<template>
	<view class="pages">
		<div class="appraise-top">
			<div style="display:flex;align-items: center;">
				{{value}}分 <u-rate activeColor="#FFD700" :count="count" v-model="value" readonly></u-rate>
			</div>
			<div class="tabs">
				<div class="tabs-content" :class="{'tabs-active':index==current}" v-for="(item, index) in gradeList" :key="item.id" @click="change(item, index)">
					{{item.name}}
				</div>
			</div>
		</div>
		<div class="grade-detail" v-for="item in 10" :key="item.id">
			<div class="grade-detail-top">
				<div>
					<u-avatar :src="'@/static/niu.jpg'"></u-avatar>
					<div style="margin-left:10px">愤怒的小白</div>
				</div>
				<div class="grade-detail-top-word">
					发表于{{new Date().toLocaleDateString()}}
				</div>
			</div>
			<div class="grade-detail-top">
				<div>
					<div>5分</div>
					<u-rate activeColor="#FFD700" :count="5" :value="item+1" readonly></u-rate>
				</div>
				<div class="grade-detail-top-word">
					特惠双人房
				</div>
			</div>
			<div class="grade-detail-remark">
				评价方未及时做出评价，系统默认好评！
			</div>
		</div>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				count: 5,
				value: 0,
				gradeList: [
					{
						id: 1,
						name: '全部',
						value: 0
					},
					{
						id: 2,
						name: '好评',
						value: 1
					},
					{
						id: 3,
						name: '待改善',
						value: 2
					},
					{
						id: 4,
						name: '有图',
						value: 3
					}
				],
				current:0,
			}
		},
		methods: {
			change(item, idx){
				console.log(item)
				this.current = idx
			}
		}
	}
</script>

<style lang="scss" scoped>
.pages{
	width: 100vw;
	height: 100vh;
	background: #f5f5f5;
}
.appraise-top{
	padding: 20px;
	background: #fff;
}
.tabs-active{
	color: #fff !important;
	background: rgb(0, 170 ,255);
}
.tabs{
	display: flex;
	margin-top: 10px;
	.tabs-content{
		padding: 5px 12px;
		border-radius: 15px;
		border: 1px solid rgb(0, 170 ,255);
		color: rgb(0, 170 ,255);
		margin-right: 10px;
	}
}
.grade-detail{
	margin-top: 10px;
	padding: 20px;
	box-sizing: border-box;
	background: #fff;
	.grade-detail-top{
		display: flex;
		justify-content: space-between;
		align-items: center;
		div:nth-child(1){
			display: flex;
			align-items: center;
		}
		.grade-detail-top-word{
			color: #999;
			font-size: 14px;
		}
	}
	.grade-detail-remark{
		margin-top: 10px;
		// color: #999;
		// font-size: 14px;
	}
}
</style>
