<template>
	<view class="foodComment b-f" style="padding: 30upx;padding-bottom: 100upx;">
		<view >
			<view class="header dis-flex">
				<view class="f-w" style="flex: 0.3;">评价</view>
				<view  style="flex: 0.5;"></view>
				<view class="f-24" style="flex: 0.2;color: #999999;text-align: right;" v-if="false">
					{{evaluateList.totalnum}}条评论
					<text class="iconfont icon-right" style="font-size: 22upx;"></text>
				</view>
			</view>
			<view class="content p-top-bom-20" style="border-bottom: 1upx solid #f1f1f1;" v-for="(item,index) in evaluateList.commentinfo" :key="index">
				<view class="dis-flex">
					<view  style="flex: 0.15;">
						<image
							style="width: 100upx;height: 100upx;border-radius: 50%;"
							:src="item.headimg"
							mode="aspectFill"
						></image>
					</view>
					<view  style="flex: 0.6;padding: 20upx 10upx;">
						<view class="f-28">{{item.nickname}}</view>
						<view class="f-24" style="color: #999999;">{{item.createtime}}</view>
					</view>
					<view  style="flex: 0.25;padding: 4% 0;"><tui-rate :current="item.star" :disabled="true" :score="1" active="#F5D145"></tui-rate></view>
				</view>
				<view class="evaluate">
					<view class="f-24" style="padding: 20upx 0;">
						{{item.text}}
					</view>
					<view class="dis-flex" style="flex-wrap: wrap;">
						<view  style="flex: 1;padding-right: 10upx;width: 31%;min-width: 31%;max-width: 31%;" v-for="(picItem,i) in item.pic" :key="i">
							<image style="width: 100%;height: 200upx;border-radius: 15upx;" :src="picItem" mode="aspectFill" @click="lookImg(item.pic,i)"></image>
						</view>
					</view>
					<view class="f-24" style="padding: 20upx 0;" v-if="item.replytextone || item.replypicone[0]">
						<view  >
							<text class="iconfont icon-comment" style="color: #999999; font-size: 24upx;"></text>
							<text style="color: #999999;">商家回复:</text>
							<text style="padding-left: 20upx;">{{item.replytextone}}</text>
						</view>
						<view class="dis-flex" style="flex-wrap: wrap;">
						<view  style="flex: 1;padding-right: 10upx;width: 31%;min-width: 31%;max-width: 31%;" v-for="(replypiconeItem,i) in item.replypicone" :key="i">
							<image style="width: 100%;height: 200upx;border-radius: 15upx;" :src="replypiconeItem" mode="aspectFill"></image>
						</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
import App from '@/common/js/app.js';
import tuiRate from '@/components/template/rate.vue';
export default {
	components: {
		tuiRate
	},
	data() {
		return {
			evaluateList:{
				commentinfo:[]
			},
		};
	},
	mounted() {
		
	},
	props:{
		storeFoodList: {
			type: Object,
			default: null
		}
	},
	watch:{
		'storeFoodList': {
			handler(newData, oldData) {
				console.log(newData);
				this.getEvaluateList();
			},
			deep: true
		},
	},
	methods:{
		lookImg(imgList,index){
			uni.previewImage({
				current: index,
				urls: imgList
			})
		},
		getEvaluateList(){
			App._post_form(`&p=Goods&do=getComment&sid=${this.storeFoodList.sid}&page=${1}`, {}, res => {
				this.setData({
					evaluateList: res.data
				});
				console.log(this.evaluateList);
			}, false, () => {
				// _this.loadlogo = true
			})
		}
	}
};
</script>

<style></style>
