gongyiList.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <template>
  2. <view class="main">
  3. <view class="list-box-h">
  4. <view v-for="(item, index) in list" :key="index" class="guess-item" @click="navToDetailPage(item)">
  5. <image :src="item.image"></image>
  6. <view class="guess-box">
  7. <view class="title clamp2">{{ item.store_name }}</view>
  8. <view class="flex itemContent">
  9. <view>
  10. <view class="price-box flex">
  11. <view class="yuanprice">{{ item.ot_price }}</view>
  12. <!-- <image src="../../static/img/jiantou.png" mode=""></image> -->
  13. <!-- <view class="jiang">直降{{ (item.ot_price - item.price).toFixed(2) }}元</view> -->
  14. </view>
  15. <view class="price" >¥{{ item.price }}</view>
  16. </view>
  17. <view class="btn">立即购买</view>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. <uni-load-more :status="loadingType"></uni-load-more>
  23. </view>
  24. </template>
  25. <script>
  26. import {
  27. getProducts
  28. } from '@/api/product.js';
  29. export default {
  30. data() {
  31. return {
  32. list: [],
  33. page: 1,
  34. limit: 10,
  35. loadingType: 'more',
  36. }
  37. },
  38. onLoad(opt) {
  39. this.getArticleList()
  40. },
  41. methods: {
  42. navToDetailPage(item) {
  43. uni.navigateTo({
  44. url: '/pages/product/product?id=' + item.id
  45. });
  46. },
  47. getArticleList() {
  48. let obj = this
  49. if (obj.loadingType == 'noMore' || obj.loadingType == 'loading') {
  50. return
  51. }
  52. obj.loadingType = 'loading'
  53. getProducts({
  54. page: obj.page,
  55. limit: obj.limit,
  56. is_gp:1 ,//设置是否vip商品
  57. // sid:obj.sid
  58. cid:8
  59. }).then(({
  60. data
  61. }) => {
  62. obj.list = obj.list.concat(data)
  63. obj.page++
  64. if (data.length == obj.limit) {
  65. obj.loadingType = 'more'
  66. } else {
  67. obj.loadingType = 'noMore'
  68. }
  69. })
  70. }
  71. }
  72. }
  73. </script>
  74. <style lang="scss" scoped>
  75. page {
  76. background-color: #fff;
  77. min-height: 100%;
  78. }
  79. .list-box-h {
  80. padding: 20rpx;
  81. }
  82. .guess-item {
  83. padding: 10rpx;
  84. display: flex;
  85. min-width: 100%;
  86. width: 0;
  87. margin-bottom: 20rpx;
  88. background: #ffffff;
  89. border-radius: 10rpx;
  90. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  91. image {
  92. width: 200rpx;
  93. height: 200rpx;
  94. border-radius: 10rpx;
  95. flex-shrink: 0;
  96. }
  97. .guess-box {
  98. width: 100%;
  99. padding: 5px;
  100. position: relative;
  101. .itemContent {
  102. position: absolute ;
  103. width: 100%;
  104. padding: 20rpx 10rpx;
  105. bottom: 0;
  106. right: 0;
  107. }
  108. .title {
  109. font-size: 30rpx;
  110. font-weight: bold;
  111. color: #333333;
  112. height: 2.5em;
  113. line-height: 1.25em;
  114. }
  115. .price-box {
  116. justify-content: flex-start;
  117. .yuanprice {
  118. font-size: 26rpx;
  119. font-family: PingFang SC;
  120. font-weight: 500;
  121. text-decoration: line-through;
  122. color: #999999;
  123. padding-right: 6rpx;
  124. }
  125. image {
  126. width: 14rpx;
  127. height: 16rpx;
  128. }
  129. .jiang {
  130. padding-left: 2rpx;
  131. font-size: 24rpx;
  132. font-family: PingFang SC;
  133. font-weight: bold;
  134. color: #b59467;
  135. }
  136. }
  137. .price {
  138. font-size: 36rpx;
  139. font-family: PingFang SC;
  140. font-weight: bold;
  141. color: #FF6F0F;
  142. }
  143. .btn {
  144. background: #16cc9f;
  145. border-radius: 28rpx;
  146. font-size: 28rpx;
  147. font-weight: 500;
  148. color: #ffffff;
  149. float: right;
  150. padding: 10rpx 20rpx;
  151. }
  152. }
  153. }
  154. </style>