market.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <view class="market-box">
  3. <view class="market-tab">
  4. <view v-for="(item , index) in marketTab"
  5. :class="['market-tab-item' , index === marketTabIndex ? 'active-tab-item' : '' ]"
  6. @click.stop="marketTabIndex = index">
  7. {{ item }}
  8. </view>
  9. </view>
  10. <swiper :duration="150" class="market-content" :current="marketTabIndex">
  11. <swiper-item>
  12. <scroll-view class="market-scroll" scroll-y>
  13. <add-optional ref="addOptionalRef" />
  14. </scroll-view>
  15. </swiper-item>
  16. <swiper-item>
  17. <scroll-view class="market-scroll" scroll-y>
  18. <marketplace ref="marketplaceRef" />
  19. </scroll-view>
  20. </swiper-item>
  21. </swiper>
  22. </view>
  23. </template>
  24. <script>
  25. export default {
  26. name: "marketModules",
  27. data() {
  28. return {
  29. marketTabIndex: 1,
  30. marketTab: [
  31. '自选',
  32. '市场'
  33. ]
  34. };
  35. }
  36. }
  37. </script>
  38. <style lang="scss" scoped>
  39. .market-box {
  40. width: 100%;
  41. height: 90vh;
  42. background-color: $modules-box-bg;
  43. .market-tab {
  44. padding: 0 $pages-padding ;
  45. width: 100%;
  46. height: 114rpx;
  47. display: flex;
  48. align-items: center;
  49. .market-tab-item {
  50. font-size: 28rpx;
  51. font-family: PingFang SC, PingFang SC-Bold;
  52. font-weight: 700;
  53. color: #1a1a1a;
  54. line-height: 40rpx;
  55. letter-spacing: 0.6rpx;
  56. +.market-tab-item {
  57. margin-left: 50rpx;
  58. }
  59. }
  60. .active-tab-item {
  61. font-size: 30rpx;
  62. color: #20B482;
  63. position: relative;
  64. &::before {
  65. position: absolute;
  66. left: 50%;
  67. transform: translateX(-50%);
  68. bottom: -20rpx;
  69. content: '';
  70. width: 80%;
  71. height: 3px;
  72. border-radius: 2px;
  73. background-color: #20B482;
  74. }
  75. }
  76. }
  77. .market-content {
  78. width: 100%;
  79. height: calc(100% - 104rpx);
  80. .market-scroll {
  81. width: 100%;
  82. height: 100%;
  83. }
  84. }
  85. }
  86. </style>