Browse Source

配置接口获取详情id

integral
zhaoyongnian 5 years ago
parent
commit
8006445999
  1. 31
      epdc-resident-mp-yushan/subpages/integralCentre/pages/index/index.js

31
epdc-resident-mp-yushan/subpages/integralCentre/pages/index/index.js

@ -3,6 +3,7 @@ import {
userPointsRankinglist, userPointsRankinglist,
gradeRankinglist gradeRankinglist
} from "../../../../utils/integralCentre" } from "../../../../utils/integralCentre"
const api = require('../../../../utils/home')
import { import {
getTimestamp getTimestamp
} from "../../../../utils/common" } from "../../../../utils/common"
@ -42,7 +43,9 @@ Page({
dj_n:'../../images/t-dj-no.png', dj_n:'../../images/t-dj-no.png',
timestamp: getTimestamp(), timestamp: getTimestamp(),
loadMoreType: "loading", loadMoreType: "loading",
loadMoreVisible: true loadMoreVisible: true,
noticePointsRule:'', // 规则
noticePointsGoods:'' // 兑换福利id
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
@ -52,6 +55,7 @@ Page({
points: options.points points: options.points
}) })
this.pointsRankinglist(); //初始化加载积分记录列表 this.pointsRankinglist(); //初始化加载积分记录列表
this.getResidentConfig(); //配置接口(通用)获取积分规则 兑换福利的详情id
}, },
// 排行切换 // 排行切换
onButtonChange: function (e) { onButtonChange: function (e) {
@ -186,6 +190,27 @@ Page({
console.log(err) console.log(err)
}) })
}, },
// 获取默认配置, 阅读时间, 获取默认网格
getResidentConfig (){
let that = this
api.getResidentConfig().then(res => {
if (res.code === 0 && res.msg === "success") {
res.data.forEach(item => {
if (item.residentCode === "notice_points_rule") { // 积分规则
that.setData({
noticePointsRule:item.residentValue
})
} else if(item.residentCode === "notice_points_goods"){ // 兑换福利
that.setData({
noticePointsGoods:item.residentValue
})
}
})
}
}).catch(err => {
console.log(err)
})
},
bindtapRecord () { bindtapRecord () {
wx.navigateTo({ wx.navigateTo({
url: `/subpages/integralCentre/pages/record/record?points=${this.data.points}` url: `/subpages/integralCentre/pages/record/record?points=${this.data.points}`
@ -193,12 +218,12 @@ Page({
}, },
bindtapIntegralGoods () { bindtapIntegralGoods () {
wx.navigateTo({ wx.navigateTo({
url: `/subpages/integralCentre/pages/noticeDetail/noticeDetail?modulecode=notice_points_goods` url: `/subpages/integralCentre/pages/noticeDetail/noticeDetail?modulecode=notice_points_goods&residentValue=${this.data.noticePointsGoods}`
}) })
}, },
bindtapIntegralRule () { bindtapIntegralRule () {
wx.navigateTo({ wx.navigateTo({
url: `/subpages/integralCentre/pages/noticeDetail/noticeDetail?modulecode=notice_points_rule` url: `/subpages/integralCentre/pages/noticeDetail/noticeDetail?modulecode=notice_points_rule&residentValue=${this.data.noticePointsRule}`
}) })
}, },
/** /**

Loading…
Cancel
Save