修复好店的支付bug
This commit is contained in:
parent
ed3a8f6e55
commit
cc30b85288
@ -18,7 +18,8 @@
|
||||
|
||||
<view class="Msg">
|
||||
<view class="payMony">
|
||||
¥<input type="number" v-model="Money" placeholder="付款金额" placeholder-style="font-size: 50rpx;" @blur="handleMoneyInput" @focus="showKeyboard" step="0.01" min="0.01">
|
||||
¥<input type="number" v-model="Money" placeholder="付款金额" placeholder-style="font-size: 50rpx;"
|
||||
@blur="handleMoneyInput" @focus="showKeyboard" step="0.01" min="0.01">
|
||||
<cu-keyboard ref="cukeyboard" @change="change" @confirm="keyboardConfirm" @hide="hide"></cu-keyboard>
|
||||
</view>
|
||||
<view class="payRemark">
|
||||
@ -297,7 +298,7 @@ export default {
|
||||
}
|
||||
request(apiArr.createPay, "POST", {
|
||||
merchant_id: that.info.id,
|
||||
order_amount: Number((that.Money) * 100), //金额
|
||||
order_amount: Number((that.Money)), //金额
|
||||
refund_property_fee: that.homeMoney, //物业费
|
||||
refund_member_points: that.integral, //积分
|
||||
remark: that.remarks,
|
||||
@ -331,38 +332,44 @@ export default {
|
||||
|
||||
async LakaLaPrePay() {
|
||||
let that = this
|
||||
request(apiPay.pay, "POST", {
|
||||
total_amount: that.OrderMsg.order_amount,
|
||||
subject: '快捷支付订单',
|
||||
goods_id: that.payId,
|
||||
address: "",
|
||||
out_trade_no: that.OrderMsg.order_no,
|
||||
remark: that.OrderMsg.remark,
|
||||
quantity: '1',
|
||||
user: uni.getStorageSync('userId'),
|
||||
user_id: uni.getStorageSync('openId')
|
||||
request(apiArr.getPreOrderInfo, "POST", {
|
||||
id: that.payId,
|
||||
}).then(res => {
|
||||
console.log(res, 'res');
|
||||
|
||||
const { resp_data, msg } = res
|
||||
|
||||
wx.requestPayment({
|
||||
timeStamp: String(resp_data.acc_resp_fields.time_stamp),
|
||||
nonceStr: String(resp_data.acc_resp_fields.nonce_str),
|
||||
package: String(resp_data.acc_resp_fields.package),
|
||||
signType: String(resp_data.acc_resp_fields.sign_type),
|
||||
paySign: String(resp_data.acc_resp_fields.pay_sign),
|
||||
success(res) {
|
||||
that.queryPay(resp_data)
|
||||
},
|
||||
fail(fal) {
|
||||
if (fal.errMsg == 'requestPayment:fail cancel') {
|
||||
// that.payFail(2)
|
||||
} else {
|
||||
// that.payFail(1)
|
||||
if (res && res.timeStamp && res.nonceStr && res.package && res.signType && res.paySign) {
|
||||
// 调用微信支付
|
||||
uni.requestPayment({
|
||||
timeStamp: res.timeStamp,
|
||||
nonceStr: res.nonceStr,
|
||||
package: res.package,
|
||||
signType: res.signType,
|
||||
paySign: res.paySign,
|
||||
success: (payRes) => {
|
||||
const params = {
|
||||
id: this.OrderMsg.id,
|
||||
}
|
||||
request(apiArr.tradeQuery, "POST", params).then(res => {
|
||||
})
|
||||
},
|
||||
fail: (payErr) => {
|
||||
uni.showToast({
|
||||
title: payErr.errMsg == 'requestPayment:fail cancel' ? '已取消支付' : '支付失败',
|
||||
icon: 'none'
|
||||
})
|
||||
const params = {
|
||||
order_ids: orderId,
|
||||
}
|
||||
},
|
||||
complete: () => {
|
||||
// 支付完成后的回调,无论成功失败都会执行
|
||||
}
|
||||
})
|
||||
} else {
|
||||
console.error("获取支付参数失败,缺少必要参数")
|
||||
uni.showToast({
|
||||
title: '获取支付信息失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user