From 6f57070ad10fc40eefb263fbc63685a7a1e4a5a4 Mon Sep 17 00:00:00 2001 From: wenfp Date: Mon, 27 Jul 2026 16:40:02 +0800 Subject: [PATCH] update --- .gitignore | 3 +- front/src/api/adSlots.ts | 43 ++ front/src/api/ads.ts | 54 ++ front/src/api/featureIcons.ts | 64 +++ front/src/views/ad-slots/AdSlotManagement.vue | 224 ++++++++ front/src/views/ads/AdManagement.vue | 428 ++++++++++++++ .../feature-icons/FeatureIconManagement.vue | 528 ++++++++++++++++++ 7 files changed, 1343 insertions(+), 1 deletion(-) create mode 100644 front/src/api/adSlots.ts create mode 100644 front/src/api/ads.ts create mode 100644 front/src/api/featureIcons.ts create mode 100644 front/src/views/ad-slots/AdSlotManagement.vue create mode 100644 front/src/views/ads/AdManagement.vue create mode 100644 front/src/views/feature-icons/FeatureIconManagement.vue diff --git a/.gitignore b/.gitignore index ed65a6e..b3e0dba 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ app.sqlite3 front/node_modules/ front/dist/ certs/ -*.pem \ No newline at end of file +*.pem +front/tsconfig.tsbuildinfo \ No newline at end of file diff --git a/front/src/api/adSlots.ts b/front/src/api/adSlots.ts new file mode 100644 index 0000000..d677d05 --- /dev/null +++ b/front/src/api/adSlots.ts @@ -0,0 +1,43 @@ +import { request } from './http'; + +export type AdSlot = { + id: number; + temple_id: number; + name: string; + code: string; + description: string | null; + sort_order: number; + is_active: boolean; +}; + +export type AdSlotPayload = { + name: string; + code: string; + description?: string | null; + sort_order?: number; + is_active?: boolean; +}; + +export function listAdSlots() { + return request('/ad-slots'); +} + +export function createAdSlot(payload: AdSlotPayload) { + return request('/ad-slots', { + method: 'POST', + json: payload, + }); +} + +export function updateAdSlot(id: number, payload: Partial) { + return request(`/ad-slots/${id}`, { + method: 'PATCH', + json: payload, + }); +} + +export function deleteAdSlot(id: number) { + return request(`/ad-slots/${id}`, { + method: 'DELETE', + }); +} diff --git a/front/src/api/ads.ts b/front/src/api/ads.ts new file mode 100644 index 0000000..51554d1 --- /dev/null +++ b/front/src/api/ads.ts @@ -0,0 +1,54 @@ +import { request } from './http'; + +export type AdTargetType = 'app' | 'link'; + +export type Ad = { + id: number; + temple_id: number; + slot_id: number; + slot_name: string | null; + slot_code: string | null; + title: string; + image_url: string; + target_type: AdTargetType; + target_url: string | null; + product_id: number | null; + product_name: string | null; + sort_order: number; + is_active: boolean; +}; + +export type AdPayload = { + slot_id: number; + title: string; + image_url: string; + target_type: AdTargetType; + target_url?: string | null; + product_id?: number | null; + sort_order?: number; + is_active?: boolean; +}; + +export function listAds() { + return request('/ads'); +} + +export function createAd(payload: AdPayload) { + return request('/ads', { + method: 'POST', + json: payload, + }); +} + +export function updateAd(id: number, payload: Partial) { + return request(`/ads/${id}`, { + method: 'PATCH', + json: payload, + }); +} + +export function deleteAd(id: number) { + return request(`/ads/${id}`, { + method: 'DELETE', + }); +} diff --git a/front/src/api/featureIcons.ts b/front/src/api/featureIcons.ts new file mode 100644 index 0000000..2e1dcda --- /dev/null +++ b/front/src/api/featureIcons.ts @@ -0,0 +1,64 @@ +import { request } from './http'; + +export type FeatureIconTargetType = 'app' | 'link'; + +export type FeatureIcon = { + id: number; + temple_id: number; + title: string; + icon_url: string; + target_type: FeatureIconTargetType; + target_url: string | null; + product_id: number | null; + product_name: string | null; + sort_order: number; + is_active: boolean; +}; + +export type FeatureIconPayload = { + title: string; + icon_url: string; + target_type: FeatureIconTargetType; + target_url?: string | null; + product_id?: number | null; + sort_order?: number; + is_active?: boolean; +}; + +export function listFeatureIcons() { + return request('/feature-icons'); +} + +export function listSourceFeatureIcons(sourceTempleId: number) { + return request(`/feature-icons/source/${sourceTempleId}`); +} + +export function createFeatureIcon(payload: FeatureIconPayload) { + return request('/feature-icons', { + method: 'POST', + json: payload, + }); +} + +export function updateFeatureIcon(id: number, payload: Partial) { + return request(`/feature-icons/${id}`, { + method: 'PATCH', + json: payload, + }); +} + +export function deleteFeatureIcon(id: number) { + return request(`/feature-icons/${id}`, { + method: 'DELETE', + }); +} + +export function copyFeatureIcons(sourceTempleId: number, iconIds: number[]) { + return request('/feature-icons/copy', { + method: 'POST', + json: { + source_temple_id: sourceTempleId, + icon_ids: iconIds, + }, + }); +} diff --git a/front/src/views/ad-slots/AdSlotManagement.vue b/front/src/views/ad-slots/AdSlotManagement.vue new file mode 100644 index 0000000..9b558be --- /dev/null +++ b/front/src/views/ad-slots/AdSlotManagement.vue @@ -0,0 +1,224 @@ + + + diff --git a/front/src/views/ads/AdManagement.vue b/front/src/views/ads/AdManagement.vue new file mode 100644 index 0000000..0fe9171 --- /dev/null +++ b/front/src/views/ads/AdManagement.vue @@ -0,0 +1,428 @@ + + + diff --git a/front/src/views/feature-icons/FeatureIconManagement.vue b/front/src/views/feature-icons/FeatureIconManagement.vue new file mode 100644 index 0000000..f0f27d2 --- /dev/null +++ b/front/src/views/feature-icons/FeatureIconManagement.vue @@ -0,0 +1,528 @@ + + +