From a159fbdb222382eb48c6f0deb62ede95db75dbf9 Mon Sep 17 00:00:00 2001 From: BAKEYi <16298417+bakeyi@user.noreply.gitee.com> Date: Thu, 23 Apr 2026 10:13:27 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=95=86=E5=AE=B6=E5=B7=A5=E4=BD=8D?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=9B=A0=E6=8E=A5=E5=8F=A3=E6=96=B0=E5=8A=A0?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=AF=BC=E8=87=B4=E7=9A=84=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E6=AD=A3=E5=B8=B8=E6=98=BE=E7=A4=BAbug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/shop/SellerDetail.vue | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pages/shop/SellerDetail.vue b/pages/shop/SellerDetail.vue index 8d7005c..2f9ae10 100644 --- a/pages/shop/SellerDetail.vue +++ b/pages/shop/SellerDetail.vue @@ -377,15 +377,18 @@ }) .then((res) => { if (this.identity == 0) { + // 商家视角:优先使用手艺人信息,若没有则使用商家自己的信息 + const provider = res.data.user_syr || res.data.user_sj || {}; this.orderInfo = res.data ? { - ...res.data.order, - ...res.data.work_seat, - ...res.data.user_syr, - work_hour_id: res.data.work_seat.id, - order_id: res.data.order.id, - user_sj_id: res.data.user_syr.id, + ...res.data.order, + ...res.data.work_seat, + ...provider, + work_hour_id: res.data.work_seat.id, + order_id: res.data.order.id, + user_sj_id: provider.id, } : {}; } else if (this.identity == 1) { + // 手艺人视角 this.orderInfo = res.data ? { ...res.data.order, ...res.data.work_hour, From 7a5181a63835985394f0d196a27b0a1eef07c614 Mon Sep 17 00:00:00 2001 From: BAKEYi <16298417+bakeyi@user.noreply.gitee.com> Date: Thu, 23 Apr 2026 10:23:34 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=95=86=E5=AE=B6=E5=B7=A5=E4=BD=8D?= =?UTF-8?q?=E3=80=81=E5=B7=A5=E6=97=B6=E8=AE=A2=E5=8D=95=E5=9B=A0=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=96=B0=E5=8A=A0=E5=AD=97=E6=AE=B5=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=9A=84=E9=A1=B5=E9=9D=A2=E4=B8=8D=E8=83=BD=E6=AD=A3=E5=B8=B8?= =?UTF-8?q?=E6=98=BE=E7=A4=BAbug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/shop/SellerDetail.vue | 15 +++++++-------- pages/shop/manHourDetail.vue | 5 +++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pages/shop/SellerDetail.vue b/pages/shop/SellerDetail.vue index 2f9ae10..47a86ab 100644 --- a/pages/shop/SellerDetail.vue +++ b/pages/shop/SellerDetail.vue @@ -377,15 +377,14 @@ }) .then((res) => { if (this.identity == 0) { - // 商家视角:优先使用手艺人信息,若没有则使用商家自己的信息 - const provider = res.data.user_syr || res.data.user_sj || {}; + const userSyr = res.data.user_syr || {}; // 避免 null 展开报错 this.orderInfo = res.data ? { - ...res.data.order, - ...res.data.work_seat, - ...provider, - work_hour_id: res.data.work_seat.id, - order_id: res.data.order.id, - user_sj_id: provider.id, + ...res.data.order, + ...res.data.work_seat, + ...userSyr, + work_hour_id: res.data.work_seat.id, + order_id: res.data.order.id, + syr_id: userSyr.id, // 用于判断是否有手艺人/顾客信息 } : {}; } else if (this.identity == 1) { // 手艺人视角 diff --git a/pages/shop/manHourDetail.vue b/pages/shop/manHourDetail.vue index 29fd098..5229af5 100644 --- a/pages/shop/manHourDetail.vue +++ b/pages/shop/manHourDetail.vue @@ -411,13 +411,14 @@ }) .then((res) => { if (this.identity == 0) { + const userSyr = res.data.user_syr || {}; // 避免 null 展开报错 this.orderInfo = res.data ? { ...res.data.order, ...res.data.work_hour, - ...res.data.user_syr, + ...userSyr, // 有手艺人就展开,没有就是空对象 work_hour_id: res.data.work_hour.id, order_id: res.data.order.id, - user_sj_id: res.data.user_syr.id, + syr_id: userSyr.id, // 手艺人ID(无手艺人时为 undefined) } : {}; console.log(this.orderInfo, '----------------------------------') } else if (this.identity == 1) {