<template>
	<view class="">
		<view class="card" v-for="item,index in datasList " :key="index">
			<view class="contract">
				<view class="left">
					<u--image :showLoading="true" src="../../static/img/contract/pdf.png" width="80px"
						height="80px"></u--image>
					<view class="text">
						<view class="name">《租赁合同》</view>
						<view>
							<text>{{item.create_time}}</text>
						</view>
					</view>
				</view>
				<!-- <view class="right" @click="navToContract(dataList.file)"> -->
				<view class="right" @click="showContractFn(item.contract_url)">
					<uni-icons type="paperclip" color="#3274F9"></uni-icons>
					<view>查看</view>
				</view>
			</view>
		</view>
	</view>

</template>

<script>
	import {
		ContractListApi
	} from "@/api/property.js"
	export default {
		data() {
			return {
				datasList: [],
			}
		},
		onLoad() {
			// return
			ContractListApi().then(res => {
				this.datasList = res.data
			})
		},
		methods: {
			showContractFn(url) {

				uni.navigateTo({
					url: `/subpkg/pdfView/pdfView?url=${url}`
				})
			}
		}


	}
</script>

<style lang="scss" scoped>
	.card {
		background-color: white;
		border-radius: 14rpx;
		padding: 20rpx;
		margin: 20rpx;

		.contract {
			display: flex;
			justify-content: space-between;

			.left {
				display: flex;
				align-items: center;

				.text {
					// background-color: red;
					height: 80px;
					display: flex;
					flex-direction: column;
					justify-content: space-around;
					margin-left: 15rpx;
				}
			}

			.right {
				display: flex;
				align-items: center;
			}
		}


	}
</style>