- 将 doctor 目录重命名为 dealer 目录 - 更新页面标题从'会员注册'为'注册会员' - 删除银行卡管理、患者报备和订单消息功能 - 重命名组件 AddDoctor 为 AddUserAddress - 添加用户角色管理和默认角色写入逻辑 - 优化注册成功后跳转至用户中心页面 - 更新应用配置中的页面路径和子包结构 - 添加经销商资金管理、团队管理和二维码推广功能 - 更新租户信息配置,增加租户名称和版权信息 - 优化文章列表组件的类型定义和渲染方式 - 修复广告轮播图数据加载和图片兼容性问题
146 lines
3.9 KiB
TypeScript
146 lines
3.9 KiB
TypeScript
import request from '@/utils/request';
|
|
import type { ApiResult, PageResult } from '@/api';
|
|
import type { ShopDealerWithdraw, ShopDealerWithdrawParam } from './model';
|
|
|
|
// WeChat transfer v3: backend may return `package_info` for MiniProgram to open the
|
|
// "confirm receipt" page via `wx.requestMerchantTransfer`.
|
|
export type ShopDealerWithdrawCreateResult =
|
|
| string
|
|
| {
|
|
package_info?: string;
|
|
packageInfo?: string;
|
|
[k: string]: any;
|
|
}
|
|
| null
|
|
| undefined;
|
|
|
|
// When applyStatus=20, user can "receive" (WeChat confirm receipt flow).
|
|
export type ShopDealerWithdrawReceiveResult = ShopDealerWithdrawCreateResult;
|
|
|
|
/**
|
|
* 分页查询分销商提现明细表
|
|
*/
|
|
export async function pageShopDealerWithdraw(params: ShopDealerWithdrawParam) {
|
|
const res = await request.get<ApiResult<PageResult<ShopDealerWithdraw>>>(
|
|
'/shop/shop-dealer-withdraw/page',
|
|
params
|
|
);
|
|
if (res.code === 0) {
|
|
return res.data;
|
|
}
|
|
return Promise.reject(new Error(res.message));
|
|
}
|
|
|
|
/**
|
|
* 查询分销商提现明细表列表
|
|
*/
|
|
export async function listShopDealerWithdraw(params?: ShopDealerWithdrawParam) {
|
|
const res = await request.get<ApiResult<ShopDealerWithdraw[]>>(
|
|
'/shop/shop-dealer-withdraw',
|
|
params
|
|
);
|
|
if (res.code === 0 && res.data) {
|
|
return res.data;
|
|
}
|
|
return Promise.reject(new Error(res.message));
|
|
}
|
|
|
|
/**
|
|
* 添加分销商提现明细表
|
|
*/
|
|
export async function addShopDealerWithdraw(data: ShopDealerWithdraw): Promise<ShopDealerWithdrawCreateResult> {
|
|
const res = await request.post<ApiResult<any>>(
|
|
'/shop/shop-dealer-withdraw',
|
|
data
|
|
);
|
|
if (res.code === 0) {
|
|
// Some backends return `message`, while WeChat transfer flow returns `data.package_info`.
|
|
return res.data ?? res.message;
|
|
}
|
|
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));
|
|
}
|
|
|
|
/**
|
|
* 修改分销商提现明细表
|
|
*/
|
|
export async function updateShopDealerWithdraw(data: ShopDealerWithdraw) {
|
|
const res = await request.put<ApiResult<unknown>>(
|
|
'/shop/shop-dealer-withdraw',
|
|
data
|
|
);
|
|
if (res.code === 0) {
|
|
return res.message;
|
|
}
|
|
return Promise.reject(new Error(res.message));
|
|
}
|
|
|
|
/**
|
|
* 删除分销商提现明细表
|
|
*/
|
|
export async function removeShopDealerWithdraw(id?: number) {
|
|
const res = await request.del<ApiResult<unknown>>(
|
|
'/shop/shop-dealer-withdraw/' + id
|
|
);
|
|
if (res.code === 0) {
|
|
return res.message;
|
|
}
|
|
return Promise.reject(new Error(res.message));
|
|
}
|
|
|
|
/**
|
|
* 批量删除分销商提现明细表
|
|
*/
|
|
export async function removeBatchShopDealerWithdraw(data: (number | undefined)[]) {
|
|
const res = await request.del<ApiResult<unknown>>(
|
|
'/shop/shop-dealer-withdraw/batch',
|
|
{
|
|
data
|
|
}
|
|
);
|
|
if (res.code === 0) {
|
|
return res.message;
|
|
}
|
|
return Promise.reject(new Error(res.message));
|
|
}
|
|
|
|
/**
|
|
* 根据id查询分销商提现明细表
|
|
*/
|
|
export async function getShopDealerWithdraw(id: number) {
|
|
const res = await request.get<ApiResult<ShopDealerWithdraw>>(
|
|
'/shop/shop-dealer-withdraw/' + id
|
|
);
|
|
if (res.code === 0 && res.data) {
|
|
return res.data;
|
|
}
|
|
return Promise.reject(new Error(res.message));
|
|
}
|