Browse Source

购买页面游戏入口修改

tags/2.2.8
海洋之声 6 years ago
parent
commit
265fce1761
5 changed files with 88 additions and 4 deletions
  1. +6
    -0
      pages/index/index.js
  2. +1
    -1
      pages/index/index.wxml
  3. +30
    -3
      pages/order/detail/index.js
  4. +7
    -0
      pages/order/detail/index.wxml
  5. +44
    -0
      pages/order/detail/index.wxss

+ 6
- 0
pages/index/index.js View File

@@ -16,6 +16,7 @@ Page({
played:false,//从游戏页面跳回首页返回true
havePlayEd: app.globalData.havePlayEd,
staticGamedata:{},
showIf:false,
page: 1 // 刷新进入页面时已经加载了第一页数据,onReachBottom时 page++,从第2页开始加载
},
swiperChange: function(e) {
@@ -249,6 +250,11 @@ Page({
}
}).then(res => {
console.log(res.data,77777)
if (res.data.id){
_this.setData({
showIf:true
})
}
_this.setData({
gamedata:res.data
})


+ 1
- 1
pages/index/index.wxml View File

@@ -3,7 +3,7 @@
<c-banner wx:key="unique" list="{{list}}" />
<c-rushToBuy />
<!-- 小游戏暂时注释 -->
<view class='game' bindtap="gotogame">
<view class='game' bindtap="gotogame" wx-if="{{showIf}}">
<view class='game-entry'>
<image src="{{staticGamedata.imgUrl}}" class='gameimg' mode='widthFix'></image>
<text>新用户专享神秘礼物</text>


+ 30
- 3
pages/order/detail/index.js View File

@@ -13,7 +13,9 @@ Page({
orderId: null,
//存储计时器
setInter: null,
mystatus: null
mystatus: null,
staticGamedata:{},
showIf:false
},


@@ -74,7 +76,7 @@ Page({
that.setData({
order: res.data
});
that.getStaticGame()
//createDate 创建时间
var createDate = util.formatTime(res.data.createDate, "yyyy-MM-dd hh:mm:ss");
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
})
})
},
/**
* 发起支付
*/


+ 7
- 0
pages/order/detail/index.wxml View File

@@ -69,4 +69,11 @@
<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>
</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>

+ 44
- 0
pages/order/detail/index.wxss View File

@@ -378,4 +378,48 @@ radio {
}
.active{
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;
}

Loading…
Cancel
Save