<template>
	<view>
		
	
	<view style="height: 100rpx;"></view>
    <view class="com_footer">
		<block v-for="(item,k) in footlist" :key="k" >
			<view class="in_item" v-if="!item.limit||item.limit&&checkPermi([item.limit])"  @click="gotopage(item)">
				<view class="im_imgs">
					<image class="in_img" :class="item.img" v-if="active == item.module" :src="item.icon_checked" mode="scaleToFill"></image>
					<image class="in_img" :class="item.img" v-else :src="item.icon_nochecked" mode="scaleToFill"></image>
				</view>
				
				<view class="in_txt" v-if="active == item.module" :style="'color: #'+color_checked">{{item.title}}</view>
				<view class="in_txt" v-else :style="'color: #'+color_nochecked">{{item.title}}</view>
			</view>
		</block>
       
    </view>
	</view>
</template>

<script>
	import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
	// import api from '../../api/api.js'
	// import plugins from '../../commen/js/plugin.js'
    export default {
		props:[
			// 'footlist',
			// 'color_checked',
			// 'color_nochecked',
			'footerindex',
			'isHomeIndex'
		],
        data () {
            return{
				active :'',
				footlist:[
					{module:'home',title:'潜山政协',img:"imga",icon_checked:require('@/static/images/tabbar/home_.png'),icon_nochecked:require('@/static/images/tabbar/home.png')},
					{module:'report',title:'履职报告',img:"imgb",icon_checked:require('@/static/images/tabbar/report_.png'),icon_nochecked:require('@/static/images/tabbar/report.png'),limit:"member:info:MemberReport"},
					{module:'notice',title:'会议通知',img:"imgc",icon_checked:require('@/static/images/tabbar/notice_.png'),icon_nochecked:require('@/static/images/tabbar/notice.png'),limit:"zxConference:conference:list"},
					{module:'mine',title:'个人中心',img:"imgd",icon_checked:require('@/static/images/tabbar/mine_.png'),icon_nochecked:require('@/static/images/tabbar/mine.png')},
					],
				color_checked :'222327',
				color_nochecked :'AAAAAA',
            }
        },
		mounted() {
			var that = this;
			this.active = this.footerindex;
		},
        methods:{
			checkPermi, checkRole,
            // 跳转底部导航页面
			gotopage(e){
				var that = this;
				let link = e.link, module = e.module, def = e.default, title = e.title;
				if(module == 'home'){
					this.$tab.reLaunch('/pages/index/index')
				}else if(module == 'report'){
					var id=this.$store.state.user.userId
					this.$tab.reLaunch('/pages/report/index?id='+id)
				}else if(module == 'notice'){
					this.$tab.reLaunch('/pages/notice/index')
				}else if(module == 'mine'){
					this.$tab.reLaunch('/pages/mine/index')
				}
			},
			
        }
    }
</script>



<style type="text/css" lang="scss" scoped>
    .com_footer{ display: flex;position: fixed;box-sizing: border-box;z-index: 99;width: 100%;height: 100rpx;bottom: 0;left: 0;background-color: #fff;overflow: hidden;box-shadow: 0px 0px 16rpx 0px rgba(87,87,87,0.41);}
	.com_footer .in_item{ display: block;flex: 1;padding: 12rpx 0 0 0;overflow: hidden; }
	.com_footer .in_img{ display: block;width: 44rpx;height: 44rpx;margin: 0 auto; }
	.com_footer .in_txt{ font-size: 26rpx;color: #999;text-align: center; font-weight: bold;}
	.com_footer .in_txt_on{ color: #20AD20; }
	.im_imgs{width: 48rpx;height: 48rpx;display: flex;align-items: center;justify-content: center;margin: 0 auto;}
	.in_img{
		&.imga{width: 38rpx;height: 48rpx;}
		&.imgb{width: 46rpx;height: 48rpx;}
		&.imgc{width: 44rpx;height: 44rpx;}
		&.imgd{width: 48rpx;height: 42rpx;}
	}
</style>