<style lang="scss" scoped>
	
	.entercerlist{
		.box{
			width: 100%;
			height: 100%;
			.box_item{
				width: 100%;
				height: 190rpx;
				background: #FFFFFF;
				padding: 15px;
				border-radius: 15px;
				margin-top: 15px;
				box-shadow: 0px 5px 5px 0px rgba(218, 220, 230, 0.85);
				display: flex;
				flex-direction: column;
				justify-content: space-between;
				.box_i_t{
					width: 100%;
					display: flex;
					justify-content: space-between;
					align-items: center;
					.box_i_t_l{
						display: flex;
						align-items: center;
						margin-right: 10px;
						.box_i_t_lt{
							font-size: 15px;
							font-weight: bold;
							color: #1F1F1F;
							width: calc(100vw - 60px - 34rpx - 100rpx - 20px);
							white-space: nowrap;text-overflow: ellipsis;overflow: hidden;
							
							
						}
					}
					.box_i_t_r{
						font-size: 12px;
						font-weight: 500;
						color: #111111;
						width: 100rpx;
						text-align: right;
						font-family: PingFang SC;

					}
				}
				.box_i_b{
					width: 100%;
					white-space: nowrap;text-overflow: ellipsis;overflow: hidden;
					font-size: 12px;
					color: #999999;
				}
			}
		}
	}
</style>

<template>
	<div class="entercerlist" :style="{'background-color': '#f6f6f6','height': '100vh','overflow': 'hidden'}">
		
		<view style="display: flex; align-items: center;">
			<view style="flex:1;overflow: hidden;">
				<u-tabs bg-color="#f6f6f6" :is-scroll="false" name="ClassName" :list="typeList" :active-color="mainColor"
					:current="active" @change="changeHandler" :show-bar="true" :activeFontSize="34" :bold="true" height="100"
					duration="0" font-size="28"></u-tabs>
			</view>
		</view>
		<u-empty v-if="g.length == 0" text="暂无内容" mode="list"></u-empty>
		<view style="height: calc(100% - 51px);padding:0px 15px;" v-if="g.length > 0">
			<scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" @scrolltolower="lower"
				style="height: 100%; padding-bottom: 0px;">
				<view class="box">
					<view class="box_item" v-for="(x,y) in g" :key="y" @click="godetails(x.CompanyId)">
						<view class="box_i_t">
							<view class="box_i_t_l">
								<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/qytoexamine.png" style="width: 34rpx;height: 40rpx;margin-right: 10px;"></image>
								<view class="box_i_t_lt">
									{{x.CompanyName}}
								</view>
							</view>
							<view class="box_i_t_r">
								<span v-if="x.CompanyStatus == 0">审核中</span>
								<span v-if="x.CompanyStatus== 1" style="color: #00DFB8;">审核通过</span>
								<span v-if="x.CompanyStatus == 2" style="color: #F70027;">审核失败</span>
							</view>
						</view>
						<view style="width: 100%;height: 1px;background: #E2E2E2;"></view>
						<view class="box_i_b">
							统一社会信用代码：{{x.UnifiedCode?x.UnifiedCode:''}}
						</view>
					</view>
					<u-loadmore
					  :status="status"
					  :load-text="loadText"
					  :font-size="24"
					  :margin-top="20"
					  :margin-bottom="20"
					  bg-color="#f6f6f6"
					/>
				</view>
				
			</scroll-view>
		</view>
	</div>
</template>

<script>
	
	export default {
		
		data() {
			return {
				mainColor: '',
				active: 0,
				searchKey:"",
				typeList: [{ID:-1,ClassName:'全部'},{ID:0,ClassName:'待审核'},{ID:1,ClassName:'审核通过'},{ID:2,ClassName:'审核失败'},],
				msg:{
					pageIndex:1,
					pageSize:20,
					CompanyStatus:-1,
				},
				loadText: {
					loadmore: "轻轻上拉，加载更多",
					loading: "努力加载中",
					nomore: "没有更多了",
				},
				page_count:1,
				status: "loadmore",
				g: [],
				contentHeight:0,
			};
		},
		onLoad(options) {
		
		},
		created() {
			this.mainColor = this.$uiConfig.mainColor;
		},
		mounted() {
			uni.setNavigationBarTitle({
				title: '企业认证',
			});
			let c = this.$uiConfig.is_bang ? 78 : 50;
			this.contentHeight = this.$utils.calcContentHeight(c)+40;
			this.init();
		},
		methods: {
			
			init() {
			  this.request2(
			  	{
			  		url: '/api/AppletTrade/GetAdminCompanyPageList',
			  		data: this.msg
			  	},
			  	res => {
			  		if(res.resultCode==1){
						this.g = this.g.concat(res.data.pageData);
						 this.page_count = res.data.pageCount;
						 if (this.page_count == 1) {
						   this.status = "nomore";
					}
			  		}
			  	}
			  );
			},
			lower(e) {
			  if (this.msg.pageIndex < this.page_count) {
			    this.msg.pageIndex++;
				this.status = "loading";
			    this.init();
			  } else {
			    
				this.status = "nomore";
			  }
			},
			changeHandler(i) {
				this.active = i;
				this.msg.CompanyStatus = this.typeList[i].ID;
				this.msg.pageIndex = 1;
				this.g= [];
				 this.init();
			},
			openGood(id) {
				
				uni.navigateTo({
					url: '/pages/kotra/brand/detail?id=' + id,
				});
			},
			godetails(CompanyId){
				
				uni.navigateTo({
					url: '/pages/kotra/enterpriseCertificationdetails?CompanyId='+CompanyId 
				})
			},
			getchildren(){
				this.msg.pageIndex = 1;
				this.g= [];
				this.init();
			}
			
		}
	};
</script>

