app-goods-time.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <template>
  2. <view class="app-goods-time">
  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-content dir-top-nowrap" style="background-color: #FAC4D1;">
  14. <view class="app-text" style="color: #F95C87;" v-if="miaosha_status === 1">距离结束仅剩</view>
  15. <view class="app-text" v-if="miaosha_status === 2">距离开始仅剩</view>
  16. <view class="app-text over-text" v-if="miaosha_status === 0">活动已结束</view>
  17. <view class="app-time cross-center main-around" v-if="miaosha_status !== 0">
  18. <text class="app-num app-right" v-if="day > 0">{{day}}</text>
  19. <text style="color: #FF3A67;" v-if="day > 0">天</text>
  20. <text class="app-num app-right">{{hour}}</text>
  21. <text style="color: #FF3A67;">时</text>
  22. <text class="app-num app-right">{{minute}}</text>
  23. <text style="color: #FF3A67;">分</text>
  24. <text class="app-num app-right">{{second}}</text>
  25. <text style="color: #FF3A67;">秒</text>
  26. </view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. export default {
  32. name: 'app-goods-time',
  33. props: {
  34. miaosha_status: {
  35. type: Number,
  36. },
  37. hour: {
  38. type: Number,
  39. default() {
  40. return 0;
  41. }
  42. },
  43. minute: {
  44. type: Number,
  45. default() {
  46. return 0;
  47. }
  48. },
  49. second: {
  50. type: Number,
  51. default() {
  52. return 0;
  53. }
  54. },
  55. day: {
  56. type: Number,
  57. default() {
  58. return 0;
  59. }
  60. },
  61. theme: String,
  62. item: {
  63. type: Object,
  64. default() {
  65. return {}
  66. }
  67. }
  68. },
  69. }
  70. </script>
  71. <style scoped lang="scss">
  72. .app-goods-time {
  73. width: #{750rpx};
  74. height: #{100rpx};
  75. position: relative;
  76. display: flex;
  77. .app-image {
  78. width: #{750rpx};
  79. height: #{100rpx};
  80. background-image: url('../image/miaosha-bg.png');
  81. background-repeat: no-repeat;
  82. background-size: 100% 100%;
  83. }
  84. .app-title {
  85. width: #{430rpx};
  86. color: white;
  87. font-size: #{22rpx};
  88. display: flex;
  89. align-items: center;
  90. padding-left: 20rpx;
  91. flex: 1;
  92. position: relative;
  93. overflow: hidden;
  94. background: linear-gradient(to right, #FB3B62, #FF3E7A,#FF478D);
  95. &:after{
  96. content: '';
  97. position: absolute;
  98. width: 70rpx;
  99. height: 70rpx;
  100. bottom: 0;
  101. right: 230rpx;
  102. background: url("../image/icon-clock.png") no-repeat;
  103. transform: rotate(-45deg);
  104. z-index: 0;
  105. opacity: .85;
  106. }
  107. .icon-text{
  108. background: #d73155;
  109. width: 100rpx;
  110. height: 85%;
  111. font-size: 30rpx;
  112. display: block;
  113. border-radius: 10rpx;
  114. text-align: center;
  115. padding: 0 10rpx;
  116. }
  117. .price{
  118. display: flex;
  119. flex-direction: column;
  120. color: #ffffff;
  121. margin-left: 10rpx;
  122. .current{
  123. font-size: 36rpx;
  124. text{
  125. background: #d73155;
  126. border-radius: 10rpx;
  127. padding: 5rpx 10rpx;
  128. margin-left: 10rpx;
  129. font-size: 24rpx;
  130. }
  131. }
  132. .original{
  133. font-size: 22rpx;
  134. text-decoration: line-through;
  135. }
  136. }
  137. }
  138. .app-content {
  139. background: #FAC4D1;
  140. position: absolute;
  141. right: 0;
  142. top: 0;
  143. height: #{100rpx};
  144. width: #{230rpx};
  145. .app-text {
  146. font-size: #{22rpx};
  147. color: #ffffff;
  148. text-align: center;
  149. margin-top: #{6rpx};
  150. }
  151. .over-text {
  152. font-size: #{32rpx};
  153. line-height: #{100rpx};
  154. margin-top: 0;
  155. }
  156. .app-time {
  157. color: white;
  158. height: #{40rpx};
  159. font-size: #{26rpx};
  160. margin-top: #{6rpx};
  161. .app-num {
  162. display: inline-block;
  163. width: #{44rpx};
  164. height: #{40rpx};
  165. line-height: #{40rpx};
  166. // background-color:white;
  167. background-color: #FF3A67;
  168. border-radius: #{8rpx};
  169. // color: #353535;
  170. color: #fff;
  171. text-align: center;
  172. }
  173. .app-right {
  174. margin: 0 #{4rpx};
  175. }
  176. }
  177. }
  178. }
  179. </style>