xfqzq.vue 5.2 KB

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