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 }}