app-pt-time.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <view class="app-pt-time dir-left-nowrap" :class="theme.key == 'a' ? 'default-back' : ''" :style="{'background-color': theme.key != 'a' ? theme.background : ''}">
  3. <image class="app-image" src="./../image/pt-icon.png"></image>
  4. <view class="app-title">限时火拼·超值低价</view>
  5. <view class="app-time-content" >
  6. <view class="app-name" v-if="!start_time">距离活动开始还有</view>
  7. <view class="app-name" v-else-if="end_time !== '0000-00-00 00:00:00'">距离结束仅剩</view>
  8. <view class="app-time-info dir-left-nowrap cross-center" v-if="end_time !== '0000-00-00 00:00:00' || !start_time">
  9. <text class="app-value">{{time_str.day}}</text>
  10. <text class="app-degree">天</text>
  11. <text class="app-value">{{time_str.hou}}</text>
  12. <text class="app-degree">时</text>
  13. <text class="app-value">{{time_str.min}}</text>
  14. <text class="app-degree">分</text>
  15. <text class="app-value">{{time_str.sec}}</text>
  16. <text class="app-degree">秒</text>
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. name: 'app-pt-time',
  24. props: {
  25. theme: Object,
  26. end_time: {
  27. type: String,
  28. default() {
  29. return '00';
  30. }
  31. },
  32. start_time: {
  33. type: Boolean,
  34. default() {
  35. return true;
  36. }
  37. },
  38. time_str: {
  39. type: Object,
  40. default() {
  41. return {}
  42. }
  43. }
  44. }
  45. }
  46. </script>
  47. <style scoped lang="scss">
  48. .default-back {
  49. background: linear-gradient(140deg, #ff5427, #ff3d3f,#ff2e4e, #ff2754);
  50. }
  51. .app-pt-time {
  52. height: #{88rpx};
  53. width: #{750rpx};
  54. .app-image {
  55. width: #{148rpx};
  56. height: #{88rpx};
  57. }
  58. .app-title {
  59. width: #{281rpx};
  60. color: white;
  61. margin-top: #{46rpx};
  62. font-size: #{22rpx};
  63. }
  64. .app-time-content {
  65. width: #{322rpx};
  66. height: #{88rpx};
  67. .app-name {
  68. width: #{322rpx};
  69. height: #{30rpx};
  70. font-size: #{20rpx};
  71. color: white;
  72. margin: #{5rpx} 0;
  73. text-align: center;
  74. }
  75. .app-time-info {
  76. height: #{48rpx};
  77. width: #{322rpx};
  78. text-align: center;
  79. .app-degree {
  80. font-size: #{23rpx};
  81. color: #ffffff;
  82. margin: 0 #{6rpx};
  83. }
  84. .app-value {
  85. display: inline-block;
  86. min-width: #{40rpx};
  87. height: #{36rpx};
  88. line-height: #{36rpx};
  89. border-radius: #{4rpx};
  90. background-color: white;
  91. text-align: center;
  92. font-size: #{19rpx};
  93. }
  94. }
  95. }
  96. }
  97. </style>