<template>
	<view>
		<view class="qu" v-for="qu in data">
			<view class="tip">
				<text>{{qu.title}}</text>
			</view>
			<view class="row uni-flex uni-row" v-for="friend in qu.children"  @click="toVisitingCard(friend)">
				<view class="row_logo">
					<image :src="BaseUrl+friend.imgSrc"></image>
				</view>
				<view class="flex-item" style="padding: 10rpx 0;">
					<u-text :text="friend.name" size="20" color="#787878"></u-text>
					<!-- <u-text mode="phone" :text="friend.phone" size="15" call="true"></u-text> -->
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				data: [],
				BaseUrl: this.$BASE_URL
			}
		},
		onLoad() {
			this.getabData()
		},
		onShow() {
			this.getabData()
		},
		methods: {
			toVisitingCard(friend) {
				uni.setStorageSync('data', friend)
				uni.navigateTo({
					url: '/pageA/msg/visitingCard'
				})
			},
			async getabData() {
				const {
					data: res
				} = await this.$httpRequest({
					url: '/api/ci/ab?un=' + uni.getStorageSync("deptId"),
					method: 'get',
				})
				if (res.code == 200) {
					this.data = res.data
				} else {
					this.data = []
					uni.showToast({
						icon: 'none',
						title: res.msg
					})
				}
			},
		}
	}
</script>

<style lang="scss">
	page {
		background: #f8f8f8;
	}

	.row {
		background: white;
		display: flex;
		width: 100%;
		height: 100rpx;
		border-bottom: 1px solid #eeeeee;

		.row_logo {
			width: 20%;
			display: flex;
			align-items: center;

			image {
				width: 50px;
				height: 50px;
				margin: auto;
				border-radius: 5px;
			}
		}

		.row_left {
			height: 100%;
			width: 40%;
			display: flex;
			align-items: center;

			border: {
				bottom: 1px solid #DDDDDD;
			}

			text {
				font-size: 16px;
				font-family: 'syht';
				display: block;
			}

		}

		.row_right {
			height: 100%;
			width: 40%;
			display: flex;
			align-items: center;

			border: {
				bottom: 1px solid #DDDDDD;
			}

			text {
				font-size: 16px;
				font-family: 'syht';
				display: block;
			}

		}



	}

	.row:last-child {
		.row_right {
			border: 0;
		}
	}

	.qu {
		.tip {
			margin: 3px 0;
			font-size: 14px;
			font-family: 'syht';

			text {
				margin-left: 13px;
			}
		}
	}
</style>
