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.
|
|
<template> <view class="pageBg"> <view class="infoBox pad"> <info :showSign="true" :item="info"></info> </view> <view class="pad"> <view class="card" style="margin: 20rpx 0;"> <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 { getListCoachComment } 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.coachId this.getListCoachCommentFn() }, methods: { changeNav(val) { this.params.condition = val this.initList() }, initList() { this.params.pageNo = 1 this.status = 'loading' this.list = [] this.getListCoachCommentFn() }, async getListCoachCommentFn() { const {data: res} = await getListCoachComment(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> .infoBox { background: #F6F6F6; overflow: hidden; } </style>
|