瀏覽代碼

首页游戏入口显示修改

tags/2.3.0
海洋之声 6 年之前
父節點
當前提交
1c47171499
共有 1 個檔案被更改,包括 14 行新增4 行删除
  1. +14
    -4
      pages/index/index.js

+ 14
- 4
pages/index/index.js 查看文件

@@ -201,9 +201,7 @@ Page({
.then(res => { .then(res => {
app.globalData.token = res.data.token; app.globalData.token = res.data.token;
if (res.data.token){ if (res.data.token){
that.setData({
showGame: true
})

that.getGameOne(res.data.token) that.getGameOne(res.data.token)
that.getStaticGame(res.data.token) that.getStaticGame(res.data.token)
} }
@@ -264,28 +262,40 @@ Page({
token: token token: token
} }
}).then(res => { }).then(res => {
if (res.data.id) {
_this.setData({
showIf:true
})
}
_this.setData({ _this.setData({
staticGamedata: res.data staticGamedata: res.data
}) })
}) })
.catch(err => {
console.log(err)
})
}, },
getGameOne:function(token){ getGameOne:function(token){
let _this=this; let _this=this;
Http.get({ Http.get({
url: config.api.getGame, url: config.api.getGame,
data:{ data:{
triggleAction: 1,
token: token token: token
} }
}).then(res => { }).then(res => {
if (res.data.id){ if (res.data.id){
_this.setData({ _this.setData({
showIf:true
showGame: true
}) })
} }
_this.setData({ _this.setData({
gamedata:res.data gamedata:res.data
}) })
}) })
.catch(err => {
console.log(err)
})
}, },
/** /**
* banner * banner


Loading…
取消
儲存