From edc1118a52d08a31e0292452eec9e028abc54ac9 Mon Sep 17 00:00:00 2001 From: shiran Date: Mon, 24 Aug 2026 20:54:13 +0800 Subject: [PATCH] feat: add AWS and MF consumption management --- src/api/admin/awsService.js | 19 ++ src/api/admin/mfConsumption.js | 19 ++ src/config/menus.js | 14 + src/router/index.js | 35 ++ src/views/activity/MFConsumptionPromotion.vue | 321 ++++++++++++++++++ src/views/aws/AwsGoods.vue | 61 ++++ src/views/aws/AwsInstances.vue | 45 +++ src/views/aws/AwsServices.vue | 56 +++ src/views/product/ProductGroup.vue | 13 + 9 files changed, 583 insertions(+) create mode 100644 src/api/admin/awsService.js create mode 100644 src/api/admin/mfConsumption.js create mode 100644 src/views/activity/MFConsumptionPromotion.vue create mode 100644 src/views/aws/AwsGoods.vue create mode 100644 src/views/aws/AwsInstances.vue create mode 100644 src/views/aws/AwsServices.vue diff --git a/src/api/admin/awsService.js b/src/api/admin/awsService.js new file mode 100644 index 0000000..bd40ad3 --- /dev/null +++ b/src/api/admin/awsService.js @@ -0,0 +1,19 @@ +import { http2 } from '@/utils/request.js' + +const base = '/api/v1/admin/server/aws_service' + +export const getAwsServiceList = (params) => http2.get(`${base}/list`, { params }) +export const getAwsServiceDetail = (id) => http2.get(`${base}/detail`, { params: { id } }) +export const createAwsService = (data) => http2.post(`${base}/create`, data) +export const updateAwsService = (data) => http2.post(`${base}/update`, data) +export const testAwsService = (id) => http2.post(`${base}/test`, null, { params: { id } }) +export const deleteAwsService = (id) => http2.delete(`${base}/delete`, { params: { id } }) + +export const getAwsGoodsList = (params) => http2.get(`${base}/goods/list`, { params }) +export const getAwsGoodsDetail = (id) => http2.get(`${base}/goods/detail`, { params: { id } }) +export const createAwsGoods = (data) => http2.post(`${base}/goods/create`, data) +export const updateAwsGoods = (data) => http2.post(`${base}/goods/update`, data) +export const deleteAwsGoods = (id) => http2.delete(`${base}/goods/delete`, { params: { id } }) + +export const getAwsInstanceList = (params) => http2.get(`${base}/instances/list`, { params }) +export const retryAwsInstance = (instanceId) => http2.post(`${base}/instances/retry`, null, { params: { instance_id: instanceId } }) diff --git a/src/api/admin/mfConsumption.js b/src/api/admin/mfConsumption.js new file mode 100644 index 0000000..a164d32 --- /dev/null +++ b/src/api/admin/mfConsumption.js @@ -0,0 +1,19 @@ +import { http2 } from '@/utils/request.js' + +const base = '/api/v1/admin/activity/mf_consumption' + +/** 获取魔方特殊消费活动列表 */ +export const getMFConsumptionPromotionList = (params) => + http2.get(`${base}/list`, { params }) + +/** 创建魔方特殊消费活动 */ +export const createMFConsumptionPromotion = (data) => + http2.post(`${base}/create`, data) + +/** 软删除魔方特殊消费活动 */ +export const deleteMFConsumptionPromotion = (id) => + http2.delete(`${base}/delete`, { params: { id } }) + +/** 永久清理指定时间范围内的 MF 扣减型消费记录 */ +export const clearMFConsumptionHistories = (data) => + http2.delete(`${base}/histories/clear`, { data }) diff --git a/src/config/menus.js b/src/config/menus.js index 394f289..e2eff65 100644 --- a/src/config/menus.js +++ b/src/config/menus.js @@ -91,6 +91,10 @@ export const menus = [ { path: '/activity/groupbuy', title: '拼团管理' + }, + { + path: '/activity/mf-consumption', + title: '魔方特殊消费' } ] }, @@ -176,6 +180,16 @@ export const menus = [ } ] }, + { + path: '/aws', + title: 'AWS 服务管理', + icon: 'Cloudy', + children: [ + { path: '/aws/services', title: '服务配置' }, + { path: '/aws/goods', title: '商品绑定' }, + { path: '/aws/instances', title: '履约实例' } + ] + }, { title: '虚拟化平台管理', icon: 'Platform', diff --git a/src/router/index.js b/src/router/index.js index 1ba0a81..27c992c 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -374,6 +374,14 @@ const routes = [ meta: { title: '拼团管理' } + }, + { + path: 'mf-consumption', + name: 'MFConsumptionPromotion', + component: () => import('../views/activity/MFConsumptionPromotion.vue'), + meta: { + title: '魔方特殊消费' + } } ] }, @@ -663,6 +671,33 @@ const routes = [ } ] }, + // AWS 远端商品管理 + { + path: 'aws', + name: 'Aws', + meta: { title: 'AWS 服务管理', icon: 'Cloudy' }, + redirect: '/aws/services', + children: [ + { + path: 'services', + name: 'AwsServices', + component: () => import('../views/aws/AwsServices.vue'), + meta: { title: '服务配置' } + }, + { + path: 'goods', + name: 'AwsGoods', + component: () => import('../views/aws/AwsGoods.vue'), + meta: { title: '商品绑定' } + }, + { + path: 'instances', + name: 'AwsInstances', + component: () => import('../views/aws/AwsInstances.vue'), + meta: { title: '履约实例' } + } + ] + }, // 站点审计路由 { path: 'audit', diff --git a/src/views/activity/MFConsumptionPromotion.vue b/src/views/activity/MFConsumptionPromotion.vue new file mode 100644 index 0000000..2da5211 --- /dev/null +++ b/src/views/activity/MFConsumptionPromotion.vue @@ -0,0 +1,321 @@ + + + + + diff --git a/src/views/aws/AwsGoods.vue b/src/views/aws/AwsGoods.vue new file mode 100644 index 0000000..01d099c --- /dev/null +++ b/src/views/aws/AwsGoods.vue @@ -0,0 +1,61 @@ + + + + diff --git a/src/views/aws/AwsInstances.vue b/src/views/aws/AwsInstances.vue new file mode 100644 index 0000000..0329e6f --- /dev/null +++ b/src/views/aws/AwsInstances.vue @@ -0,0 +1,45 @@ + + + diff --git a/src/views/aws/AwsServices.vue b/src/views/aws/AwsServices.vue new file mode 100644 index 0000000..af79766 --- /dev/null +++ b/src/views/aws/AwsServices.vue @@ -0,0 +1,56 @@ + + + + + diff --git a/src/views/product/ProductGroup.vue b/src/views/product/ProductGroup.vue index e8c08fd..f8d3658 100644 --- a/src/views/product/ProductGroup.vue +++ b/src/views/product/ProductGroup.vue @@ -162,6 +162,7 @@ {{ row.note || '-' }}
¥{{ (row.data.price / 100).toFixed(2) }} + 远端商品 库存: {{ row.data.inventory }} 推荐 有效期: {{ row.data.expireTime }}天 @@ -682,6 +683,14 @@ />
启用后,用户购买/续费/升级此商品前须完成实名认证
+ + +
AWS 商品请同时将标签设为 aws,保存后到 AWS 商品绑定页配置目录规则
+
@@ -960,6 +969,7 @@ const productForm = reactive({ arg_type: 'all', can_renew: true, require_real_name: false, + remote_goods: false, sold_out: false, max_per_user: 0, max_first_purchase_duration: 0, @@ -1621,6 +1631,7 @@ const handleAddProduct = () => { recommend_rebate: 0, arg_type: 'all', require_real_name: false, + remote_goods: false, max_per_user: 0, max_first_purchase_duration: 0, recommend_words: '' @@ -1658,6 +1669,7 @@ const handleEditProduct = (product, parentGroupId) => { arg_type: product.argType || 'all', can_renew: product.canRenew !== undefined ? product.canRenew : (product.can_renew !== undefined ? product.can_renew : true), require_real_name: product.requireRealName ?? product.require_real_name ?? false, + remote_goods: product.remoteGoods ?? product.remote_goods ?? false, sold_out: !!product.soldOut, max_per_user: product.maxPerUser ?? product.max_per_user ?? 0, max_first_purchase_duration: product.maxFirstPurchaseDuration ?? product.max_first_purchase_duration ?? 0, @@ -1691,6 +1703,7 @@ const submitProductForm = () => { arg_type: productForm.arg_type, can_renew: productForm.can_renew, require_real_name: productForm.require_real_name, + remote_goods: productForm.remote_goods === true, sold_out: productForm.sold_out === true, max_per_user: Number(productForm.max_per_user) || 0, max_first_purchase_duration: Number(productForm.max_first_purchase_duration) || 0, -- 2.54.0