swiperup.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <view class="wrap">
  3. <swiper
  4. id="_swiper_up"
  5. :indicator-dots="indicatorDots"
  6. :autoplay="autoplay" :interval="interval" :duration="duration" vertical="true" circular="true">
  7. <block v-for="(item,index) in list" :key="index">
  8. <swiper-item>
  9. <view class="itme_text">
  10. <view>
  11. <image class='gb' src='https://taohaoliang.oss-cn-beijing.aliyuncs.com/tmp/gb.png'></image>
  12. <image class='horn' src='https://taohaoliang.oss-cn-beijing.aliyuncs.com/tmp/horn.png'></image>{{item.port}}{{item.goodsName}}&nbsp;&nbsp;({{item.newOld}})&nbsp;&nbsp;{{item.price}}元/吨
  13. </view>
  14. </view>
  15. </swiper-item>
  16. </block>
  17. </swiper>
  18. </view>
  19. </template>
  20. <script>
  21. export default {
  22. name: 'swiper_up',
  23. data() {
  24. return {
  25. typeList: {
  26. left: 'icon-zuo',
  27. right: 'icon-you',
  28. up: 'icon-shang',
  29. down: 'icon-xia'
  30. },
  31. }
  32. },
  33. props: {
  34. indicatorDots: {
  35. type: Boolean,
  36. default: false
  37. },
  38. autoplay: {
  39. type: Boolean,
  40. default: true
  41. },
  42. interval: {
  43. type: String,
  44. default: '3000'
  45. },
  46. duration: {
  47. type: String,
  48. default: '1000'
  49. },
  50. list: {
  51. type: Array,
  52. default: []
  53. },
  54. },
  55. created(){
  56. console.log(this.list,this.autoplay)
  57. },
  58. onLoad(){
  59. console.log(this.list)
  60. },
  61. methods: {
  62. eventClick() {
  63. this.$emit('eventClick');
  64. }
  65. },
  66. }
  67. </script>
  68. <style scoped>
  69. .wrap{
  70. height: 64rpx;
  71. margin-bottom: 20rpx;
  72. background: #fff;
  73. line-height: 64rpx;
  74. position: relative;
  75. width:84%;
  76. margin:0 auto;
  77. margin-top:12px;
  78. box-shadow: 2px 2px 4px rgba(0,0,0,0.07);
  79. }
  80. .wrap::before{
  81. content: "";
  82. position: absolute;
  83. background: #fff;
  84. display: block;
  85. width: 35px;
  86. height: 35px;
  87. left: -15px;
  88. z-index: 1;
  89. -webkit-border-radius: 50%;
  90. border-radius: 50%;
  91. }
  92. .wrap::after{
  93. content: "";
  94. position: absolute;
  95. background: #fff;
  96. display: block;
  97. width: 35px;
  98. height: 35px;
  99. right: -15px;
  100. z-index: 1;
  101. -webkit-border-radius: 50%;
  102. border-radius: 50%;
  103. }
  104. .gb{
  105. width:27px;
  106. height:21px;
  107. vertical-align: middle;
  108. }
  109. .horn{
  110. width:14px;height:14px;
  111. vertical-align: middle;
  112. margin-right: 10px;
  113. }
  114. swiper {
  115. width: 100%;
  116. height: 68rpx;
  117. position: absolute;
  118. left: 0rpx;
  119. top: 0rpx;
  120. pointer-events: none;
  121. cursor: default;
  122. z-index:2;
  123. }
  124. .cuIcon-notification{
  125. margin-right:10rpx;
  126. }
  127. .itme_text {
  128. font-size: 26rpx;
  129. z-index: 999;
  130. }
  131. </style>