|
|
@@ -127,18 +127,6 @@
|
|
|
|
|
|
this.getActivitySetting();
|
|
|
},
|
|
|
- onShow() {
|
|
|
- let that = this
|
|
|
- uni.$on('updateData',function(payStatus){
|
|
|
- that.payStatus = payStatus;
|
|
|
- that.voteSuccess();
|
|
|
- console.log('作品投票监听到事件来自 updateData,携带参数为:' + payStatus);
|
|
|
- })
|
|
|
- },
|
|
|
- onUnload() {
|
|
|
- //移除监听事件
|
|
|
- uni.$off('updateData')
|
|
|
- },
|
|
|
computed: {
|
|
|
content() {
|
|
|
return decodeURIComponent(this.activity.content)
|
|
|
@@ -200,8 +188,7 @@
|
|
|
},
|
|
|
//活动设置
|
|
|
activitySetting: {},
|
|
|
- //支付状态
|
|
|
- payStatus: ''
|
|
|
+ interval: '',
|
|
|
}
|
|
|
},
|
|
|
onShareAppMessage(res) {
|
|
|
@@ -414,16 +401,29 @@
|
|
|
}
|
|
|
let res = await this.$api.order.cashExchange(params)
|
|
|
if (res.data.success) {
|
|
|
- this.payStatus = ''; //创建新订单,清空订单状态
|
|
|
// uni.navigateTo({
|
|
|
// url: `/pages/webview/payOrder?url=${res.data.data.qrCodeUrl}&orderId=${res.data.data.id}`
|
|
|
// })
|
|
|
+ this.queryOrder(res.data.data.id)
|
|
|
window.location.href = res.data.data.qrCodeUrl
|
|
|
} else {
|
|
|
this.$refs.toast.error(res.data.msg)
|
|
|
}
|
|
|
this.$refs.votePopup.hideVote();
|
|
|
},
|
|
|
+ //查询订单状态
|
|
|
+ queryOrder(orderId){
|
|
|
+ let params = {
|
|
|
+ id: orderId
|
|
|
+ }
|
|
|
+ this.interval = setInterval(() => {
|
|
|
+ let res = this.$api.order.orderDetail(params)
|
|
|
+ if(res.data.success && res.data.data.payStatus === '付款成功'){
|
|
|
+ this.voteSuccess();
|
|
|
+ clearInterval(this.interval)
|
|
|
+ }
|
|
|
+ }, 1500)
|
|
|
+ },
|
|
|
async cmccVote(item) {
|
|
|
this.$refs.smsAlert.hideSms()
|
|
|
let params = {
|