金诚优选前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

173 lines
3.6 KiB

  1. <template>
  2. <view>
  3. <lf-nav title="我的报名" :showIcon="true" bgColor="#fff" @changeHeight="e => nav_height = e"></lf-nav>
  4. <view v-if="tab_list.length">
  5. <u-tabs :list="tab_list" active-color="#15716E" inactive-color='#777777' :is-scroll="true" :current="tab_current" @change="tabChange"></u-tabs>
  6. </view>
  7. <swiper :style="{height: autoHeight}" :current="tab_current" @change="swiperChange">
  8. <swiper-item v-for="(item, index) in tab_list" :key="index">
  9. <scroll-view :style="{height: autoHeight}" :scroll-y="true">
  10. <view class="scroll-content">
  11. <view class="card" v-for="(item, index) in 3" :key="index">
  12. <view class="cover">
  13. <image class="img"></image>
  14. <view class="label" :class="'theme-'+ (index+1)">待参加</view>
  15. </view>
  16. <view class="info">
  17. <view class="title">海蓝之谜美颜会 9月15日场10:30</view>
  18. <view class="date">2021.09.01-2021.09.15</view>
  19. </view>
  20. </view>
  21. </view>
  22. <view style="height: 30rpx;"></view>
  23. </scroll-view>
  24. </swiper-item>
  25. </swiper>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. data(){
  31. let _public = {
  32. page: 1,
  33. isPage: true,
  34. loadingClass: true,
  35. loadingText: '正在加载中'
  36. }
  37. return {
  38. tab_current: 0,
  39. tab_list: [{
  40. name: '全部',
  41. list: [],
  42. ..._public
  43. },{
  44. name: '待参加',
  45. list: [],
  46. ..._public
  47. },{
  48. name: '已参加',
  49. list: [],
  50. ..._public
  51. },{
  52. name: '已过期',
  53. list: [],
  54. ..._public
  55. }],
  56. scrollH: 0,
  57. nav_height: 0
  58. }
  59. },
  60. computed: {
  61. autoHeight(){
  62. return `calc(${this.scrollH}px - ${this.nav_height}px - 86rpx)`;
  63. }
  64. },
  65. onLoad(){
  66. let info = uni.getSystemInfoSync();
  67. this.scrollH = info.screenHeight;
  68. },
  69. methods: {
  70. tabChange(event){
  71. this.tab_current = event;
  72. },
  73. swiperChange(event){
  74. this.tab_current = event.detail.current;
  75. }
  76. }
  77. }
  78. </script>
  79. <style lang="scss" scoped="scoped">
  80. .scroll-content{
  81. width: 100%;
  82. display: flex;
  83. flex-wrap: wrap;
  84. justify-content: center;
  85. .card{
  86. width: 686rpx;
  87. height: max-content;
  88. background-color: #FFFFFF;
  89. box-shadow: 1rpx 1rpx 6rpx 3rpx #e5e5e5;
  90. margin-top: 30rpx;
  91. border-radius: 20rpx;
  92. overflow: hidden;
  93. .cover{
  94. width: 686rpx;
  95. height: 300rpx;
  96. position: relative;
  97. .img{
  98. width: 100%;
  99. height: 100%;
  100. background-color: #EEEEEE;
  101. }
  102. .label{
  103. position: absolute;
  104. top: 0;
  105. left: 0;
  106. width: 118rpx;
  107. height: 57rpx;
  108. border-radius: 20rpx 0rpx 20rpx 0rpx;
  109. text-align: center;
  110. line-height: 57rpx;
  111. color: #FFFFFF;
  112. font-size: 26rpx;
  113. }
  114. }
  115. .info{
  116. width: 686rpx;
  117. height: max-content;
  118. padding: 20rpx 30rpx;
  119. box-sizing: border-box;
  120. .title{
  121. font-size: 28rpx;
  122. color: #222222;
  123. font-weight: bold;
  124. }
  125. .date{
  126. margin-top: 20rpx;
  127. font-size: 24rpx;
  128. color: #555555;
  129. }
  130. }
  131. }
  132. }
  133. .theme-1{
  134. background-color: #15716E;
  135. }
  136. .theme-2{
  137. background-color: #1789E4;
  138. }
  139. .theme-3{
  140. background-color: #777777;
  141. }
  142. // tabs 样式修改
  143. /deep/.u-scroll-box {
  144. display: flex;
  145. justify-content: center;
  146. align-items: center;
  147. border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
  148. }
  149. /deep/.u-scroll-box .u-tab-bar {
  150. background-color: #15716E!important;
  151. width: 80rpx!important;
  152. position: absolute;
  153. left: 0;
  154. bottom: -12rpx;
  155. }
  156. /deep/.special_tab .u-tabs .u-scroll-box .u-tab-bar {
  157. background-color: #15716E!important;
  158. width: 56rpx!important;
  159. position: absolute;
  160. height: 5rpx!important;
  161. left: 8rpx;
  162. bottom: -4rpx;
  163. }
  164. /deep/ .u-tab-item {
  165. font-size: 28rpx!important;
  166. }
  167. </style>