app.js 1.2 KB

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