share-buy-group-message.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <view class="group-message">
  3. <view class="message"> <slot name="head"></slot> </view>
  4. <view class="countdown">
  5. <!-- 时 -->
  6. <text class="hh" v-text="countDownTime.ddhh"></text>:
  7. <!-- 分 -->
  8. <text class="mm" v-text="countDownTime.mm">48</text>:
  9. <!-- 秒 -->
  10. <text class="ss" v-text="countDownTime.ss">33</text> <text class="end-tip" v-if="hasEndTip">后结束</text>
  11. </view>
  12. <view class="control"> <slot name="foot"></slot> </view>
  13. </view>
  14. </template>
  15. <script>
  16. export default {
  17. name: 'share-buy-group-message',
  18. props: {
  19. countDownTime: {
  20. type: Object,
  21. default: () => ({
  22. ddhh: '72',
  23. dd: '03',
  24. hh: '23',
  25. mm: '59',
  26. ss: '59'
  27. })
  28. },
  29. hasEndTip:{
  30. type: Boolean,
  31. default: false
  32. }
  33. }
  34. }
  35. </script>
  36. <style lang="scss" scoped>
  37. .group-message {
  38. @extend .cm-flex-center;
  39. flex-direction: column;
  40. padding: 40rpx 0;
  41. background-color: #fff;
  42. .countdown {
  43. margin: 32rpx 0;
  44. font-size: 26rpx;
  45. color: #ff457b;
  46. .hh,
  47. .mm,
  48. .ss {
  49. width: 48rpx;
  50. height: 48rpx;
  51. border-radius: 50%;
  52. text-align: center;
  53. color: #ffffff;
  54. background-color: #ff457b;
  55. }
  56. text {
  57. display: inline-block;
  58. margin: 0 8rpx;
  59. line-height: 48rpx;
  60. }
  61. .end-tip {
  62. font-size: 30rpx;
  63. color: #333;
  64. }
  65. }
  66. }
  67. </style>