<template>
	<view class="">
		<MapView></MapView>
		<van-list id="checklist" v-model="loading" :immediate-check="false" :error.sync="error" error-text="请求失败，点击重新加载"
			finished-text="没有更多了~" @load="getList">
			<view class="list-item" v-for="(item, key) in tableData" :key="key" @click="goDetail(item)">
				<div class="nameTitle">{{ item.name }}</div>
				<div>{{ item.dkbh }}</div>
				<div>监测面积：{{ item.dkmj }}</div>
				<div>核查截止日期：{{ item.jsdw }}</div>
				<div @click="navigation">导航</div>
				<div @click="upload">上传</div>
				<view class="status">{{ item.status }}</view>
			</view>
		</van-list>
	</view>
</template>
<script>
	// import MapView from "../../static/MapView.vue";
	import MapView from "./MapView.vue";
	import {
		listDkjbxx
	} from "@/api/dkjbxx.js";
	import {
		handleNavigation
	} from "./mapto.js";
	import {
		chooseImage,
		chooseVideo,
		chooseMedia
	} from "@/utils/choose.js";
	export default {
		name: "check",
		components: {
			MapView,
		},
		data() {
			return {
				queryParams: {
					pageNum: 1,
					pageSize: 10,
					time: ["", ""],
					startTime: "",
					endTime: "",
					auditflowList: [],
					dkmjbs: "",
					dkmj: "",
					descValue: "dkmj",
					dkbh: "",
					xzqdm: null,
				},
				loading: false,
				tableData: [{}],
			};
		},
		mounted() {},
		onShow(options) {
			uni.getStorage({
				key: "my_param",
				success: (res) => {
					this.queryParams.id = res.data.id;
					console.log("获取的参数是：", res.data);
					 this.getList();
				},
			});
		},
		unmounted() {},
		methods: {
			getList() {
				listDkjbxx(this.queryParams).then((response) => {
					this.tableData = response.rows;
					this.total = response.total;
					// this.open = true;
					// this.title = "修改监管批次数据";
					// this.initVectorLayer("mapDiv");
					// this.initVectorLayer("mapCon1");
					// this.initVectorLayer("mapCon2");
					// this.addGeoJson("mapDiv");
					// this.addGeoJson("mapCon1");
					// this.addGeoJson("mapCon2");
				});
			},
			navigation() {
				console.log("s-xsx");
				handleNavigation({
					latitude: 39.9042,
					longitude: 116.4074,
					name: "地址名称",
					address: "地址详情",
					selfLocation: {},
				});
			},
			upload() {
				console.log(uni, '---', uni.chooseMedia)
				chooseMedia()
			}
		},
	};
</script>
<style scoped>
	#checklist {
		width: 100%;
		height: 50vh;
	}
</style>