Browse Source

优化

master
zhaoyongnian 5 years ago
parent
commit
8c4a427b98
  1. 9
      subpages/integralCentre/pages/index/index.js
  2. 5
      subpages/integralCentre/pages/index/index.wxml
  3. 9
      subpages/integralCentre/pages/index/index.wxss
  4. 7
      subpages/understandJs/pages/delicious/delicious.js
  5. 20
      subpages/understandJs/pages/impression/impression.js
  6. 16
      subpages/understandJs/pages/index/index.js
  7. 25
      subpages/understandJs/pages/noticeDetail/noticeDetail.js
  8. 2
      subpages/understandJs/pages/noticeDetail/noticeDetail.json
  9. 23
      utils/api.js

9
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),

5
subpages/integralCentre/pages/index/index.wxml

@ -28,7 +28,8 @@
</view>
<view class="right">{{pointsRankingUser.points}}</view>
</view>
<view class="marginTop"></view>
<view class="warning">注:该排行仅显示已完善信息用户</view>
<!-- <view class="marginTop"></view> -->
<view class="ph-list" wx:for-index="index" wx:for-item="item" wx:key="index" wx:for="{{pointsRankinglist}}">
<view class="left">
<!-- 左边图片 -->
@ -41,7 +42,7 @@
<view wx:else class="list-number_">{{item.rank}}</view>
</view>
<!-- 名字 -->
<view class="list-name">{{item.nickName}}</view>
<view class="list-name">{{item.realName}}</view>
</view>
<view class="right">{{item.points}}</view>
</view>

9
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);
}

7
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}`
})
}
})

20
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(/<img/gi, '<img style="display:none" ');
noticelistItem.push(noticelistObj)
}
console.log(JSON.stringify(noticelistItem))
that.setData({
noticelist: that.data.noticelist.concat(noticelistItem),
loadMoreType: res.data.length === that.data.pageSize ? 'loading' : 'none',
@ -120,7 +132,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}`
})
}
})

16
subpages/understandJs/pages/index/index.js

@ -72,21 +72,19 @@ Page({
},
goDetails(e) {//模块编码(0-政策导航,1-印象,2-味道,3-硬核,4-档案)
console.log(JSON.stringify(e.currentTarget.dataset) + e.currentTarget.dataset.modulecode)
if (e.currentTarget.dataset.modulecode == '0') {
} else if (e.currentTarget.dataset.modulecode == '1') {
if (e.currentTarget.dataset.modulecode == 'notice_impression' || e.currentTarget.dataset.modulecode == 'notice_warning') {//印象 //警事
wx.navigateTo({
url: '../impression/impression'
url: `../impression/impression?modulecode=${e.currentTarget.dataset.modulecode}`
})
} else if (e.currentTarget.dataset.modulecode == '2') {
} else if (e.currentTarget.dataset.modulecode == 'notice_taste') {//味道
wx.navigateTo({
url: '../delicious/delicious'
url: `../delicious/delicious?modulecode=${e.currentTarget.dataset.modulecode}`
})
} else if (e.currentTarget.dataset.modulecode == '3') {
} else if (e.currentTarget.dataset.modulecode == 'module_hardcore') {//硬核
wx.navigateTo({
url: '../sclerotia/sclerotia'
url: `../sclerotia/sclerotia?modulecode=${e.currentTarget.dataset.modulecode}`
})
} else if (e.currentTarget.dataset.modulecode == '4') {
} else if (e.currentTarget.dataset.modulecode == 'module_file') {//档案
wx.showToast({
title: '敬请期待',
icon: 'none',

25
subpages/understandJs/pages/noticeDetail/noticeDetail.js

@ -1,4 +1,5 @@
const api = require('../../../../utils/understandJs')
const api_home = require('../../../../utils/home')
import util from '../../../../utils/util'
Page({
@ -14,6 +15,20 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if (options.modulecode == 'notice_taste'){//味道
wx.setNavigationBarTitle({
title: '锦水味道'
})
} else if(options.modulecode == 'notice_impression'){
wx.setNavigationBarTitle({
title: '锦水印象'
})
} else if(options.modulecode == 'notice_warning'){
wx.setNavigationBarTitle({
title: '锦水警事'
})
}
this.browseNotice(options.id)
this.noticeDetail(options.id)
},
noticeDetail(noticeId){
@ -29,6 +44,16 @@ Page({
console.log(err)
})
},
browseNotice (id) {
let para = {
noticeId: id
}
api_home.browseNotice(para).then(res => {
}).catch(err => {
console.log(err)
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/

2
subpages/understandJs/pages/noticeDetail/noticeDetail.json

@ -1,4 +1,4 @@
{
"usingComponents": {},
"navigationBarTitleText": "详情"
"navigationBarTitleText": "锦水"
}

23
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
})
}
// *****************************爱心互助接口***************************

Loading…
Cancel
Save