Commit eab38489 authored by 俞嘉婷's avatar 俞嘉婷

feat: 首页接口请求时机调整

parent 824456cf
...@@ -28,6 +28,7 @@ ComponentWithStore({ ...@@ -28,6 +28,7 @@ ComponentWithStore({
}, },
canIUseGetUserProfile: wx.canIUse('getUserProfile'), canIUseGetUserProfile: wx.canIUse('getUserProfile'),
canIUseNicknameComp: wx.canIUse('input.type.nickname'), canIUseNicknameComp: wx.canIUse('input.type.nickname'),
isFirstIndex: true,
}, },
created() { created() {
// 登录 // 登录
...@@ -37,15 +38,16 @@ ComponentWithStore({ ...@@ -37,15 +38,16 @@ ComponentWithStore({
// 发送 res.code 到后台换取 openId, sessionKey, unionId // 发送 res.code 到后台换取 openId, sessionKey, unionId
await dbLogin({code: res.code}); await dbLogin({code: res.code});
await this.updateHomeInfo(); await this.updateHomeInfo();
const {channel, city} = this.options || {};
store.paramsObj = {channel, city};
this.setData({ isFirstIndex: false })
}, },
}); });
}, },
methods: { methods: {
async onShow() { async onShow() {
store.doLog(507, 10) store.doLog(507, 10)
await this.updateHomeInfo(); if (!this.data.isFirstIndex) await this.updateHomeInfo();
const {channel, city} = this.options || {};
store.paramsObj = {channel, city};
}, },
getPhoneNumber(e: any) { getPhoneNumber(e: any) {
console.log(e.detail) console.log(e.detail)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment