<template>
	<view class="page">
		<pyh-nv ref="nv" :config="nvConfig"></pyh-nv>
		<view class="listBox" :style="{'padding-top':(pageTop+'px')}">
		<view class="content">
		<view class="map" style="width: 100%;height: 100%;">
			<map :min-scale="9"  id="customMap" :scale="15" :style="'width: 100%;'+ 'height:'+screenHeight"  :markers="markers" layer-style="1" subkey="PTOBZ-QDQEG-DK3QM-QMYWN-I5WDZ-CCB6S"
				:latitude="address.latitude" :longitude="address.longitude">
			</map>
		</view>
		<!-- 列表 -->
			<view class="message-list">
				<view class="titleall-box">
					<view class="titleall-left"><view class="titleall-left-line"></view>基本信息</view>
				</view>
				<view class="list">
					<view class="icon-data">
						<view class="data">
							<view class="title">
								<text>佩戴者</text>
							</view>
						</view>
					</view>
					<view class="more">
						<text>{{childData.childName}}</text>
					</view>
				</view>
				<view class="list">
					<view class="icon-data">
						<view class="data">
							<view class="title">
								<text>呼叫时间</text>
							</view>
						</view>
					</view>
					<view class="more">
						<text>{{childData.emergencyTime}}</text>
					</view>
				</view>
			</view>
		
		</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				nvConfig:{
					title:"2023-05-18 14:54",
					bgColor:"#ffffff",
					color:"#000000",
					fixedAssist:{
						hide:true,
					},
				},
				childData: {},
				address: {
					// 纬度
					latitude: '',
					// 经度
					longitude: ''
				},
				screenHeight:'',
				markers:[],
			}
		},
		onPageScroll(e) {this.$refs.nv.pageScroll(e)},
		computed:{
			pageTop(){return parseInt(88*uni.getSystemInfoSync().windowWidth/750) + uni.getSystemInfoSync().statusBarHeight}
		},
		onLoad(e) {
			this.childData = JSON.parse((decodeURIComponent(e.obj)))
			console.log((this.childData))
			var index = this.childData.sendAddress.indexOf(",");
			this.address.longitude = this.childData.sendAddress.substring(0, index);
			this.address.latitude = this.childData.sendAddress.substring(index + 1, this.childData.sendAddress.length);
			this.address.id = this.childData.id;
			this.address.width = 20;
			this.address.height = 20;
			this.markers.push(this.address)
			console.log(this.markers)
		},
		methods:{
		}
	}
</script>

<style scoped lang="scss">
	@import 'minorsosdetail.scss';
</style>
