<template>
	<view class="page">
		<!-- 搜索 -->
		<view class="head-search">
			
	<!-- 		<view class="search">
				<u-search bg-color="#fff" placeholder="请输入" v-model="query.venueName" :show-action="false" @search="search" @clear="clearGet"></u-search>
				<u-button type="success" @click="search">搜索</u-button>
			</view> -->
			<view style="background-color: #FFFFFF;border-radius: 18rpx;border: 2rpx solid #E8E8E8;overflow: hidden;width: 100%;" >
				<u-search :action-style="{'background':'#19be6b','color':'#fff','height':'32px','line-height':'32px','border-radius':'18rpx'}" bg-color="#fff" placeholder="请输入关键词" v-model="query.venueName" action-text="搜索" @clear="search" @search="search" @custom="search"></u-search>
			</view>
		</view>
		<view class="screen-list">
			<view class="list"  @click="show = true">
				<text>区域</text>
				<image :src="$imgUrl('/down.png')"></image>
				<u-select v-model="show" :list="areList" @confirm="(v) => {queryChange('district', v)}"></u-select>
			</view>
		<!-- 	<view class="list">
				<text>租金</text>
				<image :src="$imgUrl('/down.png')"></image>
			</view>
			<view class="list">
				<text>默认排序</text>
				<image :src="$imgUrl('/down.png')"></image>
			</view>
			<view class="list">
				<text>筛选</text>
				<image :src="$imgUrl('/down.png')"></image>
			</view> -->
		</view>
		<!-- 订单列表 -->
		<!-- <view class="goods-data">
			<view class="goods-list">
				<view class="list" v-for="(item,index) in 10" :key="index">
					<view class="thumb">
						<image  :src="$imgUrl('/img/3.jpg')"  mode=""></image>
					</view>
					<view class="item">
						<view class="title">
							<text class="one-omit">这里有标题这里有标题这里有标题这里有标题这里有标题这里有标题这里有标题</text>
						</view>
						<view class="tag">
							<text>标签标签</text>
							<text>标签标签</text>
						</view>
						<view class="introduce">
							<image  :src="$imgUrl('/kefu.png')"></image>
							<text class="one-omit">这里有地址这里有地址这里有地址这里有地址</text>
						</view>
						<view class="like-goods">
							<view class="retail-price">
								<text>租金:</text>
								<text class="min">￥</text>
								<text class="max">1067</text>
								<text class="min">/月</text>
								<text class="line"></text>
								<text>面积:</text>
								<text class="max">81</text>
								<text class="min">/m²</text>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view> -->
		<view class="goods-data">
			<view v-if="tableData.length == 0" style="padding: 50rpx 0;text-align: center;">暂无数据</view>
			<view class="goods-list">
				<view class="list" v-for="(item,index) in tableData" :key="index" @click="reconciliationdetail(item)">
					<view class="thumb">
						<u-image width="25vw" height="25vw"  border-radius="20" :src="item.displayImage.length>0?imgurl +item.displayImage.split(',')[0]:'' " ></u-image>
						<!-- <image :src="item.displayMainImage" mode=""></image> -->
					</view>
					<view class="item">
						<view class="title">
							<text class="one-omit">{{item.venueName}}</text>
						</view>
		<!-- 				<view class="tag">
							<text>标签标签</text>
							<text>标签标签</text>
						</view>
						<view class="introduce">
							<image  :src="$imgUrl('/kefu.png')"></image>
							<text class="one-omit">{{item.detailedLocation}}</text>
						</view> -->
						<view class="tag">
							<text>{{item.venueType}}</text>
						</view>
						<view class="like-goods">
							<view class="retail-price">
								<text>所属区域:</text>
								<text class="max">{{item.district}}</text>
							</view>
							<view class="retail-price">
								<text>面积:</text>
								<text class="max">{{item.actualArea}}</text>
								<text class="min">/m²</text>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				$img: this.$root.$img,
				query:{
					venueName:'',
					pageNumber: 0,
					pageSize: 10,
					publishStatus:2
				},
				pageindex: {
					pageNumber: 0,
					pageSize: 10,
					publishStatus:'1',
					publishStatus:2
				},
				areList: [
					{value: '武侯区', label: '武侯区'},
					{value: '锦江区', label: '锦江区'},
					{value: '青羊区', label: '青羊区'},
					{value: '金牛区', label: '金牛区'},
					{value: '双流区', label: '双流区'},
					{value: '郫都区', label: '郫都区'},
					{value: '龙泉驿区', label: '龙泉驿区'},
					{value: '温江区', label: '温江区'},
				], // 区域列表
				tableData: [],
				show :false,
				imgurl:''
			};
		},
		mounted() {
			this.imgurl = this.$img
			this.getAll()
		},
	
		methods: {
			//请求列表数据
			getAll() {
				let query = Object.assign(this.pageindex);
				this.$http.sendRequest('/cereBasicInformationVenue/queryByPage', 'POST', query, 1).then(res => {
					//成功回调
					this.tableData = res.data.data.content
				}).catch(err => {
					console.log(err)
					//请求失败
				})
			},
			reconciliationdetail(item) {
				let items = JSON.stringify(item)
				uni.navigateTo({
					url: `/pages/details/details?item=${items}`
				})
			},
			search(){
				this.$http.sendRequest('/cereBasicInformationVenue/queryByPage', 'POST', this.query, 1).then(res => {
					//成功回调
					this.tableData = res.data.data.content
				})
			},
			clearGet(){
				this.$http.sendRequest('/cereBasicInformationVenue/queryByPage', 'POST', this.pageindex, 1).then(res => {
					//成功回调
					this.tableData = res.data.data.content
				})
			},
			queryChange(key, val) {
				this.query[`${key}`] = val[0].value;
				this.search();
			},
		}	
	}
</script>

<style scoped lang="scss">
	@import 'field.scss';
</style>
