app.js 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // app.js
  2. App({
  3. globalData: {
  4. Version: "1.0.5",
  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. },
  37. onLaunch: function (options) {
  38. let that=this;
  39. that.getSystemInfo();
  40. // wx.setEnableDebug({
  41. // enableDebug: true
  42. // });
  43. },
  44. getSystemInfo: function () {
  45. this.globalData.systemInfo = wx.getSystemInfoSync();
  46. if (this.globalData.systemInfo.system.indexOf("Android") >= 0) {
  47. this.globalData.IsIOS =false;
  48. this.globalData.IsAndroid=true;
  49. }
  50. else if (this.globalData.systemInfo.system.indexOf("iOS") >= 0) {
  51. this.globalData.IsIOS = true;
  52. this.globalData.IsAndroid=false;
  53. if (this.globalData.systemInfo.model.indexOf("X") >= 0
  54. || this.globalData.systemInfo.model.indexOf("11") >= 0
  55. || this.globalData.systemInfo.model.indexOf("12") >= 0
  56. || this.globalData.systemInfo.model.indexOf("13") >= 0
  57. || this.globalData.systemInfo.model.indexOf("14") >= 0)
  58. this.globalData.IsIPhoneX=true;
  59. }
  60. if (this.globalData.systemInfo.model.indexOf("iPad")>=0){
  61. this.globalData.IsIPad=true;
  62. }
  63. if (this.globalData.systemInfo.brand.indexOf("OPPO")>=0){
  64. this.globalData.IsOppo=true;
  65. }
  66. }
  67. })