From c6c8afee962c0a47b7f7e0333b87acd35fbebdd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=B7=E6=B4=8B=E4=B9=8B=E5=A3=B0?= Date: Mon, 5 Nov 2018 10:36:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=B8=B8=E6=88=8F=E5=85=A5=E5=8F=A3=E6=89=BE=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/order/detail/index.js | 39 +++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/pages/order/detail/index.js b/pages/order/detail/index.js index 1bca080..1d925ac 100644 --- a/pages/order/detail/index.js +++ b/pages/order/detail/index.js @@ -13,7 +13,9 @@ Page({ orderId: null, //存储计时器 setInter: "", - mystatus: '' + mystatus: '', + staticGamedata: {}, + showIf: false }, @@ -46,6 +48,39 @@ Page({ }); } }, + gotogame: function () { + let that = this; + wx.navigateTo({ + url: '/pages/game/index?url=' + that.data.staticGamedata.url + "&id=" + that.data.staticGamedata.id + "&gameId=" + that.data.staticGamedata.gameId, + }) + }, + // 获取游戏 + getStaticGame(token) { + let _this = this; + Http.get({ + url: config.api.getGame, + data: { + triggleAction: 3 + } + }).then(res => { + if (res.data.id) { + _this.setData({ + showIf: true + }) + } + _this.setData({ + staticGamedata: res.data + }) + }) + .catch(err => { + wx.showToast({ + title: err.errMsg, + icon: 'none', + duration: 2000, + mask: false + }); + }) + }, /** * 生命周期函数--监听页面加载 */ @@ -69,7 +104,7 @@ Page({ that.setData({ order: res.data }); - + that.getStaticGame() //createDate 创建时间 var createDate = util.formatTime(res.data.createDate, "yyyy-MM-dd hh:mm:ss"); that.setData({