1
0
mirror of https://github.com/ialley-workshop-open/uni-halo.git synced 2026-06-12 21:29:31 +08:00

fix: 修复编译到app时,启动页按钮样式丢失问题

This commit is contained in:
小莫唐尼
2024-10-17 11:28:13 +08:00
parent 82062d9465
commit a98254e6cc
3 changed files with 535 additions and 512 deletions
+72 -72
View File
@@ -1,79 +1,79 @@
<template>
<view class="app-page"></view>
<view class="app-page"></view>
</template>
<script>
const homePagePath = '/pages/tabbar/home/home'
const startPagePath = '/pagesA/start/start'
const articleDetailPath = '/pagesA/article-detail/article-detail';
export default {
computed: {
configs() {
return this.$tm.vx.getters().getConfigs;
}
},
onLoad: function (options) {
uni.$tm.vx.actions('config/fetchConfigs').then(async (res) => {
if (options.scene) {
if ('' !== options.scene) {
const postId = await this.getPostIdByQRCode(options.scene);
if (postId) {
uni.redirectTo({
url: articleDetailPath + `?name=${postId}`,
animationType: 'slide-in-right'
});
}
}
}
const homePagePath = '/pages/tabbar/home/home'
const startPagePath = '/pagesA/start/start'
const articleDetailPath = '/pagesA/article-detail/article-detail';
export default {
computed: {
configs() {
return this.$tm.vx.getters().getConfigs;
}
},
onLoad: function(options) {
uni.$tm.vx.actions('config/fetchConfigs').then(async (res) => {
if (options.scene) {
if ('' !== options.scene) {
const postId = await this.getPostIdByQRCode(options.scene);
if (postId) {
uni.redirectTo({
url: articleDetailPath + `?name=${postId}`,
animationType: 'slide-in-right'
});
}
}
}
// #ifdef MP-WEIXIN
// uni.$tm.vx.commit('setWxShare', res.shareConfig);
// #endif
this.fnCheckShowStarted();
}).catch((err) => {
uni.switchTab({
url: homePagePath
});
})
},
methods: {
fnCheckShowStarted() {
if (!this.configs.appConfig.startConfig.enabled) {
uni.switchTab({
url: homePagePath
});
return;
}
// #ifdef MP-WEIXIN
// uni.$tm.vx.commit('setWxShare', res.shareConfig);
// #endif
this.fnCheckShowStarted();
}).catch((err) => {
uni.switchTab({
url: homePagePath
});
})
},
methods: {
fnCheckShowStarted() {
if (!this.configs.appConfig.startConfig.enabled) {
uni.switchTab({
url: homePagePath
});
return;
}
// 是否每次都显示启动页
if (this.configs.appConfig.startConfig.alwaysShow) {
uni.removeStorageSync('APP_HAS_STARTED')
uni.redirectTo({
url: startPagePath
});
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: homePagePath
});
} else {
uni.redirectTo({
url: startPagePath
});
}
},
async getPostIdByQRCode(key) {
const response = await this.$httpApi.v2.getQRCodeInfo(key);
if (response) {
if(response && response.postId) {
return response.postId;
}
}
return null;
}
}
};
</script>
// 只显示一次启动页
if (uni.getStorageSync('APP_HAS_STARTED')) {
uni.switchTab({
url: homePagePath
});
} else {
uni.redirectTo({
url: startPagePath
});
}
},
async getPostIdByQRCode(key) {
const response = await this.$httpApi.v2.getQRCodeInfo(key);
if (response) {
if (response && response.postId) {
return response.postId;
}
}
return null;
}
}
};
</script>
+1 -1
View File
@@ -9,7 +9,7 @@
<view class="search-input_text pl-12 text-size-m text-grey">搜索内容...</view>
</view>
<!-- #ifdef APP-PLUS || H5 -->
<view slot="right" class="mr-24 text-size-m text-grey">{{ appInfo.name }}</view>
<view slot="right" class="mr-24 text-size-m text-grey text-overflow">{{ appInfo.name }}</view>
<!-- #endif -->
</tm-menubars>
<view v-if="loading !== 'success' && articleList.length===0" class="loading-wrap">