111
QYF-GitLab1
2025-01-02 c5b6f319a21021892a299036c22862b1a3b2ad53
111
4个文件已修改
100 ■■■■ 已修改文件
packageCourse/components/studentManage/index.js 87 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageCourse/components/studentManage/index.wxml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageCourse/components/studentManage/index.wxss 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageCourse/pages/course/detail/index.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
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')
        }
      })
    },
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>
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;
}
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,
    })
  },