jfGoods.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <template>
  2. <view class="content">
  3. <view class="hot-list">
  4. <view class="hotgoods-item" v-if="list.length > 0" v-for="jfitem in list" :key="jfitem.id"
  5. @click="navto('/pages/product/product?id=' + jfitem.id)">
  6. <view class="image-wrapper">
  7. <image class="image" :src="jfitem.image" mode="scaleToFill"></image>
  8. </view>
  9. <view class="flex"
  10. style="flex-direction: column;justify-content: space-between;align-items: flex-start;">
  11. <view class="title clamp">{{jfitem.store_name}}</view>
  12. <view class="hot-price">
  13. <view class="price">
  14. <image src="../../static/icon/jf.png" mode=""></image>
  15. <text>{{ jfitem.max_integral * 1 }} + {{(jfitem.price*1 - jfitem.max_integral * 1).toFixed(2)}}</text>
  16. <!-- <text class="ot-pirce">¥{{jfitem.ot_price}}</text> -->
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import {
  26. getProducts
  27. } from '@/api/product.js';
  28. export default {
  29. data() {
  30. return {
  31. list: [],
  32. page: 1,
  33. limit: 5,
  34. loadingType: 'more',
  35. loaded: false
  36. }
  37. },
  38. onLoad() {
  39. this.getList()
  40. },
  41. onShow() {
  42. },
  43. onReachBottom() {
  44. this.getList()
  45. },
  46. onReady() {
  47. },
  48. methods: {
  49. navto(url) {
  50. uni.navigateTo({
  51. url,
  52. fail() {
  53. uni.switchTab({
  54. url
  55. })
  56. }
  57. })
  58. },
  59. getList() {
  60. let that = this
  61. if(that.loadingType == 'noMore' || that.loadingType == 'loading') {
  62. return
  63. }
  64. that.loadingType = 'loading'
  65. getProducts({
  66. page: that.page,
  67. limit: that.limit,
  68. is_integral: 1
  69. }).then(res => {
  70. let arr = res.data
  71. that.list = that.list.concat(arr)
  72. if(arr.length == that.limit) {
  73. that.loadingType = 'more'
  74. }else {
  75. that.loadingType = 'noMore'
  76. }
  77. that.loaded = true
  78. })
  79. }
  80. }
  81. }
  82. </script>
  83. <style lang="scss" scoped>
  84. .hot-list {
  85. // margin-top: 38rpx;
  86. width: 100%;
  87. display: flex;
  88. flex-wrap: wrap;
  89. padding: 0 20rpx 30rpx;
  90. justify-content: space-between;
  91. .hotgoods-item {
  92. width: 345rpx;
  93. background-color: #ffffff;
  94. border-radius: 12rpx;
  95. box-shadow: 0 0 15rpx rgba(0, 0, 0, 0.2);
  96. margin-bottom: 15rpx;
  97. padding-bottom:20rpx;
  98. .image-wrapper {
  99. width: 345rpx;
  100. height: 345rpx;
  101. border-radius: 3px;
  102. overflow: hidden;
  103. position: relative;
  104. .image-bg {
  105. position: absolute;
  106. top: 0;
  107. left: 0;
  108. right: 0;
  109. bottom: 0;
  110. width: 100%;
  111. height: 100%;
  112. opacity: 1;
  113. border-radius: 12rpx 12rpx 0 0;
  114. z-index: 2;
  115. }
  116. .image {
  117. width: 100%;
  118. height: 100%;
  119. opacity: 1;
  120. border-radius: 12rpx 12rpx 0 0;
  121. }
  122. }
  123. .title {
  124. margin-top: 24rpx;
  125. padding: 0 20rpx 10rpx;
  126. font-size: 32rpx;
  127. font-weight: 500;
  128. color: #333333;
  129. width: 345rpx;
  130. }
  131. .hot-price {
  132. display: flex;
  133. justify-content: flex-start;
  134. align-items: center;
  135. width: 100%;
  136. padding: 0 10rpx;
  137. // padding: 14rpx 0 30rpx;
  138. .hotPrice-box {
  139. padding: 2rpx 6rpx;
  140. background: linear-gradient(90deg, #c79a4c, #f9df7f);
  141. border-radius: 5rpx;
  142. text-align: center;
  143. line-height: 28rpx;
  144. font-size: 20rpx;
  145. font-family: Source Han Sans CN;
  146. font-weight: 400;
  147. color: #ffffff;
  148. }
  149. .price {
  150. margin-left: 10rpx;
  151. font-size: 36rpx;
  152. color: #ff6b2e;
  153. font-weight: 500;
  154. display: flex;
  155. width: 100%;
  156. justify-content: flex-start;
  157. align-items: center;
  158. image {
  159. width: 24rpx;
  160. height: 26rpx;
  161. }
  162. .jf {
  163. font-size: 20rpx;
  164. }
  165. .give-jf {
  166. display: inline-block;
  167. padding: 8rpx;
  168. background: linear-gradient(90deg, #FF834D, #FF2600);
  169. border-radius: 12rpx 0px 12rpx 0px;
  170. font-size: 22rpx;
  171. font-weight: 500;
  172. color: #FFFFFF;
  173. margin-left: 22rpx;
  174. }
  175. .ot-pirce {
  176. margin-left: 7rpx;
  177. font-size: 26rpx;
  178. font-weight: 500;
  179. text-decoration: line-through;
  180. color: #999999;
  181. align-self: flex-end;
  182. }
  183. }
  184. .yuanPrice {
  185. margin-left: 10rpx;
  186. font-size: 20rpx;
  187. font-family: PingFang SC;
  188. font-weight: 500;
  189. text-decoration: line-through;
  190. color: #999999;
  191. }
  192. .cart-icon {
  193. image {
  194. width: 44rpx;
  195. height: 44rpx;
  196. }
  197. }
  198. }
  199. }
  200. }
  201. </style>