feat: add week star admin management
This commit is contained in:
parent
719fe76bba
commit
2ef56428dc
@ -4,7 +4,7 @@ VITE_PORT=5999
|
|||||||
VITE_BASE=/
|
VITE_BASE=/
|
||||||
|
|
||||||
# 接口地址
|
# 接口地址
|
||||||
VITE_GLOB_API_URL=http://127.0.0.1:2700/console
|
VITE_GLOB_API_URL=/console
|
||||||
|
|
||||||
# OSS
|
# OSS
|
||||||
VITE_GLOB_OSS_BUCKET=tkm-likei
|
VITE_GLOB_OSS_BUCKET=tkm-likei
|
||||||
|
|||||||
@ -2,6 +2,9 @@ import type { LegacyPageResult } from '#/api/legacy/system';
|
|||||||
|
|
||||||
import { requestClient } from '#/api/request';
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
const SPECIFIED_GIFT_WEEKLY_RANK_BASE =
|
||||||
|
'/go/resident-activity/specified-gift-weekly-rank';
|
||||||
|
|
||||||
export async function getResidentInviteConfig(sysOrigin: string) {
|
export async function getResidentInviteConfig(sysOrigin: string) {
|
||||||
return requestClient.get<Record<string, any>>('/resident-activity/invite/config', {
|
return requestClient.get<Record<string, any>>('/resident-activity/invite/config', {
|
||||||
params: { sysOrigin },
|
params: { sysOrigin },
|
||||||
@ -41,3 +44,68 @@ export async function resetResidentRegisterRewardConfig(sysOrigin: string) {
|
|||||||
params: { sysOrigin },
|
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);
|
||||||
|
}
|
||||||
|
|||||||
@ -15,11 +15,7 @@ import { message } from 'antdv-next';
|
|||||||
|
|
||||||
import { useAuthStore } from '#/store';
|
import { useAuthStore } from '#/store';
|
||||||
|
|
||||||
const { apiURL: rawApiURL } = useAppConfig(import.meta.env, import.meta.env.PROD);
|
const { apiURL } = useAppConfig(import.meta.env, import.meta.env.PROD);
|
||||||
const apiURL =
|
|
||||||
import.meta.env.DEV && rawApiURL === '/console'
|
|
||||||
? 'http://127.0.0.1:2700/console'
|
|
||||||
: rawApiURL;
|
|
||||||
|
|
||||||
function createRequestClient(baseURL: string, options?: RequestClientOptions) {
|
function createRequestClient(baseURL: string, options?: RequestClientOptions) {
|
||||||
const client = new RequestClient({
|
const client = new RequestClient({
|
||||||
|
|||||||
@ -29,6 +29,13 @@ const routes: RouteRecordRaw[] = [
|
|||||||
component: () => import('#/views/resident-activity/invite-list.vue'),
|
component: () => import('#/views/resident-activity/invite-list.vue'),
|
||||||
meta: { title: '邀请活动列表' },
|
meta: { title: '邀请活动列表' },
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'ResidentSpecifiedGiftWeeklyRank',
|
||||||
|
path: 'specified-gift-weekly-rank',
|
||||||
|
alias: 'week-star',
|
||||||
|
component: () => import('#/views/resident-activity/week-star.vue'),
|
||||||
|
meta: { title: '指定礼物周榜' },
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
1141
apps/src/views/resident-activity/week-star.vue
Normal file
1141
apps/src/views/resident-activity/week-star.vue
Normal file
File diff suppressed because it is too large
Load Diff
@ -11,6 +11,7 @@ import {
|
|||||||
addRegionAssistConfig,
|
addRegionAssistConfig,
|
||||||
addRegionConfig,
|
addRegionConfig,
|
||||||
deleteRegionAssistConfig,
|
deleteRegionAssistConfig,
|
||||||
|
getCountryAlls,
|
||||||
regionAssistConfigTable,
|
regionAssistConfigTable,
|
||||||
regionConfigTable,
|
regionConfigTable,
|
||||||
resetRegionWithdrawal,
|
resetRegionWithdrawal,
|
||||||
@ -18,6 +19,7 @@ import {
|
|||||||
updateRegionConfig,
|
updateRegionConfig,
|
||||||
} from '#/api/legacy/system';
|
} from '#/api/legacy/system';
|
||||||
import {
|
import {
|
||||||
|
ACTUAL_LANGUAGE_OPTIONS,
|
||||||
BANK_CARD_TYPES,
|
BANK_CARD_TYPES,
|
||||||
formatDate,
|
formatDate,
|
||||||
getAllowedSysOrigins,
|
getAllowedSysOrigins,
|
||||||
@ -207,11 +209,11 @@ function createDiamondMetadata(): RegionMetadataField[] {
|
|||||||
|
|
||||||
function createRegionForm() {
|
function createRegionForm() {
|
||||||
return {
|
return {
|
||||||
countryCodes: '',
|
countryCodes: [] as string[],
|
||||||
diamondMetadata: {},
|
diamondMetadata: {},
|
||||||
diamondMetadatas: createDiamondMetadata(),
|
diamondMetadatas: createDiamondMetadata(),
|
||||||
id: '',
|
id: '',
|
||||||
langeCodes: '',
|
langeCodes: [] as string[],
|
||||||
metadata: {},
|
metadata: {},
|
||||||
metadatas: createRegionMetadata(),
|
metadatas: createRegionMetadata(),
|
||||||
regionCode: '',
|
regionCode: '',
|
||||||
@ -247,6 +249,7 @@ const assistDrawerOpen = ref(false);
|
|||||||
const regionList = ref<Array<Record<string, any>>>([]);
|
const regionList = ref<Array<Record<string, any>>>([]);
|
||||||
const assistList = ref<Array<Record<string, any>>>([]);
|
const assistList = ref<Array<Record<string, any>>>([]);
|
||||||
const regionOptions = ref<Array<Record<string, any>>>([]);
|
const regionOptions = ref<Array<Record<string, any>>>([]);
|
||||||
|
const countries = ref<Array<Record<string, any>>>([]);
|
||||||
|
|
||||||
const regionQuery = reactive({
|
const regionQuery = reactive({
|
||||||
sysOrigin: '',
|
sysOrigin: '',
|
||||||
@ -299,6 +302,25 @@ const specialAssistTypes = new Set([
|
|||||||
'WITHDRAW_PROPORTION_DIAMOND_USD_TIPS',
|
'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(
|
watch(
|
||||||
sysOriginOptions,
|
sysOriginOptions,
|
||||||
(options) => {
|
(options) => {
|
||||||
@ -329,6 +351,13 @@ function assignAssistForm(target: ReturnType<typeof createAssistForm>) {
|
|||||||
Object.assign(assistForm, cloneValue(target));
|
Object.assign(assistForm, cloneValue(target));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function splitCommaValues(value: unknown) {
|
||||||
|
return String(value || '')
|
||||||
|
.split(',')
|
||||||
|
.map((item) => item.trim())
|
||||||
|
.filter(Boolean);
|
||||||
|
}
|
||||||
|
|
||||||
function getRegionSubmitPayload() {
|
function getRegionSubmitPayload() {
|
||||||
const metadata = Object.fromEntries(
|
const metadata = Object.fromEntries(
|
||||||
regionForm.metadatas.map((item) => [
|
regionForm.metadatas.map((item) => [
|
||||||
@ -343,10 +372,10 @@ function getRegionSubmitPayload() {
|
|||||||
]),
|
]),
|
||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
countryCodes: regionForm.countryCodes?.trim(),
|
countryCodes: regionForm.countryCodes.join(','),
|
||||||
diamondMetadata,
|
diamondMetadata,
|
||||||
id: regionForm.id,
|
id: regionForm.id,
|
||||||
langeCodes: regionForm.langeCodes?.trim(),
|
langeCodes: regionForm.langeCodes.join(','),
|
||||||
metadata,
|
metadata,
|
||||||
regionCode: regionForm.regionCode?.trim(),
|
regionCode: regionForm.regionCode?.trim(),
|
||||||
regionName: regionForm.regionName?.trim(),
|
regionName: regionForm.regionName?.trim(),
|
||||||
@ -365,14 +394,12 @@ function fillRegionForm(row?: Record<string, any>) {
|
|||||||
nextForm.id = row.id || '';
|
nextForm.id = row.id || '';
|
||||||
nextForm.regionCode = row.regionCode || '';
|
nextForm.regionCode = row.regionCode || '';
|
||||||
nextForm.regionName = row.regionName || '';
|
nextForm.regionName = row.regionName || '';
|
||||||
nextForm.countryCodes = row.countryCodes || '';
|
nextForm.countryCodes = splitCommaValues(row.countryCodes);
|
||||||
nextForm.langeCodes = row.langeCodes || '';
|
nextForm.langeCodes = splitCommaValues(row.langeCodes);
|
||||||
nextForm.remarks = row.remarks || '';
|
nextForm.remarks = row.remarks || '';
|
||||||
nextForm.withdrawalWaysList = Array.isArray(row.withdrawalWaysList)
|
nextForm.withdrawalWaysList = Array.isArray(row.withdrawalWaysList)
|
||||||
? [...row.withdrawalWaysList]
|
? [...row.withdrawalWaysList]
|
||||||
: String(row.withdrawalWays || '')
|
: splitCommaValues(row.withdrawalWays);
|
||||||
.split(',')
|
|
||||||
.filter(Boolean);
|
|
||||||
|
|
||||||
const metadata = row.metadata || {};
|
const metadata = row.metadata || {};
|
||||||
nextForm.metadatas = createRegionMetadata().map((item) => ({
|
nextForm.metadatas = createRegionMetadata().map((item) => ({
|
||||||
@ -464,6 +491,10 @@ async function loadAssistList() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function loadCountryOptions() {
|
||||||
|
countries.value = (await getCountryAlls()) || [];
|
||||||
|
}
|
||||||
|
|
||||||
async function handleSaveRegion() {
|
async function handleSaveRegion() {
|
||||||
if (!regionForm.regionCode?.trim()) {
|
if (!regionForm.regionCode?.trim()) {
|
||||||
message.warning('请输入区域编码');
|
message.warning('请输入区域编码');
|
||||||
@ -585,6 +616,7 @@ function handleDeleteAssist(row: Record<string, any>) {
|
|||||||
|
|
||||||
loadRegionList();
|
loadRegionList();
|
||||||
loadAssistList();
|
loadAssistList();
|
||||||
|
loadCountryOptions();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -752,18 +784,28 @@ loadAssistList();
|
|||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="国家">
|
<FormItem label="国家">
|
||||||
<Input
|
<Select
|
||||||
v-model:value="regionForm.countryCodes"
|
v-model:value="regionForm.countryCodes"
|
||||||
:disabled="savingRegion"
|
:disabled="savingRegion"
|
||||||
placeholder="如: CN,IN 多个使用英文逗号分隔"
|
:options="countrySelectOptions"
|
||||||
/>
|
mode="multiple"
|
||||||
|
option-filter-prop="label"
|
||||||
|
placeholder="请选择国家"
|
||||||
|
show-search
|
||||||
|
>
|
||||||
|
</Select>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="语言">
|
<FormItem label="语言">
|
||||||
<Input
|
<Select
|
||||||
v-model:value="regionForm.langeCodes"
|
v-model:value="regionForm.langeCodes"
|
||||||
:disabled="savingRegion"
|
:disabled="savingRegion"
|
||||||
placeholder="如: ar,en 多个使用英文逗号分隔"
|
:options="languageSelectOptions"
|
||||||
/>
|
mode="multiple"
|
||||||
|
option-filter-prop="label"
|
||||||
|
placeholder="请选择语言"
|
||||||
|
show-search
|
||||||
|
>
|
||||||
|
</Select>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="备注">
|
<FormItem label="备注">
|
||||||
<TextArea
|
<TextArea
|
||||||
@ -774,20 +816,15 @@ loadAssistList();
|
|||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="提现方式">
|
<FormItem label="提现方式">
|
||||||
<Select option-label-prop="children"
|
<Select
|
||||||
v-model:value="regionForm.withdrawalWaysList"
|
v-model:value="regionForm.withdrawalWaysList"
|
||||||
:disabled="savingRegion"
|
:disabled="savingRegion"
|
||||||
|
:options="withdrawalWaysSelectOptions"
|
||||||
mode="multiple"
|
mode="multiple"
|
||||||
|
option-filter-prop="label"
|
||||||
placeholder="请选择"
|
placeholder="请选择"
|
||||||
>
|
show-search
|
||||||
<SelectOption
|
/>
|
||||||
v-for="item in BANK_CARD_TYPES"
|
|
||||||
:key="item.value"
|
|
||||||
:value="item.value"
|
|
||||||
>
|
|
||||||
{{ item.name }}
|
|
||||||
</SelectOption>
|
|
||||||
</Select>
|
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="美金$钱包设置">
|
<FormItem label="美金$钱包设置">
|
||||||
<div class="metadata-group">
|
<div class="metadata-group">
|
||||||
|
|||||||
@ -120,6 +120,14 @@ export const LANGUAGE_OPTIONS = [
|
|||||||
{ name: '繁体', value: 'zh_TW' },
|
{ 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 = [
|
export const ENUM_CONFIG_GROUP_NAMES = [
|
||||||
{
|
{
|
||||||
value: 'VIDEO_MATCH',
|
value: 'VIDEO_MATCH',
|
||||||
|
|||||||
@ -6,6 +6,12 @@ export default defineConfig(async () => {
|
|||||||
vite: {
|
vite: {
|
||||||
server: {
|
server: {
|
||||||
proxy: {
|
proxy: {
|
||||||
|
'/console/go': {
|
||||||
|
changeOrigin: true,
|
||||||
|
rewrite: (path) => path.replace(/^\/console\/go/, ''),
|
||||||
|
target: 'http://127.0.0.1:2900',
|
||||||
|
ws: true,
|
||||||
|
},
|
||||||
'/console': {
|
'/console': {
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
target: 'http://127.0.0.1:2700',
|
target: 'http://127.0.0.1:2700',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user