<template>
	<view class="page">
		<view class="screen-list">
			<view class="list">
				<u-input v-model="pageindex.start" type="select" @click="typeShow = true" placeholder='状态筛选' />
			</view>
		</view>
		<!-- 记录列表 -->
		<view class="record-list">
			<view class="record-list-box" v-for="(item,index) in recordList" :key="index" @click="recordXq(item)">
				<view class="list">
					<view class="title">
						<view class="left">{{item.cereBasicInformationShop&&item.cereBasicInformationShop.shopName?item.cereBasicInformationShop.shopName:item.cereBasicInformationVenue&&item.cereBasicInformationVenue.venueName?item.cereBasicInformationVenue.venueName:item.cereAdvertisingInformation&&item.cereAdvertisingInformation.advertisingName?item.cereAdvertisingInformation.advertisingName:''}}</view>
						<view class="right"><u-icon name="arrow-rightward"></u-icon></view>
					</view>
					<view class="info-item">申请时间：{{item.applicationTime}}</view>
					<view class="info-item">状态：<span style="color: #0FBB59;">{{item.auditStatus =='1'?'待审核':item.auditStatus =='2'?'待签约':item.auditStatus =='3'?'已驳回':item.auditStatus =='4'?'租赁中':'已终止'}}</span></view>
				</view>
			</view>
		</view>
		<u-select v-model="typeShow" :list="activesType" @confirm="typeChange"></u-select>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				activesType: [{
					value: 4,
					label: '租赁中'
				},
				{
					value: 7,
					label: '已终止'
				},
				],
				typeShow:false,
				recordList:[],
				pageindex: {
					auditStatus:4,
					pageNumber: 0,
					pageSize: 10
				},
			}
		},
		mounted(){
			this.getALL()
		},
		methods: {
			getALL(){
				this.pageindex.applicant =uni.getStorageSync('user').phone
				this.$http.sendRequest('/cereBusinessInfo/queryByPage', 'POST', this.pageindex,1).then(res => {
					//成功回调
					 this.recordList = res.data.data.content
					this.$http.sendRequest('/cereAdvertiserInfo/queryByPage', 'POST', this.pageindex, 1).then(item => {
						
					 if(item.data.data.content !=undefined &&item.data.data.content.length !=0){
						 item.data.data.content.map(val=>{
							  this.recordList.push(val)
						 })
					 } 
					
					 
					})
				})
				
			},
			recordXq(item){
			
				 const encodedItem = encodeURIComponent(JSON.stringify(item));
				uni.navigateTo({
				 url: `/pagesA/myZiyuan/myZiDetails?item=${encodedItem}`,
				 })
			},
			contractdetail(){
				// uni.navigateTo({
				
				// })
			},
			typeChange(e) {
				
				this.pageindex.start = e[0].labels
			this.pageindex.auditStatus = e[0].value
				this.getALL()
			},
		}
	}
</script>

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