|
@@ -99,6 +99,7 @@ export default {
|
|
|
isInPay: false,
|
|
|
showLoading: false,
|
|
|
checked: false,
|
|
|
+ phone: '',
|
|
|
payType: [
|
|
|
{
|
|
|
name: "支付宝",
|
|
@@ -124,12 +125,8 @@ export default {
|
|
|
let userinfo = await getUserInfo();
|
|
|
this.balance = userinfo.balance;
|
|
|
this.send_order_id = userinfo.send_order_id;
|
|
|
- if (userinfo.is_check) {
|
|
|
- router.push({
|
|
|
- uri: '/views/Phone'
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
+ this.checked = userinfo.is_check;
|
|
|
+ this.phone = userinfo.phone;
|
|
|
},
|
|
|
async initChargeList() {
|
|
|
this.rechargeList = await getChargeList();
|
|
@@ -141,18 +138,43 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
async toPay() {
|
|
|
- let cur_pay_type = this.curPayType;
|
|
|
- let product_id = this.rechargeList[this.curSelect].product_id;
|
|
|
- let ret = null;
|
|
|
- if (cur_pay_type === 1) {
|
|
|
- ret = await configAliPay({ product_id: product_id, bid: this.bid, send_order_id: this.send_order_id });
|
|
|
- }
|
|
|
- else {
|
|
|
- ret = await configWxPay({ product_id: product_id, bid: this.bid, send_order_id: this.send_order_id });
|
|
|
+ if (this.checked && !this.phone) {
|
|
|
+ prompt.showDialog({
|
|
|
+ title: '友情提示',
|
|
|
+ message: '您还未绑定手机号,请绑定手机号后在进行相关操作',
|
|
|
+ buttons: [
|
|
|
+ {
|
|
|
+ text: '前往绑定',
|
|
|
+ color: '#33dd44'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ success: function (data) {
|
|
|
+ router.push({
|
|
|
+ uri: '/views/Phone'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ cancel: function () {
|
|
|
+ console.log('取消绑定')
|
|
|
+ },
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ } else {
|
|
|
+ let cur_pay_type = this.curPayType;
|
|
|
+ let product_id = this.rechargeList[this.curSelect].product_id;
|
|
|
+ let ret = null;
|
|
|
+ if (cur_pay_type === 1) {
|
|
|
+ ret = await configAliPay({ product_id: product_id, bid: this.bid, send_order_id: this.send_order_id });
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ ret = await configWxPay({ product_id: product_id, bid: this.bid, send_order_id: this.send_order_id });
|
|
|
+ }
|
|
|
+ // 成功支付后的回调操作
|
|
|
+ if (ret.code === "9000") this.showWaitingWrap(ret);
|
|
|
+ else this.showToastByCode(ret.code);
|
|
|
}
|
|
|
- // 成功支付后的回调操作
|
|
|
- if (ret.code === "9000") this.showWaitingWrap(ret);
|
|
|
- else this.showToastByCode(ret.code);
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
checkOrder(order_info) {
|
|
|
this.showLoading = true;
|
|
@@ -209,6 +231,8 @@ export default {
|
|
|
},
|
|
|
onInit() {
|
|
|
this.initChargeList();
|
|
|
+ },
|
|
|
+ onShow() {
|
|
|
this.getUserInfo();
|
|
|
},
|
|
|
onHide() {
|