app.js 1.9 KB

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