bdLis.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <template>
  2. <view class="content">
  3. <view class="good-list">
  4. <view class="good flex" v-for="item in list"
  5. @click="navto('/pages/product/product?id=' + item.id + '&isbd=1')">
  6. <view class="good-img">
  7. <image :src="item.image" mode=""></image>
  8. </view>
  9. <view class="good-info flex">
  10. <view class="good-name clamp2">
  11. {{item.store_name}}
  12. </view>
  13. <view class="good-price">
  14. <view class="old-price" v-if="item.ot_price*1 > item.price*1">
  15. <text class="old-left">¥{{item.ot_price}}</text>
  16. <image src="../../static/icon/down.png" mode="widthFix"></image>
  17. <text class="old-right">直降{{item.ot_price*1 - item.price*1}}元</text>
  18. </view>
  19. <view class="new-price flex">
  20. <view class="">
  21. ¥{{item.price}}
  22. </view>
  23. <view class="good-tip">
  24. 立即购买
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. <uni-load-more :status="loadingType"></uni-load-more>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. import {
  36. groomList
  37. } from '@/api/product.js';
  38. export default {
  39. data() {
  40. return {
  41. list: [],
  42. page: 1,
  43. limit: 10,
  44. loaded: false,
  45. loadingType: 'more'
  46. }
  47. },
  48. onLoad() {
  49. this.groomList()
  50. },
  51. onShow() {
  52. },
  53. onReachBottom() {
  54. this.groomList()
  55. },
  56. onReady() {
  57. },
  58. methods: {
  59. navto(url) {
  60. uni.navigateTo({
  61. url
  62. })
  63. },
  64. groomList() {
  65. let that = this
  66. if (that.loadingType == 'loading' || that.loadingType == 'noMore') {
  67. return
  68. }
  69. that.loadingType = 'loading'
  70. groomList({
  71. page: that.page,
  72. limit: that.limit
  73. }, 5).then(res => {
  74. that.page++
  75. that.list = that.list.concat(res.data.list)
  76. if (res.data.list.length == that.limit) {
  77. that.loadingType = 'more'
  78. } else {
  79. that.loadingType = 'noMore'
  80. }
  81. })
  82. }
  83. }
  84. }
  85. </script>
  86. <style lang="scss">
  87. page {
  88. height: auto;
  89. min-height: 100%;
  90. background-color: #fff;
  91. }
  92. .good-list {
  93. width: 750rpx;
  94. background: #fff;
  95. padding: 30rpx 0;
  96. .good {
  97. width: 690rpx;
  98. height: 276rpx;
  99. background: #FFFFFF;
  100. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  101. border-radius: 10rpx;
  102. margin: auto;
  103. padding: 20rpx 15rpx;
  104. margin-bottom: 20rpx;
  105. &:last-of-type {
  106. margin-bottom: 0rpx;
  107. }
  108. .good-img {
  109. flex-shrink: 0;
  110. width: 236rpx;
  111. height: 236rpx;
  112. border-radius: 10rpx;
  113. margin-right: 22rpx;
  114. image {
  115. width: 236rpx;
  116. height: 236rpx;
  117. border-radius: 10rpx;
  118. }
  119. }
  120. .good-info {
  121. flex-grow: 1;
  122. height: 100%;
  123. flex-direction: column;
  124. justify-content: space-between;
  125. align-items: flex-start;
  126. .good-name {
  127. font-size: 32rpx;
  128. font-weight: bold;
  129. padding-top: 10rpx;
  130. color: #333333;
  131. }
  132. .good-price {
  133. width: 100%;
  134. image {
  135. width: 14rpx;
  136. margin: 0 6rpx 0 10rpx;
  137. }
  138. .old-price {
  139. .old-left {
  140. font-size: 26rpx;
  141. font-weight: 500;
  142. text-decoration: line-through;
  143. color: #999999;
  144. }
  145. .old-right {
  146. font-size: 24rpx;
  147. font-weight: bold;
  148. color: #B59467;
  149. }
  150. }
  151. .new-price {
  152. width: 100%;
  153. font-size: 36rpx;
  154. font-weight: bold;
  155. color: #FF4C4C;
  156. justify-content: space-between;
  157. .good-tip {
  158. width: 137rpx;
  159. height: 52rpx;
  160. background: #01A6A8;
  161. border-radius: 26rpx;
  162. position: relative;
  163. font-size: 26rpx;
  164. font-weight: 500;
  165. color: #FFFFFF;
  166. line-height: 52rpx;
  167. text-align: center;
  168. }
  169. }
  170. }
  171. }
  172. }
  173. }
  174. </style>