|
|
@@ -68,6 +68,7 @@ import product from '../mixins/product';
|
|
|
import coupon from '../mixins/coupon';
|
|
|
import { mapState } from 'vuex';
|
|
|
let inWeixin = /micromessenger/i.test(navigator.userAgent);
|
|
|
+let inApp = /#cordova#/i.test(navigator.userAgent);
|
|
|
export default {
|
|
|
name: 'Submit',
|
|
|
mixins: [product, coupon],
|
|
|
@@ -97,6 +98,7 @@ export default {
|
|
|
orderId: 0,
|
|
|
gas: 1,
|
|
|
inWeixin,
|
|
|
+ inApp,
|
|
|
couponList: [],
|
|
|
collectionId: 0
|
|
|
};
|
|
|
@@ -204,7 +206,17 @@ export default {
|
|
|
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));
|
|
|
+ if (this.inWeixin) {
|
|
|
+ document.location.replace(
|
|
|
+ path.resolve(this.$baseUrl, '/payOrder/alipay_wx?id=' + res.id)
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ this.$http.get(`/payOrder/${inApp ? 'alipay_app' : 'alipay_h5'}`).then(res => {
|
|
|
+ document.location.replace(
|
|
|
+ 'alipays://platformapi/startapp?saId=10000007&qrcode=' + res
|
|
|
+ );
|
|
|
+ });
|
|
|
+ }
|
|
|
} else if (this.payType === 'WEIXIN') {
|
|
|
if (this.inWeixin) {
|
|
|
this.$toast.loading('加载中');
|