<template>
	<view class="home">
		<image class="home-banner" src="https://xqg.xswlsq.cn/xqg/handbook/index_top_banner.jpg"></image>
<!-- 		<view class="brief-box" v-for="item in placeList" @click="toMap(item)">
			<text>{{item.name}}县域风貌区</text>
		</view> -->
<!-- 		<view class="brief-box" @click="toBrief">
			<image class="brief-icon" src="../static/img/index_tb_icon.png"></image>
			<text>象山县风貌区简介</text>
		</view> -->
		<view class="map-list">
			<view class="map-item" v-for="item in placeList" @click="toMap(item)">
				<view class="_name">{{item.pointName}}</view>
				<view class="_type">{{item.remark}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { getGuidePointList } from '../api/index.js'
	export default {
		data() {
			return {
				placeList: []
			}
		},
		methods: {
			getList() {
				getGuidePointList().then(res => {
					if (res.code === 0) {
						this.placeList = res.data
					}
				})
			},
			toBrief() {
				uni.navigateTo({
					url: 'brief'
				})
			},
			toMap(item) {
				const restrictedPoints = [
					'蒙顶山水·儒雅乡村',
					'荔港门户·蓬莱海岛'
				];
				if (restrictedPoints.includes(item.pointName)) {
					uni.showToast({
						title: '正在开发中，暂未开放',
						icon: 'none',
						duration: 2000
					});
					return;
				}

				uni.navigateTo({
					url: 'map?id=' + item.id + '&title=' + item.pointName
				});
			}
		},
		onLoad() {
			this.getList()
		},
		onShow() {
		}
	}
</script>

<style lang="scss" scoped>
.home{
	.home-banner{
		width: 100%;
		height: 774rpx;
	}
	.brief-box{
		width: 694rpx;
		height: 146rpx;
		background-color: #F1F7EF ;
		color: #76B062;
		font-size: 33rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		margin: 39rpx auto 38rpx;
		border-radius: 21rpx;
		.brief-icon{
			height: 47rpx;
			width: 43rpx;
			margin-right: 18rpx;
			
		}
	}
	.map-list{
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
		padding: 0 28rpx;
		.map-item{
			height: 146rpx;
			width: 333rpx;
			background-color: #F1F7EF ;
			color: #76B062;
			font-size: 29rpx;
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			border-radius: 21rpx;
			margin-bottom: 38rpx;
			._name{
				white-space: nowrap;
			}
			._type{
				
			}
		}
	}
}
</style>
