会员搜索
This commit is contained in:
parent
24e5f5a010
commit
a889c53bfc
|
|
@ -5,7 +5,7 @@
|
|||
* 支持响应式布局
|
||||
* Requirements: 2.1, 2.2, 2.4
|
||||
*/
|
||||
import { computed, onMounted, onUnmounted } from 'vue'
|
||||
import { computed, onMounted, onUnmounted, ref } from 'vue'
|
||||
import { useAppStore } from '@/stores/app'
|
||||
import type { DeviceType } from '@/stores/app'
|
||||
import Sidebar from './Sidebar.vue'
|
||||
|
|
@ -13,6 +13,9 @@ import Header from './Header.vue'
|
|||
|
||||
const appStore = useAppStore()
|
||||
|
||||
// 需要缓存的页面组件名称
|
||||
const cachedViews = ref(['UserListPage'])
|
||||
|
||||
// 侧边栏折叠状态
|
||||
const isCollapsed = computed(() => appStore.isSidebarCollapsed)
|
||||
|
||||
|
|
@ -107,13 +110,10 @@ onUnmounted(() => {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<router-view v-slot="{ Component }">
|
||||
<transition
|
||||
name="fade-transform"
|
||||
mode="out-in"
|
||||
>
|
||||
<component :is="Component" />
|
||||
</transition>
|
||||
<router-view v-slot="{ Component, route }">
|
||||
<keep-alive :include="cachedViews">
|
||||
<component :is="Component" :key="route.name" />
|
||||
</keep-alive>
|
||||
</router-view>
|
||||
</main>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
<script lang="ts">
|
||||
export default { name: 'UserListPage' }
|
||||
</script>
|
||||
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
* 用户列表页面
|
||||
|
|
@ -11,7 +15,6 @@ import SearchForm from '@/components/SearchForm/index.vue'
|
|||
import Pagination from '@/components/Pagination/index.vue'
|
||||
import StatusTag from '@/components/StatusTag/index.vue'
|
||||
import { getUserList, updateUserStatus, createTestUsers, deleteUser, refreshRecommend } from '@/api/user'
|
||||
import { getMemberTierList } from '@/api/memberTier'
|
||||
import { getFullImageUrl } from '@/utils/image'
|
||||
import type { UserListItem, UserQueryParams } from '@/types/user.d'
|
||||
|
||||
|
|
@ -55,29 +58,16 @@ const memberOptions = [
|
|||
{ label: '否', value: false }
|
||||
]
|
||||
|
||||
// 会员等级选项 - 从后台配置动态获取
|
||||
// 会员等级选项 - 固定等级名称
|
||||
const memberLevelOptions = ref([
|
||||
{ label: '全部', value: '' },
|
||||
{ label: '非会员', value: 0 }
|
||||
{ label: '非会员', value: 0 },
|
||||
{ label: '等级1 - 不限时会员', value: 1 },
|
||||
{ label: '等级2 - 诚意会员', value: 2 },
|
||||
{ label: '等级3 - 家庭版会员', value: 3 },
|
||||
{ label: '等级4 - 限时会员', value: 4 }
|
||||
])
|
||||
|
||||
// 加载会员等级配置
|
||||
const loadMemberTierOptions = async () => {
|
||||
try {
|
||||
const res = await getMemberTierList()
|
||||
const tiers = res.data || res || []
|
||||
if (Array.isArray(tiers) && tiers.length > 0) {
|
||||
memberLevelOptions.value = [
|
||||
{ label: '全部', value: '' },
|
||||
{ label: '非会员', value: 0 },
|
||||
...tiers.map((t: any) => ({ label: t.name, value: t.level }))
|
||||
]
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载会员等级配置失败:', error)
|
||||
}
|
||||
}
|
||||
|
||||
// 实名认证选项
|
||||
const realNameOptions = [
|
||||
{ label: '全部', value: '' },
|
||||
|
|
@ -99,6 +89,17 @@ const userTypeOptions = [
|
|||
{ label: '测试用户', value: true }
|
||||
]
|
||||
|
||||
// 获取会员等级名称
|
||||
const getMemberLevelName = (level: number) => {
|
||||
const names: Record<number, string> = {
|
||||
1: '不限时会员',
|
||||
2: '诚意会员',
|
||||
3: '家庭版会员',
|
||||
4: '限时会员'
|
||||
}
|
||||
return names[level] || `等级${level}`
|
||||
}
|
||||
|
||||
// 获取用户列表
|
||||
const fetchUserList = async () => {
|
||||
loading.value = true
|
||||
|
|
@ -269,7 +270,6 @@ const handleRefreshRecommend = async (row: UserListItem) => {
|
|||
|
||||
onMounted(() => {
|
||||
fetchUserList()
|
||||
loadMemberTierOptions()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
@ -480,7 +480,7 @@ onMounted(() => {
|
|||
v-if="row.isMember"
|
||||
type="warning"
|
||||
>
|
||||
{{ row.memberLevelText }}
|
||||
{{ getMemberLevelName(row.memberLevel) }}
|
||||
</el-tag>
|
||||
<span v-else>非会员</span>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ const ENV = {
|
|||
}
|
||||
|
||||
// 当前环境 - 开发时使用 development,打包时改为 production
|
||||
const CURRENT_ENV = 'development'
|
||||
const CURRENT_ENV = 'production'
|
||||
|
||||
// 导出配置
|
||||
export const config = {
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ public class AdminPopupService : IAdminPopupService
|
|||
public async Task<long> UpdatePopupByTypeAsync(int popupType, UpdatePopupRequest request, long adminId)
|
||||
{
|
||||
// Validate popup type
|
||||
if (popupType < 1 || popupType > 3)
|
||||
if (popupType < 1 || popupType > 4)
|
||||
{
|
||||
throw new BusinessException(ErrorCodes.InvalidParameter, "无效的弹窗类型");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user