123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- <template>
- <su-fixed bottom placeholder :val="44">
- <view>
- <view v-for="activity in data.activities" :key="activity.id">
- <view
- class="activity-box ss-p-x-38 ss-flex ss-row-between ss-col-center"
- :class="activity.type == 'seckill' ? 'seckill-box' : 'groupon-box'"
- >
- <view class="activity-title ss-flex">
- <view class="ss-m-r-16">
- <image
- :src="sheep.$url.static('/assets/addons/shopro/uniapp/goods/seckill-icon.png')"
- v-if="activity.type == 'seckill'"
- class="activity-icon"
- ></image>
- <image
- :src="sheep.$url.static('/assets/addons/shopro/uniapp/goods/groupon-icon.png')"
- class="activity-icon"
- v-else
- ></image>
- </view>
- <view>{{$t('goods.detail.participate')}}{{ activity.type_text }}{{$t('goods.detail.activity')}}</view>
- </view>
- <button class="ss-reset-button activity-go" @tap="onActivity(activity)"> GO </button>
- </view>
- <!-- <button @tap="onActivity(activity)">{{ activity.title }} {{ activity.type_text }}</button> -->
- </view>
- </view>
- </su-fixed>
- </template>
- <script setup>
- import { ref, reactive } from 'vue';
- import sheep from '@/sheep';
- const seckillBg = sheep.$url.css('/assets/addons/shopro/uniapp/goods/seckill-tip-bg.png');
- const grouponBg = sheep.$url.css('/assets/addons/shopro/uniapp/goods/groupon-tip-bg.png');
- const props = defineProps({
- data: {
- type: Object,
- default() {},
- },
- });
- function onActivity(activity) {
- let type = activity.type;
- if (type === 'groupon_ladder') type = 'groupon';
- sheep.$router.go(`/pages/goods/${type}`, {
- id: props.data.id,
- activity_id: activity.id,
- });
- }
- </script>
- <style lang="scss" scoped>
- .activity-box {
- width: 100%;
- height: 80rpx;
- box-sizing: border-box;
- margin-bottom: 10rpx;
- .activity-title {
- font-size: 26rpx;
- font-weight: 500;
- color: #ffffff;
- line-height: 42rpx;
- .activity-icon {
- width: 38rpx;
- height: 38rpx;
- }
- }
- .activity-go {
- width: 70rpx;
- height: 32rpx;
- background: #ffffff;
- border-radius: 16rpx;
- font-weight: 500;
- color: #ff6000;
- font-size: 24rpx;
- line-height: normal;
- }
- }
- //秒杀卡片
- .seckill-box {
- background: v-bind(seckillBg) no-repeat;
- background-size: 100% 100%;
- }
- .groupon-box {
- background: v-bind(grouponBg) no-repeat;
- background-size: 100% 100%;
- }
- </style>
|