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