update: 调整首页顶部头像为应用LOGO、调整启动页面,增加是否每次都显示判断

This commit is contained in:
小莫唐尼 2024-06-26 09:47:04 +08:00
parent aec54e8c5b
commit cc05b64dec
4 changed files with 33 additions and 14 deletions

View File

@ -6,7 +6,7 @@ export const DefaultAppConfigs = {
loveConfig: {},
imagesConfig: {},
authorConfig: {},
startConfig: {},
appConfig: {},
pluginConfig: {},
adConfig: {},
}
@ -27,4 +27,4 @@ export const getAppConfigs = () => {
*/
export const setAppConfigs = (configs) => {
uni.setStorageSync(_AppConfigKey, JSON.stringify(configs))
}
}

View File

@ -3,6 +3,8 @@
</template>
<script>
const homePagePath = '/pages/tabbar/home/home'
const startPagePath = '/pagesA/start/start'
export default {
computed: {
configs() {
@ -11,33 +13,42 @@ export default {
},
onLoad() {
uni.$tm.vx.actions('config/fetchConfigs').then((res) => {
console.log('正常:', res)
// #ifdef MP-WEIXIN
uni.$tm.vx.commit('setWxShare', res.shareConfig);
// #endif
this.fnCheckShowStarted();
}).catch((err) => {
console.log('异常:', err)
uni.switchTab({
url: '/pages/tabbar/home/home'
url: homePagePath
});
})
},
methods: {
fnCheckShowStarted() {
if (!this.configs.startConfig.enabled) {
if (!this.configs.appConfig.startConfig.enabled) {
uni.switchTab({
url: '/pages/tabbar/home/home'
url: homePagePath
});
return;
}
//
if (this.configs.appConfig.startConfig.alwaysShow) {
uni.removeStorageSync('APP_HAS_STARTED')
uni.redirectTo({
url: startPagePath
});
return;
}
//
if (uni.getStorageSync('APP_HAS_STARTED')) {
uni.switchTab({
url: '/pages/tabbar/home/home'
url: homePagePath
});
} else {
uni.redirectTo({
url: '/pagesA/start/start'
url: startPagePath
});
}
}

View File

@ -1,7 +1,9 @@
<template>
<view class="app-page">
<tm-menubars iconColor="white" color="white" :flat="true" :showback="false">
<image slot="left" class="logo ml-24 round-24" :src="bloggerInfo.avatar" mode="scaleToFill"></image>
<view slot="left">
<image class="logo ml-24 round-24" :src="appInfo.logo" mode="scaleToFill"/>
</view>
<view class="search-input round-12 pt-12 pb-12 flex pl-24" @click="fnToSearch">
<text class="search-input_icon iconfont text-size-m icon-search text-grey"></text>
<view class="search-input_text pl-12 text-size-m text-grey">搜索文章...</view>
@ -118,14 +120,20 @@ export default {
categoryList: [],
};
},
computed: {
haloConfigs() {
return this.$tm.vx.getters().getConfigs;
},
bloggerInfo() {
let blogger = this.$tm.vx.getters().getConfigs.authorConfig.blogger;
console.log('blogger----------------', blogger)
const blogger = this.$tm.vx.getters().getConfigs.authorConfig.blogger;
blogger.avatar = this.$utils.checkAvatarUrl(blogger.avatar, true);
return blogger;
},
appInfo() {
const appInfo = this.haloConfigs.appConfig.appInfo;
appInfo.logo = this.$utils.checkImageUrl(appInfo.logo)
return appInfo;
}
},
onLoad() {
this.fnSetPageTitle();

View File

@ -68,7 +68,7 @@ export default {
},
computed: {
startConfig() {
return this.$tm.vx.getters().getConfigs.startConfig;
return this.$tm.vx.getters().getConfigs.appConfig.startConfig;
},
pageStyle() {
if (this.startConfig.bg) {