app.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // app.js
  2. App({
  3. globalData: {
  4. Version: "1.0.0",
  5. IsProduction: true,
  6. ShareTitle: "",
  7. SharePath: "pages/index/index",
  8. ShareImage: '../images/program_share-a01.png',
  9. ProgramID: 107,
  10. ProgramName: "",
  11. AppID: "wx80059777521b897c",
  12. serverUrl: "https://www.kylx365.com/apiData/",
  13. serverUrlServer: "https://www.kylx365.com/apiData/",
  14. serverUrlLocalhost: "http://localhost:3020/apiData/",
  15. audioUrlBaidu: "https://tsn.baidu.com/text2audio?lan=zh&ctp=1&cuid=abcdxxx&tok=[token]&tex=[word]&vol=9&per=0&spd=3&pit=5",
  16. audioUrlYoudao: "https://dict.youdao.com/dictvoice?rate=10&le=auto&audio=[word]",
  17. uploadImageUrl: "https://miaguo-1253256735.file.myqcloud.com/",
  18. officialAccounts:"https://mp.weixin.qq.com/s/gO9S4PrPl1Uu1iksyRuBgw",
  19. BaiduToken: "",//百度开发平台token
  20. IsIOS: true,
  21. IsAndroid: false,
  22. IsIPad: false,
  23. IsIPhoneX: false,
  24. IsOppo: false,
  25. systemInfo: null,
  26. userInfo: null,
  27. SourceID: 0,//来源ID
  28. shareTicket: null,
  29. userSource: null,//用户来源方式
  30. Key: "kylx365_chengjie",
  31. IV: "kylx365hongliren",
  32. TempStr:"",
  33. ocrReady: false
  34. },
  35. onLaunch: function (options) {
  36. var that=this;
  37. that.getSystemInfo();
  38. // wx.setEnableDebug({
  39. // enableDebug: true
  40. // });
  41. },
  42. getSystemInfo: function () {
  43. this.globalData.systemInfo = wx.getSystemInfoSync();
  44. if (this.globalData.systemInfo.system.indexOf("Android") >= 0) {
  45. this.globalData.IsIOS =false;
  46. this.globalData.IsAndroid=true;
  47. }
  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. })