rxbd.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. <template>
  2. <view class="content">
  3. <!-- #ifdef APP-PLUS -->
  4. <view class="status_bar"></view>
  5. <!-- #endif -->
  6. <view class="top-bg">
  7. <image src="../../static/img/rx-mbg.png" mode="widthFix" style="width: 750rpx;"></image>
  8. <view class="body-title">
  9. <view class="goback-box" @click="toBack">
  10. <image class="goback" src="../../static/icon/fanhui.png" mode=""></image>
  11. </view>
  12. <view class="header">热销榜</view>
  13. </view>
  14. </view>
  15. <view class="bastgood-box">
  16. <view v-for="(item, index) in list" :key="index" class="guess-item">
  17. <image :src="item.image"></image>
  18. <view class="guess-box flex">
  19. <view class="title clamp2">{{ item.store_name}}</view>
  20. <view class="">
  21. <view class="price-box flex" v-if="(item.ot_price*1 - item.price*1) > 0">
  22. <view class="yuanprice">{{ item.ot_price*1 }}</view>
  23. <image src="../../static/icon/down.png" mode=""></image>
  24. <view class="jiang">直降{{ (item.ot_price*1 - item.price*1).toFixed(0) }}元</view>
  25. </view>
  26. <view class="price">¥{{ item.price*1}}</view>
  27. </view>
  28. <view class="btn" @click.stop="navTo('/pages/product/product?id='+ item.id)">
  29. 立即购买</view>
  30. </view>
  31. </view>
  32. <uni-load-more :status="loadingType"></uni-load-more>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. import {
  38. getProducts
  39. } from '@/api/product.js'
  40. import {
  41. groom4
  42. } from '@/api/index.js'
  43. export default {
  44. data() {
  45. return {
  46. page: 1,
  47. limit: 10,
  48. list: [],
  49. loadingType: 'more'
  50. }
  51. },
  52. onLoad() {
  53. this.getProducts()
  54. },
  55. onShow() {
  56. },
  57. onReachBottom() {
  58. this.getProducts()
  59. },
  60. onReady() {
  61. },
  62. methods: {
  63. navTo(url) {
  64. uni.navigateTo({
  65. url
  66. })
  67. },
  68. toBack() {
  69. uni.switchTab({
  70. url: '/pages/index/index'
  71. })
  72. },
  73. getProducts() {
  74. let obj = this
  75. if (obj.loadingType == 'noMore' || obj.loadingType == 'loading') {
  76. return
  77. }
  78. obj.loadingType = 'loading'
  79. groom4({
  80. page: obj.page,
  81. limit: obj.limit
  82. }).then(res => {
  83. console.log(res)
  84. obj.list = obj.list.concat(res.data.list)
  85. obj.page++
  86. if (obj.limit == res.data.length) {
  87. obj.loadingType = 'more'
  88. } else {
  89. obj.loadingType = 'noMore'
  90. }
  91. })
  92. }
  93. }
  94. }
  95. </script>
  96. <style lang="scss">
  97. page {
  98. background: #fff;
  99. height: auto;
  100. min-height: 100%;
  101. }
  102. .top-bg {
  103. position: relative;
  104. width: 750rpx;
  105. height: 591rpx;
  106. image {
  107. width: 750rpx;
  108. height: 591rpx;
  109. position: absolute;
  110. }
  111. }
  112. .status_bar {
  113. height: var(--status-bar-height);
  114. width: 100%;
  115. // background: #dcae6d;
  116. }
  117. .body-title {
  118. height: 80rpx;
  119. text-align: center;
  120. font-size: 35rpx;
  121. // background-color:#dcae6d;
  122. position: relative;
  123. .header {
  124. position: absolute;
  125. left: 0;
  126. top: 0;
  127. width: 100%;
  128. font-size: 36rpx;
  129. font-family: PingFang SC;
  130. font-weight: bold;
  131. color: #fffeff;
  132. height: 80rpx;
  133. font-size: 36rpx;
  134. font-weight: 700;
  135. z-index: 9;
  136. display: flex;
  137. justify-content: center;
  138. align-items: center;
  139. }
  140. .goback-box {
  141. position: absolute;
  142. left: 18rpx;
  143. top: 0;
  144. height: 80rpx;
  145. display: flex;
  146. align-items: center;
  147. }
  148. .goback {
  149. z-index: 100;
  150. width: 34rpx;
  151. height: 34rpx;
  152. }
  153. }
  154. .bastgood-box {
  155. // margin-top: 20rpx;
  156. background-color: #ffffff;
  157. padding: 0rpx 0 40rpx;
  158. // border-radius: 70rpx 70rpx 0 0;
  159. .bast-bg {
  160. width: 376rpx;
  161. height: 34rpx;
  162. margin: 0 auto;
  163. image {
  164. width: 100%;
  165. height: 100%;
  166. }
  167. }
  168. .guess-item {
  169. display: flex;
  170. width: 710rpx;
  171. background: #ffffff;
  172. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  173. border-radius: 10rpx;
  174. // padding: 15rpx;
  175. margin: 0 auto 20rpx;
  176. position: relative;
  177. image {
  178. width: 236rpx;
  179. height: 236rpx;
  180. border-radius: 10rpx;
  181. }
  182. .guess-box {
  183. padding: 12rpx 0 12rpx 24rpx;
  184. width: 436rpx;
  185. flex-direction: column;
  186. justify-content: space-between;
  187. align-items: flex-start;
  188. .title {
  189. font-size: 32rpx;
  190. padding-left: 4rpx;
  191. font-family: PingFang SC;
  192. font-weight: bold;
  193. color: #333333;
  194. width: 368rpx;
  195. line-height: 36rpx;
  196. }
  197. .price-box {
  198. justify-content: flex-start;
  199. .yuanprice {
  200. font-size: 26rpx;
  201. font-family: PingFang SC;
  202. font-weight: 500;
  203. text-decoration: line-through;
  204. color: #999999;
  205. padding-right: 6rpx;
  206. }
  207. image {
  208. width: 16rpx;
  209. height: 18rpx;
  210. }
  211. .jiang {
  212. padding-left: 2rpx;
  213. font-size: 24rpx;
  214. font-family: PingFang SC;
  215. font-weight: bold;
  216. color: #b59467;
  217. }
  218. }
  219. .price {
  220. font-size: 36rpx;
  221. font-family: PingFang SC;
  222. font-weight: bold;
  223. color: #ff1135;
  224. }
  225. .btn {
  226. width: 138rpx;
  227. height: 52rpx;
  228. background: #FF4C4C;
  229. border-radius: 26rpx;
  230. font-size: 26rpx;
  231. font-family: PingFang SC;
  232. font-weight: 500;
  233. color: #ffffff;
  234. line-height: 52rpx;
  235. text-align: center;
  236. position: absolute;
  237. bottom: 25rpx;
  238. right: 25rpx;
  239. }
  240. }
  241. }
  242. }
  243. </style>