优化
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
<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.reduce }}</text>
|
||||
<text>满{{ item.threshold }}元可用</text>
|
||||
<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}'>
|
||||
<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>
|
||||
<text class='btn-text' :class='{"btn-text-disabled": item.status==1}'>
|
||||
<text>有效期至{{ dayjs(item?.startTime).format('YYYY-MM-DD') }}</text>
|
||||
<text class='btn-text' :class='{"btn-text-disabled": item?.status==1}'>
|
||||
立即使用
|
||||
</text>
|
||||
</view>
|
||||
@@ -22,9 +22,11 @@
|
||||
|
||||
import { assetsUrl } from '@/utils/assets';
|
||||
import dayjs from 'dayjs';
|
||||
import { PropType } from 'vue';
|
||||
import { CouponBean } from '@/api/user/types';
|
||||
|
||||
defineProps({
|
||||
item: Object
|
||||
item: Object as PropType<CouponBean>
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -114,6 +116,7 @@ defineProps({
|
||||
.right-content-disabled {
|
||||
@extend .right-content;
|
||||
color: #C2C2C2;
|
||||
|
||||
text:nth-of-type(2) {
|
||||
color: #C2C2C2;
|
||||
}
|
||||
|
@@ -11,15 +11,15 @@ import CouponItem from './components/coupon-item.vue';
|
||||
import { getCouponList } from '@/api/user';
|
||||
import { useUserStore } from '@/store';
|
||||
import { getCompanyId } from '@/utils';
|
||||
import { GroupBuyBean } from '@/api/groupbuy/types';
|
||||
import { CouponBean } from '@/api/user/types';
|
||||
|
||||
const store = useUserStore();
|
||||
const { userInfo } = storeToRefs(store);
|
||||
|
||||
const coupons = ref<GroupBuyBean[]>([]);
|
||||
const coupons = ref<CouponBean[]>([]);
|
||||
|
||||
onLoad(async () => {
|
||||
fetchData(0);
|
||||
await fetchData(0);
|
||||
});
|
||||
|
||||
const tabChange = (index: number) => {
|
||||
|
Reference in New Issue
Block a user