<template>
	<view class="container">

		<view class="addRealEstateList" :style="{ paddingTop: 54 + top + 'px' }">
			<div class="addRealEstate" @click="apply">
				申请入驻 / 新增房产
			</div>
		</view>

		<view class="searchBox" :style="{ height: localHeight + 'px', paddingTop: top + 'px' }" v-if="false">
			<view class="searchBox_add">
				<img src="http://192.168.0.172:5500/com_communityIcon.png" alt="" />
				我的房产
			</view>
		</view>

		<view class="searchBox">
			<view class="searchBox_add2">
				我的房产
			</view>
		</view>

		<div class="myRealEstate">
			<div class="myRealEstateEmpty" v-if="false">
				抱歉！您尚未绑定任何房产
				<div class="btn" @click="apply">
					商户申请入驻
				</div>
			</div>

			<div class="myRealEstates">
				<image src="http://192.168.0.172:5500/com_communityNav.png" mode="aspectFill"></image>
				<div class="name">滏阳锦苑</div>
				<div class="Visitor" v-if="false">访客身份 点击立即入驻本社区</div>
				<div class="Householder">
					3号楼 2单元 17层 1706室 | 1人 | 物业公积金：￥55.68
				</div>

			</div>
		</div>

		<div class="nearby">
			<div class="nearbyTit">
				<div class="nearbyTit_left">附近已开通的小区</div>
				<div class="nearbyTit_right">
					<image src="http://192.168.0.172:5500/com_searchIcon.png" alt="" mode="aspectFill" />
					搜索
				</div>
			</div>

			<div class="empty" v-if="false">
				<image src="http://192.168.0.172:5500/com_empty.png" alt="" mode="aspectFill" />
				暂无信息
			</div>


			<div class="communityList">
				<div class="communityItem" v-for="item in communityList">
					<div class="communityItem_Box">
						<div class="communityItem_Box_left">
							<image :src="picUrl + item.community.pic" alt="" mode="aspectFill" />
						</div>
						<div class="communityItem_Box_right">
							<div class="communityItem_Box_right_tit">滏阳锦苑</div>
							<div class="communityItem_Box_right_com">物业公司：河北锦绣繁华物业管理有限公司物 业管理有限公司</div>
							<div class="communityItem_Box_right_msg">
								<div class="communityItem_Box_right_msg_left">
									<div class="communityItem_Box_right_msg_left1">
										<image src="http://192.168.0.172:5500/com_navigationIcon.png" mode="aspectFill">
										</image>
										导航
									</div>
									<div class="communityItem_Box_right_msg_left2">
										<image src="http://192.168.0.172:5500/com_phoneIconIcon.png" mode="aspectFill">
										</image>
										电话
									</div>

								</div>
								<div class="communityItem_Box_right_msg_right" @click="desc">进入小区</div>
							</div>
						</div>
					</div>
					<div class="communityItem_msg">
						河北省衡水市桃城区红旗大街与河阳路交叉口西北300米东车辆入口
					</div>
				</div>
			</div>
			<nav-footer />

		</div>
	</view>

</template>

<script>
import {
	request,
	picUrl,
	uniqueByField,
	menuButtonInfo,
	NavgateTo
} from '../../../utils';

import { apiArr } from '../../../api/v2Community';


export default {
	data() {
		return {
			picUrl,
			top: "",
			localHeight: "",
			queryPage: {
				page_num: 1,
				page_size: 10,
			},
			communityList: [],
			flag:false,
		}
	},
	onLoad(options) {
		const meun = menuButtonInfo();
		this.top = meun.top;
		// this.top = meun.height + meun.top;
		this.localHeight = meun.height;
		this.getCommunityList()
	},


	methods: {
		desc() {
			NavgateTo("../communityDetail/index")
		},
		apply() {
			NavgateTo("../applyOwer/index")
		},

		getCommunityList() {
			let that = this
			request(apiArr.getCommunityList, 'POST', {
				page_num: that.queryPage.page_num,
				page_size: that.queryPage.page_size,
				user_id:""
			}).then(res => {
				console.log(res)
				if (res.rows.length == that.queryPage.page_size) {
					that.queryPage.page_num++
					that.flag = true
					that.communityList = that.communityList.concat(res.rows)
				}else{
					that.flag = false
					that.communityList = that.communityList.concat(res.rows)
				}
			})
		},
	},


}
</script>

<style>
@import url("./index.css");
</style>