app-pt-time.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <template>
  2. <view class="app-pt-time dir-left-nowrap" :class="theme === 'a' ? 'default-back' : theme + '-m-back ' + theme">
  3. <view class="app-title">
  4. <text class="icon-text">限时拼团</text>
  5. <view class="price">
  6. <view class="current">
  7. ¥{{item.price}}
  8. <text>感恩回馈</text>
  9. </view>
  10. <view class="original">¥{{item.original_price}}</view>
  11. </view>
  12. </view>
  13. <view class="app-time-content" style="background-color: #FAC4D1;">
  14. <view class="app-name" v-if="!start_time">距离活动开始还有</view>
  15. <view class="app-name" style="color: #F95C87;" v-else-if="end_time !== '0000-00-00 00:00:00'">距离结束仅剩</view>
  16. <view class="app-time-info dir-left-nowrap cross-center" v-if="end_time !== '0000-00-00 00:00:00' || !start_time">
  17. <text class="app-value">{{time_str.day}}</text>
  18. <text class="app-degree">天</text>
  19. <text class="app-value">{{time_str.hou}}</text>
  20. <text class="app-degree">时</text>
  21. <text class="app-value">{{time_str.min}}</text>
  22. <text class="app-degree">分</text>
  23. <text class="app-value">{{time_str.sec}}</text>
  24. <text class="app-degree">秒</text>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. name: 'app-pt-time',
  32. props: {
  33. theme: String,
  34. end_time: {
  35. type: String,
  36. default() {
  37. return '00';
  38. }
  39. },
  40. start_time: {
  41. type: Boolean,
  42. default() {
  43. return true;
  44. }
  45. },
  46. time_str: {
  47. type: Object,
  48. default() {
  49. return {}
  50. }
  51. },
  52. item: {
  53. type: Object,
  54. default() {
  55. return {}
  56. }
  57. }
  58. }
  59. }
  60. </script>
  61. <style scoped lang="scss">
  62. .default-back {
  63. background: linear-gradient(to right, #FB3B62, #FF3E7A,#FF478D);
  64. }
  65. .app-pt-time {
  66. height: #{100rpx};
  67. width: #{750rpx};
  68. position: relative;
  69. display: flex;
  70. .app-image {
  71. width: #{148rpx};
  72. height: #{100rpx};
  73. }
  74. .app-title {
  75. width: #{430rpx};
  76. color: white;
  77. font-size: #{22rpx};
  78. display: flex;
  79. align-items: center;
  80. padding-left: 20rpx;
  81. flex: 1;
  82. position: relative;
  83. overflow: hidden;
  84. &:after{
  85. content: '';
  86. position: absolute;
  87. width: 70rpx;
  88. height: 70rpx;
  89. bottom: 0;
  90. right: -10rpx;
  91. background: url("../image/icon-clock.png") no-repeat;
  92. transform: rotate(-45deg);
  93. z-index: 0;
  94. opacity: .85;
  95. }
  96. .icon-text{
  97. background: #d73155;
  98. width: 100rpx;
  99. height: 85%;
  100. font-size: 30rpx;
  101. display: block;
  102. border-radius: 10rpx;
  103. text-align: center;
  104. padding: 0 10rpx;
  105. }
  106. .price{
  107. display: flex;
  108. flex-direction: column;
  109. color: #ffffff;
  110. margin-left: 10rpx;
  111. .current{
  112. font-size: 36rpx;
  113. text{
  114. background: #d73155;
  115. border-radius: 10rpx;
  116. padding: 5rpx 10rpx;
  117. margin-left: 10rpx;
  118. font-size: 24rpx;
  119. }
  120. }
  121. .original{
  122. font-size: 22rpx;
  123. text-decoration: line-through;
  124. }
  125. }
  126. }
  127. .app-time-content {
  128. background: #FAC4D1;
  129. height: #{100rpx};
  130. .app-name {
  131. width: #{322rpx};
  132. height: #{30rpx};
  133. font-size: #{26rpx};
  134. color: white;
  135. margin: #{5rpx} 0;
  136. text-align: center;
  137. }
  138. .app-time-info {
  139. height: #{48rpx};
  140. width: #{322rpx};
  141. text-align: center;
  142. justify-content: center;
  143. .app-degree {
  144. font-size: #{23rpx};
  145. // color: #ffffff;
  146. color: #FF3A67;
  147. margin: 0 #{6rpx};
  148. }
  149. .app-value {
  150. display: inline-block;
  151. min-width: #{34rpx};
  152. height: #{28rpx};
  153. line-height: #{30rpx};
  154. border-radius: #{4rpx};
  155. // background-color: white;
  156. background-color: #FF3A67;
  157. text-align: center;
  158. font-size: #{19rpx};
  159. color: #fff;
  160. }
  161. }
  162. }
  163. }
  164. </style>