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: '' })