|
@@ -5,7 +5,7 @@
|
|
|
<text class="price">{{ money }}</text>
|
|
<text class="price">{{ money }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="pay-type-list">
|
|
<view class="pay-type-list">
|
|
|
- <view class="type-item b-b" @click="changePayType(1)">
|
|
|
|
|
|
|
+ <view class="type-item b-b" @click="changePayType(1)" v-if="bool">
|
|
|
<text class="icon iconfont iconweixin"></text>
|
|
<text class="icon iconfont iconweixin"></text>
|
|
|
<view class="con">
|
|
<view class="con">
|
|
|
<text class="tit">微信支付</text>
|
|
<text class="tit">微信支付</text>
|
|
@@ -53,7 +53,10 @@
|
|
|
import { balance } from '@/api/wallet.js';
|
|
import { balance } from '@/api/wallet.js';
|
|
|
import { createOrderkey,computedOrderkey,orderPay } from '@/api/order.js';
|
|
import { createOrderkey,computedOrderkey,orderPay } from '@/api/order.js';
|
|
|
import { getUserInfo } from '@/api/user.js';
|
|
import { getUserInfo } from '@/api/user.js';
|
|
|
-import { mapState } from 'vuex';
|
|
|
|
|
|
|
+import { mapState } from 'vuex';
|
|
|
|
|
+// #ifdef H5
|
|
|
|
|
+import weixinBJ from "@/utils/wxAuthorized.js";
|
|
|
|
|
+// #endif
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
@@ -77,16 +80,16 @@ export default {
|
|
|
pinkid: '' ,//保存拼团商品id
|
|
pinkid: '' ,//保存拼团商品id
|
|
|
'gp_now_money':0,
|
|
'gp_now_money':0,
|
|
|
'integral':0,
|
|
'integral':0,
|
|
|
- is_gp:0//1为公排0不是公排
|
|
|
|
|
|
|
+ is_gp:0,//1为公排0不是公排
|
|
|
|
|
+ bool: true
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
- computed: {
|
|
|
|
|
- // #ifdef H5
|
|
|
|
|
- ...mapState(['weichatObj'])
|
|
|
|
|
- // #endif
|
|
|
|
|
- },
|
|
|
|
|
onLoad(options) {
|
|
onLoad(options) {
|
|
|
-
|
|
|
|
|
|
|
+ this.bool = uni.getStorageSync('weichatBrowser');
|
|
|
|
|
+ if(!this.bool) {
|
|
|
|
|
+ this.payType = 3
|
|
|
|
|
+ this.payName = 'yue'
|
|
|
|
|
+ }
|
|
|
if (options.type == 1) {
|
|
if (options.type == 1) {
|
|
|
this.type = 1;
|
|
this.type = 1;
|
|
|
this.orderId = options.ordid;
|
|
this.orderId = options.ordid;
|
|
@@ -179,7 +182,8 @@ export default {
|
|
|
obj.$api.msg(msg);
|
|
obj.$api.msg(msg);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if (obj.payName == 'weixin' || obj.payName == 'routine') {
|
|
|
|
|
|
|
+ if (obj.payName == 'weixin' || obj.payName == 'routine') {
|
|
|
|
|
+ console.log("开始调用");
|
|
|
let da = e.data.result.jsConfig;
|
|
let da = e.data.result.jsConfig;
|
|
|
let data = {
|
|
let data = {
|
|
|
// #ifdef H5
|
|
// #ifdef H5
|
|
@@ -195,15 +199,26 @@ export default {
|
|
|
success: function(res) {
|
|
success: function(res) {
|
|
|
obj.paySuccessTo();
|
|
obj.paySuccessTo();
|
|
|
},
|
|
},
|
|
|
- fail: () => {
|
|
|
|
|
- uni.navigateTo({
|
|
|
|
|
- url: '/pages/order/order?state=0'
|
|
|
|
|
|
|
+ fail: (e) => {
|
|
|
|
|
+ uni.showModal({
|
|
|
|
|
+ title: '错误',
|
|
|
|
|
+ content: e,
|
|
|
});
|
|
});
|
|
|
|
|
+ // uni.navigateTo({
|
|
|
|
|
+ // url: '/pages/order/order?state=0'
|
|
|
|
|
+ // });
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
// #ifdef H5
|
|
// #ifdef H5
|
|
|
- if(obj.payName == 'weixin'){
|
|
|
|
|
- obj.weichatObj.chooseWXPay(data);
|
|
|
|
|
|
|
+ if(obj.payName == 'weixin'){
|
|
|
|
|
+ weixinBJ.weixinObj.chooseWXPay(data);
|
|
|
|
|
+ // weixindata().then(() => {
|
|
|
|
|
+ // }).catch((e) => {
|
|
|
|
|
+ // uni.showModal({
|
|
|
|
|
+ // title: '错误',
|
|
|
|
|
+ // content: e,
|
|
|
|
|
+ // });
|
|
|
|
|
+ // })
|
|
|
}
|
|
}
|
|
|
// #endif
|
|
// #endif
|
|
|
// #ifdef MP-WEIXIN
|
|
// #ifdef MP-WEIXIN
|