banner.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. <template>
  2. <view class="banner">
  3. <!-- <view class="swiper-banner-msg">
  4. <view class="content">
  5. <view class="item le">
  6. <view class="item-icon">
  7. <text class="iconfont icon-zhengpin1"></text>
  8. </view>
  9. <view class="item-sm">
  10. <text>正品保证</text>
  11. </view>
  12. </view>
  13. <view class="item ce">
  14. <view class="item-icon">
  15. <text class="iconfont icon-jigou1"></text>
  16. </view>
  17. <view class="item-sm">
  18. <text>12000+机构</text>
  19. </view>
  20. </view>
  21. <view class="item ri">
  22. <view class="item-sm">
  23. <text>100+供应商</text>
  24. </view>
  25. <view class="item-icon">
  26. <text class="iconfont icon-gongyingshang1"></text>
  27. </view>
  28. </view>
  29. </view>
  30. </view -->
  31. <!-- <view class="tui-rolling-view">
  32. <view class="tui-rolling-content">
  33. <view class="tui-rolling-news">
  34. <text class="tui-roll-label">公告:</text>
  35. <swiper vertical autoplay circular interval="3500" class="tui-swiper">
  36. <swiper-item v-for="(item, index) in list" :key="index" class="tui-swiper-item">
  37. <view class="tui-news-item" @tap="detail(item)">
  38. <text class="news-dot"></text> {{ item.title }}
  39. </view>
  40. </swiper-item>
  41. </swiper>
  42. <view class="tui-roll-more" @tap="newsList(item)">
  43. 更多<text class="iconfont icon-xiayibu"></text>
  44. </view>
  45. </view>
  46. </view>
  47. </view> -->
  48. <view class="swiper-banner-content">
  49. <view class="swiper-banner-box">
  50. <swiper
  51. class="tui-banner-swiper tui-banner tui-skeleton-fillet"
  52. :autoplay="true"
  53. :interval="5000"
  54. :duration="500"
  55. @change="swiperChange"
  56. :circular="true"
  57. >
  58. <swiper-item v-for="(item, index) in list" :key="index" @click.stop="NavToDetailPage(item)">
  59. <image :src="item.image" class="tui-slide-image" mode="scaleToFill" />
  60. </swiper-item>
  61. </swiper>
  62. <view class="swiper__dots-box" v-if="list.length > 1">
  63. <view
  64. v-for="(item, idx) in list"
  65. :key="idx"
  66. :class="[idx === current ? 'swiper__dots-long' : 'none']"
  67. :data-index="current"
  68. class="swiper__dots-item"
  69. >
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. </view>
  75. </template>
  76. <script>
  77. import cmsMixins from '@/mixins/cmsMixins.js'
  78. export default {
  79. mixins: [cmsMixins],
  80. name: 'banner',
  81. props: {
  82. list: {
  83. type: Array
  84. }
  85. },
  86. data() {
  87. return {
  88. current: 0,
  89. StatusBar: this.StatusBar
  90. }
  91. },
  92. created() {
  93. },
  94. computed: {},
  95. methods: {
  96. detail(item){// 跳转公告详情
  97. this.$api.navigateTo(`/pages/service/news-detailes?id=${item.id}`)
  98. },
  99. newsList(){// 公告列表
  100. this.$api.navigateTo('/pages/service/news-list')
  101. },
  102. swiperChange(e) {
  103. //轮播图切换
  104. const index = e.detail.current
  105. this.current = index
  106. },
  107. NavToDetailPage(item) {
  108. //跳转
  109. this.cmsSysStatistics(1, item.id)
  110. this.$api.FlooryNavigateTo(item)
  111. }
  112. }
  113. }
  114. </script>
  115. <style lang="scss" scoped>
  116. .banner {
  117. margin-top: 150rpx;
  118. background: #f7f7f7;
  119. }
  120. .swiper-banner-content {
  121. width: 100%;
  122. height: auto;
  123. position: relative;
  124. background: linear-gradient(180deg, #FFFFFF 0%, rgba(255,255,255,0) 100%);
  125. }
  126. .swiper-banner-box {
  127. width: 100%;
  128. height: auto;
  129. position: relative;
  130. background-size: cover;
  131. display: flex;
  132. opacity: 1;
  133. background: linear-gradient(180deg, #FFFFFF 0%, rgba(255,255,255,0) 100%);
  134. }
  135. .tui-banner-swiper {
  136. width: 702rpx;
  137. margin: 10rpx auto;
  138. height: 280rpx;
  139. border-radius: 16rpx;
  140. overflow: hidden;
  141. transform: translateY(0);
  142. background: linear-gradient(180deg, #FFFFFF 0%, rgba(255,255,255,0) 100%);
  143. .banner-item {
  144. border-radius: 16rpx;
  145. }
  146. .tui-slide-image {
  147. width: 100%;
  148. height: 280rpx;
  149. display: block;
  150. }
  151. }
  152. .swiper__dots-box {
  153. position: absolute;
  154. bottom: 30rpx;
  155. left: 0;
  156. right: 0;
  157. /* #ifndef APP-NVUE */
  158. display: flex;
  159. /* #endif */
  160. flex: 1;
  161. flex-direction: row;
  162. justify-content: center;
  163. align-items: center;
  164. .swiper__dots-item {
  165. width: 8rpx;
  166. height: 8rpx;
  167. border-radius: 100%;
  168. margin-left: 6px;
  169. background-color: rgba(255, 255, 255, 0.7);
  170. }
  171. .swiper__dots-long {
  172. width: 35rpx;
  173. height: 8rpx;
  174. border-radius: 4rpx;
  175. background-color: #ffff;
  176. transition: all 0.4s;
  177. }
  178. }
  179. .swiper-banner-msg {
  180. width: 100%;
  181. height: 48rpx;
  182. box-sizing: border-box;
  183. background-color: #FFFFFF;
  184. padding: 0 24rpx;
  185. .content {
  186. width: 100%;
  187. height: 48rpx;
  188. box-sizing: border-box;
  189. padding: 0 24rpx;
  190. border-radius: 16rpx;
  191. .item {
  192. width: 30%;
  193. height: 48rpx;
  194. float: left;
  195. .item-icon{
  196. height: 48rpx;
  197. line-height: 48rpx;
  198. float: left;
  199. margin-right: 2px;
  200. .iconfont {
  201. color: #ffffff;
  202. font-size: $font-size-28;
  203. }
  204. }
  205. .item-sm{
  206. line-height: 48rpx;
  207. font-size: $font-size-22;
  208. color: #ffffff;
  209. float: left;
  210. }
  211. &.le {
  212. width: 37%;
  213. text-align: left;
  214. }
  215. &.ce {
  216. width: 25%;
  217. text-align: center;
  218. }
  219. &.ri {
  220. width: 37%;
  221. .item-icon{
  222. float: right;
  223. }
  224. .item-sm{
  225. float: right;
  226. }
  227. }
  228. }
  229. }
  230. }
  231. .tui-rolling-view {
  232. width: 100%;
  233. height: 96rpx;
  234. background-color: #FF5B00;
  235. }
  236. .tui-rolling-content{
  237. width: 100%;
  238. height: 100%;
  239. box-sizing: border-box;
  240. padding: 20rpx 24rpx;
  241. border-radius: 24rpx 24rpx 0 0;
  242. background-color: #FFFFFF;
  243. }
  244. .tui-rolling-news {
  245. width: 100%;
  246. padding: 0 20rpx;
  247. border-radius: 8rpx;
  248. box-sizing: border-box;
  249. display: flex;
  250. align-items: center;
  251. justify-content: center;
  252. flex-wrap: nowrap;
  253. line-height: 56rpx;
  254. background: #fff7f3;
  255. background-size: cover;
  256. .tui-roll-label {
  257. font-weight: bold;
  258. font-size: $font-size-26;
  259. color: #ff5b00;
  260. }
  261. .tui-roll-more {
  262. font-size: $font-size-24;
  263. color: #999999;
  264. .icon-xiayibu {
  265. font-size: $font-size-22;
  266. }
  267. }
  268. }
  269. .tui-swiper {
  270. font-size: 28rpx;
  271. height: 50rpx;
  272. flex: 1;
  273. }
  274. .tui-swiper-item {
  275. display: flex;
  276. align-items: center;
  277. }
  278. .tui-news-item {
  279. width: 480rpx;
  280. line-height: 28rpx;
  281. white-space: nowrap;
  282. overflow: hidden;
  283. text-overflow: ellipsis;
  284. font-size: $font-size-24;
  285. color: #666666;
  286. .news-dot {
  287. display: inline-block;
  288. width: 10rpx;
  289. height: 10rpx;
  290. background-color: #999999;
  291. border-radius: 50%;
  292. margin-right: 8rpx;
  293. float: left;
  294. margin-top: 10rpx;
  295. }
  296. }
  297. .tui-drop-item {
  298. color: #333;
  299. height: 80rpx;
  300. font-size: 28rpx;
  301. padding: 20rpx 40rpx 20rpx 40rpx;
  302. box-sizing: border-box;
  303. display: inline-block;
  304. width: 50%;
  305. }
  306. </style>