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

193 lines
4.2 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. dataList: []
  72. }
  73. },
  74. watch: {
  75. list(val){
  76. this.dataList = val;
  77. }
  78. },
  79. // computed: {
  80. // dataList: {
  81. // get() { return this.list; },
  82. // set(newValue) { console.log('newvalue',newValue) }
  83. // },
  84. // },
  85. created(){
  86. },
  87. destroyed() {
  88. },
  89. methods: {
  90. onClick(id){
  91. this.$url('/pages/goodsDetail/index?goods_id='+id);
  92. this.$emit('click');
  93. },
  94. goAd(type,url){
  95. if(url) {
  96. if(type == 0) {
  97. this.$url(url);
  98. }else {
  99. this.$url('/pages/index/urlWeb?url='+url);
  100. }
  101. }
  102. },
  103. clear() {
  104. this.$refs.uWaterfall.clear();
  105. }
  106. }
  107. }
  108. </script>
  109. <style lang="scss" scoped="scoped">
  110. // ====
  111. .list-warter {
  112. border-radius: 8px;
  113. margin: 10px 5px;
  114. margin-top: 0px;
  115. background-color: #ffffff;
  116. // padding: 8px;
  117. position: relative;
  118. overflow: hidden;
  119. }
  120. .u-close {
  121. position: absolute;
  122. top: 32rpx;
  123. right: 32rpx;
  124. }
  125. .list-image {
  126. width: 100%;
  127. border-radius: 4px;
  128. }
  129. .list-title {
  130. font-size: 28rpx;
  131. font-weight: bold;
  132. color: $u-main-color;
  133. }
  134. .list-label{
  135. position: absolute;
  136. bottom: 0;
  137. right: 0;
  138. background-color: rgba(0,0,0,0.5);
  139. width: 140rpx;
  140. height: 48rpx;
  141. border-radius: 20rpx 0rpx 0rpx 0rpx;
  142. font-size: 22rpx;
  143. color: #FFFFFF;
  144. line-height: 48rpx;
  145. text-align: center;
  146. }
  147. .list-tag {
  148. display: flex;
  149. margin-top: 5px;
  150. }
  151. .list-tag-owner {
  152. background-color: $u-type-error;
  153. color: #FFFFFF;
  154. display: flex;
  155. align-items: center;
  156. padding: 4rpx 14rpx;
  157. border-radius: 50rpx;
  158. font-size: 20rpx;
  159. line-height: 1;
  160. }
  161. .list-tag-text {
  162. border: 1px solid $u-type-primary;
  163. color: $u-type-primary;
  164. margin-left: 10px;
  165. border-radius: 50rpx;
  166. line-height: 1;
  167. padding: 4rpx 14rpx;
  168. display: flex;
  169. align-items: center;
  170. border-radius: 50rpx;
  171. font-size: 20rpx;
  172. }
  173. .list-price {
  174. font-size: 30rpx;
  175. color: $u-type-error;
  176. margin-top: 5px;
  177. display: flex;
  178. align-items: center;
  179. }
  180. // ====
  181. </style>