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 {