|
|
@@ -152,18 +152,12 @@ export default {
|
|
|
this.bottom = this.$refs.bottom;
|
|
|
},
|
|
|
methods: {
|
|
|
- refreashOrder() {
|
|
|
- this.getOrder();
|
|
|
- if (this.timer) {
|
|
|
- clearTimeout(this.timer);
|
|
|
- }
|
|
|
- this.timer = setTimeout(() => {
|
|
|
- this.refreashOrder();
|
|
|
- }, 1000);
|
|
|
- },
|
|
|
- getOrder() {
|
|
|
+ getOrder(next = false) {
|
|
|
this.$http.get('/order/get/' + this.orderId).then(res => {
|
|
|
this.info = res;
|
|
|
+ if (this.timer) {
|
|
|
+ clearTimeout(this.timer);
|
|
|
+ }
|
|
|
if (res.status === 'PROCESSING' || res.status === 'CANCELLED') {
|
|
|
this.$dialog
|
|
|
.alert({
|
|
|
@@ -179,6 +173,10 @@ export default {
|
|
|
}
|
|
|
// on close
|
|
|
});
|
|
|
+ } else if (next) {
|
|
|
+ this.timer = setTimeout(() => {
|
|
|
+ this.getOrder(next);
|
|
|
+ }, 1000);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
@@ -225,9 +223,12 @@ export default {
|
|
|
this.$http
|
|
|
.get(`/payOrder/${this.inApp ? 'alipay_app' : 'alipay_h5'}?id=${res.id}`)
|
|
|
.then(res => {
|
|
|
- window.open('alipays://platformapi/startapp?saId=10000007&qrcode=' + res);
|
|
|
+ window.open(
|
|
|
+ 'alipays://platformapi/startapp?saId=10000007&qrcode=' + res,
|
|
|
+ '_blank'
|
|
|
+ );
|
|
|
if (!this.inApp) {
|
|
|
- this.refreashOrder();
|
|
|
+ this.getOrder(true);
|
|
|
}
|
|
|
});
|
|
|
}
|