<!--气瓶申请-->
<template>
    <view id="transportPerson">
		<scroll-view scroll-y @scrolltolower="scrollGet" class="scroll-box">
		    <view class="list">
				<view class="list_li" v-for="(item,index) in dataList" :key="index" @click="goInfo(item)">
					<view class="list_li_t">
						<img class="for-back-img" :src="imagesUrl('commonality/icon_ysclgl_cl.png')">
						<text>申请时间：{{item.createTime}}</text>
						<text v-if="item.applyNum==item.storageNum">已全部入库</text>
					</view>
					<view class="list_li_b">
						<view>申请：<text>{{item.applyNum}}</text></view>
						<view>入库：<text>{{item.storageNum}}</text></view>
					</view>
				</view>
			</view>
		</scroll-view>
		<view class="empty" v-if="pageType==4">
			<img class="for-back-img" :src="imagesUrl('commonality/img_ysrygl_zwsj.png')">
			<view>暂无数据</view>
		</view>
		<view class="sub_btn" @click="subBtn()">提交申请</view>
	</view>
</template>

<script>
	import { gasApplyList } from '@/api/apiDemo/index.js'
    export default {

        name: "transportPerson",
        data() {
            return {

				pageType:0,
				//列表请求参数
				getData:{
				    pageNum:1,
					pageSize:20,
				},
				pageType:0,
                dataList:[],
            }
        },
        onLoad() {

        },
        onShow() {

        },

        methods: {

			//滚动加载事件
			scrollGet(){
			   this.getData.pageNum += 1;
			   this.getList();
			},
			subBtn(){
				uni.redirectTo({
				    url:'/pages_student/gasApply/gasApplyAdd?status=0'
				});
			},
			goInfo(d){
				uni.redirectTo({
				    url:'/pages_student/gasApply/gasApplyList?item='+encodeURIComponent(JSON.stringify(d))
				});
			},
			//获取列表数据
				async getList(){
				   let _this=this;
				    const {data} = await gasApplyList(this.getData);
				    if(data.code==200){
						let res=data.data.records;
						if(_this.getData.pageNum==1){
							_this.dataList=res;
							if(res.length>0){
								_this.pageType=0;
							}else{
								_this.pageType=4;
							}
						}else{
							_this.dataList=_this.dataList.concat(res);
						}
				    }
				},

        },
		mounted(){
			this.getList()
		},
    }
</script>

<style lang="stylus" scoped>
    #transportPerson {
        height: 100%;
        width: 100%;
		flex :1;
        display flex;
        flex-direction column
        overflow hidden;
		margin-top: 20rpx;

        .scroll-box{
        // flex:1;
         overflow-y scroll;
		 padding-bottom: 220rpx;
		 .list{
			 background: #FFFFFF;
			 border-radius: 20rpx;
			 margin: 0 20rpx;
			 padding: 0 20rpx;
			 box-sizing: border-box;
			 .list_li{
				 border-bottom:1px solid #f5f5f5;
				 padding: 30rpx 0 20rpx 0;
				 box-sizing: border-box;
				.list_li_t{
					display: flex;
					align-items: center;
					>img{
						width: 30rpx;
						height: 30rpx;
						margin-right: 16rpx;
					}
					>text:nth-of-type(1){
						font-size: 28rpx;
						font-family: PingFang SC;
						font-weight: 500;
						color: #333333;
						line-height: 28rpx;
					}
					>text:nth-of-type(2){
						width: 220rpx;
						display: inline-block;
						font-size: 24rpx;
						font-family: PingFang SC;
						font-weight: 500;
						color: #00CC26;
						line-height: 24rpx;
						text-align: right;

					}
				}
				.list_li_b{
					display: flex;
					margin-top: 42rpx;
					>view{
						width: 150rpx;
						font-size: 26rpx;
						font-family: PingFang SC;
						font-weight: 500;
						color: #333333;
						line-height: 26rpx;
						>text{
							font-size: 26rpx;
							color: #0183FA;
						}
					}
					>view:nth-of-type(2){
						>text{
							font-size: 26rpx;
							color: #00CC26;
						}
					}
				}
			 }
		 }
     }
		.empty{
			text-align: center;
			margin-top: 316rpx;
			>img{
				width: 336rpx;
				height: 222rpx;
				margin-left: 208rpx;
			}
			>view{
				font-size: 30rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #E0E0E0;
				line-height: 30rpx;
				margin-top: 48rpx;
			}
		}
		/* 按钮 */
		.sub_btn{
			width: 650rpx;
			height: 100rpx;
			background: #0183FA;
			border-radius: 20rpx;
			font-size: 28rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #FFFFFF;
			line-height: 100rpx;
			text-align: center;
			margin-left: 50rpx;
			position: fixed;
			bottom:30rpx;
		}
	}
</style>
