diff --git a/pages/index/index.js b/pages/index/index.js index d54753a..9acb5a0 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -201,9 +201,7 @@ Page({ .then(res => { app.globalData.token = res.data.token; if (res.data.token){ - that.setData({ - showGame: true - }) + that.getGameOne(res.data.token) that.getStaticGame(res.data.token) } @@ -264,28 +262,40 @@ Page({ token: token } }).then(res => { + if (res.data.id) { + _this.setData({ + showIf:true + }) + } _this.setData({ staticGamedata: res.data }) }) + .catch(err => { + console.log(err) + }) }, getGameOne:function(token){ let _this=this; Http.get({ url: config.api.getGame, data:{ + triggleAction: 1, token: token } }).then(res => { if (res.data.id){ _this.setData({ - showIf:true + showGame: true }) } _this.setData({ gamedata:res.data }) }) + .catch(err => { + console.log(err) + }) }, /** * banner