app.js 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // app.js
  2. App({
  3. globalData: {
  4. Version: "1.1.1",
  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. GenerateConfig:[],//生成文章的配置信息
  38. },
  39. onLaunch: function (options) {
  40. let that=this;
  41. that.getSystemInfo();
  42. // wx.setEnableDebug({
  43. // enableDebug: true
  44. // });
  45. },
  46. getSystemInfo: function () {
  47. this.globalData.systemInfo = wx.getSystemInfoSync();
  48. if (this.globalData.systemInfo.system.indexOf("Android") >= 0) {
  49. this.globalData.IsIOS =false;
  50. this.globalData.IsAndroid=true;
  51. }
  52. else if (this.globalData.systemInfo.system.indexOf("iOS") >= 0) {
  53. this.globalData.IsIOS = true;
  54. this.globalData.IsAndroid=false;
  55. if (this.globalData.systemInfo.model.indexOf("X") >= 0
  56. || this.globalData.systemInfo.model.indexOf("11") >= 0
  57. || this.globalData.systemInfo.model.indexOf("12") >= 0
  58. || this.globalData.systemInfo.model.indexOf("13") >= 0
  59. || this.globalData.systemInfo.model.indexOf("14") >= 0
  60. || this.globalData.systemInfo.model.indexOf("15") >= 0
  61. || this.globalData.systemInfo.model.indexOf("16") >= 0
  62. || this.globalData.systemInfo.model.indexOf("17") >= 0
  63. || this.globalData.systemInfo.model.indexOf("18") >= 0
  64. || this.globalData.systemInfo.model.indexOf("19") >= 0
  65. || this.globalData.systemInfo.model.indexOf("20") >= 0)
  66. this.globalData.IsIPhoneX=true;
  67. }
  68. if (this.globalData.systemInfo.model.indexOf("iPad")>=0){
  69. this.globalData.IsIPad=true;
  70. }
  71. if (this.globalData.systemInfo.brand.indexOf("OPPO")>=0){
  72. this.globalData.IsOppo=true;
  73. }
  74. }
  75. })