app.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // app.js
  2. App({
  3. globalData: {
  4. Version: "1.0.16",
  5. IsProduction: true,
  6. ShareTitle: "上海中考招生信息查询工具",
  7. SharePath: "pages/index/index",
  8. ShareImage: '../images/fs_a01.png',
  9. ProgramID: 173,
  10. ProgramName: "秒过分数线",
  11. AppID: "wx39bc498e7fdacb6b",
  12. serverUrl: "https://www.kylx365.com/apiData/",
  13. serverUrlServer: "https://www.kylx365.com/apiData/",
  14. serverUrlLocalhost: "http://localhost:3020/apiData/",
  15. uploadImageUrl: "https://miaguo-1253256735.file.myqcloud.com/",
  16. IsIOS: true,
  17. IsAndroid: false,
  18. IsIPad: false,
  19. IsIPhoneX: false,
  20. IsOppo: false,
  21. systemInfo: null,
  22. userInfo: null,
  23. Key: "kylx365_chengjie",
  24. IV: "kylx365hongliren",
  25. SourceID: 0, //来源ID
  26. IsGoto: true, //可以跳转
  27. WebViewUrl: "", //webview的链接
  28. PageCount: 100, //每一页翻页数
  29. TempParam: "", //临时参数
  30. MyWish: {}, //我的福帖
  31. },
  32. onLaunch: function (options) {
  33. this.getSystemInfo();
  34. },
  35. onShow: function (options) {
  36. if (options && options.scene) {
  37. this.globalData.userSource = options.scene;
  38. console.log("options.scene2:" + options.scene);
  39. }
  40. },
  41. getSystemInfo: function () {
  42. this.globalData.systemInfo = wx.getSystemInfoSync();
  43. if (this.globalData.systemInfo.system.indexOf("Android") >= 0) {
  44. this.globalData.IsIOS = false;
  45. this.globalData.IsAndroid = true;
  46. } else if (this.globalData.systemInfo.system.indexOf("iOS") >= 0) {
  47. this.globalData.IsIOS = true;
  48. this.globalData.IsAndroid = false;
  49. if (this.globalData.systemInfo.model.indexOf("X") >= 0 ||
  50. this.globalData.systemInfo.model.indexOf("11") >= 0 ||
  51. this.globalData.systemInfo.model.indexOf("12") >= 0 ||
  52. this.globalData.systemInfo.model.indexOf("13") >= 0 ||
  53. this.globalData.systemInfo.model.indexOf("14") >= 0)
  54. this.globalData.IsIPhoneX = true;
  55. }
  56. if (this.globalData.systemInfo.model.indexOf("iPad") >= 0) {
  57. this.globalData.IsIPad = true;
  58. }
  59. if (this.globalData.systemInfo.brand.indexOf("OPPO") >= 0) {
  60. this.globalData.IsOppo = true;
  61. }
  62. }
  63. })