app.js 1001 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //app.js
  2. App({
  3. onLaunch: function (options) {
  4. var info = wx.getSystemInfoSync()
  5. this.globalData.userAgent = 'Program_CD#' + info.system + '~' + info.version + '~' + info.SDKVersion + '#103'
  6. this.globalData.sys = info
  7. this.globalData.isIOS = info.system.indexOf("iOS") == 0
  8. },
  9. onHide: function () {
  10. },
  11. onHomeStart(f) {
  12. this.log(f.o() == null ? 'end' : 'start')
  13. },
  14. onHomeReady(f) {
  15. this.log(f.o() == null ? 'end' : 'start')
  16. },
  17. onError: function () {
  18. },
  19. log: function (info) {
  20. if (this.globalData.debug) {
  21. console.log(info)
  22. }
  23. },
  24. server: {},
  25. globalData: {
  26. debug: false,
  27. isIOS: true,
  28. userAgent: '',
  29. code: '',
  30. isFirstLoad: true,
  31. nextDayTime: 0,
  32. timeDifference: 0,
  33. sys: {},
  34. identify: {//点击别人分享保存的标示
  35. recomCode: null,
  36. shareIdentify: null,
  37. },
  38. user: {
  39. cell: 0,
  40. playGameC: 0,
  41. withdrawalbleFee: 0
  42. },
  43. userInfo: {},
  44. rankInfo: {},
  45. }
  46. })