<template>
	<view class="baobei-list">
		<view class="baobei-item u-flex u-row-between" v-for="(item,index) in list" :key="index" @click="toinfo(item)">
			<view class="left u-flex-col u-flex-1">
				<text>意向项目：{{item.property_name}}</text>
				<text>意向区域：{{item.area_name}}</text>
				<text>预约看房时间：{{item.time}}</text>
				<text>报备时间：{{item.create_at}}</text>
			</view>
			<view class="right" style="background-color: rgba(240, 127, 48, 1);" v-if="item.status == 1">审核中</view>
			<view class="right" style="background-color: rgba(68, 220, 37, 1);" v-if="item.status == 2">已通过</view>
			<view class="right" style="background-color: rgba(220, 75, 37, 1);" v-if="item.status == 3">审核失败</view>
			<view class="right" style="background-color: rgba(204, 204, 204, 1);" v-if="item.status == 4">已失效</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
				page: 1
			}
		},
		onLoad() {
			this.getdata()
		},
		methods: {
			getdata() {
				this.$u.post('/api/Report/report_list', {
					page: this.page,
					page_num: 20
				}).then(res => {
					this.list = this.list.concat(res.data)
				})
			},
			toinfo(item) {
				uni.navigateTo({
					url: "./baobei-info?id=" + item.id
				})
			}
		}
	}

</script>

<style lang="scss">
	page {
		background-color: rgba(245, 245, 245, 1);
	}

	.baobei-list {

		.baobei-item {
			padding: 20rpx 20rpx 10rpx 20rpx;
			background-color: #fff;
			width: 702rpx;
			border-radius: 20rpx;
			margin: 20rpx auto;

			.right {
				width: 160rpx;
				line-height: 60rpx;
				border-radius: 10rpx;
				text-align: center;
				font-size: 24rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #FFFFFF;
			}

			.left {
				text {
					margin-bottom: 10rpx;
					font-size: 24rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #666666;
				}
			}
		}
	}

</style>
