Update API request and navigation in sign page

This commit is contained in:
wangqiao
2025-08-25 22:09:48 +08:00
parent cdcb6e76c2
commit 63fa551041
3 changed files with 22 additions and 17 deletions

View File

@ -18,7 +18,7 @@
<el-button type="primary" class="search-btn" @click="handleSearch">搜索</el-button>
</div>
<div class="sign-center ml-10px">
<div class="sign-center ml-[10px]">
<el-button type="success" class="sign-btn" @click="handleClickSign"> 立即签到 </el-button>
</div>
</div>
@ -40,7 +40,7 @@
<div>积分</div>
<div>发生时间</div>
</div>
<div v-for="item in result.list" :key="item.id" class="table-row">
<div v-for="item in result?.list" :key="item.id" class="table-row">
<!-- <div class="avatar"> -->
<!-- <img :src="item.avatar" alt="avatar" /> -->
<!-- <span>{{ item.nickname }}</span> -->
@ -52,12 +52,12 @@
</div>
</div>
<!-- 分页组件 -->
<div class="mt-10px flex justify-center">
<div class="mt-[10px] flex justify-center">
<el-pagination
v-model:current-page="query.pageNo"
:page-size="query.pageSize"
layout="prev, pager, next"
:total="result.total"
:total="result?.total"
@current-change="handleCurrentChange"
/>
</div>
@ -80,10 +80,10 @@
title: '',
})
const result = reactive<PageResultMemberPointRecordRespVO>({
total: 0,
list: [],
})
// const result = reactive<PageResultMemberPointRecordRespVO>({
// total: 0,
// list: [],
// })
// const signList = ref([
// {
// avatar: 'https://dummyimage.com/40x40/ccc/fff.png&text=美',
@ -115,14 +115,19 @@
getUserPointPageList()
}
const getUserPointPageList = async () => {
const {data: result, refresh: getUserPointPageList } = await useAsyncData('getUserPointPage', async () => {
const res = await getUserPointPage(query)
if (res.code === 0) {
result.list = res.data.list
result.total = res.data.total
}
}
getUserPointPageList()
return res.data
})
// const getUserPointPageList = async () => {
// const res = await getUserPointPage(query)
// if (res.code === 0) {
// result.list = res.data.list
// result.total = res.data.total
// }
// }
// getUserPointPageList()
const handleClickSign = async () => {
const res = await signIn()