bdzq.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  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" @click.stop="navTo('/pages/product/product?id=' + item.id + '&is_xf=0&is_bk=1')">
  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 class="jiang">赠送积分</view>
  27. </view>
  28. <view class="price">¥{{ item.price }}
  29. <view class="yuanprice">¥{{item.ot_price*1}}</view>
  30. </view>
  31. </view>
  32. <view class="btn" >
  33. 立即购买</view>
  34. </view>
  35. </view>
  36. <uni-load-more :status="loadingType"></uni-load-more>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. import {
  42. getProducts
  43. } from '@/api/product.js'
  44. export default {
  45. data() {
  46. return {
  47. page: 1,
  48. limit: 10,
  49. list: [],
  50. loadingType: 'more'
  51. }
  52. },
  53. onLoad() {
  54. this.getProducts()
  55. },
  56. onShow() {
  57. },
  58. onReachBottom() {
  59. this.getProducts()
  60. },
  61. onReady() {
  62. },
  63. methods: {
  64. navTo(url) {
  65. uni.navigateTo({
  66. url
  67. })
  68. },
  69. toBack() {
  70. uni.switchTab({
  71. url: '/pages/index/index'
  72. })
  73. },
  74. getProducts() {
  75. let obj = this
  76. if (obj.loadingType == 'noMore' || obj.loadingType == 'loading') {
  77. return
  78. }
  79. obj.loadingType = 'loading'
  80. getProducts({
  81. sid: 2,
  82. page: obj.page,
  83. limit: obj.limit
  84. }).then(res => {
  85. console.log(res)
  86. obj.list = obj.list.concat(res.data)
  87. obj.page++
  88. if (obj.limit == res.data.length) {
  89. obj.loadingType = 'more'
  90. } else {
  91. obj.loadingType = 'noMore'
  92. }
  93. })
  94. }
  95. }
  96. }
  97. </script>
  98. <style lang="scss">
  99. page {
  100. background: #fff;
  101. height: auto;
  102. min-height: 100%;
  103. }
  104. .status_bar {
  105. height: var(--status-bar-height);
  106. width: 100%;
  107. background: #ff6100;
  108. }
  109. .body-title {
  110. height: 80rpx;
  111. text-align: center;
  112. font-size: 35rpx;
  113. background-color: #ff6100;
  114. position: relative;
  115. .header {
  116. position: absolute;
  117. left: 0;
  118. top: 0;
  119. width: 100%;
  120. font-size: 36rpx;
  121. font-family: PingFang SC;
  122. font-weight: bold;
  123. color: #fffeff;
  124. height: 80rpx;
  125. font-size: 36rpx;
  126. font-weight: 700;
  127. z-index: 9;
  128. display: flex;
  129. justify-content: center;
  130. align-items: center;
  131. }
  132. .goback-box {
  133. position: absolute;
  134. left: 18rpx;
  135. top: 0;
  136. height: 80rpx;
  137. display: flex;
  138. align-items: center;
  139. }
  140. .goback {
  141. z-index: 100;
  142. width: 34rpx;
  143. height: 34rpx;
  144. }
  145. }
  146. .top-bg {
  147. background: #ff6100;
  148. justify-content: center;
  149. align-items: center;
  150. padding: 30rpx 0;
  151. image {
  152. width: 700rpx;
  153. height: 350rpx;
  154. border-radius: 20rpx;
  155. }
  156. }
  157. .bastgood-box {
  158. background-color: #ffffff;
  159. position: relative;
  160. .bg-bg {
  161. position: absolute;
  162. height: 380rpx;
  163. width: 750rpx;
  164. top: 0;
  165. left: 0;
  166. background: linear-gradient(180deg, #ff6100, #fff);
  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: 0rpx 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 15rpx 24rpx;
  184. width: 436rpx;
  185. display: flex;
  186. flex-direction: column;
  187. justify-content: space-between;
  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. // margin-top: 76rpx;
  199. justify-content: flex-start;
  200. image {
  201. width: 28rpx;
  202. }
  203. .jiang {
  204. padding-left: 4rpx;
  205. font-size: 24rpx;
  206. font-family: PingFang SC;
  207. font-weight: bold;
  208. color: #b59467;
  209. }
  210. }
  211. .price {
  212. font-size: 36rpx;
  213. font-family: PingFang SC;
  214. font-weight: bold;
  215. color: #ff1135;
  216. display: flex;
  217. align-items: center;
  218. .yuanprice {
  219. font-size: 26rpx;
  220. font-family: PingFang SC;
  221. font-weight: 500;
  222. text-decoration: line-through;
  223. color: #999999;
  224. padding-left: 6rpx;
  225. }
  226. }
  227. .btn {
  228. width: 138rpx;
  229. height: 52rpx;
  230. background: #ff4c4c;
  231. border-radius: 26rpx;
  232. font-size: 26rpx;
  233. font-family: PingFang SC;
  234. font-weight: 500;
  235. color: #ffffff;
  236. line-height: 52rpx;
  237. text-align: center;
  238. position: absolute;
  239. bottom: 25rpx;
  240. right: 25rpx;
  241. }
  242. }
  243. }
  244. }
  245. </style>