diff --git a/components/custom-tabs.vue b/components/custom-tabs.vue index f9721ea..629be30 100644 --- a/components/custom-tabs.vue +++ b/components/custom-tabs.vue @@ -19,7 +19,7 @@ export default { list: { type: Array, default: () => [] }, noScroll: { type: Boolean, default: true }, current: { type: Number, default: 0 }, - activeColor: { type: String, default: getApp().globalData.themeColor }, + activeColor: { type: String, default: "" }, fontSize: { type: [String, Number], default: 32 }, activeFontWeight: { type: [String, Number], default: 600 }, normalColor: { type: String, default: "#333333" }, @@ -33,7 +33,7 @@ export default { }, created() { uni.$on('themeChanged', (color) => { - if (!this.activeColor || this.activeColor === this.currentActiveColor) { + if (!this.activeColor) { this.currentActiveColor = color; } }); @@ -41,6 +41,13 @@ export default { beforeDestroy() { uni.$off('themeChanged'); }, + watch: { + activeColor(newVal) { + if (newVal) { + this.currentActiveColor = newVal; + } + }, + }, computed: { activeIndex() { return this.current; diff --git a/pages/addJob/index.vue b/pages/addJob/index.vue index e52041e..ccb0af5 100644 --- a/pages/addJob/index.vue +++ b/pages/addJob/index.vue @@ -322,6 +322,7 @@ }, onShow() { let that = this; + that.themeColor = getApp().globalData.themeColor; uni.removeStorageSync("last_called_getCoziInfo"); // console.log('==============',this.G.store()) if (uni.getStorageSync("apply-token")) { diff --git a/pages/home/child/promotion.vue b/pages/home/child/promotion.vue index e587b05..d9a7966 100644 --- a/pages/home/child/promotion.vue +++ b/pages/home/child/promotion.vue @@ -201,6 +201,7 @@ export default { * 生命周期函数--监听页面显示 */ onShow() { + this.themeColor = getApp().globalData.themeColor; var that = this; // that.userinfo = uni.getStorageSync("apply-userinfo") || {}; that.getBannerList(); diff --git a/pages/home/child/promotion_jd.vue b/pages/home/child/promotion_jd.vue index 5f098a5..ec20171 100644 --- a/pages/home/child/promotion_jd.vue +++ b/pages/home/child/promotion_jd.vue @@ -199,7 +199,9 @@ export default { /** * 生命周期函数--监听页面显示 */ - onShow() {}, + onShow() { + this.themeColor = getApp().globalData.themeColor; + }, /** * 生命周期函数--监听页面隐藏 */ diff --git a/pages/home/child/select.vue b/pages/home/child/select.vue index 8b0df38..a8a987d 100644 --- a/pages/home/child/select.vue +++ b/pages/home/child/select.vue @@ -162,6 +162,11 @@ } } }, + created(){ + uni.$on('themeChanged', (color) => { + this.themeColor = color; + }); + }, methods:{ handleUpdateMenu($item,$index){ let that = this; diff --git a/pages/home/index.vue b/pages/home/index.vue index 6924ef3..9fb2ca5 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -316,6 +316,7 @@ export default { }, onShow() { let that = this; + that.themeColor = getApp().globalData.themeColor; let skipRefresh = uni.getStorageSync("HOME_SKIP_REFRESH"); if (skipRefresh) { uni.removeStorageSync("HOME_SKIP_REFRESH"); diff --git a/uni_modules/rh-ui/components/rh-job-form/rh-job-form.vue b/uni_modules/rh-ui/components/rh-job-form/rh-job-form.vue index 3b3d320..46877a3 100644 --- a/uni_modules/rh-ui/components/rh-job-form/rh-job-form.vue +++ b/uni_modules/rh-ui/components/rh-job-form/rh-job-form.vue @@ -647,7 +647,7 @@ import { h, ref, onMounted, onBeforeMount, watch, getCurrentInstance, computed, import { onLoad, onShow, onHide } from "@dcloudio/uni-app"; const G = getCurrentInstance().appContext.app.config.globalProperties.G; const api = getCurrentInstance().appContext.app.config.globalProperties.api; -const themeColor = getApp().globalData.themeColor; +const themeColor = ref(getApp().globalData.themeColor); let sseTest = ref(null); // sse请求的实例 import { locationList } from "../../libs/utils/locationList.js"; import color from "../../libs/utils/color"; @@ -1181,10 +1181,9 @@ onMounted(() => { }); } getAiToken(); - - - - getScrollViewScrollTop(); + uni.$on('themeChanged', (color) => { + themeColor.value = color; + }); // 给佣金和薪资重新赋默认值 formInfo.value.returnFeeType = 0; diff --git a/uni_modules/rh-ui/components/rh-job-list/rh-job-list.vue b/uni_modules/rh-ui/components/rh-job-list/rh-job-list.vue index fd9c8e1..a7bcc78 100644 --- a/uni_modules/rh-ui/components/rh-job-list/rh-job-list.vue +++ b/uni_modules/rh-ui/components/rh-job-list/rh-job-list.vue @@ -277,6 +277,9 @@ export default { }, created() { let that = this; + uni.$on('themeChanged', (color) => { + that.themeColor = color; + }); that.defaultLogo = uni.getStorageSync("miniApp-info").logo; this.jobArray = this.list; }, diff --git a/uni_modules/rh-ui/components/rh-loading/rh-loading.vue b/uni_modules/rh-ui/components/rh-loading/rh-loading.vue index f5a0622..1359a86 100644 --- a/uni_modules/rh-ui/components/rh-loading/rh-loading.vue +++ b/uni_modules/rh-ui/components/rh-loading/rh-loading.vue @@ -7,7 +7,7 @@ > - + {{ text }} @@ -52,10 +52,25 @@ export default { }, primaryColor:{ default:()=>{ - return getApp().globalData.themeColor || '#3578f6'; + return ""; } } }, + data() { + return { + currentThemeColor: getApp().globalData.themeColor || '#3578f6', + }; + }, + created() { + uni.$on('themeChanged', (color) => { + this.currentThemeColor = color || '#3578f6'; + }); + }, + computed: { + resolvedColor() { + return this.primaryColor || this.currentThemeColor; + } + }, };