Update API request and navigation in sign page
This commit is contained in:
@ -92,7 +92,7 @@ export const signIn = () => {
|
||||
* 获得用户积分记录分页
|
||||
*/
|
||||
export const getUserPointPage = (params: { pageNo: number; pageSize: number }) => {
|
||||
return useFetchRequest.get<IResponse<PageResultMemberPointRecordRespVO>>('/prod-api/app-api/member/point/record/page', params)
|
||||
return useFetchRequest.get<IResponse<PageResultMemberPointRecordRespVO>>('/prod-api/app-api/member/point/record/page', {query:params})
|
||||
}
|
||||
/**
|
||||
* 近期收益和近期活跃
|
||||
|
||||
@ -88,7 +88,7 @@
|
||||
ElMessage.error('请先登录')
|
||||
return
|
||||
}
|
||||
navigateTo('/sign-page')
|
||||
navigateTo('/sign-content')
|
||||
}
|
||||
|
||||
const readCount = ref(false)
|
||||
|
||||
@ -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()
|
||||
|
||||
Reference in New Issue
Block a user