| | |
| | | setup(__props) { |
| | | const choosedMoney = common_vendor.ref(50); |
| | | const disabled = common_vendor.ref(true); |
| | | const userInfo = JSON.parse(common_vendor.index.getStorageSync("userInfo")); |
| | | const moneyList = common_vendor.ref([ |
| | | { value: 50, active: true }, |
| | | { value: 100, active: false }, |
| | |
| | | } else { |
| | | money = Number(otherMoney.value); |
| | | } |
| | | await api_index.wxPayApi({ businessType: 1, tradeAmount: money }).then((res) => { |
| | | let data = { |
| | | cardNumber: userInfo.waterCardNumber, |
| | | paymentMethod: 1, |
| | | rechargeAmount: money |
| | | }; |
| | | await api_index.rechargeApi(data).then(async (res) => { |
| | | if (res.code == 200) { |
| | | let data2 = { |
| | | businessType: 1, |
| | | businessNo: res.data |
| | | }; |
| | | await wxPay(data2); |
| | | } |
| | | }); |
| | | } |
| | | async function wxPay(data) { |
| | | await api_index.wxPayApi(data).then((res) => { |
| | | if (res.code == 200) { |
| | | common_vendor.wx$1.requestPayment({ |
| | | //预支付订单信息 |