|
|
|
@ -2,6 +2,12 @@ |
|
|
|
import commonApi from "./utils/https/common" |
|
|
|
App({ |
|
|
|
onLaunch: function (options) { |
|
|
|
if(options.query.authCode){ |
|
|
|
wx.setStorageSync('authCode', options.query.authCode) |
|
|
|
} |
|
|
|
else { |
|
|
|
wx.removeStorageSync('authCode') |
|
|
|
} |
|
|
|
this.updateApp() |
|
|
|
let rect = wx.getSystemInfoSync(); |
|
|
|
this.globalData.safeBottom = rect.safeArea?(rect.safeArea.bottom - rect.safeArea.height):0 |
|
|
|
@ -11,37 +17,28 @@ App({ |
|
|
|
this.globalData.uuid = res.data.uuid; |
|
|
|
wx.setStorageSync('uuid', res.data.uuid) |
|
|
|
}) |
|
|
|
// 展示本地存储能力
|
|
|
|
var logs = wx.getStorageSync('logs') || [] |
|
|
|
logs.unshift(Date.now()) |
|
|
|
wx.setStorageSync('logs', logs) |
|
|
|
|
|
|
|
// 登录
|
|
|
|
wx.login({ |
|
|
|
success: res => { |
|
|
|
// 发送 res.code 到后台换取 openId, sessionKey, unionId
|
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
// 获取用户信息
|
|
|
|
wx.getSetting({ |
|
|
|
success: res => { |
|
|
|
if (res.authSetting['scope.userInfo']) { |
|
|
|
// 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
|
|
|
|
wx.getUserInfo({ |
|
|
|
success: res => { |
|
|
|
// 可以将 res 发送给后台解码出 unionId
|
|
|
|
this.globalData.userInfo = res.userInfo |
|
|
|
// wx.getSetting({
|
|
|
|
// success: res => {
|
|
|
|
// if (res.authSetting['scope.userInfo']) {
|
|
|
|
// // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
|
|
|
|
// wx.getUserInfo({
|
|
|
|
// success: res => {
|
|
|
|
// // 可以将 res 发送给后台解码出 unionId
|
|
|
|
// this.globalData.userInfo = res.userInfo
|
|
|
|
|
|
|
|
// 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
|
|
|
|
// 所以此处加入 callback 以防止这种情况
|
|
|
|
if (this.userInfoReadyCallback) { |
|
|
|
this.userInfoReadyCallback(res) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
// // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
|
|
|
|
// // 所以此处加入 callback 以防止这种情况
|
|
|
|
// if (this.userInfoReadyCallback) {
|
|
|
|
// this.userInfoReadyCallback(res)
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// })
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// })
|
|
|
|
this.getShareCategoryId() |
|
|
|
}, |
|
|
|
// 更新提示
|
|
|
|
@ -178,7 +175,7 @@ App({ |
|
|
|
'OFFLINE_WAIT':'线下退款处理中' |
|
|
|
}, |
|
|
|
codeState:['未使用','已使用','已失效','已取消'], |
|
|
|
weburl:"", |
|
|
|
weburl:"https://wechat.b2c.zj-trip.net", |
|
|
|
pay_methods:{ |
|
|
|
NONE:"无需支付", |
|
|
|
WEIXIN:"微信支付", |
|
|
|
|