mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-07 02:46:55 +08:00
fix avatar property (to uface
This commit is contained in:
@@ -425,7 +425,7 @@ export enum QueueStatus {
|
|||||||
export interface EventModel {
|
export interface EventModel {
|
||||||
type: EventDataTypes
|
type: EventDataTypes
|
||||||
name: string
|
name: string
|
||||||
avatar: string
|
uface: string
|
||||||
uid: number
|
uid: number
|
||||||
msg: string
|
msg: string
|
||||||
time: number
|
time: number
|
||||||
@@ -557,13 +557,47 @@ export interface AddressInfo {
|
|||||||
phone: number
|
phone: number
|
||||||
name: string
|
name: string
|
||||||
}
|
}
|
||||||
export interface BiliAuthModel {
|
export interface BiliAuthBaseModel {
|
||||||
id: number
|
id: number
|
||||||
userId: number
|
userId: number
|
||||||
openId: string
|
openId: string
|
||||||
|
avatar: string
|
||||||
|
name: string
|
||||||
|
}
|
||||||
|
export interface BiliAuthModel extends BiliAuthBaseModel {
|
||||||
address?: AddressInfo
|
address?: AddressInfo
|
||||||
}
|
}
|
||||||
export interface PointOrderModel{
|
export interface PointOrderModel{
|
||||||
id: number
|
id: number
|
||||||
|
|
||||||
|
}
|
||||||
|
export interface ResponsePointUserModel{
|
||||||
|
point: number
|
||||||
|
orderCount: number
|
||||||
|
isAuthed: boolean
|
||||||
|
info?: BiliAuthBaseModel
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ResponsePointOrder2StreamerModel {
|
||||||
|
id: number
|
||||||
|
customer: BiliAuthModel
|
||||||
|
address?: AddressInfo
|
||||||
|
goodsId: number
|
||||||
|
createAt: number
|
||||||
|
status: PointOrderStatus
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ResponsePointOrder2UserModel {
|
||||||
|
id: number
|
||||||
|
address?: AddressInfo
|
||||||
|
goodsId: PointGoodsModel
|
||||||
|
status: PointOrderStatus
|
||||||
|
createAt: number
|
||||||
|
}
|
||||||
|
export enum PointOrderStatus {
|
||||||
|
Pending, // 订单正在等待处理
|
||||||
|
Shipped, // 订单已发货
|
||||||
|
Canceled, // 订单已取消
|
||||||
|
Refunded, // 订单已退款
|
||||||
|
Failed, // 订单处理失败
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -266,7 +266,7 @@ export default class DanmakuClient {
|
|||||||
fans_medal_name: data.fans_medal_name,
|
fans_medal_name: data.fans_medal_name,
|
||||||
fans_medal_wearing_status: data.fans_medal_wearing_status,
|
fans_medal_wearing_status: data.fans_medal_wearing_status,
|
||||||
emoji: data.dm_type == 1 ? data.emoji_img_url : undefined,
|
emoji: data.dm_type == 1 ? data.emoji_img_url : undefined,
|
||||||
avatar: data.uface,
|
uface: data.uface,
|
||||||
},
|
},
|
||||||
command,
|
command,
|
||||||
)
|
)
|
||||||
@@ -292,7 +292,7 @@ export default class DanmakuClient {
|
|||||||
fans_medal_level: data.fans_medal_level,
|
fans_medal_level: data.fans_medal_level,
|
||||||
fans_medal_name: data.fans_medal_name,
|
fans_medal_name: data.fans_medal_name,
|
||||||
fans_medal_wearing_status: data.fans_medal_wearing_status,
|
fans_medal_wearing_status: data.fans_medal_wearing_status,
|
||||||
avatar: data.uface,
|
uface: data.uface,
|
||||||
},
|
},
|
||||||
command,
|
command,
|
||||||
)
|
)
|
||||||
@@ -317,7 +317,7 @@ export default class DanmakuClient {
|
|||||||
fans_medal_level: data.fans_medal_level,
|
fans_medal_level: data.fans_medal_level,
|
||||||
fans_medal_name: data.fans_medal_name,
|
fans_medal_name: data.fans_medal_name,
|
||||||
fans_medal_wearing_status: data.fans_medal_wearing_status,
|
fans_medal_wearing_status: data.fans_medal_wearing_status,
|
||||||
avatar: data.uface,
|
uface: data.uface,
|
||||||
},
|
},
|
||||||
command,
|
command,
|
||||||
)
|
)
|
||||||
@@ -342,7 +342,7 @@ export default class DanmakuClient {
|
|||||||
fans_medal_level: data.fans_medal_level,
|
fans_medal_level: data.fans_medal_level,
|
||||||
fans_medal_name: data.fans_medal_name,
|
fans_medal_name: data.fans_medal_name,
|
||||||
fans_medal_wearing_status: data.fans_medal_wearing_status,
|
fans_medal_wearing_status: data.fans_medal_wearing_status,
|
||||||
avatar: data.user_info.uface,
|
uface: data.user_info.uface,
|
||||||
},
|
},
|
||||||
command,
|
command,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ export default //管理页面
|
|||||||
{
|
{
|
||||||
path: 'point',
|
path: 'point',
|
||||||
name: 'manage-point',
|
name: 'manage-point',
|
||||||
component: () => import('@/views/manage/PointManage.vue'),
|
component: () => import('@/views/manage/point/PointManage.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: '积分',
|
title: '积分',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import { PointOrderModel } from '@/api/api-models'
|
import { PointOrderModel } from '@/api/api-models'
|
||||||
import { QueryGetAPI } from '@/api/query'
|
import { QueryGetAPI } from '@/api/query'
|
||||||
import { POINT_API_URL } from '@/data/constants'
|
import { POINT_API_URL } from '@/data/constants'
|
||||||
import { useMessage } from 'naive-ui'
|
import { NCard, NList, NListItem, useMessage } from 'naive-ui'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
|
|
||||||
const message = useMessage()
|
const message = useMessage()
|
||||||
@@ -25,4 +25,12 @@ async function getOrders() {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template></template>
|
<template>
|
||||||
|
<NList bordered hoverable clickable>
|
||||||
|
<NListItem v-for="order in orders" v-bind:key="order.id">
|
||||||
|
<NCard :bordered="false">
|
||||||
|
|
||||||
|
</NCard>
|
||||||
|
</NListItem>
|
||||||
|
</NList>
|
||||||
|
</template>
|
||||||
56
src/views/manage/point/PointUserDetailCard.vue
Normal file
56
src/views/manage/point/PointUserDetailCard.vue
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { ResponsePointOrder2StreamerModel, ResponsePointUserModel } from '@/api/api-models'
|
||||||
|
import { QueryGetAPI } from '@/api/query'
|
||||||
|
import { POINT_API_URL } from '@/data/constants'
|
||||||
|
import { NCard, NDataTable, NDivider, NFlex, NList, NListItem, NModal, NSpin, useMessage } from 'naive-ui'
|
||||||
|
import { ref } from 'vue'
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
user: ResponsePointUserModel
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const orders = ref<ResponsePointOrder2StreamerModel[]>(await getOrders())
|
||||||
|
const pointHistory = ref([])
|
||||||
|
const isLoading = ref(false)
|
||||||
|
|
||||||
|
const message = useMessage()
|
||||||
|
|
||||||
|
async function getOrders() {
|
||||||
|
try {
|
||||||
|
isLoading.value = true
|
||||||
|
const data = await QueryGetAPI<ResponsePointOrder2StreamerModel[]>(POINT_API_URL + 'get-user-orders', {
|
||||||
|
id: props.user.info?.id,
|
||||||
|
})
|
||||||
|
if (data.code == 200) {
|
||||||
|
return data.data
|
||||||
|
} else {
|
||||||
|
message.error('获取订单失败: ' + data.message)
|
||||||
|
console.error(data)
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
message.error('获取订单失败: ' + err)
|
||||||
|
console.error(err)
|
||||||
|
} finally {
|
||||||
|
isLoading.value = false
|
||||||
|
}
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<NCard :bordered="false">
|
||||||
|
<NCard title="用户信息">
|
||||||
|
<NFlex>
|
||||||
|
|
||||||
|
</NFlex>
|
||||||
|
</NCard>
|
||||||
|
<NDivider>
|
||||||
|
订单
|
||||||
|
</NDivider>
|
||||||
|
<NSpin :show="isLoading">
|
||||||
|
<NList>
|
||||||
|
<NListItem v-for="order in orders" v-bind:key="order.id"> </NListItem>
|
||||||
|
</NList>
|
||||||
|
</NSpin>
|
||||||
|
</NCard>
|
||||||
|
</template>
|
||||||
86
src/views/manage/point/PointUserManage.vue
Normal file
86
src/views/manage/point/PointUserManage.vue
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { ResponsePointUserModel } from '@/api/api-models'
|
||||||
|
import { QueryGetAPI } from '@/api/query'
|
||||||
|
import { POINT_API_URL } from '@/data/constants'
|
||||||
|
import { NButton, NCard, NDataTable, NList, NListItem, NModal, useMessage } from 'naive-ui'
|
||||||
|
import { h, ref } from 'vue'
|
||||||
|
import PointUserDetailCard from './PointUserDetailCard.vue'
|
||||||
|
|
||||||
|
const message = useMessage()
|
||||||
|
|
||||||
|
const pn = ref(1)
|
||||||
|
const ps = ref(25)
|
||||||
|
const showModal = ref(false)
|
||||||
|
|
||||||
|
const users = ref<ResponsePointUserModel[]>(await getUsers())
|
||||||
|
const currentUser = ref<ResponsePointUserModel>()
|
||||||
|
|
||||||
|
const column = [
|
||||||
|
{
|
||||||
|
title: '认证',
|
||||||
|
key: 'auth',
|
||||||
|
render: (row: ResponsePointUserModel) => {
|
||||||
|
return row.isAuthed ? '已认证' : '未认证'
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '用户名',
|
||||||
|
key: 'username',
|
||||||
|
render: (row: ResponsePointUserModel) => {
|
||||||
|
return row.info?.name ?? '未知'
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '积分',
|
||||||
|
key: 'points',
|
||||||
|
render: (row: ResponsePointUserModel) => {
|
||||||
|
return row.point
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '订单数量',
|
||||||
|
key: 'orders',
|
||||||
|
render: (row: ResponsePointUserModel) => {
|
||||||
|
return row.orderCount
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
key: 'action',
|
||||||
|
render: (row: ResponsePointUserModel) => {
|
||||||
|
return h(
|
||||||
|
NButton,
|
||||||
|
{
|
||||||
|
onClick: () => {
|
||||||
|
currentUser.value = row
|
||||||
|
showModal.value = true
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{ default: () => '详情' },
|
||||||
|
)
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
async function getUsers() {
|
||||||
|
try {
|
||||||
|
const data = await QueryGetAPI<ResponsePointUserModel[]>(POINT_API_URL + 'get-all-users')
|
||||||
|
if (data.code == 200) {
|
||||||
|
return data.data
|
||||||
|
} else {
|
||||||
|
message.error('获取订单失败: ' + data.message)
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err)
|
||||||
|
message.error('获取订单失败: ' + err)
|
||||||
|
}
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<NDataTable :columns="column" :data="users" :pagination="{ pageSize: ps, page: pn, showSizePicker: true, pageSizes: [10, 25, 50, 100] }" />
|
||||||
|
<NModal v-model:show="showModal" style="max-width: 600px" title="用户详情">
|
||||||
|
<PointUserDetailCard v-if="currentUser" :user="currentUser" />
|
||||||
|
</NModal>
|
||||||
|
</template>
|
||||||
Reference in New Issue
Block a user