cell.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <template>
  2. <view class="mall-cell marginB10 relative" @click="showDetail">
  3. <image :src="data.mallGoodsVO.cover" mode="widthFix" class="image" />
  4. <view class="paddingX8 paddingT8 font1 pre-wrap bold relative">
  5. {{ data.mallGoodsVO.name }}
  6. </view>
  7. <view class="flex-align-between paddingX8 paddingT5 paddingB7 width100">
  8. <view v-if="data.mallGoodsVO.residue === 0" class="presell_over">已售罄</view>
  9. <view v-else class="presell">限时秒杀价</view>
  10. <view class="flex-baseline">
  11. <view class="font4">¥</view>
  12. <view class="bold paddingL1 spike_price">{{ data.subjectPrice }}</view>
  13. </view>
  14. </view>
  15. <view class="spike_total">
  16. <view class="flex goods">
  17. <view class="goods_lave">
  18. {{ data.mallGoodsVO.residue }}
  19. </view>
  20. <view class="goods_slash marginX4">/</view>
  21. <view class="goods_total">
  22. {{ data.mallGoodsVO.inventoryQuantity }}
  23. </view>
  24. </view>
  25. <image class="img" :src="resource.spike_num" />
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. import resource from '@/utils/resource'
  31. export default {
  32. props: {
  33. data: Object,
  34. skipeType: String,
  35. startTime: String
  36. },
  37. data() {
  38. return {
  39. resource
  40. }
  41. },
  42. computed: {},
  43. methods: {
  44. showDetail() {
  45. if (this.data.mallGoodsVO.residue === 0) return
  46. this.$router.push('product', {
  47. id: this.data.mallGoodsVO.id,
  48. subjectId: this.data.subjectId,
  49. skipeType: this.skipeType,
  50. startTime: this.startTime
  51. })
  52. }
  53. }
  54. }
  55. </script>
  56. <style lang="scss" scoped>
  57. .mall-cell {
  58. color: #fff;
  59. overflow: hidden;
  60. border-radius: 16rpx;
  61. background: #000;
  62. display: inline-block;
  63. width: 100%;
  64. box-shadow: 0px 0px 4px 0px rgba(167, 110, 244, 0.25);
  65. .image {
  66. height: 0;
  67. width: 100%;
  68. }
  69. .presell {
  70. float: left;
  71. background: $color-theme;
  72. width: 144rpx;
  73. height: 46rpx;
  74. line-height: 46rpx;
  75. font-size: 24rpx;
  76. border-radius: 5rpx;
  77. color: #fff;
  78. text-align: center;
  79. margin-right: 10rpx;
  80. text-shadow: none;
  81. }
  82. .presell_over {
  83. float: left;
  84. background: linear-gradient(#f5cdd4, #fbf0d5);
  85. width: 144rpx;
  86. height: 46rpx;
  87. line-height: 46rpx;
  88. font-size: 24rpx;
  89. border-radius: 5rpx;
  90. color: #bc3737;
  91. text-align: center;
  92. margin-right: 10rpx;
  93. text-shadow: none;
  94. }
  95. .spike_price {
  96. font-size: 40rpx;
  97. }
  98. .spike_total {
  99. position: absolute;
  100. top: 0;
  101. right: 0;
  102. width: 152rpx;
  103. height: 64rpx;
  104. line-height: 64rpx;
  105. font-size: 30rpx;
  106. background: rgba(0, 0, 0, 0.4);
  107. border-radius: 0rpx 16rpx 0rpx 16rpx;
  108. z-index: 2;
  109. .goods {
  110. width: 100%;
  111. text-align: center;
  112. display: flex;
  113. justify-content: center;
  114. .goods_lave {
  115. color: $color-theme;
  116. font-size: 46rpx;
  117. text-shadow: -1px 0 #fff, 0 1px #fff, 1px 0 #fff, 0 -1px #fff;
  118. }
  119. .goods_slash {
  120. font-size: 46rpx;
  121. text-shadow: none;
  122. }
  123. .goods_total {
  124. text-shadow: none;
  125. }
  126. }
  127. .img {
  128. position: absolute;
  129. top: 14rpx;
  130. left: 20rpx;
  131. width: 116rpx;
  132. height: 40rpx;
  133. z-index: 1;
  134. }
  135. }
  136. }
  137. </style>