<template>
	<view class="itemBox" >
		<view class="img" v-if="item.schoolIntroduceDO&&item.schoolIntroduceDO.iconPath&&$u.utils.isImagePath(item.schoolIntroduceDO.iconPath)">
			<image :src="item.schoolIntroduceDO.iconPath" mode="" @error="imgError"   lazy-load style="width: 200rpx;height: 135rpx;display: block;"></image>
		</view>
		<view class="img" v-else>
			<image src="@/static/images/bigImg/jlcbg.png" mode="aspectFill"></image>
		</view>
		<view class="textCon">
			<view class="name oneRowText">{{item.name}}</view>
			<view class="flex-b">
				<view style="display: flex;">
					<view class="starBox">
						<view class="num">{{item.stars|| '无'}}</view>
					</view>
					<moreRight :text="`${item.reviewTotal}条评价` "@click.native="$goPage('/pages/indexEntry/findShcool/shcoolComment/shcoolComment?id='+ item.id)" v-if="item.stars&&showReviewTotal"/>
				</view>
				
				<callPhone v-if="showPhone" :servicePhone="[{name: item.phone}]" >
					<view class="pozPhone">
						<image src="@/static/images/indexIcon/phone.png" mode=""></image>
					</view>
				</callPhone>
			</view>
			<view class="adr">{{item.districtName}}<text style="margin-left: 6rpx;" v-if="vuex_cityInfo.lat">距您{{ $u.utils.distanceFn(item.distance)}}</text> </view> 
			<!-- <view class="credit">行业信用 <text v-if="item.creditrating">{{item.creditrating}}</text></view>  -->
		</view>
		
	</view>
</template>

<script>
	export default {
		props: {
			showPhone: {
				type: Boolean,
				default: true
			},
			item: {
				type: Object,
				default: {}
			},
			showReviewTotal: {
				type: Boolean,//是否展示显示多少条评论
				default: false
			}
		},
		methods: {
			imgError() {
				delete this.item.schoolIntroduceDO.iconPath
				console.log('这图片有问题', this.item.schoolIntroduceDO.iconPath)
				this.$forceUpdate()
			}
		}
	}
</script>

<style lang="scss" scoped>
	.itemBox {
		background: #FFFFFF;
		border-radius: 16rpx;
		padding: 20rpx 0rpx;
		display: flex;
		border-bottom: 1px solid #F4F4F4;
	}
	.img {
		width: 200rpx;
		height: 135rpx;
		background: #f6f6f6;
		border-radius: 20rpx;
		overflow: hidden;
		flex-shrink: 0;
		// background: url('../../../../static/images/bigImg/jlcbg.png') no-repeat;
		// background-size: cover;
	}
	
	.textCon {
		flex: 1;
		font-size: 24rpx;
		padding: 0 0 0 20rpx;
		width: 0;
		.name {
			font-size: 26rpx;
			margin-top: 4rpx;
			color: #363A44;
		}
	
		.starBox {
			margin: 10rpx 10rpx 10rpx 0;
			
		}
	
		.credit {
			color: #1989FA;
			margin-bottom: 4rpx;
		}
	
		.adr {
			color: #999;
			font-size: 24rpx;
		}
	}
	
	.pozPhone {
		width: 55rpx;
		height: 55rpx;
		margin-top: 10rpx;
	}
</style>