From bfc04c54aaa15bd050949354a216bb4271f260e0 Mon Sep 17 00:00:00 2001 From: Waiting Date: Sat, 20 Apr 2024 21:58:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/mine/subs/coupon/index.vue | 22 +++++++++++++++++----- src/pages/mine/subs/profile/index.vue | 2 +- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/pages/mine/subs/coupon/index.vue b/src/pages/mine/subs/coupon/index.vue index 11e0b86..8520f71 100644 --- a/src/pages/mine/subs/coupon/index.vue +++ b/src/pages/mine/subs/coupon/index.vue @@ -17,21 +17,33 @@ import { CouponBean } from '@/api/user/types'; const store = useUserStore(); const { userInfo } = storeToRefs(store); +const couponStatus = ref(undefined); const coupons = ref([]); onLoad(async () => { - await fetchData(0); + await fetchData(); }); const tabChange = (index: number) => { - fetchData(index); + switch (index) { + case 0: + couponStatus.value = undefined; + break; + case 1: + couponStatus.value = 0; + break; + case 2: + couponStatus.value = 1; + break; + } + fetchData(); }; -const fetchData = async (status: number) => { +const fetchData = async () => { const { list } = await getCouponList({ companyId: getCompanyId(), memberId: userInfo.value?.id, - status: status, + status: couponStatus.value, pageNum: 1, pageSize: 20 }); @@ -42,7 +54,7 @@ const onLoadMore = () => { if(coupons.value.length >= 20) { return; } - fetchData(0); + fetchData(); }; diff --git a/src/pages/mine/subs/profile/index.vue b/src/pages/mine/subs/profile/index.vue index 4ed6e15..1a0c24b 100644 --- a/src/pages/mine/subs/profile/index.vue +++ b/src/pages/mine/subs/profile/index.vue @@ -3,7 +3,7 @@ - {{ userInfo.name }} + {{ userInfo.nickName }} {{ userInfo.levelName }}