index.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <Theme>
  3. <view class="wrap">
  4. <Navbar leftShow fixed bgColor="transparent">
  5. <template #center>
  6. <view class="nav_center">
  7. <view class="nav_tab">
  8. <view class="tab_list" :class="tabActive == index ? 'active' : ''" v-for="item, index in tab" :key="index"
  9. @click="tabClick(index)">
  10. <trans :_t="item.text" />
  11. </view>
  12. </view>
  13. <up-icon name="search" class="search" size="56rpx" color="var(--bg)"></up-icon>
  14. </view>
  15. </template>
  16. </Navbar>
  17. <view class="content">
  18. <playVideo />
  19. </view>
  20. </view>
  21. <Tabbar page="community" />
  22. </Theme>
  23. </template>
  24. <script setup>
  25. import { ref, reactive, computed, onMounted, nextTick } from "vue";
  26. import Tabbar from '@/components/tabbar';
  27. import navMenu from '@/components/nav_menu';
  28. import Navbar from '@/components/navbar';
  29. import playVideo from "@/components/play";
  30. const tabActive = ref(2);
  31. const tab = [
  32. // {
  33. // text: '直播'
  34. // },
  35. {
  36. text: '关注'
  37. }, {
  38. text: '精选'
  39. }, {
  40. text: '推荐'
  41. }]
  42. const tabClick = (index) => {
  43. tabActive.value = index;
  44. }
  45. uni.hideTabBar();
  46. </script>
  47. <style lang="less" scoped>
  48. @import url('@/style.less');
  49. .wrap {
  50. min-height: calc(100vh - 50px);
  51. background-color: var(--black);
  52. .nav_center {
  53. height: inherit;
  54. padding: 0 30rpx;
  55. .ver();
  56. .search {
  57. position: fixed;
  58. right: 40rpx;
  59. top: 20rpx
  60. }
  61. .nav_tab {
  62. .ver();
  63. gap: 30rpx;
  64. color: var(--light);
  65. }
  66. .active {
  67. position: relative;
  68. &::before {
  69. position: absolute;
  70. content: '';
  71. left: 50%;
  72. bottom: -2px;
  73. width: 70%;
  74. transform: translateX(-50%);
  75. height: 2px;
  76. border-radius: 100px;
  77. background-color: var(--light);
  78. }
  79. }
  80. }
  81. .content {
  82. // padding: 16rpx 32rpx;
  83. margin-top: -44px;
  84. }
  85. }
  86. </style>