From bbe336d90224f42ebd5569aa92406cef5eb3f01a Mon Sep 17 00:00:00 2001 From: "pikachu1995@126.com" Date: Fri, 9 Oct 2026 15:50:56 +0800 Subject: [PATCH] =?UTF-8?q?fix(theme):=20=E4=BC=98=E5=8C=96=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E8=89=B2=E8=AE=BE=E7=BD=AE=E5=8A=9F=E8=83=BD=E5=B9=B6?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BB=A4=E7=89=8C=E5=88=B7=E6=96=B0=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除楼层列表中的主题色设置按钮及路由 - 重构主题色设置页面,新增系统预设色系和自定义模式 - 添加移动端真实页面预览功能,支持商品详情和订单页面预览 - 优化商品详情页优惠券展示样式和布局 - 修复买家端API刷新令牌请求的拦截器递归死锁问题 - 添加无refreshToken时的刷新请求保护机制 --- buyer/src/api/index.js | 3 + .../src/components/goodsDetail/ShowGoods.vue | 139 +-- buyer/src/plugins/request.js | 13 +- manager/src/router/router.js | 6 - .../src/views/page-decoration/floorList.vue | 5 - .../views/page-decoration/theme-setting.vue | 954 ++++++++++++++++-- .../src/views/page-decoration/wap/wapList.vue | 4 - 7 files changed, 981 insertions(+), 143 deletions(-) diff --git a/buyer/src/api/index.js b/buyer/src/api/index.js index 731937be1..7321361be 100644 --- a/buyer/src/api/index.js +++ b/buyer/src/api/index.js @@ -63,6 +63,9 @@ export function handleRefreshToken(token) { url: `/buyer/passport/member/refresh/${token}`, method: Method.GET, needToken: false, + // 刷新令牌请求自身不再进入 401/403 刷新分支,避免拦截器递归死锁;失败也不弹全局错误提示 + skipAuthHandler: true, + skipMessage: true, }); } diff --git a/buyer/src/components/goodsDetail/ShowGoods.vue b/buyer/src/components/goodsDetail/ShowGoods.vue index 7a7ada8e3..3d4d02d63 100644 --- a/buyer/src/components/goodsDetail/ShowGoods.vue +++ b/buyer/src/components/goodsDetail/ShowGoods.vue @@ -102,42 +102,40 @@
-
- 优惠券 - - - 满{{ item.consumeThreshold }}减{{ item.price }} - 满{{ item.consumeThreshold }}打{{ - item.couponDiscount - }}折 - + 优惠券 +
+ + 满{{ item.consumeThreshold }}减{{ item.price }} + 满{{ item.consumeThreshold }}打{{ + item.couponDiscount + }}折
@@ -898,62 +896,75 @@ export default { .item-price-coupon-row { display: flex; - align-items: center; - margin: 5px 0px; + align-items: flex-start; + margin: 8px 0px; + + .item-price-title { + flex-shrink: 0; + line-height: 22px; + } } -.Ellipsis { - overflow: hidden; - display: -webkit-box; - -webkit-line-clamp: 2; //控制显示几行 - -webkit-box-orient: vertical; //webbox方向 +.coupon-tags { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 6px; } .dropdown { position: relative; - display: inline-block; + display: inline-flex; + align-items: center; cursor: pointer; z-index: 999; } -.dropdown .item-coupon { - display: flex; - align-content: center; - align-items: center; - color: $theme_color; - margin: 5px 0; - font-size: 14px; - background-color: var(--theme-tint-12, #ffdedf); - border: 1px dotted $theme_color; - cursor: pointer; +.dropdown-more { + font-size: 12px; + color: #999; + line-height: 22px; + white-space: nowrap; - span { - padding: 3px; + &:hover { + color: $theme_color; } } + .dropdown-content { display: none; position: absolute; - background-color: #f9f9f9; - min-width: 160px; - box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2); - padding: 12px 16px; + top: 24px; + left: 0; + background-color: #fff; + min-width: 220px; + max-width: 320px; + border-radius: 8px; + box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12); + padding: 12px; + flex-wrap: wrap; + gap: 6px; } .dropdown:hover .dropdown-content { - display: block; + display: flex; } .item-coupon { - margin-right: 5px; - padding: 0 5px; + position: relative; + padding: 2px 10px; color: $theme_color; - font-size: 14px; - background-color: var(--theme-tint-12, #ffdedf); - border: 1px dotted $theme_color; + font-size: 12px; + line-height: 18px; + background-color: #fff; + border: 1px solid $theme_color; + border-radius: 3px; cursor: pointer; + transition: background-color 0.2s, color 0.2s; + white-space: nowrap; - span { - padding: 3px; + &:hover { + background-color: $theme_color; + color: #fff; } } .item-promotion { diff --git a/buyer/src/plugins/request.js b/buyer/src/plugins/request.js index d1ac42961..6c546e328 100644 --- a/buyer/src/plugins/request.js +++ b/buyer/src/plugins/request.js @@ -161,9 +161,10 @@ service.interceptors.response.use( const errorData = errorResponse.data || {}; if ( - errorResponse.status === 401 || - errorResponse.status === 403 || - error.response?.data?.code === 20004 + !error.config?.skipAuthHandler && + (errorResponse.status === 401 || + errorResponse.status === 403 || + error.response?.data?.code === 20004) ) { isRefreshToken++; if (isRefreshToken === 1) { @@ -212,8 +213,12 @@ function getTokenDebounce() { let success = false; return function () { if (!lock) { - lock = true; const oldRefreshToken = Storage.getItem("refreshToken"); + // 无 refreshToken(未登录)时不发起刷新请求,直接判失败,避免请求 /refresh/undefined 造成拦截器死锁 + if (!oldRefreshToken) { + return Promise.resolve("fail"); + } + lock = true; handleRefreshToken(oldRefreshToken) .then((res) => { if (res.success) { diff --git a/manager/src/router/router.js b/manager/src/router/router.js index 3c94850dd..8fea48abf 100644 --- a/manager/src/router/router.js +++ b/manager/src/router/router.js @@ -361,12 +361,6 @@ export const otherRouter = { name: "main", component: () => import("@/views/page-decoration/wap/main.vue") }, - { - path: "/floorList/theme-setting", - title: "主题色设置", - name: "theme-setting", - component: () => import("@/views/page-decoration/theme-setting.vue") - }, { path: "add-sms-sign", title: "短信签名", diff --git a/manager/src/views/page-decoration/floorList.vue b/manager/src/views/page-decoration/floorList.vue index 45be7eafd..aadcfa821 100644 --- a/manager/src/views/page-decoration/floorList.vue +++ b/manager/src/views/page-decoration/floorList.vue @@ -11,7 +11,6 @@
添加页面 - 主题色设置
@@ -169,10 +168,6 @@ export default { }); }, - goThemeSetting() { - this.$router.push({ name: "theme-setting" }); - }, - changePageNum(val) { this.searchForm.pageNumber = val; this.getTemplateList(); diff --git a/manager/src/views/page-decoration/theme-setting.vue b/manager/src/views/page-decoration/theme-setting.vue index 1858fed84..84c826bb5 100644 --- a/manager/src/views/page-decoration/theme-setting.vue +++ b/manager/src/views/page-decoration/theme-setting.vue @@ -1,77 +1,318 @@