app-goods-time.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <template>
  2. <view class="app-goods-time">
  3. <view class="app-image" :class="theme + '-m-back ' + theme"></view>
  4. <view class="app-content dir-top-nowrap">
  5. <view class="app-text" v-if="miaosha_status === 1">距离结束仅剩</view>
  6. <view class="app-text" v-if="miaosha_status === 2">距离开始仅剩</view>
  7. <view class="app-text over-text" v-if="miaosha_status === 0">活动已结束</view>
  8. <view class="app-time cross-center main-around" v-if="miaosha_status !== 0">
  9. <text class="app-num app-right" v-if="day > 0">{{day}}</text>
  10. <text v-if="day > 0">天</text>
  11. <text class="app-num app-right">{{hour}}</text>
  12. <text>:</text>
  13. <text class="app-num app-right">{{minute}}</text>
  14. <text>:</text>
  15. <text class="app-num app-right">{{second}}</text>
  16. </view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. export default {
  22. name: 'app-goods-time',
  23. props: {
  24. miaosha_status: {
  25. type: Number,
  26. },
  27. hour: {
  28. type: Number,
  29. default() {
  30. return 0;
  31. }
  32. },
  33. minute: {
  34. type: Number,
  35. default() {
  36. return 0;
  37. }
  38. },
  39. second: {
  40. type: Number,
  41. default() {
  42. return 0;
  43. }
  44. },
  45. day: {
  46. type: Number,
  47. default() {
  48. return 0;
  49. }
  50. },
  51. theme: String
  52. },
  53. }
  54. </script>
  55. <style scoped lang="scss">
  56. .app-goods-time {
  57. width: #{750rpx};
  58. height: #{88rpx};
  59. position: relative;
  60. .app-image {
  61. width: #{750rpx};
  62. height: #{88rpx};
  63. background-image: url('../image/miaosha-bg.png');
  64. background-repeat: no-repeat;
  65. background-size: 100% 100%;
  66. }
  67. .app-content {
  68. position: absolute;
  69. right: #{20rpx};
  70. top: 0;
  71. height: #{88rpx};
  72. width: #{230rpx};
  73. .app-text {
  74. font-size: #{22rpx};
  75. color: #ffffff;
  76. text-align: center;
  77. margin-top: #{6rpx};
  78. }
  79. .over-text {
  80. font-size: #{32rpx};
  81. line-height: #{88rpx};
  82. margin-top: 0;
  83. }
  84. .app-time {
  85. color: white;
  86. height: #{40rpx};
  87. font-size: #{26rpx};
  88. margin-top: #{6rpx};
  89. .app-num {
  90. display: inline-block;
  91. width: #{44rpx};
  92. height: #{40rpx};
  93. line-height: #{40rpx};
  94. background-color:white;
  95. border-radius: #{8rpx};
  96. color: #353535;
  97. text-align: center;
  98. }
  99. .app-right {
  100. margin: 0 #{4rpx};
  101. }
  102. }
  103. }
  104. }
  105. </style>