
<script>
	export default {
		onLaunch: function() {
			// this.init()
			console.log('App Launch')
		},
		onShow: function() {
			this.init()
			console.log('App Show')
		},
		onLoad() {
			this.init()
		},
		onHide: function() {
			console.log('App Hide')
		},

		methods: {
			init() {
				let state = this.$store.state.admin
				// console.log(state, 778)
				if (state == 0) {
					uni.setTabBarItem({
					 index: 0,
						pagePath: "pages/index/index",
						text: "合同列表",
						iconPath: "/static/icon/home.png",
						selectedIconPath: "/static/icon/achome.png",
						visible: true
					})
					uni.setTabBarItem({
						index: 1,
					 pagePath: "pages/acceptor/acceptor",
						text: "承兑人",
						iconPath: "/static/icon/per.png",
						selectedIconPath: "/static/icon/out.png",
					})
					uni.setTabBarItem({
						index: 2,
						pagePath: "pages/drawer/drawer",
						text: "出票人",
						iconPath: "/static/icon/acsip.png",
						selectedIconPath: "/static/icon/biao.png",
						visible: true
					})
					uni.setTabBarItem({
						index: 3,
						pagePath: "pages/supplier/supplier",
						text: "供应商",
						iconPath: "/static/icon/acsup.png",
						selectedIconPath: "/static/icon/sup.png",
						visible: false
					})
					uni.setTabBarItem({
						index: 4,
						pagePath: "pages/mine/mine",
						text: "我的",
						iconPath: "/static/icon/my.png",
						selectedIconPath: "/static/icon/acmy.png",
						visible: false
					})
				} else if (state == 1) {
					uni.setTabBarItem({
						index: 0,
						pagePath: "pages/index/index",
						text: "合同列表",
						iconPath: "/static/icon/home.png",
						selectedIconPath: "/static/icon/achome.png",
						visible: true
					})
					uni.setTabBarItem({
					  index: 1,
					 pagePath: "pages/acceptor/acceptor",
					 text: "承兑人",
					 iconPath: "/static/icon/card-2x.png",
					 selectedIconPath: "/static/icon/card_active-2x.png",
					  visible:false
					})
					uni.setTabBarItem({
					  index: 2,
					pagePath: "pages/drawer/drawer",
					text: "出票人",
					iconPath: "/static/icon/counter-2x.png",
					selectedIconPath: "/static/icon/counter_active-2x.png",
					 visible:false
					})
					uni.setTabBarItem({
					  index: 3,
					pagePath: "pages/supplier/supplier",
					text: "供应商",
					iconPath: "/static/icon/record-2x.png",
					selectedIconPath: "/static/icon/record_active-2x.png",
					 visible:false
					})
					uni.setTabBarItem({
						index:4,
						pagePath: "pages/mine/mine",
						text: "我的",
						iconPath: "/static/icon/my.png",
						selectedIconPath: "/static/icon/acmy.png",
						visible: true
					})
				}
			},
		}
	}
</script>
<style lang="scss">
	page {
		color: #1F242A;
	}

	@import 'uview-ui/theme.scss';
	@import "@/static/css/flex.scss";

	page {
		font-family: Source Han Sans CN-Medium;
	}
	.safebt{
		padding-bottom: 150rpx;
	}
	.statues_bar {
		height: var(--status-bar-height);
		width: 100%;
	}


</style>
