From 8c4a427b984ad27981391817c83763996e8006c7 Mon Sep 17 00:00:00 2001 From: zhaoyongnian <541231643@qq.com> Date: Thu, 4 Jun 2020 15:06:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- subpages/integralCentre/pages/index/index.js | 9 ++++--- .../integralCentre/pages/index/index.wxml | 5 ++-- .../integralCentre/pages/index/index.wxss | 9 +++++++ .../understandJs/pages/delicious/delicious.js | 7 ++++-- .../pages/impression/impression.js | 20 ++++++++++++--- subpages/understandJs/pages/index/index.js | 16 ++++++------ .../pages/noticeDetail/noticeDetail.js | 25 +++++++++++++++++++ .../pages/noticeDetail/noticeDetail.json | 2 +- utils/api.js | 23 ++++++++++++++++- 9 files changed, 93 insertions(+), 23 deletions(-) diff --git a/subpages/integralCentre/pages/index/index.js b/subpages/integralCentre/pages/index/index.js index f9d872b..0729b8e 100644 --- a/subpages/integralCentre/pages/index/index.js +++ b/subpages/integralCentre/pages/index/index.js @@ -1,7 +1,8 @@ // subpages/integralCentre/pages/index/index.js import { pointsRecordlist, - pointsRankinglist + pointsRankinglist, + userPointsRankinglist } from '../../../../utils/api' import { getTimestamp @@ -23,12 +24,12 @@ Page({ selectTab: 'tab1', typeList: [{ //排名方式:0-周,1-月 type: '0', - name: '本周排名', + name: '网络排名', select: true }, { type: '1', - name: '本月排名', + name: '街道排名', select: false } ], @@ -100,7 +101,7 @@ Page({ timestamp: this.data.timestamp, rankingType: this.data.rankingType, //排名方式:0-周,1-月 } - pointsRankinglist(para).then(res => { + userPointsRankinglist(para).then(res => { that.setData({ pointsRankingUser: res.data.currentUser, pointsRankinglist: that.data.pointsRankinglist.concat(res.data.rank), diff --git a/subpages/integralCentre/pages/index/index.wxml b/subpages/integralCentre/pages/index/index.wxml index 8c8f718..25e04e0 100644 --- a/subpages/integralCentre/pages/index/index.wxml +++ b/subpages/integralCentre/pages/index/index.wxml @@ -28,7 +28,8 @@ {{pointsRankingUser.points}} - + 注:该排行仅显示已完善信息用户 + @@ -41,7 +42,7 @@ {{item.rank}} - {{item.nickName}} + {{item.realName}} {{item.points}} diff --git a/subpages/integralCentre/pages/index/index.wxss b/subpages/integralCentre/pages/index/index.wxss index 14b2aef..1a72390 100644 --- a/subpages/integralCentre/pages/index/index.wxss +++ b/subpages/integralCentre/pages/index/index.wxss @@ -301,3 +301,12 @@ button::after { font-weight: 500; color: #b20004; } + +.warning { + padding-left: 20rpx; + height: 50rpx; + line-height: 50rpx; + font-size: 22rpx; + font-weight: 500; + color: rgba(153, 153, 153, 1); +} \ No newline at end of file diff --git a/subpages/understandJs/pages/delicious/delicious.js b/subpages/understandJs/pages/delicious/delicious.js index eaf25fc..882cd7c 100644 --- a/subpages/understandJs/pages/delicious/delicious.js +++ b/subpages/understandJs/pages/delicious/delicious.js @@ -12,13 +12,16 @@ Page({ nodata: false, loadMoreType: 'none', loadMoreVisible: false, - noticeCategory: '2',//模块编码(0-政策导航,1-印象,2-味道) + noticeCategory: '', }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { + this.setData({ + noticeCategory:options.modulecode + }) this.noticelist(); }, noticelist() { @@ -112,7 +115,7 @@ Page({ //跳转倒详情页面 toDetail(e){ wx.navigateTo({ - url: '../noticeDetail/noticeDetail?id=' + e.currentTarget.dataset.id + url: `../noticeDetail/noticeDetail?id=${e.currentTarget.dataset.id}&modulecode=${this.data.noticeCategory}` }) } }) \ No newline at end of file diff --git a/subpages/understandJs/pages/impression/impression.js b/subpages/understandJs/pages/impression/impression.js index 06f7e50..a6dea52 100644 --- a/subpages/understandJs/pages/impression/impression.js +++ b/subpages/understandJs/pages/impression/impression.js @@ -12,7 +12,7 @@ Page({ nodata: false, loadMoreType: 'none', loadMoreVisible: false, - noticeCategory: '1',//模块编码(0-政策导航,1-印象,2-味道) + noticeCategory: '',//模块编码(政策导航-最热政策:notice_navigation_hot、了解锦水-印象:notice_impression、了解锦水-味道:notice_taste、政策导航-最新通知: notice_navigation_new、了解锦水-警示:notice_warning) noticeContentNew:'', }, @@ -20,6 +20,19 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function (options) { + this.setData({ + noticeCategory:options.modulecode + }) + if(options.modulecode == 'notice_impression'){ + wx.setNavigationBarTitle({ + title: '锦水印象' + }) + }else{ + wx.setNavigationBarTitle({ + title: '锦水警事' + }) + } + this.noticelist(); }, noticelist() { @@ -27,7 +40,7 @@ Page({ let params = { pageIndex: that.data.pageIndex, pageSize: that.data.pageSize, - noticeCategory: that.data.noticeCategory + noticeCategory: that.data.noticeCategory, } api.noticelist(params).then(function (res) { //了解锦水-模块管理接口 let noticelistObj = {} @@ -37,7 +50,6 @@ Page({ noticelistObj.noticeContentNew = res.data[i].noticeContent.replace(/ { + + }).catch(err => { + console.log(err) + }) + }, /** * 生命周期函数--监听页面初次渲染完成 */ diff --git a/subpages/understandJs/pages/noticeDetail/noticeDetail.json b/subpages/understandJs/pages/noticeDetail/noticeDetail.json index 2a7aea3..b86ff26 100644 --- a/subpages/understandJs/pages/noticeDetail/noticeDetail.json +++ b/subpages/understandJs/pages/noticeDetail/noticeDetail.json @@ -1,4 +1,4 @@ { "usingComponents": {}, - "navigationBarTitleText": "详情" + "navigationBarTitleText": "锦水" } \ No newline at end of file diff --git a/utils/api.js b/utils/api.js index 7499e06..a557c0a 100644 --- a/utils/api.js +++ b/utils/api.js @@ -48,7 +48,8 @@ module.exports = { getTokenV3: getTokenV3, getWxPhone: getWxPhone, completeResidentInfoV2: completeResidentInfoV2, - completePartyInfoV2: completePartyInfoV2 + completePartyInfoV2: completePartyInfoV2, + userPointsRankinglist:userPointsRankinglist } function getToken(wxCode) { @@ -286,6 +287,26 @@ function pointsRankinglist({ rankingType }) } +/** + * 积分记录-锦水-积分排行接口 v2 排名方式发生改变 + * timestamp String 第一页查询发起时的时间 + * pageIndex Number 页码 + * pageSize Number 页容量 + * rankingType Number 排名方式:0-网格,1-街道 + */ +function userPointsRankinglist({ + timestamp, + pageIndex, + pageSize, + rankingType +}) { + return fly.get('app-user/userPointsRanking/list', { + timestamp, + pageIndex, + pageSize, + rankingType + }) +} // *****************************爱心互助接口***************************