<template>
	<view>
		<u-navbar  title="审核处理" ></u-navbar>
		<view class="guanzhu">
			<u-tabs-swiper
			  ref="uTabs"
			  :list="navList"
			  :current="current"
			  :is-scroll="false"
			  :active-item-style="{ color: '#3CB5FB', fontSize: '0.15rem' }"
			  :bar-style="{ background: '#3CB5FB' }"
			  @change="tabsChange"
			></u-tabs-swiper>
			<scroll-view
			  scroll-y="true"
			  style="height: calc(100vh - 1rem); width: 100%"
			  @scrolltolower="onreachBottom"
			>
			<view class="flex-col group_2">
				<view class="flex-col list">
					<view class="list-item flex-row group_3" v-for="(item,index) in AuditList" :key="index" @click="onAudit(item.id,current)">
						<image
							:src="$u.http.config.imgUrl + item.head"
							class="text_3 image_1" />
						<view class="bottom-text-wrapper justify-between view_1">
							<text class="text_5 text_7">{{item.name}}</text>
							<view class="center-text-wrapper flex-col items-end">
								<text class="text_8">{{item.schoolName}}</text>
							</view>
							<view class="right-text-wrapper flex-col items-center" v-if="item.state==0">
								<text class="text_10" >待处理</text>
							</view>
							<view class="right-text-wrapper flex-col items-center" v-if="item.state==1" style="background-color:#08da08;">
								<text class="text_10" >已通过</text>
							</view>
							<view class="right-text-wrapper flex-col items-center" v-if="item.state==2" style="background-color:#ef0909;">
								<text class="text_10" >已驳回</text>
							</view>
							<view class="right-text-wrapper flex-col items-center"  v-if="item.state==3" style="background-color:rgb(242, 142, 12);">
								<!-- <text class="text_10">{{auto[item.state]}}</text> -->
								<text class="text_10">待二次审核</text>
								<!-- <text class="text_10">{{item.state==0?'待处理':'已通过'}}</text> -->
							</view>
						</view>
					</view>
		<!-- 			<view class="list-item flex-row group_8">
						<image
							src="https://codefun-proj-user-res-1256085488.cos.ap-guangzhou.myqcloud.com/6216dee45a7e3f031061d0f1/621c59e162a7d90011002985/16460345196775201756.png"
							class="text_3 image_6" />
						<view class="bottom-text-wrapper justify-between view_1">
							<text class="text_5 text_26">Meiji</text>
							<view class="center-text-wrapper flex-col items-end view_20">
								<text class="text_8">浙江大学</text>
							</view>
							<view class="right-text-wrapper flex-col items-center view_21">
								<text class="text_10">审核中</text>
							</view>
						</view>
					</view> -->
				</view>
			</view>
			</scroll-view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				AuditList:[],
				current:0,
				schoolId:"",
				navList:[
					{
					  name: "待审核",
					},
					{
					  name: "已审核",
					},
				],
				auto:{
					0:'待处理',
					1:'已通过',
					2:'已驳回',
					3:'待二次审核'
				},
				pageIndex:1,
				pageSize:10,
				total:0
			}
		},
		onLoad(){
			// this.getschoolId()
		},
    onShow(){
      this.pageIndex = 1;
      this.AuditList = [];
      this.getschoolId()
      // this.getAuditList();
    },
		methods: {
			getschoolId(){
				this.$u.apiList.GetUserSchool().then(res=>{
          // 学生时
          if([0,2].includes(this.vuex_user.userType)){
            this.schoolId = res.items.schoolId
          }
          // 教师时
          if(this.vuex_user.userType === 1){
            this.schoolId = res.jzgItems.schoolId
          }
					this.getAuditList()
				})
			},
			getAuditList(){
				const data = {
					pageIndex:this.pageIndex,
					pageSize:this.pageSize,
					userId:this.vuex_user.id,
					schoolId:this.schoolId,
					type:this.current
				}
				this.$u.apiList.AuditList(data).then(res=>{
					this.total = res.total
					this.AuditList.push(...res.items)
					
				})
			},
			tabsChange(i){
				if(this.current != i){
					this.current = i 
					this.AuditList = []
					this.pageIndex = 1
					this.getAuditList()
				}
			},
			// onExamine(item){
			// 	console.log(1)
			// 	if(this.vuex_user.isAttestationJZG){
			// 		this.onAttestationJZG(item)
			// 	}else{
			// 		this.onAttestationGLY0(item)
			// 	}
			// },
			//教职工认证
			// onAttestationJZG(item){
			// 	this.$u.apiList.AttestationJZG({userId:item.id}).then((res)=>{
					
			// 	})
			// },
			// onAttestationGLY(item){
			// 	this.$u.apiList.AttestationGLY({userId:item.id}).then((res)=>{
					
			// 	})
			// },
			onAudit(id,current){
				this.$u.route({
					url:'pages/my/AuditDeatil/AuditDeatil',
					params:{id:id,type:current}
				})
			},
			onreachBottom(){
				 let num = this.pageIndex * this.pageSize
				 
				 if(num >= this.total)return
				 this.pageIndex++
				 this.getAuditList()
			},
			//返回上一级
			router(){
				 uni.switchTab({
				 	url: '../../my/my/my'
				 });
			}
		}
	}
</script>

<style lang="scss" scoped>
	.guanzhu {
		.list-item {
			padding: 0rem 0 0 0.15rem;
			box-shadow: 0px 0.005rem rgb(234, 234, 234);
			width: 100%;
			position: relative;
		}
	
		.text_3 {
			color: rgb(2, 2, 2);
			font-size: 0.15rem;
			line-height: 0.14rem;
			letter-spacing: 0.015rem;
			white-space: nowrap;
		}
	
		.bottom-text-wrapper {
			margin-top: 0.1rem;
			padding: 0.035rem 0;
			color: rgb(115, 129, 255);
			font-size: 0.11rem;
			line-height: 0.11rem;
			letter-spacing: 0.011rem;
			white-space: nowrap;
			background-color: rgba(115, 129, 255, 0.1);
			border-radius: 0.09rem;
		}
	
		.text_5 {
			margin-left: 0.1rem;
			margin-right: 0.03rem;
		}
	
		.center-text-wrapper {
			padding: 0.035rem 0.08rem;
			color: rgb(115, 129, 255);
			font-size: 0.11rem;
			line-height: 0.11rem;
			letter-spacing: 0.011rem;
			white-space: nowrap;
			background-color: rgba(115, 129, 255, 0.1);
			border-radius: 0.09rem;
			position: absolute;
			left: 0.4rem;
			bottom: 0.1rem;
		}
	
		.right-text-wrapper {
			margin-right: 0.06rem;
			margin-top: 0.03rem;
			margin-left: 0.06rem;
			padding: 0.085rem 0.08rem;
			color: rgb(255, 255, 255);
			font-size: 0.14rem;
			line-height: 0.13rem;
			white-space: nowrap;
			background-color: rgb(46, 155, 255);
			border-radius: 0.15rem;
			width: 0.85rem;
			height: 0.3rem;
			position: relative;
		}
	
		.text_8 {
			margin-right: 0.03rem;
		}
	
		.text_10 {
			text-transform: uppercase;
		}
	
		.text_12 {
			margin-left: 0.05rem;
			color: rgb(2, 2, 2);
			font-size: 0.15rem;
			line-height: 0.14rem;
			letter-spacing: 0.015rem;
			white-space: nowrap;
		}
	
		.text_14 {
			margin-left: 0.1rem;
			margin-right: 0.03rem;
		}
	
		.group_2 {
			// padding: 0.11rem 0 4.94rem;
			// flex: 1 1 auto;
			// overflow-y: auto;
			position: relative;
		}
	
		.text-wrapper {
			// margin-left: 0.17rem;
			padding: 0.11rem 0 0.12rem;
			color: rgb(255, 255, 255);
			font-size: 0.18rem;
			line-height: 0.17rem;
			letter-spacing: 0.018rem;
			white-space: nowrap;
			background-size: 100% 100%;
			background-repeat: no-repeat;
			width: 0.4rem;
			height: 0.4rem;
			margin-top: 0.08rem;
			background: #6574fc;
			border-radius: 50%;
	
			text {
				display: inline-block;
				width: 100%;
				text-align: center;
			}
		}
	
		.list {
			
		}
	
		.text_2 {
			color: #fff;
		}
	
	
		.group_4 {
			padding: initial;
			align-self: initial;
			box-shadow: initial;
			width: initial;
			position: initial;
			margin-top: 0.015rem;
		}
	
		.group_5 {
			padding: initial;
			align-self: initial;
			box-shadow: initial;
			width: initial;
			position: initial;
		}
	
		.group_6 {
			padding: initial;
			align-self: initial;
			box-shadow: initial;
			width: initial;
			position: initial;
		}
	
		.group_7 {
			padding: initial;
			align-self: initial;
			box-shadow: initial;
			width: initial;
			position: initial;
		}
	
		.group_8 {
			padding: initial;
			align-self: initial;
			box-shadow: initial;
			width: initial;
			position: initial;
		}
	
		.group_9 {
			padding: initial;
			align-self: initial;
			box-shadow: initial;
			width: initial;
			position: initial;
		}
	
		.image_1 {
			color: initial;
			font-size: initial;
			line-height: initial;
			letter-spacing: initial;
			white-space: initial;
			margin-top: 0;
			width: 0.4rem;
			height: 0.4rem;
			border-radius: 50%;
			overflow: hidden;
			    position: absolute;
			    top: 50%;
			    transform: translateY(-50%);
		}
	
		.view_1 {
			margin-top: initial;
			padding: 0.15rem 0.05rem 0.18rem 0.4rem;
			color: initial;
			font-size: initial;
			line-height: initial;
			letter-spacing: initial;
			white-space: initial;
			background-color: initial;
			border-radius: initial;
			margin-left: 0.12rem;
			margin-right: 0.04rem;
			flex: 1 1 auto;
			box-shadow: 0px 0.005rem rgb(234, 234, 234);
			height: 0.67rem;
			position: relative;
		}
	
		.image_2 {
			color: initial;
			font-size: initial;
			line-height: initial;
			letter-spacing: initial;
			white-space: initial;
			align-self: center;
			width: 0.4rem;
			height: 0.4rem;
		}
	
		.view_4 {
			margin-top: initial;
			padding: 0.14rem 0 0.1rem;
			color: initial;
			font-size: initial;
			line-height: initial;
			letter-spacing: initial;
			white-space: initial;
			background-color: initial;
			border-radius: initial;
			margin-left: 0.12rem;
			flex: 1 1 auto;
			box-shadow: 0px 0.005rem rgb(234, 234, 234);
		}
	
		.image_3 {
			color: initial;
			font-size: initial;
			line-height: initial;
			letter-spacing: initial;
			white-space: initial;
			align-self: center;
			width: 0.4rem;
			height: 0.4rem;
		}
	
		.view_8 {
			margin-top: initial;
			padding: 0.15rem 0 0.14rem;
			color: initial;
			font-size: initial;
			line-height: initial;
			letter-spacing: initial;
			white-space: initial;
			background-color: initial;
			border-radius: initial;
			margin-left: 0.13rem;
			flex: 1 1 auto;
			box-shadow: 0px 0.005rem rgb(234, 234, 234);
		}
	
		.image_4 {
			color: initial;
			font-size: initial;
			line-height: initial;
			letter-spacing: initial;
			white-space: initial;
			align-self: center;
			width: 0.4rem;
			height: 0.4rem;
		}
	
		.view_12 {
			margin-top: initial;
			padding: 0.17rem 0 0.08rem;
			color: initial;
			font-size: initial;
			line-height: initial;
			letter-spacing: initial;
			white-space: initial;
			background-color: initial;
			border-radius: initial;
			margin-left: 0.12rem;
			flex: 1 1 auto;
			box-shadow: 0px 0.005rem rgb(234, 234, 234);
		}
	
		.image_5 {
			color: initial;
			font-size: initial;
			line-height: initial;
			letter-spacing: initial;
			white-space: initial;
			align-self: center;
			width: 0.4rem;
			height: 0.4rem;
		}
	
		.view_16 {
			margin-top: initial;
			padding: 0.15rem 0 0.11rem;
			color: initial;
			font-size: initial;
			line-height: initial;
			letter-spacing: initial;
			white-space: initial;
			background-color: initial;
			border-radius: initial;
			margin-left: 0.16rem;
			flex: 1 1 auto;
			box-shadow: 0px 0.005rem rgb(234, 234, 234);
			height: 0.67rem;
		}
	
		.image_6 {
			color: initial;
			font-size: initial;
			line-height: initial;
			letter-spacing: initial;
			white-space: initial;
			align-self: center;
			width: 0.4rem;
			height: 0.4rem;
		}
	
		.view_19 {
			margin-top: initial;
			padding: 0.18rem 0 0.18rem;
			color: initial;
			font-size: initial;
			line-height: initial;
			letter-spacing: initial;
			white-space: initial;
			background-color: initial;
			border-radius: initial;
			margin-left: 0.16rem;
			flex: 1 1 auto;
			box-shadow: 0px 0.005rem rgb(234, 234, 234);
			height: 0.67rem;
			position: relative;
		}
	
		.text_7 {
			margin-left: initial;
			margin-right: initial;
			color: rgb(2, 2, 2);
			font-size: 0.15rem;
			line-height: 0.14rem;
			letter-spacing: 0.015rem;
			white-space: nowrap;
		}
	
		.text_26 {
			margin-left: initial;
			margin-right: initial;
			color: rgb(2, 2, 2);
			font-size: 0.15rem;
			line-height: 0.14rem;
			letter-spacing: 0.015rem;
			white-space: nowrap;
		}
	
		.view_20 {
			left: -0.03rem;
			bottom: 0.075rem;
		}
	
		.view_21 {
			margin-right: 0.06rem;
			margin-top: initial;
			padding: 0.09rem 0 0.06rem;
			color: rgb(73, 76, 87);
			background-color: initial;
			border: solid 0.01rem rgb(185, 185, 185);
		}
	}
</style>
