From 54c18938ebfa934b6e7736c6ef06a904488f7324 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Thu, 18 Dec 2025 11:06:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AE=A2=E9=98=85=E6=B6=88?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- groupBuying/goodsDetail/goodsDetail.vue | 57 +++++++++---------------- 1 file changed, 19 insertions(+), 38 deletions(-) diff --git a/groupBuying/goodsDetail/goodsDetail.vue b/groupBuying/goodsDetail/goodsDetail.vue index 687f3ee..55f7b71 100644 --- a/groupBuying/goodsDetail/goodsDetail.vue +++ b/groupBuying/goodsDetail/goodsDetail.vue @@ -217,11 +217,24 @@ } }) - function confirmExchange() { - // modalData.show = false; - exchange() + + function dingyue() { + return new Promise((revlove, reject) => { + uni.requestSubscribeMessage({ + tmplIds: ['JGPAGmqcPEgWB6mvAl0SC5cMqr5H5Qjcim8JCpHAZd0', + 'F4OyUhe_ZQ9BR731jlkaN2QXAUaA3HBZuUeVPfraSz0' + ], + success(res) {}, + complete() { + revlove() + } + }) + }) + } + async function payExchange() { + await dingyue(); uni.showLoading({ title: '支付中……' }) @@ -239,6 +252,7 @@ popupData.show = false; pay(orderRes.payInfo).then(res => { console.log(res) + if (res) { uni.redirectTo({ url: '/groupBuying/success/index?detailId=' + orderRes.goodsRecord @@ -261,40 +275,7 @@ }) } } - async function exchange() { - uni.showLoading({ - title: '兑换中……' - }) - const openId = await getOpenId() - uni.hideLoading() - if (openId) { - Api.exchange({ - pointsGoodsId: item.id, - shopId: item.shopId, - number: 1, - price: item.extraPrice, - openId - }).then(res => { - modalData.show = false; - if (res) { - uni.setStorageSync('exchange_goods_success', res) - uni.redirectTo({ - url: '/scoreShop/success/index' - }) - } else { - uni.showToast({ - title: '兑换失败', - icon: 'none' - }) - } - }) - } else { - uni.showToast({ - title: '鉴权失败,兑换失败', - icon: 'none' - }) - } - } + const item = reactive({ goodsDescription: [] @@ -331,7 +312,7 @@ const query = reactive({ shopId: '', wareId: '', - groupOrderNo:'' + groupOrderNo: '' })