| | |
| | | }) |
| | | }, |
| | | |
| | | //更新课程信息 |
| | | updateCourse(data) { |
| | | return request({ |
| | | url: '/edu/api/ApiUpdateCourse', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | }, |
| | | |
| | | //更新课程申请信息 |
| | | updateCourseApply(data) { |
| | | return request({ |
| | | url: '/edu/api/ApiUpdateCourseApply', |
| | | method: 'post', |
| | | data, |
| | | data |
| | | }) |
| | | }, |
| | | |
| | |
| | | total: 999, |
| | | loading: false |
| | | }, |
| | | updateCourse: false, |
| | | currentCourse: null, |
| | | submitLoading: false, |
| | | // 加载参数 |
| | | bottomLoading: false, |
| | |
| | | id: item.id, |
| | | icon: item.icon && item.icon != 'default' ? getPublicImage(item.icon, 200) : '', |
| | | introduction: item.description, |
| | | reason: item.applyReturnMsg ? JSON.parse(item.applyReturnMsg).reason : '-' |
| | | reason: item.applyReturnMsg ? JSON.parse(item.applyReturnMsg).reason ? JSON.parse(item.applyReturnMsg).reason : '-' : '-' |
| | | } |
| | | }) |
| | | //触底加载新数据并保留老数据 |
| | |
| | | }) |
| | | }, |
| | | |
| | | // 重新申请 |
| | | replayCourse(e) { |
| | | const { |
| | | item |
| | | } = e.currentTarget.dataset |
| | | if (!item.linkProduct.icon) { |
| | | item.linkProduct.icon = '' |
| | | } |
| | | const data = { |
| | | product: item.linkProduct |
| | | } |
| | | this.setData({ |
| | | currentCourse: item, |
| | | courseName: item.name, |
| | | courseDesc: item.description, |
| | | selectedBook: data, |
| | | updateCourse: true, |
| | | visible: true |
| | | }) |
| | | this.getTextBook() |
| | | }, |
| | | |
| | | // 新建课程 |
| | | submitCourse() { |
| | | if (this.data.updateCourse) { |
| | | this.setData({ |
| | | submitLoading: true |
| | | }) |
| | | app.MG.edu |
| | | .updateCourse({ |
| | | courseId: this.data.currentCourse.id, |
| | | name: this.data.currentCourse.name, |
| | | description: this.data.currentCourse.desc |
| | | }) |
| | | .then((res) => { |
| | | app.MG.edu |
| | | .updateCourseApply({ |
| | | courseId: this.data.currentCourse.id, |
| | | applyData: JSON.stringify({ |
| | | textBookId: this.data.selectedBook.product.id, |
| | | textBookName: this.data.selectedBook.product.name |
| | | }) |
| | | }) |
| | | .then((ares) => { |
| | | if (ares) { |
| | | this.setData({ |
| | | visible: false, |
| | | selectedBook: null, |
| | | courseDesc: '', |
| | | courseName: '', |
| | | submitLoading: false |
| | | }) |
| | | this.getData() |
| | | } |
| | | }) |
| | | }) |
| | | } else { |
| | | if (!this.data.courseName) { |
| | | wx.showToast({ |
| | | title: '请填写课程名称', |
| | |
| | | this.getData() |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | // 返回顶部 |
| | |
| | | <view class="courseId"> |
| | | <text>ID: {{item.id}}</text> |
| | | <t-tag class="margin-16" wx:if="{{item.applyState == 'WaitAudit'}}" variant="light" theme="warning">审核中</t-tag> |
| | | <t-tag class="margin-16" wx:if="{{item.applyState == 'Reject'}}" variant="light" theme="danger">未通过</t-tag> |
| | | <view wx:if="{{item.applyState == 'Reject'}}"> |
| | | <t-tag class="margin-16" variant="light" theme="danger">未通过</t-tag> |
| | | <t-tag bindtap="replayCourse" data-item="{{item}}" class="margin-16 replay" theme="danger">重新申请</t-tag> |
| | | </view> |
| | | <t-tag class="margin-16" wx:if="{{item.applyState == 'Normal'}}" variant="light" theme="success">使用中</t-tag> |
| | | </view> |
| | | <view wx:if="{{item.applyState == 'Reject'}}" class="reason">拒绝原因: {{item.reason}}</view> |
| | |
| | | border-bottom: 1rpx solid #eee; |
| | | } |
| | | |
| | | .replay { |
| | | margin-left: 20rpx; |
| | | background-color: red !important; |
| | | border: 0 !important; |
| | | position: relative; |
| | | z-index: 999999; |
| | | } |
| | | |
| | | .courseIcon { |
| | | width: 200rpx; |
| | | height: 280rpx; |