banner.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <view>
  3. <view class="swiper-banner-box" >
  4. <swiper class="tui-banner-swiper tui-banner tui-skeleton-fillet" :autoplay="true" :interval="5000" :duration="500" @change="swiperChange" :circular="true">
  5. <swiper-item v-for="(item,index) in list" :key="index" @click.stop="NavToDetailPage(item)">
  6. <image :src="item.image" class="tui-slide-image" mode="scaleToFill"/>
  7. </swiper-item>
  8. </swiper>
  9. <view class="swiper__dots-box" v-if="list.length > 1">
  10. <view v-for="(item,idx) in list"
  11. :key="idx"
  12. :class="[idx===current?'swiper__dots-long':'none']"
  13. :data-index="current" class="swiper__dots-item">
  14. </view>
  15. </view>
  16. </view>
  17. <view class="swiper-banner-msg">
  18. <view class="content">
  19. <view class="item le">
  20. <text class="iconfont icon-zhengpin"><text class="sm">正品保证</text></text>
  21. </view>
  22. <view class="item ce">
  23. <text class="iconfont icon-jigou"><text class="sm">5000+机构</text></text>
  24. </view>
  25. <view class="item ri">
  26. <text class="iconfont icon-gongyingshang"><text class="sm">100+供应商</text></text>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. export default{
  34. name:"address",
  35. props:{
  36. list:{
  37. type:Array
  38. }
  39. },
  40. data() {
  41. return{
  42. current:0
  43. }
  44. },
  45. created(){
  46. },
  47. computed: {
  48. },
  49. methods:{
  50. swiperChange(e) {//轮播图切换
  51. const index = e.detail.current;
  52. this.current = index;
  53. },
  54. NavToDetailPage(floor) {//跳转
  55. /**
  56. * 页面跳转类型
  57. * 1、二级页面,2、搜索项目仪器,3、直播页面,4、自由页面,5、商品详情,6、仪器项目详情,7、供应商主页
  58. * 8、专题活动页,9、二手市场介绍,10、二手商品列表,11、二手商品发布,12、商品搜索,13、信息详情
  59. * 14、品牌招商介绍页,15、维修保养介绍页,16、首页,17、注册页,18、信息中心,19、供应商列表
  60. **/
  61. if(floor.linkType){
  62. const typeMap = {
  63. 1:`/pages/goods/goods-instrument?linkId=${floor.linkParam.id}&title=${floor.title}`,
  64. 2:`/pages/goods/instrument-details?id=${floor.linkParam.id}`,
  65. 4:`/h5/pages/activity/activity?id=${floor.linkParam.id}`,
  66. 5:`/pages/goods/product?id=${floor.linkParam.id}`,
  67. 7:`/supplier/pages/user/my-shop?shopId=${floor.linkParam.id}`,
  68. 8:`/h5/pages/activity/activity-list`,
  69. 9:`/second/pages/form/introduce`,
  70. 10:`/second/pages/product/product-list`,
  71. 11:`/second/pages/form/form`,
  72. 12:`/pages/search/search?keyWord=${floor.title}`,
  73. 13:`/h5/pages/article/page?link=${floor.link}`,
  74. 14:`/h5/pages/article/page?link=${floor.link}`,
  75. 15:`/h5/pages/article/page?link=${floor.link}`,
  76. 17:`/pages/login/register-select`,
  77. 18:`/h5/pages/article/page?link=${floor.link}`,
  78. 19:`/pages/search/search-supplier?keyWord=${floor.title}`
  79. }
  80. const url = typeMap[floor.linkType];
  81. this.$api.navigateTo(url)
  82. }
  83. }
  84. }
  85. }
  86. </script>
  87. <style lang="scss">
  88. .swiper-banner-box{
  89. width: 100%;
  90. height: 360rpx;
  91. padding-top:100rpx;
  92. background:#FFFFFF url(https://img.caimei365.com/group1/M00/03/B0/Cmis217Z9LCALu9wAAAv45Bdpsk814.png)no-repeat;
  93. position: relative;
  94. background-size: cover;
  95. }
  96. .tui-banner-swiper {
  97. width: 700rpx;
  98. margin: 0 auto;
  99. height: 340rpx;
  100. border-radius: 24rpx;
  101. overflow: hidden;
  102. transform: translateY(0);
  103. box-shadow:0px 3px 6px rgba(225,86,22,0.08);
  104. margin-top: 16rpx;
  105. .banner-item{
  106. border-radius: 24rpx;
  107. }
  108. .tui-slide-image {
  109. width: 100%;
  110. height: 340rpx;
  111. display: block;
  112. }
  113. }
  114. .swiper__dots-box{
  115. position: absolute;
  116. bottom: 30rpx;
  117. left: 0;
  118. right: 0;
  119. /* #ifndef APP-NVUE */
  120. display: flex;
  121. /* #endif */
  122. flex: 1;
  123. flex-direction: row;
  124. justify-content: center;
  125. align-items: center;
  126. .swiper__dots-item{
  127. width: 8rpx;
  128. height: 8rpx;
  129. border-radius: 100%;
  130. margin-left: 6px;
  131. background-color:rgba(255,255,255,.7);
  132. }
  133. .swiper__dots-long{
  134. width: 35rpx;
  135. height: 8rpx;
  136. border-radius: 4rpx;
  137. background-color: #ffff;
  138. transition: all 0.4s;
  139. }
  140. }
  141. .swiper-banner-msg{
  142. width: 100%;
  143. height: 54rpx;
  144. box-sizing: border-box;
  145. padding: 0 24rpx;
  146. margin-top: 20rpx;
  147. .content{
  148. width: 100%;
  149. height: 54rpx;
  150. box-sizing: border-box;
  151. padding: 0 34rpx;
  152. background-color: #fff0e9;
  153. border-radius: 16rpx;
  154. .item{
  155. width: 33.33%;
  156. height: 54rpx;
  157. line-height: 54rpx;
  158. font-size: $font-size-24;
  159. color: $color-system;
  160. float: left;
  161. &.le{
  162. text-align: left;
  163. }
  164. &.ce{
  165. text-align: center;
  166. }
  167. &.ri{
  168. text-align: right;
  169. }
  170. .iconfont{
  171. color: $color-system;
  172. font-size: $font-size-34;
  173. .sm{
  174. font-size: $font-size-28;
  175. }
  176. }
  177. }
  178. }
  179. }
  180. </style>