优化
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user