<template>
	<view class="yhpj">
		<view class="yhpj-all">
			<text class="yhpj-all-fs">游友点评</text>
			<view class="">
				<text class="yhpj-all-sl">{{totalNumber}}条评论</text>
				<image class="yhpj-all-img" src="http://qiandaohu.tour-ma.com/r/cms/www/hebi/img/icon_jt.png"></image>
			</view>
		</view>
		<view class="yhpl" v-for="(el,ind) in pjinfo">
			<view class="yhxx">
				<image class="yhxx-img" :src="el.img"></image>
				<view class="yhxx-name">
					<text class="yhxx-name-txt">{{el.name}}</text>
					<text class="yhxx-name-pftxt">{{el.avg}}分</text>
				</view>
				<text class="yhxx-time">{{el.createTime}}</text>
			</view>
			<view class="yhplxx">
				{{el.des}}
			</view>
		</view>
		<view class="ckpj" v-if="totalNumber>3" @click="gotopj">
			<text class="ckpj-txt">查看全部评价</text>
		</view>
	</view>
</template>

<script>
	var web = require('../../components/utils/request.js');
	export default {
		props: ['info'],
		data() {
			return {
				pjinfo:[],
				totalNumber:0
			}
		},
		watch:{
			info(){
				this.getPinlun();
			}
		},
		created() {
			
		},
		methods: {
			getPinlun(){
				var url='/order/appraiseList.jspx';
				var para={
					waresId:this.info.waresId,
					pageNo:1,
					pageSize:3,
					orderType:this.info.orderType
				}
				var that=this;
				web.httpPost(that,url,para,function(res){
					var tmp=[];
					if(res.data.status==200){
						tmp=res.data.data;
					}
					that.totalNumber=res.data.totalNumber;
					that.pjinfo=tmp;			
				})
			},
			gotopj(){
				uni.navigateTo({
					url:'/pages/goupiao/pjlist?waresId='+this.info.waresId+'&orderType='+this.info.orderType
				})
			}
		}
	}
</script>

<style>
	.yhpj-all-img {
		width: 9upx;
		height: 15upx;
		margin-left: 10upx;
		margin-top: 5upx;
	}

	.ckpj-txt {
		font-size: 24upx;
		color: rgba(93, 163, 67, 1);
	}

	.ckpj {
		margin-top: 48upx;
		width: 196upx;
		height: 51upx;
		margin-left: 221upx;
		border: 1upx solid rgba(93, 163, 67, 1);
		border-radius: 6upx;
		line-height: 40upx;
		text-align: center;
	}



	.yhplxx {
		margin-top: 25upx;
		line-height: 1.6;
		font-size: 24upx;
		color: rgba(153, 153, 153, 1);
		text-indent: 48upx;
	}

	.yhxx-time {
		position: absolute;
		top: 5upx;
		right: 0;
		font-size: 24upx;
		color: rgba(153, 153, 153, 1);
	}

	.yhxx-name-pftxt {
		display: block;
		font-size: 28upx;
		color: rgba(93, 163, 67, 1);
		margin-top: 6upx;
	}

	.yhxx-name-txt {
		font-size: 30upx;
		color: rgba(153, 153, 153, 1);
	}

	.yhxx-name {
		margin-top: -2upx;
		margin-left: 25upx;
	}

	.yhxx-img {
		width: 83upx;
		height: 83upx;
		margin-top: -8upx;
		border-radius: 50%;
	}

	.yhxx {
		display: flex;
		flex-direction: row;
		position: relative;
	}

	.yhpl {
		margin-top: 42upx;
	}

	.yhpj-all-sl {
		font-size: 28upx;
		color: rgba(153, 153, 153, 1);
	}

	.yhpj-all-pj {
		font-size: 32upx;
		color: #5DA343;
		margin-right: 350upx;
	}

	.yhpj-all-fs {
		color: #333333;
		font-size: 32upx;
	}

	.yhpj-all {
		font-size: 28upx;
		font-weight: 600;
		color: rgba(51, 51, 51, 1);
		display: flex;
		justify-content: space-between;
	}

	.yhpj {
		width: 635upx;
		margin-top: 28upx;
		margin-left: 56upx;
	}
</style>
