| | |
| | | padding: 20rpx; |
| | | box-sizing: border-box; |
| | | background-color: #f8f8f8; |
| | | margin-bottom: 10rpx; |
| | | } |
| | | |
| | | .statics { |
| | |
| | | |
| | | .pubCss { |
| | | width: 100%; |
| | | padding: 20rpx 0; |
| | | box-sizing: border-box; |
| | | max-height: 300px; |
| | | } |
| | | |
| | | .roleInfo { |
| | |
| | | |
| | | .bookData { |
| | | width: 100%; |
| | | height: 200rpx; |
| | | height: 250rpx; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | |
| | | }], |
| | | isAll: false, |
| | | isEnbled: false, |
| | | currentState: 'Normal', |
| | | // 加载参数 |
| | | bottomLoading: false, |
| | | isMoreData: false, |
| | |
| | | * 组件的方法列表 |
| | | */ |
| | | methods: { |
| | | changeHandle(e) { |
| | | const { |
| | | value |
| | | } = e.detail; |
| | | let cmsList = this.data.userList |
| | | this.setData({ |
| | | userList: [] |
| | | }) |
| | | if (value) { |
| | | const data = cmsList.filter(item => item.appUser.name.indexOf(value) > -1); |
| | | this.setData({ |
| | | userList: data |
| | | }) |
| | | } |
| | | if (value == '') { |
| | | this.setData({ |
| | | userList: [], |
| | | }) |
| | | this.getStudentList() |
| | | } |
| | | }, |
| | | // 当前状态 |
| | | onTabsChange(e) { |
| | | this.setData({ |
| | | currentState: e.detail.value, |
| | | userList: [], |
| | | isAll: false, |
| | | isEnbled: false |
| | | }) |
| | | this.getStudentList() |
| | | }, |
| | | |
| | | // 选择学生 |
| | | selectUser(e) { |
| | | const { |
| | |
| | | } = e.currentTarget.dataset |
| | | let bool = false; |
| | | let allBool = false; |
| | | const data = this.data.userList; |
| | | 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) { |
| | | const list = data.filter(item => item.isCheck == true); |
| | | if (list.length === data.length) { |
| | | allBool = true |
| | | } |
| | | if (list.length > 1) { |
| | | if (list.length > 0) { |
| | | bool = true |
| | | } |
| | | this.setData({ |
| | |
| | | selectAll(e) { |
| | | const data = this.data.userList; |
| | | data.forEach(item => { |
| | | item.isCheck = e.detail.checked |
| | | if (item.linkType != 'Creator') { |
| | | item.isCheck = e.detail.checked |
| | | } |
| | | }) |
| | | this.setData({ |
| | | userList: data, |
| | |
| | | |
| | | // 批量通过 |
| | | updateStateNormalDatas() { |
| | | const dataUser = this.data.userList.filter((item) => item.isCheck = true) |
| | | const dataUser = this.data.userList.filter((item) => item.isCheck == true) |
| | | const data = { |
| | | groupId: this.properties.classId, |
| | | requests: dataUser.map((item) => { |
| | |
| | | } |
| | | app.MG.identity.updateAppUserGroupLink(data).then((res) => { |
| | | if (res) { |
| | | getStudentList() |
| | | this.setData({ |
| | | userList: [] |
| | | }) |
| | | this.getStudentList() |
| | | } |
| | | }) |
| | | }, |
| | |
| | | return |
| | | } |
| | | if (res.confirm) { |
| | | const dataUser = this.data.userList.filter((item) => item.isCheck = true) |
| | | 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.setData({ |
| | | userList: [] |
| | | }) |
| | | this.getStudentList() |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // 批量拒绝 |
| | | updateStateRejectDatas() { |
| | | 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: 'Reject', |
| | | groupState: 'Normal' |
| | | } |
| | | }) |
| | | } |
| | | app.MG.identity.updateAppUserGroupLink(data).then((res) => { |
| | | if (res) { |
| | | this.setData({ |
| | | userList: [] |
| | | }) |
| | | this.getStudentList() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // 更新状态 拒绝 |
| | | updateStateReject(e) { |
| | | const { |
| | | item |
| | | } = e.currentTarget.dataset |
| | | const data = { |
| | | groupId: this.properties.classId, |
| | | requests: [{ |
| | | linkId: item.linkId, |
| | | linkType: item.linkType, |
| | | state: 'Reject', |
| | | groupState: 'Normal' |
| | | }] |
| | | } |
| | | app.MG.identity.updateAppUserGroupLink(data).then((res) => { |
| | | if (res) { |
| | | this.getStudentList() |
| | | } |
| | | }) |
| | | }, |
| | |
| | | const data = { |
| | | start: (this.data.page - 1) * this.data.limit, |
| | | size: this.data.limit, |
| | | filterList: [{ |
| | | value: this.data.currentState, |
| | | field: "State", |
| | | subFilters: [] |
| | | }], |
| | | searchList: this.data.searchKey ? [{ |
| | | keywords: this.data.searchKey, |
| | | field: 'Name', |
| | |
| | | "t-icon": "tdesign-miniprogram/icon/icon", |
| | | "t-radio": "tdesign-miniprogram/radio/radio", |
| | | "t-radio-group": "tdesign-miniprogram/radio-group/radio-group", |
| | | "t-checkbox": "tdesign-miniprogram/checkbox/checkbox" |
| | | "t-checkbox": "tdesign-miniprogram/checkbox/checkbox", |
| | | "t-tabs": "tdesign-miniprogram/tabs/tabs", |
| | | "t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel" |
| | | } |
| | | } |
| | |
| | | <view class="header"> |
| | | <t-search style="flex:1" value="{{searchKey}}" bind:clear="changeHandle" bind:submit="changeHandle" placeholder="搜索名称" clearable /> |
| | | </view> |
| | | <view class="tabComtyent"> |
| | | <t-tabs class="custom-tabs" defaultValue="{{currentState}}" bind:change="onTabsChange" t-class="custom-tabs"> |
| | | <t-tab-panel label="已通过" value="Normal" /> |
| | | <t-tab-panel label="待审核" value="WaitValid" /> |
| | | <t-tab-panel label="未通过" value="Reject" /> |
| | | </t-tabs> |
| | | </view> |
| | | <view class="contentList" wx:if="{{userList.length > 0}}"> |
| | | <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"> |
| | |
| | | <text class="user">{{item.appUser.name}}</text> |
| | | </view> |
| | | <view> |
| | | <t-button bindtap="selectIdentity" data-item="{{item}}" style="margin: 0;color: green;" size="extra-small" wx:if="{{item.state != 'Normal' && item.linkType != 'Creator'}}" variant="text">通过</t-button> |
| | | <t-button bindtap="removeStudent" data-item="{{item}}" style="margin: 0;color: red;" size="extra-small" wx:if="{{item.linkType != 'Creator' }}" variant="text">移除</t-button> |
| | | <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="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> |
| | | <view class="bottom-loading" wx:if="{{bottomLoading}}"> |
| | |
| | | <view class="content" wx:if="{{userList.length == 0}}"> |
| | | <empty /> |
| | | </view> |
| | | <view class="navBottom" wx:if="{{userList.length > 1}}"> |
| | | <view class="navBottom"> |
| | | <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> |
| | | <t-button class="custom-css" wx:if="{{currentState == 'WaitValid'}}" disabled="{{!isEnbled}}" style="margin-right:10px;" size="extra-small" bindtap="updateStateNormalDatas">批量通过</t-button> |
| | | <t-button wx:if="{{currentState != 'WaitValid'}}" disabled="{{!isEnbled}}" size="extra-small" theme="danger" bindtap="removeStudentDatas">批量移除</t-button> |
| | | <t-button wx:if="{{currentState == 'WaitValid'}}" disabled="{{!isEnbled}}" size="extra-small" theme="danger" bindtap="updateStateRejectDatas">批量拒绝</t-button> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | /* packageCourse/pages/course/index.wxss */ |
| | | .custom-css { |
| | | --td-button-default-disabled-bg: #ccc; |
| | | --td-button-default-bg-color: #67c23a; |
| | | --td-button-default-border-color: #67c23a; |
| | | } |
| | | |
| | | .custom-tabs { |
| | | --td-tab-item-active-color: #ff6d00; |
| | | --td-tab-track-color: #ff6d00; |
| | | } |
| | | |
| | | .demo-section__content { |
| | | margin-top: 32rpx; |
| | |
| | | background-color: #fff; |
| | | } |
| | | |
| | | .tabComtyent { |
| | | width: 100%; |
| | | } |
| | | |
| | | .tabComtyent .t-tabs__item--active { |
| | | color: #ff6d00 !important; |
| | | } |
| | | |
| | | .header .t-search__input-box { |
| | | height: 70rpx !important; |
| | | font-size: 28rpx; |
| | |
| | | |
| | | .contentList { |
| | | width: 100%; |
| | | height: calc(100% - 55px - 45px); |
| | | height: calc(100% - 55px - 45px - 48px); |
| | | background-color: #fff; |
| | | } |
| | | |
| | |
| | | |
| | | // 通过code查询班级 |
| | | getClassDetail() { |
| | | if (this.data.refCode == '') { |
| | | if (!this.data.refCode) { |
| | | wx.showToast({ |
| | | title: '请输入邀请码', |
| | | duration: 1000, |
| | | icon: "none", |
| | | }) |
| | | this.setData({ |
| | | classDetail: null |
| | | }) |
| | | return false |
| | | } |
| | |
| | | app.MG.edu |
| | | .getCourseClass(data) |
| | | .then(res => { |
| | | if (res) { |
| | | if (res.linkProductDto) { |
| | | res.classTime = moment(res.beginDate).format('YYYY-MM-DD') + '--' + moment(res.endDate).format('YYYY-MM-DD') |
| | | this.setData({ |
| | | classDetail: res |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | classDetail: null |
| | | }) |
| | | wx.showToast({ |
| | | title: '邀请码无效', |
| | | icon: "none" |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | wx.showToast({ |
| | | title: '邀请码无效', |
| | | icon: "none" |
| | | }) |
| | | this.setData({ |
| | | classDetail: null |
| | | }) |
| | | console.log(err) |
| | | }) |
| | | }, |
| | |
| | | // 关闭申请 |
| | | cancle() { |
| | | this.setData({ |
| | | visible: false |
| | | visible: false, |
| | | classDetail: null, |
| | | refCode: '' |
| | | }) |
| | | }, |
| | | |
| | |
| | | classList: list, |
| | | totalSize: totalSize, |
| | | visible: false, |
| | | classDetail: null, |
| | | refCode: '', |
| | | skeletonLoding: false, |
| | | bottomLoading: false |
| | | }) |
| | |
| | | <view class="c-name"> |
| | | <text>邀请码: </text> |
| | | <view class="c-name-option"> |
| | | <t-input value="{{refCode}}" bindchange="onCourseNameInput" borderless clearable placeholder="请输入邀请码" /> |
| | | <t-input value="{{refCode}}" bind:change="onCourseNameInput" bind:clear="onCourseNameInput" borderless clearable placeholder="请输入邀请码" /> |
| | | <t-button bindtap="getClassDetail" size="small" style="margin-left: 15rpx;">查看班级</t-button> |
| | | </view> |
| | | </view> |