list.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <template>
  2. <view class="content">
  3. <swiper class="top-swiper" autoplay="true" duration="400" interval="5000" @change="swiperChange">
  4. <swiper-item v-for="item in imagelist" class="carousel-item" @click="navTo(item.url)">
  5. <image class="imageitem" :src="item.img" />
  6. </swiper-item>
  7. </swiper>
  8. <view class="nav flex">
  9. <view class="nav-item" v-for="(item,index) in navList" @click="navClick(index)"
  10. :class="{'action': index == currentIndex}">
  11. {{item.title}}
  12. </view>
  13. </view>
  14. <scroll-view scroll-y="true" :style="{'height':height}" class="scroll-wrap">
  15. <view class="kc-item flex" v-for="item in 10">
  16. <image src="" mode="" class="kc-img"></image>
  17. <view class="kc-info">
  18. <view class="info-tit clamp">
  19. 母婴行业必学舞蹈(邓晏老师视频)
  20. </view>
  21. <view class="info-cate clamp">
  22. 技术控必练习
  23. </view>
  24. <view class="info-info flex">
  25. <view class="rs">
  26. 100
  27. </view>
  28. <view class="visit">
  29. 555555
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </scroll-view>
  35. </view>
  36. </template>
  37. <script>
  38. export default {
  39. data() {
  40. return {
  41. height: '',
  42. currentIndex: 0,
  43. navList: [{
  44. title: '全部'
  45. }, {
  46. title: '视频'
  47. },
  48. {
  49. title: '音频'
  50. }
  51. ]
  52. };
  53. },
  54. onLoad(opt) {
  55. },
  56. onShow() {
  57. },
  58. onReady(res) {
  59. var that = this;
  60. uni.getSystemInfo({
  61. success: resu => {
  62. const query = uni.createSelectorQuery();
  63. query.select('.scroll-wrap').boundingClientRect();
  64. query.exec(function(res) {
  65. that.height = resu.windowHeight - res[0].top + 'px';
  66. });
  67. },
  68. fail: res => {}
  69. });
  70. },
  71. onReachBottom() {
  72. },
  73. methods: {
  74. navClick(index) {
  75. this.currentIndex = index
  76. }
  77. }
  78. };
  79. </script>
  80. <style lang="scss" scoped>
  81. .top-swiper {
  82. margin: auto;
  83. width: 750rpx;
  84. height: 392rpx;
  85. padding: 0 $page-row-spacing;
  86. .carousel-item {
  87. border-radius: 20rpx;
  88. .imageitem {
  89. // margin: auto;
  90. width:750rpx;
  91. height:392rpx;
  92. }
  93. }
  94. }
  95. .nav {
  96. width: 750rpx;
  97. height: 88rpx;
  98. margin: 20rpx 0;
  99. .nav-item {
  100. line-height: 88rpx;
  101. width: 50%;
  102. text-align: center;
  103. font-size: 30rpx;
  104. font-weight: 500;
  105. color: #333333;
  106. height: 100%;
  107. }
  108. .action {
  109. font-weight: bold;
  110. color: $base-color;
  111. }
  112. background-color: #fff;
  113. }
  114. .scroll-wrap {
  115. // background-color: red;
  116. }
  117. .kc-item {
  118. // border-bottom: #c8c7cc solid 1px;
  119. padding: 22rpx 0;
  120. justify-content: center;
  121. background-color: #fff;
  122. .kc-img {
  123. flex-shrink: 0;
  124. width: 266rpx;
  125. height: 164rpx;
  126. margin-right: 20rpx;
  127. background-color: #eee;
  128. }
  129. .kc-info {
  130. height: 164rpx;
  131. width: 360rpx;
  132. display: flex;
  133. flex-direction: column;
  134. justify-content: space-between;
  135. align-items: flex-start;
  136. // background-color: red;
  137. .info-tit {
  138. width: 100%;
  139. font-size: 32rpx;
  140. color: #000;
  141. }
  142. .info-cate {
  143. width: 100%;
  144. color: #ff5a97;
  145. font-size: 28rpx;
  146. }
  147. .info-info {
  148. width: 360rpx;
  149. font-size: 24rpx;
  150. .rs {
  151. color: #8f8f94;
  152. }
  153. .visit {
  154. color: $base-color;
  155. }
  156. }
  157. }
  158. }
  159. </style>