<template>
	<view class="container">
		<view class="page">
			<view class="receipt">
				<view class="list">
					<!-- <view v-for="item in payList" :key="item.id" class="item" @click="toDetail(item)">
						<view class="title">
							<view class="name">电费：<view class="cost">¥100.00</view>
							</view>
							<view class="text">2022年3月12日 12:12</view>
						</view>
						<view class="download" @click.stop="onDownLoad(item)">
							<image src="../../static/images/download.png" class="icon"></image>
						</view>
					</view> -->
					<view class="item" @click="toDetail()">
						<view class="title">
							<view class="name">电费：<view class="cost">¥100.00</view>
							</view>
							<view class="text">2022年3月12日 12:12</view>
						</view>
						<view class="download">
							<image src="../../static/images/download.png" class="icon"></image>
						</view>
					</view>
					<view class="item" @click="toDetail()">
						<view class="title">
							<view class="name">水费：<view class="cost">¥100.00</view>
							</view>
							<view class="text">2022年3月12日 12:12</view>
						</view>
						<view class="download">
							<image src="../../static/images/download.png" class="icon"></image>
						</view>
					</view>
					<view class="item" @click="toDetail()">
						<view class="title">
							<view class="name">物业费：<view class="cost">¥100.00</view>
							</view>
							<view class="text">2022年3月12日 12:12</view>
						</view>
						<view class="download">
							<image src="../../static/images/download.png" class="icon"></image>
						</view>
					</view>
				</view>
			</view>
		</view>
		<!-- <no-data :show="payList.length === 0" text="暂无收据信息"></no-data> -->
	</view>
</template>

<script>
	import {
		communityPaymentApi
	} from '@/config/api.js'
	import noData from '@/components/no-data/no-data'
	export default {
		components: {noData},
		data() {
			return {
				payList: []
			}
		},
		methods: {
			async getList() {
				let {result} = await communityPaymentApi({receiptStatus: 1})
				this.payList = result.records
			},
			toDetail() {
				uni.navigateTo({
					url: '/pages/payCostDetails/index',
				});
			},
			onDownLoad(item) {
				console.log('下載')
			}
		},
		onLoad() {
			this.getList()
		}
	}
</script>
<style>
	page {
		background-color: #F8F6F9;
	}
</style>
<style lang="scss" scoped>
	.page {
		padding: 30rpx 30rpx 90rpx;
		background-color: #F8F6F9;
	}

	.receipt {

		.list {
			.item {
				background-color: #ffffff;
				border-radius: 16rpx;
				padding: 30rpx;
				margin-bottom: 30rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;

				.title {
					.name {
						font-size: 32rpx;
						color: #373737;
						display: flex;
						font-weight: bold;

						.cost {
							font-size: 36rpx;
							color: #6A59F2;
							font-weight: bold;
						}

					}

					.text {
						margin-top: 15rpx;
						font-size: 28rpx;
						color: #9D9CA6;
					}
				}

				.download {
					width: 76rpx;
					height: 76rpx;
					display: flex;
					align-items: center;
					background-color: #EEECFE;
					border-radius: 76rpx;
					justify-content: center;

					.icon {
						width: 40rpx;
						height: 40rpx;
					}
				}

			}
		}
	}
</style>