<template>
	<view>
		<view style="padding:5rpx 20rpx 45rpx 20rpx;">
			<view class="desc item_border">
				<uni-row>
					<uni-col :span="20">
						<view class="desc">
							头像
						</view>
					</uni-col>
					<uni-col :span="4">
						<view>
							<view class="desc">
								<image v-if="data.imgSrc" class="desc_img" :src="BaseUrl+data.imgSrc"></image>
								<view v-else class="desc_img img_alt_text">无</view>
							</view>
						</view>
					</uni-col>
				</uni-row>
			</view>
			<view class="desc item_border">
				<uni-row>
					<uni-col :span="5">
						<view class="desc">
							姓名
						</view>
					</uni-col>
					<uni-col :span="19">
						<view class="desc descContent">
							<u-text :text="data.userName" size="18" color="#a3a3a3"></u-text>
						</view>
					</uni-col>
				</uni-row>
			</view>
			<view class="desc item_border">
				<uni-row>
					<uni-col :span="5">
						<view class="desc">
							部门
						</view>
					</uni-col>
					<uni-col :span="19">
						<view class="desc descContent">
							<u-text :text="data.department" size="18" color="#a3a3a3"></u-text>
						</view>
					</uni-col>
				</uni-row>
			</view>
			<view class="desc item_border">
				<uni-row>
					<uni-col :span="5">
						<view class="desc">
							岗位
						</view>
					</uni-col>
					<uni-col :span="19">
						<view class="desc descContent">
							<u-text :text="data.post" size="18" color="#a3a3a3"></u-text>
						</view>
					</uni-col>
				</uni-row>
			</view>
			<view class="desc item_border">
				<uni-row>
					<uni-col :span="5">
						<view class="desc">
							手机号
						</view>
					</uni-col>
					<uni-col :span="19">
						<view class="desc">
							<u-text mode="phone" :text="data.phone" size="18" call="true" color="#45a5ff"></u-text>
						</view>
					</uni-col>
				</uni-row>
			</view>
			<view class="desc item_border">
				<uni-row>
					<uni-col :span="5">
						<view class="desc">
							座机号
						</view>
					</uni-col>
					<uni-col :span="19">
						<view class="desc descContent">
							<u-text :text="data.seatNo" size="18" color="#a3a3a3"></u-text>
						</view>
					</uni-col>
				</uni-row>
			</view>
			<view class="desc item_border">
				<uni-row>
					<uni-col :span="5">
						<view class="desc">
							邮箱
						</view>
					</uni-col>
					<uni-col :span="19">
						<view class="desc descContent">
							<u-text mode="text" :text="data.email" size="18" color="#a3a3a3" align="right"></u-text>
						</view>
					</uni-col>
				</uni-row>
			</view>
		</view>
	</view>

</template>

<script>
	export default {
		data() {
			return {
				data: {},
				BaseUrl: this.$BASE_URL
			}
		},
		onLoad() {},
		onShow() {
			this.getVisitingCard()
		},
		methods: {
			async getVisitingCard() {
				console.log(uni.getStorageSync('data'))
				const {
					data: res
				} = await this.$httpRequest({
					url: '/app/getOpfInfo?opfUserPhone=' + uni.getStorageSync('data').phone,
					method: 'get'
				})
				if (res.code == 200) {
					this.data = res.data
				} else {
					uni.showToast({
						icon: 'none',
						title: res.msg
					})
				}
			}
		}
	}
</script>
<style>
	.desc {
		padding: 15rpx 5rpx;
		font-size: 35rpx;
		color: #838383;
	}

	.descContent {
		color: #a3a3a3;
		text-align: right;
	}

	.item_border {
		border-bottom: 1px solid #eeeeee;
	}

	.desc_img {
		width: 100rpx;
		height: 100rpx;
		border: 2rpx solid #dadada;
		border-radius: 20rpx;
	}

	.img_alt_text {
		color: #dadada;
		line-height: 95rpx;
		font-size: 35rpx;
		align-items: center;
	}
</style>
