|
|
@@ -149,24 +149,24 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
submit() {
|
|
|
- if (this.payType === 'ALIPAY') {
|
|
|
- this.$http
|
|
|
- .post('/order/create?collectionId=' + this.$route.query.id + '&qty=1')
|
|
|
- .then(res => {
|
|
|
- this.orderId = res.id;
|
|
|
- this.$router.replace('/submit?orderId=' + res.id);
|
|
|
- this.$nextTick(() => {
|
|
|
+ this.$http
|
|
|
+ .post('/order/create?collectionId=' + this.$route.query.id + '&qty=1')
|
|
|
+ .then(res => {
|
|
|
+ this.orderId = res.id;
|
|
|
+ this.$router.replace('/submit?orderId=' + res.id);
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (this.payType === 'ALIPAY') {
|
|
|
document.location.replace(path.resolve(this.$baseUrl, 'payOrder/alipay?id=' + res.id));
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(e => {
|
|
|
- if (e) {
|
|
|
- this.$toast(e.error);
|
|
|
+ } else if (this.payType === 'WEIXIN') {
|
|
|
+ document.location.replace(path.resolve(this.$baseUrl, 'payOrder/weixin_h5?id=' + res.id));
|
|
|
}
|
|
|
});
|
|
|
- } else {
|
|
|
- this.wait();
|
|
|
- }
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ if (e) {
|
|
|
+ this.$toast(e.error);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
};
|