app.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. // app.js
  2. App({
  3. globalData: {
  4. Version: "1.0.7",
  5. //IsProduction: true,
  6. ShareTitle: "阅读理解+答题",
  7. SharePath: "pages/index/index",
  8. ShareImage: '../images/pic_07.png',
  9. ProgramID: 186,
  10. ProgramName: "语境背单词",
  11. AppID: "wx80059777521b897c",
  12. serverUrl: "https://scoreline.kylx365.com/apiData/",
  13. serverUrlServer: "https://scoreline.kylx365.com/apiData/",
  14. serverUrlLocalhost: "http://localhost:3000/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. uploadImageUrl: "https://miaguo-1253256735.file.myqcloud.com/",
  17. officialAccounts:"https://mp.weixin.qq.com/s/gO9S4PrPl1Uu1iksyRuBgw",
  18. BaiduToken: "",//百度开发平台token
  19. IsIOS: true,
  20. IsAndroid: false,
  21. IsIPad: false,
  22. IsIPhoneX: false,
  23. IsOppo: false,
  24. systemInfo: null,
  25. userInfo: null,
  26. SourceID: 0,//来源ID
  27. shareTicket: null,
  28. userSource: null,//用户来源方式
  29. Key: "kylx365_chengjie",
  30. IV: "kylx365hongliren",
  31. TempStr:"",
  32. OCRWords:[],//OCR的单词
  33. SelectedWords:[],//选中的单词
  34. ocrReady: false,//
  35. Generating:false,//生成文章中
  36. GeneratingStart:false,//生成文章中已经开始
  37. },
  38. onLaunch: function (options) {
  39. let that=this;
  40. that.getSystemInfo();
  41. // wx.setEnableDebug({
  42. // enableDebug: true
  43. // });
  44. },
  45. getSystemInfo: function () {
  46. this.globalData.systemInfo = wx.getSystemInfoSync();
  47. if (this.globalData.systemInfo.system.indexOf("Android") >= 0) {
  48. this.globalData.IsIOS =false;
  49. this.globalData.IsAndroid=true;
  50. }
  51. else if (this.globalData.systemInfo.system.indexOf("iOS") >= 0) {
  52. this.globalData.IsIOS = true;
  53. this.globalData.IsAndroid=false;
  54. if (this.globalData.systemInfo.model.indexOf("X") >= 0
  55. || this.globalData.systemInfo.model.indexOf("11") >= 0
  56. || this.globalData.systemInfo.model.indexOf("12") >= 0
  57. || this.globalData.systemInfo.model.indexOf("13") >= 0
  58. || this.globalData.systemInfo.model.indexOf("14") >= 0)
  59. this.globalData.IsIPhoneX=true;
  60. }
  61. if (this.globalData.systemInfo.model.indexOf("iPad")>=0){
  62. this.globalData.IsIPad=true;
  63. }
  64. if (this.globalData.systemInfo.brand.indexOf("OPPO")>=0){
  65. this.globalData.IsOppo=true;
  66. }
  67. }
  68. })