海南旅游项目 前端仓库
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.

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