From a128f19808b7a0295180251c8e329e43d08a0037 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=AF=85?= <1335909236@qq.com> Date: Mon, 1 Dec 2025 09:16:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=98=93=E8=B4=AD=E7=AB=8B?= =?UTF-8?q?=E5=8D=B3=E6=94=AF=E4=BB=98=E4=B8=8D=E8=B0=83=E7=94=A8=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/shop/goods/index.vue | 45 +++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/packages/shop/goods/index.vue b/packages/shop/goods/index.vue index ee6e528c..f1341af9 100644 --- a/packages/shop/goods/index.vue +++ b/packages/shop/goods/index.vue @@ -837,6 +837,51 @@ export default { }) }) }, + // 处理mergePreorder接口的响应 + handleMergePreorderResponse(res, orderId) { + 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 = { + order_id: orderId, + from: this.carList.some(item => item.isAdver === true) ? 3 : (isGroupBuyValid ? 2 : 1), + adver_id: this.carList.some(item => item.isAdver === true) ? this.carList.find(item => item.isAdver === true).adver_id : '' + } + request(apiArr.queryOrder, "POST", params).then(res => { + this.verifyCode = res.verification_code + this.slJin = res.shiliu_money + this.boxshadow1 = true + }) + }, + fail: (payErr) => { + uni.showToast({ + title: payErr.errMsg == 'requestPayment:fail cancel' ? '已取消支付' : '支付失败', + icon: 'none' + }) + const params = { + order_ids: orderId, + } + request(apiArr.cancelPay, "POST", params).then(res => { + }) + }, + complete: () => { + // 支付完成后的回调,无论成功失败都会执行 + } + }) + } else { + console.error("获取支付参数失败,缺少必要参数") + uni.showToast({ + title: '获取支付信息失败', + icon: 'none' + }) + } + }, // 获取评论 getComment(id) { let params = {}