litian
2024-09-29 cb6d3c36fca269121bf2acd513dc05377ba87630
packageBookService/pages/bookServices/detail/components/learnTask/index.js
@@ -33,7 +33,22 @@
    dialogVisible: false,
    invitee: "",
    teacherEvaluated: false,
    evaluated: false
    evaluated: false,
    rowCol: [{
        width: '50%',
      },
      {
        width: '100%'
      },
      {
        width: '80%'
      },
      {
        width: '100%'
      }, {
        width: '100%'
      },
    ],
  },
  onShow() {
    var that = this;
@@ -54,7 +69,7 @@
      this.setData({
        bookId: options.bookId,
        cmsPath: options.cmsPath,
        taskId: options.bookId,
        taskId: options.taskId,
        consumer: options.consumer,
        userId: options.userId,
        userName: JSON.parse(wx.getStorageSync(app.config.userInfoKey)).nickName
@@ -63,7 +78,7 @@
        this.setData({
          cmsPath: options.cmsPath,
          bookId: options.bookId,
          taskId: options.bookId,
          taskId: options.taskId,
          consumer: options.consumer,
          userId: options.userId,
          disabled: true
@@ -84,7 +99,7 @@
    app.MG.identity
      .getUserKey({
        domain: 'cloudLearningTime',
        keys: [this.data.bookId + '']
        keys: [this.data.bookId]
      })
      .then((res) => {
        if (res.length > 0 && JSON.parse(res[0].value) && JSON.parse(res[0].value).length > 0) {
@@ -194,7 +209,9 @@
          }, 500)
        }
      }
      this.getTasksList()
      setTimeout(() => {
        this.getTasksList()
      }, 500)
    })
  },
  getTask(e) {
@@ -229,7 +246,6 @@
      this.setData({
        tasksListData: res.datas,
      });
      if (this.data.taskInfo.name) {
        this.taskSelect(this.data.taskInfo)
      }
@@ -252,22 +268,24 @@
                name: content.userName,
                school: content.school,
                class: content.class,
                learnTime: content.learnTime,
                taskShow: true,
                learnTime: this.data.learnTime,
              });
              this.getChildTasksList()
              if (content.evaluate.length > 0) {
                // content.evaluate.forEach((element) => {
                //   if (this.data.consumer == 'classmate') {
                //     element.mateEvaluation = ''
                //   }
                //   if (this.data.consumer == 'teacher') {
                //     element.teacherEvaluation = ''
                //   }
                // })
              if (this.data.name && this.data.school && this.data.class) {
                this.setData({
                  dataList: content.evaluate,
                });
                  taskShow: true,
                })
                this.getChildTasksList()
                if (content.evaluate.length > 0) {
                  this.setData({
                    dataList: content.evaluate,
                  });
                }
              } else {
                wx.showToast({
                  title: "请先填写个人信息",
                  icon: 'none',
                  duration: 1000
                })
              }
            }
          } else {
@@ -311,9 +329,6 @@
          item.teacherEvaluation = ''
        })
      }
      this.setData({
      });
      if (this.data.name && this.data.school && this.data.class) {
        this.setData({
          dataList: res.datas.cmsDatas[0].datas,
@@ -576,19 +591,16 @@
  },
  confirmBtn() {
    if (this.data.invitee == 'teacher' && this.data.teacherEvaluated) {
      wx.showToast({
        title: "教师已经评价,不能再邀请教师评价!",
        icon: 'none',
        duration: 1000
      })
      return false
    } else {
      wx.showShareMenu({
        withShareTicket: true
      });
    }
    wx.showShareMenu({
      withShareTicket: true
    });
  },
  confirmBtn1() {
    wx.showToast({
      title: "教师已经评价,不能再邀请教师评价!",
      icon: 'none',
      duration: 1000
    })
  },
  submitComment() {
    let mateEvaluationList = []