洛阳学员端
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.
 
 
 
 
 

89 lines
1.9 KiB

<template>
<view class="pageBg">
<view class="infoBox pad">
<info :showSign="true" :item="info"></info>
</view>
<view class="pad">
<view class="card">
<view class="h1"><text class="active">教练评价</text></view>
<comments :list="list" @changeNav="changeNav"></comments>
<view style="padding-bottom: 20rpx;" v-if="list.length">
<u-loadmore :status="status" />
</view>
<nodata v-if="!list.length&&status=='nomore'"></nodata>
</view>
</view>
</view>
</template>
<script>
import comments from '../comments/comments.vue'
import info from './coachInfo.vue'
import { getBycoachId, } from '@/config/api.js'
export default {
components: { comments, info},
data() {
return {
params: {
pageNo: 1,
pageSize: 20,
coachId: '',
condition: 0
},
total: 20,
list: [],
coachList: [],
status: 'loading'
}
},
onLoad(options) {
if(!options.item) return
this.info = JSON.parse(decodeURIComponent(options.item))
console.log(this.info)
this.params.coachId = this.info.id
this.getBycoachIdFn()
},
methods: {
changeNav(val) {
if(this.params.condition == val) return
this.params.condition = val
this.initList()
},
initList() {
this.params.pageNo = 1
this.status = 'loading'
this.list = []
this.getBycoachIdFn()
},
async getBycoachIdFn() {
const {data: res} = await getBycoachId(this.params)
this.params.pageNo ++
this.total = res.total
let arr = res.list.map(item=>{
if(item.images) {
item.images = item.images.split(',')
}
return item
})
this.list.push(...arr)
if(this.list.length>=this.list.length) this.status = 'nomore'
}
}
}
</script>
<style lang="scss" scoped>
.card {
padding: 20rpx 0;
margin-top: 20rpx;
}
.h1 {
padding: 0 20rpx;
margin-bottom: 20rpx;
}
.infoBox {
background: #F6F6F6;
overflow: hidden;
}
</style>