海南旅游项目 前端仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

164 lines
3.4 KiB

  1. <template>
  2. <view>
  3. <u-waterfall v-model="dataList" ref="uWaterfall">
  4. <template v-slot:left="{leftList}">
  5. <view class="list-warter" v-for="(item, index) in leftList" :key="index" @click="onClick(item.id)">
  6. <u-lazy-load threshold="-450" border-radius="8px 8px 0 0" :image="item.product.picture" :index="index">
  7. <view class="list-label">已售{{item.sale}}</view>
  8. </u-lazy-load>
  9. <view class="lf-p-20">
  10. <view class="list-title">
  11. {{item.product.title}}
  12. </view>
  13. <view class="list-price">
  14. <!-- <text>{{item.price}}</text> -->
  15. <lf-price :price="item.price"></lf-price>
  16. <text class="lf-m-l-20 lf-font-24 lf-color-666 lf-line-through">{{item.original_price}}</text>
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <template v-slot:right="{rightList}">
  22. <view class="list-warter" v-for="(item, index) in rightList" :key="index" @click="onClick(item.id)">
  23. <u-lazy-load threshold="-450" border-radius="8px 8px 0 0" :image="item.product.picture" :index="index">
  24. <view class="list-label">已售{{item.sale}}</view>
  25. </u-lazy-load>
  26. <view class="lf-p-20">
  27. <view class="list-title">
  28. {{item.product.title}}
  29. </view>
  30. <view class="list-price">
  31. <!-- <text>{{item.price}}</text> -->
  32. <lf-price :price="item.price"></lf-price>
  33. <text class="lf-m-l-20 lf-font-24 lf-color-666 lf-line-through">{{item.original_price}}</text>
  34. </view>
  35. </view>
  36. </view>
  37. </template>
  38. </u-waterfall>
  39. </view>
  40. </template>
  41. <script>
  42. export default {
  43. props: {
  44. list: {
  45. type: Array,
  46. default: []
  47. }
  48. },
  49. data(){
  50. return {
  51. }
  52. },
  53. computed: {
  54. dataList: {
  55. // let arr = [];
  56. // if(this.list && this.list.length){
  57. // arr = this.list;
  58. // }
  59. // return arr;
  60. get() { return this.list; },
  61. set(newValue) { console.log('newvalue',newValue) }
  62. },
  63. },
  64. onShow(){
  65. },
  66. destroyed() {
  67. },
  68. methods: {
  69. onClick(id){
  70. this.$url('/pages/goodsDetail/index?goods_id='+id);
  71. this.$emit('click');
  72. },
  73. clear() {
  74. this.$refs.uWaterfall.clear();
  75. }
  76. }
  77. }
  78. </script>
  79. <style lang="scss" scoped="scoped">
  80. // ====
  81. .list-warter {
  82. border-radius: 8px;
  83. margin: 10px 5px;
  84. margin-top: 0px;
  85. background-color: #ffffff;
  86. // padding: 8px;
  87. position: relative;
  88. overflow: hidden;
  89. }
  90. .u-close {
  91. position: absolute;
  92. top: 32rpx;
  93. right: 32rpx;
  94. }
  95. .list-image {
  96. width: 100%;
  97. border-radius: 4px;
  98. }
  99. .list-title {
  100. font-size: 28rpx;
  101. font-weight: bold;
  102. color: $u-main-color;
  103. }
  104. .list-label{
  105. position: absolute;
  106. bottom: 0;
  107. right: 0;
  108. background-color: rgba(0,0,0,0.5);
  109. width: 140rpx;
  110. height: 48rpx;
  111. border-radius: 20rpx 0rpx 0rpx 0rpx;
  112. font-size: 22rpx;
  113. color: #FFFFFF;
  114. line-height: 48rpx;
  115. text-align: center;
  116. }
  117. .list-tag {
  118. display: flex;
  119. margin-top: 5px;
  120. }
  121. .list-tag-owner {
  122. background-color: $u-type-error;
  123. color: #FFFFFF;
  124. display: flex;
  125. align-items: center;
  126. padding: 4rpx 14rpx;
  127. border-radius: 50rpx;
  128. font-size: 20rpx;
  129. line-height: 1;
  130. }
  131. .list-tag-text {
  132. border: 1px solid $u-type-primary;
  133. color: $u-type-primary;
  134. margin-left: 10px;
  135. border-radius: 50rpx;
  136. line-height: 1;
  137. padding: 4rpx 14rpx;
  138. display: flex;
  139. align-items: center;
  140. border-radius: 50rpx;
  141. font-size: 20rpx;
  142. }
  143. .list-price {
  144. font-size: 30rpx;
  145. color: $u-type-error;
  146. margin-top: 5px;
  147. display: flex;
  148. align-items: center;
  149. }
  150. // ====
  151. </style>