footer.vue 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. export default {
  21. props:[
  22. // 'footlist',
  23. // 'color_checked',
  24. // 'color_nochecked',
  25. 'footerindex',
  26. // 'isHomeIndex'
  27. ],
  28. data () {
  29. return{
  30. active :'',
  31. footlist:[
  32. {module:'home',title:'首页',img:"imga",icon_checked:require('@/static/images/tabbar/home_.png'),icon_nochecked:require('@/static/images/tabbar/home.png')},
  33. {module:'work',title:'业务',img:"imgb",icon_checked:require('@/static/images/tabbar/work_.png'),icon_nochecked:require('@/static/images/tabbar/work.png')},
  34. {module:'custom',title:'客户',img:"imgc",icon_checked:require('@/static/images/tabbar/custom_.png'),icon_nochecked:require('@/static/images/tabbar/custom.png'),limit:'idcard:idcard:list'},
  35. {module:'mine',title:'我的',img:"imga",icon_checked:require('@/static/images/tabbar/mine_.png'),icon_nochecked:require('@/static/images/tabbar/mine.png')},
  36. ],
  37. color_checked :'00A9F0',
  38. color_nochecked :'AAAAAA',
  39. }
  40. },
  41. mounted() {
  42. var that = this;
  43. this.active = this.footerindex;
  44. },
  45. methods:{
  46. checkPermi, checkRole,
  47. // 跳转底部导航页面
  48. gotopage(e){
  49. var that = this;
  50. let link = e.link, module = e.module, def = e.default, title = e.title;
  51. if(module == 'home'){
  52. this.$tab.reLaunch('/pages/index/index')
  53. }else if(module == 'work'){
  54. this.$tab.reLaunch('/pages/work/index')
  55. }else if(module == 'custom'){
  56. this.$tab.reLaunch('/pages/custom/index')
  57. }else if(module == 'mine'){
  58. this.$tab.reLaunch('/pages/mine/index')
  59. }
  60. },
  61. }
  62. }
  63. </script>
  64. <style type="text/css" lang="scss" scoped>
  65. .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);}
  66. .com_footer .in_item{ display: block;flex: 1;padding: 12rpx 0 0 0;overflow: hidden; }
  67. .com_footer .in_img{ display: block;width: 44rpx;height: 44rpx;margin: 0 auto; }
  68. .com_footer .in_txt{ font-size: 26rpx;color: #999;text-align: center; font-weight: bold;}
  69. .com_footer .in_txt_on{ color: #20AD20; }
  70. .im_imgs{width: 48rpx;height: 48rpx;display: flex;align-items: center;justify-content: center;margin: 0 auto;}
  71. .in_img{
  72. &.imga{width: 40rpx;height: 40rpx;}
  73. &.imgb{width: 42rpx;height: 40rpx;}
  74. &.imgc{width: 38rpx;height: 40rpx;}
  75. }
  76. </style>