footer.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. <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 api from '../../api/api.js'
  18. import {checkPermi,checkRole} from "@/utils/permission"; // 权限判断函数
  19. export default {
  20. props:[
  21. 'footlist',
  22. 'footerindex',
  23. 'color_checked',
  24. 'color_nochecked',
  25. 'isHomeIndex'
  26. ],
  27. data () {
  28. return{
  29. active :'',
  30. }
  31. },
  32. mounted() {
  33. var that = this;
  34. this.active = this.footerindex;
  35. },
  36. methods:{
  37. checkPermi,checkRole,
  38. // 跳转底部导航页面
  39. gotopage(e){
  40. var that = this;
  41. let link = e.link, module = e.module, def = e.default, title = e.title;
  42. if(module == 'home'){
  43. this.$tab.reLaunch('/pages/index/index')
  44. }else if(module == 'mine'){
  45. this.$tab.reLaunch('/pages/mine/index')
  46. }else if(module == 'work'){
  47. this.$tab.reLaunch('/pages/work/index')
  48. }else if(module == 'trends'){
  49. this.$tab.reLaunch('/pages/trends/index')
  50. }else if(module == 'road'){
  51. this.$tab.reLaunch('/pages/road/index')
  52. }
  53. },
  54. }
  55. }
  56. </script>
  57. <style type="text/css">
  58. .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);}
  59. .com_footer .in_item{ display: block;flex: 1;padding: 12rpx 0 0 0;overflow: hidden; }
  60. .com_footer .in_img{ display: block;width: 44rpx;height: 44rpx;margin: 0 auto; }
  61. .com_footer .in_txt{ font-size: 26rpx;color: #999;text-align: center; font-weight: bold;}
  62. .com_footer .in_txt_on{ color: #20AD20; }
  63. </style>