<template>
	<view>
		<view class="content-box" v-if="flag === 'msg'">
			<label class="content-label">
				<view class="label-name">
					<text>客户名称</text>
				</view >
				<view class="label-data">
					<text v-show="isShow">{{msgdata.customerName}}</text>
					<input type="text" v-model="form" v-show="!isShow" class="label-input"/>
				</view>
			</label>
			<label class="content-label">
				<view class="label-name">
					<text>公司名称</text>
				</view >
				<view class="label-data">{{msgdata.company}}</view>
			</label>
			<label class="content-label">
				<view class="label-name">
					<text>客户电话</text>
				</view >
				<view class="label-data">{{msgdata.phone}}</view>
			</label>
			<label class="content-label">
				<view class="label-name">
					<text>年龄</text>
				</view >
				<view class="label-data">{{msgdata.age}}</view>
			</label>
			<label class="content-label">
				<view class="label-name">
					<text>性别</text>
				</view >
				<view class="label-data">{{msgdata.sex}}</view>
			</label>
			<label class="content-label">
				<view class="label-name">
					<text>职位</text>
				</view >
				<view class="label-data">{{msgdata.position}}</view>
			</label>
			<label class="content-label">
				<view class="label-name">
					<text>是否内部客户</text>
				</view >
				<view class="label-data">{{msgdata.isIn}}</view>
			</label>
			<label class="content-label">
				<view class="label-name">
					<text>备注</text>
				</view >
				<view class="label-data">{{msgdata.remark}}</view>
			</label>
			<label class="content-label">
				<view class="label-name">
					<text>登记年份</text>
				</view >
				<view class="label-data">{{msgdata.year}}</view>
			</label>
		</view>
		<view class="content-box" v-if="flag === 'visit'">
			<label class="content-label">
				<view class="label-name">
					<text>客户名称</text>
				</view >
				<view class="label-data">{{visitdata.customerName}}</view>
			</label>
			<label class="content-label">
				<view class="label-name">
					<text>拜访时间</text>
				</view >
				<view class="label-data">{{visitdata.visitTime}}</view>
			</label>
			<label class="content-label">
				<view class="label-name">
					<text>拜访方式</text>
				</view >
				<view class="label-data">{{visitdata.visitMethod}}</view>
			</label>
			<label class="content-label">
				<view class="label-name">
					<text>回访记录</text>
				</view >
				<view class="label-data">{{visitdata.record}}</view>
			</label>
			<label class="content-label">
				<view class="label-name">
					<text>是否内部客户</text>
				</view >
				<view class="label-data">{{visitdata.isIn}}</view>
			</label>
		</view>
		<view class="content-box" v-if="flag === 'market'">
			<label class="content-label">
				<view class="label-name">
					<text>市场名称</text>
				</view >
				<view class="label-data">{{marketdata.marketName}}</view>
			</label>
			<label class="content-label">
				<view class="label-name">
					<text>市场地址</text>
				</view >
				<view class="label-data">{{marketdata.address}}</view>
			</label>
			<label class="content-label">
				<view class="label-name">
					<text>竞争对手数量</text>
				</view >
				<view class="label-data">{{marketdata.competitorNumber}}</view>
			</label>
			<label class="content-label">
				<view class="label-name">
					<text>潜在客户数量</text>
				</view >
				<view class="label-data">{{marketdata.customerNumber}}</view>
			</label>
			<label class="content-label">
				<view class="label-name">
					<text>平均消费价格</text>
				</view >
				<view class="label-data">{{marketdata.avgPrice}}</view>
			</label>
			<label class="content-label">
				<view class="label-name">
					<text>调研时间</text>
				</view >
				<view class="label-data">{{marketdata.researchTime}}</view>
			</label>
		</view>
		<view class="content-btn">
			<button class="content-btn-edit">编辑</button>
			<button class="content-btn-save">保存</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				flag:'msg',
				isShow:true,
				form:'李嘉欣',
				msgdata:{
					address: "深圳南山",
					age: 23,
					company: "腾讯",
					createBy: null,
					createTime: "2022-07-12 11:47:31",
					createUserId: null,
					customerId: "1",
					customerName: "李嘉欣",
					isIn: 1,
					params: {},
					phone: 18313121312,
					position: "开发员",
					remark: "地中海发型1231111ghjgvgvvj552gvhhg",
					searchValue: null,
					sex: 0,
					updateBy: null,
					updateTime: "2022-07-12 11:53:14",
					updateUserId: null,
					year: "2022"
				},
				visitdata:{
					customerId: 7,
					customerName: "周杰伦",
					isIn: 2,
					record: "新歌不错",
					visitId: "1",
					visitMethod: 1,
					visitTime: "2022-07-12"
				},
				marketdata:{
					address: "城北",
					avgPrice: 5,
					competitorNumber: 5,
					createBy: null,
					createTime: "2022-07-12 15:30:26",
					createUserId: null,
					customerNumber: 5,
					marketName: "城北市场",
					params: {},
					remark: null,
					researchId: "1",
					researchTime: "2022-07-12",
					searchValue: null,
					updateBy: null,
					updateTime: "2022-07-12 15:30:40",
					updateUserId: null
				}
			};
		},
		onLoad: function (option) { //option为object类型，会序列化上个页面传递的参数
			// console.log(option.id); //打印出上个页面传递的参数。
			// console.log(option.flag); //打印出上个页面传递的参数。
			this.flag = option.flag
		}
	}
</script>

<style lang="scss">
@import url("@/common/scss/core.scss");
</style>
