@@ -16,6 +16,7 @@ Page({ | |||||
played:false,//从游戏页面跳回首页返回true | played:false,//从游戏页面跳回首页返回true | ||||
havePlayEd: app.globalData.havePlayEd, | havePlayEd: app.globalData.havePlayEd, | ||||
staticGamedata:{}, | staticGamedata:{}, | ||||
showIf:false, | |||||
page: 1 // 刷新进入页面时已经加载了第一页数据,onReachBottom时 page++,从第2页开始加载 | page: 1 // 刷新进入页面时已经加载了第一页数据,onReachBottom时 page++,从第2页开始加载 | ||||
}, | }, | ||||
swiperChange: function(e) { | swiperChange: function(e) { | ||||
@@ -249,6 +250,11 @@ Page({ | |||||
} | } | ||||
}).then(res => { | }).then(res => { | ||||
console.log(res.data,77777) | console.log(res.data,77777) | ||||
if (res.data.id){ | |||||
_this.setData({ | |||||
showIf:true | |||||
}) | |||||
} | |||||
_this.setData({ | _this.setData({ | ||||
gamedata:res.data | gamedata:res.data | ||||
}) | }) | ||||
@@ -3,7 +3,7 @@ | |||||
<c-banner wx:key="unique" list="{{list}}" /> | <c-banner wx:key="unique" list="{{list}}" /> | ||||
<c-rushToBuy /> | <c-rushToBuy /> | ||||
<!-- 小游戏暂时注释 --> | <!-- 小游戏暂时注释 --> | ||||
<view class='game' bindtap="gotogame"> | |||||
<view class='game' bindtap="gotogame" wx-if="{{showIf}}"> | |||||
<view class='game-entry'> | <view class='game-entry'> | ||||
<image src="{{staticGamedata.imgUrl}}" class='gameimg' mode='widthFix'></image> | <image src="{{staticGamedata.imgUrl}}" class='gameimg' mode='widthFix'></image> | ||||
<text>新用户专享神秘礼物</text> | <text>新用户专享神秘礼物</text> | ||||
@@ -13,7 +13,9 @@ Page({ | |||||
orderId: null, | orderId: null, | ||||
//存储计时器 | //存储计时器 | ||||
setInter: null, | setInter: null, | ||||
mystatus: null | |||||
mystatus: null, | |||||
staticGamedata:{}, | |||||
showIf:false | |||||
}, | }, | ||||
@@ -74,7 +76,7 @@ Page({ | |||||
that.setData({ | that.setData({ | ||||
order: res.data | order: res.data | ||||
}); | }); | ||||
that.getStaticGame() | |||||
//createDate 创建时间 | //createDate 创建时间 | ||||
var createDate = util.formatTime(res.data.createDate, "yyyy-MM-dd hh:mm:ss"); | var createDate = util.formatTime(res.data.createDate, "yyyy-MM-dd hh:mm:ss"); | ||||
console.log(createDate); | console.log(createDate); | ||||
@@ -83,7 +85,32 @@ 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, | |||||
token: token | |||||
} | |||||
}).then(res => { | |||||
if (res.data.id){ | |||||
_this.setData({ | |||||
showIf:true | |||||
}) | |||||
} | |||||
_this.setData({ | |||||
staticGamedata: res.data | |||||
}) | |||||
}) | |||||
}, | |||||
/** | /** | ||||
* 发起支付 | * 发起支付 | ||||
*/ | */ | ||||
@@ -69,4 +69,11 @@ | |||||
<view wx:if="{{order.orderStatus==0}}" class="buy-view app-border-top"> | <view wx:if="{{order.orderStatus==0}}" class="buy-view app-border-top"> | ||||
<button bindtap='orderFunc' hover-class='active' data-couponChannelId="{{order.id}}" class='buy'>立即支付</button> | <button bindtap='orderFunc' hover-class='active' data-couponChannelId="{{order.id}}" class='buy'>立即支付</button> | ||||
</view> | </view> | ||||
<view class='game' bindtap="gotogame" wx-if="{{showIf}}"> | |||||
<view class='game-entry'> | |||||
<image src="{{staticGamedata.imgUrl}}" class='gameimg' mode='widthFix'></image> | |||||
<text>新用户专享神秘礼物</text> | |||||
<text>独家福利,抢完即止</text> | |||||
</view> | |||||
</view> | |||||
</view> | </view> |
@@ -378,4 +378,48 @@ radio { | |||||
} | } | ||||
.active{ | .active{ | ||||
opacity: .6; | opacity: .6; | ||||
} | |||||
/* 游戏入口样式修改 */ | |||||
.game-entry{ | |||||
width: 690rpx; | |||||
height: 140rpx; | |||||
margin: 0 auto; | |||||
border-radius: 14rpx; | |||||
box-shadow: 1px 4px 20px #C4C4C4; | |||||
} | |||||
.game { | |||||
position: relative; | |||||
width: 750rpx; | |||||
height: 200rpx; | |||||
margin: 0 auto; | |||||
padding-top: 30rpx; | |||||
margin-top: 50rpx; | |||||
box-sizing: border-box; | |||||
} | |||||
.gameimg{ | |||||
position: absolute; | |||||
right: 25rpx; | |||||
top: -14rpx; | |||||
width: 250rpx; | |||||
} | |||||
.game text { | |||||
display: block; | |||||
position: relative; | |||||
} | |||||
.game text:nth-of-type(1) { | |||||
display: inline-block; | |||||
padding-top: 39rpx; | |||||
padding-left: 70rpx; | |||||
font-size: 32rpx; | |||||
color: #333; | |||||
line-height: 36rpx; | |||||
} | |||||
.game text:nth-of-type(2) { | |||||
font-size: 24rpx; | |||||
color: #999; | |||||
line-height: 24rpx; | |||||
padding-left: 70rpx; | |||||
} | } |