diff --git a/.env b/.env index 0ed20e9..c647c59 100644 --- a/.env +++ b/.env @@ -25,16 +25,16 @@ VITE_OAUTH2_APP_CLIENT='mini:mini' # VITE_ZZD_CORP_ID= # --------------------------- 开发环境 api地址 ---------------------------------- -VITE_APP_DEV_SERVICE = https://www.pjzhhq.cn/api # 域名线上 +# VITE_APP_DEV_SERVICE = https://www.pjzhhq.cn/api # 域名线上 #VITE_APP_DEV_SERVICE = http://59.202.170.152:81/api # 信创线上 -# VITE_APP_DEV_SERVICE = https://dzc-test-1.fy.takin.cc # 邓-本地 + VITE_APP_DEV_SERVICE = https://dzc-test-1.fy.takin.cc # 邓-本地 # VITE_APP_DEV_SERVICE = http://127.0.0.1:9999 # 邓-本地 # VITE_APP_DEV_SERVICE = http://123.157.250.162:8089/api # 测试线上 # --------------------------- 开发环境 图片访问基础地址 --------------------------- -VITE_IMAGE_DEV_PATH = https://www.pjzhhq.cn/api # 域名线上 +# VITE_IMAGE_DEV_PATH = https://www.pjzhhq.cn/api # 域名线上 #VITE_IMAGE_DEV_PATH = http://59.202.170.152:81/api # 信创线上 -# VITE_IMAGE_DEV_PATH = https://dzc-test-1.fy.takin.cc # 邓-本地 +VITE_IMAGE_DEV_PATH = https://dzc-test-1.fy.takin.cc # 邓-本地 # VITE_IMAGE_DEV_PATH = http://127.0.0.1:9999 # VITE_IMAGE_DEV_PATH = http://123.157.250.162:8089/api # 测试线上 diff --git a/.gitignore b/.gitignore index 28561a1..ffe6602 100644 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,11 @@ dist *.sln *.sw? -.env \ No newline at end of file +.env + +# AI 辅助工具生成文件(ZCode 等) +.zcode/ +.zcodeignore +.mimosa/ +.v2c/ +.video_agent/ \ No newline at end of file diff --git a/src/pages/merchant/brandDetail.vue b/src/pages/merchant/brandDetail.vue index e49e6c9..bf3496b 100644 --- a/src/pages/merchant/brandDetail.vue +++ b/src/pages/merchant/brandDetail.vue @@ -1,5 +1,5 @@ + + diff --git a/src/pages/tabbar/coopMerchant.vue b/src/pages/tabbar/coopMerchant.vue index e50daae..95af28f 100644 --- a/src/pages/tabbar/coopMerchant.vue +++ b/src/pages/tabbar/coopMerchant.vue @@ -60,6 +60,55 @@ const toDetail = async (v: any) => { uni.showToast({ title: "合作商家类型未知", icon: "none" }) } } + +const isBrand = (v: any) => v.supType == "10" || v.supType == "50" +const hasBranch = (v: any) => isBrand(v) && Number(v.mchCount) > 0 + +const jobTimeText = (v: any) => { + if (!v.jobTime || v.jobTime == ",,") return "" + const labels = ["早", "中", "晚"] + return v.jobTime + .split(",") + .map((s: string, i: number) => (s ? `${labels[i]} ${s}` : "")) + .filter(Boolean) + .join(" · ") +} + +// 后端对过大 size 的分页查询会返回空列表,这里用小分页循环拉全量 +const loadBranches = async (v: any) => { + v._loading = true + try { + const size = 10 + const all: any[] = [] + for (let current = 1; current <= 50; current++) { + const res: any = await merchantApi.childrenPage({ current, size, type: "2", parentId: v.id }) + if (res.code != 0) throw new Error(res.msg || "分店加载失败") + const records = res.data?.records || [] + all.push(...records) + if (records.length < size || all.length >= Number(res.data?.total || 0)) break + } + v._children = all + // 空结果不缓存,避免一次异常返回空后本次会话内再也刷不出来 + v._childrenLoaded = all.length > 0 + } catch (error: any) { + v._expanded = false + uni.showToast({ title: error?.message || "分店加载失败", icon: "none" }) + } finally { + v._loading = false + } +} + +const toggleBranch = async (v: any) => { + v._expanded = !v._expanded + if (v._expanded && !v._childrenLoaded && !v._loading) await loadBranches(v) +} + +const toBranchDetail = async (b: any) => { + const isLogin = await hooks.useCheckLogin() + if (isLogin) { + router.jump("/pages/merchant/detail", { id: b.id }) + } +} - - - - - {{ v.name }} - - - - - - - - {{ v.phone }} - + + + + + + {{ v.name }} + 品牌店 + + + + + {{ v.discountsPrice }} + + + + + {{ jobTimeText(v) }} + + + + + {{ v.phone }} - {{ v.deptName.length > 5 ? v.deptName.substring(0, 5) - + "..." : - v.deptName }} + + {{ v.deptName.length > 5 ? v.deptName.substring(0, 5) + "..." : v.deptName }} + - - 营业时间: - {{ v.jobTime?.split(",")[0] ? "早:" + v.jobTime?.split(",")[0] : "" }} - {{ v.jobTime?.split(",")[1] ? "中:" + v.jobTime?.split(",")[1] : "" }} - {{ v.jobTime?.split(",")[2] ? "晚:" + v.jobTime?.split(",")[2] : "" }} + + + {{ v.addressDes }} - - - 地址: - {{ v.addressDes }} + + + + + + + + 分店 · {{ v.mchCount }}家 + + {{ v._expanded ? "收起" : "展开" }} + + + + + + 分店加载中... + + +