seckillCard.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <view :data-theme="theme">
  3. <view class="seckill_activity pad-30 acea-row row-between acea-no-warp" :style="{backgroundImage: bgImage}">
  4. <view class="acea-row items-baseline">
  5. <text class="title">秒杀价</text>
  6. <text class="biao">¥</text>
  7. <text class="price semiBold">{{productPrice.price}}</text>
  8. <text class="ot-price text-dec">{{productPrice.otPrice}}</text>
  9. </view>
  10. <view class="acea-row row-column seckillTime">
  11. <text class="f-s-24 text-right mb12"
  12. :class="seckillStatus == 2 ? 'end_title' : 'text-white'">{{seckillStatus === 0? '活动已结束' : seckillStatus === 2 || seckillStatus === 3? '距活动开始' : '距活动结束'}}</text>
  13. <countDown v-if="seckillStatus > 0" :is-day="true" :tip-text="' '" :day-text="' '" :hour-text="' : '"
  14. :minute-text="' : '" :second-text="' '" :datatime="seckillTime" :isCol="false" :bgColor="bgColor">
  15. </countDown>
  16. </view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. import svipPrice from '@/components/svipPrice.vue';
  22. import countDown from "@/components/countDown";
  23. import {
  24. setThemeColor
  25. } from '@/utils/setTheme.js'
  26. import {
  27. mapGetters
  28. } from "vuex";
  29. const app = getApp();
  30. export default {
  31. computed: mapGetters(["globalData"]),
  32. components: {
  33. countDown,
  34. svipPrice
  35. },
  36. props: {
  37. // 0=已结束 1=抢购中 2=即将开始 3=明日预告
  38. seckillStatus: {
  39. type: Number,
  40. default: 0
  41. },
  42. productInfo: {
  43. type: Object,
  44. default: () => {}
  45. },
  46. seckillTime: {
  47. type: Number,
  48. default: 0
  49. },
  50. //选中的价格
  51. productPrice: {
  52. type: Object,
  53. default: () => {},
  54. }
  55. },
  56. data() {
  57. return {
  58. theme: this.$Cache.get("theme"),
  59. //bgImage: '',
  60. bgColor: {
  61. 'bgColor': '#fff',
  62. 'Color': '',
  63. 'width': '36rpx',
  64. 'timeTxtwidth': '16rpx',
  65. 'isDay': true
  66. },
  67. }
  68. },
  69. computed: {
  70. bgImage() {
  71. return 'url(' + require('@/pages/goods/static/images/' + this.theme + '.png') + ')'
  72. }
  73. },
  74. mounted() {
  75. this.bgColor.Color = setThemeColor();
  76. },
  77. }
  78. </script>
  79. <style scoped lang="scss">
  80. .pad-30 {
  81. padding: 0 30rpx;
  82. }
  83. .mb12 {
  84. margin-bottom: 12rpx;
  85. }
  86. .seckill_activity {
  87. width: 750rpx;
  88. height: 303rpx;
  89. color: #fff;
  90. background-size: cover;
  91. padding: 0 30rpx;
  92. .title,
  93. .ot-price {
  94. font-size: 22rpx;
  95. margin-top: 96rpx;
  96. }
  97. .biao {
  98. font-size: 22rpx;
  99. font-weight: 800;
  100. margin-top: 96rpx;
  101. margin-left: 6rpx;
  102. }
  103. .price {
  104. font-size: 50rpx;
  105. margin-top: 72rpx;
  106. margin-right: 6rpx;
  107. }
  108. .seckillTime {
  109. margin-top: 35rpx;
  110. }
  111. }
  112. </style>