specialProduct.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <template>
  2. <view class="special-content clearfix">
  3. <view class="swiper-banner-title">商品专题</view>
  4. <view class="swiper-banner-box" >
  5. <swiper class="tui-banner-swiper tui-banner tui-skeleton-fillet" :autoplay="true" :interval="5000" :duration="500" @change="swiperChange" :circular="true">
  6. <swiper-item v-for="(item,index) in listArray" :key="index">
  7. <image :src="item.image" class="tui-slide-image" mode="scaleToFill"/>
  8. </swiper-item>
  9. </swiper>
  10. <view class="swiper__dots-box" v-if="listArray.length > 1">
  11. <view v-for="(item,idx) in listArray"
  12. :key="idx"
  13. :class="[idx===current?'swiper__dots-long':'none']"
  14. :data-index="current" class="swiper__dots-item">
  15. </view>
  16. </view>
  17. </view>
  18. <view class="swiper-goods-box">
  19. <view class="goods-box-item" v-for="(item,index) in goodArray" :key="index">
  20. <image :src="item.image" mode="" class="box-item-image"></image>
  21. <view class="box-item-mask">{{ item.title }}</view>
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. export default{
  28. name:"specialContent",
  29. props:{
  30. list:{
  31. type:Array
  32. }
  33. },
  34. data() {
  35. return{
  36. current:0,
  37. listArray:[
  38. {image:'https://m.360buyimg.com/mobilecms/s700x280_jfs/t1/114550/12/7437/102254/5ec3971fE78db18f4/438d4775f9d653ee.jpg!q70.jpg.dpg'},
  39. {image:'https://m.360buyimg.com/mobilecms/s700x280_jfs/t1/126187/19/17323/149042/5fa13ef1E6bc65f5b/8fbecafdbf0e4736.jpg!q70.jpg.dpg'},
  40. {image:'https://m.360buyimg.com/mobilecms/s700x280_jfs/t1/126522/38/16493/151268/5f9940bfE9bf4ce43/b9a09e36102a9667.jpg!q70.jpg.dpg'}
  41. ],
  42. goodArray:[
  43. {image:'https://img.caimei365.com/group1/M00/03/A2/Cmis2F8VTz2AIH2JAAIDFdpGDsE352.jpg',title:'优斐斯术后护理产品搭配应用'},
  44. {image:'https://img.caimei365.com/group1/M00/03/5B/Cmis2F1bq0yATM6SAAEcNkc0bwk054.jpg',title:'肌本演绎·动能精华素'},
  45. {image:'https://img.caimei365.com/group1/M00/03/BF/Cmis2F-GZJOAdquJAADIHkLdHVE324.jpg',title:'科医人第六代王者之冠M22'},
  46. {image:'https://img.caimei365.com/group1/M00/03/38/Cmis21yweGSAdSCdAADddSdkc1E158.jpg',title:'赛诺龙360'},
  47. ]
  48. }
  49. },
  50. created(){
  51. },
  52. computed: {
  53. },
  54. methods:{
  55. swiperChange(e) {//轮播图切换
  56. const index = e.detail.current;
  57. this.current = index;
  58. },
  59. }
  60. }
  61. </script>
  62. <style lang="scss">
  63. .special-content{
  64. background-color: #F7F7F7;
  65. width: 100%;
  66. height: auto;
  67. box-sizing: border-box;
  68. padding: 0 24rpx;
  69. }
  70. .swiper-banner-box{
  71. width: 100%;
  72. height: 284rpx;
  73. background:#F7F7F7;
  74. position: relative;
  75. background-size: cover;
  76. float: left;
  77. margin: 20rpx 0;
  78. }
  79. .swiper-banner-title{
  80. width: 100%;
  81. float: left;
  82. font-size: 34rpx;
  83. font-weight: bold;
  84. text-align: left;
  85. line-height: 49rpx;
  86. color: #333;
  87. ackground:#F7F7F7;
  88. }
  89. .tui-banner-swiper {
  90. width: 700rpx;
  91. margin: 0 auto;
  92. height: 284rpx;
  93. border-radius: 2rpx;
  94. overflow: hidden;
  95. transform: translateY(0);
  96. box-shadow:0px 3px 6px rgba(225,86,22,0.08);
  97. .banner-item{
  98. border-radius: 16rpx;
  99. }
  100. .tui-slide-image {
  101. width: 100%;
  102. height: 284rpx;
  103. display: block;
  104. border-radius: 2rpx;
  105. }
  106. }
  107. .swiper__dots-box{
  108. position: absolute;
  109. bottom: 30rpx;
  110. left: 0;
  111. right: 0;
  112. /* #ifndef APP-NVUE */
  113. display: flex;
  114. /* #endif */
  115. flex: 1;
  116. flex-direction: row;
  117. justify-content: center;
  118. align-items: center;
  119. .swiper__dots-item{
  120. width: 8rpx;
  121. height: 8rpx;
  122. border-radius: 100%;
  123. margin-left: 6px;
  124. background-color:rgba(255,255,255,.7);
  125. }
  126. .swiper__dots-long{
  127. width: 35rpx;
  128. height: 8rpx;
  129. border-radius: 4rpx;
  130. background-color: #ffff;
  131. transition: all 0.4s;
  132. }
  133. }
  134. .swiper-goods-box{
  135. width: 100%;
  136. height: auto;
  137. float: left;
  138. .goods-box-item{
  139. width: 340rpx;
  140. height: 340rpx;
  141. float: left;
  142. margin-right: 20rpx;
  143. margin-bottom: 20rpx;
  144. &:nth-child(2n){
  145. margin-right: 0;
  146. }
  147. position: relative;
  148. .box-item-image{
  149. width: 340rpx;
  150. height: 340rpx;
  151. display: block;
  152. }
  153. .box-item-mask{
  154. width: 100%;
  155. height: 64rpx;
  156. background: rgba(0,0,0,.36);
  157. line-height: 64rpx;
  158. font-size: $font-size-26;
  159. text-align: center;
  160. color: #FFFFFF;
  161. position: absolute;
  162. bottom: 0;
  163. left: 0;
  164. box-sizing: border-box;
  165. padding:0 20rpx;
  166. white-space: normal;
  167. word-break: break-all;
  168. overflow: hidden;
  169. text-overflow: ellipsis;
  170. display: -webkit-box;
  171. -webkit-box-orient: vertical;
  172. -webkit-line-clamp: 1;
  173. }
  174. }
  175. }
  176. </style>