app.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. //app.js
  2. App({
  3. globalData: {
  4. Version: "1.2.21",
  5. IsProduction: true,
  6. //IsProduction: false,
  7. ProgramID: 106,
  8. AppID: "wx313a8f2c0741efe1",
  9. ProgramName: "语文识字",
  10. ShareTitle:"赢在阅读起跑线",
  11. SharePath: "pages/index/index",
  12. ShareImage: "../../pages/images/07001.png",
  13. userInfo: null,
  14. fileUrl: "https://www.kylx365.com/",
  15. serverUrl: "https://www.kylx365.com/apiData/",
  16. serverUrlServer: "https://www.kylx365.com/apiData/",
  17. serverUrlLocalhost: "http://localhost:3020/apiData/",
  18. imageUrl: "https://hanzi-1253256735.file.myqcloud.com",
  19. audioUrl: "https://pinyin.kylx365.com",
  20. audioUrlBaidu: "https://tsn.baidu.com/text2audio?lan=zh&ctp=1&cuid=abcdxxx&tok=[token]&tex=[word]&vol=9&per=0&spd=3&pit=5",
  21. uploadImageUrl: "https://miaguo-1253256735.file.myqcloud.com/",
  22. Key: "kylx365_chengjie",
  23. IV: "kylx365hongliren",
  24. systemInfo: null,
  25. userInfo: null,
  26. SourceID: 0,//来源ID
  27. DayNumber: 0,//使用天数
  28. PayMoney: 19.8,//产品销售价
  29. BaiduToken:"",//百度开发平台token
  30. IsShow: 0,
  31. IsLocked: 0,
  32. IsIOS: true,
  33. IsAndroid: false,
  34. IsIPad: false,
  35. NewUserNumberMax:6,//邀请新用户最大值
  36. IsSaveCustom:false,//是否保存了定制
  37. goto:"",//用于服务直达的跳转
  38. IsShowMiaoguo:false,
  39. IsRefresh: false,
  40. IsShowGift:0,
  41. },
  42. onLaunch: function (options) {
  43. this.getSystemInfo();
  44. if (options && options.scene) {
  45. //console.log("scene:" + options.scene);
  46. this.globalData.userSource = options.scene;
  47. }
  48. },
  49. getSystemInfo: function () {
  50. this.globalData.systemInfo = wx.getSystemInfoSync();
  51. if (this.globalData.systemInfo.system.indexOf("Android") >= 0) {
  52. this.globalData.IsIOS = false;
  53. this.globalData.IsAndroid = true;
  54. }
  55. else if (this.globalData.systemInfo.system.indexOf("iOS") >= 0) {
  56. this.globalData.IsIOS = true;
  57. this.globalData.IsAndroid = false;
  58. }
  59. if (this.globalData.systemInfo.model.indexOf("iPad") >= 0) {
  60. this.globalData.IsIPad = true;
  61. }
  62. }
  63. })