diff --git a/api/request.js b/api/request.js index ff491b7..da68716 100644 --- a/api/request.js +++ b/api/request.js @@ -9,6 +9,7 @@ if(envVersion=='develop'){ let app = getApp(); let token = wx.getStorageSync('accessToken'); + const sendRequest = (options)=>{ if(!app)app = getApp(); return new Promise((rs,rj)=>{ diff --git a/app.js b/app.js index abcf569..74973ea 100644 --- a/app.js +++ b/app.js @@ -2,14 +2,14 @@ import userApi from './api/user'; import commonApi from './api/common'; let token = wx.getStorageSync('accessToken'); App({ - onLaunch(options) { + async onLaunch(options){ + console.log('app onlaunch',new Date().getTime()); wx.getStorage({ key:'accessToken', success:(res)=>{ this.globalData.accessToken = res.data; } }); - this.getAppConfig(); wx.onAppRoute((res)=>{ const page = getCurrentPages(); const currentPage = page[page.length-1]; @@ -32,8 +32,12 @@ App({ }) }, onShow(options){ - //shared_user_code 通过分享进来的 分享者 的user_code - //这里必须放到onshow 里 才能实时获取 code 先保存在这里,再跳转登录的时候通过 url 带过去,防止刷新丢失 code + console.log('app onShow',new Date().getTime()); + /** + * shared_user_code 通过分享进来的 分享者 的user_code + * 这里必须放到onshow 里 才能实时获取 code 先保存在这里,再跳转登录的时候通过 url 带过去,防止刷新丢失 code + * wx.getLaunchOptionsSync 也不行,比如用户开始自行打开了 app,然后再次点朋友的进来,就无法获取 code + */ if(options.query.shared_user_code){ this.globalData.shared_user_code = options.query.shared_user_code; } diff --git a/components/navbar/index.js b/components/navbar/index.js index 14aeef4..d721c55 100644 --- a/components/navbar/index.js +++ b/components/navbar/index.js @@ -32,7 +32,6 @@ Component({ }, lifetimes:{ attached(){ - console.log('1212121212'); const windowInfo = wx.getWindowInfo(); this.setData({ diff --git a/pages/browser/index.js b/pages/browser/index.js index cf5131c..960aec6 100644 --- a/pages/browser/index.js +++ b/pages/browser/index.js @@ -13,7 +13,7 @@ Page({ */ onLoad(options) { this.setData({ - webUrl:options.url + webUrl:decodeURIComponent(options.url) }) }, diff --git a/pages/help/index/index.js b/pages/help/index/index.js index bf24cb3..b9bdb2e 100644 --- a/pages/help/index/index.js +++ b/pages/help/index/index.js @@ -39,6 +39,7 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad(options) { + console.log('page onload',new Date().getTime()); let height = this.selectComponent("#navBar").getHeight(); this.setData({ navBarHeight:height @@ -52,13 +53,6 @@ Page({ appConfig:data }) }) - - - // wx.login({ - // success: (res) => { - // console.log(res); - // }, - // }) }, /** @@ -66,11 +60,13 @@ Page({ */ onReady() { + console.log('page onReady',new Date().getTime()); }, /** * 生命周期函数--监听页面显示 */ onShow() { + console.log('page onShow',new Date().getTime()); wx.getStorage({ key:'pre-order', success:(res)=>{ diff --git a/pages/my/setting/index/index.js b/pages/my/setting/index/index.js index 3240e8e..6deae99 100644 --- a/pages/my/setting/index/index.js +++ b/pages/my/setting/index/index.js @@ -96,6 +96,10 @@ Page({ }, navToPrivacy(){ + // wx.navigateTo({ + // url: `/pages/browser/index?url=${encodeURIComponent('https://beefast.co/#/how-to-use')}`, + // }) + // return; wx.navigateTo({ url: `/pages/browser/index?url=${this.data.appConfig.url_user_privacy}`, })