sell-quickly-list.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <template>
  2. <view class="bg-white margin radius">
  3. <view class="grid col-4 padding zaiui-sell-quickly-box">
  4. <view class="live-box">
  5. <view class="text-black text-lg text-bold">省心快卖</view>
  6. <view class="cu-tag bg-red round text-center margin-tb-xs">
  7. <text>立即开卖</text>
  8. <text class="cuIcon-right text-xs"></text>
  9. </view>
  10. <!--赚钱滚动信息-->
  11. <view class="user-list-box">
  12. <swiper class="swiper" disable-touch :touchable="false" autoplay circular vertical
  13. previous-margin="23.5upx" next-margin="23.5upx" interval="1000" :current="indexs" @animationfinish="earnSwiper">
  14. <swiper-item v-for="(item,index) in ListData.swiper" :key="index">
  15. <view class="swiper-padding">
  16. <view class="flex flex-wrap swiper-item" :class="index == indexs?'show':''">
  17. <view class="basis-xs">
  18. <image class="img" :src="item.img" mode="widthFix"/>
  19. </view>
  20. <view class="basis-xl text-cut">
  21. <text class="text-xs">{{item.text}}</text>
  22. </view>
  23. </view>
  24. </view>
  25. </swiper-item>
  26. </swiper>
  27. </view>
  28. </view>
  29. <block v-for="(item,index) in ListData.list" :key="index" v-if="index < 3">
  30. <view class="live-box text-center zaiui-sell-quickly-list" @tap="listTap(item,index)">
  31. <image class="img" :src="item.img" mode="widthFix"/>
  32. <view class="text-black">{{item.title}}</view>
  33. <view class="text-xs text-gray text-cut">{{item.text}}</view>
  34. </view>
  35. </block>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. import _tool from '@/static/zaiui/util/tools.js';
  41. export default {
  42. name: 'sell-quickly-list',
  43. data() {
  44. return {
  45. ListData: { swiper: [], list: [] }, indexs: 0,
  46. };
  47. },
  48. props: {
  49. list_data: {
  50. type: Object,
  51. default: () => {
  52. return {}
  53. }
  54. }
  55. },
  56. created() {
  57. this.ListData = this.list_data;
  58. },
  59. watch: {
  60. list_data() {
  61. this.ListData = this.list_data;
  62. }
  63. },
  64. methods: {
  65. earnSwiper(e) {
  66. this.indexs = e.detail.current;
  67. },
  68. listTap(data,index) {
  69. this.$emit('listTap', {
  70. data,
  71. index
  72. });
  73. }
  74. }
  75. }
  76. </script>
  77. <style lang="scss" scoped>
  78. .zaiui-sell-quickly-box {
  79. .live-box {
  80. position: relative;
  81. .flex-wrap {
  82. background-color: #FAFAFA;
  83. border-radius: 16upx 16upx;
  84. .basis-xs {
  85. flex-basis: 30%;
  86. width: 30%;
  87. .img {
  88. width: 100%;
  89. border-radius: 25%;
  90. }
  91. }
  92. .basis-xl {
  93. flex-basis: 70%;
  94. width: 70%;
  95. }
  96. }
  97. }
  98. .user-list-box {
  99. .swiper {
  100. height: 92upx;
  101. swiper-item {
  102. height: 46upx !important;
  103. .swiper-padding {
  104. padding: 4upx 0;
  105. }
  106. .swiper-item {
  107. border-radius: 37upx 37upx;
  108. opacity: .5;
  109. transition: opacity .2s;
  110. .img {
  111. width: 37upx !important;
  112. border-radius: 100% !important;
  113. }
  114. .basis-xs {
  115. flex-basis: 24%;
  116. width: 24%;
  117. }
  118. .basis-xl {
  119. line-height: 37upx;
  120. flex-basis: 76%;
  121. width: 76%;
  122. text {
  123. color: #838383;
  124. margin-left: 6upx;
  125. }
  126. }
  127. }
  128. .swiper-item.show {
  129. opacity: 1;
  130. transition: opacity .2s;
  131. }
  132. }
  133. }
  134. }
  135. .zaiui-sell-quickly-list {
  136. .img {
  137. width: 101upx;
  138. }
  139. }
  140. }
  141. </style>