index.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <view class="container">
  3. <tab-control ref="tabControl" :active='opentabControl' />
  4. <home v-show="PageCur == 'Home'" />
  5. <my-map v-show="PageCur == 'Map'" />
  6. <message v-show="PageCur == 'Message'" />
  7. <mine v-show="PageCur == 'Mine'" />
  8. <view class="cu-bar tabbar bg-white foot" style="z-index: 100000;" @click="opentabControl(false)">
  9. <!-- bg-black -->
  10. <view @click="PageCur = 'Home'" :class="PageCur == 'Home' ? 'action pitch-on-color' : 'action text-gray'">
  11. <view class="iconfont" :class="PageCur == 'Home' ? 'icon-shouye-xuanzhong' : 'icon-shouye-weixuanzhong'" />
  12. 首页
  13. </view>
  14. <view @click="PageCur = 'Map'" :class="PageCur == 'Map' ? 'action pitch-on-color' : 'action text-gray'">
  15. <view class="iconfont" :class="PageCur == 'Map' ? 'icon-ditu-xuanzhong' : 'icon-ditu-weixuanzhong'" /> 地图
  16. </view>
  17. <view class="text-gray" @click.stop="opentabControl(true)">
  18. <button class="cu-btn cuIcon-add shadow more" style="background-color:#0B3F7E;color: #fff;"></button>
  19. </view>
  20. <view @click="PageCur = 'Message'" :class="PageCur == 'Message' ? 'action pitch-on-color' : 'action text-gray'">
  21. <view class="iconfont" :class="PageCur == 'Message' ? 'icon-xiaoxi-xuanzhong' : 'icon-xiaoxi-weixuanzhong'">
  22. <view class="cu-tag badge">99</view>
  23. </view> 消息
  24. </view>
  25. <view @click="PageCur = 'Mine'" :class="PageCur == 'Mine' ? 'action pitch-on-color' : 'action text-gray'">
  26. <view class="iconfont" :class="PageCur == 'Mine' ? 'icon-wode-xuanzhong' : 'icon-wode-weixuanzhong'" /> 我的
  27. </view>
  28. </view>
  29. <!-- <view style="height: calc(62px + env(safe-area-inset-bottom) / 2);" /> -->
  30. </view>
  31. </template>
  32. <script>
  33. import home from "./modules/home.vue";
  34. import myMap from "./modules/my-map.vue";
  35. import message from "./modules/message.vue";
  36. import mine from "./modules/mine.vue";
  37. import tabControl from "../../components/bottomTabControl.vue";
  38. export default {
  39. components: { home, myMap, message, mine, tabControl },
  40. data() {
  41. return {
  42. PageCur: "Home",
  43. }
  44. },
  45. methods: {
  46. opentabControl(active) {
  47. if (this.$refs.tabControl.active !== active) this.$nextTick(() => {
  48. this.$refs.tabControl.active = active;
  49. });
  50. }
  51. }
  52. }
  53. </script>
  54. <style lang="scss">
  55. .action .iconfont {
  56. width: 52px;
  57. position: relative;
  58. display: block;
  59. height: auto;
  60. margin: 0 auto 5px;
  61. text-align: center;
  62. font-size: 20px;
  63. }
  64. .pitch-on-color {
  65. color: #0B3F7E;
  66. }
  67. .more {
  68. height: 40px !important;
  69. font-size: 25px !important;
  70. }
  71. </style>