<template>
	<view class="info_detail">
		<view class="info_item">
			<view class="basic_main">
				<view style="font-size: 30rpx;color: #999;display: -webkit-box;display: flex;flex-direction: row;align-items: center;">负责人</view>
				<view style="font-size: 30rpx;color: #333;width: 450rpx;text-align: right;">{{info.owner_staff ? info.owner_staff.name: ''}}</view>
			</view>
			<view class="basic_main">
				<view style="font-size: 30rpx;color: #999;display: -webkit-box;display: flex;flex-direction: row;align-items: center;">创建人</view>
				<view style="font-size: 30rpx;color: #333;width: 450rpx;text-align: right;">{{info.create_staff ? info.create_staff.name: ''}}</view>
			</view>
			<view class="basic_main">
				<view style="font-size: 32rpx;color: #999;display: flex;flex-direction: row;align-items: center;">所在地区</view>
				<view 
					style="
					font-size: 30rpx;
					color: #333;
					width: 450rpx;
					text-align: right;
					">{{info.address ? info.address : ''}}</view>
			</view>
			<view class="basic_main" @click="jumpMap">
				<view style="font-size: 30rpx;color: #999;display: -webkit-box;display: flex;flex-direction: row;align-items: center;">详细地址</view>
				<view style="font-size: 30rpx;color: #333;width: 450rpx;text-align: right;">{{info.address_detail ? info.address_detail : ''}}</view>
			</view>
			<form-item v-for="(item,index) in listForm" :key="index" :isEdit="false" :objInfo="item"></form-item>
		</view>
	</view>
</template>

<script>
	import formItem from '@/components/form/formitem.vue'
	import { netSetForm } from '@/api/index.js'
	export default {
		props:{
			info:{
				type:Object,
				default:{}
			}
		},
		components:{
			formItem
		},
		created() {
			this.getForm()
		},
		data() {
			return {
				listForm:[]
			}
		},
		methods: {
			getForm() {
				netSetForm({type:'customer'}).then(res=>{
					res = res.data.data
					res.forEach(ele=>{
						ele.value = this.info[ele.id]?this.info[ele.id]:''
					})
					this.listForm = res
				})
			},
			jumpMap() {
				uni.openLocation({
					latitude: this.info.lat,
					longitude: this.info.lng
				})
			}
		}
	}
</script>

<style lang="scss">
.info_detail {
	margin-bottom: 100rpx;
	.basic_head {
		display: flex;
		:last-child {
			font-weight: 700;
			margin-left: 8rpx;
		}
	}
	.basic_main {
		display: flex;
		justify-content: space-between;
		background-color: #fff;
		line-height: 40rpx;
		border-bottom: 1rpx solid #EAEAEA;
		padding: 30rpx 40rpx 30rpx 47rpx;
		:first-child {
			color: #333;
		}
	}
}

</style>
