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