app.js 936 B

1234567891011121314151617181920212223242526272829303132333435
  1. // app.js
  2. App({
  3. onLaunch() {
  4. // 展示本地存储能力
  5. const logs = wx.getStorageSync('logs') || []
  6. logs.unshift(Date.now())
  7. wx.setStorageSync('logs', logs)
  8. // 登录
  9. wx.login({
  10. success: res => {
  11. // 发送 res.code 到后台换取 openId, sessionKey, unionId
  12. }
  13. })
  14. },
  15. globalData: {
  16. userInfo: null,
  17. // 统一管理图片路径
  18. images: {
  19. logo: '/static_file/logo.png',
  20. background: '/static_file/backgorund.png',
  21. card: '/static_file/crad.png',
  22. tabBar: {
  23. home: '/static_file/homepage.png',
  24. homeActive: '/static_file/homepageCheck.png',
  25. profile: '/static_file/personalCenter.png',
  26. profileActive: '/static_file/personalCenterCheck.png',
  27. tzd: '/static_file/tzd.png',
  28. phone: '/static_file/phone.png',
  29. yl: '/static_file/yl.png',
  30. jcsfcjtzd:'/static_file/jcsfcjtzd.jpg'
  31. }
  32. }
  33. }
  34. })