banner.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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. if(floor.linkParam.id == '276'){
  56. return
  57. }else{
  58. /**
  59. * 页面跳转类型
  60. * 1、二级页面,2、搜索项目仪器,3、直播页面,4、自由页面,5、商品详情,6、仪器项目详情,7、供应商主页
  61. * 8、专题活动页,9、二手市场介绍,10、二手商品列表,11、二手商品发布,12、商品搜索,13、信息详情
  62. * 14、品牌招商介绍页,15、维修保养介绍页,16、首页,17、注册页,18、信息中心,19、供应商列表
  63. **/
  64. if(floor.linkType){
  65. const typeMap = {
  66. 1:`/pages/goods/goods-instrument?linkId=${floor.linkParam.id}&title=${floor.title}`,
  67. 2:`/pages/goods/instrument-details?id=${floor.linkParam.id}`,
  68. 4:`/h5/pages/activity/activity?id=${floor.linkParam.id}`,
  69. 5:`/pages/goods/product?id=${floor.linkParam.id}`,
  70. 7:`/supplier/pages/user/my-shop?shopId=${floor.linkParam.id}`,
  71. 8:`/h5/pages/activity/activity-list`,
  72. 9:`/second/pages/form/introduce`,
  73. 10:`/second/pages/product/product-list`,
  74. 11:`/second/pages/form/form`,
  75. 12:`/pages/search/search?keyWord=${floor.title}`,
  76. 13:`/h5/pages/article/page?link=${floor.link}`,
  77. 14:`/h5/pages/article/page?linkType=${floor.linkType}`,
  78. 15:`/h5/pages/article/page?link=${floor.link}`,
  79. 17:`/pages/login/register-select`,
  80. 18:`/h5/pages/article/page?link=${floor.link}`,
  81. 19:`/pages/search/search-supplier?keyWord=${floor.title}`
  82. }
  83. const url = typeMap[floor.linkType];
  84. this.$api.navigateTo(url)
  85. }
  86. }
  87. }
  88. }
  89. }
  90. </script>
  91. <style lang="scss">
  92. .swiper-banner-box{
  93. width: 100%;
  94. height: 360rpx;
  95. padding-top:100rpx;
  96. background:#FFFFFF url(https://img.caimei365.com/group1/M00/03/B0/Cmis217Z9LCALu9wAAAv45Bdpsk814.png)no-repeat;
  97. position: relative;
  98. background-size: cover;
  99. }
  100. .tui-banner-swiper {
  101. width: 700rpx;
  102. margin: 0 auto;
  103. height: 340rpx;
  104. border-radius: 24rpx;
  105. overflow: hidden;
  106. transform: translateY(0);
  107. box-shadow:0px 3px 6px rgba(225,86,22,0.08);
  108. margin-top: 16rpx;
  109. .banner-item{
  110. border-radius: 24rpx;
  111. }
  112. .tui-slide-image {
  113. width: 100%;
  114. height: 340rpx;
  115. display: block;
  116. }
  117. }
  118. .swiper__dots-box{
  119. position: absolute;
  120. bottom: 30rpx;
  121. left: 0;
  122. right: 0;
  123. /* #ifndef APP-NVUE */
  124. display: flex;
  125. /* #endif */
  126. flex: 1;
  127. flex-direction: row;
  128. justify-content: center;
  129. align-items: center;
  130. .swiper__dots-item{
  131. width: 8rpx;
  132. height: 8rpx;
  133. border-radius: 100%;
  134. margin-left: 6px;
  135. background-color:rgba(255,255,255,.7);
  136. }
  137. .swiper__dots-long{
  138. width: 35rpx;
  139. height: 8rpx;
  140. border-radius: 4rpx;
  141. background-color: #ffff;
  142. transition: all 0.4s;
  143. }
  144. }
  145. .swiper-banner-msg{
  146. width: 100%;
  147. height: 54rpx;
  148. box-sizing: border-box;
  149. padding: 0 24rpx;
  150. margin-top: 20rpx;
  151. .content{
  152. width: 100%;
  153. height: 54rpx;
  154. box-sizing: border-box;
  155. padding: 0 34rpx;
  156. background-color: #fff0e9;
  157. border-radius: 16rpx;
  158. .item{
  159. width: 33.33%;
  160. height: 54rpx;
  161. line-height: 54rpx;
  162. font-size: $font-size-24;
  163. color: $color-system;
  164. float: left;
  165. &.le{
  166. text-align: left;
  167. }
  168. &.ce{
  169. text-align: center;
  170. }
  171. &.ri{
  172. text-align: right;
  173. }
  174. .iconfont{
  175. color: $color-system;
  176. font-size: $font-size-32;
  177. .sm{
  178. font-size: $font-size-26;
  179. }
  180. }
  181. }
  182. }
  183. }
  184. </style>