swiperup.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <template>
  2. <view class="wrap" @click="clickInfoList()">
  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/new.png'></image>
  12. 最新价格:<{{item.goodsName}}>
  13. <text style="margin-right: 10px;margin-left: 10px;" :class="item.newPrice > item.openPrice ? 'text-red':'text-green'">{{item.newPrice}}</text>
  14. 元/吨
  15. </view>
  16. </view>
  17. </swiper-item>
  18. </block>
  19. </swiper>
  20. </view>
  21. </template>
  22. <script>
  23. export default {
  24. name: 'swiper_up',
  25. data() {
  26. return {
  27. typeList: {
  28. left: 'icon-zuo',
  29. right: 'icon-you',
  30. up: 'icon-shang',
  31. down: 'icon-xia'
  32. },
  33. }
  34. },
  35. props: {
  36. indicatorDots: {
  37. type: Boolean,
  38. default: false
  39. },
  40. autoplay: {
  41. type: Boolean,
  42. default: true
  43. },
  44. interval: {
  45. type: String,
  46. default: '3000'
  47. },
  48. duration: {
  49. type: String,
  50. default: '1000'
  51. },
  52. list: {
  53. type: Array,
  54. default: []
  55. },
  56. },
  57. created(){
  58. console.log(this.list,this.autoplay)
  59. },
  60. onLoad(){
  61. console.log(this.list)
  62. },
  63. methods: {
  64. clickInfoList(){
  65. uni.navigateTo({
  66. url: `/pageB/info/info_list`
  67. })
  68. },
  69. eventClick() {
  70. this.$emit('eventClick');
  71. }
  72. },
  73. }
  74. </script>
  75. <style scoped>
  76. .wrap{
  77. height: 64rpx;
  78. margin-bottom: 20rpx;
  79. background: #fff;
  80. line-height: 64rpx;
  81. position: relative;
  82. width:84%;
  83. margin:0 auto;
  84. margin-top:12px;
  85. box-shadow: 2px 2px 4px rgba(0,0,0,0.07);
  86. }
  87. .wrap::before{
  88. content: "";
  89. position: absolute;
  90. background: #fff;
  91. display: block;
  92. width: 32px;
  93. height: 32px;
  94. left: -15px;
  95. z-index: 1;
  96. -webkit-border-radius: 30%;
  97. border-radius: 30%;
  98. }
  99. .wrap::after{
  100. content: "";
  101. position: absolute;
  102. background: #fff;
  103. display: block;
  104. width: 32px;
  105. height: 32px;
  106. right: -15px;
  107. z-index: 1;
  108. -webkit-border-radius: 30%;
  109. border-radius: 30%;
  110. }
  111. .gb{
  112. width:27px;
  113. height:21px;
  114. vertical-align: middle;
  115. margin-right: 10px;
  116. }
  117. .horn{
  118. width:14px;height:14px;
  119. vertical-align: middle;
  120. margin-right: 10px;
  121. }
  122. swiper {
  123. width: 100%;
  124. height: 68rpx;
  125. position: absolute;
  126. left: 0rpx;
  127. top: 0rpx;
  128. pointer-events: none;
  129. cursor: default;
  130. z-index:2;
  131. }
  132. .cuIcon-notification{
  133. margin-right:10rpx;
  134. }
  135. .itme_text {
  136. font-size: 26rpx;
  137. z-index: 999;
  138. color: #000000;
  139. }
  140. </style>