foot.vue 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <view class="gui-flex gui-rows gui-nowrap gui-space-between gui-align-items-end" style="height:150rpx;">
  3. <view class="gui-footer-icon-buttons" @tap="menu(0)">
  4. <text class="gui-footer-icon-buttons-icon gui-block-text gui-icons"
  5. :class="[cur == 0 ? 'gui-nav-bottom-active-color' : 'gui-nav-bottom-color']">&#xe608;</text>
  6. <text class="gui-footer-icon-buttons-text gui-block-text gui-nav-bottom-color"
  7. :class="[cur == 0 ? 'gui-nav-bottom-active-color' : 'gui-nav-bottom-color']">首页</text>
  8. </view>
  9. <view class="gui-footer-icon-buttons" @tap="menu(1)">
  10. <text class="gui-footer-icon-buttons-icon gui-block-text gui-icons"
  11. :class="[cur == 1 ? 'gui-nav-bottom-active-color' : 'gui-nav-bottom-color']">&#xe624;</text>
  12. <text class="gui-footer-icon-buttons-text gui-block-text gui-nav-bottom-color"
  13. :class="[cur == 1 ? 'gui-nav-bottom-active-color' : 'gui-nav-bottom-color']">头条</text>
  14. </view>
  15. <!-- 凸出按钮占位 普通按钮 实现下面的 gui-footer-icon-buttons 即可 -->
  16. <view class="gui-footer-icon-buttons"></view>
  17. <view class="gui-footer-icon-buttons" @tap="menu(3)">
  18. <text class="gui-footer-icon-buttons-icon gui-block-text gui-icons"
  19. :class="[cur == 3 ? 'gui-nav-bottom-active-color' : 'gui-nav-bottom-color']">&#xe6b8;</text>
  20. <text class="gui-footer-icon-buttons-text gui-block-text"
  21. :class="[cur == 3 ? 'gui-nav-bottom-active-color' : 'gui-nav-bottom-color']">消息</text>
  22. </view>
  23. <view class="gui-footer-icon-buttons" @tap="menu(4)">
  24. <text class="gui-footer-icon-buttons-icon gui-block-text gui-icons"
  25. :class="[cur == 4 ? 'gui-nav-bottom-active-color' : 'gui-nav-bottom-color']">&#xe6fe;</text>
  26. <text class="gui-footer-icon-buttons-text gui-block-text"
  27. :class="[cur == 4 ? 'gui-nav-bottom-active-color' : 'gui-nav-bottom-color']">我的</text>
  28. </view>
  29. <!-- 使用定位方式实现凸出按钮 -->
  30. <view class="gui-footer-buttons-ab" @tap="menu(2)">
  31. <text class="gui-footer-buttons-ab-icon gui-block-text gui-icons"
  32. :class="[cur == 2 ? 'gui-nav-bottom-active-color' : 'gui-nav-bottom-color']">&#xe612;</text>
  33. <text class="gui-footer-icon-buttons-text gui-block-text"
  34. :class="[cur == 2 ? 'gui-nav-bottom-active-color' : 'gui-nav-bottom-color']">合小记</text>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. export default {
  40. props: {
  41. value : {
  42. type : Number,
  43. value : 0
  44. },
  45. },
  46. data() {
  47. return {
  48. cur : 0,
  49. }
  50. },
  51. mounted() {
  52. this.cur = this.value;
  53. },
  54. methods: {
  55. menu : function (index) {
  56. this.cur = index;
  57. if (index == 0) {
  58. this.Dever.location('index/index');
  59. } else if (index == 1) {
  60. this.Dever.location('index/news');
  61. } else if (index == 2) {
  62. this.Dever.location('index/list');
  63. } else if (index == 3) {
  64. this.Dever.location('index/msg');
  65. } else if (index == 4) {
  66. this.Dever.location('index/my');
  67. }
  68. }
  69. }
  70. }
  71. </script>
  72. <style>
  73. view {
  74. box-sizing: unset;
  75. }
  76. .gui-footer-icon-buttons{width:130rpx; height:80rpx; padding:10rpx; flex:1; position:relative; margin:0; background-color:#F8F8F8;}
  77. .gui-footer-buttons-ab{position:absolute; z-index:101; left:325rpx; top:0rpx; width:110rpx; height:150rpx;}
  78. .gui-footer-buttons-ab-icon{width:110rpx; height:110rpx; line-height:120rpx; text-align:center; font-size:68rpx; background-color:#F7F8FA; border-radius:100rpx;}
  79. </style>