This commit is contained in:
2024-03-31 18:19:26 +08:00
parent b502385272
commit 60cb832b02
10 changed files with 107 additions and 109 deletions

View File

@@ -1,28 +1,35 @@
<template>
<view class='coupon-content'>
<image v-if='item.status==0' :src='assetsUrl("bg_coupon.png")' />
<image v-else-if='item.status==1' :src='assetsUrl("bg_coupon_expired.png")' />
<view class='left-content accent-text-color' :class='{"left-content-disabled": item.status==1}'>
<text>{{ item.price }}</text>
<text>{{ item.threshold }}元可用</text>
<view class='coupon-content' @click.stop='()=>{emits("confirm")}'>
<image v-if='item?.status==0' :src='assetsUrl("bg_coupon.png")' />
<image v-else-if='item?.status==1' :src='assetsUrl("bg_coupon_expired.png")' />
<view class='left-content accent-text-color' :class='{"left-content-disabled": item?.status==1}'>
<text>{{ item?.reduce }}</text>
<text>满{{ item?.threshold }}元可用</text>
</view>
<view class='right-content accent-text-color' :class='{"right-content-disabled": item.status==1}'>
<text>{{ item?.title }}</text>
<text>有效期至{{ item.useTime }}</text>
<image class='checkbox' :src='assetsUrl("ic_checkbox_active.png")' />
<view class='right-content accent-text-color' :class='{"right-content-disabled": item?.status==1}'>
<text>{{ item?.name }}</text>
<text>有效期至{{ dayjs(item?.startTime).format('YYYY-MM-DD') }}</text>
<image v-if='item?.status==0' class='checkbox'
:src='assetsUrl(item.checked?"ic_checkbox_active.png":"ic_checkbox_normal.png")'
/>
</view>
</view>
</template>
<script lang='ts' setup>
import { PropType } from 'vue';
import { assetsUrl } from '@/utils/assets';
import { CouponBean } from '@/api/user/types';
import dayjs from 'dayjs';
defineProps({
item: Object
item: Object as PropType<CouponBean>
});
const emits = defineEmits(['confirm']);
</script>
<style lang='scss' scoped>
@@ -74,7 +81,7 @@ defineProps({
position: relative;
flex: 1;
justify-content: center;
margin-left: 100rpx;
margin-left: 60rpx;
text:nth-of-type(1) {
font-size: 30rpx;