闫增涛
2024-12-31 afdda50cc54231b4fa788041adadb49cc239da23
Merge refs/remotes/origin/master into refs/heads/master
8个文件已修改
411 ■■■■■ 已修改文件
packageCourse/components/studentManage/index.js 107 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageCourse/components/studentManage/index.json 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageCourse/components/studentManage/index.wxml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageCourse/components/studentManage/index.wxss 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageCourse/pages/course/detail/index.wxml 253 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageCourse/pages/course/detail/index.wxss 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageCourse/pages/course/index.wxml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageCourse/pages/course/index.wxss 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
packageCourse/components/studentManage/index.js
@@ -34,6 +34,8 @@
      name: '助教',
      value: 'Teacher'
    }],
    isAll: false,
    isEnbled: false,
    // 加载参数
    bottomLoading: false,
    isMoreData: false,
@@ -50,6 +52,88 @@
   * 组件的方法列表
   */
  methods: {
    // 选择学生
    selectUser(e) {
      const {
        index
      } = e.currentTarget.dataset
      let bool = false;
      let allBool = false;
      const data = this.data.userList;
      data[index].isCheck = !data[index].isCheck;
      const list = data.filter(item => item.isCheck);
      if (list.length === this.data.userList.length - 1) {
        allBool = true
      }
      if (list.length > 1) {
        bool = true
      }
      this.setData({
        userList: data,
        isEnbled: bool,
        isAll: allBool
      })
    },
    // 全选
    selectAll(e) {
      const data = this.data.userList;
      data.forEach(item => {
        item.isCheck = e.detail.checked
      })
      this.setData({
        userList: data,
        isAll: e.detail.checked,
        isEnbled: e.detail.checked,
      })
    },
    // 批量通过
    updateStateNormalDatas() {
      const dataUser = this.data.userList.filter((item) => item.isCheck = true)
      const data = {
        groupId: this.properties.classId,
        requests: dataUser.map((item) => {
          return {
            linkId: item.linkId,
            linkType: item.linkType,
            state: 'Normal',
            groupState: 'Normal'
          }
        })
      }
      app.MG.identity.updateAppUserGroupLink(data).then((res) => {
        if (res) {
          getStudentList()
        }
      })
    },
    // 批量移除学生
    removeStudentDatas() {
      wx.showModal({
        title: '提示',
        content: '是否批量移除选中成员?',
        complete: (res) => {
          if (res.cancel) {
            return
          }
          if (res.confirm) {
            const dataUser = this.data.userList.filter((item) => item.isCheck = true)
            const data = {
              groupId: this.properties.classId,
              appUserIds: dataUser.map((item) => item.appUser.id)
            }
            app.MG.identity.removeAppUserFromGroup(data).then((res) => {
              if (res) {
                this.getStudentList()
              }
            })
          }
        }
      })
    },
    // 获取学生列表
    getStudentList(isReachBottom) {
      const data = {
@@ -70,12 +154,18 @@
        if (datas.length > 0) {
          let list = datas.map((item, index) => {
            if (item.linkType == 'Creator') {
              const userInfo = item.appUser?.infoList?.find((citem) => citem.type == 'teacherInfo')
              item.appUser.name = userInfo.name
              item.appUser.icon = userInfo.icon
              if (userInfo?.data) {
                const iconData = JSON.parse(userInfo.data)
                item.appUser.icon = getPublicImage(iconData?.relevantCertificates[0]?.md5, 100) ?? ''
              const wechatData = item.appUser?.infoList?.find((citem) => citem.type == 'WeChat')
              const defaultData = item.appUser?.infoList?.find((citem) => citem.type == 'teacherInfo')
              let userInfo = defaultData;
              if (wechatData?.name) {
                userInfo = wechatData;
                item.appUser.name = userInfo.name
                item.appUser.icon = userInfo.icon
              } else {
                if (userInfo?.data) {
                  const iconData = JSON.parse(userInfo.data)
                  item.appUser.icon = getPublicImage(iconData?.relevantCertificates[0]?.md5, 100) ?? ''
                }
              }
            }
            if (item.linkType == 'RefCode' || item.linkType == 'Teacher') {
@@ -92,7 +182,8 @@
            return {
              ...item,
              index: index + 1,
              createDate: moment(item.createDate).format('YYYY-MM-DD')
              createDate: moment(item.createDate).format('YYYY-MM-DD'),
              isCheck: false
            }
          })
          //触底加载新数据并保留老数据
@@ -101,7 +192,7 @@
          }
          this.setData({
            userList: list,
            total: res.totalSize,
            total: totalSize,
            skeletonLoding: false,
            bottomLoading: false
          })
packageCourse/components/studentManage/index.json
@@ -13,6 +13,7 @@
    "t-popup": "tdesign-miniprogram/popup/popup",
    "t-icon": "tdesign-miniprogram/icon/icon",
    "t-radio": "tdesign-miniprogram/radio/radio",
    "t-radio-group": "tdesign-miniprogram/radio-group/radio-group"
    "t-radio-group": "tdesign-miniprogram/radio-group/radio-group",
    "t-checkbox": "tdesign-miniprogram/checkbox/checkbox"
  }
}
packageCourse/components/studentManage/index.wxml
@@ -11,7 +11,8 @@
        </view>
      </view>
      <view class="userList" wx:for="{{userList}}" wx:key="index">
        <view class="userInfo">
        <view class="userInfo" bindtap="selectUser" data-index="{{index}}">
          <t-checkbox wx:if="{{item.linkType != 'Creator'}}" block="{{false}}" checked="{{item.isCheck}}" />
          <t-avatar class="avatar-example" size="small" image="{{item.appUser.icon}}" />
          <text class="user">{{item.appUser.name}}</text>
        </view>
@@ -32,6 +33,15 @@
  <view class="content" wx:if="{{userList.length == 0}}">
    <empty />
  </view>
  <view class="navBottom" wx:if="{{userList.length > 1}}">
    <view class="navBottom-check">
      <t-checkbox block="{{false}}" label="全选" checked="{{isAll}}" bind:change="selectAll" />
    </view>
    <view class="navBtn">
      <t-button disabled="{{!isEnbled}}" style="margin-right:10px" size="extra-small" bindtap="updateStateNormalDatas">批量通过</t-button>
      <t-button disabled="{{!isEnbled}}" size="extra-small" theme="danger" bindtap="removeStudentDatas">批量移除</t-button>
    </view>
  </view>
</view>
<t-popup visible="{{showConfirm}}" usingCustomNavbar bind:visible-change="onVisibleChange" placement="center">
  <view class="block--select">
packageCourse/components/studentManage/index.wxss
@@ -7,8 +7,8 @@
.contentBox {
  width: 100%;
  height: calc(100vh - env(safe-area-inset-bottom));
  background-color: #eee;
  height: 100%;
  background-color: #fff;
  font-size: 28rpx;
}
@@ -55,7 +55,7 @@
.contentList {
  width: 100%;
  height: calc(100% - 55px);
  height: calc(100% - 55px - 45px);
  background-color: #fff;
}
@@ -120,6 +120,18 @@
  right: 0;
}
.navBottom {
  width: 100%;
  height: 45px;
  background-color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1rpx solid #eee;
  padding: 5px 10px;
  box-sizing: border-box;
}
/* gujia */
.group {
packageCourse/pages/course/detail/index.wxml
@@ -6,30 +6,9 @@
      <view wx:if="{{!courseLoading}}">
        <view class="ID-State">
          <text class="ID">ID: {{detail.id}}</text>
          <t-tag
            class="margin-16"
            size="large"
            wx:if="{{detail.applyState == 'WaitAudit'}}"
            variant="light"
            theme="warning"
            >审核中</t-tag
          >
          <t-tag
            class="margin-16"
            size="large"
            wx:if="{{detail.applyState == 'Reject'}}"
            variant="light"
            theme="danger"
            >未通过</t-tag
          >
          <t-tag
            class="margin-16"
            size="large"
            wx:if="{{detail.applyState == 'Normal'}}"
            variant="light"
            theme="success"
            >使用中</t-tag
          >
          <t-tag class="margin-16" size="large" wx:if="{{detail.applyState == 'WaitAudit'}}" variant="light" theme="warning">审核中</t-tag>
          <t-tag class="margin-16" size="large" wx:if="{{detail.applyState == 'Reject'}}" variant="light" theme="danger">未通过</t-tag>
          <t-tag class="margin-16" size="large" wx:if="{{detail.applyState == 'Normal'}}" variant="light" theme="success">使用中</t-tag>
        </view>
        <view class="statics">
          <view class="classCout">
@@ -50,18 +29,8 @@
                <text>作者:{{bookData.author}}</text>
                <text>ISBN:{{bookData.isbn}}</text>
              </view>
              <image
                wx:if="{{bookData.icon}}"
                class="bookIcon"
                src="{{bookData.icon}}"
                mode=""
              />
              <image
                wx:else
                class="bookIcon"
                src="/static/images/default-book-img.png"
                mode=""
              />
              <image wx:if="{{bookData.icon}}" class="bookIcon" src="{{bookData.icon}}" mode="" />
              <image wx:else class="bookIcon" src="/static/images/default-book-img.png" mode="" />
            </view>
          </view>
        </view>
@@ -78,123 +47,40 @@
    <!-- 班级管理 -->
    <view class="classBox" wx:else>
      <view class="header">
        <t-search
          style="flex: 1"
          value="{{searchKey}}"
          bind:clear="changeHandle"
          bind:submit="changeHandle"
          placeholder="搜索班级名称"
          clearable
        />
        <t-button bindtap="newClass" size="small" style="margin-left: 15rpx"
          >开班</t-button
        >
        <t-search style="flex: 1" value="{{searchKey}}" bind:clear="changeHandle" bind:submit="changeHandle" placeholder="搜索班级名称" clearable />
        <t-button bindtap="newClass" size="small" style="margin-left: 15rpx">开班</t-button>
      </view>
      <view
        class="contentList"
        wx:if="{{classList.length > 0 && !classLoading}}"
      >
        <scroll-view
          class="scroll"
          class="content"
          bind:scroll="onPageScroll"
          model:scroll-top="{{setScrollValue}}"
          scroll-y
          refresher-enabled="{{true}}"
          lower-threshold="{{80}}"
          refresher-threshold="{{80}}"
          refresher-default-style="none"
          refresher-triggered="{{triggered}}"
          bindrefresherpulling="{{refresh.onPulling}}"
          bindrefresherrefresh="onPullDownRefresh"
          bindscrolltolower="onReachBottom"
        >
      <view class="contentList" wx:if="{{classList.length > 0 && !classLoading}}">
        <scroll-view class="scroll" class="content" bind:scroll="onPageScroll" model:scroll-top="{{setScrollValue}}" scroll-y refresher-enabled="{{true}}" lower-threshold="{{80}}" refresher-threshold="{{80}}" refresher-default-style="none" refresher-triggered="{{triggered}}" bindrefresherpulling="{{refresh.onPulling}}" bindrefresherrefresh="onPullDownRefresh" bindscrolltolower="onReachBottom">
          <view slot="refresher" class="refresh-container">
            <view class="loading">
              <t-loading
                theme="circular"
                size="40rpx"
                text="正在刷新..."
                class="wrapper"
              />
              <t-loading theme="circular" size="40rpx" text="正在刷新..." class="wrapper" />
            </view>
          </view>
          <view
            class="listClass"
            wx:for="{{classList}}"
            wx:key="index"
            data-class-id="{{item.id}}"
            data-item="{{item}}"
            bindtap="todetail"
          >
          <view class="listClass" wx:for="{{classList}}" wx:key="index" data-class-id="{{item.id}}" data-item="{{item}}" bindtap="todetail">
            <view class="titleBox">
              <text class="className">{{item.name}}</text>
              <text class="classId" style="color: #999; font-size: 12px">
                ID: {{item.id}}</text
              >
              <text class="classId" style="color: #999; font-size: 12px">ID: {{item.id}}</text>
            </view>
            <view class="infoBox">
              <text
                class="classTag"
                wx:if="{{item.applyState == 'WaitAudit'}}"
                style="color: #ef9f29"
                >状态: 审核中</text
              >
              <text
                class="classTag"
                wx:if="{{item.applyState == 'Normal'}}"
                style="color: #1dbd11"
                >状态: 进行中</text
              >
              <text
                class="classTag"
                wx:if="{{item.applyState == 'Reject'}}"
                style="color: red"
                >状态: 未通过</text
              >
              <t-icon
                bindtap="delClass"
                data-del-id="{{item.id}}"
                class="delete"
                wx:if="{{item.applyState == 'Reject'}}"
                name="delete"
                color="red"
                size="18px"
              />
              <text class="classTag" wx:if="{{item.applyState == 'WaitAudit'}}" style="color: #ef9f29">状态: 审核中</text>
              <text class="classTag" wx:if="{{item.applyState == 'Normal'}}" style="color: #1dbd11">状态: 进行中</text>
              <text class="classTag" wx:if="{{item.applyState == 'Reject'}}" style="color: red">状态: 未通过</text>
              <t-icon bindtap="delClass" data-del-id="{{item.id}}" class="delete" wx:if="{{item.applyState == 'Reject'}}" name="delete" color="red" size="18px" />
              <view wx:if="{{item.applyState == 'Reject'}}" class="reason">
                <text> 拒绝原因:</text>
                <t-tag
                  style="margin-left: 0"
                  bind:tap="showDialog"
                  data-item="{{item}}"
                  class="margin-16 replay"
                  theme="danger"
                  >点击查看</t-tag
                >
                <t-tag style="margin-left: 0" bind:tap="showDialog" data-item="{{item}}" class="margin-16 replay" theme="danger">点击查看</t-tag>
              </view>
              <!-- <text class="classTag" wx:if="{{item.applyState == 'Reject'}}" style="color: red">拒绝原因:{{ item.reason != '' ? item.reason : '-' }}</text> -->
              <text class="classTag"
                >班级人数: {{ item.memberCount }} / {{ item.maxUserCount
                }}</text
              >
              <text class="classTag"
                >有效期:{{ item.beginDate }} - {{ item.endDate }}</text
              >
              <text class="classTag">班级人数: {{ item.memberCount }} / {{ item.maxUserCount
                }}</text>
              <text class="classTag">有效期:{{ item.beginDate }} - {{ item.endDate }}</text>
            </view>
          </view>
          <view class="bottom-loading" wx:if="{{bottomLoading}}">
            <t-loading
              theme="circular"
              size="40rpx"
              text="加载中..."
              class="wrapper"
            />
            <t-loading theme="circular" size="40rpx" text="加载中..." class="wrapper" />
          </view>
          <view
            class="bottom-loading"
            style="color: #ccc; font-size: 28rpx"
            wx:if="{{isMoreData}}"
          >
          <view class="bottom-loading" style="color: #ccc; font-size: 28rpx" wx:if="{{isMoreData}}">
            <text>没有更多了</text>
          </view>
        </scroll-view>
@@ -216,112 +102,53 @@
          <view class="classInfo">
            <view class="c-name">
              <text>班级名称</text>
              <t-input
                value="{{className}}"
                bindchange="onCourseNameInput"
                borderless
                clearable
                placeholder="请输入班级名称"
              />
              <t-input value="{{className}}" bindchange="onCourseNameInput" borderless clearable placeholder="请输入班级名称" />
            </view>
            <view class="c-desc">
              <text>班级人数</text>
              <t-input
                value="{{count}}"
                type="number"
                bindchange="onCourseDescInput"
                borderless
                placeholder="请输入班级人数"
              />
              <t-input value="{{count}}" type="number" bindchange="onCourseDescInput" borderless placeholder="请输入班级人数" />
            </view>
            <view class="c-date">
              <text>班级有效期</text>
              <view class="dateBox">
                <view>
                  <t-input
                    style="display:{{isShow}}"
                    value="{{startTime}}"
                    readonly
                    borderless
                    bindtap="openDateStart"
                    placeholder="请选择开始时间"
                  />
                  <t-calendar
                    visible="{{visibleStart}}"
                    bind:confirm="handleConfirmStart"
                  />
                  <t-input style="display:{{isShow}}" value="{{startTime}}" readonly borderless bindtap="openDateStart" placeholder="请选择开始时间" />
                  <t-calendar visible="{{visibleStart}}" bind:confirm="handleConfirmStart" />
                </view>
                <view>~</view>
                <view>
                  <t-input
                    value="{{endTime}}"
                    style="display:{{isShow}}"
                    readonly
                    borderless
                    bindtap="openDateEnd"
                    placeholder="请选择结束时间"
                  />
                  <t-calendar
                    visible="{{visibleEnd}}"
                    bind:confirm="handleConfirmEnd"
                  />
                  <t-input value="{{endTime}}" style="display:{{isShow}}" readonly borderless bindtap="openDateEnd" placeholder="请选择结束时间" />
                  <t-calendar visible="{{visibleEnd}}" bind:confirm="handleConfirmEnd" />
                </view>
              </view>
            </view>
          </view>
          <view class="classSubmit">
            <t-button
              style="padding: 0 25px; margin: 0 15px"
              size="small"
              bindtap="cancle"
              variant="outline"
              >取消</t-button
            >
            <t-button
              style="padding: 0 25px; margin: 0"
              size="small"
              bindtap="submitClass"
              >确认</t-button
            >
            <t-button style="padding: 0 25px; margin: 0 15px" size="small" bindtap="cancle" variant="outline">取消</t-button>
            <t-button style="padding: 0 25px; margin: 0" size="small" bindtap="submitClass">确认</t-button>
          </view>
        </view>
      </t-popup>
      <t-dialog
        visible="{{showContentOnly}}"
        bind:confirm="closeDialog"
        close-on-overlay-click
      >
        <view slot="content" class="reasonContent"> {{reason}} </view>
      <t-dialog visible="{{showContentOnly}}" bind:confirm="closeDialog" close-on-overlay-click>
        <scroll-view slot="content" type="list" scroll-y class="long-content">
          <view class="reasonContent">
            {{reason}}
          </view>
        </scroll-view>
        <view slot="confirm-btn" style="width: 100%">
          <t-button
            style="color: #ff6d00; border-top: 1px solid #eee"
            variant="text"
            bindtap="closeDialog"
            size="large"
            block
            t-class="external-class"
            >知道了</t-button
          >
          <t-button style="color: #ff6d00; border-top: 1px solid #eee" variant="text" bindtap="closeDialog" size="large" block t-class="external-class">知道了</t-button>
        </view>
      </t-dialog>
    </view>
  </view>
  <view class="tabbar-bottom">
    <view
      class="{{tabVal == 'base'?'tab-pubItem activeTab':'tab-pubItem'}}"
      data-str="base"
      bindtap="tabActive"
    >
    <view class="{{tabVal == 'base'?'tab-pubItem activeTab':'tab-pubItem'}}" data-str="base" bindtap="tabActive">
      <t-icon class="tabIcon" name="home" size="24px" />
      <text class="text">基本信息</text>
    </view>
    <view
      class="{{tabVal == 'class'?'tab-pubItem activeTab':'tab-pubItem'}}"
      data-str="class"
      bindtap="tabActive"
    >
    <view class="{{tabVal == 'class'?'tab-pubItem activeTab':'tab-pubItem'}}" data-str="class" bindtap="tabActive">
      <t-icon class="tabIcon" name="file-setting" size="24px" />
      <text class="text">班级管理</text>
    </view>
  </view>
</view>
</view>
packageCourse/pages/course/detail/index.wxss
@@ -57,7 +57,7 @@
.contentList {
  width: 100%;
  height: calc(100% - 55px);
  padding: 5px 20rpx;
  padding: 5px 10rpx;
  box-sizing: border-box;
}
@@ -136,6 +136,7 @@
  color: #666;
  font-size: 26rpx;
  line-height: 44rpx;
  max-height: 300rpx;
}
.external-class {
@@ -227,10 +228,6 @@
  color: #ff6d00;
}
.contentList {
  width: 100%;
  height: calc(100% - 55px);
}
.header {
  width: 100%;
packageCourse/pages/course/index.wxml
@@ -32,9 +32,11 @@
            <text> 拒绝原因:</text>
            <t-tag style="margin-left: 0;" bind:tap="showDialog" class="margin-16 replay" theme="danger">点击查看</t-tag>
            <t-dialog visible="{{showContentOnly}}" bind:confirm="closeDialog" close-on-overlay-click>
              <view slot="content" class="reasonContent">
                {{item.reason}}
              </view>
              <scroll-view slot="content" type="list" scroll-y class="long-content">
                <view class="reasonContent">
                  {{item.reason}}
                </view>
              </scroll-view>
              <view slot="confirm-btn" style="width: 100%;">
                <t-button style="color: #ff6d00;border-top: 1px solid #eee;" variant="text" bindtap="closeDialog" size="large" block t-class="external-class">知道了</t-button>
              </view>
packageCourse/pages/course/index.wxss
@@ -85,6 +85,7 @@
  color: #666;
  font-size: 26rpx;
  line-height: 44rpx;
  max-height: 300rpx;
}
.external-class {
@@ -363,4 +364,4 @@
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
}