<!-- https://www.kancloud.cn/dishaxueyuan/uni-app/1358897 onBackPress在小程序不生效 -->
<template>
	<view class="pages">
		<view class="hold-status-bar show">
			<!-- 占据了状态栏位置 -->
		</view>
		<view class="custom-nav">
			<view class="custom-nav-left" @click="$api.goback"><text class="iconfont icon-jiantou"></text></view>
			<view class="custom-nav-center"></view>
		</view>
		<image :src="$getimg + 'building.png'" class="building-img" mode="heightFix"></image>
		<view class="building-text">正在建设中<text class="dotting"></text></view>
		
		<hans-tabber :list="list" style="position:fixed;bottom:0;width:100%;left:0;right:0;" @tabChange="tabChange"></hans-tabber>
	</view>
</template>

<script>
	import hansTabber from '../../components/hans-tabbar/hans-tabbar.vue';
	export default {
		components:{
			hansTabber
		},
		data() {
			return {
				list: [{
				 "text": "首页",
				 "iconPath": '/static/img/icon_home.png' ,
				 "selectedIconPath": '/static/img/icon_home_active.png'
			   },
			   {
				 "text": "价值实现",
				 "iconPath": '/static/img/icon_use.png',
				 "selectedIconPath":'/static/img/icon_use_active.png'
				 },
				 {
				   "text": "我的信息",
				   "iconPath": '/static/img/icon_usercenter.png',
				   "selectedIconPath": '/static/img/icon_usercenter_active.png'
				 }],
				$getimg:this.$getimg,
				token:'',
				params:{
					
				}
				
			}
		},
		onShow() {
			let self = this;
			uni.getStorage({
				key : 'userInfo',
				success:function(res){
					if(res.data.customerType =='1'){
						// console.log('个人用户');
						self.list[1].text='普惠商城';
						self.list[1].iconPath='/static/img/icon_mall.png';
						self.list[1].selectedIconPath='/static/img/icon_mall_active.png';
					}else{
						
					};
				}
			});
		},
		onLoad() {
			// var pages = getCurrentPages();
			// console.log('pages',pages);
			// let menuButtonInfo = uni.getMenuButtonBoundingClientRect();//胶囊按钮信息
			// console.log('menuButtonInfo',menuButtonInfo);

		},
		methods: {
			tabChange(index) {
				console.log(index)
				switch(index) {
				     case 0:
				        uni.switchTab({
				        	url:'../index/index'
				        });
				        break;
				     case 1:
				        return
				        break;
					case 2:
					   uni.switchTab({
					   	url:'../usercenter/usercenter'
					   });
					   break;
				     default:
				        return
				} 
			}

		}
	}
</script>

<style>
	/* @import url("./building.css"); */
	page{background-color: #F5F5F5;text-align: center;}
	.custom-nav{background-color: #fff;color: #333;padding-bottom: 20rpx;}
	.building-img{margin-top: 408rpx;width: 240rpx;height: 240rpx;margin-bottom: 36rpx;}
	.building-text{font-size: 30rpx;color: #999;line-height: 45rpx;font-weight: 400;}
</style>
