<template>
	<div class="container">
		<div class="searchBox" :style="{ height: localHeight + 'px', paddingTop: top + 'px' }">
			<div class="searchBox_add">
				<div class="emptyCommunity" @click="addCommunity">添加我的房产</div>
				<div class="MyCommunity" v-if="false">
					<image src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/community/community_mycommunity.png"
						mode="aspectFill"></image>
					<span>惠生活</span>
					<u-icon name="arrow-down" color="#999999" size="28"></u-icon>
				</div>
			</div>
		</div>

		<div class="swiperBox1">
			<swiper>
				<swiper-item>
					<image src="http://192.168.0.172:5500/test.png"></image>
				</swiper-item>

				<swiper-item>
					<image src="http://192.168.0.172:5500/test.png"></image>
				</swiper-item>
			</swiper>

			<div class="dot">
				<div class="dotItem"></div>
				<div class="dotItem active"></div>
			</div>
		</div>

		<div class="swiperBox2">
			<swiper>
				<swiper-item>
					<image src="http://192.168.0.172:5500/com_communityNav.png"></image>
				</swiper-item>

				<swiper-item>
					<image src="http://192.168.0.172:5500/com_communityNav.png"></image>
				</swiper-item>
			</swiper>
		</div>

		<div class="funcList">
			<div class="funcItem" v-for="item in functionList" @click="jump(item.link)">
				<image :src="item.url"></image>
				{{ item.name }}
			</div>
		</div>

		<div class="ads">
			<image src="http://192.168.0.172:5500/com_communityNav.png" mode="aspectFill"></image>
		</div>

		<div class="ads">
			<image src="http://192.168.0.172:5500/com_communityNav.png" mode="aspectFill"></image>
		</div>

		<div class="tabs">
			<div class="tabItem active2">物业公告</div>
			<div class="tabItem">天气</div>
			<div class="tabItem">放假时间</div>
			<div class="tabItem">送饭</div>
		</div>

		<div class="newsList">
			<div class="newsItem" v-for="item in 4">
				<div class="newsItem_left">
					<div class="newsItem_left_tit">关于小区停车场治理通告</div>
					<div class="newsItem_left_sub">高尚</div>
				</div>
				<div class="newsItem_right">
					<image src="http://192.168.0.172:5500/test.png"></image>
				</div>
			</div>
		</div>

		<div class="tips">下拉加载后续10条，共计30条</div>

		<div class="bigAds" v-if="ads1Show">
			<div class="bigAdsCon">
				<div class="bigAdsCon_img">
					<image src="http://192.168.0.172:5500/test.png"></image>
				</div>
				<div class="close" @click="closeAds">
					<image src="http://192.168.0.172:5500/com_close.png"></image>
				</div>
			</div>
		</div>

		<div class="bigAds" v-if="ads2Show">
			<div class="bigAdsCon2">
				<div class="bigAdsCon2_img">
					<image src="http://192.168.0.172:5500/test.png"></image>
				</div>
				<div class="AdsBtnList">
					<div class="AdsBtnItem1" @click="closeAds">取消</div>
					<div class="AdsBtnItem2">了解详情</div>
				</div>
			</div>
		</div>
		<nav-footer :current="1"/>
	</div>
</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,

			functionList: [
				{
					name: "报事报修",
					link: "",
					url: "http://192.168.0.172:5500/com_homeIcon1.png",
				},
				{
					name: "物业缴费",
					link: "/packages/community/propertyPayment/index",
					url: "http://192.168.0.172:5500/com_homeIcon2.png",
				},
				{
					name: "物业公积",
					link: "",
					url: "http://192.168.0.172:5500/com_homeIcon3.png",
				},
				{
					name: "物业公积",
					link: "",
					url: "http://192.168.0.172:5500/com_homeIcon4.png",
				},
				{
					name: "物业服务",
					link: "",
					url: "http://192.168.0.172:5500/com_homeIcon5.png",
				},
			],
				
			ads1Show: false,
			ads2Show: 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")
		},
		closeAds() {
			this.ads1Show = false
			this.ads2Show = false
		},
		jump(e) {
			console.log(e);
			NavgateTo(e)
		},

		addCommunity(){
			
		},

		// 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>