<template>
	<view class="myDemand">
		<view  v-if="MyDemandList.length > 0">
			<view class="myDemand-item" v-for="(item,index) in MyDemandList" :key="index">
				<demand-item :demanItem="item" @getMyDemandList="getMyDemandList" :myDemandData="myDemandData"></demand-item>
				<view class="reject" v-if="item.status == '6'">
					驳回原因:{{item.reason}}
				</view>
			</view>
		</view>
		<view  v-else>			<image style="width: 750upx;height: 560upx;" :src="imgfixUrls + 'homemakingImg/wushuju.png'" mode=""></image>		</view>
		<view class="issue-myDemand-box">
			<view class="issue-myDemand" @click="issue">
				<text class="iconfont icon-add" style="font-size: 32upx;color: #FFFFFF;padding-right: 20upx;"></text> 
				 发布需求
			</view>
		</view>
		<!-- <TabBars :tabBarAct="0" pageType="18"></TabBars> -->
	</view>
</template>

<script>
	import App from '@/common/js/app.js';
	import demandItem from '@/components/template/demandItem.vue';
	import TabBars from '@/components/template/tabBar.vue';
	export default{
		data(){
			return{
				MyDemandList:[],
				myDemandData:{}
			}
		},
		components:{
			demandItem,
			TabBars
		},
		onLoad() {
			
		},
		onShow() {
			this.getMyDemandList();
		},
		methods:{
			issue(){
				App.navigationTo({
					url: "pages/subPages2/homemaking/postDemand/postDemand"
				});
			},
			getMyDemandList(){
				App._post_form(
					`&p=housekeep&do=myDemandList`,
					{},
					res => {
						console.log(res);
						this.MyDemandList = res.data.list;
						this.myDemandData = res.data;
					},
					false,
					() => {
						
					}
				);
			}
		}
	}
</script>

<style lang="scss" scoped>
	.myDemand{
		padding: 20upx 30upx;
		margin-bottom: 100upx;
		.myDemand-item{
			margin-bottom: 20upx;
		}
		.reject{
			width: 610upx;
			padding: 20upx;
			border-radius: 0 0 20upx 20upx;
			background-color: #FF4444;
			color: #FFFFFF;
			font-size: 28upx;
			font-weight: 400;
			margin-left: 20upx;
			
		}
		.issue-myDemand-box{
			position: fixed;
			bottom: 0upx;
			left: 0upx;
			background-color: #F9F9F9;
			.issue-myDemand{
				width: 690upx;
				height: 80upx;
				text-align: center;
				line-height: 80upx;
				color: #FFFFFF;
				font-size: 32upx;
				background: linear-gradient(360deg, #6094FD 0%, #70A8FD 100%);
				opacity: 1;
				border-radius: 20upx;
				
				margin: 30upx;
			}
		}
		
	}
</style>
<style>
	page{
		background-color: #F8F8F8;
	}
</style>
