From 16ec75360eef2b0d209ad6866c0bb348f909b20c Mon Sep 17 00:00:00 2001
From: dzc <2388224167@qq.com>
Date: Tue, 29 Sep 2026 20:00:47 +0800
Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.env | 8 +-
.gitignore | 9 +-
src/pages/merchant/brandDetail.vue | 224 ++++++++++++++++++-------
src/pages/tabbar/coopMerchant.vue | 255 +++++++++++++++++++++++++----
4 files changed, 401 insertions(+), 95 deletions(-)
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 @@
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
- {{ v.name }}
-
-
-
-
-
- {{ v.phone }}
-
-
-
- {{ 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 }}
-
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ state.detail.name }}
+ {{ isBranch ? "分店" : "品牌店" }}
+
+
+
+
+ {{ state.detail.discountsPrice }}
+
+
+
+
+
+ {{ state.detail.phone }}
+
+ {{ state.detail.deptName.length > 5 ? state.detail.deptName.substring(0, 5) + "..." : state.detail.deptName }}
+
+
+
+
+ {{ jobTimeText(state.detail) }}
+
+
+
+ {{ state.detail.addressDes }}
-
-
-
+
+
+
+
+
+ 所属品牌
+ {{ state.parent.name }}
+
+
+
+
+
+
+ 分店列表
+ ({{ state.detail.mchCount }}家)
+
+
+
+
+
+ {{ v.name }}
+
+
+
+
+ {{ v.discountsPrice }}
+
+
+
+ {{ v.phone }}
+
+
+
+ {{ v.addressDes }}
+
+
+
+
+
+
+
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 })
+ }
+}
@@ -71,11 +120,11 @@ const toDetail = async (v: any) => {
+ fontSize="28" :showClear="true" :focus="false" placeholder="搜索商家名称"
+ :focus-highlight="false" color="#ffffff"
+ style="border-radius: 36rpx; box-shadow: 0 6rpx 20rpx rgba(7, 121, 253, 0.1)">
- 搜 索
+ 搜索
@@ -84,39 +133,185 @@ const toDetail = async (v: any) => {
-
-
-
-
- {{ 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 ? "收起" : "展开" }}
+
+
+
+
+
+ 分店加载中...
+
+
+
+
+
+
+
+ {{ b.name }}
+
+ {{ b.addressDes || b.phone }}
+
+
+
+
+ 暂无分店信息
+
+
+