app.js 2.2 KB

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