This commit is contained in:
2024-04-20 21:58:16 +08:00
parent 5b8c7d4a2d
commit bfc04c54aa
2 changed files with 18 additions and 6 deletions

View File

@@ -17,21 +17,33 @@ import { CouponBean } from '@/api/user/types';
const store = useUserStore();
const { userInfo } = storeToRefs(store);
const couponStatus = ref<number | any>(undefined);
const coupons = ref<CouponBean[]>([]);
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();
};
</script>

View File

@@ -3,7 +3,7 @@
<view class='top-card-view'>
<image class='bg-image' :src='companyConfigInfo.userbgcover' />
<image class='avatar-image' :src='params.image' />
<text>{{ userInfo.name }}</text>
<text>{{ userInfo.nickName }}</text>
<text>{{ userInfo.levelName }}</text>
</view>