From a2b0942d88d39df6df52560b9a0154fa8786d0ff Mon Sep 17 00:00:00 2001 From: puhui999 Date: Thu, 25 Jul 2024 17:40:29 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E4=BB=A3=E7=A0=81=E8=AF=84=E5=AE=A1=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=B0=8F=E7=A8=8B=E5=BA=8F=E7=9A=84=E8=AE=A2=E9=98=85?= =?UTF-8?q?=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sheep/api/migration/third.js | 4 ++-- sheep/platform/provider/wechat/miniProgram.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sheep/api/migration/third.js b/sheep/api/migration/third.js index 0f32c394..e3babc68 100644 --- a/sheep/api/migration/third.js +++ b/sheep/api/migration/third.js @@ -4,9 +4,9 @@ export default { // 微信相关 wechat: { // 小程序订阅消息 - subscribeTemplate: () => + getSubscribeTemplateList: () => request({ - url: '/member/social-user/get-subscribe-template', + url: '/member/social-user/get-subscribe-template-list', method: 'GET', custom: { showError: false, diff --git a/sheep/platform/provider/wechat/miniProgram.js b/sheep/platform/provider/wechat/miniProgram.js index 0ce7dc39..29473786 100644 --- a/sheep/platform/provider/wechat/miniProgram.js +++ b/sheep/platform/provider/wechat/miniProgram.js @@ -164,7 +164,7 @@ const checkUpdate = async (silence = true) => { // 获取订阅消息模板 async function getSubscribeTemplate() { - const { code, data } = await third.wechat.subscribeTemplate(); + const { code, data } = await third.wechat.getSubscribeTemplateList(); if (code === 0) { subscribeEventList = data; } @@ -176,14 +176,14 @@ function subscribeMessage(event) { if (typeof event === 'string') { const temp = subscribeEventList.find(item => item.title.includes(event)); if (temp) { - tmplIds.push(temp.priTmplId); + tmplIds.push(temp.id); } } if (typeof event === 'object') { event.forEach((e) => { const temp = subscribeEventList.find(item => item.title.includes(e)); if (temp) { - tmplIds.push(temp.priTmplId); + tmplIds.push(temp.id); } }); } From 9add242540908ac929637358c5de939d74df1b46 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Tue, 30 Jul 2024 17:44:55 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E3=80=90=E6=96=B0=E5=A2=9E=E3=80=91?= =?UTF-8?q?=E8=AE=A2=E9=98=85=E6=B6=88=E6=81=AF=EF=BC=9A=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=8F=91=E8=B4=A7=E3=80=81=E5=85=85=E5=80=BC=E9=80=80=E6=AC=BE?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E8=AE=A2=E9=98=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/order/confirm.vue | 6 + pages/pay/recharge.vue | 404 ++++++++++++++++++++-------------------- sheep/util/const.js | 4 +- 3 files changed, 211 insertions(+), 203 deletions(-) diff --git a/pages/order/confirm.vue b/pages/order/confirm.vue index 69e7f4d4..c5380536 100644 --- a/pages/order/confirm.vue +++ b/pages/order/confirm.vue @@ -166,6 +166,7 @@ import OrderApi from '@/sheep/api/trade/order'; import CouponApi from '@/sheep/api/promotion/coupon'; import { fen2yuan } from '@/sheep/hooks/useGoods'; + import { SubscribeTemplate } from '@/sheep/util/const'; const state = reactive({ orderPayload: {}, @@ -230,6 +231,11 @@ if (state.orderPayload.items[0].cartId > 0) { sheep.$store('cart').getList(); } + + // #ifdef MP + sheep.$platform.useProvider('wechat').subscribeMessage(SubscribeTemplate.DELIVERY_ORDER); + // #endif + // 跳转到支付页面 sheep.$router.redirect('/pages/pay/index', { id: data.payOrderId, diff --git a/pages/pay/recharge.vue b/pages/pay/recharge.vue index 430db1a8..a54061ae 100644 --- a/pages/pay/recharge.vue +++ b/pages/pay/recharge.vue @@ -1,260 +1,260 @@ diff --git a/sheep/util/const.js b/sheep/util/const.js index f2768870..fd6f6493 100644 --- a/sheep/util/const.js +++ b/sheep/util/const.js @@ -59,7 +59,9 @@ export const TimeStatusEnum = { // TODO 订阅模版枚举 export const SubscribeTemplate = { ORDER_AFTERSALE_CHANGE: "售后进度通知", - MONEY_CHANGE: "充值成功通知" + WALLET_RECHARGER_PAID: "充值成功通知", + WALLET_RECHARGE_REFUNDED: "退款申请通知", + DELIVERY_ORDER: "订单发货通知", }