app.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. //app.js
  2. App({
  3. globalData: {
  4. Version: "1.1.23",
  5. IsProduction: true,
  6. ProgramID: 105,
  7. AppID: "wx1fef080f74481cbd",
  8. ProgramName: "数学计算题",
  9. ShareTitle: "认真练习,告别粗心",
  10. SharePath: "pages/index/index",
  11. ShareImage: '../../pages/images/program_share-a01.png',
  12. fileUrl: "https://math-1253256735.file.myqcloud.com/",
  13. serverUrl: "https://www.kylx365.com/apiData/",
  14. serverUrlServer: "https://www.kylx365.com/apiData/",
  15. serverUrlLocalhost: "http://localhost:3020/apiData/",
  16. audioUrlBaidu: "https://tsn.baidu.com/text2audio?lan=zh&ctp=1&cuid=abcdxxx&tok=[token]&tex=[word]&vol=9&per=4&spd=6&pit=5",
  17. uploadImageUrl: "https://miaguo-1253256735.file.myqcloud.com/",
  18. Key: "kylx365_chengjie",
  19. IV: "kylx365hongliren",
  20. systemInfo: null,
  21. userInfo: null,
  22. SourceID: 0,//来源ID
  23. DayNumber: 0,//使用天数
  24. BaiduToken: "",//百度开发平台token
  25. IsShow: 0,
  26. NewUserNumberMax: 6,//邀请新用户最大值
  27. IsSaveCustom: false,//是否保存了定制
  28. IsRefresh: false,
  29. IsIOS: true,
  30. IsAndroid: false,
  31. IsIPad: false,
  32. },
  33. onLaunch: function (options) {
  34. this.getSystemInfo();
  35. if (options && options.scene) {
  36. console.log("scene:" + options.scene);
  37. this.globalData.userSource = options.scene;
  38. }
  39. if (options && options.shareTicket) {
  40. this.globalData.shareTicket = options.shareTicket;
  41. }
  42. },
  43. getSystemInfo: function () {
  44. this.globalData.systemInfo = wx.getSystemInfoSync();
  45. if (this.globalData.systemInfo.system.indexOf("Android") >= 0) {
  46. this.globalData.IsIOS = false;
  47. this.globalData.IsAndroid = true;
  48. }
  49. else if (this.globalData.systemInfo.system.indexOf("iOS") >= 0) {
  50. this.globalData.IsIOS = true;
  51. this.globalData.IsAndroid = false;
  52. }
  53. if (this.globalData.systemInfo.model.indexOf("iPad") >= 0) {
  54. this.globalData.IsIPad = true;
  55. }
  56. }
  57. })