From 1c47171499c45dc5d0dd661eba0711f50692488e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=B7=E6=B4=8B=E4=B9=8B=E5=A3=B0?= Date: Tue, 6 Nov 2018 14:06:56 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E6=B8=B8=E6=88=8F=E5=85=A5?= =?UTF-8?q?=E5=8F=A3=E6=98=BE=E7=A4=BA=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/index.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) 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