detail-activity-tip.vue 2.4 KB

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