<template>
	<view class="safe-area-inset-bottom">
		<navigator :url="`/pages/enterprise/detail?id=${item.id}`" class="card" v-for="(item,index) in list" :key="index">
			<view class="item">
				<view class="left">
					<view class="tag" :class="item.tagColor">
						<text>{{item.enterpriseName.substr(0,1)}}</text>
					</view>
					<view class="content">
						<text class="text-cut-1">{{item.enterpriseName}}</text>
						<text class="text-cut-1">{{item.enterpriseTypeName}}</text>
					</view>
				</view>
				<view class="right">
					<image @click.stop="$util.callPhone(item.officeNum)" src="../../../static/index/call.png" mode=""></image>
				</view>
			</view>
		</navigator>
	</view>
</template>

<script>
	export default {
		props: {
			list: Array
		},
		data() {
			return {
				callPhone(phone) {
					uni.showModal({
						title: '提示',
						content: `确定要拨打电话：${phone}吗?`,
						success: function(res) {
							if (res.confirm) {
								uni.makePhoneCall({
									phoneNumber: phone //仅为示例
								});
							}
						}
					});
				}
			}
		},
		methods: {

		}
	}
</script>

<style lang="scss">
	.card {
		position: relative;
		background-color: #FFFFFF;
		padding: 35rpx;
		margin: 20rpx;

		.item {
			display: flex;
			justify-content: space-between;
		}

		.left {
			display: flex;
			width: 88%;

			.tag {
				border-radius: 50%;
				display: flex;
				justify-content: center;
				align-items: center;
				height: 80rpx;
				width: 80rpx;
				font-size: 32rpx;
			}

			.content {
				padding-left: 30rpx;
				display: flex;
				flex-direction: column;

				text:first-child {
					font-size: 32rpx;
				}

				text:last-child {
					font-size: 28rpx;
					color: #9f9f9f;
					padding-top: 15rpx;
				}
			}
		}

		.right {
			display: flex;
			justify-content: center;
			align-items: center;

			image {
				width: 50rpx;
				height: 50rpx;
			}
		}
	}
</style>
