You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
142 lines
3.3 KiB
142 lines
3.3 KiB
<template>
|
|
<view class="pageBgImg">
|
|
<topNavbar title="学员评价"></topNavbar>
|
|
<view class="pad">
|
|
<view class="searchBox">
|
|
<searchRow placeholder="搜索学员姓名" @searchFn="searchFn"></searchRow>
|
|
</view>
|
|
<view class="tabs">
|
|
<view class="tab" :class="{active: this.params.condition==0}" @click="changeTab(0)">全部({{total}})</view>
|
|
<view class="tab" :class="{active: this.params.condition==1}" @click="changeTab(1)">匿名(缺字段)</view>
|
|
<view class="tab" :class="{active: this.params.condition==2}" @click="changeTab(2)">有图(2)</view>
|
|
<view class="tab" :class="{active: this.params.condition==3}" @click="changeTab(3)">有视频(3)</view>
|
|
</view>
|
|
<view class="list">
|
|
<view class="card" v-for="(item,index) in list" :key="index">
|
|
<commentItem :item="item" />
|
|
</view>
|
|
</view>
|
|
|
|
<view style="padding-bottom: 20rpx;" v-if="list.length">
|
|
<u-loadmore :status="status" />
|
|
</view>
|
|
<nodata v-if="!list.length&&status=='nomore'"></nodata>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import { schoolCommentPage, coachCommentPage } from '@/config/api.js'
|
|
export default {
|
|
data() {
|
|
return {
|
|
list: [],
|
|
params: {
|
|
pageNo: 1,
|
|
pageSize: 20,
|
|
schoolId: '',
|
|
condition: 0,
|
|
studentName: '',
|
|
coachType: '', //1.教练 2.模拟教练 3.模拟器老师
|
|
},
|
|
// 0查全部 1有图 2最新 3有视频
|
|
total: 20,
|
|
status: 'loading'
|
|
}
|
|
},
|
|
onLoad() {
|
|
this.params.schoolId = this.vuex_schoolId
|
|
if(this.identity=='实操教练') {
|
|
this.params.coachType = 1
|
|
}else if(this.identity=='考场模拟教练'){
|
|
this.params.coachType = 2
|
|
}else if(this.identity=='模拟器老师'){
|
|
this.params.coachType = 3
|
|
}
|
|
this.schoolCommentPageFn()
|
|
},
|
|
onPullDownRefresh() {
|
|
this.initList()
|
|
},
|
|
onReachBottom() {
|
|
if(this.total>this.list.length) {
|
|
this.schoolCommentPageFn()
|
|
}
|
|
},
|
|
methods: {
|
|
searchFn(val) {
|
|
this.params.studentName = val
|
|
this.initList()
|
|
},
|
|
changeTab(val) {
|
|
this.params.condition = val
|
|
this.initList()
|
|
},
|
|
initList() {
|
|
this.list = []
|
|
this.params.pageNo = 1
|
|
this.status = 'loading'
|
|
this.schoolCommentPageFn()
|
|
},
|
|
async schoolCommentPageFn() {
|
|
if(this.identity=='校长') {
|
|
var {data: res} = await schoolCommentPage(this.params)
|
|
}else {
|
|
let obj = Object.assign({},this.params)
|
|
obj.coachId = this.vuex_coachId
|
|
var {data: res} = await coachCommentPage(obj)
|
|
}
|
|
this.params.pageNo ++
|
|
let arr = res.list.map(item=>{
|
|
if(item.images) {
|
|
item.images = item.images.split(',')
|
|
}
|
|
return item
|
|
})
|
|
this.list.push(...arr)
|
|
this.total = res.total
|
|
if(this.list.length>=this.total) {
|
|
this.status = 'nomore'
|
|
}else {
|
|
this.status = 'loading'
|
|
}
|
|
console.log(res)
|
|
},
|
|
|
|
}
|
|
}
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.card {
|
|
padding: 28rpx;
|
|
margin-bottom: 20rpx;
|
|
}
|
|
.tabs {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
padding: 24rpx 12rpx;
|
|
.tab {
|
|
line-height: 76rpx;
|
|
font-size: 28rpx;
|
|
color: #fff;
|
|
&.active {
|
|
position: relative;
|
|
&::before {
|
|
position: absolute;
|
|
content: '';
|
|
left: 50%;
|
|
bottom: 0;
|
|
transform: translateX(-50%);
|
|
width: 56rpx;
|
|
height: 6rpx;
|
|
background: #FFFFFF;
|
|
border-radius: 3rpx;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|