detail-activity-tip.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <su-fixed bottom placeholder :val="44">
  3. <view>
  4. <view v-for="activity in props.activityList" :key="activity.id">
  5. <!-- TODO 非繁人:拼团 -->
  6. <view
  7. class="activity-box ss-p-x-38 ss-flex ss-row-between ss-col-center"
  8. :class="activity.type === 1 ? 'seckill-box' : 'groupon-box'"
  9. >
  10. <view class="activity-title ss-flex">
  11. <view class="ss-m-r-16">
  12. <image
  13. v-if="activity.type === 1"
  14. :src="sheep.$url.static('/static/images/seckill-icon.png')"
  15. class="activity-icon"
  16. />
  17. <!-- TODO 非繁人:拼团 -->
  18. <image
  19. v-else-if="activity.type === 3"
  20. :src="sheep.$url.static('/static/images/groupon-icon.png')"
  21. class="activity-icon"
  22. />
  23. </view>
  24. <view>该商品正在参与{{ activity.name }}活动</view>
  25. </view>
  26. <button class="ss-reset-button activity-go" @tap="onActivity(activity)"> GO </button>
  27. </view>
  28. </view>
  29. </view>
  30. </su-fixed>
  31. </template>
  32. <script setup>
  33. import sheep from '@/sheep';
  34. // TODO 非繁人:这里要迁移下;
  35. const seckillBg = sheep.$url.css('/static/images/seckill-tip-bg.png');
  36. const grouponBg = sheep.$url.css('/static/images/groupon-tip-bg.png');
  37. const props = defineProps({
  38. activityList: {
  39. type: Array,
  40. default() {
  41. return [];
  42. }
  43. }
  44. });
  45. function onActivity(activity) {
  46. const type = activity.type;
  47. const typePath = type === 1 ? 'seckill' :
  48. type === 2 ? 'TODO 拼团' : 'groupon';
  49. sheep.$router.go(`/pages/goods/${typePath}`, {
  50. id: activity.id,
  51. });
  52. }
  53. </script>
  54. <style lang="scss" scoped>
  55. .activity-box {
  56. width: 100%;
  57. height: 80rpx;
  58. box-sizing: border-box;
  59. margin-bottom: 10rpx;
  60. .activity-title {
  61. font-size: 26rpx;
  62. font-weight: 500;
  63. color: #ffffff;
  64. line-height: 42rpx;
  65. .activity-icon {
  66. width: 38rpx;
  67. height: 38rpx;
  68. }
  69. }
  70. .activity-go {
  71. width: 70rpx;
  72. height: 32rpx;
  73. background: #ffffff;
  74. border-radius: 16rpx;
  75. font-weight: 500;
  76. color: #ff6000;
  77. font-size: 24rpx;
  78. line-height: normal;
  79. }
  80. }
  81. //秒杀卡片
  82. .seckill-box {
  83. background: v-bind(seckillBg) no-repeat;
  84. background-size: 100% 100%;
  85. }
  86. .groupon-box {
  87. background: v-bind(grouponBg) no-repeat;
  88. background-size: 100% 100%;
  89. }
  90. </style>