banner.vue 4.7 KB

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