  return {
    data() {
      return {
        activeName: "first",
        apptoken:'',
        columncourse:[],
        camplist:[],
        rightcamplist:[],
        classcourse:[],
        classfacecourse:[],
        currid:'0',
        classtab:[
          {type:0,label:'线上'},
          {type:1,label:'面授'}
        ],
        classcurr:0,
        periodstype:-1
      };
    },
    methods: {
      open:function(courseid,costype){
        this.$router.push({
          name:'UserCourseDetailPeriodTable',
          query:{
            costype:costype,
            courseid:courseid
          }
        })
      },
      handleClick(tab){
        console.log(tab.name)
        var that = this
        if(tab.name=='first'){
          that.periodstype = -1
        }else if(tab.name=='second'){
          that.periodstype = 5
        }else if(tab.name=='third'){
          that.periodstype = 6
        }else if(tab.name=='four'){
          that.periodstype = 1
        }else if(tab.name=='find'){
          that.periodstype = 0
        }
      },
      getColumnCourse:function(){
        var that=this
        GetUserSpecialDetail({
          courseid:that.$route.params.id,
          apptoken:that.apptoken
        }).then(function(res) {
          if(res.result){
            that.columncourse = res.data.course_list
          }else{
            that.columncourse = []
          }
        })
      },
      campDirectoryList:function(campid){
        var that=this
        that.currid = campid
        GetTrainCatalogueList({
          trainid:that.$route.params.id,
          campid:campid,
          apptoken:that.apptoken
        }).then(function(res) {
          if(res.result){
            that.camplist = res.data.cataloguelist
          }
        })
      },
      getClassCourse:function(type){
        var that = this
        that.classcurr = type
      },
      getTrainCampList:function() {
        var that = this
        GetTrainCampList({
          trainid:that.$route.params.id,
          apptoken:that.apptoken
        }).then(function(res) {
          if(res.result){
            that.rightcamplist = res.data.camplist
            that.currid = res.data.camplist[0].campid
            that.campDirectoryList(that.currid)
          }else{
            that.rightcamplist = []
          }
        })
      },
      getUserClassDetail:function () {
        var that = this
        GetUserClassDetail({
          roomid:that.$route.params.id,
          apptoken:that.apptoken
        }).then(function(res) {
          if(res.result){
            that.classcourse = res.data.course_list
            that.classfacecourse = res.data.courseface_list
          }else{
            that.classcourse = []
            that.classfacecourse = []
          }
        })
      }
    },
    created:function(){
      let that = this
      that.$store.ready(function(state) {
        that.apptoken = state.appToken
        if(that.$route.query.costype=='2'||that.$route.query.costype=='5'){
          that.activeName = 'first'
        }else if(that.$route.query.costype=='1'){
          that.activeName = 'four'
        }else if(that.$route.query.costype=='0'){
          that.activeName = 'find'
        }else if(that.$route.query.costype=='3'){
          that.getColumnCourse()
        }else if(that.$route.query.costype=='7'){
          that.getTrainCampList()
        }else if(that.$route.query.costype=='8'){
          that.getUserClassDetail()
        }
      })
    }
  }

