<template>
	<view class="main">
		<comments :list="list"></comments>
	</view>
</template>

<script>
	import comments from '../comments/comments.vue'
	import { getSchoolListComment } from '@/config/api.js'
	export default {
		components: { comments },
		data() {
			return {
				params: {
					pageNo: 1,
					pageSize: 20,
					schoolId: '',
				},
				total: 20,
				list: []
			}
		},
		onLoad(options) {
			this.params.schoolId = options.id
			this.getSchoolListCommentFn()
		},
		methods: {
			async getSchoolListCommentFn() {
				const {data: res} = await getSchoolListComment(this.params)
				this.params.pageNo ++
				this.list.push(...res.list)
				this.total = res.total
			}
		}
	}
</script>

<style>
</style>