footer.vue 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <view>
  3. <!-- <view style="height: 150rpx;"></view> -->
  4. <view class="footbg">
  5. <view class="com_footer">
  6. <block v-for="(item,k) in footlist" :key="k">
  7. <!-- v-if="!item.limit||item.limit&&checkPermi([item.limit])" -->
  8. <view class="in_item" @click="gotopage(item)">
  9. <view class="im_imgs">
  10. <image class="in_img" :class="item.img" v-if="active == item.module" :src="item.icon_checked" mode="scaleToFill"></image>
  11. <image class="in_img" :class="item.img" v-else :src="item.icon_nochecked" mode="scaleToFill"></image>
  12. </view>
  13. <view class="in_txt" v-if="active == item.module" :style="'color: #'+color_checked">{{item.title}}</view>
  14. <view class="in_txt" v-else :style="'color: #'+color_nochecked">{{item.title}}</view>
  15. </view>
  16. </block>
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. import { checkPermi, checkRole } from "@/utils/permission";
  23. export default {
  24. props:[
  25. 'footerindex'
  26. ],
  27. data () {
  28. return{
  29. active :'',
  30. footlist:[
  31. // limit:'system:camera:video',
  32. {module:'home',title:'首页',img:"imga",icon_checked:require('@/static/images/tabbar/home_.png'),icon_nochecked:require('@/static/images/tabbar/home.png')},
  33. {module:'mine',title:'我的',img:"imga",icon_checked:require('@/static/images/tabbar/mine_.png'),icon_nochecked:require('@/static/images/tabbar/mine.png')},
  34. ],
  35. color_checked :'2B73FF',
  36. color_nochecked :'838383',
  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 == 'mine'){
  52. this.$tab.reLaunch('/pages/mine/index')
  53. }
  54. },
  55. }
  56. }
  57. </script>
  58. <style type="text/css" lang="scss" scoped>
  59. // background: #E2EDFF;
  60. .footbg{position: fixed;z-index: 4;bottom: 0;left: 0;right: 0;padding: 20rpx 172rpx 30rpx;display: flex;align-items: center;justify-content: center;}
  61. .com_footer{ display: flex;box-sizing: border-box;background-color: #fff;box-shadow: 0px 0px 16rpx 4rpx #D2DFF3;height: 100rpx;border-radius: 50rpx;flex: 1;
  62. .in_item{ display: block;flex: 1;padding: 12rpx 0 0 0;overflow: hidden; }
  63. .in_txt{ font-size: 20rpx;color: #838383;text-align: center; font-weight: bold;}
  64. }
  65. .im_imgs{width: 48rpx;height: 48rpx;display: flex;align-items: center;justify-content: center;margin: 0 auto 2rpx;}
  66. .in_img{
  67. &.imga{width: 48rpx;height: 46rpx;}
  68. }
  69. </style>