<template>
	<view class="orderPage">
		<hcCounts @golist="golist"></hcCounts>
		<!-- sticky 
<uni-segmented-control :current="current" :values="tabOptions" style-type="text"
					active-color="#007aff" @clickItem="onClickItem" />-->
		<!-- <van-sticky :offset-top="140">
		<van-tabs v-model="searchForm.basetype" @click="tabList(searchForm.basetype)">
			<van-tab v-for="(item, key) in tabOptions" :key="key" :name="item.name"
				:title="`${item.name}(${item.num})`"></van-tab>
		</van-tabs>
		<!-- </van-sticky>-->
		<!-- :finished="finished" -->
		<van-list v-if="showlist" v-model="loading" :immediate-check="false" :error.sync="error"
			error-text="请求失败，点击重新加载" finished-text="没有更多了~" @load="getList">
			<view class="list-item" v-for="(item, key) in pcsjList" :key="key" @click="goDetail(item)">
				<div class="nameTitle">{{ item.name }}</div>
				<div>{{ item.dkbh }}</div>
				<div>监测面积：{{ item.dkmj }}</div>
				<div>核查截止日期：{{ item.jsdw }}</div>
			</view>
		</van-list>
		<!-- <button type="primary" @click="submit">提交</button> -->
	</view>
</template>
<script>
	//import { Tabs } from "vant";
	import hcCounts from "./index/common/hcCounts.vue";
	import {
		listDkjbxx
	} from "@/api/dkjbxx.js";
	export default {
		name: "list",
		components: {
			hcCounts,
		},
		data() {
			return {
				activeName: "a",
				searchForm: {},
				tabOptions: [{
						name: "待核查",
						num: 2,
					},
					{
						name: "核查中",
						num: 1,
					},
					{
						name: "已核查",
						num: 1,
					},
					{
						name: "已退回",
						num: 1,
					},
				],
				showlist: false,
				queryParams: {
					pageNum: 1,
					pageSize: 10,
					time: ["", ""],
					startTime: "",
					endTime: "",
					auditflowList: [],
					dkmjbs: "",
					dkmj: "",
					descValue: "dkmj",
					dkbh: "",
					xzqdm: null,
				},
				loading: false,
				pcsjList: [],
				total: 0,
			};
		},
		onLoad() {
			// console.log("aaaa", "00s00s");
			// this.getUser();
		},
		created() {
			console.log("aaZZaa", "00s00s");
		},
		mounted() {
			console.log("aaaa", "00s00s");

		},
		onReady() {
			//this.$refs.form.setRules(this.rules)
		},
		methods: {
			golist() {
				this.showlist = true
				this.activeName = 'a'
				console.log("aaaa", "00s00s");
				//this.getList();
			},
			getList() {
				this.loading = true;
				console.log("", "00s00s");
				listDkjbxx(this.queryParams).then((res) => {
					console.log(res, "00s00s");
					this.pcsjList = res.rows;
					this.total = res.total;
					this.loading = false;
				});
			},
			//跳转到详情页
			goDetail(value) {
				uni.setStorage({
					key: "my_param",
					data: value,
					success: () => {
						uni.switchTab({
							url: "/pages/check/index",
						});
					},
				});
				//   uni.navigateTo({
				//     url: "/pages/check/index?item=" + value,
				//   });
			},
		},
	};
</script>

<style lang="scss">
	.button {
		display: flex;
		align-items: center;
		height: 35px;
		line-height: 35px;
		margin-left: 10px;
	}

	.orderPage {
		padding: 30rpx;
		background: azure;
		padding-bottom: 50px;

		.list-item {
			background: #fff;
			padding: 40rpx 20rpx;
			border-radius: 20rpx;
			margin-bottom: 30rpx;
			position: relative;

			.nameTitle {
				color: red;
				line-height: 50rpx;
			}


		}
	}
</style>