From 686aed848d8d4151328e50881f196094cae22156 Mon Sep 17 00:00:00 2001 From: "pikachu1995@126.com" Date: Tue, 7 Jul 2026 09:39:32 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E6=A8=A1=E5=9D=97=E5=B9=B6=E4=BC=98=E5=8C=96=E5=A4=9A?= =?UTF-8?q?=E4=B8=AA=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/tabbar/home/template/tpl_group.vue | 97 ++- pages/tabbar/home/template/tpl_integral.vue | 61 +- pages/tabbar/home/template/tpl_join_group.vue | 90 --- pages/tabbar/home/template/tpl_spike.vue | 105 ++- pages/tabbar/home/template/tpl_video.vue | 168 +++++ pages/tabbar/home/views.vue | 644 +++++++++--------- pages/tabbar/special/special.vue | 6 +- pages/tabbar/user/utils/tool.vue | 12 +- 8 files changed, 714 insertions(+), 469 deletions(-) delete mode 100644 pages/tabbar/home/template/tpl_join_group.vue create mode 100644 pages/tabbar/home/template/tpl_video.vue diff --git a/pages/tabbar/home/template/tpl_group.vue b/pages/tabbar/home/template/tpl_group.vue index f869054..6d2e746 100644 --- a/pages/tabbar/home/template/tpl_group.vue +++ b/pages/tabbar/home/template/tpl_group.vue @@ -1,20 +1,30 @@ \ No newline at end of file +.join-box { + display: flex; +} +.item-price { + .price-text { + font-size: 15px; + font-weight: 500; + color: #e1212b; + } +} +.join-item { + flex: 1; + text-align: center; +} +.item-img { + width: 75px; + height: 75px; + margin: 0 auto; + display: block; +} +.item-img-box { + position: relative; +} +.item-line-through { + .price-text { + font-size: 10px; + font-weight: 400; + text-decoration: line-through; + color: #999; + } +} +.join-title { + display: flex; + justify-content: space-between; + align-items: center; + background: #fff; + height: 50px; + .join-title-name { + font-size: 16px; + font-weight: bold; + } + .join-title-more { + font-size: 12px; + color: #999; + } +} + diff --git a/pages/tabbar/home/template/tpl_integral.vue b/pages/tabbar/home/template/tpl_integral.vue index cbe7d73..199b122 100644 --- a/pages/tabbar/home/template/tpl_integral.vue +++ b/pages/tabbar/home/template/tpl_integral.vue @@ -1,20 +1,30 @@ \ No newline at end of file + diff --git a/pages/tabbar/home/template/tpl_join_group.vue b/pages/tabbar/home/template/tpl_join_group.vue deleted file mode 100644 index a040db0..0000000 --- a/pages/tabbar/home/template/tpl_join_group.vue +++ /dev/null @@ -1,90 +0,0 @@ - - - \ No newline at end of file diff --git a/pages/tabbar/home/template/tpl_spike.vue b/pages/tabbar/home/template/tpl_spike.vue index 6327e47..e0efb27 100644 --- a/pages/tabbar/home/template/tpl_spike.vue +++ b/pages/tabbar/home/template/tpl_spike.vue @@ -1,24 +1,30 @@ \ No newline at end of file +@import "./advertising.scss"; +.join-box { + display: flex; +} +.item-price { + .price-text { + font-size: 15px; + font-weight: 500; + color: #e1212b; + } +} +.join-item { + flex: 1; + text-align: center; +} +.item-img { + width: 75px; + height: 75px; + margin: 0 auto; + display: block; +} +.item-img-box { + position: relative; +} +.item-line-through { + .price-text { + font-size: 10px; + font-weight: 400; + text-decoration: line-through; + color: #999; + } +} +.join-title { + display: flex; + justify-content: space-between; + align-items: center; + background: #fff; + height: 50px; + .join-title-name { + font-size: 16px; + font-weight: bold; + } + .join-title-more { + font-size: 12px; + color: #999; + } +} + diff --git a/pages/tabbar/home/template/tpl_video.vue b/pages/tabbar/home/template/tpl_video.vue new file mode 100644 index 0000000..b145a71 --- /dev/null +++ b/pages/tabbar/home/template/tpl_video.vue @@ -0,0 +1,168 @@ + + + diff --git a/pages/tabbar/home/views.vue b/pages/tabbar/home/views.vue index 65a71fb..bef31e4 100644 --- a/pages/tabbar/home/views.vue +++ b/pages/tabbar/home/views.vue @@ -1,332 +1,312 @@ - - - - - + + + + + diff --git a/pages/tabbar/special/special.vue b/pages/tabbar/special/special.vue index f690194..4c58b38 100644 --- a/pages/tabbar/special/special.vue +++ b/pages/tabbar/special/special.vue @@ -41,9 +41,9 @@ - + @@ -66,6 +66,7 @@ import tpl_text_picture from "@/pages/tabbar/home/template/tpl_text_picture"; // import tpl_menu from "@/pages/tabbar/home/template/tpl_menu"; //五列菜单模块 import tpl_search from "@/pages/tabbar/home/template/tpl_search"; //搜索栏 import tpl_group from "@/pages/tabbar/home/template/tpl_group"; // +import tpl_video from "@/pages/tabbar/home/template/tpl_video"; //视频模块 import tpl_goods from "@/pages/tabbar/home/template/tpl_goods"; //商品分类以及分类中的商品 // 结束引用组件 import { toSpecial, getSpecial } from "@/api/home"; //获取楼层装修接口 @@ -102,7 +103,8 @@ export default { goods: tpl_goods, group: tpl_group, notice: tpl_notice, - promotions: tpl_promotions + promotions: tpl_promotions, + videoLayout: tpl_video }, mounted() { diff --git a/pages/tabbar/user/utils/tool.vue b/pages/tabbar/user/utils/tool.vue index 69fde88..1581c8b 100644 --- a/pages/tabbar/user/utils/tool.vue +++ b/pages/tabbar/user/utils/tool.vue @@ -19,10 +19,10 @@ 我的评价 - + @@ -181,9 +181,11 @@ export default { }, linkMsgDetail(){ - uni.navigateTo({ - url: `/pages/mine/im/list`, - }); + if (this.tipsToLogin('normal')) { + uni.navigateTo({ + url: '/pages/tabbar/home/title', + }); + } }, distribution() { From 23e3825366c41a5eef471a067bbb3bd91fcb198e Mon Sep 17 00:00:00 2001 From: "pikachu1995@126.com" Date: Tue, 7 Jul 2026 10:57:04 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=E5=AE=9E=E7=8E=B0=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD=EF=BC=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=A0=B7=E5=BC=8F=E5=92=8C=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 32 +++++++- api/common.js | 11 +++ main.js | 21 +++-- pages.json | 2 +- pages/cart/payment/shareOrderGoods.vue | 2 +- pages/mine/im/index-app.scss | 2 +- pages/tabbar/cart/cartList.vue | 2 +- pages/tabbar/category/category.vue | 2 +- pages/tabbar/home/index.vue | 2 +- pages/tabbar/home/template/advertising.scss | 2 +- pages/tabbar/home/template/tpl_group.vue | 2 +- pages/tabbar/home/template/tpl_integral.vue | 2 +- .../home/template/tpl_promotions_detail.vue | 8 +- pages/tabbar/home/template/tpl_spike.vue | 2 +- pages/tabbar/home/views.vue | 2 +- pages/tabbar/user/my.vue | 2 +- store/index.js | 21 ++++- uni.scss | 10 +-- utils/filters.js | 11 ++- utils/theme.js | 77 +++++++++++++++++++ 20 files changed, 183 insertions(+), 32 deletions(-) create mode 100644 utils/theme.js diff --git a/App.vue b/App.vue index caf4b61..57e52e6 100644 --- a/App.vue +++ b/App.vue @@ -8,6 +8,13 @@ import { } from "@/js_sdk/h5-copy/h5-copy.js"; import APPUpdate from "@/plugins/APPUpdate"; import storage from "@/utils/storage"; +import { getThemeSetting } from "@/api/common.js"; +import { + applyTabBarStyle, + cacheTheme, + loadCachedTheme, + normalizeTheme, +} from "@/utils/theme"; import { mapMutations } from "vuex"; @@ -36,6 +43,7 @@ import { * 监听返回(页面级 onBackPress 在 App.vue 不生效,保留空实现避免误导) */ onLaunch: function(val) { + this.initTheme(); if(val.query.inviter){ storage.setInviter(val.query.inviter) } @@ -69,7 +77,29 @@ import { // #endif }, methods: { - ...mapMutations(["login"]), + ...mapMutations(["login", "SET_THEME"]), + initTheme() { + const cached = loadCachedTheme(); + if (cached) { + this.SET_THEME(cached); + applyTabBarStyle(cached.mainColor); + } + getThemeSetting() + .then((res) => { + if (res.data && res.data.success && res.data.result && res.data.result.settingValue) { + try { + const raw = JSON.parse(res.data.result.settingValue); + const theme = normalizeTheme(raw); + this.SET_THEME(theme); + cacheTheme(theme); + applyTabBarStyle(theme.mainColor); + } catch (e) { + // 主题配置解析失败时使用缓存 + } + } + }) + .catch(() => {}); + }, /** * 微信小程序版本提交更新版本 解决缓存问题 */ diff --git a/api/common.js b/api/common.js index 20f7ce3..3050efc 100644 --- a/api/common.js +++ b/api/common.js @@ -30,3 +30,14 @@ export function getIMDetail() { * @type {string} */ export const upload = api.common + "/common/upload/file"; + +/** + * 获取主题色配置 + */ +export function getThemeSetting() { + return http.request({ + url: `${api.common}/common/common/site/theme`, + method: Method.GET, + message: false, + }); +} diff --git a/main.js b/main.js index 5b4c72f..e845274 100644 --- a/main.js +++ b/main.js @@ -1,4 +1,4 @@ -import { createSSRApp } from 'vue' +import { createSSRApp, computed } from 'vue' import App from './App' import uviewPlus, { setConfig } from 'uview-plus' import store from './store' @@ -6,6 +6,7 @@ import config from '@/config/config' import airBtn from '@/components/m-airbtn/index.vue' import mpShare from '@/utils/mpShare.js' import * as filterUtils from './utils/filters.js' +import { getThemeStyle } from '@/utils/theme' export function createApp() { const app = createSSRApp(App) @@ -40,9 +41,11 @@ export function createApp() { }) app.config.globalProperties.$store = store - app.config.globalProperties.$mainColor = config.mainColor - app.config.globalProperties.$lightColor = config.lightColor - app.config.globalProperties.$aiderLightColor = config.aiderLightColor + app.config.globalProperties.$mainColor = computed(() => store.getters.mainColor) + app.config.globalProperties.$lightColor = computed(() => store.getters.lightColor) + app.config.globalProperties.$aiderLightColor = computed( + () => store.getters.aiderLightColor + ) const filterMethods = {} Object.keys(filterUtils).forEach((key) => { @@ -50,7 +53,15 @@ export function createApp() { filterMethods[key] = filterUtils[key] } }) - app.mixin({ methods: filterMethods }) + + app.mixin({ + methods: filterMethods, + computed: { + themeStyle() { + return getThemeStyle(this.$store.state.theme) + }, + }, + }) app.mixin(mpShare) // #ifdef H5 diff --git a/pages.json b/pages.json index 489b660..1233801 100644 --- a/pages.json +++ b/pages.json @@ -855,7 +855,7 @@ }, "tabBar": { "color": "#666", - "selectedColor": "#ff573e", + "selectedColor": "#ff3c2a", "borderStyle": "black", "backgroundColor": "#ffffff", "list": [{ diff --git a/pages/cart/payment/shareOrderGoods.vue b/pages/cart/payment/shareOrderGoods.vue index b19878e..e8d300a 100644 --- a/pages/cart/payment/shareOrderGoods.vue +++ b/pages/cart/payment/shareOrderGoods.vue @@ -321,7 +321,7 @@ page { background: $main-color; } .disabled { - background: rgba($main-color, $alpha: 0.2); + background: var(--theme-primary-20, rgba(255, 60, 42, 0.2)); } .home { color: $main-color; diff --git a/pages/mine/im/index-app.scss b/pages/mine/im/index-app.scss index ebec467..3e1115c 100644 --- a/pages/mine/im/index-app.scss +++ b/pages/mine/im/index-app.scss @@ -5087,7 +5087,7 @@ scroll-view.cu-steps .cu-item { } .bg-user-orang { - background-color:rgba($main-color,0.1); + background-color: var(--theme-primary-10, rgba(255, 60, 42, 0.1)); color: black; } diff --git a/pages/tabbar/cart/cartList.vue b/pages/tabbar/cart/cartList.vue index 1f8c0d1..89b084d 100644 --- a/pages/tabbar/cart/cartList.vue +++ b/pages/tabbar/cart/cartList.vue @@ -1,5 +1,5 @@