footer.vue 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <view>
  3. <view style="height: 100rpx;"></view>
  4. <view class="com_footer">
  5. <block v-for="(item,k) in footlist" :key="k" >
  6. <view class="in_item" v-if="!item.limit||item.limit&&checkPermi([item.limit])" @click="gotopage(item)">
  7. <view class="im_imgs">
  8. <image class="in_img" :class="item.img" v-if="active == item.module" :src="item.icon_checked" mode="scaleToFill"></image>
  9. <image class="in_img" :class="item.img" v-else :src="item.icon_nochecked" mode="scaleToFill"></image>
  10. </view>
  11. <view class="in_txt" v-if="active == item.module" :style="'color: #'+color_checked">{{item.title}}</view>
  12. <view class="in_txt" v-else :style="'color: #'+color_nochecked">{{item.title}}</view>
  13. </view>
  14. </block>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  20. // import api from '../../api/api.js'
  21. // import plugins from '../../commen/js/plugin.js'
  22. export default {
  23. props:[
  24. // 'footlist',
  25. // 'color_checked',
  26. // 'color_nochecked',
  27. 'footerindex',
  28. 'isHomeIndex'
  29. ],
  30. data () {
  31. return{
  32. active :'',
  33. footlist:[
  34. {module:'home',title:'潜山政协',img:"imga",icon_checked:require('@/static/images/tabbar/home_.png'),icon_nochecked:require('@/static/images/tabbar/home.png')},
  35. {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"},
  36. {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"},
  37. {module:'mine',title:'个人中心',img:"imgd",icon_checked:require('@/static/images/tabbar/mine_.png'),icon_nochecked:require('@/static/images/tabbar/mine.png')},
  38. ],
  39. color_checked :'222327',
  40. color_nochecked :'AAAAAA',
  41. }
  42. },
  43. mounted() {
  44. var that = this;
  45. this.active = this.footerindex;
  46. },
  47. methods:{
  48. checkPermi, checkRole,
  49. // 跳转底部导航页面
  50. gotopage(e){
  51. var that = this;
  52. let link = e.link, module = e.module, def = e.default, title = e.title;
  53. if(module == 'home'){
  54. this.$tab.reLaunch('/pages/index/index')
  55. }else if(module == 'report'){
  56. var id=this.$store.state.user.userId
  57. this.$tab.reLaunch('/pages/report/index?id='+id)
  58. }else if(module == 'notice'){
  59. this.$tab.reLaunch('/pages/notice/index')
  60. }else if(module == 'mine'){
  61. this.$tab.reLaunch('/pages/mine/index')
  62. }
  63. },
  64. }
  65. }
  66. </script>
  67. <style type="text/css" lang="scss" scoped>
  68. .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);}
  69. .com_footer .in_item{ display: block;flex: 1;padding: 12rpx 0 0 0;overflow: hidden; }
  70. .com_footer .in_img{ display: block;width: 44rpx;height: 44rpx;margin: 0 auto; }
  71. .com_footer .in_txt{ font-size: 26rpx;color: #999;text-align: center; font-weight: bold;}
  72. .com_footer .in_txt_on{ color: #20AD20; }
  73. .im_imgs{width: 48rpx;height: 48rpx;display: flex;align-items: center;justify-content: center;margin: 0 auto;}
  74. .in_img{
  75. &.imga{width: 38rpx;height: 48rpx;}
  76. &.imgb{width: 46rpx;height: 48rpx;}
  77. &.imgc{width: 44rpx;height: 44rpx;}
  78. &.imgd{width: 48rpx;height: 42rpx;}
  79. }
  80. </style>