金诚优选前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

151 lines
3.2 KiB

  1. <template>
  2. <view>
  3. <lf-nav title="秒杀专场" :showIcon="true" bgColor="#fff"></lf-nav>
  4. <view class="content">
  5. <view class="card" v-for="(item, index) in list" :key="index"
  6. @click="$url('/pages/shop/goodsdetail?type=seckill&id='+ item.goods.id)">
  7. <view class="goods-img">
  8. <image class="img" :src="item.goods.img"></image>
  9. <view class="tips">TODO已有0人购买</view>
  10. </view>
  11. <view class="goods-info">
  12. <view>
  13. <view class="lf-line-2 title">{{ item.goods.name }}</view>
  14. <view class="desc">距离开始还剩余 20:34:18</view>
  15. </view>
  16. <view class="lf-row-between">
  17. <view class="price">
  18. <text>¥{{ item.goods.max_price }}</text>
  19. <text>¥{{ item.goods.market_price }}</text>
  20. </view>
  21. <view class="btn" hover-class="lf-opacity">立即秒杀</view>
  22. </view>
  23. </view>
  24. </view>
  25. <lf-nocontent src="/static/images/empty.png" v-if="list.length <= 0"></lf-nocontent>
  26. </view>
  27. <u-back-top :scrollTop="pageScrollTop"></u-back-top>
  28. </view>
  29. </template>
  30. <script>
  31. export default {
  32. data(){
  33. return {
  34. list: []
  35. }
  36. },
  37. onLoad(){
  38. this.getSeckillList();
  39. },
  40. methods: {
  41. getSeckillList(){
  42. this.$http.get({
  43. api: 'api/seckill/all'
  44. }).then(res => {
  45. console.log("----", res);
  46. this.list = res.data.data;
  47. })
  48. }
  49. }
  50. }
  51. </script>
  52. <style>
  53. page{
  54. background-color: #F8F8F8;
  55. }
  56. </style>
  57. <style lang="scss" scoped="scoped">
  58. .content{
  59. padding: 30rpx 32rpx;
  60. width: 750rpx;
  61. height: max-content;
  62. box-sizing: border-box;
  63. .card{
  64. width: 686rpx;
  65. height: 260rpx;
  66. background: #FFFFFF;
  67. border-radius: 20rpx;
  68. box-sizing: border-box;
  69. padding: 30rpx;
  70. display: flex;
  71. &:nth-child(n+2){
  72. margin-top: 30rpx;
  73. }
  74. .goods-img{
  75. width: 200rpx;
  76. height: 200rpx;
  77. border-radius: 10rpx;
  78. overflow: hidden;
  79. position: relative;
  80. margin-right: 15rpx;
  81. .img{
  82. width: 100%;
  83. height: 100%;
  84. background-color: #EEEEEE;
  85. }
  86. .tips{
  87. position: absolute;
  88. bottom: 0;
  89. left: 0;
  90. width: 100%;
  91. height: 37rpx;
  92. background-color: rgba(0,0,0,0.5);
  93. color: #FFFFFF;
  94. font-size: 22rpx;
  95. display: flex;
  96. justify-content: center;
  97. align-items: center;
  98. }
  99. }
  100. .goods-info{
  101. width: 410rpx;
  102. height: 200rpx;
  103. display: flex;
  104. flex-direction: column;
  105. justify-content: space-between;
  106. .title{
  107. font-size: 28rpx;
  108. color: #222222;
  109. font-weight: bold;
  110. }
  111. .desc{
  112. width: 281rpx;
  113. height: 35rpx;
  114. border-radius: 3rpx;
  115. background-color: #E9F2F2;
  116. font-size: 24rpx;
  117. color: #15716E;
  118. display: flex;
  119. justify-content: center;
  120. align-items: center;
  121. margin-top: 10rpx;
  122. }
  123. .price>text:nth-child(1){
  124. font-size: 36rpx;
  125. color: #F63434;
  126. font-weight: bold;
  127. }
  128. .price>text:nth-child(2){
  129. font-size: 24rpx;
  130. color: #777777;
  131. margin-left: 20rpx;
  132. text-decoration: line-through;
  133. }
  134. .btn{
  135. width: 142rpx;
  136. height: 60rpx;
  137. background: rgba(21, 113, 110, 0.05);
  138. border-radius: 36rpx;
  139. border: 2rpx solid #15716E;
  140. font-size: 26rpx;
  141. color: #15716E;
  142. display: flex;
  143. justify-content: center;
  144. align-items: center;
  145. }
  146. }
  147. }
  148. }
  149. </style>