mirror of
https://github.com/ialley-workshop-open/uni-halo.git
synced 2026-06-12 13:19:31 +08:00
1. 优化密码访问,实现联动插件动态启用关闭;
2. 文章海报分享支持动态小程序码; 3. 支持扫描文章海报跳转指定文章详情;
This commit is contained in:
+33
-11
@@ -5,24 +5,37 @@
|
||||
<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() {
|
||||
uni.$tm.vx.actions('config/fetchConfigs').then((res) => {
|
||||
// #ifdef MP-WEIXIN
|
||||
// uni.$tm.vx.commit('setWxShare', res.shareConfig);
|
||||
// #endif
|
||||
this.fnCheckShowStarted();
|
||||
}).catch((err) => {
|
||||
uni.switchTab({
|
||||
url: homePagePath
|
||||
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) {
|
||||
@@ -51,6 +64,15 @@ export default {
|
||||
url: startPagePath
|
||||
});
|
||||
}
|
||||
},
|
||||
async getPostIdByQRCode(key) {
|
||||
const response = await this.$httpApi.v2.getQRCodeInfo(key);
|
||||
if (response) {
|
||||
if(response && response.postId) {
|
||||
return response.postId;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user