金诚优选前端代码
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.

209 lines
4.2 KiB

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