|
|
@ -131,13 +131,12 @@ |
|
|
|
async fetchCreateOrder() { |
|
|
|
// todo: check |
|
|
|
let params = { |
|
|
|
'massageItem.id': this.payOrderProduct[0].id, |
|
|
|
itemId: this.payOrderProduct[0].id, |
|
|
|
amount: this.totalPrice, |
|
|
|
|
|
|
|
payType : this.payMethod, |
|
|
|
|
|
|
|
// num: this.payOrderProduct[0].num, |
|
|
|
// id: this.payOrderProduct[0].id, |
|
|
|
// payType : this.payMethod, |
|
|
|
// num: this.payOrderProduct[0].num, |
|
|
|
// memberNum : 1, |
|
|
|
} |
|
|
|
|
|
|
@ -150,29 +149,30 @@ |
|
|
|
|
|
|
|
return res |
|
|
|
}, |
|
|
|
|
|
|
|
async fetchPayOrder() { |
|
|
|
// todo |
|
|
|
let params = { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
await this.$fetch('payOrder', params) |
|
|
|
}, |
|
|
|
|
|
|
|
async submit() { |
|
|
|
// todo |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
const res = await this.fetchCreateOrder() |
|
|
|
|
|
|
|
if (!res.success) { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (this.payMethod == 1) { // 账户余额 |
|
|
|
|
|
|
|
} else { // 微信支付 |
|
|
|
await uni.requestPaymentWxPay(res) |
|
|
|
} |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
title: '下单成功', |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
|
|
|
|
setTimeout(uni.redirectTo, 700, { |
|
|
|
url: '/pages/index/order' |
|
|
|
}) |
|
|
|
} catch (err) { |
|
|
|
|
|
|
|
} |
|
|
|