feat: add week star admin management

This commit is contained in:
hy 2026-04-18 13:08:39 +08:00
parent 719fe76bba
commit 2ef56428dc
8 changed files with 1294 additions and 31 deletions

View File

@ -4,7 +4,7 @@ VITE_PORT=5999
VITE_BASE=/
# 接口地址
VITE_GLOB_API_URL=http://127.0.0.1:2700/console
VITE_GLOB_API_URL=/console
# OSS
VITE_GLOB_OSS_BUCKET=tkm-likei

View File

@ -2,6 +2,9 @@ import type { LegacyPageResult } from '#/api/legacy/system';
import { requestClient } from '#/api/request';
const SPECIFIED_GIFT_WEEKLY_RANK_BASE =
'/go/resident-activity/specified-gift-weekly-rank';
export async function getResidentInviteConfig(sysOrigin: string) {
return requestClient.get<Record<string, any>>('/resident-activity/invite/config', {
params: { sysOrigin },
@ -41,3 +44,68 @@ export async function resetResidentRegisterRewardConfig(sysOrigin: string) {
params: { sysOrigin },
});
}
export async function pageSpecifiedGiftWeeklyRankConfigs(params: Record<string, any>) {
return requestClient.get<LegacyPageResult<Record<string, any>>>(
`${SPECIFIED_GIFT_WEEKLY_RANK_BASE}/config/page`,
{ params },
);
}
export async function getSpecifiedGiftWeeklyRankConfig(params: Record<string, any>) {
return requestClient.get<Record<string, any>>(
`${SPECIFIED_GIFT_WEEKLY_RANK_BASE}/config`,
{ params },
);
}
export async function saveSpecifiedGiftWeeklyRankConfig(data: Record<string, any>) {
return requestClient.post(`${SPECIFIED_GIFT_WEEKLY_RANK_BASE}/config/save`, data);
}
export async function pageSpecifiedGiftWeeklyRankSnapshots(params: Record<string, any>) {
return requestClient.get<LegacyPageResult<Record<string, any>>>(
`${SPECIFIED_GIFT_WEEKLY_RANK_BASE}/snapshot/page`,
{ params },
);
}
export async function pageSpecifiedGiftWeeklyRankRewardRecords(
params: Record<string, any>,
) {
return requestClient.get<LegacyPageResult<Record<string, any>>>(
`${SPECIFIED_GIFT_WEEKLY_RANK_BASE}/reward-record/page`,
{ params },
);
}
export async function retrySpecifiedGiftWeeklyRankRewardRecord(id: number | string) {
return requestClient.post<Record<string, any>>(
`${SPECIFIED_GIFT_WEEKLY_RANK_BASE}/reward-record/retry`,
{ id },
);
}
export async function getWeekStarConfig(params: Record<string, any>) {
return getSpecifiedGiftWeeklyRankConfig(params);
}
export async function saveWeekStarConfig(data: Record<string, any>) {
return saveSpecifiedGiftWeeklyRankConfig(data);
}
export async function pageWeekStarConfigs(params: Record<string, any>) {
return pageSpecifiedGiftWeeklyRankConfigs(params);
}
export async function pageWeekStarSnapshots(params: Record<string, any>) {
return pageSpecifiedGiftWeeklyRankSnapshots(params);
}
export async function pageWeekStarRewardRecords(params: Record<string, any>) {
return pageSpecifiedGiftWeeklyRankRewardRecords(params);
}
export async function retryWeekStarRewardRecord(id: number | string) {
return retrySpecifiedGiftWeeklyRankRewardRecord(id);
}

View File

@ -15,11 +15,7 @@ import { message } from 'antdv-next';
import { useAuthStore } from '#/store';
const { apiURL: rawApiURL } = useAppConfig(import.meta.env, import.meta.env.PROD);
const apiURL =
import.meta.env.DEV && rawApiURL === '/console'
? 'http://127.0.0.1:2700/console'
: rawApiURL;
const { apiURL } = useAppConfig(import.meta.env, import.meta.env.PROD);
function createRequestClient(baseURL: string, options?: RequestClientOptions) {
const client = new RequestClient({

View File

@ -29,6 +29,13 @@ const routes: RouteRecordRaw[] = [
component: () => import('#/views/resident-activity/invite-list.vue'),
meta: { title: '邀请活动列表' },
},
{
name: 'ResidentSpecifiedGiftWeeklyRank',
path: 'specified-gift-weekly-rank',
alias: 'week-star',
component: () => import('#/views/resident-activity/week-star.vue'),
meta: { title: '指定礼物周榜' },
},
],
},
];

File diff suppressed because it is too large Load Diff

View File

@ -11,6 +11,7 @@ import {
addRegionAssistConfig,
addRegionConfig,
deleteRegionAssistConfig,
getCountryAlls,
regionAssistConfigTable,
regionConfigTable,
resetRegionWithdrawal,
@ -18,6 +19,7 @@ import {
updateRegionConfig,
} from '#/api/legacy/system';
import {
ACTUAL_LANGUAGE_OPTIONS,
BANK_CARD_TYPES,
formatDate,
getAllowedSysOrigins,
@ -207,11 +209,11 @@ function createDiamondMetadata(): RegionMetadataField[] {
function createRegionForm() {
return {
countryCodes: '',
countryCodes: [] as string[],
diamondMetadata: {},
diamondMetadatas: createDiamondMetadata(),
id: '',
langeCodes: '',
langeCodes: [] as string[],
metadata: {},
metadatas: createRegionMetadata(),
regionCode: '',
@ -247,6 +249,7 @@ const assistDrawerOpen = ref(false);
const regionList = ref<Array<Record<string, any>>>([]);
const assistList = ref<Array<Record<string, any>>>([]);
const regionOptions = ref<Array<Record<string, any>>>([]);
const countries = ref<Array<Record<string, any>>>([]);
const regionQuery = reactive({
sysOrigin: '',
@ -299,6 +302,25 @@ const specialAssistTypes = new Set([
'WITHDRAW_PROPORTION_DIAMOND_USD_TIPS',
]);
const countrySelectOptions = computed(() =>
countries.value
.filter((item) => Boolean(item.alphaTwo))
.map((item) => ({
label: `${item.aliasName || item.countryName || item.alphaTwo} (${item.alphaTwo})`,
value: String(item.alphaTwo),
})),
);
const languageSelectOptions = ACTUAL_LANGUAGE_OPTIONS.map((item) => ({
label: `${item.name} (${item.value})`,
value: item.value,
}));
const withdrawalWaysSelectOptions = BANK_CARD_TYPES.map((item) => ({
label: item.name,
value: item.value,
}));
watch(
sysOriginOptions,
(options) => {
@ -329,6 +351,13 @@ function assignAssistForm(target: ReturnType<typeof createAssistForm>) {
Object.assign(assistForm, cloneValue(target));
}
function splitCommaValues(value: unknown) {
return String(value || '')
.split(',')
.map((item) => item.trim())
.filter(Boolean);
}
function getRegionSubmitPayload() {
const metadata = Object.fromEntries(
regionForm.metadatas.map((item) => [
@ -343,10 +372,10 @@ function getRegionSubmitPayload() {
]),
);
return {
countryCodes: regionForm.countryCodes?.trim(),
countryCodes: regionForm.countryCodes.join(','),
diamondMetadata,
id: regionForm.id,
langeCodes: regionForm.langeCodes?.trim(),
langeCodes: regionForm.langeCodes.join(','),
metadata,
regionCode: regionForm.regionCode?.trim(),
regionName: regionForm.regionName?.trim(),
@ -365,14 +394,12 @@ function fillRegionForm(row?: Record<string, any>) {
nextForm.id = row.id || '';
nextForm.regionCode = row.regionCode || '';
nextForm.regionName = row.regionName || '';
nextForm.countryCodes = row.countryCodes || '';
nextForm.langeCodes = row.langeCodes || '';
nextForm.countryCodes = splitCommaValues(row.countryCodes);
nextForm.langeCodes = splitCommaValues(row.langeCodes);
nextForm.remarks = row.remarks || '';
nextForm.withdrawalWaysList = Array.isArray(row.withdrawalWaysList)
? [...row.withdrawalWaysList]
: String(row.withdrawalWays || '')
.split(',')
.filter(Boolean);
: splitCommaValues(row.withdrawalWays);
const metadata = row.metadata || {};
nextForm.metadatas = createRegionMetadata().map((item) => ({
@ -464,6 +491,10 @@ async function loadAssistList() {
}
}
async function loadCountryOptions() {
countries.value = (await getCountryAlls()) || [];
}
async function handleSaveRegion() {
if (!regionForm.regionCode?.trim()) {
message.warning('请输入区域编码');
@ -585,6 +616,7 @@ function handleDeleteAssist(row: Record<string, any>) {
loadRegionList();
loadAssistList();
loadCountryOptions();
</script>
<template>
@ -752,18 +784,28 @@ loadAssistList();
/>
</FormItem>
<FormItem label="国家">
<Input
<Select
v-model:value="regionForm.countryCodes"
:disabled="savingRegion"
placeholder="如: CN,IN 多个使用英文逗号分隔"
/>
:options="countrySelectOptions"
mode="multiple"
option-filter-prop="label"
placeholder="请选择国家"
show-search
>
</Select>
</FormItem>
<FormItem label="语言">
<Input
<Select
v-model:value="regionForm.langeCodes"
:disabled="savingRegion"
placeholder="如: ar,en 多个使用英文逗号分隔"
/>
:options="languageSelectOptions"
mode="multiple"
option-filter-prop="label"
placeholder="请选择语言"
show-search
>
</Select>
</FormItem>
<FormItem label="备注">
<TextArea
@ -774,20 +816,15 @@ loadAssistList();
/>
</FormItem>
<FormItem label="提现方式">
<Select option-label-prop="children"
<Select
v-model:value="regionForm.withdrawalWaysList"
:disabled="savingRegion"
:options="withdrawalWaysSelectOptions"
mode="multiple"
option-filter-prop="label"
placeholder="请选择"
>
<SelectOption
v-for="item in BANK_CARD_TYPES"
:key="item.value"
:value="item.value"
>
{{ item.name }}
</SelectOption>
</Select>
show-search
/>
</FormItem>
<FormItem label="美金$钱包设置">
<div class="metadata-group">

View File

@ -120,6 +120,14 @@ export const LANGUAGE_OPTIONS = [
{ name: '繁体', value: 'zh_TW' },
];
export const ACTUAL_LANGUAGE_OPTIONS = [
{ name: '英语', value: 'en' },
{ name: '阿拉伯语', value: 'ar' },
{ name: '土耳其语', value: 'tr' },
{ name: '孟加拉语', value: 'bn' },
{ name: '中文', value: 'zh' },
];
export const ENUM_CONFIG_GROUP_NAMES = [
{
value: 'VIDEO_MATCH',

View File

@ -6,6 +6,12 @@ export default defineConfig(async () => {
vite: {
server: {
proxy: {
'/console/go': {
changeOrigin: true,
rewrite: (path) => path.replace(/^\/console\/go/, ''),
target: 'http://127.0.0.1:2900',
ws: true,
},
'/console': {
changeOrigin: true,
target: 'http://127.0.0.1:2700',