<template>
	<view>
		<uni-list :border="true">
			<!-- 显示圆形头像 -->
			<uni-list-chat
				v-for="(item, index) in pholist"
				:key="item.id"
				:title="`${item.secUnitName}/${item.deptName}`"
				clickable="true"
				@click="callPoh(item)"
				:time="item.userName"
				:note="item.telephoneNum"
				badge-text="点击拨打"
			></uni-list-chat>
		</uni-list>
	</view>
</template>

<script>
import { listAddressBook } from '@/api/system/user.js';
export default {
	data() {
		return {
			pholist: []
		};
	},
	onLoad() {
		this.getCall();
	},
	methods: {
		getCall() {
			listAddressBook().then(res => {
				this.pholist = res.rows;
			});
		},
		callPoh(item) {
			uni.makePhoneCall({
				phoneNumber: item.telephoneNum
			});
		}
	}
};
</script>

<style lang="scss">
.chat-custom-right {
	flex: 1;
	/* #ifndef APP-NVUE */
	display: flex;
	/* #endif */
	flex-direction: column;
	justify-content: space-between;
	align-items: flex-end;
}

.chat-custom-text {
	font-size: 12px;
	color: #999;
}
</style>
