|
|
@@ -62,6 +62,7 @@
|
|
|
const path = require('path');
|
|
|
import { add } from 'mathjs';
|
|
|
import product from '../mixins/product';
|
|
|
+let inWeixin = /micromessenger/i.test(navigator.userAgent);
|
|
|
export default {
|
|
|
name: 'Submit',
|
|
|
mixins: [product],
|
|
|
@@ -69,7 +70,7 @@ export default {
|
|
|
return {
|
|
|
info: {},
|
|
|
message: '',
|
|
|
- payType: 'ALIPAY',
|
|
|
+ payType: inWeixin ? 'WEIXIN' : 'ALIPAY',
|
|
|
payInfos: [
|
|
|
{
|
|
|
icon: require('../assets/svgs/zhifubao.svg'),
|
|
|
@@ -89,7 +90,8 @@ export default {
|
|
|
icons: [require('../assets/svgs/icon_gouxuan_huise.svg'), require('../assets/svgs/icon_gouxuan_pre.svg')],
|
|
|
bottom: null,
|
|
|
orderId: 0,
|
|
|
- gas: 1
|
|
|
+ gas: 1,
|
|
|
+ inWeixin
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -160,7 +162,7 @@ export default {
|
|
|
if (this.payType === 'ALIPAY') {
|
|
|
document.location.replace(path.resolve(this.$baseUrl, 'payOrder/alipay?id=' + res.id));
|
|
|
} else if (this.payType === 'WEIXIN') {
|
|
|
- if (/MicroMessenger/i.test(navigator.userAgent)) {
|
|
|
+ if (this.inWeixin) {
|
|
|
this.$toast.loading('加载中');
|
|
|
this.$http
|
|
|
.post('/payOrder/weixin', { id: res.id, openId: localStorage.getItem('openId') })
|