bdzq.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. <template>
  2. <view class="content">
  3. <!-- #ifdef APP-PLUS -->
  4. <view class="status_bar"></view>
  5. <!-- #endif -->
  6. <view class="body-title">
  7. <view class="goback-box" @click="toBack">
  8. <image class="goback" src="../../static/icon/fanhui.png" mode=""></image>
  9. </view>
  10. <view class="header">爆品专区</view>
  11. </view>
  12. <view class="top-bg flex">
  13. <image src="../../static/img/bd-mbg.png" mode=""></image>
  14. </view>
  15. <view class="bastgood-box">
  16. <view class="bg-bg">
  17. </view>
  18. <view v-for="(item, index) in list" :key="item.id" class="guess-item">
  19. <image :src="item.image"></image>
  20. <view class="guess-box">
  21. <view class="title clamp2">{{item.store_name}}</view>
  22. <view class="info">
  23. <view class="price-box flex">
  24. <image src="../../static/icon/xfq.png" mode="widthFix"></image>
  25. <view class="jiang">赠送积分{{item.give_integral*1}}个</view>
  26. </view>
  27. <view class="price">¥{{ item.price }}
  28. <view class="yuanprice">¥{{item.ot_price*1}}</view>
  29. </view>
  30. </view>
  31. <view class="btn" @click.stop="navTo('/pages/product/product?id=' + item.id + '&is_xf=0&is_bk=1')">
  32. 立即购买</view>
  33. </view>
  34. </view>
  35. <uni-load-more :status="loadingType"></uni-load-more>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. import {
  41. getProducts
  42. } from '@/api/product.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. getProducts({
  80. sid: 2,
  81. page: obj.page,
  82. limit: obj.limit
  83. }).then(res => {
  84. console.log(res)
  85. obj.list = obj.list.concat(res.data)
  86. obj.page++
  87. if (obj.limit == res.data.length) {
  88. obj.loadingType = 'more'
  89. } else {
  90. obj.loadingType = 'noMore'
  91. }
  92. })
  93. }
  94. }
  95. }
  96. </script>
  97. <style lang="scss">
  98. page {
  99. background: #fff;
  100. height: auto;
  101. min-height: 100%;
  102. }
  103. .status_bar {
  104. height: var(--status-bar-height);
  105. width: 100%;
  106. background: #ff6100;
  107. }
  108. .body-title {
  109. height: 80rpx;
  110. text-align: center;
  111. font-size: 35rpx;
  112. background-color: #ff6100;
  113. position: relative;
  114. .header {
  115. position: absolute;
  116. left: 0;
  117. top: 0;
  118. width: 100%;
  119. font-size: 36rpx;
  120. font-family: PingFang SC;
  121. font-weight: bold;
  122. color: #fffeff;
  123. height: 80rpx;
  124. font-size: 36rpx;
  125. font-weight: 700;
  126. z-index: 9;
  127. display: flex;
  128. justify-content: center;
  129. align-items: center;
  130. }
  131. .goback-box {
  132. position: absolute;
  133. left: 18rpx;
  134. top: 0;
  135. height: 80rpx;
  136. display: flex;
  137. align-items: center;
  138. }
  139. .goback {
  140. z-index: 100;
  141. width: 34rpx;
  142. height: 34rpx;
  143. }
  144. }
  145. .top-bg {
  146. background: #ff6100;
  147. justify-content: center;
  148. align-items: center;
  149. padding: 30rpx 0;
  150. image {
  151. width: 700rpx;
  152. height: 350rpx;
  153. border-radius: 20rpx;
  154. }
  155. }
  156. .bastgood-box {
  157. background-color: #ffffff;
  158. position: relative;
  159. .bg-bg {
  160. position: absolute;
  161. height: 380rpx;
  162. width: 750rpx;
  163. top: 0;
  164. left: 0;
  165. background: linear-gradient(180deg, #ff6100, #fff);
  166. }
  167. .guess-item {
  168. display: flex;
  169. width: 710rpx;
  170. background: #ffffff;
  171. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  172. border-radius: 10rpx;
  173. padding: 15rpx;
  174. margin: 0rpx auto 20rpx;
  175. position: relative;
  176. image {
  177. width: 236rpx;
  178. height: 236rpx;
  179. border-radius: 10rpx;
  180. }
  181. .guess-box {
  182. padding: 12rpx 0 15rpx 24rpx;
  183. width: 436rpx;
  184. display: flex;
  185. flex-direction: column;
  186. justify-content: space-between;
  187. .title {
  188. font-size: 32rpx;
  189. padding-left: 4rpx;
  190. font-family: PingFang SC;
  191. font-weight: bold;
  192. color: #333333;
  193. width: 368rpx;
  194. line-height: 36rpx;
  195. }
  196. .price-box {
  197. // margin-top: 76rpx;
  198. justify-content: flex-start;
  199. image {
  200. width: 28rpx;
  201. }
  202. .jiang {
  203. padding-left: 4rpx;
  204. font-size: 24rpx;
  205. font-family: PingFang SC;
  206. font-weight: bold;
  207. color: #b59467;
  208. }
  209. }
  210. .price {
  211. font-size: 36rpx;
  212. font-family: PingFang SC;
  213. font-weight: bold;
  214. color: #ff1135;
  215. display: flex;
  216. align-items: center;
  217. .yuanprice {
  218. font-size: 26rpx;
  219. font-family: PingFang SC;
  220. font-weight: 500;
  221. text-decoration: line-through;
  222. color: #999999;
  223. padding-left: 6rpx;
  224. }
  225. }
  226. .btn {
  227. width: 138rpx;
  228. height: 52rpx;
  229. background: #ff4c4c;
  230. border-radius: 26rpx;
  231. font-size: 26rpx;
  232. font-family: PingFang SC;
  233. font-weight: 500;
  234. color: #ffffff;
  235. line-height: 52rpx;
  236. text-align: center;
  237. position: absolute;
  238. bottom: 25rpx;
  239. right: 25rpx;
  240. }
  241. }
  242. }
  243. }
  244. </style>