HolyKnightIX před 2 roky
rodič
revize
05d483df0c
1 změnil soubory, kde provedl 22 přidání a 15 odebrání
  1. +22
    -15
      pages/grade/grade.js

+ 22
- 15
pages/grade/grade.js Zobrazit soubor

@@ -21,30 +21,37 @@ Page({
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function() {
onShow: function () {
let that = this; let that = this;
Http.get({ Http.get({
url: config.api.scoreLevelInfo, url: config.api.scoreLevelInfo,
data: {} data: {}
}) })
.then(res=>{
that.setData({
flags: 'have',
rules: JSON.parse(res.data.score.rules),
rules1: JSON.parse(res.data.score.rules)[1].childs,
levelList: res.data.levelList
.then(res => {
let childs = []
JSON.parse(res.data.score.rules).forEach(item => {
if (item.id == 2) {
childs = item.childs
}
})
that.setData({
flags: 'have',
rules: JSON.parse(res.data.score.rules),
rules1: childs || [],
levelList: res.data.levelList
})
console.log(that.data.rules)
console.log(that.data.rules1)
}) })
console.log(that.data.rules)
})
.catch(res=>{
that.setData({
flags: 'nothave'
.catch(res => {
that.setData({
flags: 'nothave'
})
}) })
})

}, },
// 点击跳转到我的特享优惠 // 点击跳转到我的特享优惠
gotospecialcourtesy:function(){
gotospecialcourtesy: function () {
wx.navigateTo({ wx.navigateTo({
url: '/pages/specialcourtesy/specialcourtesy', url: '/pages/specialcourtesy/specialcourtesy',
}) })


Načítá se…
Zrušit
Uložit