<template>
	<!-- 商户审核 -->
	<view>
		<view class="select">
			<view class="text font-color4" :class="{active1:shows === 1}" @click="active('001')">
				未审核
			</view>
			<view class="text font-color4" :class="{active:shows === 2}" @click="active('002')">
				审核未通过
			</view>
			<view class="text font-color4" :class="{active2:shows === 3}" @click="active('003')">
				审核通过
			</view>
		</view>
		<view>
			<view v-if="shows === 1">
				<noexamine ref="noexamine"></noexamine>
			</view>
			<view v-if="shows === 2">
				<noadopt ref="noadopt"></noadopt>
			</view>
			<view v-if="shows === 3">
				<examined ref="examined"></examined>
			</view>
		</view>
		<!-- <u-tabbar :list="tabBarList" :active-color="activeColor" :inactive-color="inactiveColor"
					:border-top="borderTop"></u-tabbar> -->
	</view>
</template>

<script>
	import examined from './examined.vue'
	import noadopt from './noadopt.vue'
	import noexamine from './noexamine.vue'
	import { mapGetters } from 'vuex'
	export default {
		data() {
			return {
				shows: 1,
				borderTop: false,
				inactiveColor: '#ccc',
				activeColor: '#2E4F1C',
			}
		},
		components:{
			examined,
			noadopt,
			noexamine
		},
		computed: {
			...mapGetters([
				'tabBarList',
				'role'
			])
		},
		onLoad(e) {
			if(e.id){
				console.log('e.id', e.id)
			}
			this.shows = 1;
			this.show();
		},
		methods: {
			show(){
				console.log('001')
				if(this.shows === 1){
					this.$refs.noexamine.showModel();
				}else if(this.shows === 2){
					this.$refs.noadopt.showModel();
				}else if(this.shows === 3){
					this.$refs.examined.showModel();
				}
			},
			active(type) {
				if (type === '001') {
					this.shows = 1;
				} else if (type === '002') {
					this.shows = 2;
				} else {
					this.shows = 3;
				}
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #F9F9F9;
	}
	.select {
		border: 2rpx solid #2E4F1C;
		border-radius: 48rpx;
		margin: 30rpx 36rpx 0;
		display: flex;
		justify-content: space-between;
		.text {
			padding: 22rpx 60rpx;
			text-align: center;
		}
	}
	.text:nth-child(3) {
		border: none;
	}
	.active {
		background-color: #2E4F1C;
		color: #ffffff;
	}
	.active1 {
		background-color: #2E4F1C;
		color: #ffffff;
		border-radius: 48rpx 0rpx 0rpx 48rpx;
	}
	.active2 {
		background-color: #2E4F1C;
		color: #ffffff;
		border-radius: 0rpx 48rpx 48rpx 0rpx;
	}
</style>
