index.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. <template>
  2. <view class="dailyOffer">
  3. <view class="top-box">
  4. <view class="position-box">
  5. <image class="back" src="@/static/back-btn.png" @click="back" mode=""></image>
  6. <view class="topbar">
  7. 天天特惠
  8. </view>
  9. </view>
  10. </view>
  11. <view class="discounts-item" >
  12. <view class="info">
  13. <view class="title">
  14. 满200享 <text class="red">7</text> 折
  15. </view>
  16. <view class="time">
  17. 有效期至2023-10-27
  18. </view>
  19. </view>
  20. <view class="btn-box">
  21. <view class="num">
  22. 剩余 1 次
  23. </view>
  24. <view class="btn" @click="jump">
  25. 去使用
  26. </view>
  27. </view>
  28. </view>
  29. <!-- 列表 -->
  30. <zs-list class="store-box" mt="30rpx" @load="loadMore" :status="status">
  31. <view class="item" v-for="(item,index) in list" :key="index">
  32. <image class="icon" :src="item.src" mode=""></image>
  33. <view class="info">
  34. <view class="title">
  35. {{item.title}}
  36. </view>
  37. <view class="bottom-box">
  38. <view class="chart-box">
  39. <image class="chart" src="../../static/chart.png" mode=""></image>
  40. <view class="num">
  41. 直降¥{{item.num}}
  42. </view>
  43. </view>
  44. <view class="btn">
  45. 马上抢
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. </zs-list>
  51. </view>
  52. </template>
  53. <script>
  54. export default {
  55. data() {
  56. return {
  57. status: 'more',
  58. list: [{
  59. src: 'http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/gSNf2MrwFIob948da9579fe520ac36ef8fc3ae3164fe.png/1.png',
  60. title: '麓客岛,动物农场两大一小超值亲子套票',
  61. num:100
  62. },
  63. {
  64. src: 'http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/MFsbXSFsXbWH19aa1b7279e136e66a72212819c9e3d1.png/1.png',
  65. title: '维生素片',
  66. num:100
  67. },
  68. {
  69. src: 'http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/KsMua5e4gKl5ff07c6b0150fac72db44e877ce813381.png/1.png',
  70. title: '整理收纳',
  71. num:100
  72. },
  73. {
  74. src: 'http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/Qou1Wqc2PNzq84a88b1a352a1ffb04e2339b12d086fe.png/1.png',
  75. title: '水果',
  76. num:100
  77. }
  78. ]
  79. }
  80. },
  81. methods: {
  82. back(){
  83. var pages = getCurrentPages();
  84. if(pages.length == 1){
  85. uni.switchTab({
  86. url:'/pages/index/index'
  87. })
  88. }else{
  89. uni.navigateBack();
  90. }
  91. },
  92. loadMore() {},
  93. },
  94. }
  95. </script>
  96. <style lang="scss" scoped>
  97. .dailyOffer {
  98. background: #f5f5f5;
  99. .top-box{
  100. height: 518rpx;
  101. background: url('http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/d5Yi74GqHSzmda3003fff83f3a2813f666ea1424779f.png/1.png') no-repeat;
  102. background-size: 100% 100%;
  103. .position-box {
  104. position: absolute;
  105. width: 100%;
  106. top: 90rpx;
  107. left: 0;
  108. z-index: 2;
  109. display: flex;
  110. align-items: center;
  111. justify-content: center;
  112. .back {
  113. position: absolute;
  114. top: 10rpx;
  115. left: 30rpx;
  116. color: #fff;
  117. display: flex;
  118. align-items: center;
  119. font-size: 24rpx;
  120. width: 40rpx;
  121. height: 40rpx;
  122. filter: invert(1);
  123. }
  124. .topbar {
  125. font-size: 36rpx;
  126. color: #FFFFFF;
  127. text-align: center;
  128. font-weight: bold;
  129. font-family: DOUYUFont;
  130. }
  131. }
  132. }
  133. .discounts-item {
  134. display: flex;
  135. align-items: center;
  136. justify-content: space-between;
  137. background-color: rgb(239, 239, 239);
  138. background: url('http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/J1452FRMQ7j829a1e8e916847035cab4b65756cc8f30.png/1.png') no-repeat;
  139. background-repeat: no-repeat;
  140. background-size: 100% 144rpx;
  141. border-radius: 16rpx;
  142. height: 144rpx;
  143. padding: 0 30rpx 0 140rpx;
  144. margin: 20rpx 30rpx;
  145. .info {
  146. margin-left: 20rpx;
  147. .title {
  148. color: #0F0F0F;
  149. font-size: 30rpx;
  150. }
  151. .red{
  152. color: $uni-text-primary!important;
  153. }
  154. .time {
  155. color: #9a9a9a;
  156. font-size: 24rpx;
  157. margin-top: 15rpx;
  158. }
  159. }
  160. .btn-box{
  161. display: flex;
  162. flex-direction: column;
  163. align-items: center;
  164. .btn {
  165. width: 118rpx;
  166. height: 48rpx;
  167. line-height: 48rpx;
  168. text-align: center;
  169. font-size: 24rpx;
  170. background: linear-gradient(90deg, #FEFBF2 0%, #F7D188 100%);
  171. border-radius: 35rpx;
  172. color: #E5452C;
  173. margin-top: 15rpx;
  174. }
  175. .num{
  176. color: #fff;
  177. font-size: 24rpx;
  178. }
  179. }
  180. }
  181. .item {
  182. width: 690rpx;
  183. box-sizing: border-box;
  184. backdrop-filter: blur(10px);
  185. border-radius: 16rpx;
  186. background: #fff;
  187. display: flex;
  188. margin: 20rpx 30rpx 0;
  189. padding: 20rpx;
  190. .icon {
  191. width: 220rpx;
  192. height: 220rpx;
  193. border-radius: 16rpx;
  194. align-self: flex-end;
  195. }
  196. .info {
  197. flex: 1;
  198. margin-left: 20rpx;
  199. display: flex;
  200. flex-direction: column;
  201. justify-content: space-between;
  202. .title {
  203. color: #222222;
  204. font-weight: bold;
  205. font-size: 28rpx;
  206. margin-top: 10rpx;
  207. }
  208. .bottom-box {
  209. display: flex;
  210. align-items: center;
  211. justify-content: space-between;
  212. margin-top: 16rpx;
  213. .chart-box{
  214. position: relative;
  215. .chart{
  216. width: 252rpx;
  217. height: 98rpx;
  218. }
  219. .num{
  220. position: absolute;
  221. top: 25rpx;
  222. left: 35rpx;
  223. font-size: 24rpx;
  224. color: #FF4C3A;
  225. font-weight: bold;
  226. }
  227. }
  228. .btn {
  229. align-self: flex-end;
  230. width: 140rpx;
  231. height: 44rpx;
  232. line-height: 44rpx;
  233. text-align: center;
  234. background: #FF4C3A;
  235. border-radius: 30rpx;
  236. color: #fff;
  237. font-size: 28rpx;
  238. font-weight: bold;
  239. }
  240. }
  241. }
  242. }
  243. }
  244. </style>