<!-- 我的评价 -->
<template>
	<view class="evaluate">
		<mNavbar title="我的评价" :leftClick="leftClick"></mNavbar>

		<van-list v-if="reviewList.length > 0" v-model:loading="loading" :finished="finished" finished-text="没有更多了"
			@load="onLoad">
			<reviewListVue :list="reviewList"></reviewListVue>
		</van-list>

		<van-empty v-else image="/static/empty/record.png" image-size="400rpx" description="暂无评论" />

	</view>
</template>

<script>
	import mNavbar from '@/components/base/m-navbar.vue'
	import reviewListVue from '@/components/review/reviewList/reviewList.vue'

	export default {
		components: {
			mNavbar,
			reviewListVue
		},
		data() {
			return {
				loading : false,
				finished : false,
				reviewList : [],
			}
		},
		onShow(){
			this.getReview()
		},
		methods: {
			
			//返回个人中心
			leftClick() {
				uni.switchTab({
					url: '/pages/index/center'
				})
			},
			
			//滑动到屏幕底部
			onLoad(){
				this.queryParams.pageSize += 10;
				this.getReview()
			},
			
			//获取评论
			getReview(index) {
				this.loading = true
				this.$api('getCommentList', this.queryParams, res => {
					if (res.code == 200) {
						this.reviewList = res.result;
						// if(res.result.total > this.queryParams.pageSize){
						// 	this.finished = true;
						// }
						this.finished = true;
						this.loading = false;
					}
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.evaluate {}
</style>