1
QYF-GitLab1
2025-01-02 1530f605190069e45b5e31a7ec2bf7a6dc691f39
packageCourse/pages/studentClass/index.js
@@ -42,11 +42,14 @@
  // 通过code查询班级
  getClassDetail() {
    if (this.data.refCode == '') {
    if (!this.data.refCode) {
      wx.showToast({
        title: '请输入邀请码',
        duration: 1000,
        icon: "none",
      })
      this.setData({
        classDetail: null
      })
      return false
    }
@@ -56,14 +59,29 @@
    app.MG.edu
      .getCourseClass(data)
      .then(res => {
        if (res) {
        if (res.linkProductDto) {
          res.classTime = moment(res.beginDate).format('YYYY-MM-DD') + '--' + moment(res.endDate).format('YYYY-MM-DD')
          this.setData({
            classDetail: res
          })
        } else {
          this.setData({
            classDetail: null
          })
          wx.showToast({
            title: '邀请码无效',
            icon: "none"
          })
        }
      })
      .catch(err => {
        wx.showToast({
          title: '邀请码无效',
          icon: "none"
        })
        this.setData({
          classDetail: null
        })
        console.log(err)
      })
  },
@@ -78,7 +96,9 @@
  // 关闭申请
  cancle() {
    this.setData({
      visible: false
      visible: false,
      classDetail: null,
      refCode: ''
    })
  },
@@ -161,6 +181,8 @@
          classList: list,
          totalSize: totalSize,
          visible: false,
          classDetail: null,
          refCode: '',
          skeletonLoding: false,
          bottomLoading: false
        })