提交 d5267084 authored 作者: pengxiaohui's avatar pengxiaohui

修复bug

上级 d1637e46
......@@ -87,6 +87,7 @@ export default {
else this.getCode()
}
this.fetchOrderDetails()
this.isPayBack && this.autoUpdateStatus()
},
methods: {
handlePay(item) {
......@@ -142,7 +143,12 @@ export default {
const [first = {}] = res.data
this.details = first
if (this.isPayBack) {
if (first.order_status !== '1') Toast.success('购买商品成功')
if (first.order_status === '1') {
this.timer && clearInterval(this.timer)
}
if (first.order_status === '4') {
Toast.success('购买商品成功')
}
}
}
})
......@@ -196,7 +202,16 @@ export default {
// 支付宝网页支付
window.location.href = res.payment_url
}
},
autoUpdateStatus() {
this.timer && clearInterval(this.timer)
this.timer = setInterval(() => {
this.fetchOrderDetails()
}, 1000);
}
},
destroyed() {
this.timer && clearInterval(this.timer)
}
}
</script>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论