feat(withdraw): 添加分销商提现领取功能
- 新增 receiveShopDealerWithdraw 接口用于用户领取提现 - 新增 receiveSuccessShopDealerWithdraw 接口用于领取成功回调 - 添加 ShopDealerWithdrawReceiveResult 类型定义 - 实现提取 package_info 的 extractPackageInfo 函数 - 更新提现列表页面的领取按钮样式 - 完善领取流程的状态处理和错误提示机制
This commit is contained in:
@@ -14,6 +14,9 @@ export type ShopDealerWithdrawCreateResult =
|
||||
| null
|
||||
| undefined;
|
||||
|
||||
// When applyStatus=20, user can "receive" (WeChat confirm receipt flow).
|
||||
export type ShopDealerWithdrawReceiveResult = ShopDealerWithdrawCreateResult;
|
||||
|
||||
/**
|
||||
* 分页查询分销商提现明细表
|
||||
*/
|
||||
@@ -57,6 +60,34 @@ export async function addShopDealerWithdraw(data: ShopDealerWithdraw): Promise<S
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户领取(仅当 applyStatus=20 时)- 后台返回 package_info 供小程序调起确认收款页
|
||||
*/
|
||||
export async function receiveShopDealerWithdraw(id: number): Promise<ShopDealerWithdrawReceiveResult> {
|
||||
const res = await request.post<ApiResult<any>>(
|
||||
'/shop/shop-dealer-withdraw/receive/' + id,
|
||||
{}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data ?? res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 领取成功回调:前端确认收款后通知后台把状态置为 applyStatus=40
|
||||
*/
|
||||
export async function receiveSuccessShopDealerWithdraw(id: number) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-withdraw/receive-success/' + id,
|
||||
{}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改分销商提现明细表
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user