diff --git a/epdc-resident-mp-yushan/subpages/integralCentre/pages/index/index.js b/epdc-resident-mp-yushan/subpages/integralCentre/pages/index/index.js index 1008676..395ae8a 100644 --- a/epdc-resident-mp-yushan/subpages/integralCentre/pages/index/index.js +++ b/epdc-resident-mp-yushan/subpages/integralCentre/pages/index/index.js @@ -3,6 +3,7 @@ import { userPointsRankinglist, gradeRankinglist } from "../../../../utils/integralCentre" +const api = require('../../../../utils/home') import { getTimestamp } from "../../../../utils/common" @@ -42,7 +43,9 @@ Page({ dj_n:'../../images/t-dj-no.png', timestamp: getTimestamp(), loadMoreType: "loading", - loadMoreVisible: true + loadMoreVisible: true, + noticePointsRule:'', // 规则 + noticePointsGoods:'' // 兑换福利id }, /** * 生命周期函数--监听页面加载 @@ -52,6 +55,7 @@ Page({ points: options.points }) this.pointsRankinglist(); //初始化加载积分记录列表 + this.getResidentConfig(); //配置接口(通用)获取积分规则 兑换福利的详情id }, // 排行切换 onButtonChange: function (e) { @@ -186,6 +190,27 @@ Page({ 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 () { wx.navigateTo({ url: `/subpages/integralCentre/pages/record/record?points=${this.data.points}` @@ -193,12 +218,12 @@ Page({ }, bindtapIntegralGoods () { 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 () { 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}` }) }, /**