Quellcode durchsuchen

新增核销页面小游戏入口

tags/2.2.8
海洋之声 vor 6 Jahren
Ursprung
Commit
ef86d5a223
4 geänderte Dateien mit 84 neuen und 6 gelöschten Zeilen
  1. +31
    -4
      pages/couponorder/detail/index.js
  2. +7
    -0
      pages/couponorder/detail/index.wxml
  3. +45
    -0
      pages/couponorder/detail/index.wxss
  4. +1
    -2
      pages/order/detail/index.js

+ 31
- 4
pages/couponorder/detail/index.js Datei anzeigen

@@ -11,7 +11,9 @@ Page({
expiredTime: "", expiredTime: "",
updateDate: "", updateDate: "",
//存储计时器 //存储计时器
setInter: ""
setInter: "",
staticGamedata: {},
showIf:false
}, },
onUnload: function() { onUnload: function() {
let that = this; let that = this;
@@ -20,6 +22,31 @@ Page({
value: that.data.sight, value: that.data.sight,
}) })
}, },
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
})
})
},
onLoad: function(options) { onLoad: function(options) {
let that = this; let that = this;
console.log(options.sight); console.log(options.sight);
@@ -38,9 +65,7 @@ Page({
//获得优惠券的详情 //获得优惠券的详情
that.data.setInter = setInterval(function() { that.data.setInter = setInterval(function() {
if ( if (
options.quancode != null &&
options.quancode != "" &&
options.quancode != undefined &&
options.quancode &&
that.data.couponorderstatus == 0 that.data.couponorderstatus == 0
) { ) {
Http.get({ Http.get({
@@ -58,6 +83,8 @@ Page({
/** /**
* 动态改变上一级页面的核销状态 * 动态改变上一级页面的核销状态
*/ */

that.getStaticGame()
var pages = getCurrentPages(); var pages = getCurrentPages();
var prevPage = pages[pages.length - 2]; //上一个页面 var prevPage = pages[pages.length - 2]; //上一个页面
//直接调用上一个页面的setData()方法,把数据存到上一个页面中去 //直接调用上一个页面的setData()方法,把数据存到上一个页面中去


+ 7
- 0
pages/couponorder/detail/index.wxml Datei anzeigen

@@ -88,4 +88,11 @@
<text><text class='spot'></text>{{data.remark}}</text> <text><text class='spot'></text>{{data.remark}}</text>
</view> </view>
</view> </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>

+ 45
- 0
pages/couponorder/detail/index.wxss Datei anzeigen

@@ -352,3 +352,48 @@ page {
letter-spacing: 0; letter-spacing: 0;
text-align: right; text-align: right;
} }

/* 小游戏入口
*/
.game-entry{
width: 690rpx;
height: 140rpx;
margin: 0 auto;
border-radius: 14rpx;
box-shadow: 1px 4px 20px #C4C4C4;
background: #fff;
}
.game {
position: relative;
width: 750rpx;
height: 200rpx;
margin: 0 auto;
padding-top: 30rpx;
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;
}

+ 1
- 2
pages/order/detail/index.js Datei anzeigen

@@ -97,8 +97,7 @@ Page({
Http.get({ Http.get({
url: config.api.getGame, url: config.api.getGame,
data: { data: {
triggleAction: 3,
token: token
triggleAction: 3
} }
}).then(res => { }).then(res => {
if (res.data.id){ if (res.data.id){


Laden…
Abbrechen
Speichern