<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">
				<notApproved ref="notApproved"></notApproved>
			</view>
			<view v-if="shows === 2">
				<noPass ref="noPass"></noPass>
			</view>
			<view v-if="shows === 3">
				<Pass ref="Pass"></Pass>
			</view>
		</view>
		<!-- <u-tabbar :list="tabBarList" :active-color="activeColor" :inactive-color="inactiveColor"
					:border-top="borderTop"></u-tabbar> -->
	</view>
</template>

<script>
	import notApproved from './notApproved.vue'
	import noPass from './noPass.vue'
	import Pass from './Pass.vue'
	import { mapGetters } from 'vuex'
	export default {
		components:{
			notApproved,
			noPass,
			Pass
		},
		data() {
			return {
				shows: 1,
				borderTop: false,
				inactiveColor: '#ccc',
				activeColor: '#2E4F1C',
			}
		},
		computed: {
			...mapGetters([
				'tabBarList',
				'role'
			])
		},
		onLoad() {
			this.shows = 1;
		},
		methods: {
			show(){
				if(this.shows === 1){
					this.$refs.notApproved.showMOdel();
				}else if(this.shows === 2){
					this.$refs.noPass.showMOdel();
				}else if(this.shows === 3){
					this.$refs.Pass.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;
	}
	.header{
		width: 100%;
		height: 176rpx;
		background: #2E4F1C;
		text-align: center;
		color: #FFFFFF;
		padding-top: 116rpx;
		font-size: 26rpx;
	}
	.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>
