index.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <view>
  3. <addressbook v-if="PageCur=='addressbook'"></addressbook>
  4. <!-- <message v-if="PageCur=='message'"></message> -->
  5. <workbench v-if="PageCur=='workbench'"></workbench>
  6. <!-- <apps v-if="PageCur=='apps'"></apps> -->
  7. <person v-if="PageCur=='my'"></person>
  8. <view class="cu-bar tabbar bg-white shadow foot">
  9. <view class="action" @click="NavChange" data-cur="addressbook">
  10. <view :class="PageCur=='addressbook'?'text-blue':'text-gray'">
  11. <text class="lg" :class="PageCur=='addressbook'?'cuIcon-addressbook':'cuIcon-addressbook'"></text>
  12. <text>通讯录</text>
  13. </view>
  14. </view>
  15. <!-- <view class="action" @click="NavChange" data-cur="message">
  16. <view :class="PageCur=='message'?'text-blue':'text-gray'">
  17. <text class="lg" :class="PageCur=='message'?'cuIcon-messagefill':'cuIcon-message'">
  18. <text class='cu-tag badge'>0</text>
  19. </text>
  20. <text>消息</text>
  21. </view>
  22. </view> -->
  23. <view class="action text-gray add-action" @click="NavChange" data-cur="workbench">
  24. <button class="cu-btn shadow"
  25. :class="PageCur=='workbench'?'cuIcon-homefill bg-blue':'cuIcon-home bg-grey'"></button>
  26. 工作台
  27. </view>
  28. <!--
  29. <view class="action" @click="NavChange" data-cur="apps">
  30. <view :class="PageCur=='apps'?'text-blue':'text-gray'">
  31. <text class="lg" :class="PageCur=='apps'?'cuIcon-circlefill':'cuIcon-circle'"></text>
  32. <text>应用</text>
  33. </view>
  34. </view> -->
  35. <view class="action" @click="NavChange" data-cur="my">
  36. <view :class="PageCur=='my'?'text-blue':'text-gray'">
  37. <text class="lg" :class="PageCur=='my'?'cuIcon-profilefill':'cuIcon-profile'"></text>
  38. <text>我的</text>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. </template>
  44. <script>
  45. import addressbook from '@/pages/addressbook/addressbook.vue'
  46. import person from '@/pages/user/person/person.vue'
  47. import message from '@/pages/message/message.vue'
  48. import workbench from '@/pages/workbench/workbench.vue'
  49. import apps from '@/pages/apps/apps.vue'
  50. export default {
  51. components: {
  52. person,
  53. message,
  54. workbench,
  55. apps,
  56. addressbook
  57. },
  58. onShow() {
  59. if(this.PageCur == 'workbench'){
  60. this.PageCur = ''
  61. setTimeout(() => {
  62. this.PageCur = 'workbench'
  63. }, 300)
  64. }
  65. },
  66. data() {
  67. return {
  68. PageCur: 'workbench'
  69. }
  70. },
  71. methods: {
  72. NavChange: function(e) {
  73. this.PageCur = e.currentTarget.dataset.cur
  74. }
  75. }
  76. }
  77. </script>
  78. <style>
  79. .cu-tag.badge {
  80. right: 4px;
  81. }
  82. </style>