diff --git a/src/api/mall/trade/brokerage/user/index.ts b/src/api/mall/trade/brokerage/user/index.ts index 95f3a6a1..1fed3bfa 100644 --- a/src/api/mall/trade/brokerage/user/index.ts +++ b/src/api/mall/trade/brokerage/user/index.ts @@ -8,6 +8,9 @@ export interface BrokerageUserVO { brokerageTime: Date price: number frozenPrice: number + + nickname: string + avatar: string } // 查询分销用户列表 @@ -19,3 +22,18 @@ export const getBrokerageUserPage = async (params: any) => { export const getBrokerageUser = async (id: number) => { return await request.get({ url: `/trade/brokerage-user/get?id=` + id }) } + +// 修改推广员 +export const updateBindUser = async (data: any) => { + return await request.put({ url: `/trade/brokerage-user/update-bind-user`, data }) +} + +// 清除推广员 +export const clearBindUser = async (data: any) => { + return await request.put({ url: `/trade/brokerage-user/clear-bind-user`, data }) +} + +// 修改推广资格 +export const updateBrokerageEnabled = async (data: any) => { + return await request.put({ url: `/trade/brokerage-user/update-brokerage-enable`, data }) +} diff --git a/src/api/mall/trade/brokerage/withdraw/index.ts b/src/api/mall/trade/brokerage/withdraw/index.ts new file mode 100644 index 00000000..c93286a9 --- /dev/null +++ b/src/api/mall/trade/brokerage/withdraw/index.ts @@ -0,0 +1,39 @@ +import request from '@/config/axios' + +export interface BrokerageWithdrawVO { + id: number + userId: number + price: number + feePrice: number + totalPrice: number + type: number + name: string + accountNo: string + bankName: string + bankAddress: string + accountQrCodeUrl: string + status: number + auditReason: string + auditTime: Date + remark: string +} + +// 查询佣金提现列表 +export const getBrokerageWithdrawPage = async (params: any) => { + return await request.get({ url: `/trade/brokerage-withdraw/page`, params }) +} + +// 查询佣金提现详情 +export const getBrokerageWithdraw = async (id: number) => { + return await request.get({ url: `/trade/brokerage-withdraw/get?id=` + id }) +} + +// 佣金提现 - 通过申请 +export const approveBrokerageWithdraw = async (id: number) => { + return await request.put({ url: `/trade/brokerage-withdraw/approve?id=` + id }) +} + +// 审核佣金提现 - 驳回申请 +export const rejectBrokerageWithdraw = async (data: BrokerageWithdrawVO) => { + return await request.put({ url: `/trade/brokerage-withdraw/reject`, data }) +} diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 022d308c..6f3ded5c 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -299,3 +299,62 @@ export const BrokerageEnabledConditionEnum = { name: '指定分销' } } +/** + * 佣金记录业务类型枚举 + */ +export const BrokerageRecordBizTypeEnum = { + ORDER: { + type: 1, + name: '获得推广佣金' + }, + WITHDRAW: { + type: 2, + name: '提现申请' + } +} +/** + * 佣金提现状态枚举 + */ +export const BrokerageWithdrawStatusEnum = { + AUDITING: { + status: 0, + name: '审核中' + }, + AUDIT_SUCCESS: { + status: 10, + name: '审核通过' + }, + AUDIT_FAIL: { + status: 20, + name: '审核不通过' + }, + WITHDRAW_SUCCESS: { + status: 11, + name: '提现成功' + }, + WITHDRAW_FAIL: { + status: 21, + name: '提现失败' + } +} +/** + * 佣金提现类型枚举 + */ +export const BrokerageWithdrawTypeEnum = { + WALLET: { + type: 1, + name: '钱包' + }, + BANK: { + type: 2, + name: '银行卡' + }, + WECHAT: { + type: 3, + name: '微信' + }, + ALIPAY: { + type: 4, + name: '支付宝' + } +} diff --git a/src/utils/dict.ts b/src/utils/dict.ts index f898ed58..52b705b8 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -151,13 +151,6 @@ export enum DICT_TYPE { // ========== MALL - 会员模块 ========== MEMBER_POINT_BIZ_TYPE = 'member_point_biz_type', // 积分的业务类型 MEMBER_EXPERIENCE_BIZ_TYPE = 'member_experience_biz_type', // 会员经验业务类型 - // TODO @疯狂:这块的枚举,是不是要挪到 TRADE 那啦 - BROKERAGE_ENABLED_CONDITION = 'brokerage_enabled_condition', // 分佣模式 - BROKERAGE_BIND_MODE = 'brokerage_bind_mode', // 分销关系绑定模式 - BROKERAGE_BANK_NAME = 'brokerage_bank_name', // 佣金提现银行 - BROKERAGE_WITHDRAW_TYPE = 'brokerage_withdraw_type', // 佣金冻结时间 - BROKERAGE_RECORD_BIZ_TYPE = 'brokerage_record_biz_type', // 佣金业务类型 - BROKERAGE_RECORD_STATUS = 'brokerage_record_status', // 佣金状态 // ========== MALL - 商品模块 ========== PRODUCT_UNIT = 'product_unit', // 商品单位 @@ -172,6 +165,13 @@ export enum DICT_TYPE { TRADE_ORDER_STATUS = 'trade_order_status', // 订单 - 状态 TRADE_ORDER_ITEM_AFTER_SALE_STATUS = 'trade_order_item_after_sale_status', // 订单项 - 售后状态 TRADE_DELIVERY_TYPE = 'trade_delivery_type', // 配送方式 + BROKERAGE_ENABLED_CONDITION = 'brokerage_enabled_condition', // 分佣模式 + BROKERAGE_BIND_MODE = 'brokerage_bind_mode', // 分销关系绑定模式 + BROKERAGE_BANK_NAME = 'brokerage_bank_name', // 佣金提现银行 + BROKERAGE_WITHDRAW_TYPE = 'brokerage_withdraw_type', // 佣金冻结时间 + BROKERAGE_RECORD_BIZ_TYPE = 'brokerage_record_biz_type', // 佣金业务类型 + BROKERAGE_RECORD_STATUS = 'brokerage_record_status', // 佣金状态 + BROKERAGE_WITHDRAW_STATUS = 'brokerage_withdraw_status', // 佣金提现状态 // ========== MALL - 营销模块 ========== PROMOTION_DISCOUNT_TYPE = 'promotion_discount_type', // 优惠类型 diff --git a/src/views/infra/server/index.vue b/src/views/infra/server/index.vue index 06c35d97..b9a157a5 100644 --- a/src/views/infra/server/index.vue +++ b/src/views/infra/server/index.vue @@ -16,6 +16,9 @@ const src = ref(import.meta.env.VITE_BASE_URL + '/admin/applications') /** 初始化 */ onMounted(async () => { try { + // 友情提示:如果访问出现 404 问题: + // 1)boot 参考 https://doc.iocoder.cn/server-monitor/ 解决; + // 2)cloud 参考 https://cloud.iocoder.cn/server-monitor/ 解决 const data = await ConfigApi.getConfigKey('url.spring-boot-admin') if (data && data.length > 0) { src.value = data diff --git a/src/views/mall/trade/brokerage/record/index.vue b/src/views/mall/trade/brokerage/record/index.vue index 0e62a778..f9cae4e1 100644 --- a/src/views/mall/trade/brokerage/record/index.vue +++ b/src/views/mall/trade/brokerage/record/index.vue @@ -65,6 +65,12 @@ + + + + @@ -131,10 +126,14 @@ v-hasPermi="[ 'trade:brokerage-user:user-query', 'trade:brokerage-user:order-query', - 'trade:brokerage-user:update-brokerage-user', - 'trade:brokerage-user:clear-brokerage-user' + 'trade:brokerage-user:update-bind-user', + 'trade:brokerage-user:clear-bind-user' ]" > + + + 更多 + diff --git a/src/views/mall/trade/brokerage/withdraw/index.vue b/src/views/mall/trade/brokerage/withdraw/index.vue new file mode 100644 index 00000000..89323f93 --- /dev/null +++ b/src/views/mall/trade/brokerage/withdraw/index.vue @@ -0,0 +1,264 @@ + + + diff --git a/src/views/mall/trade/order/detail/index.vue b/src/views/mall/trade/order/detail/index.vue index 40f2a664..e92fa82c 100644 --- a/src/views/mall/trade/order/detail/index.vue +++ b/src/views/mall/trade/order/detail/index.vue @@ -245,9 +245,9 @@ const { params } = useRoute() // 查询参数 const getDetail = async () => { const id = params.orderId as unknown as number if (id) { - const res = (await TradeOrderApi.getOrder(66666)) as TradeOrderApi.OrderVO + const res = (await TradeOrderApi.getOrder(id)) as TradeOrderApi.OrderVO // 没有表单信息则关闭页面返回 - if (res == null) { + if (res === null) { message.error('交易订单不存在') close() } diff --git a/src/views/mall/trade/order/index.vue b/src/views/mall/trade/order/index.vue index 61037d64..dca2fe85 100644 --- a/src/views/mall/trade/order/index.vue +++ b/src/views/mall/trade/order/index.vue @@ -101,6 +101,7 @@ +