app-goods-time.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <view class="app-goods-time">
  3. <view class="app-image" :class="theme + '-m-back ' + theme"></view>
  4. <view class="app-goods-info">
  5. <text>¥</text>
  6. <text class="app-goods-price">{{goods.price}}</text>
  7. <text v-if="status !== 0 && goods.is_sales == 1" class="app-goods-sales">已抢{{goods.sales}}{{goods.unit}},剩{{goods.goods_stock}}{{goods.unit}}</text>
  8. </view>
  9. <view class="app-content dir-top-nowrap">
  10. <view class="app-text" v-if="status === 1">距离结束仅剩</view>
  11. <view class="app-text" v-if="status === 0">距离开始仅剩</view>
  12. <view class="app-text over-text" v-if="status === 2">活动已结束</view>
  13. <view class="app-time cross-center main-around" v-if="status !== 2">
  14. <text class="app-num app-right" v-if="day > 0">{{day}}</text>
  15. <text v-if="day > 0">天</text>
  16. <text class="app-num app-right">{{hour}}</text>
  17. <text>时</text>
  18. <text class="app-num app-right">{{minute}}</text>
  19. <text>分</text>
  20. <text class="app-num app-right">{{second}}</text>
  21. <text>秒</text>
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. export default {
  28. name: 'app-goods-time',
  29. props: {
  30. status: {
  31. type: Number,
  32. },
  33. goods: {
  34. type: Object
  35. },
  36. hour: {
  37. type: String,
  38. default() {
  39. return 0;
  40. }
  41. },
  42. minute: {
  43. type: String,
  44. default() {
  45. return 0;
  46. }
  47. },
  48. second: {
  49. type: String,
  50. default() {
  51. return 0;
  52. }
  53. },
  54. day: {
  55. type: Number,
  56. default() {
  57. return 0;
  58. }
  59. },
  60. theme: String
  61. },
  62. }
  63. </script>
  64. <style scoped lang="scss">
  65. .app-goods-time {
  66. width: #{750rpx};
  67. height: #{88rpx};
  68. position: relative;
  69. .app-image {
  70. width: #{750rpx};
  71. height: #{88rpx};
  72. background-repeat: no-repeat;
  73. background-size: 100% 100%;
  74. }
  75. .app-goods-info {
  76. position: absolute;
  77. left: #{24rpx};
  78. bottom: #{12rpx};
  79. color: #fff;
  80. font-size: #{32rpx};
  81. .app-goods-price {
  82. font-family: DIN;
  83. font-size: #{56rpx};
  84. }
  85. .app-goods-sales {
  86. margin-left: #{16rpx};
  87. font-size: #{20rpx};
  88. }
  89. }
  90. .app-content {
  91. position: absolute;
  92. right: #{20rpx};
  93. top: 0;
  94. height: #{88rpx};
  95. width: #{300rpx};
  96. .app-text {
  97. font-size: #{22rpx};
  98. color: #ffffff;
  99. text-align: center;
  100. margin-top: #{2rpx};
  101. }
  102. .over-text {
  103. font-size: #{32rpx};
  104. line-height: #{88rpx};
  105. margin-top: 0;
  106. }
  107. .app-time {
  108. color: white;
  109. height: #{40rpx};
  110. font-size: #{26rpx};
  111. margin-top: #{6rpx};
  112. .app-num {
  113. display: inline-block;
  114. width: #{44rpx};
  115. height: #{40rpx};
  116. line-height: #{40rpx};
  117. background-color:white;
  118. border-radius: #{8rpx};
  119. color: #353535;
  120. text-align: center;
  121. }
  122. .app-right {
  123. margin: 0 #{4rpx};
  124. }
  125. }
  126. }
  127. }
  128. </style>