goods-price.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <template>
  2. <view class="goods-price">
  3. <view class="row">
  4. <view class="price"> <text class="amount">9999.00</text> <text class="delete">12888.00</text> </view>
  5. <view class="price-tags">
  6. <!-- <view class="tag-pt">拼团价</view>
  7. <view class="tag-hd">活动价</view> -->
  8. <view class="tag-xs">限时特价</view>
  9. </view>
  10. </view>
  11. <view class="row">
  12. <!-- 券后价 -->
  13. <view class="tag-qh">券后价¥6000.00</view>
  14. </view>
  15. <!-- 限时特价结束时间 -->
  16. <view class="countdown-box">
  17. <view class="tip">距离结束</view>
  18. <view class="time">
  19. <!-- 时 -->
  20. <text class="hh">72</text>:
  21. <!-- 分 -->
  22. <text class="mm">48</text>:
  23. <!-- 秒 -->
  24. <text class="ss">33</text>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. name: 'goods-price',
  32. props: {
  33. priceType: {
  34. type: String,
  35. default: 'normal',
  36. validator: value => {
  37. /* normal: 普通价 | group: 拼团价 | activity: 活动价 | time-limit: 限时特价 | */
  38. return ['normal', 'group', 'activity', 'time-limit'].indexOf(value) > -1
  39. }
  40. },
  41. productData: {
  42. type: Object,
  43. default: () => {}
  44. }
  45. }
  46. }
  47. </script>
  48. <style lang="scss" scoped>
  49. .goods-price {
  50. position: relative;
  51. padding: 24rpx;
  52. background-color: #fff;
  53. .row {
  54. @extend .cm-flex-center;
  55. justify-content: flex-start;
  56. &:nth-child(2) {
  57. margin-top: 4rpx;
  58. }
  59. }
  60. .price {
  61. .amount {
  62. font-size: 48rpx;
  63. font-weight: bold;
  64. color: #ff457b;
  65. &::before {
  66. content: '¥';
  67. font-size: 24rpx;
  68. vertical-align: 2rpx;
  69. }
  70. }
  71. .delete {
  72. margin-left: 16rpx;
  73. font-size: 26rpx;
  74. font-weight: 400;
  75. color: #999999;
  76. text-decoration: line-through;
  77. &::before {
  78. content: '¥';
  79. }
  80. }
  81. }
  82. .price-tags {
  83. margin-left: 24rpx;
  84. @extend .cm-flex-center;
  85. justify-content: flex-start;
  86. margin-top: 10rpx;
  87. .tag-pt {
  88. @extend .cm-flex-center;
  89. height: 32rpx;
  90. padding: 0 8rpx;
  91. background: linear-gradient(90deg, #6431f2 0%, #b03bb8 49%, #ff457b 100%);
  92. border-radius: 4rpx;
  93. font-size: 22rpx;
  94. color: #fff;
  95. }
  96. .tag-hd,
  97. .tag-xs {
  98. @extend .cm-flex-center;
  99. display: block;
  100. height: 30rpx;
  101. padding: 0 8rpx;
  102. background: #fff3f7;
  103. border: 1rpx solid #ff457b;
  104. border-radius: 4rpx;
  105. font-size: 22rpx;
  106. color: #ff457b;
  107. }
  108. }
  109. .tag-qh {
  110. @extend .cm-flex-center;
  111. height: 40rpx;
  112. background: #ff457b;
  113. border-radius: 25rpx;
  114. padding: 0 15rpx;
  115. font-size: 24rpx;
  116. font-weight: bold;
  117. color: #ffffff;
  118. }
  119. }
  120. .countdown-box {
  121. position: absolute;
  122. top: 50%;
  123. right: 24rpx;
  124. transform: translateY(-50%);
  125. @extend .cm-flex-center;
  126. flex-direction: column;
  127. width: 160rpx;
  128. .tip {
  129. font-size: 24rpx;
  130. color: #ff457b;
  131. }
  132. .time {
  133. margin-top: 20rpx;
  134. width: 160rpx;
  135. @extend .cm-flex-between;
  136. font-size: 24rpx;
  137. font-weight: bold;
  138. color: #333333;
  139. text {
  140. @extend .cm-flex-center;
  141. width: 40rpx;
  142. height: 40rpx;
  143. background: #333;
  144. border-radius: 4rpx;
  145. color: #ffffff;
  146. }
  147. }
  148. }
  149. </style>