From f8f448ee269d99595abe9c1a3de1a0987843f731 Mon Sep 17 00:00:00 2001
From: litian <C21AF165>
Date: 星期日, 29 九月 2024 10:10:23 +0800
Subject: [PATCH] rwd

---
 packageBookService/pages/bookServices/detail/components/learnTask/index.js |  117 +++++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 78 insertions(+), 39 deletions(-)

diff --git a/packageBookService/pages/bookServices/detail/components/learnTask/index.js b/packageBookService/pages/bookServices/detail/components/learnTask/index.js
index 0607788..db81061 100644
--- a/packageBookService/pages/bookServices/detail/components/learnTask/index.js
+++ b/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
@@ -74,7 +89,6 @@
           disabled: false
         });
       }
-      console.log(options.consumer, 77)
       this.getResourceData()
       this.getLearnTime()
     }
@@ -85,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) {
@@ -195,11 +209,12 @@
           }, 500)
         }
       }
-      this.getTasksList()
+      setTimeout(() => {
+        this.getTasksList()
+      }, 500)
     })
   },
   getTask(e) {
-    console.log(e)
     let item = e.currentTarget.dataset.item
     this.taskSelect(item)
   },
@@ -254,21 +269,23 @@
                 school: content.school,
                 class: content.class,
                 learnTime: content.learnTime,
-                taskShow: true,
               });
-              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 {
@@ -276,10 +293,11 @@
           }
         })
       }
+      if (this.data.dataList.length == 0) {
+        this.goDetail(item)
+      }
     }
-    if (this.data.dataList.length == 0) {
-      this.goDetail(item)
-    }
+
   },
   goDetail(item) {
     this.setData({
@@ -311,10 +329,18 @@
           item.teacherEvaluation = ''
         })
       }
-      this.setData({
-        dataList: res.datas.cmsDatas[0].datas,
-        taskShow: true,
-      });
+      if (this.data.name && this.data.school && this.data.class) {
+        this.setData({
+          dataList: res.datas.cmsDatas[0].datas,
+          taskShow: true,
+        })
+      } else {
+        wx.showToast({
+          title: "璇峰厛濉啓涓汉淇℃伅",
+          icon: 'none',
+          duration: 1000
+        })
+      }
     })
   },
   getChildTasksList() {
@@ -340,7 +366,7 @@
             if (content.teacherComment.length > 0) {
               content.teacherComment.forEach((item2) => {
                 if (item.id == item2.childTaskId) {
-                  item.mateEvaluation = [item2]
+                  item.teacherEvaluation = [item2]
                   if (this.data.consumer == 'teacher') {
                     this.setData({
                       evaluated: true
@@ -358,7 +384,6 @@
               content.mateComment.forEach((item3) => {
                 if (item.id == item3.childTaskId) {
                   item.mateEvaluation = [...item.mateEvaluation, item3]
-                  console.log(item.mateEvaluation, 123)
                   if (this.data.consumer == 'classmate') {
                     if (item.mateEvaluation && item.mateEvaluation.length > 0) {
                       let data = item.mateEvaluation.find(
@@ -387,6 +412,23 @@
           dataList: list
         });
       }
+    })
+  },
+
+  // 涓汉淇℃伅濉啓
+  bindTnputBlur(e) {
+    this.setData({
+      name: e.detail.value
+    })
+  },
+  onSchoolInput(e) {
+    this.setData({
+      school: e.detail.value
+    })
+  },
+  bindClassBlur(e) {
+    this.setData({
+      class: e.detail.value
     })
   },
 
@@ -434,7 +476,6 @@
   //鎻愪氦鑷繁濉啓
   inviteBtn() {
     let empty = false
-    console.log(this.data.dataList, 123)
     this.data.dataList.forEach((item) => {
       if (item.introspection == '' || item.completion == '' || item.selfEvaluation == '') {
         empty = true
@@ -494,7 +535,6 @@
   },
   updateSubmit() {
     let evaluate = []
-    console.log(this.data.dataList, 211)
     this.data.dataList.forEach((item) => {
       evaluate.push({
         id: item.id,
@@ -551,18 +591,17 @@
   },
 
   confirmBtn() {
-    if (this.data.invitee == 'teacher' && this.data.teacherEvaluated) {
-      wx.showToast({
-        title: "鏁欏笀宸茬粡璇勪环锛屼笉鑳藉啀閭�璇锋暀甯堣瘎浠凤紒",
-        icon: 'none',
-        duration: 1000
-      })
-      return false
-    }
     wx.showShareMenu({
       withShareTicket: true
     });
   },
+  confirmBtn1() {
+    wx.showToast({
+      title: "鏁欏笀宸茬粡璇勪环锛屼笉鑳藉啀閭�璇锋暀甯堣瘎浠凤紒",
+      icon: 'none',
+      duration: 1000
+    })
+  },
   submitComment() {
     let mateEvaluationList = []
     let teacherEvaluationList = []

--
Gitblit v1.9.1