From c5b6f319a21021892a299036c22862b1a3b2ad53 Mon Sep 17 00:00:00 2001
From: QYF-GitLab1 <1940665526@qq.com>
Date: 星期四, 02 一月 2025 17:13:57 +0800
Subject: [PATCH] 111

---
 packageCourse/pages/course/detail/index.js        |    2 
 packageCourse/components/studentManage/index.js   |   87 +++++++++++++++++++++++++++++++++----------
 packageCourse/components/studentManage/index.wxml |    5 +-
 packageCourse/components/studentManage/index.wxss |    6 +-
 4 files changed, 72 insertions(+), 28 deletions(-)

diff --git a/packageCourse/components/studentManage/index.js b/packageCourse/components/studentManage/index.js
index 1aa437b..967308b 100644
--- a/packageCourse/components/studentManage/index.js
+++ b/packageCourse/components/studentManage/index.js
@@ -80,7 +80,8 @@
         currentState: e.detail.value,
         userList: [],
         isAll: false,
-        isEnbled: false
+        isEnbled: false,
+        searchKey: ''
       })
       this.getStudentList()
     },
@@ -125,7 +126,7 @@
 
     // 鎵归噺閫氳繃
     updateStateNormalDatas() {
-      const dataUser = this.data.userList.filter((item) => item.isCheck == true)
+      const dataUser = this.data.userList.filter((item) => item.isCheck == true && item.linkType != 'Creator')
       const data = {
         groupId: this.properties.classId,
         requests: dataUser.map((item) => {
@@ -139,6 +140,11 @@
       }
       app.MG.identity.updateAppUserGroupLink(data).then((res) => {
         if (res) {
+          wx.showToast({
+            title: '宸查�氳繃',
+            duration: 1000,
+            icon: 'none',
+          })
           this.setData({
             userList: []
           })
@@ -157,13 +163,18 @@
             return
           }
           if (res.confirm) {
-            const dataUser = this.data.userList.filter((item) => item.isCheck == true)
+            const dataUser = this.data.userList.filter((item) => item.isCheck == true && item.linkType != 'Creator')
             const data = {
               groupId: this.properties.classId,
               appUserIds: dataUser.map((item) => item.appUser.id)
             }
             app.MG.identity.removeAppUserFromGroup(data).then((res) => {
               if (res) {
+                wx.showToast({
+                  title: '宸茬Щ闄�',
+                  duration: 1000,
+                  icon: 'none',
+                })
                 this.setData({
                   userList: []
                 })
@@ -177,7 +188,7 @@
 
     // 鎵归噺鎷掔粷
     updateStateRejectDatas() {
-      const dataUser = this.data.userList.filter((item) => item.isCheck == true)
+      const dataUser = this.data.userList.filter((item) => item.isCheck == true && item.linkType != 'Creator')
       const data = {
         groupId: this.properties.classId,
         requests: dataUser.map((item) => {
@@ -191,6 +202,11 @@
       }
       app.MG.identity.updateAppUserGroupLink(data).then((res) => {
         if (res) {
+          wx.showToast({
+            title: '宸叉嫆缁�',
+            duration: 1000,
+            icon: 'none',
+          })
           this.setData({
             userList: []
           })
@@ -215,6 +231,14 @@
       }
       app.MG.identity.updateAppUserGroupLink(data).then((res) => {
         if (res) {
+          wx.showToast({
+            title: '宸叉嫆缁�',
+            duration: 1000,
+            icon: 'none',
+          })
+          this.setData({
+            userList: []
+          })
           this.getStudentList()
         }
       })
@@ -284,6 +308,8 @@
           this.setData({
             userList: list,
             total: totalSize,
+            isAll: false,
+            isEnbled: false,
             skeletonLoding: false,
             bottomLoading: false
           })
@@ -359,22 +385,37 @@
 
     // 绉婚櫎瀛︾敓
     removeStudent(e) {
-      const {
-        item
-      } = e.currentTarget.dataset
-      const data = {
-        groupId: this.properties.classId,
-        appUserIds: [item.appUser.id]
-      }
-      app.MG.identity.removeAppUserFromGroup(data).then((res) => {
-        if (res) {
-          wx.showToast({
-            title: '宸茬Щ闄�',
-            duration: 1000,
-            icon: 'none',
-          })
-          this.getStudentList()
-          this.newNotice(item, 'remove')
+      wx.showModal({
+        title: '鎻愮ず',
+        content: '鏄惁绉婚櫎褰撳墠鎴愬憳?',
+        complete: (res) => {
+          if (res.cancel) {
+            return
+          }
+          if (res.confirm) {
+            const {
+              item
+            } = e.currentTarget.dataset
+            const data = {
+              groupId: this.properties.classId,
+              appUserIds: [item.appUser.id]
+            }
+            app.MG.identity.removeAppUserFromGroup(data).then((res) => {
+              if (res) {
+                wx.showToast({
+                  title: '宸茬Щ闄�',
+                  duration: 1000,
+                  icon: 'none',
+                })
+                this.setData({
+                  userList: [],
+                  isAll: false,
+                  isEnbled: false
+                })
+                this.getStudentList()
+              }
+            })
+          }
         }
       })
     },
@@ -404,9 +445,13 @@
             duration: 1000,
             icon: 'success',
           })
+          this.setData({
+            userList: [],
+            isAll: false,
+            isEnbled: false
+          })
           this.cancle()
           this.getStudentList()
-          this.newNotice(this.data.currentIdentity, 'success')
         }
       })
     },
diff --git a/packageCourse/components/studentManage/index.wxml b/packageCourse/components/studentManage/index.wxml
index a4b1fe6..5143ff0 100644
--- a/packageCourse/components/studentManage/index.wxml
+++ b/packageCourse/components/studentManage/index.wxml
@@ -25,9 +25,8 @@
         </view>
         <view>
           <text style="color: #ff6d00;" wx:if="{{item.linkType == 'Creator'}}">鍒涘缓浜�</text>
-          <text style="color: #ff6d00;" wx:if="{{item.state == 'Reject'}}">宸叉嫆缁�</text>
           <t-button bindtap="selectIdentity" data-item="{{item}}" style="margin: 0;color: #67c23a;" size="extra-small" wx:if="{{item.state != 'Normal' && item.linkType != 'Creator' && item.state != 'Reject'}}" variant="text">閫氳繃</t-button>
-          <t-button bindtap="removeStudent" data-item="{{item}}" style="margin: 0;color: red;" size="extra-small" wx:if="{{item.linkType != 'Creator' && item.state == 'Normal'  }}" variant="text">绉婚櫎</t-button>
+          <t-button bindtap="removeStudent" data-item="{{item}}" style="margin: 0;color: red;" size="extra-small" wx:if="{{item.linkType != 'Creator' && (item.state == 'Normal' || item.state == 'Reject')}}" variant="text">绉婚櫎</t-button>
           <t-button bindtap="updateStateReject" data-item="{{item}}" style="margin: 0;color: #ff6d00;" size="extra-small" wx:if="{{item.linkType != 'Creator' && item.state != 'Normal' && item.state != 'Reject' }}" variant="text">鎷掔粷</t-button>
         </view>
       </view>
@@ -44,7 +43,7 @@
   </view>
   <view class="navBottom">
     <view class="navBottom-check">
-      <t-checkbox block="{{false}}" label="鍏ㄩ��" checked="{{isAll}}" bind:change="selectAll" />
+      <t-checkbox block="{{false}}" label="鍏ㄩ��" disabled="{{userList.length == 1 && currentState == 'Normal' }}" checked="{{isAll}}" bind:change="selectAll" />
     </view>
     <view class="navBtn">
       <t-button class="custom-css" wx:if="{{currentState == 'WaitValid'}}" disabled="{{!isEnbled}}" style="margin-right:10px;" size="extra-small" bindtap="updateStateNormalDatas">鎵归噺閫氳繃</t-button>
diff --git a/packageCourse/components/studentManage/index.wxss b/packageCourse/components/studentManage/index.wxss
index 07e031c..e9ccc12 100644
--- a/packageCourse/components/studentManage/index.wxss
+++ b/packageCourse/components/studentManage/index.wxss
@@ -73,7 +73,7 @@
 
 .contentList {
   width: 100%;
-  height: calc(100% - 55px - 45px - 48px);
+  height: calc(100% - 55px - 48px - 48px);
   background-color: #fff;
 }
 
@@ -140,13 +140,13 @@
 
 .navBottom {
   width: 100%;
-  height: 45px;
+  height: 46px;
   background-color: #fff;
   display: flex;
   justify-content: space-between;
   align-items: center;
   border-top: 1rpx solid #eee;
-  padding: 5px 10px;
+  padding: 0 10px;
   box-sizing: border-box;
 }
 
diff --git a/packageCourse/pages/course/detail/index.js b/packageCourse/pages/course/detail/index.js
index 0e7815d..564f0e7 100644
--- a/packageCourse/pages/course/detail/index.js
+++ b/packageCourse/pages/course/detail/index.js
@@ -401,7 +401,7 @@
       return false
     }
     wx.navigateTo({
-      url: '/packageCourse/pages/teachClass/index?classId=' + classId + '&courseId=' + this.data.courseId + '&author=' + this.data.bookData.author + '&isbn=' + this.data.bookData.isbn + '&bookId=' + this.data.bookData.id + '&rootCmsItemId=' + this.data.bookData.rootCmsItemId + "&bookRefCode=" + this.data.defaultCmsPath,
+      url: '/packageCourse/pages/teachClass/index?classId=' + classId + '&courseId=' + this.data.courseId + '&author=' + this.data.bookData.author + '&isbn=' + this.data.bookData.isbn + '&bookId=' + this.data.bookData.id + '&rootCmsItemId=' + this.data.bookData.rootCmsItemId + "&bookRefCode=" + item.linkProductDto.product.refCode,
     })
   },
 

--
Gitblit v1.9.1