Browse Source

feat: 广告页、引导页

test2
xuesinan 4 years ago
parent
commit
1c89806d29
  1. 35
      App.vue
  2. 1
      CHANGELOG.md
  3. 4
      apis/tall.js

35
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;

1
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)

4
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);
// 注册

Loading…
Cancel
Save