xfqzq.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  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="http://ygs.hqgjsmc.com/baseimg/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/goods_details/index?id='+ item.product_id)">
  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. getXfList
  41. } from '@/api/activity.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. getXfList({
  79. page: obj.page,
  80. limit: obj.limit
  81. }).then(res => {
  82. console.log(res)
  83. obj.list = obj.list.concat(res.data.list)
  84. obj.page++
  85. if (obj.limit == res.data.list.length) {
  86. obj.loadingType = 'more'
  87. } else {
  88. obj.loadingType = 'noMore'
  89. }
  90. })
  91. }
  92. }
  93. }
  94. </script>
  95. <style lang="scss">
  96. page {
  97. background-color: #fff;
  98. height: auto;
  99. min-height: 100%;
  100. }
  101. .status_bar {
  102. height: var(--status-bar-height);
  103. width: 100%;
  104. background: #f32b09;
  105. }
  106. .top-bg {
  107. background: #f32b09;
  108. justify-content: center;
  109. align-items: center;
  110. padding: 30rpx 0;
  111. image {
  112. width: 700rpx;
  113. height: 350rpx;
  114. border-radius: 20rpx;
  115. }
  116. }
  117. .bastgood-box {
  118. background-color: #ffffff;
  119. position: relative;
  120. .bg-bg {
  121. position: absolute;
  122. height: 380rpx;
  123. width: 750rpx;
  124. top: 0;
  125. left: 0;
  126. background: linear-gradient(180deg, #f32b09, #fff);
  127. }
  128. .guess-item {
  129. display: flex;
  130. width: 710rpx;
  131. background: #ffffff;
  132. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  133. border-radius: 10rpx;
  134. padding: 15rpx;
  135. margin: 0rpx auto 20rpx;
  136. position: relative;
  137. image {
  138. width: 236rpx;
  139. height: 236rpx;
  140. border-radius: 10rpx;
  141. }
  142. .guess-box {
  143. padding: 12rpx 0 15rpx 24rpx;
  144. width: 436rpx;
  145. display: flex;
  146. flex-direction: column;
  147. justify-content: space-between;
  148. .title {
  149. font-size: 32rpx;
  150. padding-left: 4rpx;
  151. font-family: PingFang SC;
  152. font-weight: bold;
  153. color: #333333;
  154. width: 368rpx;
  155. line-height: 36rpx;
  156. }
  157. .price-box {
  158. // margin-top: 76rpx;
  159. justify-content: flex-start;
  160. image {
  161. width: 28rpx;
  162. }
  163. .jiang {
  164. padding-left: 4rpx;
  165. font-size: 24rpx;
  166. font-family: PingFang SC;
  167. font-weight: bold;
  168. color: #b59467;
  169. }
  170. }
  171. .price {
  172. font-size: 36rpx;
  173. font-family: PingFang SC;
  174. font-weight: bold;
  175. color: #ff1135;
  176. display: flex;
  177. align-items: center;
  178. .yuanprice {
  179. font-size: 26rpx;
  180. font-family: PingFang SC;
  181. font-weight: 500;
  182. text-decoration: line-through;
  183. color: #999999;
  184. padding-left: 6rpx;
  185. }
  186. }
  187. .btn {
  188. width: 138rpx;
  189. height: 52rpx;
  190. background: #ff4c4c;
  191. border-radius: 26rpx;
  192. font-size: 26rpx;
  193. font-family: PingFang SC;
  194. font-weight: 500;
  195. color: #ffffff;
  196. line-height: 52rpx;
  197. text-align: center;
  198. position: absolute;
  199. bottom: 25rpx;
  200. right: 25rpx;
  201. }
  202. }
  203. }
  204. }
  205. .body-title {
  206. height: 80rpx;
  207. text-align: center;
  208. font-size: 35rpx;
  209. background-color: #f32b09;
  210. position: relative;
  211. .header {
  212. position: absolute;
  213. left: 0;
  214. top: 0;
  215. width: 100%;
  216. font-size: 36rpx;
  217. font-family: PingFang SC;
  218. font-weight: bold;
  219. color: #fffeff;
  220. height: 80rpx;
  221. font-size: 36rpx;
  222. font-weight: 700;
  223. z-index: 9;
  224. display: flex;
  225. justify-content: center;
  226. align-items: center;
  227. }
  228. .goback-box {
  229. position: absolute;
  230. left: 18rpx;
  231. top: 0;
  232. height: 80rpx;
  233. display: flex;
  234. align-items: center;
  235. }
  236. .goback {
  237. z-index: 100;
  238. width: 34rpx;
  239. height: 34rpx;
  240. }
  241. }
  242. </style>