fix: user sign
This commit is contained in:
@@ -23,3 +23,11 @@ export function getAdWatchTicketList(data) {
|
||||
params: data,
|
||||
})
|
||||
}
|
||||
|
||||
export function getUserSignLogList(data) {
|
||||
return request({
|
||||
url: 'management/api/system/user-sign-log/list',
|
||||
method: 'get',
|
||||
params: data,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -283,6 +283,12 @@ export const asyncRoutes = [
|
||||
component: () => import('@/views/spring/user/adWatch/index'),
|
||||
meta: { title: '广告观看记录' },
|
||||
},
|
||||
{
|
||||
path: 'userSignLog',
|
||||
name: 'UserSignLog',
|
||||
component: () => import('@/views/spring/user/signLog/index'),
|
||||
meta: { title: '用户签到记录' },
|
||||
},
|
||||
{
|
||||
path: 'userChat',
|
||||
name: 'UserChat',
|
||||
|
||||
131
src/views/spring/user/signLog/index.vue
Normal file
131
src/views/spring/user/signLog/index.vue
Normal file
@@ -0,0 +1,131 @@
|
||||
<template>
|
||||
<div class="signLog-container">
|
||||
<vab-query-form>
|
||||
<vab-query-form-left-panel :span="12" />
|
||||
<vab-query-form-right-panel :span="12">
|
||||
<el-form :inline="true" :model="queryForm" @submit.native.prevent>
|
||||
<el-form-item>
|
||||
<el-input v-model.trim="queryForm.keyword" clearable placeholder="请输入查询条件" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="el-icon-search" type="primary" @click="queryData">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</vab-query-form-right-panel>
|
||||
</vab-query-form>
|
||||
|
||||
<el-table v-loading="listLoading" :data="list" :element-loading-text="elementLoadingText">
|
||||
<el-table-column align="center" label="ID" prop="id" show-overflow-tooltip width="220" />
|
||||
|
||||
<el-table-column align="left" label="用户信息" min-width="200" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<div v-if="row.user && row.user.id" class="author-cell">
|
||||
<el-image class="author-avatar" :preview-src-list="[getThumbUrl(row.user.avatar)]" :src="getThumbUrl(row.user.avatar)" />
|
||||
<div class="author-meta">
|
||||
<div>
|
||||
<strong>昵称:</strong>
|
||||
{{ row.user.nickname || '--' }}
|
||||
</div>
|
||||
<div>
|
||||
<strong>ID:</strong>
|
||||
{{ row.user.id }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div>User ID: {{ row.userId }}</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" label="签到日期" prop="signDate" show-overflow-tooltip />
|
||||
<el-table-column align="center" label="连续签到天数" prop="continuousDays" show-overflow-tooltip />
|
||||
<el-table-column align="center" label="奖励积分" prop="rewardPoint" show-overflow-tooltip />
|
||||
<el-table-column align="center" label="奖励经验" prop="rewardExp" show-overflow-tooltip />
|
||||
|
||||
<el-table-column align="center" label="创建时间" show-overflow-tooltip width="160">
|
||||
<template #default="{ row }">
|
||||
{{ formatTime(row.createdAt) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<el-pagination
|
||||
background
|
||||
:current-page="queryForm.pageNo"
|
||||
:layout="layout"
|
||||
:page-size="queryForm.pageSize"
|
||||
:total="total"
|
||||
@current-change="handleCurrentChange"
|
||||
@size-change="handleSizeChange"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getUserSignLogList } from '@/api/system/index'
|
||||
import { formatTime } from '@/utils'
|
||||
import { getThumbUrl } from '@/utils/blessing'
|
||||
|
||||
export default {
|
||||
name: 'UserSignLog',
|
||||
data() {
|
||||
return {
|
||||
list: null,
|
||||
listLoading: true,
|
||||
layout: 'total, sizes, prev, pager, next, jumper',
|
||||
total: 0,
|
||||
elementLoadingText: '正在加载...',
|
||||
queryForm: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
keyword: '',
|
||||
},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
getThumbUrl,
|
||||
formatTime,
|
||||
handleSizeChange(val) {
|
||||
this.queryForm.pageSize = val
|
||||
this.fetchData()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.queryForm.pageNo = val
|
||||
this.fetchData()
|
||||
},
|
||||
queryData() {
|
||||
this.queryForm.pageNo = 1
|
||||
this.fetchData()
|
||||
},
|
||||
async fetchData() {
|
||||
this.listLoading = true
|
||||
const { data } = await getUserSignLogList(this.queryForm)
|
||||
this.list = data.list
|
||||
this.total = data.totalCount
|
||||
this.listLoading = false
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.author-cell {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
.author-avatar {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
object-fit: cover;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.author-meta {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user