app.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. //app.js
  2. App({
  3. onLaunch: function (options) {
  4. this.getSystemInfo();
  5. if (options && options.scene) {
  6. this.globalData.userSource = options.scene;
  7. }
  8. if (options && options.shareTicket) {
  9. this.globalData.shareTicket = options.shareTicket;
  10. }
  11. },
  12. getSystemInfo: function () {
  13. this.globalData.systemInfo = wx.getSystemInfoSync();
  14. if (this.globalData.systemInfo.system.indexOf("Android") >= 0) {
  15. this.globalData.IsIOS =false;
  16. this.globalData.IsAndroid=true;
  17. }
  18. else if (this.globalData.systemInfo.system.indexOf("iOS") >= 0) {
  19. this.globalData.IsIOS = true;
  20. this.globalData.IsAndroid=false;
  21. }
  22. if (this.globalData.systemInfo.model.indexOf("iPad")>=0){
  23. this.globalData.IsIPad=true;
  24. }
  25. },
  26. globalData: {
  27. Version: "1.0.0.20",
  28. IsProduction: true,
  29. ShareTitle: "可以用来记忆一切的工具",
  30. SharePath: "pages/index/index",
  31. ShareImage: '',
  32. ProgramID: 166,
  33. ProgramName:"秒过学习",
  34. serverUrl: "https://www.kylx365.com/apiData/",
  35. serverUrlServer: "https://www.kylx365.com/apiData/",
  36. serverUrlLocalhost: "http://localhost:3020/apiData/",
  37. audioUrlBaidu: "https://tsn.baidu.com/text2audio?lan=zh&ctp=1&cuid=abcdxxx&tok=[token]&tex=[word]&vol=9&per=0&spd=3&pit=5",
  38. audioUrlYoudao: "https://dict.youdao.com/dictvoice?rate=5&le=auto&audio=",
  39. pinyinUrl: "https://pinyin.kylx365.com/sounds/[pinyin].m4a",
  40. uploadImageUrl:"https://miaguo-1253256735.file.myqcloud.com/",
  41. BaiduToken: "",//百度开发平台token
  42. IsIOS:true,
  43. IsAndroid:false,
  44. IsIPad:false,
  45. systemInfo: null,
  46. userInfo: null,
  47. SourceID: 0,//来源ID
  48. shareTicket: null,
  49. userSource: null,//用户来源方式
  50. Key: "kylx365_chengjie",
  51. IV: "kylx365hongliren",
  52. IsEnter: true,//是否是刚进来
  53. CardList:[],//卡列表变量
  54. TaskToday:[],//今天任务列表
  55. TempMiaoguoCardID:0,//临时题卡ID,用于资料选取时用
  56. }
  57. })