我报名的完善

This commit is contained in:
lmj
2022-11-16 14:43:17 +08:00
parent e8be3a6227
commit 4caa17aadb

View File

@@ -4,11 +4,16 @@
<!-- <view class="top-ten" style="margin-top: 21px;margin-left: 13px;"> <!-- <view class="top-ten" style="margin-top: 21px;margin-left: 13px;">
<text class="textbtn" @click="loadstatusSelecShow=!loadstatusSelecShow">状态</text> <text class="textbtn" @click="loadstatusSelecShow=!loadstatusSelecShow">状态</text>
</view> --> </view> -->
<view class="searchView"> <view class="searchView" v-show="tabIndex===0">
<u-search :clearabled="true" @search="loadBoeData(true)" @clear="loadBoeData(true)" <u-search :clearabled="true" @search="loadBoeData(true)" @clear="loadBoeData(true)"
placeholder="搜索关键字" v-model="loadkeyword" :showAction="false" shape="square" bgColor="##F2F5F7"> placeholder="搜索关键字" v-model="loadkeyword" :showAction="false" shape="square" bgColor="##F2F5F7">
</u-search> </u-search>
</view> </view>
<view class="searchView" v-show="tabIndex===1">
<u-search :clearabled="true" @search="getLearning()" @clear="getLearning()"
placeholder="搜索关键字" v-model="learkeyword" :showAction="false" shape="square" bgColor="##F2F5F7">
</u-search>
</view>
</view> </view>
<view class="tabbar" style="position: relative;"> <view class="tabbar" style="position: relative;">
<view class="tabbar-item" style="text-align: right;margin-right: 26upx;" @click="clicktab(0)" :class="{'active':tabIndex===0}"> <view class="tabbar-item" style="text-align: right;margin-right: 26upx;" @click="clicktab(0)" :class="{'active':tabIndex===0}">
@@ -20,14 +25,25 @@
</view> </view>
</view> </view>
<!-- 筛选状态 --> <!-- 筛选状态 -->
<view class="addition" v-if="tabIndex===1"> <view class="addition" v-show="tabIndex===0">
<view class="textbtn" style="color:#666;font-size: 28upx;" @click="statusSelectShow = !statusSelectShow"> <view class="textbtn" style="color:#666;font-size: 28upx;" @click="statusSelectShow = !statusSelectShow">
<text>筛选</text> <text>筛选</text>
<u-icon style="margin-left: 18upx;" name="arrow-down"></u-icon> <u-icon style="margin-left: 18upx;" name="arrow-down"></u-icon>
</view> </view>
<view class="sea-show" v-show="statusSelectShow"> <view class="sea-show" v-show="statusSelectShow">
<view v-for="(status,index) in selectData" :key="index" :class="[articleList.status == status.value? 'sea-active':'','sea-index']" @click="chooseStatus(status)"> <view v-for="(status,index) in statustList" :key="index" :class="[classType == status.value? 'sea-active':'','sea-index']" @click="autonomyStatus(status.value)">
{{status.label}} {{status.name}}
</view>
</view>
</view>
<view class="addition" v-show="tabIndex===1">
<view class="textbtn" style="color:#666;font-size: 28upx;" @click="statusSelectShow = !statusSelectShow">
<text>筛选</text>
<u-icon style="margin-left: 18upx;" name="arrow-down"></u-icon>
</view>
<view class="sea-show" v-show="statusSelectShow">
<view v-for="(status,index) in statustList" :key="index" :class="[classType == status.value? 'sea-active':'','sea-index']" @click="taskStatus(status.value)">
{{status.name}}
</view> </view>
</view> </view>
</view> </view>
@@ -108,11 +124,13 @@
<text style="font-size: 30upx; font-weight: bold;" v-html="$keywordActiveShow(c.courseName, autonomy.keyword)"></text> <text style="font-size: 30upx; font-weight: bold;" v-html="$keywordActiveShow(c.courseName, autonomy.keyword)"></text>
</view> </view>
<view class="coures-midd"> <view class="coures-midd">
</view> </view>
<view class="rowbtn"> <view class="rowbtn" >
<image @click.native.stop="rowbtn(c)" style="width: 100%;height: 100%;" <image @click.native.stop="removecour(c)" style="width: 100%;height: 100%;position: relative"
src="../../static/images/icon/more.png" alt=""> src="../../static/images/icon/more.png" alt="">
<view class="delcoures" v-show="c.delcour" @click.native.stop="rowbtn(c)">
<u-icon style="line-height: 90upx;" name="trash" label="删除课程"></u-icon>
</view>
</view> </view>
<view class="coures-bottom coures-midd"> <view class="coures-bottom coures-midd">
<view v-if="c.teacherName" class="course-author"> <view v-if="c.teacherName" class="course-author">
@@ -295,7 +313,7 @@
couresList: '', couresList: '',
switch: '', switch: '',
hisswitch: '', hisswitch: '',
classType: 0, classType: '',
hisclassType: '', hisclassType: '',
historyList: '', historyList: '',
studyList: [], studyList: [],
@@ -413,6 +431,10 @@
}, 500); }, 500);
}, },
methods: { methods: {
removecour(item){
console.log(item);
item.delcour = !item.delcour
},
rowbtn(row) { rowbtn(row) {
this.delData = row; this.delData = row;
this.btnsShow = true; this.btnsShow = true;
@@ -427,6 +449,7 @@
}); });
this.studyList.forEach((item, index) => { this.studyList.forEach((item, index) => {
if (item.id === this.delData.id) { if (item.id === this.delData.id) {
// item.delcour = false;
this.studyList.splice(index, 1); this.studyList.splice(index, 1);
} }
}) })
@@ -514,16 +537,17 @@
}) })
}, },
autonomyStatus(num) { autonomyStatus(num) {
// this.isSelect = num; this.status = num;
this.autonomy.status = num; this.getLearning();
this.searchData(); },
taskStatus(num) {
this.boeStatus = num;
this.loadBoeData(true);
}, },
closeBtns() { closeBtns() {
this.btnsShow = false; this.btnsShow = false;
}, },
searchData() { searchData() {
// this.page.pageIndex = 1;
// this.isListOne = true;
let list = this.studyData; let list = this.studyData;
let type; let type;
let wei; let wei;
@@ -580,13 +604,10 @@
} }
apiBoeCourse.cmtaskList(params).then(res => { apiBoeCourse.cmtaskList(params).then(res => {
this.taskCount = res.result.count; this.taskCount = res.result.count;
// let userIds=[];
res.result.list.forEach(item => { res.result.list.forEach(item => {
let time = this.formatDate(item.created_at * 1000); let time = this.formatDate(item.created_at * 1000);
item.created_at = time.split(' ')[0]; item.created_at = time.split(' ')[0];
// userIds.push(item.sysCreateAid);
}); });
// this.loadUserInfos(rs.result.list, userIds);
this.couresList = res.result.list; this.couresList = res.result.list;
if (this.taskCount > this.taskPageIndex * this.taskPageSize) { if (this.taskCount > this.taskPageIndex * this.taskPageSize) {
this.taskHasMore = true; this.taskHasMore = true;
@@ -700,23 +721,20 @@
title: '加载中...' title: '加载中...'
}); });
this.loadStatus = 'loading'; this.loadStatus = 'loading';
// let classType = null;
let data = []; let data = [];
let lear = { let lear = {
pageIndex: 1, //第几页 pageIndex: 1, //第几页
pageSize: 200, pageSize: 200,
courseName: this.learkeyword, courseName: this.learkeyword,
// courseType: classType,
status: this.status, status: this.status,
} }
// if(this.classType == 'online-course' || this.classType == '') {
await apicourseStudy.myStudyList(lear).then(res => { await apicourseStudy.myStudyList(lear).then(res => {
if (res.status == 200) { if (res.status == 200) {
// 我报名的接口 // 我报名的接口
//console.log(res) //console.log(res)
let courseIds = []; let courseIds = [];
res.result.list.forEach(item => { res.result.list.forEach(item => {
item.delcour = false;
item.teachersName = ''; item.teachersName = '';
item.addTime = item.addTime.split(' ')[0]; item.addTime = item.addTime.split(' ')[0];
courseIds.push(item.courseId); courseIds.push(item.courseId);
@@ -735,8 +753,12 @@
await apiBoeCourse.myLearning(learData).then(res => { await apiBoeCourse.myLearning(learData).then(res => {
if (res.status == 200) { if (res.status == 200) {
res.result.dataList.forEach(item => {
item.delcour = false;
})
let list = this.filterConversion(res.result.dataList); let list = this.filterConversion(res.result.dataList);
data.push(...list); data.push(...list);
} }
}) })
this.loadStatus = 'noMore'; this.loadStatus = 'noMore';
@@ -865,6 +887,18 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.delcoures{
position: absolute;
width: 180upx;
top: 40upx;
right: 0;
background: #FFFFFF;
box-shadow: 0px 1px 4px 1px rgba(0,0,0,0.08);
border-radius: 8upx;
z-index: 77;
padding: 30upx 30upx;
color: #333333;
}
.addition { .addition {
position: absolute; position: absolute;
right: 10upx; right: 10upx;
@@ -875,7 +909,7 @@
color: #4f4f4f; color: #4f4f4f;
font-size: 28upx; font-size: 28upx;
} }
.sea-show{ .sea-show {
width: 130upx; width: 130upx;
position: absolute; position: absolute;
top: 80upx; top: 80upx;
@@ -1022,15 +1056,10 @@
padding: 20upx 30upx 10upx 30upx; padding: 20upx 30upx 10upx 30upx;
.sea-active { .sea-active {
border: 1rpx solid #679cfc !important;
color: #679cfc; color: #679cfc;
} }
.sea-index { .sea-index {
font-size: 26rpx; font-size: 26rpx;
padding: 6rpx 16rpx;
border: 1rpx solid #ccc;
border-radius: 20rpx;
margin-right: 16rpx; margin-right: 16rpx;
background-color: #fff; background-color: #fff;
} }