<template>
	<view class="content">
		<u-cell-group>
			<u-cell-item title="销售名称" :value="dataInfo.name" :arrow="false"></u-cell-item>
			<u-cell-item title="全部客户数" :value="dataInfo.allCustomer + '人'" :arrow="false"></u-cell-item>
			<u-cell-item title="已报名客户数" :value="dataInfo.applicationCustomer + '人'" :arrow="false"></u-cell-item>
			<u-cell-item title="意向客户数" :value="dataInfo.potentialCustomer + '人'" :arrow="false"></u-cell-item>
			<u-cell-item title="本月新增" :value="dataInfo.nowMonthAdd + '人'" :arrow="false"></u-cell-item>
		</u-cell-group>
		<u-top-tips ref="uTips"></u-top-tips>
	</view>
</template>

<script>
	import {
		mapGetters
	} from 'vuex'
	const NET = require('@/utils/request')
	const API = require('@/config/api')
	export default {
		computed: {
			...mapGetters([
				'mainColor'
			])
		},
		data() {
			return {
				dataInfo: {
					name: '',
					allCustomer: 0,
					applicationCustomer: 0,
					nowMonthAdd: 0,
					potentialCustomer: 0
				}
			}
		},
		onLoad() {
			this.getData()
		},
		onReady() {},
		methods: {
			//  获取数据
			getData() {
				NET.request(API.getDataCensus, {}, 'POST').then(res => {
					this.dataInfo = res.data
				}).catch(error => {
					this.$refs.uTips.show({
						title: error.message,
						type: 'warning',
					})
				})
			}
		},
	}
</script>

<style>
	page {
		width: 100%;
		height: 100%;
		background-color: #f7f7f7;
	}
</style>
<style lang="scss" scoped>
	@import "@/static/css/themes.scss";

	.content {
		width: 100%;
		float: left;
	}
</style>
