app.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. //app.js
  2. App({
  3. onLaunch: function (options) {
  4. this.getSystemInfo();
  5. if (options && options.scene) {
  6. this.globalData.userSource = options.scene;
  7. console.log("options.scene:" + options.scene);
  8. }
  9. if (options && options.shareTicket) {
  10. this.globalData.shareTicket = options.shareTicket;
  11. }
  12. },
  13. getSystemInfo: function () {
  14. this.globalData.systemInfo = wx.getSystemInfoSync();
  15. if (this.globalData.systemInfo.system.indexOf("Android") >= 0) {
  16. this.globalData.IsIOS =false;
  17. this.globalData.IsAndroid=true;
  18. }
  19. else if (this.globalData.systemInfo.system.indexOf("iOS") >= 0) {
  20. this.globalData.IsIOS = true;
  21. this.globalData.IsAndroid=false;
  22. }
  23. if (this.globalData.systemInfo.model.indexOf("iPad")>=0){
  24. this.globalData.IsIPad=true;
  25. }
  26. },
  27. globalData: {
  28. Version: "1.3.0",
  29. IsProduction: true,
  30. ShareTitle: "高效学习从秒过开始",
  31. SharePath: "pages/index/index",
  32. ShareImage: '../images/program_screenshot_main.png',
  33. ProgramID: 166,
  34. ProgramName:"秒过学习",
  35. serverUrl: "https://www.kylx365.com/apiData/",
  36. serverUrlServer: "https://www.kylx365.com/apiData/",
  37. serverUrlLocalhost: "http://localhost:3020/apiData/",
  38. audioUrlBaidu: "https://tsn.baidu.com/text2audio?lan=zh&ctp=1&cuid=abcdxxx&tok=[token]&tex=[word]&vol=9&per=0&spd=3&pit=5",
  39. audioUrlYoudao: "https://dict.youdao.com/dictvoice?rate=5&le=auto&audio=",
  40. pinyinUrl: "https://pinyin.kylx365.com/sounds/[pinyin].m4a",
  41. uploadImageUrl:"https://miaguo-1253256735.file.myqcloud.com/",
  42. BaiduToken: "",//百度开发平台token
  43. IsIOS:true,
  44. IsAndroid:false,
  45. IsIPad:false,
  46. systemInfo: null,
  47. userInfo: null,
  48. SourceID: 0,//来源ID
  49. shareTicket: null,
  50. userSource: null,//用户来源方式
  51. Key: "kylx365_chengjie",
  52. IV: "kylx365hongliren",
  53. IsEnter: true,//是否是刚进来
  54. LessonID:0,//听课ID
  55. CardWaitTimeMax:3,//每张卡最长等待时间(分钟)
  56. IsRecorderAccredit:0,
  57. CardList:[],//卡列表变量
  58. TaskToday:[],//今天任务列表
  59. SearchResultList: [],//搜索获得要选择的字词或古诗词列表
  60. TempMiaoguoCardID: 0,//临时题卡ID,用于资料选取时用
  61. SearchNull: 0,//资料搜索为空时标记,用于资料搜索时用
  62. SearchItem: {},//资料搜索项信息,用于资料搜索时用
  63. TempFieldNumber:0,//资料搜索时的段落编号
  64. TempSearcchBackNumber:3,//资料搜索时返回的页面数
  65. MemoryLevel:0,//记忆水平
  66. ColorIndex:0,//色彩方案
  67. ClickType:0,//点击方案
  68. SecondConfigArray:[0,0,0],//选择记忆水平建议
  69. GotoUrl:"",//首页跳转页面
  70. }
  71. })