<template>
	<div>
		<common @asynCallBack="asynCallBack"></common>
		<top-header :pageTitle="pageTitle"></top-header>

		<div class="mui-content vongi-qqhm">
			<ul class="mui-table-view">
				<li v-for="(item,index) in recordList" class="mui-table-view-cell">
					<router-link :to="{name:'MasterRelativesInfo',query:{'popedomId':item.popedomId}}" class="mui-navigate-right">
						<div class="mui-col-xs-8  mui-pull-left flew-items">
							<div class="mui-media-object mui-pull-left "><img :src="item.faceImageUrl" width="50" /></div>
							<div class="mui-media-body">
								<h3>{{item.name}}<span class="mui-badge vongi-badge-pink" v-text="item.relationName"></span></h3>
								<p class='mui-ellipsis mui-h3' v-text="item.phone"></p>
							</div>
						</div>
						<!-- <span class="mui-pull-right iconfont icon-ziyuan1"></span> -->
					</router-link>
				</li>
			</ul>
		</div>

		<NullList :remark="'暂无关联亲属'" v-if="!recordList.length"></NullList>

		<loading :visible="isLoading"></loading>
	</div>
</template>

<script>
	import * as API_Relatives from '@/apis/Master/relatives'
	import Common from '$project/components/Common.vue'
	import Loading from '$project/components/Loading.vue'
	import TopHeader from '$project/components/TopHeader.vue'
	import NullList from '$project/components/NullList.vue'
	import {
		mapGetters,
		mapMutations
	} from 'vuex'
	export default {
		name: 'MasterRelatives',
		components: {
			Common,
			Loading,
			TopHeader,
			NullList
		},
		data() {
			return {
				pageTitle: '我的亲属',

				isLoading: false,

				recordList: []
			}
		},
		created() {

		},
		methods: {
			//获取列表
			getList() {
				this.isLoading = true;
				API_Relatives.getRelationList().then(response => {
					this.isLoading = false;

					this.recordList = response.relationsList;

				}).catch(error => {
					this.isLoading = false;
					mui.toast(error);
				})
			},
			asynCallBack() {},
		},
		mounted() {
			//获取列表
			this.getList()
		},
		destroyed() {

		},
		computed: {
			...mapGetters({
				openId: 'wx_openid',
				token: 'token',
				person_data: 'person_data',
				person_popedom: 'person_popedom',
			})
		}
	}
</script>

<style scoped src="$project/assets/css/pension.css"></style>
<style scoped src="$project/assets/css/xpwyfyy.css"></style>
<style src="$project/assets/css/iconfont.css"></style>
<style>
</style>
