footer.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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&&checkPermi([item.limit]))||!item.limit" @click="gotopage(item)">
  7. <view class="in_imgs">
  8. <image :class="item.imgtype" v-if="active == item.module" :src="item.icon_checked" mode="scaleToFill"></image>
  9. <image :class="item.imgtype" 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 api from '../../api/api.js'
  20. import {checkPermi,checkRole} from "@/utils/permission"; // 权限判断函数
  21. export default {
  22. props:[
  23. 'footlist',
  24. 'footerindex',
  25. 'color_checked',
  26. 'color_nochecked',
  27. 'isHomeIndex'
  28. ],
  29. data () {
  30. return{
  31. active :'',
  32. }
  33. },
  34. mounted() {
  35. var that = this;
  36. this.active = this.footerindex;
  37. },
  38. methods:{
  39. checkPermi,checkRole,
  40. // 跳转底部导航页面
  41. gotopage(e){
  42. var that = this;
  43. let link = e.link, module = e.module, def = e.default, title = e.title;
  44. if(module == 'home'){
  45. this.$tab.reLaunch('/pages/index')
  46. }else if(module == 'mine'){
  47. this.$tab.reLaunch('/pages/mine/index')
  48. }else if(module == 'news'){
  49. this.$tab.reLaunch('/pages/news/index')
  50. }
  51. },
  52. }
  53. }
  54. </script>
  55. <style lang="scss" scoped>
  56. .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);
  57. .in_item{ display: block;flex: 1;padding: 12rpx 0 0 0;overflow: hidden; }
  58. .in_imgs{ display: block;width: 48rpx;height: 48rpx;margin: 0 auto; display: flex;align-items: center;justify-content: center;
  59. .img1{width: 32rpx;height: 46rpx;}
  60. .img2{width: 36rpx;height: 38rpx;}
  61. .img3{width: 40rpx;height: 48rpx;}
  62. }
  63. .in_txt{ font-size: 22rpx;color: #999;text-align: center; font-weight: bold;}
  64. .in_txt_on{ color: #20AD20; }
  65. }
  66. </style>