//index.js

const util = require("../../utils/util")

//获取应用实例
const app = getApp()

Page({
  data: {
    buyModel:false,
    code_url:'',
    info:{},
    system: "",
    groups: [],
    pushPaper: [],
    timeLimitPaper: [],
    userInfo:{},
    taskList: [],
    departments:[]
  },
  onLoad: function(){
    let that = this
    wx.getSystemInfo({
      success: function(res) {
        that.setData({system: res.system})
      }
    })
    app.getDepartments(  departments=>{
      this.setData({departments})
    })
  },
  onPullDownRefresh() {
    if (!this.loading) {
      this.indexLoad( this.stopPullDownRefresh )
    }
  },
  gotoDepartment(e){
    let id = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: `/pages/department/artical/index?departmentId=${id}`,
    })
  },
  stopPullDownRefresh(){
    wx.stopPullDownRefresh()
  },
  onShareAppMessage: function(){
  }
})