<template>
	<view class="echart-content"> 
		<view class="echart-title">
			<view class="e-icon e1"><text class="iconfont icon-gongsi"></text></view>
			<view class="e-name">{{ data.name }}</view>
			<view class="e-start">{{ data.status | statusFilters }}</view>
		</view>
		<view class="echart-main clearfix" @click="handleClubInfo">
			<view class="echart-text">
				<text class="label">联系人：</text>{{ data.linkMan ? data.linkMan :'无' }}
			</view>
			<view class="echart-text">
				<text class="label">手机号：</text>{{ data.contractMobile }}
			</view>
			<view class="echart-text" v-if="data.linkManIdentity">
				<text class="label">联系人身份：</text>{{ data.linkManIdentity | linkManFormat }}
			</view>
			<view class="echart-text" v-if="data.firstClubType">
				<text class="label">机构类型：</text>{{ data.firstClubType | FirstFormat }}-{{ data.secondClubType | TwoFormat }}
			</view>
			<view class="echart-text" v-if="data.provincialAddress">
				<text class="label">地址：</text>{{ data.provincialAddress }}
			</view>
			<view class="echart-text" v-if="data.addTime">
				<text class="label">注册时间：</text> {{ data.addTime }}
			</view>
			<view class="echart-next">详情></view>
		</view>
	</view>
</template>

<script>
import { mapState, mapMutations } from 'vuex'
export default {
	props:{
		clubInfo:{
			type:Object,
			default:{}
		}
	},
	data() {
		return {
			data:{}
		}
	},
	created() {
		this.data = this.clubInfo
	},
	filters: {
		FirstFormat(value) {
			//处理格式
			const map = {
				1: '医美',
				2: '生美',
				3: '项目公司',
				4: '个人',
				5: '其他'
			}
			return map[value]
		},
		TwoFormat(value) {
			if(!value){  return ''}
			const map = {
				1: '诊所',
				2: '门诊',
				3: '医院',
				4: '其他',
				5: '美容院',
				6: '养生馆',
				7: '其他',
			}
			return map[value]
		},
		linkManFormat(value) {
			const map = {
				1: '老板',
				2: '采购',
				3: '运营',
				4: '其他'
			}
			return map[value]
		},
		statusFilters(value) {
			// 状态
			const map = {
				1: '待审核',
				90: '已上线',
				92: '审核未通过'
			}
			return map[value]
		}
	},
	methods: {
		handleClubInfo(){
			this.$api.navigateTo(`/pages/seller/club/club-detail?userId=${this.data.userId}`)
		},
	},
	onShow() {}
}
</script>

<style lang="scss">

</style>
