app.js 1.9 KB

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