From 1c89806d296d364f24ad57d7edb1251cfbaec8bb Mon Sep 17 00:00:00 2001 From: xuesinan <1404152492@qq.com> Date: Tue, 25 Jan 2022 16:03:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=B9=BF=E5=91=8A=E9=A1=B5=E3=80=81?= =?UTF-8?q?=E5=BC=95=E5=AF=BC=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 35 +++++++++++++++++++++++++++++++++++ CHANGELOG.md | 1 + apis/tall.js | 4 +++- 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/App.vue b/App.vue index 525fde7..bf6193d 100644 --- a/App.vue +++ b/App.vue @@ -23,6 +23,16 @@ export default { this.$store.commit('user/setToken', token); } + // 查询广告页和引导页并缓存 + this.getGuide(0); + this.getGuide(1); + + // 定时查询服务和插件 + setInterval(() => { + this.getServices(); + this.getPlugins(); + }, 60000); + // if (!token) { // this.$ui.showToast('获取用户信息失败, 请登录'); // // TODO: 跳转登录界面 @@ -41,6 +51,31 @@ export default { // const path = this.theme.replace('-', '/'); // import(`./common/styles/${path}.scss`); // }, + /** + * 查询广告页和引导页并缓存 + */ + async getGuide(type) { + try { + const res = await uni.$u.api.getGuide(type); + type === 0 ? uni.$storage.setStorageSync('guide', res) : uni.$storage.setStorageSync('advs', res); + } catch (error) { + throw error; + } + }, + + /** + * 查询服务 + */ + async getServices() { + console.log('服务') + }, + + /** + * 查询插件 + */ + async getPlugins() { + console.log('插件') + }, async getToken() { const { token } = this.$store.state.user; diff --git a/CHANGELOG.md b/CHANGELOG.md index 9516dc5..cf0a10c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ - | 将时间轴改成swiper滑动 | [12384f9](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/12384f9) - | 日历页首页 | [561c8e6](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/561c8e6) - | 日历页添加 | [1b46a91](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/1b46a91) + - | 设置项目域名 | [1a835f1](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/1a835f1) - | 设置状态栏 | [9871356](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/9871356) - | 时间轴接口 | [a95d005](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/a95d005) - | 时间轴页面 | [e926b75](https://101.201.226.163:50022/TALL/TALL-MUI-4/commits/e926b75) diff --git a/apis/tall.js b/apis/tall.js index 6d7bbf1..6190e86 100644 --- a/apis/tall.js +++ b/apis/tall.js @@ -6,7 +6,9 @@ const apiUrl = Config.apiUrlNew; const tall = `${apiUrl}/ptostall`; export function setupTall(app) { - uni.$u.api = { ...uni.$u.api } || {}; + uni.$u.api = { ...uni.$u.api } || {}; + // 查询广告页和引导页 + uni.$u.api.getGuide = type => uni.$u.http.get(`${tall}/business/guide`, { type }); // 登录 uni.$u.api.signin = params => uni.$u.http.post(`${tall}/users/signin`, params); // 注册