@@ -36,7 +36,8 @@ Page({ | |||
opacity:0, | |||
queueData:null, | |||
zIndex:11, | |||
display:null | |||
display:null, | |||
showbutton:false | |||
}, | |||
phone: function () { | |||
let that = this; | |||
@@ -111,7 +112,8 @@ Page({ | |||
gotopay: function () { | |||
let that = this; | |||
that.setData({ | |||
queueData: null | |||
queueData: null, | |||
showbutton:true | |||
}) | |||
Http.get({ | |||
url: config.api.getQuestion, | |||
@@ -150,7 +152,6 @@ Page({ | |||
}) | |||
}, | |||
countdown(end_time) { | |||
let that = this; | |||
var EndTime = end_time; | |||
@@ -273,15 +274,14 @@ Page({ | |||
} | |||
}) | |||
.then(res => { | |||
wx.hideLoading() | |||
console.log(res); | |||
if (!type) { | |||
setTimeout(() => { | |||
wx.navigateTo({ | |||
url: `/pages/order/detail/index?orderId=${ | |||
orderId | |||
}` | |||
}); | |||
}, 1000) | |||
wx.navigateTo({ | |||
url: `/pages/order/detail/index?orderId=${ | |||
orderId | |||
}` | |||
}); | |||
} | |||
}) | |||
.catch(err => { | |||
@@ -298,9 +298,9 @@ Page({ | |||
*/ | |||
orderFunc(flag) { | |||
var that = this; | |||
wx.showLoading({ | |||
title: "加载中..." | |||
}); | |||
// wx.showLoading({ | |||
// title: "加载中..." | |||
// }); | |||
if (that.data.data.type == 6) {} else { | |||
Http.post({ | |||
url: config.api.checkPhoneStatus, | |||
@@ -426,7 +426,6 @@ Page({ | |||
orderId: orderId | |||
} | |||
}).then(res => { | |||
/// Begin payment ---- | |||
var payOrderId = "" + res.data.payOrderId; | |||
wx.hideLoading(); | |||
wx.requestPayment({ | |||
@@ -436,6 +435,12 @@ Page({ | |||
signType: (res.data.signType) ? res.data.signType : "MD5", | |||
paySign: res.data.paySign, | |||
success: res => { | |||
wx.showLoading({ | |||
title: '订单正在处理中...', | |||
}) | |||
setTimeout(function(){ | |||
wx.hideLoading() | |||
},5000) | |||
that.payOrderUpdate(that.data.orderId, payOrderId, 1, '', '', that); | |||
if (res.errMsg == "requestPayment:ok") { | |||
setTimeout(function () { | |||
@@ -462,6 +467,9 @@ Page({ | |||
* 支付失败,需要更新订单的状态 | |||
*/ | |||
that.payOrderUpdate(that.data.orderId, payOrderId, 2, '', 'fail', that); | |||
that.setData({ | |||
showbutton: false | |||
}) | |||
return; | |||
}, | |||
complete: res => {} | |||
@@ -483,13 +491,13 @@ Page({ | |||
key: 'couponNum', | |||
data: "couponNum" | |||
}) | |||
setTimeout(function () { | |||
wx.navigateTo({ | |||
url: `/pages/order/detail/index?orderId=${ | |||
that.data.orderId | |||
}` | |||
}); | |||
}, 1000) | |||
wx.navigateTo({ | |||
url: `/pages/order/detail/index?orderId=${ | |||
that.data.orderId | |||
}` | |||
}); | |||
// setTimeout(function () { | |||
// }, 1000) | |||
// if (that.data.data.type == 5) { | |||
// setTimeout(() => { | |||
// wx.switchTab({ | |||
@@ -510,6 +518,11 @@ Page({ | |||
}) | |||
} | |||
}, | |||
onShow(){ | |||
this.setData({ | |||
showbutton:false | |||
}) | |||
}, | |||
onShareAppMessage: function (options) { | |||
var that = this; | |||
var shareObj = { | |||
@@ -79,15 +79,18 @@ | |||
</view> | |||
</view> | |||
</view> | |||
<view class="buy-view app-border-top" style="position:fixed;z-index:{{zIndex}};"> | |||
<button bindtap='gotopay' hover-class='active' class='buy' wx:if="{{data.salePriceStr!=0&&data.remainInventory!=0&&endtime!='活动已结束'}}"> | |||
<button bindtap='gotopay' disabled='{{showbutton}}' hover-class='active' class='buy' wx:if="{{data.salePriceStr!=0&&data.remainInventory!=0&&endtime!='活动已结束'}}"> | |||
<text class='txt'>{{data.salePriceStr}}元</text>马上购买</button> | |||
<button bindtap='gotopay' class='buy' wx:if="{{data.salePriceStr==0&&data.remainInventory!=0&&endtime!='活动已结束'}}">免费领取</button> | |||
<button class='buy' wx:if="{{data.remainInventory==0&&endtime!='活动已结束'}}" style="background:#999;color: #fff;">已售罄</button> | |||
<button class='buy' wx:if="{{endtime=='活动已结束'}}" style="background:#999;color: #fff;">活动已结束</button> | |||
<button class='buy' wx:if="{{total_micro_second<=0}}" style="background:#999;color: #fff;">活动已结束</button> | |||
<button bindtap='gotopay' disabled='{{showbutton}}' class='buy' wx:if="{{data.salePriceStr==0&&data.remainInventory!=0&&endtime!='活动已结束'}}">免费领取</button> | |||
<button class='buy' disabled='true' wx:if="{{data.remainInventory==0&&endtime!='活动已结束'}}">已售罄</button> | |||
<button class='buy' disabled='true' wx:if="{{endtime=='活动已结束'}}">活动已结束</button> | |||
<button class='buy' disabled='true' wx:if="{{total_micro_second<=0}}">活动已结束</button> | |||
</view> | |||
</view> | |||
<!-- 问卷调查 --> | |||
<view class="b1" style="opacity:{{opacity}};display: {{display}}" animation="{{queueData}}"> | |||
<view id='con' class='con'> | |||
@@ -136,6 +136,12 @@ Page({ | |||
signType: (res.data.signType) ? res.data.signType : "MD5", | |||
paySign: res.data.paySign, | |||
success: res => { | |||
wx.showLoading({ | |||
title: '订单正在处理中...', | |||
}) | |||
setTimeout(function () { | |||
wx.hideLoading() | |||
}, 5000) | |||
that.payOrderUpdate(that.data.orderId, payOrderId, 1,'','',that); // 支付成功 | |||
}, | |||
fail: res => { | |||
@@ -170,6 +176,7 @@ Page({ | |||
} | |||
}) | |||
.then(res => { | |||
wx.hideLoading() | |||
if (!type) { | |||
wx.showToast({ | |||
title: "购买成功", | |||
@@ -70,7 +70,7 @@ | |||
<view class="margin"></view> | |||
<!-- <button bindtap="navigateTo" class="user-out-btn">退出登陆</button> --> | |||
<view bindlongtap='showVersion' class='version'> | |||
<view wx:if="{{flag=='show'}}">版本号:3.1.0</view> | |||
<view wx:if="{{flag=='show'}}">版本号:3.1.1</view> | |||
<view wx:if="{{flag=='hidden'}}"></view> | |||
</view> | |||
</view> | |||