From 72628f7e1cc5620ee45494285587f0806d55a90a Mon Sep 17 00:00:00 2001 From: WCH Date: Mon, 8 Jul 2024 09:13:27 +0000 Subject: [PATCH 1/4] =?UTF-8?q?=E5=A4=8D=E5=88=B6=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=A4=B1=E8=B4=A5=EF=BC=8C=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: WCH --- pages/order/detail.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/order/detail.vue b/pages/order/detail.vue index 4daa3024..b9527e76 100644 --- a/pages/order/detail.vue +++ b/pages/order/detail.vue @@ -272,7 +272,7 @@ // 复制 const onCopy = () => { - sheep.$helper.copyText(state.orderInfo.sn); + sheep.$helper.copyText(state.orderInfo.no); }; // 去支付 From e289c102706ab8c55eb0659e2219c8af9d3042c2 Mon Sep 17 00:00:00 2001 From: zhaowg Date: Wed, 17 Jul 2024 03:35:24 +0000 Subject: [PATCH 2/4] =?UTF-8?q?update=20pages/order/aftersale/return-deliv?= =?UTF-8?q?ery.vue.=20=E4=BF=AE=E6=94=B91=EF=BC=9A=E8=BF=9B=E5=85=A5?= =?UTF-8?q?=E8=AF=A5=E9=A1=B5=E9=9D=A2=E6=8A=A5=EF=BC=9A=20Cannot=20read?= =?UTF-8?q?=20properties=20of=20undefined=20(reading=20'name')=EF=BC=8C?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=E6=98=AF=E5=9C=A8{{=20state.expresses[state.?= =?UTF-8?q?expressIndex].name=20}}=E8=BF=99=E8=A1=8C=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=8ConLoad=E5=BC=82=E6=AD=A5=E5=8A=A0=E8=BD=BD=E5=90=8E?= =?UTF-8?q?=E7=AB=AF=E5=BF=AB=E9=80=92=E5=85=AC=E5=8F=B8=E5=88=97=E8=A1=A8?= =?UTF-8?q?=EF=BC=8C=E5=9C=A8state.expresses=E4=B8=BA=E7=A9=BA=E6=95=B0?= =?UTF-8?q?=E7=BB=84=E6=97=B6=EF=BC=8C=E7=9B=B4=E6=8E=A5=E8=AF=BB=E5=8F=96?= =?UTF-8?q?name=E5=AD=97=E6=AE=B5=E5=AF=BC=E8=87=B4=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E3=80=82=20=E4=BF=AE=E6=94=B9=E6=96=B9=E5=BC=8F=EF=BC=9A?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0v-if=E5=88=A4=E6=96=AD=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改2:物流公司右侧增加箭头图标。icon-jiantou替换为_icon-forward。 Signed-off-by: zhaowg --- pages/order/aftersale/return-delivery.vue | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pages/order/aftersale/return-delivery.vue b/pages/order/aftersale/return-delivery.vue index 461fef0e..fa3ecec0 100644 --- a/pages/order/aftersale/return-delivery.vue +++ b/pages/order/aftersale/return-delivery.vue @@ -6,14 +6,15 @@ 物流公司 - - - {{ state.expresses[state.expressIndex].name }} - - - - + + + + {{ state.expresses[state.expressIndex].name }} + + + + 物流单号 From 8977504147ee7a7c1dfe80003e87f1f153e89bda Mon Sep 17 00:00:00 2001 From: puhui999 Date: Wed, 24 Jul 2024 17:17:44 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E3=80=90=E6=96=B0=E5=A2=9E=E3=80=91?= =?UTF-8?q?=E6=8E=A5=E5=85=A5=E5=BE=AE=E4=BF=A1=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 --- pages/order/aftersale/apply.vue | 3 +- pages/pay/recharge.vue | 27 +++++++++--------- sheep/api/migration/third.js | 7 ++--- sheep/platform/provider/wechat/miniProgram.js | 28 +++++++++++-------- sheep/util/const.js | 7 +++++ 5 files changed, 42 insertions(+), 30 deletions(-) diff --git a/pages/order/aftersale/apply.vue b/pages/order/aftersale/apply.vue index 7512302b..ece7e963 100644 --- a/pages/order/aftersale/apply.vue +++ b/pages/order/aftersale/apply.vue @@ -130,6 +130,7 @@ import TradeConfigApi from '@/sheep/api/trade/config'; import { fen2yuan } from '@/sheep/hooks/useGoods'; import AfterSaleApi from '@/sheep/api/trade/afterSale'; + import { SubscribeTemplate } from '@/sheep/util/const'; const form = ref(null); const state = reactive({ @@ -165,7 +166,7 @@ // 提交表单 async function submit() { // #ifdef MP - sheep.$platform.useProvider('wechat').subscribeMessage('order_aftersale_change'); + sheep.$platform.useProvider('wechat').subscribeMessage(SubscribeTemplate.ORDER_AFTERSALE_CHANGE); // #endif let data = { orderItemId: state.itemId, diff --git a/pages/pay/recharge.vue b/pages/pay/recharge.vue index 9432886e..430db1a8 100644 --- a/pages/pay/recharge.vue +++ b/pages/pay/recharge.vue @@ -47,6 +47,7 @@ import { onLoad } from '@dcloudio/uni-app'; import { fen2yuan } from '@/sheep/hooks/useGoods'; import PayWalletApi from '@/sheep/api/pay/wallet'; + import { SubscribeTemplate } from '@/sheep/util/const'; const userWallet = computed(() => sheep.$store('user').userWallet); const statusBarHeight = sheep.$platform.device.statusBarHeight * 2; @@ -73,20 +74,20 @@ // 发起支付 async function onConfirm() { - const { code, data } = await PayWalletApi.createWalletRecharge({ - packageId: state.packageList.find((item) => fen2yuan(item.payPrice) === state.recharge_money)?.id, - payPrice: state.recharge_money * 100 - }); - if (code !== 0) { - return; - } + // const { code, data } = await PayWalletApi.createWalletRecharge({ + // packageId: state.packageList.find((item) => fen2yuan(item.payPrice) === state.recharge_money)?.id, + // payPrice: state.recharge_money * 100 + // }); + // if (code !== 0) { + // return; + // } // #ifdef MP - sheep.$platform.useProvider('wechat').subscribeMessage('money_change'); + sheep.$platform.useProvider('wechat').subscribeMessage(SubscribeTemplate.MONEY_CHANGE); // #endif - sheep.$router.go('/pages/pay/index', { - id: data.payOrderId, - orderType: 'recharge' - }); + // sheep.$router.go('/pages/pay/index', { + // id: data.payOrderId, + // orderType: 'recharge' + // }); } onLoad(() => { @@ -256,4 +257,4 @@ } } } - \ No newline at end of file + diff --git a/sheep/api/migration/third.js b/sheep/api/migration/third.js index 85db8cc3..0f32c394 100644 --- a/sheep/api/migration/third.js +++ b/sheep/api/migration/third.js @@ -4,13 +4,10 @@ export default { // 微信相关 wechat: { // 小程序订阅消息 - subscribeTemplate: (params) => + subscribeTemplate: () => request({ - url: 'third/wechat/subscribeTemplate', + url: '/member/social-user/get-subscribe-template', method: 'GET', - params: { - platform: 'miniProgram', - }, custom: { showError: false, showLoading: false, diff --git a/sheep/platform/provider/wechat/miniProgram.js b/sheep/platform/provider/wechat/miniProgram.js index a5b64b0b..0ce7dc39 100644 --- a/sheep/platform/provider/wechat/miniProgram.js +++ b/sheep/platform/provider/wechat/miniProgram.js @@ -1,4 +1,4 @@ -import third from '@/sheep/api/migration/third' +import third from '@/sheep/api/migration/third'; import AuthUtil from '@/sheep/api/member/auth'; import SocialApi from '@/sheep/api/member/social'; import UserApi from '@/sheep/api/member/user'; @@ -128,14 +128,14 @@ async function getInfo() { const checkUpdate = async (silence = true) => { if (uni.canIUse('getUpdateManager')) { const updateManager = uni.getUpdateManager(); - updateManager.onCheckForUpdate(function (res) { + updateManager.onCheckForUpdate(function(res) { // 请求完新版本信息的回调 if (res.hasUpdate) { - updateManager.onUpdateReady(function () { + updateManager.onUpdateReady(function() { uni.showModal({ title: '更新提示', content: '新版本已经准备好,是否重启应用?', - success: function (res) { + success: function(res) { if (res.confirm) { // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 updateManager.applyUpdate(); @@ -143,7 +143,7 @@ const checkUpdate = async (silence = true) => { }, }); }); - updateManager.onUpdateFailed(function () { + updateManager.onUpdateFailed(function() { // 新的版本下载失败 // uni.showModal({ // title: '已经有新版本了哟~', @@ -164,8 +164,8 @@ const checkUpdate = async (silence = true) => { // 获取订阅消息模板 async function getSubscribeTemplate() { - const { error, data } = await third.wechat.subscribeTemplate(); - if (error === 0) { + const { code, data } = await third.wechat.subscribeTemplate(); + if (code === 0) { subscribeEventList = data; } } @@ -174,11 +174,17 @@ async function getSubscribeTemplate() { function subscribeMessage(event) { let tmplIds = []; if (typeof event === 'string') { - tmplIds.push(subscribeEventList[event]); + const temp = subscribeEventList.find(item => item.title.includes(event)); + if (temp) { + tmplIds.push(temp.priTmplId); + } } if (typeof event === 'object') { - event.forEach((item) => { - if (typeof subscribeEventList[item] !== 'undefined') tmplIds.push(subscribeEventList[item]); + event.forEach((e) => { + const temp = subscribeEventList.find(item => item.title.includes(e)); + if (temp) { + tmplIds.push(temp.priTmplId); + } }); } if (tmplIds.length === 0) return; @@ -201,5 +207,5 @@ export default { getInfo, getOpenid, subscribeMessage, - checkUpdate + checkUpdate, }; diff --git a/sheep/util/const.js b/sheep/util/const.js index e5eba0c2..f2768870 100644 --- a/sheep/util/const.js +++ b/sheep/util/const.js @@ -56,6 +56,13 @@ export const TimeStatusEnum = { END: '已结束', } +// TODO 订阅模版枚举 +export const SubscribeTemplate = { + ORDER_AFTERSALE_CHANGE: "售后进度通知", + MONEY_CHANGE: "充值成功通知" +} + + export const getTimeStatusEnum = (startTime, endTime) => { const now = dayjs(); if (now.isBefore(startTime)) { From 20f937a4edc49e63ebfafff538caad647bbde414 Mon Sep 17 00:00:00 2001 From: downeyin <853384781@qq.com> Date: Fri, 26 Jul 2024 00:11:07 +0800 Subject: [PATCH 4/4] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E7=A7=9F?= =?UTF-8?q?=E6=88=B7ID=E8=87=AA=E5=AE=9A=E4=B9=89=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 3 +++ sheep/api/infra/file.js | 6 +++--- sheep/config/index.js | 5 ++++- sheep/request/index.js | 8 ++++---- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.env b/.env index 4860a552..adcc17dd 100644 --- a/.env +++ b/.env @@ -22,3 +22,6 @@ SHOPRO_STATIC_URL = https://file.sheepjs.com # 是否开启直播 1 开启直播 | 0 关闭直播 (小程序官方后台未审核开通直播权限时请勿开启) SHOPRO_MPLIVE_ON = 0 + +# 租户ID 默认 1 +SHOPRO_TENANT_ID = 1 diff --git a/sheep/api/infra/file.js b/sheep/api/infra/file.js index a4bac46f..f7f2a964 100644 --- a/sheep/api/infra/file.js +++ b/sheep/api/infra/file.js @@ -1,4 +1,4 @@ -import { baseUrl, apiPath } from '@/sheep/config'; +import { baseUrl, apiPath, tenantId } from '@/sheep/config'; const FileApi = { // 上传文件 @@ -15,8 +15,8 @@ const FileApi = { name: 'file', header: { // Accept: 'text/json', - Accept : '*/*', - 'tenant-id' :'1', + Accept: '*/*', + 'tenant-id': tenantId, // Authorization: 'Bearer test247', }, success: (uploadFileRes) => { diff --git a/sheep/config/index.js b/sheep/config/index.js index 48f46ef9..9aa4f523 100644 --- a/sheep/config/index.js +++ b/sheep/config/index.js @@ -11,10 +11,13 @@ console.log(`[芋道商城 ${version}] http://doc.iocoder.cn`); export const apiPath = import.meta.env.SHOPRO_API_PATH; export const staticUrl = import.meta.env.SHOPRO_STATIC_URL; +export const tenantId = import.meta.env.SHOPRO_TENANT_ID; export const websocketPath = import.meta.env.SHOPRO_WEBSOCKET_PATH; + export default { baseUrl, apiPath, staticUrl, - websocketPath + tenantId, + websocketPath, }; diff --git a/sheep/request/index.js b/sheep/request/index.js index 99c38a4f..700c7dda 100644 --- a/sheep/request/index.js +++ b/sheep/request/index.js @@ -4,7 +4,7 @@ */ import Request from 'luch-request'; -import { baseUrl, apiPath } from '@/sheep/config'; +import { baseUrl, apiPath, tenantId } from '@/sheep/config'; import $store from '@/sheep/store'; import $platform from '@/sheep/platform'; import { @@ -96,8 +96,8 @@ http.interceptors.request.use( config.header['Authorization'] = token; } // TODO 芋艿:特殊处理 - config.header['Accept'] = '*/*' - config.header['tenant-id'] = '1'; + config.header['Accept'] = '*/*'; + config.header['tenant-id'] = tenantId; config.header['terminal'] = '20'; // config.header['Authorization'] = 'Bearer test247'; return config; @@ -299,4 +299,4 @@ const request = (config) => { return http.middleware(config); }; -export default request; \ No newline at end of file +export default request;