app.js 522 B

1234567891011121314151617181920212223242526
  1. // app.js
  2. App({
  3. onLaunch() {
  4. wx.hideTabBar()
  5. // 展示本地存储能力
  6. // const logs = wx.getStorageSync('logs') || []
  7. // logs.unshift(Date.now())
  8. // wx.setStorageSync('logs', logs)
  9. // this.globalData.selectedTabIndex = wx.getStorageSync("selectedTabIndex") || 0;
  10. // 登录
  11. wx.login({
  12. success: res => {
  13. // 发送 res.code 到后台换取 openId, sessionKey, unionId
  14. }
  15. })
  16. },
  17. onShow(){
  18. },
  19. globalData: {
  20. userInfo: null,
  21. selectedTabIndex:0
  22. }
  23. })