footer.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. <image class="in_img" v-if="active == item.module" :src="item.icon_checked" mode="scaleToFill"></image>
  8. <image class="in_img" v-else :src="item.icon_nochecked" mode="scaleToFill"></image>
  9. <view class="in_txt" v-if="active == item.module" :style="'color: #'+color_checked">{{item.title}}</view>
  10. <view class="in_txt" v-else :style="'color: #'+color_nochecked">{{item.title}}</view>
  11. </view>
  12. </block>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. import { checkPermi, checkRole } from "@/utils/permission";
  18. export default {
  19. props:[
  20. 'footerindex'
  21. ],
  22. data () {
  23. return{
  24. active :'',
  25. footlist:[
  26. // limit:'system:camera:video',
  27. {module:'home',title:'首页',img:"imga",icon_checked:require('@/static/images/tabbar/home_.png'),icon_nochecked:require('@/static/images/tabbar/home.png')},
  28. {module:'video',title:'门禁',img:"imgb",icon_checked:require('@/static/images/tabbar/video_.png'),icon_nochecked:require('@/static/images/tabbar/video.png'),limit:'system:camera:video'},
  29. {module:'mine',title:'我的',img:"imga",icon_checked:require('@/static/images/tabbar/mine_.png'),icon_nochecked:require('@/static/images/tabbar/mine.png')},
  30. ],
  31. color_checked :'161616',
  32. color_nochecked :'666666',
  33. }
  34. },
  35. mounted() {
  36. var that = this;
  37. this.active = this.footerindex;
  38. },
  39. methods:{
  40. checkPermi, checkRole,
  41. // 跳转底部导航页面
  42. gotopage(e){
  43. var that = this;
  44. let link = e.link, module = e.module, def = e.default, title = e.title;
  45. if(module == 'home'){
  46. this.$tab.reLaunch('/pages/index/index')
  47. }else if(module == 'video'){
  48. this.$tab.reLaunch('/pages/video/index')
  49. }else if(module == 'mine'){
  50. this.$tab.reLaunch('/pages/mine/index')
  51. }
  52. },
  53. }
  54. }
  55. </script>
  56. <style type="text/css">
  57. .com_footer{ display: flex;position: fixed;box-sizing: border-box;z-index: 98;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);}
  58. .com_footer .in_item{ display: block;flex: 1;padding: 12rpx 0 0 0;overflow: hidden; }
  59. .com_footer .in_img{ display: block;width: 44rpx;height: 44rpx;margin: 0 auto; }
  60. .com_footer .in_txt{ font-size: 26rpx;color: #999;text-align: center; font-weight: bold;}
  61. .com_footer .in_txt_on{ color: #20AD20; }
  62. </style>