Author SHA1 Message Date
Vicky bedae02946 feat: phase1 UI prep — 后台 App 用户列表支持系统筛选 + 国家中文名 + 标签语义优化
新增: 系统下拉 (ANDROID/IOS)、国家中文名映射、用户列昵称/UID 冒号标签
详情抽屉: 同步系统/国家/标签展示
2026-10-27 15:45:23 +08:00
Vicky daf681ae1a fix(admin): 观看时间统一格式化为 yyyy-MM-dd HH:mm:ss
后端改输出格式后仍保留前端兜底,同时修掉用户详情里的原始 ISO 展示。
2026-10-27 14:39:18 +08:00
Vicky 111bbdaeb7 fix(admin): 用户列标签改用半角冒号 2026-10-27 14:29:56 +08:00
Vicky 5da72d1aa2 fix(admin): 用户列补全「昵称 / UID / 设备」标签与冒号
两行都以「字段名:值」呈现,避免只看到一串随机字母。
2026-10-27 14:28:59 +08:00
Vicky e1eb58d4c4 feat(admin): 列表支持按系统筛选,用户列补语义标签
- 收藏/点赞/观看增加「全部系统 / Android / iOS」下拉
- 用户列第二行标注 UID,游客行标注设备,避免一串字母看不出含义
2026-10-27 14:27:16 +08:00
Vicky 5dbc752798 feat(admin): 观看/收藏/点赞列表单独增加系统列
用户单元格只保留身份信息,Android/iOS 抽成独立「系统」列,三页列结构一致。
2026-10-27 14:17:37 +08:00
Vicky c89c5668e1 refactor(admin): 用户单元格只保留平台标识
机型与系统版本号属于多余信息,Android/iOS 加游客标签已足够区分。
2026-10-27 14:00:07 +08:00
Vicky 9ea22d5951 chore(merge): 合并后台用户单元格统一 2026-10-27 13:53:54 +08:00
Vicky f3fbc57c14 feat(admin): 统一用户单元格,展示游客设备号与客户端系统
- 新增 AppUserCell,游客显示标签+deviceId,第二行统一展示系统与机型
- 收藏、点赞、观看记录三页复用,观看记录去掉重复的系统列
2026-10-27 13:53:53 +08:00
Zhou Weidong c45820258e chore(merge): 合并游客标签样式修正 2026-10-27 13:11:10 +08:00
Zhou Weidong 12d63e9670 fix(admin): 修正游客标签拉伸 2026-10-27 13:10:19 +08:00
9 changed files with 279 additions and 79 deletions

No files matched your search

+4
View File
@@ -11,6 +11,8 @@ export interface AppUserPageParams {
status?: string
countryCode?: string
registerSource?: string
/** 客户端平台:ANDROID / IOS / WEB */
platform?: string
}
export interface WatchHistoryPageParams {
@@ -21,6 +23,8 @@ export interface WatchHistoryPageParams {
dramaTitle?: string
dramaId?: number
episodeId?: number
/** 客户端平台:ANDROID / IOS / WEB */
platform?: string
source?: string
finished?: boolean
startTime?: string
+5 -1
View File
@@ -10,6 +10,8 @@ export interface EngagementPageParams {
keyword?: string
userId?: string | number
deviceId?: string
/** 客户端平台:ANDROID / IOS / WEB */
platform?: string
dramaId?: string | number
dramaTitle?: string
targetType?: string
@@ -26,12 +28,14 @@ export interface EngagementItem {
uid: string | null
nickname: string | null
deviceId: string | null
/** 客户端平台 ANDROID / IOS / WEB;老客户端未上报时为空。 */
platform: string | null
anonymous: boolean
dramaId: string | null
dramaTitle: string | null
dramaCover: string | null
dramaStatus: string | null
dramaPublished: boolean
dramaPublished: boolean | null
targetType: string
targetId: string
episodeId: string | null
+3 -1
View File
@@ -18,7 +18,8 @@
}
.app-user-toolbar .app-user-status,
.app-user-toolbar .app-user-country {
.app-user-toolbar .app-user-country,
.app-user-toolbar .app-user-platform {
width: 150px;
flex: 0 0 150px;
}
@@ -63,6 +64,7 @@
.app-user-meta {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 2px;
min-width: 0;
}
+43
View File
@@ -0,0 +1,43 @@
<!-- Author: fruit.com.cn -->
<script setup>
import { computed } from 'vue'
/**
* 后台各列表共用的「用户」单元格。
*
* 口径:已登录显示昵称 + `UID xxx`;未登录显示「游客」标签 + `设备 xxx`。
* 两行都带标签,避免一串随机字母看不出是什么。平台由独立的「系统」列展示。
*/
const props = defineProps({
row: { type: Object, required: true }
})
const isGuest = computed(() => props.row?.userId == null)
</script>
<template>
<div class="app-user-meta">
<template v-if="isGuest">
<el-tag type="info" size="small">游客</el-tag>
<span class="app-user-uid app-user-device" :title="row.deviceId || ''">
设备: {{ row.deviceId || '—' }}
</span>
</template>
<template v-else>
<span class="app-user-name" :title="row.nickname || ''">
昵称: {{ row.nickname || '未设置昵称' }}
</span>
<span class="app-user-uid">UID: {{ row.uid || `#${row.userId}` }}</span>
</template>
</div>
</template>
<style scoped>
.app-user-device {
max-width: 150px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
</style>
+43 -16
View File
@@ -9,9 +9,11 @@ import { useRbac } from '@/stores/rbac'
import {
APP_USER_STATUS,
COUNTRY_OPTIONS,
countryText,
formatDateTime,
formatDuration,
platformText,
statusMeta,
systemText,
useAppUsers
} from './composables/useAppUsers'
@@ -25,6 +27,7 @@ const {
keyword,
statusFilter,
countryFilter,
platformFilter,
currentPage,
pageSize,
detailVisible,
@@ -53,6 +56,11 @@ const SOURCE_TEXT = {
FAVORITE: '收藏'
}
const BAN_TYPE_TEXT = { BAN: '封禁', LIMIT: '限制', MUTE: '禁言' }
const PLATFORM_OPTIONS = [
{ value: '', label: '全部系统' },
{ value: 'ANDROID', label: 'Android' },
{ value: 'IOS', label: 'iOS' }
]
const APPEAL_TEXT = {
none: '未申诉',
pending: '待处理',
@@ -116,6 +124,20 @@ function canBeBanned(row) {
:value="item.value"
/>
</el-select>
<el-select
v-model="platformFilter"
class="app-user-platform"
clearable
placeholder="全部系统"
@change="queryUsers"
>
<el-option
v-for="item in PLATFORM_OPTIONS"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-select
v-model="countryFilter"
class="app-user-country"
@@ -165,24 +187,24 @@ function canBeBanned(row) {
<template v-else>{{ avatarText(row) }}</template>
</span>
<div class="app-user-meta">
<span class="app-user-name" :title="row.nickname">{{
row.nickname || '未设置昵称'
}}</span>
<span class="app-user-uid" :title="row.uid">{{ row.uid }}</span>
<span class="app-user-name" :title="row.nickname || ''">
昵称: {{ row.nickname || '未设置昵称' }}
</span>
<span class="app-user-uid">UID: {{ row.uid }}</span>
</div>
</div>
</template>
</el-table-column>
<el-table-column label="系统" width="130" show-overflow-tooltip>
<template #default="{ row }">{{ systemText(row) }}</template>
<el-table-column label="系统" width="110" show-overflow-tooltip>
<template #default="{ row }">{{ platformText(row) }}</template>
</el-table-column>
<el-table-column label="手机 / 邮箱" min-width="150" show-overflow-tooltip>
<template #default="{ row }">
<span class="app-user-mono">{{ row.maskedTarget || '—' }}</span>
</template>
</el-table-column>
<el-table-column label="国家" width="90">
<template #default="{ row }">{{ row.countryCode || '—' }}</template>
<el-table-column label="国家" width="110">
<template #default="{ row }">{{ countryText(row.countryCode) }}</template>
</el-table-column>
<el-table-column label="状态" width="90">
<template #default="{ row }">
@@ -248,8 +270,8 @@ function canBeBanned(row) {
<template v-else>{{ avatarText(detail) }}</template>
</span>
<div class="app-user-meta">
<span class="app-user-name">{{ detail.nickname || '未设置昵称' }}</span>
<span class="app-user-uid">{{ detail.uid }}</span>
<span class="app-user-name"> 昵称: {{ detail.nickname || '未设置昵称' }} </span>
<span class="app-user-uid">UID: {{ detail.uid }}</span>
</div>
<el-tag :type="statusMeta(detail.status).tag" effect="light" style="margin-left: auto">
{{ statusMeta(detail.status).label }}
@@ -262,7 +284,10 @@ function canBeBanned(row) {
{{ detail.maskedTarget || '—' }}
</el-descriptions-item>
<el-descriptions-item label="国家 / 地区">
{{ detail.countryCode || '—' }} / {{ detail.regionCode || '—' }}
{{ countryText(detail.countryCode) }}
<template v-if="detail.regionCode && detail.regionCode !== detail.countryCode">
/ {{ countryText(detail.regionCode) }}
</template>
</el-descriptions-item>
<el-descriptions-item label="语言">{{ detail.language || '—' }}</el-descriptions-item>
<el-descriptions-item label="时区">{{ detail.timezone || '—' }}</el-descriptions-item>
@@ -272,7 +297,7 @@ function canBeBanned(row) {
<el-descriptions-item label="最后登录">{{
detail.lastLoginAt || '—'
}}</el-descriptions-item>
<el-descriptions-item label="系统">{{ systemText(detail) }}</el-descriptions-item>
<el-descriptions-item label="系统">{{ platformText(detail) }}</el-descriptions-item>
<el-descriptions-item label="会员">
{{ detail.vipLevel ? `等级 ${detail.vipLevel}` : '未开通(第二阶段)' }}
</el-descriptions-item>
@@ -304,15 +329,17 @@ function canBeBanned(row) {
<el-table-column label="完成" width="70">
<template #default="{ row }">{{ row.finished ? '是' : '否' }}</template>
</el-table-column>
<el-table-column label="系统" width="120" show-overflow-tooltip>
<template #default="{ row }">{{ systemText(row) }}</template>
<el-table-column label="系统" width="100" show-overflow-tooltip>
<template #default="{ row }">{{ platformText(row) }}</template>
</el-table-column>
<el-table-column label="来源" width="80">
<template #default="{ row }">{{
SOURCE_TEXT[row.source] || row.source || '—'
}}</template>
</el-table-column>
<el-table-column prop="watchedAt" label="时间" width="160" show-overflow-tooltip />
<el-table-column label="时间" width="160">
<template #default="{ row }">{{ formatDateTime(row.watchedAt) }}</template>
</el-table-column>
</el-table>
</div>
+35 -23
View File
@@ -4,11 +4,24 @@
import { onMounted, reactive, ref } from 'vue'
import dayjs from 'dayjs'
import PageHeading from '@/views/components/PageHeading.vue'
import AppUserCell from '@/views/components/AppUserCell.vue'
import { pageFavoritesApi } from '@/api/admin/engagement'
import { platformText } from './composables/useAppUsers'
const PAGE_SIZES = [10, 20, 50]
const PLATFORM_OPTIONS = [
{ value: '', label: '全部系统' },
{ value: 'ANDROID', label: 'Android' },
{ value: 'IOS', label: 'iOS' }
]
const filters = reactive({ keyword: '', deviceId: '', dramaTitle: '', range: null })
const filters = reactive({
keyword: '',
deviceId: '',
dramaTitle: '',
platform: '',
range: null
})
const rows = ref([])
const total = ref(0)
const loading = ref(false)
@@ -24,7 +37,7 @@ async function load() {
keyword: filters.keyword.trim() || undefined,
deviceId: filters.deviceId.trim() || undefined,
dramaTitle: filters.dramaTitle.trim() || undefined,
platform: filters.platform || undefined,
startTime: filters.range?.[0] || undefined,
endTime: filters.range?.[1] || undefined
})
@@ -41,7 +54,13 @@ function search() {
}
function resetFilters() {
Object.assign(filters, { keyword: '', deviceId: '', dramaTitle: '', range: null })
Object.assign(filters, {
keyword: '',
deviceId: '',
dramaTitle: '',
platform: '',
range: null
})
search()
}
@@ -82,6 +101,14 @@ onMounted(load)
placeholder="短剧名称"
@keyup.enter="search"
/>
<el-select v-model="filters.platform" class="console-select" placeholder="全部系统">
<el-option
v-for="item in PLATFORM_OPTIONS"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-date-picker
v-model="filters.range"
@@ -104,22 +131,14 @@ onMounted(load)
class="drama-el-table"
empty-text="暂无收藏"
>
<el-table-column label="用户" min-width="180">
<el-table-column label="用户" min-width="200">
<template #default="{ row }">
<div class="app-user-meta">
<template v-if="row.userId == null">
<el-tag type="info" size="small">游客</el-tag>
<span class="app-user-uid engagement-device-id" :title="row.deviceId || ''">{{
row.deviceId || '—'
}}</span>
</template>
<template v-else>
<span class="app-user-name">{{ row.nickname || '未设置昵称' }}</span>
<span class="app-user-uid">{{ row.uid || `用户 #${row.userId}` }}</span>
</template>
</div>
<AppUserCell :row="row" />
</template>
</el-table-column>
<el-table-column label="系统" width="100">
<template #default="{ row }">{{ platformText(row) }}</template>
</el-table-column>
<el-table-column label="短剧" min-width="220">
<template #default="{ row }">
<div class="engagement-drama">
@@ -156,13 +175,6 @@ onMounted(load)
</template>
<style scoped>
.engagement-device-id {
max-width: 150px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.engagement-range {
width: 360px;
max-width: 100%;
+37 -22
View File
@@ -4,7 +4,9 @@
import { onMounted, reactive, ref } from 'vue'
import dayjs from 'dayjs'
import PageHeading from '@/views/components/PageHeading.vue'
import AppUserCell from '@/views/components/AppUserCell.vue'
import { pageLikesApi } from '@/api/admin/engagement'
import { platformText } from './composables/useAppUsers'
const PAGE_SIZES = [10, 20, 50]
const TARGET_OPTIONS = [
@@ -13,8 +15,20 @@ const TARGET_OPTIONS = [
{ value: 'EPISODE', label: '剧集' },
{ value: 'COMMENT', label: '评论' }
]
const PLATFORM_OPTIONS = [
{ value: '', label: '全部系统' },
{ value: 'ANDROID', label: 'Android' },
{ value: 'IOS', label: 'iOS' }
]
const filters = reactive({ keyword: '', deviceId: '', dramaTitle: '', range: null, targetType: '' })
const filters = reactive({
keyword: '',
deviceId: '',
dramaTitle: '',
range: null,
targetType: '',
platform: ''
})
const rows = ref([])
const total = ref(0)
const loading = ref(false)
@@ -31,6 +45,7 @@ async function load() {
deviceId: filters.deviceId.trim() || undefined,
dramaTitle: filters.dramaTitle.trim() || undefined,
targetType: filters.targetType || undefined,
platform: filters.platform || undefined,
startTime: filters.range?.[0] || undefined,
endTime: filters.range?.[1] || undefined
})
@@ -47,7 +62,14 @@ function search() {
}
function resetFilters() {
Object.assign(filters, { keyword: '', deviceId: '', dramaTitle: '', range: null, targetType: '' })
Object.assign(filters, {
keyword: '',
deviceId: '',
dramaTitle: '',
range: null,
targetType: '',
platform: ''
})
search()
}
@@ -106,6 +128,14 @@ onMounted(load)
:value="item.value"
/>
</el-select>
<el-select v-model="filters.platform" class="console-select" placeholder="全部系统">
<el-option
v-for="item in PLATFORM_OPTIONS"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-date-picker
v-model="filters.range"
class="engagement-range"
@@ -127,22 +157,14 @@ onMounted(load)
class="drama-el-table"
empty-text="暂无点赞"
>
<el-table-column label="用户" min-width="180">
<el-table-column label="用户" min-width="200">
<template #default="{ row }">
<div class="app-user-meta">
<template v-if="row.userId == null">
<el-tag type="info" size="small">游客</el-tag>
<span class="app-user-uid engagement-device-id" :title="row.deviceId || ''">{{
row.deviceId || '—'
}}</span>
</template>
<template v-else>
<span class="app-user-name">{{ row.nickname || '未设置昵称' }}</span>
<span class="app-user-uid">{{ row.uid || `用户 #${row.userId}` }}</span>
</template>
</div>
<AppUserCell :row="row" />
</template>
</el-table-column>
<el-table-column label="系统" width="100">
<template #default="{ row }">{{ platformText(row) }}</template>
</el-table-column>
<el-table-column label="目标类型" width="110">
<template #default="{ row }">{{ typeText(row.targetType) }}</template>
</el-table-column>
@@ -172,13 +194,6 @@ onMounted(load)
</template>
<style scoped>
.engagement-device-id {
max-width: 150px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.engagement-range {
width: 360px;
max-width: 100%;
+31 -9
View File
@@ -3,8 +3,9 @@
<script setup>
import { onMounted, reactive, ref } from 'vue'
import PageHeading from '@/views/components/PageHeading.vue'
import AppUserCell from '@/views/components/AppUserCell.vue'
import { pageWatchHistoryApi } from '@/api/admin/appUser'
import { formatDuration, systemText } from './composables/useAppUsers'
import { formatDateTime, formatDuration, platformText } from './composables/useAppUsers'
const SOURCE_OPTIONS = [
{ value: '', label: '全部' },
@@ -20,11 +21,18 @@ const FINISHED_OPTIONS = [
{ value: false, label: '未看完' }
]
const PLATFORM_OPTIONS = [
{ value: '', label: '全部系统' },
{ value: 'ANDROID', label: 'Android' },
{ value: 'IOS', label: 'iOS' }
]
const filters = reactive({
keyword: '',
dramaTitle: '',
source: '',
finished: '',
platform: '',
range: null
})
const rows = ref([])
@@ -43,6 +51,7 @@ async function load() {
dramaTitle: filters.dramaTitle.trim() || undefined,
source: filters.source || undefined,
finished: filters.finished === '' ? undefined : filters.finished,
platform: filters.platform || undefined,
startTime: filters.range?.[0] || undefined,
endTime: filters.range?.[1] || undefined
})
@@ -63,6 +72,7 @@ function resetFilters() {
filters.dramaTitle = ''
filters.source = ''
filters.finished = ''
filters.platform = ''
filters.range = null
search()
}
@@ -144,6 +154,19 @@ onMounted(load)
:value="item.value"
/>
</el-select>
<el-select
v-model="filters.platform"
class="console-select"
placeholder="全部系统"
@change="search"
>
<el-option
v-for="item in PLATFORM_OPTIONS"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-date-picker
v-model="filters.range"
class="watch-history-range"
@@ -167,17 +190,16 @@ onMounted(load)
class="drama-el-table"
empty-text="暂无符合条件的观看记录"
>
<el-table-column prop="watchedAt" label="观看时间" min-width="170" show-overflow-tooltip />
<el-table-column label="用户" min-width="180">
<el-table-column label="观看时间" min-width="170">
<template #default="{ row }">{{ formatDateTime(row.watchedAt) }}</template>
</el-table-column>
<el-table-column label="用户" min-width="200">
<template #default="{ row }">
<div class="app-user-meta">
<span class="app-user-name">{{ row.nickname || '未设置昵称' }}</span>
<span class="app-user-uid">{{ row.uid || `用户 #${row.userId || '—'}` }}</span>
</div>
<AppUserCell :row="row" />
</template>
</el-table-column>
<el-table-column label="系统" width="130" show-overflow-tooltip>
<template #default="{ row }">{{ systemText(row) }}</template>
<el-table-column label="系统" width="100">
<template #default="{ row }">{{ platformText(row) }}</template>
</el-table-column>
<el-table-column label="短剧" min-width="190">
<template #default="{ row }">
@@ -1,6 +1,7 @@
// Author: fruit.com.cn
import { onMounted, reactive, ref } from 'vue'
import dayjs from 'dayjs'
import { ElMessage, ElMessageBox } from 'element-plus'
import {
getAppUserApi,
@@ -28,6 +29,69 @@ export const COUNTRY_OPTIONS = [
{ value: 'CN', label: '中国' }
]
/** 国家码 → 中文名,与后端 CountryProfile 保持一致;未收录的仍显示原码 */
const COUNTRY_TEXT = {
ID: '印度尼西亚',
MY: '马来西亚',
SG: '新加坡',
TH: '泰国',
VN: '越南',
PH: '菲律宾',
KH: '柬埔寨',
MM: '缅甸',
LA: '老挝',
BN: '文莱',
CN: '中国',
TW: '中国台湾',
HK: '中国香港',
MO: '中国澳门',
JP: '日本',
KR: '韩国',
IN: '印度',
PK: '巴基斯坦',
BD: '孟加拉国',
LK: '斯里兰卡',
NP: '尼泊尔',
US: '美国',
CA: '加拿大',
MX: '墨西哥',
BR: '巴西',
AR: '阿根廷',
CL: '智利',
CO: '哥伦比亚',
PE: '秘鲁',
VE: '委内瑞拉',
EC: '厄瓜多尔',
GT: '危地马拉',
DO: '多米尼加',
GB: '英国',
DE: '德国',
FR: '法国',
ES: '西班牙',
IT: '意大利',
NL: '荷兰',
PL: '波兰',
RU: '俄罗斯',
UA: '乌克兰',
TR: '土耳其',
SA: '沙特阿拉伯',
AE: '阿联酋',
IL: '以色列',
EG: '埃及',
NG: '尼日利亚',
ZA: '南非',
KE: '肯尼亚',
MA: '摩洛哥',
AU: '澳大利亚',
NZ: '新西兰'
}
/** 国家列统一展示中文名,无值时显示横线 */
export function countryText(code) {
const value = (code || '').toUpperCase()
return COUNTRY_TEXT[value] || value || '—'
}
export function statusMeta(status) {
return (
APP_USER_STATUS.find((item) => item.value === status) || { label: status || '-', tag: 'info' }
@@ -36,12 +100,15 @@ export function statusMeta(status) {
const PLATFORM_TEXT = { ANDROID: 'Android', IOS: 'iOS', WEB: 'Web' }
/** 登录会话上的系统,例如 Android 16。没有记录时显示横线。 */
export function systemText(row) {
const name = PLATFORM_TEXT[row?.platform] || row?.platform || ''
const version = row?.osVersion || ''
const text = `${name} ${version}`.trim()
return text || '—'
/** 客户端平台,只有 iOS / Android 两种取值(缺记录显示横线)。 */
export function platformText(row) {
const platform = row?.platform || ''
return PLATFORM_TEXT[platform] || platform || '—'
}
/** 后端返回 ISO 时间串,统一格式化成后台可读的本地时间 */
export function formatDateTime(value) {
return value && dayjs(value).isValid() ? dayjs(value).format('YYYY-MM-DD HH:mm:ss') : '—'
}
/** 毫秒转 mm:ss,观看流水里的进度用 */
@@ -60,6 +127,7 @@ export function useAppUsers() {
const keyword = ref('')
const statusFilter = ref(undefined)
const countryFilter = ref(undefined)
const platformFilter = ref(undefined)
const currentPage = ref(1)
const pageSize = ref(10)
@@ -82,7 +150,8 @@ export function useAppUsers() {
pageSize: pageSize.value,
keyword: keyword.value.trim() || undefined,
status: statusFilter.value,
countryCode: countryFilter.value
countryCode: countryFilter.value,
platform: platformFilter.value || undefined
})
users.value = res.data?.list || []
total.value = res.data?.total || 0
@@ -100,6 +169,7 @@ export function useAppUsers() {
keyword.value = ''
statusFilter.value = undefined
countryFilter.value = undefined
platformFilter.value = undefined
queryUsers()
}
@@ -186,6 +256,7 @@ export function useAppUsers() {
keyword,
statusFilter,
countryFilter,
platformFilter,
currentPage,
pageSize,
detailVisible,