swiperup.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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: 92rpx;
  78. margin-bottom: 20rpx;
  79. background: #fff;
  80. line-height: 92rpx;
  81. position: relative;
  82. width:100%;
  83. margin:0 auto;
  84. margin-top:12px;
  85. /* box-shadow: 2px 2px 4px rgba(0,0,0,0.07); */
  86. /* background:url('./bert-suggest/icons/bg@2x%20(1).png'); */
  87. background-size: cover;
  88. /* border-radius: 20rpx; */
  89. background: white;
  90. border-radius: 20rpx;
  91. }
  92. .wrap::before{
  93. /* content: "";
  94. position: absolute;
  95. background: #fff;
  96. display: block;
  97. width: 78rpx;
  98. height: 78rpx;
  99. left: -15px;
  100. z-index: 1;
  101. -webkit-border-radius: 30%;
  102. border-radius: 30%; */
  103. }
  104. .wrap::after{
  105. /* content: "";
  106. position: absolute;
  107. background: #fff;
  108. display: block;
  109. width: 78rpx;
  110. height: 78rpx;
  111. right: -15px;
  112. z-index: 1;
  113. -webkit-border-radius: 30%;
  114. border-radius: 30%; */
  115. }
  116. .gb{
  117. width:60rpx;
  118. height:40rpx;
  119. vertical-align: middle;
  120. margin:0 24rpx 0 33rpx;
  121. }
  122. .horn{
  123. width:14px;height:14px;
  124. vertical-align: middle;
  125. margin-right: 10px;
  126. }
  127. swiper {
  128. width: 100%;
  129. height: 68rpx;
  130. position: absolute;
  131. left: 0rpx;
  132. top: 0rpx;
  133. pointer-events: none;
  134. cursor: default;
  135. z-index:2;
  136. }
  137. .cuIcon-notification{
  138. margin-right:10rpx;
  139. }
  140. .itme_text {
  141. font-size: 26rpx;
  142. z-index: 999;
  143. color: #000000;
  144. }
  145. </style>