const Http = require("../../utils/HttpBasics"); const config = require("../../config/config"); let app = getApp(); Page({ /** * 页面的初始数据 */ data: { src:'./../../../assets/img/grade.png' }, /** * 生命周期函数--监听页面加载 */ onLoad: function(options) { }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function() { }, /** * 生命周期函数--监听页面显示 */ onShow: function() { let that = this; Http.get({ url: config.api.scoreLevelInfo, data: { appId: config.weapp.AppId, } }) .then(res=>{ // if true 则开启特享礼遇 if (res.data.discountEnable) { that.setData({ discountEnable: true }) } else { that.setData({ discountEnable: false }) } that.setData({ flags: 'have', rules: JSON.parse(res.data.score.rules).concat(JSON.parse(res.data.score.rules)[1].childs), levelList: res.data.levelList }) }) .catch(res=>{ that.setData({ flags: 'nothave' }) }) }, // 点击跳转到我的特享优惠 gotospecialcourtesy:function(){ wx.navigateTo({ url: '/pages/specialcourtesy/specialcourtesy', }) } })