diff --git a/apps/web-antd/src/api/agent/agent.ts b/apps/web-antd/src/api/agent/agent.ts index 95aed33..76e6a6a 100644 --- a/apps/web-antd/src/api/agent/agent.ts +++ b/apps/web-antd/src/api/agent/agent.ts @@ -4,19 +4,19 @@ export namespace AgentApi { export interface AgentListItem { id: number; user_id: number; + agent_code: number; + level: number; // 1=普通,2=黄金,3=钻石 level_name: string; region: string; mobile: string; - membership_expiry_time: string; + wechat_id?: string; + team_leader_id?: number; balance: number; total_earnings: number; frozen_balance: number; withdrawn_amount: number; + is_real_name: boolean; create_time: string; - is_real_name_verified: boolean; - real_name: string; - id_card: string; - real_name_status: 'approved' | 'pending' | 'rejected'; } export interface AgentList { @@ -29,7 +29,8 @@ export namespace AgentApi { pageSize: number; mobile?: string; region?: string; - parent_agent_id?: number; + level?: number; + team_leader_id?: number; id?: number; create_time_start?: string; create_time_end?: string; @@ -39,8 +40,10 @@ export namespace AgentApi { export interface AgentLinkListItem { agent_id: number; + product_id: number; product_name: string; - price: number; + set_price: number; + actual_base_price: number; link_identifier: string; create_time: string; } @@ -54,6 +57,7 @@ export namespace AgentApi { page: number; pageSize: number; agent_id?: number; + product_id?: number; product_name?: string; link_identifier?: string; } @@ -82,27 +86,28 @@ export namespace AgentApi { status?: number; } - // 代理奖励相关接口 - export interface AgentRewardListItem { + // 代理返佣相关接口 + export interface AgentRebateListItem { id: number; agent_id: number; - relation_agent_id: number; + source_agent_id: number; + order_id: number; + rebate_type: number; // 1=直接上级返佣,2=钻石上级返佣,3=黄金上级返佣 amount: number; - type: string; create_time: string; } - export interface AgentRewardList { + export interface AgentRebateList { total: number; - items: AgentRewardListItem[]; + items: AgentRebateListItem[]; } - export interface GetAgentRewardListParams { + export interface GetAgentRebateListParams { page: number; pageSize: number; agent_id?: number; - relation_agent_id?: number; - type?: string; + source_agent_id?: number; + rebate_type?: number; } // 代理提现相关接口 @@ -111,8 +116,11 @@ export namespace AgentApi { agent_id: number; withdraw_no: string; amount: number; - status: number; + tax_amount: number; + actual_amount: number; + status: number; // 1=待审核,2=审核通过,3=审核拒绝,4=提现中,5=提现成功,6=提现失败 payee_account: string; + payee_name: string; remark: string; create_time: string; } @@ -130,66 +138,22 @@ export namespace AgentApi { withdraw_no?: string; } - // 代理上级抽佣相关接口 - export interface AgentCommissionDeductionListItem { - id: number; - agent_id: number; - deducted_agent_id: number; - amount: number; - product_name: string; - type: 'cost' | 'pricing'; - status: number; - create_time: string; - } - - export interface AgentCommissionDeductionList { - total: number; - items: AgentCommissionDeductionListItem[]; - } - - export interface GetAgentCommissionDeductionListParams { - page: number; - pageSize: number; - agent_id?: number; - product_name?: string; - type?: 'cost' | 'pricing'; - status?: number; - } - - // 平台抽佣列表项 - export interface AgentPlatformDeductionListItem { - id: number; - agent_id: number; - amount: number; - type: 'cost' | 'pricing'; - status: number; - create_time: string; - } - - // 平台抽佣列表响应 - export interface AgentPlatformDeductionList { - total: number; - items: AgentPlatformDeductionListItem[]; - } - - // 获取平台抽佣列表参数 - export interface GetAgentPlatformDeductionListParams { - page: number; - pageSize: number; - agent_id?: number; - type?: 'cost' | 'pricing'; - status?: number; + export interface AuditWithdrawalParams { + withdrawal_id: number; + status: number; // 2=通过,3=拒绝 + remark: string; } // 代理产品配置列表项 export interface AgentProductionConfigItem { id: number; + product_id: number; product_name: string; - cost_price: number; + base_price: number; price_range_min: number; price_range_max: number; - pricing_standard: number; - overpricing_ratio: number; + price_threshold: number; + price_fee_rate: number; create_time: string; } @@ -204,17 +168,17 @@ export namespace AgentApi { page: number; pageSize: number; product_name?: string; + product_id?: number; id?: number; } // 更新代理产品配置参数 export interface UpdateAgentProductionConfigParams { id: number; - cost_price: number; - price_range_min: number; + base_price: number; price_range_max: number; - pricing_standard: number; - overpricing_ratio: number; + price_threshold?: number; + price_fee_rate?: number; } // 更新代理产品配置响应 @@ -222,76 +186,213 @@ export namespace AgentApi { success: boolean; } - export interface MembershipRechargeOrderListItem { + // 代理升级记录相关接口 + export interface AgentUpgradeListItem { id: number; - user_id: number; agent_id: number; - level_name: string; - amount: number; - payment_method: 'alipay' | 'appleiap' | 'other' | 'wechat'; - order_no: string; - platform_order_id: string; - status: 'cancelled' | 'failed' | 'pending' | 'success'; + from_level: number; + to_level: number; + upgrade_type: number; // 1=自主付费,2=钻石升级下级 + upgrade_fee: number; + rebate_amount: number; + status: number; // 1=待处理,2=已完成,3=已失败 create_time: string; } - export interface GetMembershipRechargeOrderListParams { - page: number; - pageSize: number; - user_id?: number; - agent_id?: number; - level_name?: string; - status?: string; - } - - export interface MembershipRechargeOrderList { + export interface AgentUpgradeList { total: number; - items: MembershipRechargeOrderListItem[]; + items: AgentUpgradeListItem[]; } - // 代理会员配置相关接口 - export interface AgentMembershipConfigListItem { + export interface GetAgentUpgradeListParams { + page: number; + pageSize: number; + agent_id?: number; + upgrade_type?: number; + status?: number; + } + + // 代理订单相关接口 + export interface AgentOrderListItem { id: number; - level_name: string; - price: number; - report_commission: number; - lower_activity_reward: null | number; - new_activity_reward: null | number; - lower_standard_count: null | number; - new_lower_standard_count: null | number; - lower_withdraw_reward_ratio: null | number; - lower_convert_vip_reward: null | number; - lower_convert_svip_reward: null | number; - exemption_amount: number; - price_increase_max: null | number; - price_ratio: null | number; - price_increase_amount: null | number; + agent_id: number; + order_id: number; + product_id: number; + product_name: string; + order_amount: number; + set_price: number; + actual_base_price: number; + price_cost: number; + agent_profit: number; + process_status: number; // 0=待处理,1=处理成功,2=处理失败 create_time: string; } - export interface GetAgentMembershipConfigListParams { - page: number; - pageSize: number; - level_name?: string; + export interface AgentOrderList { + total: number; + items: AgentOrderListItem[]; } - // 代理会员配置编辑请求参数 - export interface UpdateAgentMembershipConfigParams { - id: number; // 主键 - level_name: string; // 会员级别名称 - price: number; // 会员年费 - report_commission: number; // 直推报告收益 - lower_activity_reward?: null | number; // 下级活跃奖励金额 - new_activity_reward?: null | number; // 新增活跃奖励金额 - lower_standard_count?: null | number; // 活跃下级达标个数 - new_lower_standard_count?: null | number; // 新增活跃下级达标个数 - lower_withdraw_reward_ratio?: null | number; // 下级提现奖励比例 - lower_convert_vip_reward?: null | number; // 下级转化VIP奖励 - lower_convert_svip_reward?: null | number; // 下级转化SVIP奖励 - exemption_amount?: null | number; // 免责金额 - price_increase_max?: null | number; // 提价最高金额 - price_ratio?: null | number; // 提价区间收取比例 - price_increase_amount?: null | number; // 在原本成本上加价的金额 + export interface GetAgentOrderListParams { + page: number; + pageSize: number; + agent_id?: number; + order_id?: number; + process_status?: number; + } + + // 邀请码管理相关接口 + export interface InviteCodeListItem { + id: number; + code: string; + agent_id: number; // 0表示平台发放 + agent_mobile: string; + target_level: number; + status: number; // 0=未使用,1=已使用,2=已失效 + used_user_id?: number; + used_agent_id?: number; + used_time?: string; + expire_time?: string; + remark?: string; + create_time: string; + } + + export interface InviteCodeList { + total: number; + items: InviteCodeListItem[]; + } + + export interface GetInviteCodeListParams { + page: number; + pageSize: number; + code?: string; + agent_id?: number; + target_level?: number; + status?: number; + } + + export interface GenerateDiamondInviteCodeParams { + count: number; + expire_days?: number; // 可选,0表示不过期 + remark?: string; + } + + export interface GenerateDiamondInviteCodeResp { + codes: string[]; + } + + // 系统配置相关接口(价格配置已移除,改为产品配置表管理) + export interface AgentConfig { + level_bonus: { + diamond: number; + gold: number; + normal: number; + }; + upgrade_fee: { + normal_to_gold: number; + normal_to_diamond: number; + gold_to_diamond: number; + }; + upgrade_rebate: { + normal_to_gold_rebate: number; + to_diamond_rebate: number; + }; + direct_parent_rebate: { + diamond: number; // 直接上级是钻石的返佣金额(6元) + gold: number; // 直接上级是黄金的返佣金额(3元) + normal: number; // 直接上级是普通的返佣金额(2元) + }; + max_gold_rebate_amount: number; // 黄金代理最大返佣金额(3元) + commission_freeze: { + ratio: number; // 佣金冻结比例(例如:0.1表示10%) + threshold: number; // 佣金冻结阈值(订单单价达到此金额才触发冻结,单位:元) + days: number; // 佣金冻结解冻天数(单位:天,例如:30表示30天后解冻) + }; + tax_rate: number; + tax_exemption_amount: number; + gold_max_uplift_amount: number; + diamond_max_uplift_amount: number; + } + + export interface UpdateAgentConfigParams { + level_bonus?: { + diamond?: number; + gold?: number; + normal?: number; + }; + upgrade_fee?: { + normal_to_gold?: number; + normal_to_diamond?: number; + gold_to_diamond?: number; + }; + upgrade_rebate?: { + normal_to_gold_rebate?: number; + to_diamond_rebate?: number; + }; + direct_parent_rebate?: { + diamond?: number; // 直接上级是钻石的返佣金额(6元) + gold?: number; // 直接上级是黄金的返佣金额(3元) + normal?: number; // 直接上级是普通的返佣金额(2元) + }; + max_gold_rebate_amount?: number; // 黄金代理最大返佣金额(3元) + commission_freeze?: { + ratio?: number; // 佣金冻结比例(例如:0.1表示10%) + threshold?: number; // 佣金冻结阈值(订单单价达到此金额才触发冻结,单位:元) + days?: number; // 佣金冻结解冻天数(单位:天,例如:30表示30天后解冻) + }; + tax_rate?: number; + tax_exemption_amount?: number; + gold_max_uplift_amount?: number; + diamond_max_uplift_amount?: number; + } + + // 实名认证相关接口 + export interface AgentRealNameListItem { + id: number; + agent_id: number; + name: string; + id_card: string; // 加密,需要脱敏显示 + mobile: string; // 加密 + status: number; // 1=未验证,2=已通过 + verify_time?: string; + create_time: string; + } + + export interface AgentRealNameList { + total: number; + items: AgentRealNameListItem[]; + } + + export interface GetAgentRealNameListParams { + page: number; + pageSize: number; + agent_id?: number; + status?: number; + } + + // 代理奖励相关接口 + export interface AgentRewardListItem { + id: number; + agent_id: number; + type: string; // 奖励类型:register=注册奖励,first_order=首单奖励,level_up=升级奖励 + amount: number; + order_id?: number; + status: string; // pending=待发放,paid=已发放,failed=发放失败 + create_time: string; + pay_time?: string; + } + + export interface AgentRewardList { + total: number; + items: AgentRewardListItem[]; + } + + export interface GetAgentRewardListParams { + page: number; + pageSize: number; + agent_id?: number; + type?: string; + status?: string; } } @@ -309,7 +410,7 @@ async function getAgentList(params: AgentApi.GetAgentListParams) { * 获取代理推广链接列表 */ async function getAgentLinkList(params: AgentApi.GetAgentLinkListParams) { - return requestClient.get('/agent/agent-link/list', { + return requestClient.get('/agent/link/list', { params, }); } @@ -321,19 +422,7 @@ async function getAgentCommissionList( params: AgentApi.GetAgentCommissionListParams, ) { return requestClient.get( - '/agent/agent-commission/list', - { - params, - }, - ); -} - -/** - * 获取代理奖励列表 - */ -async function getAgentRewardList(params: AgentApi.GetAgentRewardListParams) { - return requestClient.get( - '/agent/agent-reward/list', + '/agent/commission/list', { params, }, @@ -347,35 +436,7 @@ async function getAgentWithdrawalList( params: AgentApi.GetAgentWithdrawalListParams, ) { return requestClient.get( - '/agent/agent-withdrawal/list', - { - params, - }, - ); -} - -/** - * 获取代理上级抽佣列表 - */ -async function getAgentCommissionDeductionList( - params: AgentApi.GetAgentCommissionDeductionListParams, -) { - return requestClient.get( - '/agent/agent-commission-deduction/list', - { - params, - }, - ); -} - -/** - * 获取平台抽佣列表 - */ -async function getAgentPlatformDeductionList( - params: AgentApi.GetAgentPlatformDeductionListParams, -) { - return requestClient.get( - '/agent/agent-platform-deduction/list', + '/agent/withdrawal/list', { params, }, @@ -389,7 +450,7 @@ async function getAgentProductionConfigList( params: AgentApi.GetAgentProductionConfigListParams, ) { return requestClient.get( - '/agent/agent-production-config/list', + '/agent/product_config/list', { params, }, @@ -403,19 +464,46 @@ async function updateAgentProductionConfig( params: AgentApi.UpdateAgentProductionConfigParams, ) { return requestClient.post( - '/agent/agent-production-config/update', + '/agent/product_config/update', params, ); } /** - * 获取会员充值订单列表 + * 获取代理返佣记录列表 */ -async function getMembershipRechargeOrderList( - params: AgentApi.GetMembershipRechargeOrderListParams, +async function getAgentRebateList(params: AgentApi.GetAgentRebateListParams) { + return requestClient.get('/agent/rebate/list', { + params, + }); +} + +/** + * 获取代理升级记录列表 + */ +async function getAgentUpgradeList( + params: AgentApi.GetAgentUpgradeListParams, ) { - return requestClient.get( - '/agent/agent-membership-recharge-order/list', + return requestClient.get('/agent/upgrade/list', { + params, + }); +} + +/** + * 获取代理订单列表 + */ +async function getAgentOrderList(params: AgentApi.GetAgentOrderListParams) { + return requestClient.get('/agent/order/list', { + params, + }); +} + +/** + * 获取邀请码列表 + */ +async function getInviteCodeList(params: AgentApi.GetInviteCodeListParams) { + return requestClient.get( + '/agent/invite_code/list', { params, }, @@ -423,40 +511,84 @@ async function getMembershipRechargeOrderList( } /** - * 获取代理会员配置列表 + * 生成钻石邀请码 */ -async function getAgentMembershipConfigList( - params: AgentApi.GetAgentMembershipConfigListParams, +async function generateDiamondInviteCode( + params: AgentApi.GenerateDiamondInviteCodeParams, ) { - return requestClient.get<{ - items: AgentApi.AgentMembershipConfigListItem[]; - total: number; - }>('/agent/agent-membership-config/list', { params }); -} - -/** - * 更新代理会员配置 - */ -async function updateAgentMembershipConfig( - params: AgentApi.UpdateAgentMembershipConfigParams, -) { - return requestClient.post<{ success: boolean }>( - '/agent/agent-membership-config/update', + return requestClient.post( + '/agent/invite_code/diamond/generate', params, ); } +/** + * 获取系统配置 + */ +async function getAgentConfig() { + return requestClient.get('/agent/config'); +} + +/** + * 更新系统配置 + */ +async function updateAgentConfig(params: AgentApi.UpdateAgentConfigParams) { + return requestClient.post<{ success: boolean }>( + '/agent/config/update', + params, + ); +} + +/** + * 获取实名认证列表 + */ +async function getAgentRealNameList( + params: AgentApi.GetAgentRealNameListParams, +) { + return requestClient.get( + '/agent/real_name/list', + { + params, + }, + ); +} + +/** + * 审核提现 + */ +async function auditWithdrawal(params: AgentApi.AuditWithdrawalParams) { + return requestClient.post<{ success: boolean }>( + '/agent/withdrawal/audit', + params, + ); +} + +/** + * 获取代理奖励列表 + */ +async function getAgentRewardList( + params: AgentApi.GetAgentRewardListParams, +) { + return requestClient.get('/agent/reward/list', { + params, + }); +} + export { - getAgentCommissionDeductionList, + auditWithdrawal, + generateDiamondInviteCode, getAgentCommissionList, + getAgentConfig, getAgentLinkList, getAgentList, - getAgentMembershipConfigList, - getAgentPlatformDeductionList, + getAgentOrderList, getAgentProductionConfigList, + getAgentRebateList, + getAgentRealNameList, getAgentRewardList, + getAgentUpgradeList, getAgentWithdrawalList, - getMembershipRechargeOrderList, - updateAgentMembershipConfig, + getInviteCodeList, + updateAgentConfig, updateAgentProductionConfig, }; diff --git a/apps/web-antd/src/api/complaint/complaint.ts b/apps/web-antd/src/api/complaint/complaint.ts new file mode 100644 index 0000000..1782f6a --- /dev/null +++ b/apps/web-antd/src/api/complaint/complaint.ts @@ -0,0 +1,160 @@ +import type { Recordable } from '@vben/types'; + +import { requestClient } from '#/api/request'; + +export namespace ComplaintApi { + export interface Complaint { + id: string; + type: 'alipay' | 'manual'; + order_id: string; + name: string; + contact: string; + content: string; + status: 'pending' | 'processing' | 'resolved' | 'closed'; + status_description: string; + remark: string; + handler_id: string; + handle_time: string; + create_time: string; + update_time: string; + // 支付宝投诉特有字段 + task_id?: string; + trade_no?: string; + complain_amount?: string; + gmt_complain?: string; + // 主动投诉特有字段 + subject?: string; + priority?: string; + source?: string; + } + + export interface ComplaintList { + total: number; + items: Complaint[]; + } + + export interface ComplaintDetail { + id: string; + type: 'alipay' | 'manual'; + order_id: string; + name: string; + contact: string; + content: string; + status: string; + status_description: string; + remark: string; + handler_id: string; + handle_time: string; + create_time: string; + update_time: string; + alipay_complaint?: AlipayComplaintDetail; + manual_complaint?: ManualComplaintDetail; + } + + export interface AlipayComplaintDetail { + id: string; + alipay_id: number; + task_id: string; + opposite_pid: string; + opposite_name: string; + complain_amount: string; + gmt_complain: string; + gmt_process: string; + complain_content: string; + trade_no: string; + status: string; + status_description: string; + process_code: string; + process_message: string; + process_remark: string; + process_img_url_list: string[]; + gmt_risk_finish_time: string; + complain_url: string; + certify_info: string[]; + trade_info_list: AlipayComplaintTradeInfo[]; + } + + export interface AlipayComplaintTradeInfo { + id: string; + alipay_trade_id: string; + alipay_complaint_record_id: string; + trade_no: string; + out_no: string; + gmt_trade: string; + gmt_refund: string; + status: string; + status_description: string; + amount: string; + } + + export interface ManualComplaintDetail { + id: string; + user_id: string; + subject: string; + priority: string; + source: string; + attachment_urls: string[]; + } + + export interface UpdateStatusRequest { + status: 'pending' | 'processing' | 'resolved' | 'closed'; + status_description?: string; + handler_id?: string; + } + + export interface UpdateRemarkRequest { + remark: string; + } +} + +/** + * 获取投诉列表 + */ +async function getComplaintList(params: Recordable) { + return requestClient.get('/complaint/list', { + params, + }); +} + +/** + * 获取投诉详情 + * @param id 投诉 ID + */ +async function getComplaintDetail(id: string) { + return requestClient.get( + `/complaint/detail/${id}`, + ); +} + +/** + * 更新投诉状态 + * @param id 投诉 ID + * @param data 更新状态请求数据 + */ +async function updateComplaintStatus( + id: string, + data: ComplaintApi.UpdateStatusRequest, +) { + return requestClient.put<{ success: boolean }>( + `/complaint/update-status/${id}`, + data, + ); +} + +/** + * 更新投诉备注 + * @param id 投诉 ID + * @param data 更新备注请求数据 + */ +async function updateComplaintRemark( + id: string, + data: ComplaintApi.UpdateRemarkRequest, +) { + return requestClient.put<{ success: boolean }>( + `/complaint/update-remark/${id}`, + data, + ); +} + +export { getComplaintList, getComplaintDetail, updateComplaintStatus, updateComplaintRemark }; + diff --git a/apps/web-antd/src/api/complaint/index.ts b/apps/web-antd/src/api/complaint/index.ts new file mode 100644 index 0000000..00d274e --- /dev/null +++ b/apps/web-antd/src/api/complaint/index.ts @@ -0,0 +1,2 @@ +export * from './complaint'; + diff --git a/apps/web-antd/src/api/dashboard/dashboard.ts b/apps/web-antd/src/api/dashboard/dashboard.ts new file mode 100644 index 0000000..da827ad --- /dev/null +++ b/apps/web-antd/src/api/dashboard/dashboard.ts @@ -0,0 +1,74 @@ +import type { Recordable } from '@vben/types'; + +import { requestClient } from '#/api/request'; + +export namespace DashboardApi { + export interface OrderStatistics { + today_count: number; + month_count: number; + total_count: number; + yesterday_count: number; + change_rate: number; + } + + export interface RevenueStatistics { + today_amount: number; + month_amount: number; + total_amount: number; + yesterday_amount: number; + change_rate: number; + } + + export interface AgentStatistics { + total_count: number; + today_new: number; + month_new: number; + } + + export interface ProfitDetail { + revenue: number; // 营收 + commission: number; // 佣金 + rebate: number; // 返利 + company_tax: number; // 税务成本 + api_cost: number; // API调用成本 + tax_income: number; // 提现收税 + profit: number; // 利润 + profit_rate: number; // 利润率 + } + + export interface ProfitStatistics { + today_profit: number; + month_profit: number; + total_profit: number; + today_profit_rate: number; + month_profit_rate: number; + total_profit_rate: number; + today_detail: ProfitDetail; + month_detail: ProfitDetail; + total_detail: ProfitDetail; + } + + export interface TrendData { + date: string; + value: number; + } + + export interface DashboardStatistics { + order_stats: OrderStatistics; + revenue_stats: RevenueStatistics; + agent_stats: AgentStatistics; + profit_stats: ProfitStatistics; + order_trend: TrendData[]; + revenue_trend: TrendData[]; + } +} + +/** + * 获取统计面板数据 + */ +export async function getDashboardStatistics(): Promise { + return await requestClient.get( + '/dashboard/statistics', + ); +} + diff --git a/apps/web-antd/src/api/dashboard/index.ts b/apps/web-antd/src/api/dashboard/index.ts new file mode 100644 index 0000000..b56c17a --- /dev/null +++ b/apps/web-antd/src/api/dashboard/index.ts @@ -0,0 +1,2 @@ +export * from './dashboard'; + diff --git a/apps/web-antd/src/api/index.ts b/apps/web-antd/src/api/index.ts index 51f2ded..e83a606 100644 --- a/apps/web-antd/src/api/index.ts +++ b/apps/web-antd/src/api/index.ts @@ -1,10 +1,11 @@ export * from './agent'; +export * from './complaint'; export * from './core'; +export * from './dashboard'; export * from './notification'; export * from './order'; export * from './platform-user'; export * from './product-manage'; -export * from './promotion'; export * from './system'; export interface ApiResponse { code: number; diff --git a/apps/web-antd/src/api/order/order.ts b/apps/web-antd/src/api/order/order.ts index 22a7310..a4c3b9b 100644 --- a/apps/web-antd/src/api/order/order.ts +++ b/apps/web-antd/src/api/order/order.ts @@ -4,7 +4,7 @@ import { requestClient } from '#/api/request'; export namespace OrderApi { export interface Order { - id: number; + id: string; order_no: string; platform_order_id: string; product_name: string; @@ -16,7 +16,6 @@ export namespace OrderApi { create_time: string; pay_time: null | string; refund_time: null | string; - is_promotion: 0 | 1; } export interface OrderList { @@ -50,7 +49,7 @@ async function getOrderList(params: Recordable) { * @param id 订单 ID * @param data 退款请求数据 */ -async function refundOrder(id: number, data: OrderApi.RefundOrderRequest) { +async function refundOrder(id: string, data: OrderApi.RefundOrderRequest) { return requestClient.post( `/order/refund/${id}`, data, diff --git a/apps/web-antd/src/api/order/query.ts b/apps/web-antd/src/api/order/query.ts index 215697a..8eb39a1 100644 --- a/apps/web-antd/src/api/order/query.ts +++ b/apps/web-antd/src/api/order/query.ts @@ -9,9 +9,9 @@ export namespace OrderQueryApi { } export interface QueryDetail { - id: number; - order_id: number; - user_id: number; + id: string; + order_id: string; + user_id: string; product_name: string; query_params: Recordable; query_data: QueryItem[]; @@ -21,13 +21,13 @@ export namespace OrderQueryApi { } export interface GetQueryDetailRequest { - order_id: number; + order_id: string; } export interface GetQueryDetailResponse { - id: number; - order_id: number; - user_id: number; + id: string; + order_id: string; + user_id: string; product_name: string; query_params: Recordable; query_data: QueryItem[]; @@ -119,7 +119,7 @@ export namespace OrderQueryApi { * 获取订单查询详情 * @param orderId 订单ID */ -async function getOrderQueryDetail(orderId: number) { +async function getOrderQueryDetail(orderId: string) { return requestClient.get( `/query/detail/${orderId}`, ); diff --git a/apps/web-antd/src/api/product-manage/feature.ts b/apps/web-antd/src/api/product-manage/feature.ts index cbf9de3..119bd7d 100644 --- a/apps/web-antd/src/api/product-manage/feature.ts +++ b/apps/web-antd/src/api/product-manage/feature.ts @@ -7,6 +7,8 @@ export namespace FeatureApi { id: number; api_id: string; name: string; + whitelist_price: number; + cost_price: number; create_time: string; update_time: string; } @@ -19,11 +21,15 @@ export namespace FeatureApi { export interface CreateFeatureRequest { api_id: string; name: string; + whitelist_price?: number; + cost_price?: number; } export interface UpdateFeatureRequest { api_id?: string; name?: string; + whitelist_price?: number; + cost_price?: number; } export interface FeatureExampleItem { diff --git a/apps/web-antd/src/api/promotion/analytics.ts b/apps/web-antd/src/api/promotion/analytics.ts deleted file mode 100644 index 1d7d441..0000000 --- a/apps/web-antd/src/api/promotion/analytics.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { requestClient } from '#/api/request'; - -export namespace PromotionAnalyticsApi { - export interface OverviewData { - today_click_count: number; - today_pay_count: number; - today_pay_amount: number; - total_click_count: number; - total_pay_count: number; - total_pay_amount: number; - } - - export interface TrendData { - id: number; - link_id: number; - pay_amount: number; - click_count: number; - pay_count: number; - stats_date: string; - } -} - -/** - * 获取推广数据概览 - */ -async function statsTotal() { - return requestClient.get( - '/promotion/stats/total', - ); -} - -/** - * 获取推广数据趋势 - * @param params 日期范围参数 - */ -async function statsHistory(params: { end_date: string; start_date: string }) { - return requestClient.get( - '/promotion/stats/history', - { - params, - }, - ); -} - -export { statsHistory, statsTotal }; diff --git a/apps/web-antd/src/api/promotion/index.ts b/apps/web-antd/src/api/promotion/index.ts deleted file mode 100644 index 2b06f5a..0000000 --- a/apps/web-antd/src/api/promotion/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './analytics'; -export * from './link'; diff --git a/apps/web-antd/src/api/promotion/link.ts b/apps/web-antd/src/api/promotion/link.ts deleted file mode 100644 index 2ca6171..0000000 --- a/apps/web-antd/src/api/promotion/link.ts +++ /dev/null @@ -1,67 +0,0 @@ -import type { Recordable } from '@vben/types'; - -import { requestClient } from '#/api/request'; - -export namespace PromotionLinkApi { - export interface PromotionLinkItem { - id: number; - name: string; - url: string; - create_time: string; - } - - export interface PromotionLink { - total: number; - items: PromotionLinkItem[]; - } -} - -/** - * 获取推广链接列表数据 - */ -async function getPromotionLinkList(params: Recordable) { - return requestClient.get( - '/promotion/link/list', - { - params, - }, - ); -} - -/** - * 创建推广链接 - * @param data 推广链接数据 - */ -async function createPromotionLink( - data: Omit, -) { - return requestClient.post('/promotion/link/create', data); -} - -/** - * 更新推广链接 - * - * @param id 推广链接 ID - * @param data 推广链接数据 - */ -async function updatePromotionLink( - id: string, - data: Omit, -) { - return requestClient.put(`/promotion/link/update/${id}`, data); -} - -/** - * 删除推广链接 - * @param id 推广链接 ID - */ -async function deletePromotionLink(id: string) { - return requestClient.delete(`/promotion/link/delete/${id}`); -} - -export { - createPromotionLink, - deletePromotionLink, - getPromotionLinkList, - updatePromotionLink, -}; diff --git a/apps/web-antd/src/api/system/api.ts b/apps/web-antd/src/api/system/api.ts index 0f4cd98..ba2adab 100644 --- a/apps/web-antd/src/api/system/api.ts +++ b/apps/web-antd/src/api/system/api.ts @@ -4,9 +4,9 @@ import { requestClient } from '#/api/request'; export namespace SystemApiApi { export interface SystemApiItem { - id: number; - role_id?: number; - api_id?: number; + id: string; + role_id?: string; + api_id?: string; api_name: string; api_code: string; method: string; @@ -31,9 +31,9 @@ export namespace SystemApiApi { } export interface RoleApiItem { - id: number; - role_id: number; - api_id: number; + id: string; + role_id: string; + api_id: string; api_name: string; api_code: string; method: string; @@ -60,7 +60,7 @@ async function getApiList(params: Recordable) { * 获取API详情 * @param id API ID */ -async function getApiDetail(id: number) { +async function getApiDetail(id: string) { return requestClient.get(`/api/detail/${id}`); } @@ -80,7 +80,7 @@ async function createApi( * @param data API数据 */ async function updateApi( - id: number, + id: string, data: Omit, ) { return requestClient.put(`/api/update/${id}`, data); @@ -107,7 +107,7 @@ async function batchUpdateApiStatus(data: { ids: number[]; status: 0 | 1 }) { * 获取角色API权限列表 * @param roleId 角色ID */ -async function getRoleApiList(roleId: number) { +async function getRoleApiList(roleId: string) { return requestClient.get( `/role/${roleId}/api/list`, ); @@ -118,7 +118,7 @@ async function getRoleApiList(roleId: number) { * @param data.api_ids API ID数组 * @param data.role_id 角色ID */ -async function assignRoleApi(data: { api_ids: number[]; role_id: number }) { +async function assignRoleApi(data: { api_ids: string[]; role_id: string }) { return requestClient.post('/role/api/assign', data); } @@ -127,7 +127,7 @@ async function assignRoleApi(data: { api_ids: number[]; role_id: number }) { * @param data.api_ids API ID数组 * @param data.role_id 角色ID */ -async function removeRoleApi(data: { api_ids: number[]; role_id: number }) { +async function removeRoleApi(data: { api_ids: string[]; role_id: string }) { return requestClient.post('/role/api/remove', data); } @@ -136,7 +136,7 @@ async function removeRoleApi(data: { api_ids: number[]; role_id: number }) { * @param data.api_ids API ID数组 * @param data.role_id 角色ID */ -async function updateRoleApi(data: { api_ids: number[]; role_id: number }) { +async function updateRoleApi(data: { api_ids: string[]; role_id: string }) { return requestClient.put('/role/api/update', data); } diff --git a/apps/web-antd/src/api/system/role.ts b/apps/web-antd/src/api/system/role.ts index fdbc269..32c0af5 100644 --- a/apps/web-antd/src/api/system/role.ts +++ b/apps/web-antd/src/api/system/role.ts @@ -4,14 +4,14 @@ import { requestClient } from '#/api/request'; export namespace SystemRoleApi { export interface SystemRoleItem { - id: number; + id: string; role_name: string; role_code: string; description?: string; status: 0 | 1; sort: number; create_time: string; - menu_ids: number[]; + menu_ids: string[]; } export interface SystemRole { @@ -44,7 +44,7 @@ async function createRole(data: Omit) { * @param data 角色数据 */ async function updateRole( - id: number, + id: string, data: Omit, ) { return requestClient.put(`/role/update/${id}`, data); diff --git a/apps/web-antd/src/preferences.ts b/apps/web-antd/src/preferences.ts index c27c961..9eb2231 100644 --- a/apps/web-antd/src/preferences.ts +++ b/apps/web-antd/src/preferences.ts @@ -12,13 +12,13 @@ export const overridesPreferences = defineOverridesPreferences({ accessMode: 'backend', }, logo: { - source: 'https://ctrlph.tianyuandb.com/logo.png', + source: 'https://ctrlph.onecha.cn/logo.png', }, copyright: { - companyName: '海南天远大数据科技有限公司', - companySiteLink: 'https://www.tianyuandb.com', + companyName: '海南海宇大数据有限公司', + companySiteLink: 'https://www.onecha.cn', date: '2025', - icp: '琼ICP备2024048057号-1', + icp: '琼ICP备2024048057号-2', icpLink: 'https://beian.miit.gov.cn/', }, footer: { diff --git a/apps/web-antd/src/router/routes/modules/agent.ts b/apps/web-antd/src/router/routes/modules/agent.ts new file mode 100644 index 0000000..a01cc63 --- /dev/null +++ b/apps/web-antd/src/router/routes/modules/agent.ts @@ -0,0 +1,117 @@ +import type { RouteRecordRaw } from 'vue-router'; + +const routes: RouteRecordRaw[] = [ + { + meta: { + icon: 'mdi:account-group', + order: 2000, + title: '代理管理', + }, + name: 'Agent', + path: '/agent', + children: [ + { + path: '/agent/list', + name: 'AgentList', + meta: { + icon: 'mdi:account-multiple', + title: '代理列表', + }, + component: () => import('#/views/agent/agent-list/list.vue'), + }, + { + path: '/agent/links', + name: 'AgentLinks', + meta: { + icon: 'mdi:link-variant', + title: '推广链接', + }, + component: () => import('#/views/agent/agent-links/list.vue'), + }, + { + path: '/agent/commission', + name: 'AgentCommission', + meta: { + icon: 'mdi:cash-multiple', + title: '佣金记录', + }, + component: () => import('#/views/agent/agent-commission/list.vue'), + }, + { + path: '/agent/rebate', + name: 'AgentRebate', + meta: { + icon: 'mdi:currency-usd', + title: '返佣记录', + }, + component: () => import('#/views/agent/agent-rebate/list.vue'), + }, + { + path: '/agent/upgrade', + name: 'AgentUpgrade', + meta: { + icon: 'mdi:arrow-up-circle', + title: '升级记录', + }, + component: () => import('#/views/agent/agent-upgrade/list.vue'), + }, + { + path: '/agent/order', + name: 'AgentOrder', + meta: { + icon: 'mdi:package-variant', + title: '订单记录', + }, + component: () => import('#/views/agent/agent-order/list.vue'), + }, + { + path: '/agent/withdrawal', + name: 'AgentWithdrawal', + meta: { + icon: 'mdi:bank-transfer-out', + title: '提现记录', + }, + component: () => import('#/views/agent/agent-withdrawal/list.vue'), + }, + { + path: '/agent/invite-code', + name: 'AgentInviteCode', + meta: { + icon: 'mdi:ticket-confirmation', + title: '邀请码管理', + }, + component: () => import('#/views/agent/agent-invite-code/list.vue'), + }, + { + path: '/agent/config', + name: 'AgentConfig', + meta: { + icon: 'mdi:cog', + title: '系统配置', + }, + component: () => import('#/views/agent/agent-config/list.vue'), + }, + { + path: '/agent/real-name', + name: 'AgentRealName', + meta: { + icon: 'mdi:account-check', + title: '实名认证', + }, + component: () => import('#/views/agent/agent-real-name/list.vue'), + }, + { + path: '/agent/product-config', + name: 'AgentProductConfig', + meta: { + icon: 'mdi:package-variant-closed', + title: '产品配置', + }, + component: () => import('#/views/agent/agent-product-config/list.vue'), + }, + ], + }, +]; + +export default routes; + diff --git a/apps/web-antd/src/router/routes/modules/complaint.ts b/apps/web-antd/src/router/routes/modules/complaint.ts new file mode 100644 index 0000000..5deccfc --- /dev/null +++ b/apps/web-antd/src/router/routes/modules/complaint.ts @@ -0,0 +1,17 @@ +import type { RouteRecordRaw } from 'vue-router'; + +const routes: RouteRecordRaw[] = [ + { + meta: { + icon: 'lucide:message-square-warning', + order: 2000, + title: '投诉管理', + }, + name: 'Complaint', + path: '/complaint', + component: () => import('#/views/complaint/list/index.vue'), + }, +]; + +export default routes; + diff --git a/apps/web-antd/src/router/routes/modules/order.ts b/apps/web-antd/src/router/routes/modules/order.ts index b43bc0c..377fd24 100644 --- a/apps/web-antd/src/router/routes/modules/order.ts +++ b/apps/web-antd/src/router/routes/modules/order.ts @@ -11,6 +11,15 @@ const routes: RouteRecordRaw[] = [ path: '/order', component: () => import('#/views/order/order/index.vue'), }, + { + meta: { + hideInMenu: true, + title: '订单查询详情', + }, + name: 'OrderQueryDetail', + path: '/order/query/detail/:id', + component: () => import('#/views/order/query/query-details.vue'), + }, ]; export default routes; diff --git a/apps/web-antd/src/utils/agent.ts b/apps/web-antd/src/utils/agent.ts new file mode 100644 index 0000000..7997ff4 --- /dev/null +++ b/apps/web-antd/src/utils/agent.ts @@ -0,0 +1,113 @@ +/** + * 等级数字转中文名称 + */ +export function getLevelName(level: number): string { + const map: Record = { + 1: '普通代理', + 2: '黄金代理', + 3: '钻石代理', + }; + return map[level] || '未知'; +} + +/** + * 返佣类型转中文 + */ +export function getRebateTypeName(type: number): string { + const map: Record = { + 1: '直接上级返佣', + 2: '钻石上级返佣', + 3: '黄金上级返佣', + }; + return map[type] || '未知'; +} + +/** + * 升级类型转中文 + */ +export function getUpgradeTypeName(type: number): string { + const map: Record = { + 1: '自主付费', + 2: '钻石升级下级', + }; + return map[type] || '未知'; +} + +/** + * 提现状态转中文 + */ +export function getWithdrawalStatusName(status: number): string { + const map: Record = { + 1: '待审核', + 2: '审核通过', + 3: '审核拒绝', + 4: '提现中', + 5: '提现成功', + 6: '提现失败', + }; + return map[status] || '未知'; +} + +/** + * 订单处理状态转中文 + */ +export function getOrderProcessStatusName(status: number): string { + const map: Record = { + 0: '待处理', + 1: '处理成功', + 2: '处理失败', + }; + return map[status] || '未知'; +} + +/** + * 升级状态转中文 + */ +export function getUpgradeStatusName(status: number): string { + const map: Record = { + 1: '待处理', + 2: '已完成', + 3: '已失败', + }; + return map[status] || '未知'; +} + +/** + * 邀请码状态转中文 + */ +export function getInviteCodeStatusName(status: number): string { + const map: Record = { + 0: '未使用', + 1: '已使用', + 2: '已失效', + }; + return map[status] || '未知'; +} + +/** + * 实名认证状态转中文 + */ +export function getRealNameStatusName(status: number): string { + const map: Record = { + 1: '未验证', + 2: '已通过', + }; + return map[status] || '未知'; +} + +/** + * 身份证号脱敏显示 + */ +export function maskIdCard(idCard: string): string { + if (!idCard || idCard.length < 14) return idCard; + return `${idCard.slice(0, 6)}${'*'.repeat(8)}${idCard.slice(-4)}`; +} + +/** + * 手机号脱敏显示 + */ +export function maskMobile(mobile: string): string { + if (!mobile || mobile.length !== 11) return mobile; + return `${mobile.slice(0, 3)}****${mobile.slice(-4)}`; +} + diff --git a/apps/web-antd/src/views/agent/agent-commission-deduction/data.ts b/apps/web-antd/src/views/agent/agent-commission-deduction/data.ts deleted file mode 100644 index 4a9e655..0000000 --- a/apps/web-antd/src/views/agent/agent-commission-deduction/data.ts +++ /dev/null @@ -1,101 +0,0 @@ -import type { VbenFormSchema } from '#/adapter/form'; -import type { VxeTableGridOptions } from '#/adapter/vxe-table'; - -export function useCommissionDeductionColumns(): VxeTableGridOptions['columns'] { - return [ - { - title: 'ID', - field: 'id', - width: 80, - }, - { - title: '代理ID', - field: 'agent_id', - width: 100, - }, - { - title: '被扣代理ID', - field: 'deducted_agent_id', - width: 100, - }, - { - title: '抽佣金额', - field: 'amount', - width: 120, - formatter: ({ cellValue }) => `¥${cellValue.toFixed(2)}`, - }, - { - title: '产品名称', - field: 'product_name', - width: 150, - }, - { - title: '抽佣类型', - field: 'type', - width: 120, - formatter: ({ cellValue }: { cellValue: 'cost' | 'pricing' }) => { - const typeMap = { - cost: '成本抽佣', - pricing: '定价抽佣', - }; - return typeMap[cellValue] || cellValue; - }, - }, - { - title: '状态', - field: 'status', - width: 100, - cellRender: { - name: 'CellTag', - options: [ - { value: 0, color: 'warning', label: '待结算' }, - { value: 1, color: 'success', label: '已结算' }, - { value: 2, color: 'error', label: '已取消' }, - ], - }, - }, - { - title: '创建时间', - field: 'create_time', - width: 180, - }, - ]; -} - -export function useCommissionDeductionFormSchema(): VbenFormSchema[] { - return [ - { - fieldName: 'product_name', - label: '产品名称', - component: 'Input', - componentProps: { - allowClear: true, - }, - }, - { - fieldName: 'type', - label: '抽佣类型', - component: 'Select', - componentProps: { - options: [ - { label: '成本抽佣', value: 'cost' }, - { label: '定价抽佣', value: 'pricing' }, - ], - allowClear: true, - }, - }, - { - fieldName: 'status', - label: '状态', - component: 'Select', - componentProps: { - options: [ - { label: '待结算', value: 0 }, - { label: '已结算', value: 1 }, - { label: '已取消', value: 2 }, - ], - allowClear: true, - }, - }, - ]; -} diff --git a/apps/web-antd/src/views/agent/agent-commission/data.ts b/apps/web-antd/src/views/agent/agent-commission/data.ts index f34d762..af825be 100644 --- a/apps/web-antd/src/views/agent/agent-commission/data.ts +++ b/apps/web-antd/src/views/agent/agent-commission/data.ts @@ -32,9 +32,9 @@ export function useCommissionColumns(): VxeTableGridOptions['columns'] { width: 100, formatter: ({ cellValue }: { cellValue: number }) => { const statusMap: Record = { - 0: '待结算', - 1: '已结算', - 2: '已取消', + 1: '已发放', + 2: '已冻结', + 3: '已取消(已退款)', }; return statusMap[cellValue] || '未知'; }, @@ -64,9 +64,9 @@ export function useCommissionFormSchema(): VbenFormSchema[] { componentProps: { allowClear: true, options: [ - { label: '待结算', value: 0 }, - { label: '已结算', value: 1 }, - { label: '已取消', value: 2 }, + { label: '已发放', value: 1 }, + { label: '已冻结', value: 2 }, + { label: '已取消(已退款)', value: 3 }, ], }, }, diff --git a/apps/web-antd/src/views/agent/agent-config/list.vue b/apps/web-antd/src/views/agent/agent-config/list.vue new file mode 100644 index 0000000..03c25e2 --- /dev/null +++ b/apps/web-antd/src/views/agent/agent-config/list.vue @@ -0,0 +1,274 @@ + + + diff --git a/apps/web-antd/src/views/agent/agent-invite-code/data.ts b/apps/web-antd/src/views/agent/agent-invite-code/data.ts new file mode 100644 index 0000000..3e4f523 --- /dev/null +++ b/apps/web-antd/src/views/agent/agent-invite-code/data.ts @@ -0,0 +1,109 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; + +import { getLevelName } from '#/utils/agent'; + +export function useInviteCodeColumns(): VxeTableGridOptions['columns'] { + return [ + { + field: 'id', + title: 'ID', + width: 80, + }, + { + field: 'code', + title: '邀请码', + width: 200, + }, + { + field: 'agent_id', + title: '发放代理ID', + width: 120, + }, + { + field: 'agent_mobile', + title: '发放代理手机号', + width: 140, + }, + { + field: 'target_level', + title: '目标等级', + width: 100, + formatter: ({ cellValue }: { cellValue: number }) => { + return getLevelName(cellValue); + }, + }, + { + field: 'status', + title: '状态', + width: 100, + cellRender: { + name: 'CellTag', + options: [ + { value: 0, color: 'default', label: '未使用' }, + { value: 1, color: 'success', label: '已使用' }, + { value: 2, color: 'error', label: '已失效' }, + ], + }, + }, + { + field: 'used_user_id', + title: '使用用户ID', + width: 120, + }, + { + field: 'used_agent_id', + title: '使用代理ID', + width: 120, + }, + { + field: 'used_time', + title: '使用时间', + width: 160, + }, + { + field: 'expire_time', + title: '过期时间', + width: 160, + }, + { + field: 'remark', + title: '备注', + width: 200, + }, + { + field: 'create_time', + title: '创建时间', + width: 160, + sortable: true, + }, + ] as const; +} + +export function useInviteCodeFormSchema(): VbenFormSchema[] { + return [ + { + component: 'Input', + fieldName: 'code', + label: '邀请码', + }, + { + component: 'InputNumber', + fieldName: 'agent_id', + label: '发放代理ID', + }, + { + component: 'Select', + fieldName: 'status', + label: '状态', + componentProps: { + allowClear: true, + options: [ + { label: '未使用', value: 0 }, + { label: '已使用', value: 1 }, + { label: '已失效', value: 2 }, + ], + }, + }, + ]; +} diff --git a/apps/web-antd/src/views/agent/agent-invite-code/list.vue b/apps/web-antd/src/views/agent/agent-invite-code/list.vue new file mode 100644 index 0000000..758285c --- /dev/null +++ b/apps/web-antd/src/views/agent/agent-invite-code/list.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/apps/web-antd/src/views/agent/agent-links/data.ts b/apps/web-antd/src/views/agent/agent-links/data.ts index fff12e2..ae45d44 100644 --- a/apps/web-antd/src/views/agent/agent-links/data.ts +++ b/apps/web-antd/src/views/agent/agent-links/data.ts @@ -9,14 +9,25 @@ export function useLinkColumns(): VxeTableGridOptions['columns'] { title: '代理ID', width: 100, }, + { + field: 'product_id', + title: '产品ID', + width: 100, + }, { field: 'product_name', title: '产品名称', width: 150, }, { - field: 'price', - title: '价格', + field: 'set_price', + title: '设定价格', + width: 120, + formatter: ({ cellValue }) => `¥${cellValue.toFixed(2)}`, + }, + { + field: 'actual_base_price', + title: '实际底价', width: 120, formatter: ({ cellValue }) => `¥${cellValue.toFixed(2)}`, }, @@ -37,6 +48,11 @@ export function useLinkColumns(): VxeTableGridOptions['columns'] { // 推广链接搜索表单配置 export function useLinkFormSchema(): VbenFormSchema[] { return [ + { + component: 'InputNumber', + fieldName: 'product_id', + label: '产品ID', + }, { component: 'Input', fieldName: 'product_name', diff --git a/apps/web-antd/src/views/agent/agent-list/data.ts b/apps/web-antd/src/views/agent/agent-list/data.ts index 04787e7..e458973 100644 --- a/apps/web-antd/src/views/agent/agent-list/data.ts +++ b/apps/web-antd/src/views/agent/agent-list/data.ts @@ -1,6 +1,8 @@ import type { VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import { getLevelName } from '#/utils/agent'; + // 表单配置 export function useFormSchema(): VbenFormSchema[] { return [ @@ -11,10 +13,18 @@ export function useFormSchema(): VbenFormSchema[] { rules: 'required', }, { - component: 'Input', - fieldName: 'level_name', - label: '等级名称', + component: 'Select', + fieldName: 'level', + label: '等级', rules: 'required', + componentProps: { + disabled: true, + options: [ + { label: '普通代理', value: 1 }, + { label: '黄金代理', value: 2 }, + { label: '钻石代理', value: 3 }, + ], + }, }, { component: 'Input', @@ -23,13 +33,9 @@ export function useFormSchema(): VbenFormSchema[] { rules: 'required', }, { - component: 'DatePicker', - fieldName: 'membership_expiry_time', - label: '会员到期时间', - rules: 'required', - componentProps: { - showTime: true, - }, + component: 'Input', + fieldName: 'wechat_id', + label: '微信号', }, ]; } @@ -47,6 +53,24 @@ export function useGridFormSchema(): VbenFormSchema[] { fieldName: 'region', label: '区域', }, + { + component: 'Select', + fieldName: 'level', + label: '等级', + componentProps: { + allowClear: true, + options: [ + { label: '普通代理', value: 1 }, + { label: '黄金代理', value: 2 }, + { label: '钻石代理', value: 3 }, + ], + }, + }, + { + component: 'InputNumber', + fieldName: 'team_leader_id', + label: '团队首领ID', + }, { component: 'RangePicker', fieldName: 'create_time', @@ -71,14 +95,16 @@ export function useColumns(): VxeTableGridOptions['columns'] { width: 100, }, { - field: 'level_name', - title: '等级名称', + field: 'agent_code', + title: '代理编码', + width: 100, + }, + { + field: 'level', + title: '等级', width: 120, - formatter: ({ cellValue }: { cellValue: string }) => { - if (cellValue === '' || cellValue === 'normal') { - return '普通代理'; - } - return cellValue; + formatter: ({ cellValue }: { cellValue: number }) => { + return getLevelName(cellValue); }, }, { @@ -95,41 +121,25 @@ export function useColumns(): VxeTableGridOptions['columns'] { cellRender: { name: 'CellTag', options: [ - { value: 'approved', color: 'success', label: '已认证' }, - { value: 'pending', color: 'warning', label: '审核中' }, - { value: 'rejected', color: 'error', label: '已拒绝' }, - { value: '', color: 'default', label: '未认证' }, + { value: true, color: 'success', label: '已认证' }, + { value: false, color: 'default', label: '未认证' }, ], }, - field: 'real_name_status', + field: 'is_real_name', title: '实名认证状态', width: 120, }, { - field: 'real_name', - title: '实名姓名', + field: 'wechat_id', + title: '微信号', width: 120, - formatter: ({ cellValue }: { cellValue: string }) => { - if (!cellValue) return '-'; - return cellValue; - }, + visible: false, }, { - field: 'id_card', - title: '身份证号', - width: 180, - formatter: ({ cellValue }: { cellValue: string }) => { - if (!cellValue) return '-'; - // 只显示前6位和后4位,中间用*代替 - return `${cellValue.slice(0, 6)}${'*'.repeat(8)}${cellValue.slice(-4)}`; - }, - }, - { - field: 'membership_expiry_time', - title: '会员到期时间', - width: 160, - sortable: true, - sortType: 'string' as const, + field: 'team_leader_id', + title: '团队首领ID', + width: 120, + visible: false, }, { field: 'balance', diff --git a/apps/web-antd/src/views/agent/agent-list/list.vue b/apps/web-antd/src/views/agent/agent-list/list.vue index 9bb9dc6..2739809 100644 --- a/apps/web-antd/src/views/agent/agent-list/list.vue +++ b/apps/web-antd/src/views/agent/agent-list/list.vue @@ -17,12 +17,12 @@ import { useVbenVxeGrid } from '#/adapter/vxe-table'; import { getAgentList } from '#/api/agent'; import { useColumns, useGridFormSchema } from './data'; -import CommissionDeductionModal from './modules/commission-deduction-modal.vue'; import CommissionModal from './modules/commission-modal.vue'; import Form from './modules/form.vue'; import LinkModal from './modules/link-modal.vue'; -import PlatformDeductionModal from './modules/platform-deduction-modal.vue'; -import RewardModal from './modules/reward-modal.vue'; +import OrderModal from './modules/order-modal.vue'; +import RebateModal from './modules/rebate-modal.vue'; +import UpgradeModal from './modules/upgrade-modal.vue'; import WithdrawalModal from './modules/withdrawal-modal.vue'; const route = useRoute(); @@ -46,9 +46,21 @@ const [CommissionModalComponent, commissionModalApi] = useVbenModal({ destroyOnClose: true, }); -// 奖励记录弹窗 -const [RewardModalComponent, rewardModalApi] = useVbenModal({ - connectedComponent: RewardModal, +// 返佣记录弹窗 +const [RebateModalComponent, rebateModalApi] = useVbenModal({ + connectedComponent: RebateModal, + destroyOnClose: true, +}); + +// 升级记录弹窗 +const [UpgradeModalComponent, upgradeModalApi] = useVbenModal({ + connectedComponent: UpgradeModal, + destroyOnClose: true, +}); + +// 订单记录弹窗 +const [OrderModalComponent, orderModalApi] = useVbenModal({ + connectedComponent: OrderModal, destroyOnClose: true, }); @@ -58,20 +70,6 @@ const [WithdrawalModalComponent, withdrawalModalApi] = useVbenModal({ destroyOnClose: true, }); -// 上级抽佣弹窗 -const [CommissionDeductionModalComponent, commissionDeductionModalApi] = - useVbenModal({ - connectedComponent: CommissionDeductionModal, - destroyOnClose: true, - }); - -// 平台抽佣弹窗 -const [PlatformDeductionModalComponent, platformDeductionModalApi] = - useVbenModal({ - connectedComponent: PlatformDeductionModal, - destroyOnClose: true, - }); - // 表格配置 const [Grid, gridApi] = useVbenVxeGrid({ formOptions: { @@ -102,9 +100,9 @@ const [Grid, gridApi] = useVbenVxeGrid({ query: async ({ page, sort }, formValues) => { const sortParams = sort ? { - order_by: sort.field, - order_type: sort.order, - } + order_by: sort.field, + order_type: sort.order, + } : {}; const res = await getAgentList({ @@ -112,8 +110,8 @@ const [Grid, gridApi] = useVbenVxeGrid({ pageSize: page.pageSize, ...formValues, ...sortParams, - parent_agent_id: route.query.parent_agent_id - ? Number(route.query.parent_agent_id) + team_leader_id: route.query.team_leader_id + ? Number(route.query.team_leader_id) : undefined, }); @@ -148,21 +146,17 @@ const moreMenuItems = [ key: 'links', label: '推广链接', }, - // { - // key: 'commission', - // label: '佣金记录', - // }, - // { - // key: 'commission-deduction', - // label: '上级抽佣', - // }, - // { - // key: 'platform-deduction', - // label: '平台抽佣', - // }, { - key: 'reward', - label: '奖励记录', + key: 'rebate', + label: '返佣记录', + }, + { + key: 'upgrade', + label: '升级记录', + }, + { + key: 'order', + label: '订单记录', }, { key: 'withdrawal', @@ -170,15 +164,15 @@ const moreMenuItems = [ }, ]; -// 上级代理信息 -const parentAgentId = computed(() => route.query.parent_agent_id); +// 团队首领信息 +const teamLeaderId = computed(() => route.query.team_leader_id); -// 返回上级列表 +// 返回团队首领列表 function onBackToParent() { router.replace({ query: { ...route.query, - parent_agent_id: undefined, + team_leader_id: undefined, }, }); } @@ -194,10 +188,6 @@ function onActionClick( onViewCommission(e.row); break; } - case 'commission-deduction': { - onViewCommissionDeduction(e.row); - break; - } case 'edit': { onEdit(e.row); break; @@ -206,19 +196,23 @@ function onActionClick( onViewLinks(e.row); break; } - case 'platform-deduction': { - onViewPlatformDeduction(e.row); + case 'rebate': { + onViewRebate(e.row); break; } - case 'reward': { - onViewReward(e.row); + case 'upgrade': { + onViewUpgrade(e.row); + break; + } + case 'order': { + onViewOrder(e.row); break; } case 'view-sub-agent': { router.replace({ query: { ...route.query, - parent_agent_id: e.row.id, + team_leader_id: e.row.id, }, }); break; @@ -245,9 +239,19 @@ function onViewCommission(row: AgentApi.AgentListItem) { commissionModalApi.setData({ agentId: row.id }).open(); } -// 查看奖励记录 -function onViewReward(row: AgentApi.AgentListItem) { - rewardModalApi.setData({ agentId: row.id }).open(); +// 查看返佣记录 +function onViewRebate(row: AgentApi.AgentListItem) { + rebateModalApi.setData({ agentId: row.id }).open(); +} + +// 查看升级记录 +function onViewUpgrade(row: AgentApi.AgentListItem) { + upgradeModalApi.setData({ agentId: row.id }).open(); +} + +// 查看订单记录 +function onViewOrder(row: AgentApi.AgentListItem) { + orderModalApi.setData({ agentId: row.id }).open(); } // 查看提现记录 @@ -255,16 +259,6 @@ function onViewWithdrawal(row: AgentApi.AgentListItem) { withdrawalModalApi.setData({ agentId: row.id }).open(); } -// 查看上级抽佣记录 -function onViewCommissionDeduction(row: AgentApi.AgentListItem) { - commissionDeductionModalApi.setData({ agentId: row.id }).open(); -} - -// 查看平台抽佣记录 -function onViewPlatformDeduction(row: AgentApi.AgentListItem) { - platformDeductionModalApi.setData({ agentId: row.id }).open(); -} - // 刷新处理 function onRefresh() { gridApi.query(); @@ -276,16 +270,16 @@ function onRefresh() { - - - + + + - - + +
-
上级代理ID:{{ parentAgentId }}
+
团队首领ID:{{ teamLeaderId }}
@@ -295,10 +289,7 @@ function onRefresh() { - + +
+

提现单号:{{ currentWithdrawal.withdraw_no }}

+

代理ID:{{ currentWithdrawal.agent_id }}

+

+ 提现方式: + 支付宝 + 银行卡 +

+

+ 提现金额:¥{{ currentWithdrawal.amount.toFixed(2) }} +

+

+ 税费金额:¥{{ currentWithdrawal.tax_amount?.toFixed(2) ?? '0.00' }} +

+

+ 实际到账金额:¥{{ currentWithdrawal.actual_amount?.toFixed(2) ?? '0.00' }} +

+

+ 支付宝账号:{{ currentWithdrawal.payee_account }} +

+ +

收款人姓名:{{ currentWithdrawal.payee_name }}

+

+ 状态:{{ statusLabelMap[currentWithdrawal.status] ?? currentWithdrawal.status }} +

+

备注:{{ currentWithdrawal.remark }}

+

创建时间:{{ currentWithdrawal.create_time }}

+
+
+ + diff --git a/apps/web-antd/src/views/complaint/list/data.ts b/apps/web-antd/src/views/complaint/list/data.ts new file mode 100644 index 0000000..97510b1 --- /dev/null +++ b/apps/web-antd/src/views/complaint/list/data.ts @@ -0,0 +1,185 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { OnActionClickFn, VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { ComplaintApi } from '#/api/complaint'; + +export function useColumns( + onActionClick: OnActionClickFn, +): VxeTableGridOptions['columns'] { + return [ + { + field: 'id', + title: 'ID', + width: 100, + }, + { + cellRender: { + name: 'CellTag', + options: [ + { value: 'alipay', color: 'blue', label: '支付宝投诉' }, + { value: 'manual', color: 'green', label: '主动投诉' }, + ], + }, + field: 'type', + title: '投诉类型', + width: 120, + }, + { + field: 'name', + title: '投诉人姓名', + minWidth: 120, + }, + { + field: 'contact', + title: '联系方式', + minWidth: 150, + }, + { + field: 'content', + title: '投诉内容', + minWidth: 200, + showOverflow: 'tooltip', + }, + { + cellRender: { + name: 'CellTag', + options: [ + { value: 'pending', color: 'warning', label: '待处理' }, + { value: 'processing', color: 'processing', label: '处理中' }, + { value: 'resolved', color: 'success', label: '已解决' }, + { value: 'closed', color: 'default', label: '已关闭' }, + ], + }, + field: 'status', + title: '投诉状态', + width: 120, + }, + { + field: 'status_description', + title: '状态描述', + minWidth: 150, + showOverflow: 'tooltip', + }, + { + field: 'task_id', + title: '投诉单号', + minWidth: 150, + }, + { + field: 'trade_no', + title: '交易单号', + minWidth: 180, + }, + { + field: 'complain_amount', + title: '投诉金额', + width: 120, + formatter: ({ row }) => { + if (row.complain_amount) { + return `¥${parseFloat(row.complain_amount).toFixed(2)}`; + } + return '-'; + }, + }, + { + field: 'order_id', + title: '关联订单ID', + minWidth: 150, + }, + { + field: 'create_time', + title: '创建时间', + width: 180, + }, + { + field: 'handle_time', + title: '处理时间', + width: 180, + }, + { + align: 'center', + cellRender: { + attrs: { + nameField: 'id', + nameTitle: '投诉ID', + onClick: onActionClick, + }, + name: 'CellOperation', + options: [ + { + code: 'detail', + text: '查看详情', + }, + { + code: 'update_status', + text: '更新状态', + }, + { + code: 'update_remark', + text: '更新备注', + }, + ], + }, + field: 'operation', + fixed: 'right', + title: '操作', + width: 200, + }, + ]; +} + +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + component: 'Select', + componentProps: { + allowClear: true, + options: [ + { label: '支付宝投诉', value: 'alipay' }, + { label: '主动投诉', value: 'manual' }, + ], + }, + fieldName: 'type', + label: '投诉类型', + }, + { + component: 'Select', + componentProps: { + allowClear: true, + options: [ + { label: '待处理', value: 'pending' }, + { label: '处理中', value: 'processing' }, + { label: '已解决', value: 'resolved' }, + { label: '已关闭', value: 'closed' }, + ], + }, + fieldName: 'status', + label: '投诉状态', + }, + { + component: 'Input', + fieldName: 'name', + label: '投诉人姓名', + }, + { + component: 'Input', + fieldName: 'contact', + label: '联系方式', + }, + { + component: 'Input', + fieldName: 'order_id', + label: '关联订单ID', + }, + { + component: 'RangePicker', + fieldName: 'create_time', + label: '创建时间', + }, + { + component: 'RangePicker', + fieldName: 'handle_time', + label: '处理时间', + }, + ]; +} + diff --git a/apps/web-antd/src/views/complaint/list/index.vue b/apps/web-antd/src/views/complaint/list/index.vue new file mode 100644 index 0000000..aeb5d82 --- /dev/null +++ b/apps/web-antd/src/views/complaint/list/index.vue @@ -0,0 +1,131 @@ + + + diff --git a/apps/web-antd/src/views/complaint/list/modules/detail-modal.vue b/apps/web-antd/src/views/complaint/list/modules/detail-modal.vue new file mode 100644 index 0000000..a70ff90 --- /dev/null +++ b/apps/web-antd/src/views/complaint/list/modules/detail-modal.vue @@ -0,0 +1,289 @@ + + + + + diff --git a/apps/web-antd/src/views/complaint/list/modules/remark-modal.vue b/apps/web-antd/src/views/complaint/list/modules/remark-modal.vue new file mode 100644 index 0000000..449de5b --- /dev/null +++ b/apps/web-antd/src/views/complaint/list/modules/remark-modal.vue @@ -0,0 +1,83 @@ + + + diff --git a/apps/web-antd/src/views/complaint/list/modules/status-modal.vue b/apps/web-antd/src/views/complaint/list/modules/status-modal.vue new file mode 100644 index 0000000..330210e --- /dev/null +++ b/apps/web-antd/src/views/complaint/list/modules/status-modal.vue @@ -0,0 +1,100 @@ + + + diff --git a/apps/web-antd/src/views/dashboard/analytics/analytics-profit-panel.vue b/apps/web-antd/src/views/dashboard/analytics/analytics-profit-panel.vue new file mode 100644 index 0000000..4daff99 --- /dev/null +++ b/apps/web-antd/src/views/dashboard/analytics/analytics-profit-panel.vue @@ -0,0 +1,362 @@ + + + + + diff --git a/apps/web-antd/src/views/dashboard/analytics/analytics-revenue-trend.vue b/apps/web-antd/src/views/dashboard/analytics/analytics-revenue-trend.vue new file mode 100644 index 0000000..a4a225c --- /dev/null +++ b/apps/web-antd/src/views/dashboard/analytics/analytics-revenue-trend.vue @@ -0,0 +1,113 @@ + + + + diff --git a/apps/web-antd/src/views/dashboard/analytics/analytics-trends.vue b/apps/web-antd/src/views/dashboard/analytics/analytics-trends.vue index c3d3d81..d1f8616 100644 --- a/apps/web-antd/src/views/dashboard/analytics/analytics-trends.vue +++ b/apps/web-antd/src/views/dashboard/analytics/analytics-trends.vue @@ -1,14 +1,28 @@ diff --git a/apps/web-antd/src/views/dashboard/analytics/index.vue b/apps/web-antd/src/views/dashboard/analytics/index.vue index 5155d3e..a304344 100644 --- a/apps/web-antd/src/views/dashboard/analytics/index.vue +++ b/apps/web-antd/src/views/dashboard/analytics/index.vue @@ -1,102 +1,207 @@ + + diff --git a/apps/web-antd/src/views/order/order/data.ts b/apps/web-antd/src/views/order/order/data.ts index 5405d01..fab7684 100644 --- a/apps/web-antd/src/views/order/order/data.ts +++ b/apps/web-antd/src/views/order/order/data.ts @@ -107,18 +107,6 @@ export function useColumns( title: '退款时间', width: 180, }, - { - cellRender: { - name: 'CellTag', - options: [ - { value: 0, color: 'default', label: '否' }, - { value: 1, color: 'success', label: '是' }, - ], - }, - field: 'is_promotion', - title: '推广订单', - width: 100, - }, { align: 'center', cellRender: { @@ -212,18 +200,6 @@ export function useGridFormSchema(): VbenFormSchema[] { fieldName: 'status', label: '支付状态', }, - { - component: 'Select', - componentProps: { - allowClear: true, - options: [ - { label: '否', value: 0 }, - { label: '是', value: 1 }, - ], - }, - fieldName: 'is_promotion', - label: '推广订单', - }, { component: 'RangePicker', fieldName: 'create_time', diff --git a/apps/web-antd/src/views/order/query/query-details.vue b/apps/web-antd/src/views/order/query/query-details.vue index ee7580c..df1b8ea 100644 --- a/apps/web-antd/src/views/order/query/query-details.vue +++ b/apps/web-antd/src/views/order/query/query-details.vue @@ -22,7 +22,7 @@ import { getOrderQueryDetail } from '#/api/order/query'; const route = useRoute(); const router = useRouter(); -const orderId = Number(route.params.id); +const orderId = route.params.id as string; const loading = ref(false); const queryDetail = ref(); @@ -111,7 +111,9 @@ onMounted(() => {
@@ -122,10 +124,7 @@ onMounted(() => { 订单查询详情
查询状态: - + {{ getQueryStateConfig(queryDetail.query_state).label }}
@@ -160,11 +159,8 @@ onMounted(() => {