From d08c284e6f3565de73f69ba2b98191ef68ca7fd1 Mon Sep 17 00:00:00 2001 From: zhaoyongnian <541231643@qq.com> Date: Tue, 2 Jun 2020 15:53:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 1 + pages/indexNew/indexNew.js | 2 +- subpages/home/images/ic_zhengce.png | Bin 0 -> 1313 bytes subpages/home/pages/noticeNew/noticeNew.js | 140 ++++++++++++++++++ subpages/home/pages/noticeNew/noticeNew.json | 7 + subpages/home/pages/noticeNew/noticeNew.wxml | 25 ++++ subpages/home/pages/noticeNew/noticeNew.wxss | 95 ++++++++++++ .../pages/impression/impression.js | 12 +- .../pages/impression/impression.wxml | 4 +- .../pages/impression/impression.wxss | 25 +++- 10 files changed, 305 insertions(+), 6 deletions(-) create mode 100644 subpages/home/images/ic_zhengce.png create mode 100644 subpages/home/pages/noticeNew/noticeNew.js create mode 100644 subpages/home/pages/noticeNew/noticeNew.json create mode 100644 subpages/home/pages/noticeNew/noticeNew.wxml create mode 100644 subpages/home/pages/noticeNew/noticeNew.wxss diff --git a/app.json b/app.json index 523d09a..5c7e403 100644 --- a/app.json +++ b/app.json @@ -25,6 +25,7 @@ "pages/webview/webview", "pages/agreement/agreement", "pages/notice/notice", + "pages/noticeNew/noticeNew", "pages/info/info", "pages/noticeDetail/noticeDetail", "pages/newsDetail/newsDetail", diff --git a/pages/indexNew/indexNew.js b/pages/indexNew/indexNew.js index 3312266..18805d7 100644 --- a/pages/indexNew/indexNew.js +++ b/pages/indexNew/indexNew.js @@ -363,7 +363,7 @@ Page({ // 点击-更多,跳转通知列表 moreNotice() { wx.navigateTo({ - url: '/subpages/home/pages/notice/notice' + url: '/subpages/home/pages/noticeNew/noticeNew' }) // wx.miniProgram.navigateTo({ url: '/pages/detail/detail?weburl=' + encodeURIComponent(global.baseURL + 'notice?departmentName=' + sessionStorage.getItem('departmentName')) }) }, diff --git a/subpages/home/images/ic_zhengce.png b/subpages/home/images/ic_zhengce.png new file mode 100644 index 0000000000000000000000000000000000000000..26eb97da2f823c79548fa96e199afe4647d7eda7 GIT binary patch literal 1313 zcmV++1>X9JP)Ws7_K-wG zNMIn8M22Ayk|1pC-h1wjuA52{v57%G#1b3Z%st<@v9pZp%yjSUy*oRD2j*#hzu)5vzLL#mkLUCG3ytb)3F!NN z3BY~;4+9|PNbQj(SF_j^%d!p@i^Z1~8Z=d`wcZTi`%b8Bw@v`>DW&$*`!@tEm&>by zAh--59FkpA!Vwk(fhd(qeob^kK&|yo03US?S)EX0%*UltX=h77*L6=a^OkM|Wajfi zh}{46U>QKZX8}FWJ4ZzGtu#Qdo$WyYzc8~yM0cezw>vfm z!&J|4oCB*@uYPTMdfKj5tNV#)chZoZ1iYY>>aPd#Jnsi0+K?n<#{h#M$PEn*ov(*+ zU3Z;jSw91~B`L^G0UnT2-jL~sP_FAfO+=q0wNqJgKmZq|l>N+%X1(P5{x?AoY)b-i zsR5^$dAksz+-e9;OiZkunVFfiZTt4c4%MXqoD72C^vabhPcZZ8TrT%l6w#jNNoL+X zmjlnIT2Xwj+yAAMs$FB|FNo-9u~rw6N?a~GWfP0lvm)j9n^YJ|Ic_M0ST}>M>=e8tR1`}+DW&Cbql zwJhs1BFZdRz);ukM0D%iFOJTuM6@oB!$RA%=ip+rCE|M%Fl@$~w@Zl(rgVZZ^G`yE z`)kpgy|U=q`#~b|q?D?c0S`$jpX+77%~HzwV~(C0q5!^BN1o} zB^=ww0E7<)tnfK;ylT?54)ui3tXHg9F*Q9seYk#q*${AKWTZcv&4#DS=_*S&x-tLV zyB;c)O05_A(8}|?H;8Co!Wxz$+*K*%`j(kY?N8tL_ZnkfZDZrQ6d=v&I4q^yQTy{> X1uX<-7TyWn00000NkvXXu0mjfPZV#i literal 0 HcmV?d00001 diff --git a/subpages/home/pages/noticeNew/noticeNew.js b/subpages/home/pages/noticeNew/noticeNew.js new file mode 100644 index 0000000..def5922 --- /dev/null +++ b/subpages/home/pages/noticeNew/noticeNew.js @@ -0,0 +1,140 @@ +// subpages/home/pages/noticeNew/noticeNew.js +const api = require('../../../../utils/understandJs') +Page({ + + /** + * 页面的初始数据 + */ + data: { + pageIndex: 1, + pageSize: 10, + noticeCategory: '5',//模块编码(1-印象,2-味道,5-政策导航最新,6-政策导航最热) + noticelist: [], + selectTab: 'tab1', + nodata: false, + loadMoreType: 'none', + loadMoreVisible: false, + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.noticelist(); + }, + + // 加载网格长管辖的网格列表 + noticelist() { + let that = this + let params = { + pageIndex: that.data.pageIndex, + pageSize: that.data.pageSize, + noticeCategory: that.data.noticeCategory + } + + api.noticelist(params).then(res => { + that.setData({ + noticelist: that.data.noticelist.concat(res.data), + loadMoreType: res.data.length === that.data.pageSize ? 'loading' : 'none', + loadMoreVisible: res.data.length === that.data.pageSize ? false : true + }) + if (that.data.noticelist.length == 0) {//没有值 + that.setData({ + nodata: true, + loadMoreType: 'none', + loadMoreVisible: false, + }) + } + }).catch(err => { + that.setData({ + noticelist: [], + nodata: true, + loadMoreType: 'none', + loadMoreVisible: false, + }) + console.log(err) + }) + }, + + // tab 切换 + onTabChange(e) { + if (e.currentTarget.dataset.tab == 'tab1') {//最新政策 + this.setData({//模块编码(1-印象,2-味道,5-政策导航最新,6-政策导航最热) + noticeCategory: '5', + }) + } else {//最新通知 + this.setData({ + noticeCategory: '6', + }) + } + this.setData({ + selectTab: e.currentTarget.dataset.tab, + noticelist: [], + loadMoreType: 'loading', + loadMoreVisible: true, + }) + + this.noticelist(); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + this.setData({ + loadMoreVisible: true + }) + if (this.data.loadMoreType === 'loading') { + this.setData({ + pageIndex: this.data.pageIndex + 1, + pageSize: this.data.pageSize, + }) + this.deptinfolist(); + } + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + toDetail(e) { + console.log(e.currentTarget.dataset.id) + wx.navigateTo({ url: '/subpages/home/pages/noticeDetail/noticeDetail?id=' + e.currentTarget.dataset.id }) + } +}) \ No newline at end of file diff --git a/subpages/home/pages/noticeNew/noticeNew.json b/subpages/home/pages/noticeNew/noticeNew.json new file mode 100644 index 0000000..97c5fb1 --- /dev/null +++ b/subpages/home/pages/noticeNew/noticeNew.json @@ -0,0 +1,7 @@ +{ + "usingComponents": { + "load-more": "../../../../components/loadMore/loadMore", + "no-data":"../../../../components/nodata/nodata" + }, + "navigationBarTitleText": "政策导航" +} \ No newline at end of file diff --git a/subpages/home/pages/noticeNew/noticeNew.wxml b/subpages/home/pages/noticeNew/noticeNew.wxml new file mode 100644 index 0000000..30c7c3b --- /dev/null +++ b/subpages/home/pages/noticeNew/noticeNew.wxml @@ -0,0 +1,25 @@ + + + 最新政策 + + 最新通知 + + + + + + + {{item.noticeTitle}} + + + {{item.deptName}} + {{item.noticeTime}} + + + + + + + + \ No newline at end of file diff --git a/subpages/home/pages/noticeNew/noticeNew.wxss b/subpages/home/pages/noticeNew/noticeNew.wxss new file mode 100644 index 0000000..23ab170 --- /dev/null +++ b/subpages/home/pages/noticeNew/noticeNew.wxss @@ -0,0 +1,95 @@ +page { + background: #f7f7f7; +} + +.tab-bar { + width: 100%; + height: 80rpx; + background: #fff; + display: flex; + justify-content: space-around; + position: relative; +} + +.tab-bar .tab { + flex: 1; + height: 80rpx; + line-height: 80rpx; + text-align: center; + width: 50%; + font-size: 32rpx; + font-weight: 500; + color: rgba(153, 153, 153, 1); +} + +.tab-bar .select-tab { + color: #b20004; + font-size: 32rpx; + font-weight: bold; +} + +.tab-bar .select-bar { + width: 40rpx; + height: 8rpx; + border-radius: 5rpx; + background: #b20004; + position: absolute; + bottom: 0rpx; +} + +.tab-bar .select-bar.tab1 { + left: calc(25% - 15rpx); + transition: left linear 0.4s; +} + +.tab-bar .select-bar.tab2 { + left: calc(75% - 15rpx); + transition: left linear 0.4s; +} + +/* 列表样式 */ +.list-lu .list-li:first-child { + margin-top: 27rpx; +} + +.list-li { + width: 100%; + background: #fff; + padding: 38rpx 30rpx; + margin-top: 16rpx; +} + +.list-li .item-name { + width: calc(100% - 60rpx); + font-size: 34rpx; + font-weight: 500; + color: rgba(51, 51, 51, 1); + line-height: 52rpx; +} + +.list-li .item-info { + width: calc(100% - 60rpx); + height: 28rpx; + margin-top: 30rpx; + display: flex; + align-items: center; +} + +.list-li .item-info image { + width: 28rpx; + height: 28rpx; +} + +.list-li .item-info .street { + margin-left: 11rpx; + font-size: 24rpx; + font-weight: 500; + color: rgba(153, 153, 153, 1); +} + +.list-li .item-info .time { + margin-left: 22rpx; + font-size: 24rpx; + font-weight: 500; + color: rgba(153, 153, 153, 1); +} \ No newline at end of file diff --git a/subpages/understandJs/pages/impression/impression.js b/subpages/understandJs/pages/impression/impression.js index bb336db..06f7e50 100644 --- a/subpages/understandJs/pages/impression/impression.js +++ b/subpages/understandJs/pages/impression/impression.js @@ -13,6 +13,7 @@ Page({ loadMoreType: 'none', loadMoreVisible: false, noticeCategory: '1',//模块编码(0-政策导航,1-印象,2-味道) + noticeContentNew:'', }, /** @@ -29,9 +30,16 @@ Page({ noticeCategory: that.data.noticeCategory } api.noticelist(params).then(function (res) { //了解锦水-模块管理接口 - console.log(JSON.stringify(res)) + let noticelistObj = {} + let noticelistItem = [] + for(var i = 0; i < res.data.length; i++){ + noticelistObj= res.data[i] + noticelistObj.noticeContentNew = res.data[i].noticeContent.replace(/ {{item.noticeTitle}} - 我们城市建设在转变城市功能的同时,更加关注于群众的生活质量的提升,给予百姓以更多的关心和方便我们城市建设在转变城市功能的同时,更加关注于群众的生活质量的提升,给予百姓以更多的关心和方便 + + + diff --git a/subpages/understandJs/pages/impression/impression.wxss b/subpages/understandJs/pages/impression/impression.wxss index 14e486a..860c0ed 100644 --- a/subpages/understandJs/pages/impression/impression.wxss +++ b/subpages/understandJs/pages/impression/impression.wxss @@ -7,10 +7,11 @@ page { padding: 40rpx 28rpx; margin-top: 16rpx; background: #fff; + box-sizing: border-box; } .list-item .name { - width: calc(100% - 56rpx); + /* width: calc(100% - 56rpx); */ font-size: 34rpx; font-weight: 500; color: rgba(51, 51, 51, 1); @@ -18,7 +19,7 @@ page { } .list-item .info { - margin-top: 15rpx; + /* margin-top: 15rpx; width: calc(100% - 56rpx); font-size: 28rpx; font-weight: 500; @@ -27,5 +28,25 @@ page { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; + overflow: hidden; */ + + margin-top: 15rpx; + /* width: calc(100% - 56rpx); */ + height: 75rpx; + font-size: 28rpx; + font-family: PingFang SC; + font-weight: 500; + color: rgba(153, 153, 153, 1); +} + +.list-item .info rich-text { + /* width:100%; */ + line-height: 44rpx; + display: -webkit-box; overflow: hidden; + text-overflow: ellipsis; + word-wrap: break-word; + white-space: normal !important; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; } \ No newline at end of file