no message

cyl/job_im_cus
jscyl13849007907 3 weeks ago
parent b965aa5a6f
commit cf35134ba5

@ -19,7 +19,7 @@ export default {
list: { type: Array, default: () => [] }, list: { type: Array, default: () => [] },
noScroll: { type: Boolean, default: true }, noScroll: { type: Boolean, default: true },
current: { type: Number, default: 0 }, current: { type: Number, default: 0 },
activeColor: { type: String, default: getApp().globalData.themeColor }, activeColor: { type: String, default: "" },
fontSize: { type: [String, Number], default: 32 }, fontSize: { type: [String, Number], default: 32 },
activeFontWeight: { type: [String, Number], default: 600 }, activeFontWeight: { type: [String, Number], default: 600 },
normalColor: { type: String, default: "#333333" }, normalColor: { type: String, default: "#333333" },
@ -33,7 +33,7 @@ export default {
}, },
created() { created() {
uni.$on('themeChanged', (color) => { uni.$on('themeChanged', (color) => {
if (!this.activeColor || this.activeColor === this.currentActiveColor) { if (!this.activeColor) {
this.currentActiveColor = color; this.currentActiveColor = color;
} }
}); });
@ -41,6 +41,13 @@ export default {
beforeDestroy() { beforeDestroy() {
uni.$off('themeChanged'); uni.$off('themeChanged');
}, },
watch: {
activeColor(newVal) {
if (newVal) {
this.currentActiveColor = newVal;
}
},
},
computed: { computed: {
activeIndex() { activeIndex() {
return this.current; return this.current;

@ -322,6 +322,7 @@
}, },
onShow() { onShow() {
let that = this; let that = this;
that.themeColor = getApp().globalData.themeColor;
uni.removeStorageSync("last_called_getCoziInfo"); uni.removeStorageSync("last_called_getCoziInfo");
// console.log('==============',this.G.store()) // console.log('==============',this.G.store())
if (uni.getStorageSync("apply-token")) { if (uni.getStorageSync("apply-token")) {

@ -201,6 +201,7 @@ export default {
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
this.themeColor = getApp().globalData.themeColor;
var that = this; var that = this;
// that.userinfo = uni.getStorageSync("apply-userinfo") || {}; // that.userinfo = uni.getStorageSync("apply-userinfo") || {};
that.getBannerList(); that.getBannerList();

@ -199,7 +199,9 @@ export default {
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() {}, onShow() {
this.themeColor = getApp().globalData.themeColor;
},
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */

@ -162,6 +162,11 @@
} }
} }
}, },
created(){
uni.$on('themeChanged', (color) => {
this.themeColor = color;
});
},
methods:{ methods:{
handleUpdateMenu($item,$index){ handleUpdateMenu($item,$index){
let that = this; let that = this;

@ -316,6 +316,7 @@ export default {
}, },
onShow() { onShow() {
let that = this; let that = this;
that.themeColor = getApp().globalData.themeColor;
let skipRefresh = uni.getStorageSync("HOME_SKIP_REFRESH"); let skipRefresh = uni.getStorageSync("HOME_SKIP_REFRESH");
if (skipRefresh) { if (skipRefresh) {
uni.removeStorageSync("HOME_SKIP_REFRESH"); uni.removeStorageSync("HOME_SKIP_REFRESH");

@ -647,7 +647,7 @@ import { h, ref, onMounted, onBeforeMount, watch, getCurrentInstance, computed,
import { onLoad, onShow, onHide } from "@dcloudio/uni-app"; import { onLoad, onShow, onHide } from "@dcloudio/uni-app";
const G = getCurrentInstance().appContext.app.config.globalProperties.G; const G = getCurrentInstance().appContext.app.config.globalProperties.G;
const api = getCurrentInstance().appContext.app.config.globalProperties.api; const api = getCurrentInstance().appContext.app.config.globalProperties.api;
const themeColor = getApp().globalData.themeColor; const themeColor = ref(getApp().globalData.themeColor);
let sseTest = ref(null); // sse let sseTest = ref(null); // sse
import { locationList } from "../../libs/utils/locationList.js"; import { locationList } from "../../libs/utils/locationList.js";
import color from "../../libs/utils/color"; import color from "../../libs/utils/color";
@ -1181,10 +1181,9 @@ onMounted(() => {
}); });
} }
getAiToken(); getAiToken();
uni.$on('themeChanged', (color) => {
themeColor.value = color;
});
getScrollViewScrollTop();
// //
formInfo.value.returnFeeType = 0; formInfo.value.returnFeeType = 0;

@ -277,6 +277,9 @@ export default {
}, },
created() { created() {
let that = this; let that = this;
uni.$on('themeChanged', (color) => {
that.themeColor = color;
});
that.defaultLogo = uni.getStorageSync("miniApp-info").logo; that.defaultLogo = uni.getStorageSync("miniApp-info").logo;
this.jobArray = this.list; this.jobArray = this.list;
}, },

@ -7,7 +7,7 @@
> >
<view :class="paddingBottom"> <view :class="paddingBottom">
<view class="g_flex_row_center"> <view class="g_flex_row_center">
<u-loading mode="circle" :size="size" :color="primaryColor"></u-loading> <u-loading mode="circle" :size="size" :color="resolvedColor"></u-loading>
</view> </view>
<view class="g_fs_14 g_c_9 g_flex_row_center g_mt_10" v-if="text != 'empty'">{{ text }}</view> <view class="g_fs_14 g_c_9 g_flex_row_center g_mt_10" v-if="text != 'empty'">{{ text }}</view>
</view> </view>
@ -52,10 +52,25 @@ export default {
}, },
primaryColor:{ primaryColor:{
default:()=>{ 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;
}
},
}; };
</script> </script>

Loading…
Cancel
Save