From ceba1cabecea38b1f05b7a2e035a2f61569eda73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Fri, 17 Jul 2026 11:36:15 +0800 Subject: [PATCH] =?UTF-8?q?fix(store):=20=E4=BF=AE=E5=A4=8D=E5=BA=97?= =?UTF-8?q?=E5=91=98=E5=88=97=E8=A1=A8=E6=8B=89=E5=8F=96=E9=80=BB=E8=BE=91?= =?UTF-8?q?=EF=BC=8C=E4=BF=9D=E8=AF=81=E6=95=B0=E6=8D=AE=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 获取当前登录店员的 storeId,避免使用无效 storeId 查询 - 根据 storeId 拉取本门店店员列表,修复空列表问题 - 加载失败时提示“加载店员失败” - 提示门店信息未就绪时的用户反馈 - 默认选中当前登录用户对应的店员项 --- src/pages/store/orders/index.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/pages/store/orders/index.tsx b/src/pages/store/orders/index.tsx index 9f5b134..446f320 100644 --- a/src/pages/store/orders/index.tsx +++ b/src/pages/store/orders/index.tsx @@ -462,8 +462,21 @@ export default function StoreOrdersPage() { setShowShipModal(true) setLoadingClerks(true) try { - const res = await listShopStoreUser() + // 获取当前登录店员(含 storeId / userId), + // 用 storeId 拉取本门店店员列表,避免 ?storeId=0 拉不到数据 + const myClerk = await getMyClerk() + const storeId = myClerk?.storeId + if (!storeId) { + Taro.showToast({title: '门店信息未就绪,请稍后再试', icon: 'none'}) + return + } + const res = await listShopStoreUser({storeId}) setClerkList(res || []) + // 默认选中与当前登录用户 userId 一致的店员 + if (res && myClerk?.userId) { + const match = res.find(c => c.userId === myClerk!.userId) + if (match) setSelectedClerkId(match.id ?? null) + } } catch (e) { Taro.showToast({title: '加载店员失败', icon: 'none'}) } finally {