日常提交
This commit is contained in:
parent
9694f39780
commit
6c7e23af54
@ -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)=>{
|
||||
|
||||
12
app.js
12
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;
|
||||
}
|
||||
|
||||
@ -32,7 +32,6 @@ Component({
|
||||
},
|
||||
lifetimes:{
|
||||
attached(){
|
||||
console.log('1212121212');
|
||||
const windowInfo = wx.getWindowInfo();
|
||||
|
||||
this.setData({
|
||||
|
||||
@ -13,7 +13,7 @@ Page({
|
||||
*/
|
||||
onLoad(options) {
|
||||
this.setData({
|
||||
webUrl:options.url
|
||||
webUrl:decodeURIComponent(options.url)
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
@ -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)=>{
|
||||
|
||||
@ -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}`,
|
||||
})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user