mirror of
https://github.com/ialley-workshop-open/uni-halo.git
synced 2025-05-19 01:50:15 +09:00
update: 调整获取模拟参数请求策略
This commit is contained in:
parent
e8edc03526
commit
7c15c84dba
@ -1,84 +1,86 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="app-page"></view>
|
<view class="app-page"></view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const homePagePath = '/pages/tabbar/home/home'
|
const homePagePath = '/pages/tabbar/home/home'
|
||||||
const startPagePath = '/pagesA/start/start'
|
const startPagePath = '/pagesA/start/start'
|
||||||
const articleDetailPath = '/pagesA/article-detail/article-detail';
|
const articleDetailPath = '/pagesA/article-detail/article-detail';
|
||||||
export default {
|
export default {
|
||||||
computed: {
|
computed: {
|
||||||
configs() {
|
configs() {
|
||||||
return this.$tm.vx.getters().getConfigs;
|
return this.$tm.vx.getters().getConfigs;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad: function(options) {
|
onLoad: function (options) {
|
||||||
uni.$tm.vx.actions('config/fetchConfigs').then(async (res) => {
|
uni.$tm.vx.actions('config/fetchConfigs').then(async (res) => {
|
||||||
if (options.scene) {
|
if (options.scene) {
|
||||||
if ('' !== options.scene) {
|
if ('' !== options.scene) {
|
||||||
const postId = await this.getPostIdByQRCode(options.scene);
|
const postId = await this.getPostIdByQRCode(options.scene);
|
||||||
if (postId) {
|
if (postId) {
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: articleDetailPath + `?name=${postId}`,
|
url: articleDetailPath + `?name=${postId}`,
|
||||||
animationType: 'slide-in-right'
|
animationType: 'slide-in-right'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
// uni.$tm.vx.commit('setWxShare', res.shareConfig);
|
// uni.$tm.vx.commit('setWxShare', res.shareConfig);
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// 获取mockjson
|
|
||||||
await uni.$tm.vx.actions('config/fetchMockJson')
|
|
||||||
|
|
||||||
// 进入检查
|
|
||||||
this.fnCheckShowStarted();
|
|
||||||
}).catch((err) => {
|
|
||||||
uni.switchTab({
|
|
||||||
url: homePagePath
|
|
||||||
});
|
|
||||||
})
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
fnCheckShowStarted() {
|
|
||||||
if (!this.configs.appConfig.startConfig.enabled) {
|
|
||||||
uni.switchTab({
|
|
||||||
url: homePagePath
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 是否每次都显示启动页
|
// 获取mockjson
|
||||||
if (this.configs.appConfig.startConfig.alwaysShow) {
|
if (res.basicConfig.auditModeEnabled) {
|
||||||
uni.removeStorageSync('APP_HAS_STARTED')
|
await uni.$tm.vx.actions('config/fetchMockJson')
|
||||||
uni.redirectTo({
|
}
|
||||||
url: startPagePath
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 只显示一次启动页
|
// 进入检查
|
||||||
if (uni.getStorageSync('APP_HAS_STARTED')) {
|
this.fnCheckShowStarted();
|
||||||
uni.switchTab({
|
}).catch((err) => {
|
||||||
url: homePagePath
|
uni.switchTab({
|
||||||
});
|
url: homePagePath
|
||||||
} else {
|
});
|
||||||
uni.redirectTo({
|
})
|
||||||
url: startPagePath
|
},
|
||||||
});
|
methods: {
|
||||||
}
|
fnCheckShowStarted() {
|
||||||
},
|
if (!this.configs.appConfig.startConfig.enabled) {
|
||||||
async getPostIdByQRCode(key) {
|
uni.switchTab({
|
||||||
const response = await this.$httpApi.v2.getQRCodeInfo(key);
|
url: homePagePath
|
||||||
if (response) {
|
});
|
||||||
if (response && response.postId) {
|
return;
|
||||||
return response.postId;
|
}
|
||||||
}
|
|
||||||
}
|
// 是否每次都显示启动页
|
||||||
return null;
|
if (this.configs.appConfig.startConfig.alwaysShow) {
|
||||||
}
|
uni.removeStorageSync('APP_HAS_STARTED')
|
||||||
}
|
uni.redirectTo({
|
||||||
};
|
url: startPagePath
|
||||||
</script>
|
});
|
||||||
|
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>
|
||||||
|
Loading…
Reference in New Issue
Block a user