index.js 904 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //index.js
  2. const util = require("../../utils/util")
  3. //获取应用实例
  4. const app = getApp()
  5. Page({
  6. data: {
  7. buyModel:false,
  8. code_url:'',
  9. info:{},
  10. system: "",
  11. groups: [],
  12. pushPaper: [],
  13. timeLimitPaper: [],
  14. userInfo:{},
  15. taskList: [],
  16. departments:[]
  17. },
  18. onLoad: function(){
  19. let that = this
  20. wx.getSystemInfo({
  21. success: function(res) {
  22. that.setData({system: res.system})
  23. }
  24. })
  25. app.getDepartments( departments=>{
  26. this.setData({departments})
  27. })
  28. },
  29. onPullDownRefresh() {
  30. if (!this.loading) {
  31. this.indexLoad( this.stopPullDownRefresh )
  32. }
  33. },
  34. gotoDepartment(e){
  35. let id = e.currentTarget.dataset.id;
  36. wx.navigateTo({
  37. url: `/pages/department/artical/index?departmentId=${id}`,
  38. })
  39. },
  40. stopPullDownRefresh(){
  41. wx.stopPullDownRefresh()
  42. },
  43. onShareAppMessage: function(){
  44. }
  45. })