<!--资质审核-->
<template>
    <view id="gasRecycle">
		<view class="tabTitle" v-if="userType==1">
			<view class="tabTitle_li" @tap="tabClick(index)"  :key="index" v-for="(item,index) in tabText">
				<view :class="{on:curTab==index}" class="tabTitle_text">{{item}}</view>
			    <view :class="{on:curTab==index}" class="tabTitle_across"></view>
			</view>
		</view>
		<scroll-view scroll-y @scrolltolower="scrollGet" class="scroll-box">
		    <view class="list">
				<view class="list_li" @click="goInfo(item)" v-for="(item,index) in dataList">
					<view class="list_li_t">
						<text v-if="curTab==1" :class="item.auditStatus==1?'colorA':'colorB'">{{item.auditStatus==1?'已通过':'未通过'}}</text>
						<text>{{item.applyUser}}</text>
						<text style="color: #0183FA;">{{item.remark=='yq'?'用气申请':'资格申请'}}</text>
					</view>
					<view class="list_li_b">
						<img src="@/pages_manage/images/Version3.0/icon_zgsh_sysmph.png">
						<text>{{item.room}}</text>
						<img src="@/pages_manage/images/Version2.2/icon_wtzg_sj.png">
						<text>{{item.createTime}}</text>
					</view>
				</view>
			</view>
			<view class="get-null-box" v-if="noData">暂无更多数据</view>
		</scroll-view>
	</view>
</template>

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

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

				pageType:0,
				//列表请求参数
				params:{
				    pageNum:1,
					pageSize:10,
					auditStatus:0,//0待审核  3已审核
				},
				userType:uni.getStorageSync('userType'),
				pageType:0,
				curTab:0,
				tabText:['待审核','已审核',],
                dataList:[],
				noData:false,
            }
        },
        onLoad() {

        },
        onShow() {

        },
        methods: {
			goInfo(d){

				if(this.curTab==0){//审核
					uni.redirectTo({
					    url:'/pages_manage/aptitudeAudit/aptitudeAuditCheck?item='+encodeURIComponent(JSON.stringify(d))
					});
				}else if(this.curTab==1){//详情
					uni.navigateTo({
					    url:'/pages_manage/aptitudeAudit/aptitudeAuditDetail?item='+encodeURIComponent(JSON.stringify(d))
					});
				}

			},
			//顶部tab点击
			tabClick(index) {
				this.curTab = index;
				this.pageType=index;
				this.params.pageNum=1;

				if(index==0){
					this.params.auditStatus=0;
				}else if(index==1){
					this.params.auditStatus=3;
				}
				this.dataList=[];
				this.getList();
			},
			//滚动加载事件
			scrollGet(){
			   this.params.pageNum += 1;
			   this.getList();
			},
			//查询实验室
			async getList(){
				const {data} = await auditList(this.params)
				if(data.code == 200){
					let _this=this;
					let res=data.rows
					if(res && res.length>0){
						if(_this.params.pageNum==1){
							_this.dataList=res;
						}else{
							_this.dataList=_this.dataList.concat(res);

						}
					}else{
						_this.noData=true;
					}


				}
			},

        },
		mounted(){
		   this.getList();

		},
    }
</script>

<style lang="stylus" scoped>
    #gasRecycle {
        height: 100%;
        width: 100%;
		flex :1;
        display flex;
        flex-direction column
        overflow hidden
		.tabTitle{
			display flex;
			width:100%;
			height: 100rpx;
			background: #fff;
			margin-bottom 16rpx;

			.tabTitle_li{
				width:146rpx;
				text-align center;
				.tabTitle_text{
					display: inline-block;
					font-size: 28rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #333333;
					line-height: 70rpx;
					&.on{
						color:#0183FA;
					}
				}
				.tabTitle_across{
					width: 50rpx;
					height: 6rpx;
					background: #0183FA;
					border-radius: 3rpx;
					margin-left 50rpx;
					display none;
					&.on{
						display block;
					}
				}

			}


		}
     .scroll-box{
        // flex:1;
         overflow-y scroll;
     	.list{
			width: 710rpx;
			background: #FFFFFF;
			border-radius: 10rpx;
			margin: 20rpx;
			overflow: hidden;
			.list_li{
				height: 134rpx;
				border-bottom: 1px solid #E0E0E0;
				margin: 0 20rpx;
				padding-top: 20rpx;
				box-sizing: border-box;
				.list_li_t{
					display: flex;
					justify-content: space-between;
					align-items: center;
					.colorA{
						display: inline-block;
						background: rgba(48,162,61,0.2);
						border-radius: 6rpx;
						font-size: 22rpx;
						font-family: PingFang SC;
						font-weight: 500;
						color: #30A23D;
						padding: 6rpx 18rpx;
						box-sizing: border-box;
					}
					.colorB{
						display: inline-block;
						background: rgba(165,25,25,0.2);
						border-radius: 6rpx;
						font-size: 22rpx;
						font-family: PingFang SC;
						font-weight: 500;
						color: #A51919;
						padding: 6rpx 18rpx;
						box-sizing: border-box;
					}
					>text:nth-of-type(2){
						font-size: 28rpx;
						font-family: PingFang SC;
						font-weight: 500;
						color: #333333;
						line-height: 28rpx;
						margin-left: 12rpx;
					}
					>text:nth-of-type(3){
						flex: 1;
						font-size: 26rpx;
						font-family: PingFang SC;
						font-weight: 500;
						color: #333333;
						line-height: 26rpx;
						text-align: right;
					}

				}
				.list_li_b{
					margin-top: 30rpx;
					display: flex;
					>img:nth-of-type(1){
						width: 28rpx;
						height: 28rpx;
						margin-right: 16rpx;
					}
					>img:nth-of-type(2){
						width: 28rpx;
						height: 28rpx;
						margin-right: 20rpx;
					}
					>text:nth-of-type(1){
						font-size: 26rpx;
						font-family: PingFang SC;
						font-weight: 500;
						color: #666666;
						line-height: 26rpx;
						width: 152rpx;
					}
					>text:nth-of-type(2){
						font-size: 26rpx;
						font-family: PingFang SC;
						font-weight: 500;
						color: #666666;
						line-height: 26rpx;

					}
				}
			}
		}
		/*暂无数据*/
		.get-null-box{
		    height:100rpx;
		    line-height:100rpx;
		    color:#999;
		    text-align center
		}
	 }
	}
</style>
