|
@@ -27,6 +27,14 @@
|
|
|
<text>可用余额 ¥{{ now_money }}</text>
|
|
<text>可用余额 ¥{{ now_money }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
<label class="radio"><radio value="" color="#5dbc7c" :checked="payType == 3"></radio></label>
|
|
<label class="radio"><radio value="" color="#5dbc7c" :checked="payType == 3"></radio></label>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="type-item" @click="changePayType(4)" v-if="isP == 1">
|
|
|
|
|
+ <text class="icon iconfont iconyue"></text>
|
|
|
|
|
+ <view class="con">
|
|
|
|
|
+ <text class="tit">拼团积分</text>
|
|
|
|
|
+ <text>可用余额 {{ userInfo.pink_integral }}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <label class="radio"><radio value="" color="#5dbc7c" :checked="payType == 4"></radio></label>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<text class="mix-btn" :class="{ clickbg: payLoding }" @click="!payLoding ? confirm() : ''">确认支付</text>
|
|
<text class="mix-btn" :class="{ clickbg: payLoding }" @click="!payLoding ? confirm() : ''">确认支付</text>
|
|
@@ -36,7 +44,8 @@
|
|
|
<script>
|
|
<script>
|
|
|
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 { mapState } from 'vuex';
|
|
|
|
|
|
|
+import { mapState,mapMutations } from 'vuex';
|
|
|
|
|
+import { orderData, userinfo } from '@/api/user.js';
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
@@ -57,15 +66,20 @@ export default {
|
|
|
// #ifdef H5
|
|
// #ifdef H5
|
|
|
froms: '', //保存h5中数据来源对象
|
|
froms: '', //保存h5中数据来源对象
|
|
|
// #endif
|
|
// #endif
|
|
|
- pinkid: '' //保存拼团商品id
|
|
|
|
|
|
|
+ pinkid: '' ,//保存拼团商品id
|
|
|
|
|
+ isP: 0,
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
|
// #ifdef H5
|
|
// #ifdef H5
|
|
|
- ...mapState(['weichatObj'])
|
|
|
|
|
|
|
+ ...mapState(['weichatObj']),
|
|
|
|
|
+ ...mapState('user',['userInfo'])
|
|
|
// #endif
|
|
// #endif
|
|
|
},
|
|
},
|
|
|
- onLoad(options) {
|
|
|
|
|
|
|
+ onLoad(options) {
|
|
|
|
|
+ if(options.isP) {
|
|
|
|
|
+ this.isP = options.isP
|
|
|
|
|
+ }
|
|
|
if (options.type == 1) {
|
|
if (options.type == 1) {
|
|
|
this.type = 1;
|
|
this.type = 1;
|
|
|
this.orderId = options.ordid;
|
|
this.orderId = options.ordid;
|
|
@@ -82,7 +96,8 @@ export default {
|
|
|
// 获取支付金额
|
|
// 获取支付金额
|
|
|
this.money = data.result.pay_price;
|
|
this.money = data.result.pay_price;
|
|
|
});
|
|
});
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ this.getUserInfo()
|
|
|
// 保存pinkid
|
|
// 保存pinkid
|
|
|
if (options.pinkid) {
|
|
if (options.pinkid) {
|
|
|
this.pinkid = options.pinkid;
|
|
this.pinkid = options.pinkid;
|
|
@@ -93,7 +108,17 @@ export default {
|
|
|
this.now_money = data.now_money;
|
|
this.now_money = data.now_money;
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
- methods: {
|
|
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ ...mapMutations('user', ['setUserInfo', 'setOrderInfo']),
|
|
|
|
|
+ getUserInfo() {
|
|
|
|
|
+ userinfo({})
|
|
|
|
|
+ .then(({ data }) => {
|
|
|
|
|
+ this.setUserInfo(data);
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(e => {
|
|
|
|
|
+ console.log(e);
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
//选择支付方式
|
|
//选择支付方式
|
|
|
changePayType(type) {
|
|
changePayType(type) {
|
|
|
this.payType = type;
|
|
this.payType = type;
|
|
@@ -105,6 +130,9 @@ export default {
|
|
|
}
|
|
}
|
|
|
if (this.payType == 3) {
|
|
if (this.payType == 3) {
|
|
|
this.payName = 'yue';
|
|
this.payName = 'yue';
|
|
|
|
|
+ }
|
|
|
|
|
+ if(this.payType == 4) {
|
|
|
|
|
+ this.payName = 'pink_integral';
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
// 支付金额
|
|
// 支付金额
|
|
@@ -131,6 +159,13 @@ export default {
|
|
|
} else {
|
|
} else {
|
|
|
obj.$api.msg(msg);
|
|
obj.$api.msg(msg);
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
+ if (obj.payName == 'pink_integral' && e.data.status == 'SUCCESS') {
|
|
|
|
|
+ if (e.status == 200) {
|
|
|
|
|
+ obj.paySuccessTo();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ obj.$api.msg(msg);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
if (obj.payName == 'weixin' || obj.payName == 'routine') {
|
|
if (obj.payName == 'weixin' || obj.payName == 'routine') {
|
|
|
let da = e.data.result.jsConfig;
|
|
let da = e.data.result.jsConfig;
|