index.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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>
  30. </template>
  31. <script>
  32. import home from "./modules/home.vue";
  33. import myMap from "./modules/my-map.vue";
  34. import message from "./modules/message.vue";
  35. import mine from "./modules/mine.vue";
  36. import tabControl from "../../components/bottomTabControl.vue";
  37. export default {
  38. components: { home, myMap, message, mine, tabControl },
  39. data() {
  40. return {
  41. PageCur: "Home",
  42. }
  43. },
  44. methods: {
  45. opentabControl(active) {
  46. if (this.$refs.tabControl.active !== active) this.$nextTick(() => this.$refs.tabControl.active = active);
  47. }
  48. }
  49. }
  50. </script>
  51. <style lang="scss" scoped></style>