feat(user): 新增收货地址管理及售后申请页面
- 新增地址类型定义,增强前端地址数据结构 - 新增地址编辑页面,支持地址智能识别和定位选点功能 - 地址编辑支持省市区选择及默认地址设置 - 新增地址列表页面,支持地址展示、删除、编辑和选择功能 - 实现售后申请页面,支持选择售后类型和退款原因 - 售后申请支持商品选择、退款金额计算和凭证上传 - 新增售后详情页面,支持售后状态展示及申请取消 - 优化页面加载和用户交互体验,增加错误提示和权限处理
This commit is contained in:
110
src_bak/api/shop/shopActivity/index.ts
Normal file
110
src_bak/api/shop/shopActivity/index.ts
Normal file
@@ -0,0 +1,110 @@
|
||||
import request from '@/utils/request'
|
||||
import type { ApiResult, PageResult } from '@/api'
|
||||
import type {
|
||||
ShopActivity,
|
||||
ShopActivityParam,
|
||||
ActivitySignUpParams,
|
||||
ActivityStats,
|
||||
} from './model'
|
||||
import { normalizeActivity } from './model'
|
||||
|
||||
export type { ShopActivity, ActivityStatus, ActivityType } from './model'
|
||||
|
||||
/**
|
||||
* 分页查询活动
|
||||
*/
|
||||
export async function pageShopActivity(params: ShopActivityParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopActivity>>>(
|
||||
'/shop/shop-activity/page',
|
||||
params
|
||||
)
|
||||
if (res.code === 0 && res.data) {
|
||||
return {
|
||||
...res.data,
|
||||
list: (res.data.list || []).map(normalizeActivity),
|
||||
}
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询活动列表
|
||||
*/
|
||||
export async function listShopActivity(params?: ShopActivityParam) {
|
||||
const res = await request.get<ApiResult<ShopActivity[]>>(
|
||||
'/shop/shop-activity',
|
||||
params
|
||||
)
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data.map(normalizeActivity)
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID查询活动
|
||||
*/
|
||||
export async function getShopActivity(id: number) {
|
||||
const res = await request.get<ApiResult<ShopActivity>>(
|
||||
'/shop/shop-activity/' + id
|
||||
)
|
||||
if (res.code === 0 && res.data) {
|
||||
return normalizeActivity(res.data)
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 报名活动
|
||||
*/
|
||||
export async function signUpActivity(params: ActivitySignUpParams) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-activity/sign-up',
|
||||
params
|
||||
)
|
||||
if (res.code === 0) {
|
||||
return res.message
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消报名
|
||||
*/
|
||||
export async function cancelSignUpActivity(activityId: number) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-activity/cancel-sign-up',
|
||||
{ activityId }
|
||||
)
|
||||
if (res.code === 0) {
|
||||
return res.message
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取活动报名状态
|
||||
*/
|
||||
export async function getSignUpStatus(activityId: number) {
|
||||
const res = await request.get<ApiResult<{ signedUp: boolean }>>(
|
||||
'/shop/shop-activity/sign-up-status',
|
||||
{ activityId }
|
||||
)
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取活动统计
|
||||
*/
|
||||
export async function getActivityStats() {
|
||||
const res = await request.get<ApiResult<ActivityStats>>(
|
||||
'/shop/shop-activity/stats'
|
||||
)
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
89
src_bak/api/shop/shopActivity/model/index.ts
Normal file
89
src_bak/api/shop/shopActivity/model/index.ts
Normal file
@@ -0,0 +1,89 @@
|
||||
/**
|
||||
* 活动模型
|
||||
*/
|
||||
|
||||
// 活动类型(前端语义化)
|
||||
export type ActivityType = 'discount' | 'full_reduction' | 'seckill' | 'group_buy' | 'flash_sale'
|
||||
|
||||
// 活动状态(前端语义化)
|
||||
export type ActivityStatus = 'upcoming' | 'ongoing' | 'ended' | 'cancelled'
|
||||
|
||||
// 活动数据(与后端字段对齐)
|
||||
export interface ShopActivity {
|
||||
id: number
|
||||
name: string
|
||||
image: string
|
||||
banner?: string
|
||||
startTime: string
|
||||
endTime: string
|
||||
/** 后端返回整数: 0=未开始 1=进行中 2=已结束,前端通过 normalizeActivity 转为语义化字符串 */
|
||||
status: ActivityStatus | number
|
||||
/** 后端返回整数: 1=满减 2=折扣 3=秒杀 4=拼团 */
|
||||
type: ActivityType | number
|
||||
typeName?: string
|
||||
description: string
|
||||
participants?: number
|
||||
maxParticipants?: number
|
||||
discountRate?: number
|
||||
reductionAmount?: number
|
||||
minAmount?: number
|
||||
rules?: string
|
||||
tenantId?: number
|
||||
createTime: string
|
||||
updateTime?: string
|
||||
}
|
||||
|
||||
// 活动查询参数
|
||||
export interface ShopActivityParam {
|
||||
page?: number
|
||||
limit?: number
|
||||
status?: number | ActivityStatus
|
||||
type?: number | ActivityType
|
||||
keywords?: string
|
||||
}
|
||||
|
||||
// 活动报名参数
|
||||
export interface ActivitySignUpParams {
|
||||
activityId: number
|
||||
userId?: number
|
||||
contactPhone?: string
|
||||
remark?: string
|
||||
}
|
||||
|
||||
// 活动统计
|
||||
export interface ActivityStats {
|
||||
total: number
|
||||
ongoing: number
|
||||
upcoming: number
|
||||
ended: number
|
||||
totalParticipants: number
|
||||
}
|
||||
|
||||
// 后端整数状态 → 前端语义化状态
|
||||
export function normalizeActivityStatus(status: number | ActivityStatus): ActivityStatus {
|
||||
if (typeof status === 'string') return status
|
||||
const map: Record<number, ActivityStatus> = { 0: 'upcoming', 1: 'ongoing', 2: 'ended' }
|
||||
return map[status] ?? 'ended'
|
||||
}
|
||||
|
||||
// 后端整数类型 → 前端语义化类型
|
||||
export function normalizeActivityType(type: number | ActivityType): ActivityType {
|
||||
if (typeof type === 'string') return type
|
||||
const map: Record<number, ActivityType> = {
|
||||
1: 'full_reduction',
|
||||
2: 'discount',
|
||||
3: 'seckill',
|
||||
4: 'group_buy',
|
||||
}
|
||||
return map[type] ?? 'discount'
|
||||
}
|
||||
|
||||
// 规范化活动对象(处理后端整数字段)
|
||||
export function normalizeActivity(a: ShopActivity): ShopActivity & { status: ActivityStatus; type: ActivityType } {
|
||||
return {
|
||||
...a,
|
||||
participants: a.participants ?? 0,
|
||||
status: normalizeActivityStatus(a.status as number),
|
||||
type: normalizeActivityType(a.type as number),
|
||||
}
|
||||
}
|
||||
154
src_bak/api/shop/shopAfterSale/index.ts
Normal file
154
src_bak/api/shop/shopAfterSale/index.ts
Normal file
@@ -0,0 +1,154 @@
|
||||
import request from '@/utils/request'
|
||||
import type { ApiResult, PageResult } from '@/api'
|
||||
|
||||
// 售后类型
|
||||
export type AfterSaleType = 'refund' | 'return' | 'exchange' | 'repair'
|
||||
|
||||
// 售后状态
|
||||
export type AfterSaleStatus =
|
||||
| 'pending' // 待审核
|
||||
| 'approved' // 已同意
|
||||
| 'rejected' // 已拒绝
|
||||
| 'processing' // 处理中
|
||||
| 'completed' // 已完成
|
||||
| 'cancelled' // 已取消
|
||||
|
||||
// 售后进度记录
|
||||
export interface ProgressRecord {
|
||||
id: string
|
||||
time: string
|
||||
status: string
|
||||
description: string
|
||||
operator?: string
|
||||
remark?: string
|
||||
}
|
||||
|
||||
// 售后详情
|
||||
export interface AfterSaleDetail {
|
||||
id: string
|
||||
orderId: string
|
||||
orderNo: string
|
||||
goodsName?: string
|
||||
type: AfterSaleType
|
||||
status: AfterSaleStatus
|
||||
reason: string
|
||||
description: string
|
||||
amount: number
|
||||
applyTime: string
|
||||
processTime?: string
|
||||
completeTime?: string
|
||||
rejectReason?: string
|
||||
contactPhone?: string
|
||||
evidenceImages: string[]
|
||||
progressRecords: ProgressRecord[]
|
||||
}
|
||||
|
||||
// 售后申请参数
|
||||
export interface AfterSaleApplyParams {
|
||||
orderId: string
|
||||
type: AfterSaleType
|
||||
reason: string
|
||||
description?: string
|
||||
amount?: number
|
||||
contactPhone?: string
|
||||
evidenceImages?: string[]
|
||||
goodsItems?: Array<{ goodsId: string; quantity: number }>
|
||||
}
|
||||
|
||||
// 售后列表查询参数
|
||||
export interface AfterSaleListParams {
|
||||
page?: number
|
||||
pageSize?: number
|
||||
status?: AfterSaleStatus
|
||||
type?: AfterSaleType
|
||||
}
|
||||
|
||||
// 售后类型映射
|
||||
export const AFTER_SALE_TYPE_MAP: Record<AfterSaleType, string> = {
|
||||
refund: '退款',
|
||||
return: '退货',
|
||||
exchange: '换货',
|
||||
repair: '维修',
|
||||
}
|
||||
|
||||
// 售后状态映射
|
||||
export const AFTER_SALE_STATUS_MAP: Record<AfterSaleStatus, string> = {
|
||||
pending: '待审核',
|
||||
approved: '已同意',
|
||||
rejected: '已拒绝',
|
||||
processing: '处理中',
|
||||
completed: '已完成',
|
||||
cancelled: '已取消',
|
||||
}
|
||||
|
||||
// 格式化售后状态
|
||||
export const formatAfterSaleStatus = (status: AfterSaleStatus): {
|
||||
text: string
|
||||
color: string
|
||||
icon: string
|
||||
} => {
|
||||
const statusMap: Record<AfterSaleStatus, { text: string; color: string; icon: string }> = {
|
||||
pending: { text: '待审核', color: 'text-orange-500', icon: '⏳' },
|
||||
approved: { text: '已同意', color: 'text-green-500', icon: '✅' },
|
||||
rejected: { text: '已拒绝', color: 'text-red-500', icon: '❌' },
|
||||
processing: { text: '处理中', color: 'text-blue-500', icon: '🔄' },
|
||||
completed: { text: '已完成', color: 'text-green-500', icon: '✅' },
|
||||
cancelled: { text: '已取消', color: 'text-gray-400', icon: '⭕' },
|
||||
}
|
||||
return statusMap[status] || { text: status, color: 'text-gray-400', icon: '📋' }
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请售后
|
||||
*/
|
||||
export async function applyAfterSale(data: AfterSaleApplyParams) {
|
||||
const res = await request.post<ApiResult<AfterSaleDetail>>(
|
||||
'/shop/shop-after-sale/apply',
|
||||
data
|
||||
)
|
||||
if (res.code === 0) {
|
||||
return res.data
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询售后列表
|
||||
*/
|
||||
export async function pageAfterSaleList(params: AfterSaleListParams) {
|
||||
const res = await request.get<ApiResult<PageResult<AfterSaleDetail>>>(
|
||||
'/shop/shop-after-sale/page',
|
||||
params
|
||||
)
|
||||
if (res.code === 0) {
|
||||
return res.data
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询售后详情
|
||||
*/
|
||||
export async function getAfterSaleDetail(id: string) {
|
||||
const res = await request.get<ApiResult<AfterSaleDetail>>(
|
||||
'/shop/shop-after-sale/' + id
|
||||
)
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤销售后申请
|
||||
*/
|
||||
export async function cancelAfterSale(id: string) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-after-sale/cancel',
|
||||
{ id }
|
||||
)
|
||||
if (res.code === 0) {
|
||||
return res.message
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
101
src_bak/api/shop/shopArticle/index.ts
Normal file
101
src_bak/api/shop/shopArticle/index.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopArticle, ShopArticleParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询商品文章
|
||||
*/
|
||||
export async function pageShopArticle(params: ShopArticleParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopArticle>>>(
|
||||
'/shop/shop-article/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品文章列表
|
||||
*/
|
||||
export async function listShopArticle(params?: ShopArticleParam) {
|
||||
const res = await request.get<ApiResult<ShopArticle[]>>(
|
||||
'/shop/shop-article',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品文章
|
||||
*/
|
||||
export async function addShopArticle(data: ShopArticle) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-article',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品文章
|
||||
*/
|
||||
export async function updateShopArticle(data: ShopArticle) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-article',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品文章
|
||||
*/
|
||||
export async function removeShopArticle(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-article/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品文章
|
||||
*/
|
||||
export async function removeBatchShopArticle(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-article/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品文章
|
||||
*/
|
||||
export async function getShopArticle(id: number) {
|
||||
const res = await request.get<ApiResult<ShopArticle>>(
|
||||
'/shop/shop-article/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
123
src_bak/api/shop/shopArticle/model/index.ts
Normal file
123
src_bak/api/shop/shopArticle/model/index.ts
Normal file
@@ -0,0 +1,123 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 商品文章
|
||||
*/
|
||||
export interface ShopArticle {
|
||||
// 文章ID
|
||||
articleId?: number;
|
||||
// 文章标题
|
||||
title?: string;
|
||||
// 文章类型 0常规 1视频
|
||||
type?: number;
|
||||
// 模型
|
||||
model?: string;
|
||||
// 详情页模板
|
||||
detail?: string;
|
||||
// 文章分类ID
|
||||
categoryId?: number;
|
||||
// 上级id, 0是顶级
|
||||
parentId?: number;
|
||||
// 话题
|
||||
topic?: string;
|
||||
// 标签
|
||||
tags?: string;
|
||||
// 封面图
|
||||
image?: string;
|
||||
// 封面图宽
|
||||
imageWidth?: number;
|
||||
// 封面图高
|
||||
imageHeight?: number;
|
||||
// 付费金额
|
||||
price?: string;
|
||||
// 开始时间
|
||||
startTime?: string;
|
||||
// 结束时间
|
||||
endTime?: string;
|
||||
// 来源
|
||||
source?: string;
|
||||
// 产品概述
|
||||
overview?: string;
|
||||
// 虚拟阅读量(仅用作展示)
|
||||
virtualViews?: number;
|
||||
// 实际阅读量
|
||||
actualViews?: number;
|
||||
// 评分
|
||||
rate?: string;
|
||||
// 列表显示方式(10小图展示 20大图展示)
|
||||
showType?: number;
|
||||
// 访问密码
|
||||
password?: string;
|
||||
// 可见类型 0所有人 1登录可见 2密码可见
|
||||
permission?: number;
|
||||
// 发布来源客户端 (APP、H5、小程序等)
|
||||
platform?: string;
|
||||
// 文章附件
|
||||
files?: string;
|
||||
// 视频地址
|
||||
video?: string;
|
||||
// 接受的文件类型
|
||||
accept?: string;
|
||||
// 经度
|
||||
longitude?: string;
|
||||
// 纬度
|
||||
latitude?: string;
|
||||
// 所在省份
|
||||
province?: string;
|
||||
// 所在城市
|
||||
city?: string;
|
||||
// 所在辖区
|
||||
region?: string;
|
||||
// 街道地址
|
||||
address?: string;
|
||||
// 点赞数
|
||||
likes?: number;
|
||||
// 评论数
|
||||
commentNumbers?: number;
|
||||
// 提醒谁看
|
||||
toUsers?: string;
|
||||
// 作者
|
||||
author?: string;
|
||||
// 推荐
|
||||
recommend?: number;
|
||||
// 报名人数
|
||||
bmUsers?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 项目ID
|
||||
projectId?: number;
|
||||
// 语言
|
||||
lang?: string;
|
||||
// 关联默认语言的文章ID
|
||||
langArticleId?: number;
|
||||
// 是否自动翻译
|
||||
translation?: string;
|
||||
// 编辑器类型 0 Markdown编辑器 1 富文本编辑器
|
||||
editor?: string;
|
||||
// pdf文件地址
|
||||
pdfUrl?: string;
|
||||
// 版本号
|
||||
version?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态, 0已发布, 1待审核 2已驳回 3违规内容
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品文章搜索条件
|
||||
*/
|
||||
export interface ShopArticleParam extends PageParam {
|
||||
articleId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
121
src_bak/api/shop/shopBooking/index.ts
Normal file
121
src_bak/api/shop/shopBooking/index.ts
Normal file
@@ -0,0 +1,121 @@
|
||||
import request from '@/utils/request'
|
||||
import type { ApiResult, PageResult } from '@/api'
|
||||
import type {
|
||||
ShopBooking,
|
||||
ShopBookingParam,
|
||||
ShopBookingParams,
|
||||
BookingStats,
|
||||
} from './model'
|
||||
|
||||
/**
|
||||
* 分页查询预约订单
|
||||
*/
|
||||
export async function pageShopBooking(params: ShopBookingParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopBooking>>>(
|
||||
'/shop/shop-booking/page',
|
||||
params
|
||||
)
|
||||
if (res.code === 0) {
|
||||
return res.data
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询预约订单列表
|
||||
*/
|
||||
export async function listShopBooking(params?: ShopBookingParam) {
|
||||
const res = await request.get<ApiResult<ShopBooking[]>>(
|
||||
'/shop/shop-booking',
|
||||
params
|
||||
)
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID查询预约订单
|
||||
*/
|
||||
export async function getShopBooking(id: string) {
|
||||
const res = await request.get<ApiResult<ShopBooking>>(
|
||||
'/shop/shop-booking/' + id
|
||||
)
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建预约订单
|
||||
*/
|
||||
export async function createShopBooking(data: ShopBookingParams) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-booking',
|
||||
data
|
||||
)
|
||||
if (res.code === 0) {
|
||||
return res.message
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改预约订单
|
||||
*/
|
||||
export async function updateShopBooking(data: ShopBookingParams) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-booking',
|
||||
data
|
||||
)
|
||||
if (res.code === 0) {
|
||||
return res.message
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消预约订单
|
||||
*/
|
||||
export async function cancelShopBooking(id?: string) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-booking/' + id
|
||||
)
|
||||
if (res.code === 0) {
|
||||
return res.message
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 改签预约订单
|
||||
*/
|
||||
export async function rescheduleShopBooking(data: {
|
||||
bookingId: string
|
||||
newDate: string
|
||||
newTime: string
|
||||
}) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-booking/reschedule',
|
||||
data
|
||||
)
|
||||
if (res.code === 0) {
|
||||
return res.message
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取预约统计
|
||||
*/
|
||||
export async function getBookingStats() {
|
||||
const res = await request.get<ApiResult<BookingStats>>(
|
||||
'/shop/shop-booking/stats'
|
||||
)
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
53
src_bak/api/shop/shopBooking/model/index.ts
Normal file
53
src_bak/api/shop/shopBooking/model/index.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
/**
|
||||
* 预约订单模型
|
||||
*/
|
||||
|
||||
// 预约状态
|
||||
export type BookingStatus = 'pending' | 'confirmed' | 'in_progress' | 'completed' | 'cancelled' | 'rescheduled'
|
||||
|
||||
// 预约订单数据
|
||||
export interface ShopBooking {
|
||||
id: number | string
|
||||
bookingNo: string // 预约编号
|
||||
storeId: number // 店铺ID
|
||||
storeName: string // 店铺名称
|
||||
storePhone?: string // 门店服务电话
|
||||
serviceId: number // 服务ID
|
||||
serviceName: string // 服务名称
|
||||
bookingDate: string // 预约日期
|
||||
bookingTime: string // 预约时间段
|
||||
status: BookingStatus // 预约状态
|
||||
price: number // 价格
|
||||
createTime: string // 创建时间
|
||||
updateTime?: string // 更新时间
|
||||
remark?: string // 备注
|
||||
contactName?: string // 联系人
|
||||
contactPhone?: string // 联系电话
|
||||
address?: string // 地址
|
||||
}
|
||||
|
||||
// 预约查询参数
|
||||
export interface ShopBookingParam {
|
||||
page?: number
|
||||
limit?: number
|
||||
status?: BookingStatus // 按状态筛选
|
||||
storeId?: number // 按店铺筛选
|
||||
startDate?: string // 预约日期范围-起始
|
||||
endDate?: string // 预约日期范围-结束
|
||||
keywords?: string // 关键词搜索
|
||||
sortBy?: string // 排序方式(createTime, bookingDate)
|
||||
}
|
||||
|
||||
// 创建/更新预约参数
|
||||
export interface ShopBookingParams extends ShopBooking {}
|
||||
|
||||
// 预约统计
|
||||
export interface BookingStats {
|
||||
total: number // 总预约数
|
||||
pending: number // 待服务
|
||||
confirmed: number // 已确认
|
||||
inProgress: number // 进行中
|
||||
completed: number // 已完成
|
||||
cancelled: number // 已取消
|
||||
rescheduled: number // 已改签
|
||||
}
|
||||
153
src_bak/api/shop/shopCart/index.ts
Normal file
153
src_bak/api/shop/shopCart/index.ts
Normal file
@@ -0,0 +1,153 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import type { ShopCart, ShopCartParam, AddToCartParam, UpdateCartNumParam } from './model';
|
||||
|
||||
/**
|
||||
* 获取购物车列表
|
||||
*/
|
||||
export async function listShopCart(params?: ShopCartParam) {
|
||||
const res = await request.get<ApiResult<ShopCart[]>>(
|
||||
'/shop/shop-cart',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取购物车分页列表
|
||||
*/
|
||||
export async function pageShopCart(params: ShopCartParam) {
|
||||
const res = await request.get<ApiResult<{ list: ShopCart[]; count: number }>>(
|
||||
'/shop/shop-cart/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取购物车数量
|
||||
*/
|
||||
export async function getShopCartCount() {
|
||||
const res = await request.get<ApiResult<{ count: number }>>(
|
||||
'/shop/shop-cart/count'
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data.count;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品到购物车
|
||||
*/
|
||||
export async function addToCart(data: AddToCartParam) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-cart',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message || '添加成功';
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新购物车商品数量
|
||||
*/
|
||||
export async function updateCartNum(data: UpdateCartNumParam) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-cart/' + data.id,
|
||||
{ quantity: data.num }
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message || '更新成功';
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新购物车商品选中状态
|
||||
*/
|
||||
export async function updateCartChecked(id: number, checked: boolean) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-cart/' + id,
|
||||
{ selected: checked }
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message || '更新成功';
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 全选/取消全选购物车
|
||||
*/
|
||||
export async function updateCartAllChecked(checked: boolean) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-cart/selected',
|
||||
{ selected: checked }
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message || '更新成功';
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除购物车商品
|
||||
*/
|
||||
export async function removeShopCart(id: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-cart/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message || '删除成功';
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除购物车商品
|
||||
*/
|
||||
export async function removeBatchShopCart(ids: number[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-cart/batch',
|
||||
{ ids }
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message || '删除成功';
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空购物车
|
||||
*/
|
||||
export async function clearShopCart() {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-cart/clear'
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message || '清空成功';
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取购物车详情
|
||||
*/
|
||||
export async function getShopCart(id: number) {
|
||||
const res = await request.get<ApiResult<ShopCart>>(
|
||||
'/shop/shop-cart/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
74
src_bak/api/shop/shopCart/model/index.ts
Normal file
74
src_bak/api/shop/shopCart/model/index.ts
Normal file
@@ -0,0 +1,74 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 购物车项
|
||||
*/
|
||||
export interface ShopCart {
|
||||
// 主键ID
|
||||
id?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 商品ID
|
||||
goodsId?: number;
|
||||
// SKU ID
|
||||
skuId?: number;
|
||||
// 数量
|
||||
num?: number;
|
||||
// 商品名称
|
||||
goodsName?: string;
|
||||
// 商品图片
|
||||
goodsImage?: string;
|
||||
// SKU价格
|
||||
skuPrice?: string;
|
||||
// SKU规格
|
||||
skuSpec?: string;
|
||||
// 库存
|
||||
stock?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 更新时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 购物车项扩展(包含选中状态,用于前端展示)
|
||||
*/
|
||||
export interface ShopCartItem extends ShopCart {
|
||||
// 是否选中
|
||||
checked?: boolean;
|
||||
// 商品详情
|
||||
product?: any;
|
||||
// SKU详情
|
||||
sku?: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加到购物车参数
|
||||
*/
|
||||
export interface AddToCartParam {
|
||||
// 商品ID
|
||||
goodsId: number;
|
||||
// SKU ID(单规格可不传)
|
||||
skuId?: number;
|
||||
// 数量
|
||||
num: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新购物车数量参数
|
||||
*/
|
||||
export interface UpdateCartNumParam {
|
||||
// 购物车ID
|
||||
id: number;
|
||||
// 数量
|
||||
num: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 购物车搜索条件
|
||||
*/
|
||||
export interface ShopCartParam extends PageParam {
|
||||
userId?: number;
|
||||
}
|
||||
101
src_bak/api/shop/shopChatConversation/index.ts
Normal file
101
src_bak/api/shop/shopChatConversation/index.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopChatConversation, ShopChatConversationParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询聊天会话表
|
||||
*/
|
||||
export async function pageShopChatConversation(params: ShopChatConversationParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopChatConversation>>>(
|
||||
'/shop/shop-chat-conversation/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询聊天会话表列表
|
||||
*/
|
||||
export async function listShopChatConversation(params?: ShopChatConversationParam) {
|
||||
const res = await request.get<ApiResult<ShopChatConversation[]>>(
|
||||
'/shop/shop-chat-conversation',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加聊天会话表
|
||||
*/
|
||||
export async function addShopChatConversation(data: ShopChatConversation) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-chat-conversation',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改聊天会话表
|
||||
*/
|
||||
export async function updateShopChatConversation(data: ShopChatConversation) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-chat-conversation',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除聊天会话表
|
||||
*/
|
||||
export async function removeShopChatConversation(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-chat-conversation/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除聊天会话表
|
||||
*/
|
||||
export async function removeShopBatchChatConversation(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-chat-conversation/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询聊天会话表
|
||||
*/
|
||||
export async function getShopChatConversation(id: number) {
|
||||
const res = await request.get<ApiResult<ShopChatConversation>>(
|
||||
'/shop/shop-chat-conversation/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
37
src_bak/api/shop/shopChatConversation/model/index.ts
Normal file
37
src_bak/api/shop/shopChatConversation/model/index.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 聊天消息表
|
||||
*/
|
||||
export interface ShopChatConversation {
|
||||
// 自增ID
|
||||
id?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 好友ID
|
||||
friendId?: number;
|
||||
// 消息类型
|
||||
type?: number;
|
||||
// 消息内容
|
||||
content?: string;
|
||||
// 未读消息
|
||||
unRead?: number;
|
||||
// 状态, 0未读, 1已读
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 聊天消息表搜索条件
|
||||
*/
|
||||
export interface ShopChatConversationParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
115
src_bak/api/shop/shopChatMessage/index.ts
Normal file
115
src_bak/api/shop/shopChatMessage/index.ts
Normal file
@@ -0,0 +1,115 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopChatMessage, ShopChatMessageParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询聊天消息表
|
||||
*/
|
||||
export async function pageShopChatMessage(params: ShopChatMessageParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopChatMessage>>>(
|
||||
'/shop/shop-chat-message/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询聊天消息表列表
|
||||
*/
|
||||
export async function listShopChatMessage(params?: ShopChatMessageParam) {
|
||||
const res = await request.get<ApiResult<ShopChatMessage[]>>(
|
||||
'/shop/shop-chat-message',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加聊天消息表
|
||||
*/
|
||||
export async function addShopChatMessage(data: ShopChatMessage) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-chat-message',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加聊天消息表
|
||||
*/
|
||||
export async function addShopBatchChatMessage(data: ShopChatMessage[]) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-chat-message/batch',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改聊天消息表
|
||||
*/
|
||||
export async function updateShopChatMessage(data: ShopChatMessage) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-chat-message',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除聊天消息表
|
||||
*/
|
||||
export async function removeShopChatMessage(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-chat-message/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除聊天消息表
|
||||
*/
|
||||
export async function removeShopBatchChatMessage(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-chat-message/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询聊天消息表
|
||||
*/
|
||||
export async function getShopChatMessage(id: number) {
|
||||
const res = await request.get<ApiResult<ShopChatMessage>>(
|
||||
'/shop/shop-chat-message/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
63
src_bak/api/shop/shopChatMessage/model/index.ts
Normal file
63
src_bak/api/shop/shopChatMessage/model/index.ts
Normal file
@@ -0,0 +1,63 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 聊天消息表
|
||||
*/
|
||||
export interface ShopChatMessage {
|
||||
// 自增ID
|
||||
id?: number;
|
||||
// 发送人ID
|
||||
formUserId?: number;
|
||||
// 发送人名称
|
||||
formUserName?: string;
|
||||
// 发送人头像
|
||||
formUserAvatar?: string;
|
||||
// 发送人手机号
|
||||
formUserPhone?: string;
|
||||
// 发送人别名
|
||||
formUserAlias?: string;
|
||||
// 接收人ID
|
||||
toUserId?: number;
|
||||
// 接收人名称
|
||||
toUserName?: string;
|
||||
// 接收人头像
|
||||
toUserAvatar?: string;
|
||||
// 接收人手机号
|
||||
toUserPhone?: string;
|
||||
// 接收人别名
|
||||
toUserAlias?: string;
|
||||
// 消息类型
|
||||
type?: string;
|
||||
// 消息内容
|
||||
content?: string;
|
||||
// 屏蔽接收方
|
||||
sideTo?: number;
|
||||
// 屏蔽发送方
|
||||
sideFrom?: number;
|
||||
// 是否撤回
|
||||
withdraw?: number;
|
||||
// 文件信息
|
||||
fileInfo?: string;
|
||||
// 批量发送
|
||||
toUserIds?: any[];
|
||||
// 存在联系方式
|
||||
hasContact?: number;
|
||||
// 状态, 0未读, 1已读
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 聊天消息表搜索条件
|
||||
*/
|
||||
export interface ShopChatMessageParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
29
src_bak/api/shop/shopCommissionRecord.ts
Normal file
29
src_bak/api/shop/shopCommissionRecord.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
/**
|
||||
* 获取我的佣金记录
|
||||
*/
|
||||
export function getMyCommissionList(params: any) {
|
||||
return request.get('/shop/shop-commission-record/my/list', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取佣金统计
|
||||
*/
|
||||
export function getCommissionStats() {
|
||||
return request.get('/shop/shop-commission-record/my/stats');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取佣金记录列表(管理员)
|
||||
*/
|
||||
export function getCommissionList(params: any) {
|
||||
return request.get('/shop/shop-commission-record/page', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动触发佣金结算(管理员)
|
||||
*/
|
||||
export function settleCommission() {
|
||||
return request.post('/shop/shop-commission-record/settle');
|
||||
}
|
||||
101
src_bak/api/shop/shopCommissionRole/index.ts
Normal file
101
src_bak/api/shop/shopCommissionRole/index.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopCommissionRole, ShopCommissionRoleParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询分红角色
|
||||
*/
|
||||
export async function pageShopCommissionRole(params: ShopCommissionRoleParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopCommissionRole>>>(
|
||||
'/shop/shop-commission-role/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分红角色列表
|
||||
*/
|
||||
export async function listShopCommissionRole(params?: ShopCommissionRoleParam) {
|
||||
const res = await request.get<ApiResult<ShopCommissionRole[]>>(
|
||||
'/shop/shop-commission-role',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加分红角色
|
||||
*/
|
||||
export async function addShopCommissionRole(data: ShopCommissionRole) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-commission-role',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改分红角色
|
||||
*/
|
||||
export async function updateShopCommissionRole(data: ShopCommissionRole) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-commission-role',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分红角色
|
||||
*/
|
||||
export async function removeShopCommissionRole(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-commission-role/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除分红角色
|
||||
*/
|
||||
export async function removeBatchShopCommissionRole(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-commission-role/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询分红角色
|
||||
*/
|
||||
export async function getShopCommissionRole(id: number) {
|
||||
const res = await request.get<ApiResult<ShopCommissionRole>>(
|
||||
'/shop/shop-commission-role/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
35
src_bak/api/shop/shopCommissionRole/model/index.ts
Normal file
35
src_bak/api/shop/shopCommissionRole/model/index.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 分红角色
|
||||
*/
|
||||
export interface ShopCommissionRole {
|
||||
//
|
||||
id?: number;
|
||||
//
|
||||
title?: string;
|
||||
//
|
||||
provinceId?: number;
|
||||
//
|
||||
cityId?: number;
|
||||
//
|
||||
regionId?: number;
|
||||
// 状态, 0正常, 1异常
|
||||
status?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
//
|
||||
sortNumber?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分红角色搜索条件
|
||||
*/
|
||||
export interface ShopCommissionRoleParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
115
src_bak/api/shop/shopCoupon/index.ts
Normal file
115
src_bak/api/shop/shopCoupon/index.ts
Normal file
@@ -0,0 +1,115 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopCoupon, ShopCouponParam, ShopCouponWithTake } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询优惠券
|
||||
*/
|
||||
export async function pageShopCoupon(params: ShopCouponParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopCoupon>>>(
|
||||
'/shop/shop-coupon/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询优惠券列表
|
||||
*/
|
||||
export async function listShopCoupon(params?: ShopCouponParam) {
|
||||
const res = await request.get<ApiResult<ShopCoupon[]>>(
|
||||
'/shop/shop-coupon',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加优惠券
|
||||
*/
|
||||
export async function addShopCoupon(data: ShopCoupon) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-coupon',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改优惠券
|
||||
*/
|
||||
export async function updateShopCoupon(data: ShopCoupon) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-coupon',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除优惠券
|
||||
*/
|
||||
export async function removeShopCoupon(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-coupon/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除优惠券
|
||||
*/
|
||||
export async function removeBatchShopCoupon(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-coupon/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询优惠券
|
||||
*/
|
||||
export async function getShopCoupon(id: number) {
|
||||
const res = await request.get<ApiResult<ShopCoupon>>(
|
||||
'/shop/shop-coupon/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 领券中心-查询可领取优惠券列表(含是否已领取状态)
|
||||
*/
|
||||
export async function listCouponCenter(params?: ShopCouponParam) {
|
||||
const res = await request.post<ApiResult<ShopCouponWithTake[]>>(
|
||||
'/shop/shop-coupon/list',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
97
src_bak/api/shop/shopCoupon/model/index.ts
Normal file
97
src_bak/api/shop/shopCoupon/model/index.ts
Normal file
@@ -0,0 +1,97 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 优惠券
|
||||
*/
|
||||
export interface ShopCoupon {
|
||||
// id
|
||||
id?: number;
|
||||
// 优惠券名称
|
||||
name?: string;
|
||||
// 优惠券描述
|
||||
description?: string;
|
||||
// 优惠券类型(10满减券 20折扣券 30免费券 40无门槛券 50场地使用券)
|
||||
type?: number;
|
||||
// 满减券-减免金额
|
||||
reducePrice?: string;
|
||||
// 折扣券-折扣率(0-100)
|
||||
discount?: number;
|
||||
// 最低消费金额
|
||||
minPrice?: string;
|
||||
// 到期类型(10领取后生效 20固定时间)
|
||||
expireType?: number;
|
||||
// 领取后生效-有效天数
|
||||
expireDay?: number;
|
||||
// 有效期开始时间
|
||||
startTime?: string;
|
||||
// 有效期结束时间
|
||||
endTime?: string;
|
||||
// 适用范围(10全部商品 20指定商品 30指定分类)
|
||||
applyRange?: number;
|
||||
// 适用范围配置(json格式)
|
||||
applyRangeConfig?: string;
|
||||
// 是否过期(0未过期 1已过期)
|
||||
isExpire?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 状态, 0正常, 1禁用
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 创建用户ID
|
||||
userId?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
// 发放总数量(-1表示无限制)
|
||||
totalCount?: number;
|
||||
// 已发放数量
|
||||
issuedCount?: number;
|
||||
// 每人限领数量(-1表示无限制)
|
||||
limitPerUser?: number;
|
||||
// 是否启用(0禁用 1启用)
|
||||
enabled?: string;
|
||||
// 发放对象(0全部用户 1仅会员 2仅非会员 3指定用户)
|
||||
receiveTarget?: number;
|
||||
// 指定用户ID列表(JSON数组格式),receiveTarget=3时使用
|
||||
receiveUserIds?: string;
|
||||
// 场地使用券-场地类型
|
||||
venueType?: number;
|
||||
// 场地使用券-指定场地ID
|
||||
venueId?: number;
|
||||
// 场地使用券-可用次数(-1表示无限制)
|
||||
useCount?: number;
|
||||
// 场地使用券-使用时长(分钟)
|
||||
useDuration?: number;
|
||||
sortBy?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 优惠券搜索条件
|
||||
*/
|
||||
export interface ShopCouponParam extends PageParam {
|
||||
id?: number;
|
||||
status?: number;
|
||||
isExpire?: number;
|
||||
sortBy?: string;
|
||||
sortOrder?: 'asc' | 'desc';
|
||||
keywords?: string;
|
||||
enabled?: number;
|
||||
type?: number;
|
||||
minAmount?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 领券中心优惠券(含是否已领取)
|
||||
*/
|
||||
export interface ShopCouponWithTake extends ShopCoupon {
|
||||
// 是否已领取
|
||||
hasTake?: boolean;
|
||||
// 用户已领取数量
|
||||
userTakeNum?: number;
|
||||
// 用户已使用数量
|
||||
userUseNum?: number;
|
||||
}
|
||||
17
src_bak/api/shop/shopCustomerService/index.ts
Normal file
17
src_bak/api/shop/shopCustomerService/index.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import request from '@/utils/request'
|
||||
import type { CustomerServiceInfo } from './model'
|
||||
|
||||
/** 获取客服信息 */
|
||||
export function getCustomerServiceInfo() {
|
||||
return request.post<CustomerServiceInfo>('/shopCustomerService/getInfo', {})
|
||||
}
|
||||
|
||||
/** 发送消息 */
|
||||
export function sendMessage(data: { content: string; type: 'text' | 'image' }) {
|
||||
return request.post<{ success: boolean }>('/shopCustomerService/sendMessage', data)
|
||||
}
|
||||
|
||||
/** 获取聊天记录 */
|
||||
export function getChatHistory(params: { page?: number; pageSize?: number } = {}) {
|
||||
return request.post<{ items: any[]; total: number }>('/shopCustomerService/getHistory', params)
|
||||
}
|
||||
26
src_bak/api/shop/shopCustomerService/model.ts
Normal file
26
src_bak/api/shop/shopCustomerService/model.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
/** 客服消息 */
|
||||
export interface CustomerServiceMessage {
|
||||
id: number
|
||||
userId: number
|
||||
content: string
|
||||
type: 'text' | 'image'
|
||||
isFromUser: boolean
|
||||
createTime: string
|
||||
}
|
||||
|
||||
/** 客服会话 */
|
||||
export interface CustomerServiceSession {
|
||||
id: number
|
||||
userId: number
|
||||
status: number
|
||||
createTime: string
|
||||
messages?: CustomerServiceMessage[]
|
||||
}
|
||||
|
||||
/** 客服信息 */
|
||||
export interface CustomerServiceInfo {
|
||||
online: boolean
|
||||
onlineHours: string
|
||||
hotline: string
|
||||
wechat: string
|
||||
}
|
||||
155
src_bak/api/shop/shopDealerApply/index.ts
Normal file
155
src_bak/api/shop/shopDealerApply/index.ts
Normal file
@@ -0,0 +1,155 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopDealerApply, ShopDealerApplyParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询分销商申请记录表
|
||||
*/
|
||||
export async function pageShopDealerApply(params: ShopDealerApplyParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopDealerApply>>>(
|
||||
'/shop/shop-dealer-apply/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分销商申请记录表列表
|
||||
*/
|
||||
export async function listShopDealerApply(params?: ShopDealerApplyParam) {
|
||||
const res = await request.get<ApiResult<ShopDealerApply[]>>(
|
||||
'/shop/shop-dealer-apply',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加分销商申请记录表
|
||||
*/
|
||||
export async function addShopDealerApply(data: ShopDealerApply) {
|
||||
try {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-apply',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message || '提交成功';
|
||||
}
|
||||
// 直接抛出包含服务器错误信息的错误
|
||||
const error = new Error(res.message || '提交失败');
|
||||
(error as any).code = res.code;
|
||||
(error as any).data = res.data;
|
||||
throw error;
|
||||
} catch (error: any) {
|
||||
// 如果已经是我们处理过的错误,直接抛出
|
||||
if (error.message && error.code !== undefined) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
// 处理网络错误或其他异常
|
||||
console.error('添加分销商申请失败:', error);
|
||||
|
||||
// 尝试从响应中提取错误信息
|
||||
if (error.response?.data) {
|
||||
const responseData = error.response.data;
|
||||
if (responseData.message) {
|
||||
const newError = new Error(responseData.message);
|
||||
(newError as any).code = responseData.code;
|
||||
throw newError;
|
||||
}
|
||||
}
|
||||
|
||||
// 默认错误处理
|
||||
throw new Error(error.message || '网络错误,请重试');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改分销商申请记录表
|
||||
*/
|
||||
export async function updateShopDealerApply(data: ShopDealerApply) {
|
||||
try {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-apply',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message || '修改成功';
|
||||
}
|
||||
// 直接抛出包含服务器错误信息的错误
|
||||
const error = new Error(res.message || '修改失败');
|
||||
(error as any).code = res.code;
|
||||
(error as any).data = res.data;
|
||||
throw error;
|
||||
} catch (error: any) {
|
||||
// 如果已经是我们处理过的错误,直接抛出
|
||||
if (error.message && error.code !== undefined) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
// 处理网络错误或其他异常
|
||||
console.error('修改分销商申请失败:', error);
|
||||
|
||||
// 尝试从响应中提取错误信息
|
||||
if (error.response?.data) {
|
||||
const responseData = error.response.data;
|
||||
if (responseData.message) {
|
||||
const newError = new Error(responseData.message);
|
||||
(newError as any).code = responseData.code;
|
||||
throw newError;
|
||||
}
|
||||
}
|
||||
|
||||
// 默认错误处理
|
||||
throw new Error(error.message || '网络错误,请重试');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分销商申请记录表
|
||||
*/
|
||||
export async function removeShopDealerApply(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-apply/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除分销商申请记录表
|
||||
*/
|
||||
export async function removeBatchShopDealerApply(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-apply/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询分销商申请记录表
|
||||
*/
|
||||
export async function getShopDealerApply(id: number) {
|
||||
const res = await request.get<ApiResult<ShopDealerApply>>(
|
||||
'/shop/shop-dealer-apply/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
43
src_bak/api/shop/shopDealerApply/model/index.ts
Normal file
43
src_bak/api/shop/shopDealerApply/model/index.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 分销商申请记录表
|
||||
*/
|
||||
export interface ShopDealerApply {
|
||||
// 主键ID
|
||||
applyId?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 姓名
|
||||
realName?: string;
|
||||
// 手机号
|
||||
mobile?: string;
|
||||
// 推荐人用户ID
|
||||
refereeId?: number;
|
||||
// 申请方式(10需后台审核 20无需审核)
|
||||
applyType?: number;
|
||||
// 申请时间
|
||||
applyTime?: number;
|
||||
// 审核状态 (10待审核 20审核通过 30驳回)
|
||||
applyStatus?: number;
|
||||
// 审核时间
|
||||
auditTime?: number;
|
||||
// 驳回原因
|
||||
rejectReason?: string;
|
||||
// 商城ID
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销商申请记录表搜索条件
|
||||
*/
|
||||
export interface ShopDealerApplyParam extends PageParam {
|
||||
applyId?: number;
|
||||
mobile?: string;
|
||||
userId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
101
src_bak/api/shop/shopDealerCapital/index.ts
Normal file
101
src_bak/api/shop/shopDealerCapital/index.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopDealerCapital, ShopDealerCapitalParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询分销商资金明细表
|
||||
*/
|
||||
export async function pageShopDealerCapital(params: ShopDealerCapitalParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopDealerCapital>>>(
|
||||
'/shop/shop-dealer-capital/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分销商资金明细表列表
|
||||
*/
|
||||
export async function listShopDealerCapital(params?: ShopDealerCapitalParam) {
|
||||
const res = await request.get<ApiResult<ShopDealerCapital[]>>(
|
||||
'/shop/shop-dealer-capital',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加分销商资金明细表
|
||||
*/
|
||||
export async function addShopDealerCapital(data: ShopDealerCapital) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-capital',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改分销商资金明细表
|
||||
*/
|
||||
export async function updateShopDealerCapital(data: ShopDealerCapital) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-capital',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分销商资金明细表
|
||||
*/
|
||||
export async function removeShopDealerCapital(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-capital/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除分销商资金明细表
|
||||
*/
|
||||
export async function removeBatchShopDealerCapital(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-capital/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询分销商资金明细表
|
||||
*/
|
||||
export async function getShopDealerCapital(id: number) {
|
||||
const res = await request.get<ApiResult<ShopDealerCapital>>(
|
||||
'/shop/shop-dealer-capital/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
109
src_bak/api/shop/shopDealerCapital/model.ts
Normal file
109
src_bak/api/shop/shopDealerCapital/model.ts
Normal file
@@ -0,0 +1,109 @@
|
||||
/**
|
||||
* 分销商资金明细表
|
||||
*/
|
||||
export interface ShopDealerCapital {
|
||||
/** 主键ID */
|
||||
id?: number;
|
||||
/** 分销商用户ID */
|
||||
userId?: number;
|
||||
/** 分销商昵称 */
|
||||
nickName?: string;
|
||||
/** 订单编号 */
|
||||
orderNo?: string;
|
||||
/** 订单状态 */
|
||||
orderStatus?: number;
|
||||
/** 资金流动类型 (10佣金收入 20提现支出 30转账支出 40转账收入 50佣金解冻 60配送奖励) */
|
||||
flowType?: number;
|
||||
/** 金额 */
|
||||
money?: number;
|
||||
/** 描述 */
|
||||
comments?: string;
|
||||
/** 对方用户ID */
|
||||
toUserId?: number;
|
||||
/** 对方昵称 */
|
||||
toNickName?: string;
|
||||
/** 结算月份 */
|
||||
month?: string;
|
||||
/** 商城ID */
|
||||
tenantId?: number;
|
||||
/** 创建时间 */
|
||||
createTime?: string;
|
||||
/** 修改时间 */
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销商资金明细表查询参数
|
||||
*/
|
||||
export interface ShopDealerCapitalParam {
|
||||
/** 主键ID */
|
||||
id?: number;
|
||||
/** 分销商用户ID */
|
||||
userId?: number;
|
||||
/** 订单编号 */
|
||||
orderNo?: string;
|
||||
/** 资金流动类型 (10佣金收入 20提现支出 30转账支出 40转账收入 50佣金解冻) */
|
||||
flowType?: number;
|
||||
/** 金额 */
|
||||
money?: number;
|
||||
/** 描述 */
|
||||
comments?: string;
|
||||
/** 对方用户ID */
|
||||
toUserId?: number;
|
||||
/** 月份 */
|
||||
month?: string;
|
||||
/** 第几页 */
|
||||
page?: number;
|
||||
/** 每页多少条 */
|
||||
limit?: number;
|
||||
/** 排序字段 */
|
||||
sort?: string;
|
||||
/** 排序方式, asc升序, desc降序 */
|
||||
order?: string;
|
||||
/** 起始时间 */
|
||||
createTimeStart?: string;
|
||||
/** 结束时间 */
|
||||
createTimeEnd?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 资金流动类型枚举
|
||||
*/
|
||||
export enum FlowTypeEnum {
|
||||
/** 佣金收入 */
|
||||
COMMISSION_INCOME = 10,
|
||||
/** 提现支出 */
|
||||
WITHDRAW_OUT = 20,
|
||||
/** 转账支出 */
|
||||
TRANSFER_OUT = 30,
|
||||
/** 转账收入 */
|
||||
TRANSFER_IN = 40,
|
||||
/** 佣金解冻 */
|
||||
COMMISSION_UNFREEZE = 50,
|
||||
/** 配送奖励 */
|
||||
DELIVERY_REWARD = 60,
|
||||
}
|
||||
|
||||
/**
|
||||
* 返利记录类型
|
||||
*/
|
||||
export type RebateRecordType = 'register' | 'order';
|
||||
|
||||
/**
|
||||
* 返利记录状态
|
||||
*/
|
||||
export type RebateRecordStatus = 'pending' | 'settled';
|
||||
|
||||
/**
|
||||
* 返利记录(前端展示用)
|
||||
*/
|
||||
export interface RebateRecord {
|
||||
id: number;
|
||||
type: RebateRecordType;
|
||||
title: string;
|
||||
amount: number;
|
||||
status: RebateRecordStatus;
|
||||
date: string;
|
||||
orderNo?: string;
|
||||
comments?: string;
|
||||
}
|
||||
41
src_bak/api/shop/shopDealerCapital/model/index.ts
Normal file
41
src_bak/api/shop/shopDealerCapital/model/index.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 分销商资金明细表
|
||||
*/
|
||||
export interface ShopDealerCapital {
|
||||
// 主键ID
|
||||
id?: number;
|
||||
// 分销商用户ID
|
||||
userId?: number;
|
||||
// 订单ID
|
||||
orderId?: number;
|
||||
// 资金流动类型 (10佣金收入 20提现支出 30转账支出 40转账收入)
|
||||
flowType?: number;
|
||||
// 金额
|
||||
money?: string;
|
||||
// 描述
|
||||
describe?: string;
|
||||
// 对方用户ID
|
||||
toUserId?: number;
|
||||
// 商城ID
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销商资金明细表搜索条件
|
||||
*/
|
||||
export interface ShopDealerCapitalParam extends PageParam {
|
||||
id?: number;
|
||||
// 仅查询当前分销商的收益/资金明细
|
||||
userId?: number;
|
||||
// 可选:按订单过滤
|
||||
orderId?: number;
|
||||
// 可选:资金流动类型过滤
|
||||
flowType?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
101
src_bak/api/shop/shopDealerOrder/index.ts
Normal file
101
src_bak/api/shop/shopDealerOrder/index.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopDealerOrder, ShopDealerOrderParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询分销商订单记录表
|
||||
*/
|
||||
export async function pageShopDealerOrder(params: ShopDealerOrderParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopDealerOrder>>>(
|
||||
'/shop/shop-dealer-order/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分销商订单记录表列表
|
||||
*/
|
||||
export async function listShopDealerOrder(params?: ShopDealerOrderParam) {
|
||||
const res = await request.get<ApiResult<ShopDealerOrder[]>>(
|
||||
'/shop/shop-dealer-order',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加分销商订单记录表
|
||||
*/
|
||||
export async function addShopDealerOrder(data: ShopDealerOrder) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-order',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改分销商订单记录表
|
||||
*/
|
||||
export async function updateShopDealerOrder(data: ShopDealerOrder) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-order',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分销商订单记录表
|
||||
*/
|
||||
export async function removeShopDealerOrder(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-order/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除分销商订单记录表
|
||||
*/
|
||||
export async function removeBatchShopDealerOrder(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-order/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询分销商订单记录表
|
||||
*/
|
||||
export async function getShopDealerOrder(id: number) {
|
||||
const res = await request.get<ApiResult<ShopDealerOrder>>(
|
||||
'/shop/shop-dealer-order/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
60
src_bak/api/shop/shopDealerOrder/model/index.ts
Normal file
60
src_bak/api/shop/shopDealerOrder/model/index.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 分销商订单记录表
|
||||
*/
|
||||
export interface ShopDealerOrder {
|
||||
// 主键ID
|
||||
id?: number;
|
||||
// 买家用户ID
|
||||
userId?: number;
|
||||
nickname?: string;
|
||||
// 订单编号(部分接口会直接返回订单号字符串)
|
||||
orderNo?: string;
|
||||
// 订单ID
|
||||
orderId?: number;
|
||||
// 订单总金额(不含运费)
|
||||
orderPrice?: string;
|
||||
// 分销商用户id(一级)
|
||||
firstUserId?: number;
|
||||
// 分销商用户id(二级)
|
||||
secondUserId?: number;
|
||||
// 分销商用户id(三级)
|
||||
thirdUserId?: number;
|
||||
// 分销佣金(一级)
|
||||
firstMoney?: string;
|
||||
// 分销佣金(二级)
|
||||
secondMoney?: string;
|
||||
// 分销佣金(三级)
|
||||
thirdMoney?: string;
|
||||
// 订单是否失效(0未失效 1已失效)
|
||||
isInvalid?: number;
|
||||
// 佣金结算(0未结算 1已结算)
|
||||
isSettled?: number;
|
||||
// 佣金解冻(0未解冻 1已解冻)
|
||||
isUnfreeze?: number;
|
||||
// 订单状态
|
||||
orderStatus?: number;
|
||||
// 结算时间
|
||||
settleTime?: number;
|
||||
// 商城ID
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销商订单记录表搜索条件
|
||||
*/
|
||||
export interface ShopDealerOrderParam extends PageParam {
|
||||
id?: number;
|
||||
firstUserId?: number;
|
||||
secondUserId?: number;
|
||||
thirdUserId?: number;
|
||||
userId?: number;
|
||||
// 数据权限/资源ID(通常传当前登录用户ID)
|
||||
resourceId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
101
src_bak/api/shop/shopDealerReferee/index.ts
Normal file
101
src_bak/api/shop/shopDealerReferee/index.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopDealerReferee, ShopDealerRefereeParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询分销商推荐关系表
|
||||
*/
|
||||
export async function pageShopDealerReferee(params: ShopDealerRefereeParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopDealerReferee>>>(
|
||||
'/shop/shop-dealer-referee/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分销商推荐关系表列表
|
||||
*/
|
||||
export async function listShopDealerReferee(params?: ShopDealerRefereeParam) {
|
||||
const res = await request.get<ApiResult<ShopDealerReferee[]>>(
|
||||
'/shop/shop-dealer-referee',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加分销商推荐关系表
|
||||
*/
|
||||
export async function addShopDealerReferee(data: ShopDealerReferee) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-referee',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改分销商推荐关系表
|
||||
*/
|
||||
export async function updateShopDealerReferee(data: ShopDealerReferee) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-referee',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分销商推荐关系表
|
||||
*/
|
||||
export async function removeShopDealerReferee(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-referee/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除分销商推荐关系表
|
||||
*/
|
||||
export async function removeBatchShopDealerReferee(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-referee/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询分销商推荐关系表
|
||||
*/
|
||||
export async function getShopDealerReferee(id: number) {
|
||||
const res = await request.get<ApiResult<ShopDealerReferee>>(
|
||||
'/shop/shop-dealer-referee/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
31
src_bak/api/shop/shopDealerReferee/model/index.ts
Normal file
31
src_bak/api/shop/shopDealerReferee/model/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 分销商推荐关系表
|
||||
*/
|
||||
export interface ShopDealerReferee {
|
||||
// 主键ID
|
||||
id?: number;
|
||||
// 分销商用户ID
|
||||
dealerId?: number;
|
||||
// 用户id(被推荐人)
|
||||
userId?: number;
|
||||
// 推荐关系层级(1,2,3)
|
||||
level?: number;
|
||||
// 商城ID
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销商推荐关系表搜索条件
|
||||
*/
|
||||
export interface ShopDealerRefereeParam extends PageParam {
|
||||
id?: number;
|
||||
dealerId?: number;
|
||||
keywords?: string;
|
||||
deleted?: number;
|
||||
}
|
||||
101
src_bak/api/shop/shopDealerSetting/index.ts
Normal file
101
src_bak/api/shop/shopDealerSetting/index.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopDealerSetting, ShopDealerSettingParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询分销商设置表
|
||||
*/
|
||||
export async function pageShopDealerSetting(params: ShopDealerSettingParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopDealerSetting>>>(
|
||||
'/shop/shop-dealer-setting/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分销商设置表列表
|
||||
*/
|
||||
export async function listShopDealerSetting(params?: ShopDealerSettingParam) {
|
||||
const res = await request.get<ApiResult<ShopDealerSetting[]>>(
|
||||
'/shop/shop-dealer-setting',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加分销商设置表
|
||||
*/
|
||||
export async function addShopDealerSetting(data: ShopDealerSetting) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-setting',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改分销商设置表
|
||||
*/
|
||||
export async function updateShopDealerSetting(data: ShopDealerSetting) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-setting',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分销商设置表
|
||||
*/
|
||||
export async function removeShopDealerSetting(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-setting/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除分销商设置表
|
||||
*/
|
||||
export async function removeBatchShopDealerSetting(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-setting/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询分销商设置表
|
||||
*/
|
||||
export async function getShopDealerSetting(id: number) {
|
||||
const res = await request.get<ApiResult<ShopDealerSetting>>(
|
||||
'/shop/shop-dealer-setting/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
25
src_bak/api/shop/shopDealerSetting/model/index.ts
Normal file
25
src_bak/api/shop/shopDealerSetting/model/index.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 分销商设置表
|
||||
*/
|
||||
export interface ShopDealerSetting {
|
||||
// 设置项标示
|
||||
key?: string;
|
||||
// 设置项描述
|
||||
describe?: string;
|
||||
// 设置内容(json格式)
|
||||
values?: string;
|
||||
// 商城ID
|
||||
tenantId?: number;
|
||||
// 更新时间
|
||||
updateTime?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销商设置表搜索条件
|
||||
*/
|
||||
export interface ShopDealerSettingParam extends PageParam {
|
||||
key?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
103
src_bak/api/shop/shopDealerUser/index.ts
Normal file
103
src_bak/api/shop/shopDealerUser/index.ts
Normal file
@@ -0,0 +1,103 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopDealerUser, ShopDealerUserParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询分销商用户记录表
|
||||
*/
|
||||
export async function pageShopDealerUser(params: ShopDealerUserParam) {
|
||||
// 使用新的request方法,它会自动处理错误并返回完整的ApiResult
|
||||
const res = await request.get<ApiResult<PageResult<ShopDealerUser>>>(
|
||||
'/shop/shop-dealer-user/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分销商用户记录表列表
|
||||
*/
|
||||
export async function listShopDealerUser(params?: ShopDealerUserParam) {
|
||||
const res = await request.get<ApiResult<ShopDealerUser[]>>(
|
||||
'/shop/shop-dealer-user',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加分销商用户记录表
|
||||
*/
|
||||
export async function addShopDealerUser(data: ShopDealerUser) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-user',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改分销商用户记录表
|
||||
*/
|
||||
export async function updateShopDealerUser(data: ShopDealerUser) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-user',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分销商用户记录表
|
||||
*/
|
||||
export async function removeShopDealerUser(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-user/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除分销商用户记录表
|
||||
*/
|
||||
export async function removeBatchShopDealerUser(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-user/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据userId查询分销商用户记录表
|
||||
*/
|
||||
export async function getShopDealerUser(userId: number) {
|
||||
const res = await request.get<ApiResult<ShopDealerUser>>(
|
||||
'/shop/shop-dealer-user/' + userId
|
||||
);
|
||||
if (res.code === 0) {
|
||||
// 未注册为分销商时,后端可能返回 data=null,这里用 null 表示“没有分销商信息”
|
||||
return res.data || null;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
53
src_bak/api/shop/shopDealerUser/model/index.ts
Normal file
53
src_bak/api/shop/shopDealerUser/model/index.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 分销商用户记录表
|
||||
*/
|
||||
export interface ShopDealerUser {
|
||||
// 主键ID
|
||||
id?: number;
|
||||
// 自增ID
|
||||
userId?: number;
|
||||
// 姓名
|
||||
realName?: string;
|
||||
// 手机号
|
||||
mobile?: string;
|
||||
// 支付密码
|
||||
payPassword?: string;
|
||||
// 当前可提现佣金
|
||||
money?: string;
|
||||
// 已冻结佣金
|
||||
freezeMoney?: string;
|
||||
// 累积提现佣金
|
||||
totalMoney?: string;
|
||||
// 推荐人用户ID
|
||||
refereeId?: number;
|
||||
// 成员数量(一级)
|
||||
firstNum?: number;
|
||||
// 成员数量(二级)
|
||||
secondNum?: number;
|
||||
// 成员数量(三级)
|
||||
thirdNum?: number;
|
||||
// 专属二维码
|
||||
qrcode?: string;
|
||||
// 是否删除
|
||||
isDelete?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
// 分销商等级:0-普通用户 1-超级管理员 2-合伙人(总店) 3-合伙人(分店)
|
||||
dealerLevel?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销商用户记录表搜索条件
|
||||
*/
|
||||
export interface ShopDealerUserParam extends PageParam {
|
||||
id?: number;
|
||||
phone?: string;
|
||||
userId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
145
src_bak/api/shop/shopDealerWithdraw/index.ts
Normal file
145
src_bak/api/shop/shopDealerWithdraw/index.ts
Normal file
@@ -0,0 +1,145 @@
|
||||
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));
|
||||
}
|
||||
48
src_bak/api/shop/shopDealerWithdraw/model/index.ts
Normal file
48
src_bak/api/shop/shopDealerWithdraw/model/index.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 分销商提现明细表
|
||||
*/
|
||||
export interface ShopDealerWithdraw {
|
||||
// 主键ID
|
||||
id?: number;
|
||||
// 分销商用户ID
|
||||
userId?: number;
|
||||
// 提现金额
|
||||
money?: string;
|
||||
// 打款方式 (10微信 20支付宝 30银行卡)
|
||||
payType?: number;
|
||||
// 支付宝姓名
|
||||
alipayName?: string;
|
||||
// 支付宝账号
|
||||
alipayAccount?: string;
|
||||
// 开户行名称
|
||||
bankName?: string;
|
||||
// 银行开户名
|
||||
bankAccount?: string;
|
||||
// 银行卡号
|
||||
bankCard?: string;
|
||||
// 申请状态 (10待审核 20审核通过 30驳回 40已打款)
|
||||
applyStatus?: number;
|
||||
// 审核时间
|
||||
auditTime?: number;
|
||||
// 驳回原因
|
||||
rejectReason?: string;
|
||||
// 来源客户端(APP、H5、小程序等)
|
||||
platform?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销商提现明细表搜索条件
|
||||
*/
|
||||
export interface ShopDealerWithdrawParam extends PageParam {
|
||||
id?: number;
|
||||
userId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
119
src_bak/api/shop/shopEvaluation/index.ts
Normal file
119
src_bak/api/shop/shopEvaluation/index.ts
Normal file
@@ -0,0 +1,119 @@
|
||||
import request from '@/utils/request'
|
||||
import type { ApiResult, PageResult } from '@/api'
|
||||
import type {
|
||||
ShopEvaluation,
|
||||
ShopEvaluationParam,
|
||||
CreateEvaluationParams,
|
||||
LikeEvaluationParams,
|
||||
EvaluationStats,
|
||||
} from './model'
|
||||
|
||||
/**
|
||||
* 分页查询评价
|
||||
*/
|
||||
export async function pageShopEvaluation(params: ShopEvaluationParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopEvaluation>>>(
|
||||
'/shop/shop-evaluation/page',
|
||||
params
|
||||
)
|
||||
if (res.code === 0) {
|
||||
return res.data
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询评价列表
|
||||
*/
|
||||
export async function listShopEvaluation(params?: ShopEvaluationParam) {
|
||||
const res = await request.get<ApiResult<ShopEvaluation[]>>(
|
||||
'/shop/shop-evaluation',
|
||||
params
|
||||
)
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID查询评价
|
||||
*/
|
||||
export async function getShopEvaluation(id: number) {
|
||||
const res = await request.get<ApiResult<ShopEvaluation>>(
|
||||
'/shop/shop-evaluation/' + id
|
||||
)
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建评价
|
||||
*/
|
||||
export async function createShopEvaluation(data: CreateEvaluationParams) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-evaluation',
|
||||
data
|
||||
)
|
||||
if (res.code === 0) {
|
||||
return res.message
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除评价
|
||||
*/
|
||||
export async function removeShopEvaluation(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-evaluation/' + id
|
||||
)
|
||||
if (res.code === 0) {
|
||||
return res.message
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 点赞/取消点赞评价
|
||||
*/
|
||||
export async function likeShopEvaluation(params: LikeEvaluationParams) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-evaluation/like',
|
||||
params
|
||||
)
|
||||
if (res.code === 0) {
|
||||
return res.message
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取商品评价统计
|
||||
*/
|
||||
export async function getEvaluationStats(goodsId: number) {
|
||||
const res = await request.get<ApiResult<EvaluationStats>>(
|
||||
'/shop/shop-evaluation/stats',
|
||||
{ goodsId }
|
||||
)
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单的评价信息(用于判断是否已评价)
|
||||
*/
|
||||
export async function getOrderEvaluationStatus(orderId: number) {
|
||||
const res = await request.get<ApiResult<{ evaluated: boolean; evaluationId?: number }>>(
|
||||
'/shop/shop-evaluation/order-status',
|
||||
{ orderId }
|
||||
)
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
77
src_bak/api/shop/shopEvaluation/model/index.ts
Normal file
77
src_bak/api/shop/shopEvaluation/model/index.ts
Normal file
@@ -0,0 +1,77 @@
|
||||
/**
|
||||
* 商品评价模型
|
||||
*/
|
||||
|
||||
// 评价维度
|
||||
export interface EvaluationDimension {
|
||||
name: string // 维度名称(如:质量、服务、物流)
|
||||
score: number // 维度评分(1-5)
|
||||
}
|
||||
|
||||
// 评价数据
|
||||
export interface ShopEvaluation {
|
||||
id: number
|
||||
goodsId: number // 商品ID
|
||||
goodsName: string // 商品名称
|
||||
goodsImage: string // 商品图片
|
||||
orderId: number // 订单ID
|
||||
userId: number // 用户ID
|
||||
userName: string // 用户名(脱敏)
|
||||
userAvatar?: string // 用户头像
|
||||
score: number // 总评分(1-5)
|
||||
dimensions?: EvaluationDimension[] // 评价维度
|
||||
content: string // 评价内容
|
||||
images: string[] // 评价图片
|
||||
isAnonymous: boolean // 是否匿名
|
||||
likes: number // 点赞数
|
||||
isLiked: boolean // 当前用户是否点赞
|
||||
reply?: string // 商家回复
|
||||
replyTime?: string // 回复时间
|
||||
createTime: string // 评价时间
|
||||
updateTime?: string // 更新时间
|
||||
}
|
||||
|
||||
// 评价查询参数
|
||||
export interface ShopEvaluationParam {
|
||||
page?: number
|
||||
limit?: number
|
||||
goodsId?: number // 按商品查询
|
||||
userId?: number // 按用户查询
|
||||
orderId?: number // 按订单查询
|
||||
minScore?: number // 最低评分
|
||||
maxScore?: number // 最高评分
|
||||
hasImages?: boolean // 是否有图
|
||||
isLiked?: boolean // 是否点赞过
|
||||
sortBy?: string // 排序方式(newest, mostLiked)
|
||||
keywords?: string // 关键词搜索
|
||||
}
|
||||
|
||||
// 创建评价参数
|
||||
export interface CreateEvaluationParams {
|
||||
orderId: number
|
||||
goodsId: number
|
||||
score: number
|
||||
dimensions?: EvaluationDimension[]
|
||||
content: string
|
||||
images?: string[]
|
||||
isAnonymous: boolean
|
||||
}
|
||||
|
||||
// 点赞/取消点赞参数
|
||||
export interface LikeEvaluationParams {
|
||||
evaluationId: number
|
||||
isLiked: boolean
|
||||
}
|
||||
|
||||
// 评价统计
|
||||
export interface EvaluationStats {
|
||||
total: number // 总评价数
|
||||
averageScore: number // 平均评分
|
||||
scoreDistribution: { // 评分分布
|
||||
[key: number]: number
|
||||
}
|
||||
imageCount: number // 有图评价数
|
||||
positiveCount: number // 好评数(4-5星)
|
||||
neutralCount: number // 中评数(3星)
|
||||
negativeCount: number // 差评数(1-2星)
|
||||
}
|
||||
80
src_bak/api/shop/shopEvent/index.ts
Normal file
80
src_bak/api/shop/shopEvent/index.ts
Normal file
@@ -0,0 +1,80 @@
|
||||
import request from '@/utils/request'
|
||||
import type { ApiResult, PageResult } from '@/api'
|
||||
import type {
|
||||
ShopEvent,
|
||||
ShopEventParam,
|
||||
EventRegisterParams,
|
||||
EventRegistration,
|
||||
RegistrationStatus,
|
||||
} from './model'
|
||||
|
||||
export type { ShopEvent, EventRegistration, RegistrationStatus, EventStatus, EventFormField } from './model'
|
||||
export { getEventStatusLabel, getPayStatusLabel } from './model'
|
||||
|
||||
/**
|
||||
* 分页查询赛事
|
||||
*/
|
||||
export async function pageShopEvent(params: ShopEventParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopEvent>>>(
|
||||
'/shop/shop-event/page',
|
||||
params
|
||||
)
|
||||
if (res.code === 0 && res.data) return res.data
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 赛事详情
|
||||
*/
|
||||
export async function getShopEvent(id: number) {
|
||||
const res = await request.get<ApiResult<ShopEvent>>(`/shop/shop-event/${id}`)
|
||||
if (res.code === 0 && res.data) return res.data
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交报名(免费返回 {success,free},收费返回微信支付参数)
|
||||
*/
|
||||
export async function registerEvent(data: EventRegisterParams) {
|
||||
const res = await request.post<ApiResult<Record<string, any>>>(
|
||||
'/shop/shop-event/register',
|
||||
data
|
||||
)
|
||||
if (res.code === 0 && res.data) return res.data
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 重新发起支付
|
||||
*/
|
||||
export async function payEventRegistration(registrationId: number) {
|
||||
const res = await request.post<ApiResult<Record<string, string>>>(
|
||||
'/shop/shop-event/pay',
|
||||
{ registrationId }
|
||||
)
|
||||
if (res.code === 0 && res.data) return res.data
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询报名状态
|
||||
*/
|
||||
export async function getRegistrationStatus(eventId: number) {
|
||||
const res = await request.get<ApiResult<RegistrationStatus>>(
|
||||
'/shop/shop-event/registration-status',
|
||||
{ eventId }
|
||||
)
|
||||
if (res.code === 0 && res.data) return res.data
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的报名记录
|
||||
*/
|
||||
export async function getMyRegistrations() {
|
||||
const res = await request.get<ApiResult<EventRegistration[]>>(
|
||||
'/shop/shop-event/my-registrations'
|
||||
)
|
||||
if (res.code === 0 && res.data) return res.data
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
96
src_bak/api/shop/shopEvent/model/index.ts
Normal file
96
src_bak/api/shop/shopEvent/model/index.ts
Normal file
@@ -0,0 +1,96 @@
|
||||
/**
|
||||
* 赛事模型
|
||||
*/
|
||||
|
||||
export type EventStatus = 'upcoming' | 'registering' | 'closed' | 'ended'
|
||||
|
||||
/** 动态报名表单字段配置 */
|
||||
export interface EventFormField {
|
||||
/** 字段唯一标识 */
|
||||
key: string
|
||||
/** 显示名称(后台可自定义) */
|
||||
label: string
|
||||
/** 字段类型:text-文本 number-数字 idcard-身份证 phone-手机号 select-下拉选择 radio-单选 */
|
||||
type: 'text' | 'number' | 'idcard' | 'phone' | 'select' | 'radio'
|
||||
/** 是否必填 1=必填 0=选填 */
|
||||
required: number
|
||||
/** 选项列表(type=select/radio时有效) */
|
||||
options?: string[]
|
||||
/** 占位提示文字 */
|
||||
placeholder?: string
|
||||
/** 排序号 */
|
||||
sort: number
|
||||
}
|
||||
|
||||
export interface ShopEvent {
|
||||
id: number
|
||||
name: string
|
||||
description: string
|
||||
image?: string
|
||||
banner?: string
|
||||
eventDate: string
|
||||
location?: string
|
||||
maxParticipants: number
|
||||
entryFee: number
|
||||
/** 动态表单字段配置(JSON字符串或数组) */
|
||||
formFields?: string | EventFormField[]
|
||||
status: number | EventStatus
|
||||
isHot: number
|
||||
tenantId?: number
|
||||
createTime: string
|
||||
paidCount: number
|
||||
}
|
||||
|
||||
export interface ShopEventParam {
|
||||
page?: number
|
||||
limit?: number
|
||||
status?: number
|
||||
isHot?: number
|
||||
tenantId?: number
|
||||
}
|
||||
|
||||
export interface EventRegisterParams {
|
||||
eventId: number
|
||||
/** 动态表单数据,key-value 形式 */
|
||||
formData?: Record<string, string>
|
||||
}
|
||||
|
||||
export interface EventRegistration {
|
||||
id: number
|
||||
eventId: number
|
||||
userId: number
|
||||
/** 动态表单提交的数据 */
|
||||
formData?: string | Record<string, string>
|
||||
entryFee: number
|
||||
payStatus: number // 0=待缴费 1=已缴费 2=已取消
|
||||
orderNo?: string
|
||||
paidAt?: string
|
||||
createTime: string
|
||||
eventName?: string
|
||||
}
|
||||
|
||||
export interface RegistrationStatus {
|
||||
registered: boolean
|
||||
payStatus: number | null
|
||||
registrationId?: number
|
||||
}
|
||||
|
||||
// 状态映射
|
||||
export function getEventStatusLabel(status: number): { label: string; color: string } {
|
||||
const map: Record<number, { label: string; color: string }> = {
|
||||
0: { label: '未开始', color: 'text-blue-500' },
|
||||
1: { label: '报名中', color: 'text-green-500' },
|
||||
2: { label: '已截止', color: 'text-orange-400' },
|
||||
3: { label: '已结束', color: 'text-gray-400' },
|
||||
}
|
||||
return map[status] ?? { label: '未知', color: 'text-gray-400' }
|
||||
}
|
||||
|
||||
export function getPayStatusLabel(payStatus: number): { label: string; color: string } {
|
||||
const map: Record<number, { label: string; color: string }> = {
|
||||
0: { label: '待缴费', color: 'text-orange-500' },
|
||||
1: { label: '已缴费', color: 'text-green-500' },
|
||||
2: { label: '已取消', color: 'text-gray-400' },
|
||||
}
|
||||
return map[payStatus] ?? { label: '未知', color: 'text-gray-400' }
|
||||
}
|
||||
101
src_bak/api/shop/shopExpress/index.ts
Normal file
101
src_bak/api/shop/shopExpress/index.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopExpress, ShopExpressParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询物流公司
|
||||
*/
|
||||
export async function pageShopExpress(params: ShopExpressParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopExpress>>>(
|
||||
'/shop/shop-express/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物流公司列表
|
||||
*/
|
||||
export async function listShopExpress(params?: ShopExpressParam) {
|
||||
const res = await request.get<ApiResult<ShopExpress[]>>(
|
||||
'/shop/shop-express',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加物流公司
|
||||
*/
|
||||
export async function addShopExpress(data: ShopExpress) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-express',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物流公司
|
||||
*/
|
||||
export async function updateShopExpress(data: ShopExpress) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-express',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除物流公司
|
||||
*/
|
||||
export async function removeShopExpress(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-express/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除物流公司
|
||||
*/
|
||||
export async function removeBatchShopExpress(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-express/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询物流公司
|
||||
*/
|
||||
export async function getShopExpress(id: number) {
|
||||
const res = await request.get<ApiResult<ShopExpress>>(
|
||||
'/shop/shop-express/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
35
src_bak/api/shop/shopExpress/model/index.ts
Normal file
35
src_bak/api/shop/shopExpress/model/index.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 物流公司
|
||||
*/
|
||||
export interface ShopExpress {
|
||||
// 物流公司ID
|
||||
expressId?: number;
|
||||
// 物流公司名称
|
||||
expressName?: string;
|
||||
// 物流公司编码 (微信)
|
||||
wxCode?: string;
|
||||
// 物流公司编码 (快递100)
|
||||
kuaidi100Code?: string;
|
||||
// 物流公司编码 (快递鸟)
|
||||
kdniaoCode?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 物流公司搜索条件
|
||||
*/
|
||||
export interface ShopExpressParam extends PageParam {
|
||||
expressId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
101
src_bak/api/shop/shopExpressTemplate/index.ts
Normal file
101
src_bak/api/shop/shopExpressTemplate/index.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopExpressTemplate, ShopExpressTemplateParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询运费模板
|
||||
*/
|
||||
export async function pageShopExpressTemplate(params: ShopExpressTemplateParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopExpressTemplate>>>(
|
||||
'/shop/shop-express-template/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询运费模板列表
|
||||
*/
|
||||
export async function listShopExpressTemplate(params?: ShopExpressTemplateParam) {
|
||||
const res = await request.get<ApiResult<ShopExpressTemplate[]>>(
|
||||
'/shop/shop-express-template',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加运费模板
|
||||
*/
|
||||
export async function addShopExpressTemplate(data: ShopExpressTemplate) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-express-template',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改运费模板
|
||||
*/
|
||||
export async function updateShopExpressTemplate(data: ShopExpressTemplate) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-express-template',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除运费模板
|
||||
*/
|
||||
export async function removeShopExpressTemplate(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-express-template/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除运费模板
|
||||
*/
|
||||
export async function removeBatchShopExpressTemplate(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-express-template/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询运费模板
|
||||
*/
|
||||
export async function getShopExpressTemplate(id: number) {
|
||||
const res = await request.get<ApiResult<ShopExpressTemplate>>(
|
||||
'/shop/shop-express-template/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
41
src_bak/api/shop/shopExpressTemplate/model/index.ts
Normal file
41
src_bak/api/shop/shopExpressTemplate/model/index.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 运费模板
|
||||
*/
|
||||
export interface ShopExpressTemplate {
|
||||
//
|
||||
id?: number;
|
||||
//
|
||||
type?: string;
|
||||
//
|
||||
title?: string;
|
||||
// 收件价格
|
||||
firstAmount?: string;
|
||||
// 续件价格
|
||||
extraAmount?: string;
|
||||
// 状态, 0已发布, 1待审核 2已驳回 3违规内容
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
//
|
||||
sortNumber?: number;
|
||||
// 首件数量/重量
|
||||
firstNum?: string;
|
||||
// 续件数量/重量
|
||||
extraNum?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 运费模板搜索条件
|
||||
*/
|
||||
export interface ShopExpressTemplateParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
101
src_bak/api/shop/shopExpressTemplateDetail/index.ts
Normal file
101
src_bak/api/shop/shopExpressTemplateDetail/index.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopExpressTemplateDetail, ShopExpressTemplateDetailParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询运费模板
|
||||
*/
|
||||
export async function pageShopExpressTemplateDetail(params: ShopExpressTemplateDetailParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopExpressTemplateDetail>>>(
|
||||
'/shop/shop-express-template-detail/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询运费模板列表
|
||||
*/
|
||||
export async function listShopExpressTemplateDetail(params?: ShopExpressTemplateDetailParam) {
|
||||
const res = await request.get<ApiResult<ShopExpressTemplateDetail[]>>(
|
||||
'/shop/shop-express-template-detail',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加运费模板
|
||||
*/
|
||||
export async function addShopExpressTemplateDetail(data: ShopExpressTemplateDetail) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-express-template-detail',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改运费模板
|
||||
*/
|
||||
export async function updateShopExpressTemplateDetail(data: ShopExpressTemplateDetail) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-express-template-detail',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除运费模板
|
||||
*/
|
||||
export async function removeShopExpressTemplateDetail(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-express-template-detail/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除运费模板
|
||||
*/
|
||||
export async function removeBatchShopExpressTemplateDetail(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-express-template-detail/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询运费模板
|
||||
*/
|
||||
export async function getShopExpressTemplateDetail(id: number) {
|
||||
const res = await request.get<ApiResult<ShopExpressTemplateDetail>>(
|
||||
'/shop/shop-express-template-detail/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
45
src_bak/api/shop/shopExpressTemplateDetail/model/index.ts
Normal file
45
src_bak/api/shop/shopExpressTemplateDetail/model/index.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 运费模板
|
||||
*/
|
||||
export interface ShopExpressTemplateDetail {
|
||||
//
|
||||
id?: number;
|
||||
//
|
||||
templateId?: number;
|
||||
// 0按件
|
||||
type?: string;
|
||||
//
|
||||
provinceId?: number;
|
||||
//
|
||||
cityId?: number;
|
||||
// 首件数量/重量
|
||||
firstNum?: string;
|
||||
// 收件价格
|
||||
firstAmount?: string;
|
||||
// 续件价格
|
||||
extraAmount?: string;
|
||||
// 续件数量/重量
|
||||
extraNum?: string;
|
||||
// 状态, 0已发布, 1待审核 2已驳回 3违规内容
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
//
|
||||
sortNumber?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 运费模板搜索条件
|
||||
*/
|
||||
export interface ShopExpressTemplateDetailParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
260
src_bak/api/shop/shopGift/index.ts
Normal file
260
src_bak/api/shop/shopGift/index.ts
Normal file
@@ -0,0 +1,260 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import {ShopGift, ShopGiftParam, GiftRedeemParam, GiftUseParam, QRCodeParam} from './model';
|
||||
|
||||
/**
|
||||
* 分页查询礼品卡
|
||||
*/
|
||||
export async function pageShopGift(params: ShopGiftParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopGift>>>(
|
||||
'/shop/shop-gift/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询礼品卡列表
|
||||
*/
|
||||
export async function listShopGift(params?: ShopGiftParam) {
|
||||
const res = await request.get<ApiResult<ShopGift[]>>(
|
||||
'/shop/shop-gift',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加礼品卡
|
||||
*/
|
||||
export async function addShopGift(data: ShopGift) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-gift',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成礼品卡
|
||||
*/
|
||||
export async function makeShopGift(data: ShopGift) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-gift/make',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改礼品卡
|
||||
*/
|
||||
export async function updateShopGift(data: ShopGift) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-gift',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除礼品卡
|
||||
*/
|
||||
export async function removeShopGift(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-gift/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除礼品卡
|
||||
*/
|
||||
export async function removeBatchShopGift(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-gift/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询礼品卡
|
||||
*/
|
||||
export async function getShopGift(id: number) {
|
||||
const res = await request.get<ApiResult<ShopGift>>(
|
||||
'/shop/shop-gift/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据code查询礼品卡
|
||||
* @param code
|
||||
*/
|
||||
export async function getShopGiftByCode(code: string) {
|
||||
const res = await request.get<ApiResult<ShopGift>>(
|
||||
'/shop/shop-gift/by-code/' + code
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 兑换礼品卡
|
||||
*/
|
||||
export async function redeemGift(params: GiftRedeemParam) {
|
||||
const res = await request.post<ApiResult<ShopGift>>(
|
||||
'/shop/shop-gift/redeem',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用礼品卡
|
||||
*/
|
||||
export async function useGift(params: GiftUseParam) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-gift/use',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户的礼品卡列表
|
||||
*/
|
||||
export async function getUserGifts(params: ShopGiftParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopGift>>>(
|
||||
'/shop/shop-gift/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证礼品卡兑换码
|
||||
*/
|
||||
export async function validateGiftCode(code: string) {
|
||||
const res = await request.get<ApiResult<ShopGift>>(
|
||||
`/shop/shop-gift/validate/${code}`
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
export async function exportShopGift(ids?: number[]) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-gift/export',
|
||||
ids
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成礼品卡核销码(可用)
|
||||
*/
|
||||
export async function generateVerificationCode(data: QRCodeParam) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/qr-code/create-encrypted-qr-code',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证核销码
|
||||
*/
|
||||
export async function verifyGiftCard(params: { verificationCode?: string; giftCode?: string }) {
|
||||
const res = await request.post<ApiResult<ShopGift>>(
|
||||
'/shop/shop-gift/verify',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成礼品卡核销
|
||||
*/
|
||||
export async function completeVerification(params: {
|
||||
giftId: number;
|
||||
verificationCode: string;
|
||||
storeId?: number;
|
||||
storeName?: string;
|
||||
operatorId?: number;
|
||||
operatorName?: string;
|
||||
}) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-gift/complete-verification',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 解密二维码数据
|
||||
*/
|
||||
export async function decryptQrData(params: { token: string; encryptedData: string }) {
|
||||
const res = await request.post<ApiResult<string>>(
|
||||
'/qr-code/decrypt-qr-data',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
127
src_bak/api/shop/shopGift/model/index.ts
Normal file
127
src_bak/api/shop/shopGift/model/index.ts
Normal file
@@ -0,0 +1,127 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 水票
|
||||
*/
|
||||
export interface ShopGift {
|
||||
// 礼品卡ID
|
||||
id?: number;
|
||||
// 礼品卡名称
|
||||
name?: string;
|
||||
// 礼品卡描述
|
||||
description?: string;
|
||||
// 礼品卡兑换码
|
||||
code?: string;
|
||||
// 关联商品ID
|
||||
goodsId?: number;
|
||||
// 商品名称
|
||||
goodsName?: string;
|
||||
// 商品图片
|
||||
goodsImage?: string;
|
||||
// 礼品卡面值
|
||||
faceValue?: string;
|
||||
// 礼品卡类型 (10实物礼品卡 20虚拟礼品卡 30服务礼品卡)
|
||||
type?: number;
|
||||
// 领取时间
|
||||
takeTime?: string;
|
||||
// 过期时间
|
||||
expireTime?: string;
|
||||
// 有效期天数
|
||||
validDays?: number;
|
||||
// 操作人
|
||||
operatorUserId?: number;
|
||||
// 操作人名称
|
||||
operatorUserName?: string;
|
||||
// 是否展示
|
||||
isShow?: string;
|
||||
// 状态 (0未使用 1已使用 2已过期 3已失效)
|
||||
status?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 使用说明
|
||||
instructions?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 拥有者用户ID
|
||||
userId?: number;
|
||||
// 发放者用户ID
|
||||
issuerUserId?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
// 数量
|
||||
num?: number;
|
||||
// 已发放数量
|
||||
issuedCount?: number;
|
||||
// 总发放数量
|
||||
totalCount?: number;
|
||||
// 使用门店/地址
|
||||
useLocation?: string;
|
||||
// 客服联系方式
|
||||
contactInfo?: string;
|
||||
// 核销时间
|
||||
verificationTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 礼品卡搜索条件
|
||||
*/
|
||||
export interface ShopGiftParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
code?: string;
|
||||
// 礼品卡类型筛选
|
||||
type?: number;
|
||||
// 状态筛选 (0未使用 1已使用 2失效)
|
||||
status?: number;
|
||||
// 用户ID筛选
|
||||
userId?: number;
|
||||
// 商品ID筛选
|
||||
goodsId?: number;
|
||||
// 是否过期筛选
|
||||
isExpired?: boolean;
|
||||
// 排序字段
|
||||
sortBy?: 'createTime' | 'expireTime' | 'faceValue' | 'takeTime';
|
||||
// 排序方向
|
||||
sortOrder?: 'asc' | 'desc';
|
||||
}
|
||||
|
||||
/**
|
||||
* 礼品卡兑换参数
|
||||
*/
|
||||
export interface GiftRedeemParam {
|
||||
// 兑换码
|
||||
code: string;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 礼品卡使用参数
|
||||
*/
|
||||
export interface GiftUseParam {
|
||||
// 礼品卡ID
|
||||
giftId?: number;
|
||||
// 使用地址/门店
|
||||
useLocation?: string;
|
||||
// 使用备注
|
||||
useNote?: string;
|
||||
}
|
||||
|
||||
export interface QRCodeParam {
|
||||
// 二维码数据
|
||||
data?: string;
|
||||
// 二维码尺寸
|
||||
width?: number;
|
||||
// 二维码高度
|
||||
height?: number;
|
||||
// 二维码过期时间
|
||||
expireMinutes?: number;
|
||||
// 业务类型
|
||||
businessType?: string;
|
||||
}
|
||||
21
src_bak/api/shop/shopGiftCard/index.ts
Normal file
21
src_bak/api/shop/shopGiftCard/index.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import request from '@/utils/request'
|
||||
import type { ShopGiftCard } from './model'
|
||||
|
||||
/** 获取我的礼品卡列表 */
|
||||
export function listMyGiftCards() {
|
||||
return request.get<{ code: number; data: ShopGiftCard[] }>('/shop/shop-gift/my')
|
||||
}
|
||||
|
||||
/** 绑定/兑换礼品卡
|
||||
* @param code - 礼品卡代码
|
||||
*/
|
||||
export function bindGiftCard(code: string) {
|
||||
return request.post<{ code: number; message: string }>('/shop/shop-gift/bind', {
|
||||
code,
|
||||
})
|
||||
}
|
||||
|
||||
/** 获取礼品卡余额(从用户卡包统计中获取) */
|
||||
export function getGiftCardBalance() {
|
||||
return request.get<{ code: number; data: { giftCards: number } }>('/user/card/stats')
|
||||
}
|
||||
29
src_bak/api/shop/shopGiftCard/model.ts
Normal file
29
src_bak/api/shop/shopGiftCard/model.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
/** 礼品卡 */
|
||||
export interface ShopGiftCard {
|
||||
id: number
|
||||
/** 卡号 */
|
||||
cardNo: string
|
||||
/** 密码 */
|
||||
password?: string
|
||||
/** 面额 */
|
||||
faceValue: number
|
||||
/** 余额 */
|
||||
balance: number
|
||||
/** 状态:0-未激活 1-正常 2-已用完 3-已过期 */
|
||||
status: number
|
||||
/** 有效期 */
|
||||
expireTime: string
|
||||
/** 创建时间 */
|
||||
createTime: string
|
||||
}
|
||||
|
||||
/** 礼品卡购买参数 */
|
||||
export interface GiftCardPurchaseParams {
|
||||
amount: number
|
||||
paymentMethod: number
|
||||
}
|
||||
|
||||
/** 礼品卡兑换参数 */
|
||||
export interface GiftCardExchangeParams {
|
||||
code: string
|
||||
}
|
||||
112
src_bak/api/shop/shopGoods/index.ts
Normal file
112
src_bak/api/shop/shopGoods/index.ts
Normal file
@@ -0,0 +1,112 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopGoods, ShopGoodsParam } from './model';
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询商品
|
||||
*/
|
||||
export async function pageShopGoods(params: ShopGoodsParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopGoods>>>(
|
||||
'/shop/shop-goods/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品列表
|
||||
*/
|
||||
export async function listShopGoods(params?: ShopGoodsParam) {
|
||||
const res = await request.get<ApiResult<ShopGoods[]>>(
|
||||
'/shop/shop-goods',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品
|
||||
*/
|
||||
export async function addShopGoods(data: ShopGoods) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-goods',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品
|
||||
*/
|
||||
export async function updateShopGoods(data: ShopGoods) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-goods',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品
|
||||
*/
|
||||
export async function removeShopGoods(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-goods/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品
|
||||
*/
|
||||
export async function removeBatchShopGoods(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-goods/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品
|
||||
*/
|
||||
export async function getShopGoods(id: number) {
|
||||
const res = await request.get<ApiResult<ShopGoods>>(
|
||||
'/shop/shop-goods/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
export async function getCount(params: ShopGoodsParam) {
|
||||
const res = await request.get<ApiResult<unknown>>('/shop/shop-goods/data', {
|
||||
params
|
||||
});
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
158
src_bak/api/shop/shopGoods/model/index.ts
Normal file
158
src_bak/api/shop/shopGoods/model/index.ts
Normal file
@@ -0,0 +1,158 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
import { ShopGoodsSpec } from '@/api/shop/shopGoodsSpec/model';
|
||||
import { ShopGoodsSku } from '@/api/shop/shopGoodsSku/model';
|
||||
import { ShopGoodsRoleCommission } from '@/api/shop/shopGoodsRoleCommission/model';
|
||||
|
||||
export interface GoodsCount {
|
||||
totalNum: number;
|
||||
totalNum2: number;
|
||||
totalNum3: number;
|
||||
totalNum4: number;
|
||||
}
|
||||
/**
|
||||
* 商品记录表
|
||||
*/
|
||||
export interface ShopGoods {
|
||||
// 自增ID
|
||||
goodsId?: number;
|
||||
// 类型 1实物商品 2虚拟商品
|
||||
type?: number;
|
||||
// 商品编码
|
||||
code?: string;
|
||||
// 商品名称
|
||||
name?: string;
|
||||
// 商品标题
|
||||
goodsName?: string;
|
||||
// 商品封面图
|
||||
image?: string;
|
||||
video?: string;
|
||||
// 商品详情
|
||||
content?: string;
|
||||
canExpress?: number;
|
||||
// 商品分类
|
||||
category?: string;
|
||||
// 商品分类ID
|
||||
categoryId?: number;
|
||||
parentName?: string;
|
||||
categoryName?: string;
|
||||
// 一级分类
|
||||
categoryParent?: string;
|
||||
// 二级分类
|
||||
categoryChildren?: string;
|
||||
// 商品规格 0单规格 1多规格
|
||||
specs?: number;
|
||||
commissionRole?: number;
|
||||
// 货架
|
||||
position?: string;
|
||||
// 进货价
|
||||
buyingPrice?: string;
|
||||
// 商品价格
|
||||
price?: string;
|
||||
originPrice?: string;
|
||||
// 销售价格
|
||||
salePrice?: string;
|
||||
chainStorePrice?: string;
|
||||
chainStoreRate?: string;
|
||||
memberStoreRate?: string;
|
||||
memberMarketRate?: string;
|
||||
memberStoreCommission?: string;
|
||||
supplierCommission?: string;
|
||||
coopCommission?: string;
|
||||
memberStorePrice?: string;
|
||||
memberMarketPrice?: string;
|
||||
// 经销商价格
|
||||
dealerPrice?: string;
|
||||
// 有赠品
|
||||
buyingGift?: boolean;
|
||||
// 有赠品
|
||||
priceGift?: boolean;
|
||||
// 有赠品
|
||||
dealerGift?: boolean;
|
||||
buyingGiftNum?: number;
|
||||
priceGiftNum?: number;
|
||||
priceGiftName?: string;
|
||||
dealerGiftNum?: number;
|
||||
// 库存计算方式(10下单减库存 20付款减库存)
|
||||
deductStockType?: number;
|
||||
// 封面图
|
||||
files?: string;
|
||||
// 销量
|
||||
sales?: number;
|
||||
isNew?: number;
|
||||
// 库存
|
||||
stock?: number;
|
||||
// 步长
|
||||
step?: number;
|
||||
// 商品重量
|
||||
goodsWeight?: number;
|
||||
// 消费赚取积分
|
||||
gainIntegral?: number;
|
||||
// 推荐
|
||||
recommend?: number;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 商户名称
|
||||
merchantName?: string;
|
||||
supplierMerchantId?: number;
|
||||
supplierName?: string;
|
||||
// 状态(0:未上架,1:上架)
|
||||
isShow?: number;
|
||||
// 状态, 0上架 1待上架 2待审核 3审核不通过
|
||||
status?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
// 显示规格名
|
||||
specName?: string;
|
||||
// 商品规格
|
||||
goodsSpecs?: ShopGoodsSpec[];
|
||||
goodsRoleCommission?: ShopGoodsRoleCommission[];
|
||||
// 商品sku列表
|
||||
goodsSkus?: ShopGoodsSku[];
|
||||
// 单位名称
|
||||
unitName?: string;
|
||||
expressTemplateId?: number;
|
||||
canUseDate?: string;
|
||||
ensureTag?: string;
|
||||
expiredDay?: number;
|
||||
// 可购买数量
|
||||
canBuyNumber?: number;
|
||||
// 活动方式:0全平台 1新用户专享
|
||||
activityType?: number;
|
||||
// 配送方式:0送上门 1限自提
|
||||
deliveryMode?: number;
|
||||
}
|
||||
|
||||
export interface BathSet {
|
||||
price?: number;
|
||||
salePrice?: number;
|
||||
stock?: number;
|
||||
skuNo?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品记录表搜索条件
|
||||
*/
|
||||
export interface ShopGoodsParam extends PageParam {
|
||||
parentId?: number;
|
||||
categoryId?: number;
|
||||
goodsId?: number;
|
||||
goodsName?: string;
|
||||
isShow?: number;
|
||||
stock?: number;
|
||||
keywords?: string;
|
||||
recommend?: number;
|
||||
// 0上架 1下架(以实际后端约定为准)
|
||||
status?: number;
|
||||
}
|
||||
101
src_bak/api/shop/shopGoodsCategory/index.ts
Normal file
101
src_bak/api/shop/shopGoodsCategory/index.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopGoodsCategory, ShopGoodsCategoryParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询商品分类
|
||||
*/
|
||||
export async function pageShopGoodsCategory(params: ShopGoodsCategoryParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopGoodsCategory>>>(
|
||||
'/shop/shop-goods-category/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品分类列表
|
||||
*/
|
||||
export async function listShopGoodsCategory(params?: ShopGoodsCategoryParam) {
|
||||
const res = await request.get<ApiResult<ShopGoodsCategory[]>>(
|
||||
'/shop/shop-goods-category',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品分类
|
||||
*/
|
||||
export async function addShopGoodsCategory(data: ShopGoodsCategory) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-category',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品分类
|
||||
*/
|
||||
export async function updateShopGoodsCategory(data: ShopGoodsCategory) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-category',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品分类
|
||||
*/
|
||||
export async function removeShopGoodsCategory(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-category/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品分类
|
||||
*/
|
||||
export async function removeBatchShopGoodsCategory(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-category/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品分类
|
||||
*/
|
||||
export async function getShopGoodsCategory(id: number) {
|
||||
const res = await request.get<ApiResult<ShopGoodsCategory>>(
|
||||
'/shop/shop-goods-category/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
64
src_bak/api/shop/shopGoodsCategory/model/index.ts
Normal file
64
src_bak/api/shop/shopGoodsCategory/model/index.ts
Normal file
@@ -0,0 +1,64 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 商品分类
|
||||
*/
|
||||
export interface ShopGoodsCategory {
|
||||
// 商品分类ID
|
||||
categoryId?: number;
|
||||
// 分类标识
|
||||
categoryCode?: string;
|
||||
// 分类名称
|
||||
title?: string;
|
||||
// 类型 0商城分类 1外卖分类
|
||||
type?: number;
|
||||
// 分类图片
|
||||
image?: string;
|
||||
// 上级分类ID
|
||||
parentId?: number;
|
||||
// 路由/链接地址
|
||||
path?: string;
|
||||
// 组件路径
|
||||
component?: string;
|
||||
// 绑定的页面
|
||||
pageId?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 商品数量
|
||||
count?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)
|
||||
hide?: number;
|
||||
// 是否推荐
|
||||
recommend?: number;
|
||||
// 是否显示在首页
|
||||
showIndex?: number;
|
||||
// 商铺ID
|
||||
merchantId?: number;
|
||||
// 状态, 0正常, 1禁用
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
// 子菜单
|
||||
children?: ShopGoodsCategory[];
|
||||
key?: number;
|
||||
value?: number;
|
||||
label?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品分类搜索条件
|
||||
*/
|
||||
export interface ShopGoodsCategoryParam extends PageParam {
|
||||
categoryId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
69
src_bak/api/shop/shopGoodsComment/index.ts
Normal file
69
src_bak/api/shop/shopGoodsComment/index.ts
Normal file
@@ -0,0 +1,69 @@
|
||||
import request from '@/utils/request'
|
||||
import type { ShopGoodsComment, SubmitCommentParams, CommentPageParams } from './model'
|
||||
|
||||
/**
|
||||
* 提交商品评价
|
||||
* @desc 对接 Java 后端 /api/shop/shopGoodsComment
|
||||
*/
|
||||
export function submitGoodsComment(data: SubmitCommentParams) {
|
||||
return request.post<{ code: number; message: string }>('/shop/shopGoodsComment', {
|
||||
goodsId: data.goodsId,
|
||||
oid: data.oid || data.orderId,
|
||||
unique: data.unique,
|
||||
replyType: data.replyType,
|
||||
goodsScore: data.goodsScore,
|
||||
serviceScore: data.serviceScore || 5,
|
||||
comment: data.comment || data.content,
|
||||
pics: data.pics || data.images?.join(','),
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询商品评价
|
||||
* @desc 对接 Java 后端 /api/shop/shopGoodsComment/page
|
||||
*/
|
||||
export function pageGoodsComment(params: CommentPageParams = {}) {
|
||||
return request.get<{
|
||||
code: number
|
||||
data: {
|
||||
records: ShopGoodsComment[]
|
||||
total: number
|
||||
size: number
|
||||
current: number
|
||||
}
|
||||
}>('/shop/shopGoodsComment/page', {
|
||||
params: {
|
||||
page: params.page || 1,
|
||||
size: params.pageSize || 10,
|
||||
goodsId: params.goodsId,
|
||||
oid: params.oid || params.orderId,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询我的评价列表
|
||||
* @desc 对接 Java 后端 /api/shop/shopGoodsComment
|
||||
*/
|
||||
export function myGoodsComment(params: { page?: number; pageSize?: number } = {}) {
|
||||
return request.get<{
|
||||
code: number
|
||||
data: {
|
||||
records: ShopGoodsComment[]
|
||||
total: number
|
||||
}
|
||||
}>('/shop/shopGoodsComment', {
|
||||
params: {
|
||||
page: params.page || 1,
|
||||
size: params.pageSize || 10,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取评价详情
|
||||
* @desc 对接 Java 后端 /api/shop/shopGoodsComment/{id}
|
||||
*/
|
||||
export function getGoodsComment(id: number) {
|
||||
return request.get<{ code: number; data: ShopGoodsComment }>(`/shop/shopGoodsComment/${id}`)
|
||||
}
|
||||
77
src_bak/api/shop/shopGoodsComment/model.ts
Normal file
77
src_bak/api/shop/shopGoodsComment/model.ts
Normal file
@@ -0,0 +1,77 @@
|
||||
/** 商品评价 - 对接 Java 后端 /api/shop/shopGoodsComment */
|
||||
export interface ShopGoodsComment {
|
||||
/** 评论ID */
|
||||
id: number
|
||||
/** 用户ID */
|
||||
uid?: number
|
||||
userId?: number
|
||||
/** 订单ID */
|
||||
oid?: number
|
||||
orderId?: number
|
||||
/** 商品唯一标识 */
|
||||
unique?: string
|
||||
/** 商品ID */
|
||||
goodsId?: number
|
||||
/** 商品类型(普通商品、秒杀商品) */
|
||||
replyType?: string
|
||||
/** 商品分数 */
|
||||
goodsScore?: boolean | number
|
||||
/** 服务分数 */
|
||||
serviceScore?: boolean | number
|
||||
/** 评论内容 */
|
||||
comment?: string
|
||||
content?: string
|
||||
/** 评论图片(逗号分隔) */
|
||||
pics?: string
|
||||
images?: string[]
|
||||
/** 商家回复内容 */
|
||||
merchantReplyContent?: string
|
||||
reply?: string
|
||||
/** 商家回复时间 */
|
||||
merchantReplyTime?: number
|
||||
replyTime?: number
|
||||
/** 用户名称 */
|
||||
nickname?: string
|
||||
/** 用户头像 */
|
||||
avatar?: string
|
||||
/** 商品规格属性值 */
|
||||
sku?: string
|
||||
/** 状态: 0正常, 1冻结 */
|
||||
status?: number
|
||||
/** 创建时间 */
|
||||
createTime?: string
|
||||
}
|
||||
|
||||
/** 提交评价参数 - 对接 Java 后端 */
|
||||
export interface SubmitCommentParams {
|
||||
/** 订单ID */
|
||||
oid?: number
|
||||
orderId?: number
|
||||
/** 商品ID */
|
||||
goodsId: number
|
||||
/** 商品唯一标识 */
|
||||
unique?: string
|
||||
/** 商品类型 */
|
||||
replyType?: string
|
||||
/** 商品分数 (1-5) */
|
||||
goodsScore: number
|
||||
/** 服务分数 (1-5) */
|
||||
serviceScore?: number
|
||||
/** 评论内容 */
|
||||
comment: string
|
||||
content?: string
|
||||
/** 评论图片(逗号分隔) */
|
||||
pics?: string
|
||||
images?: string[]
|
||||
}
|
||||
|
||||
/** 评价分页参数 */
|
||||
export interface CommentPageParams {
|
||||
page?: number
|
||||
pageSize?: number
|
||||
/** 商品ID筛选 */
|
||||
goodsId?: number
|
||||
/** 订单ID筛选 */
|
||||
oid?: number
|
||||
orderId?: number
|
||||
}
|
||||
22
src_bak/api/shop/shopGoodsEvaluate/index.ts
Normal file
22
src_bak/api/shop/shopGoodsEvaluate/index.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import request from '@/utils/request'
|
||||
import type { ShopGoodsEvaluate, SubmitEvaluateParams, EvaluatePageParams } from './model'
|
||||
|
||||
/** 提交商品评价 */
|
||||
export function submitGoodsEvaluate(data: SubmitEvaluateParams) {
|
||||
return request.post<ShopGoodsEvaluate>('/shopGoodsEvaluate/submit', data)
|
||||
}
|
||||
|
||||
/** 获取商品评价列表 */
|
||||
export function pageGoodsEvaluate(params: EvaluatePageParams = {}) {
|
||||
return request.post<{ items: ShopGoodsEvaluate[]; total: number }>('/shopGoodsEvaluate/page', params)
|
||||
}
|
||||
|
||||
/** 获取我的评价列表 */
|
||||
export function myGoodsEvaluate(params: { page?: number; pageSize?: number } = {}) {
|
||||
return request.post<{ items: ShopGoodsEvaluate[]; total: number }>('/shopGoodsEvaluate/myList', params)
|
||||
}
|
||||
|
||||
/** 获取评价详情 */
|
||||
export function getGoodsEvaluate(id: number) {
|
||||
return request.post<ShopGoodsEvaluate>('/shopGoodsEvaluate/get', { id })
|
||||
}
|
||||
39
src_bak/api/shop/shopGoodsEvaluate/model.ts
Normal file
39
src_bak/api/shop/shopGoodsEvaluate/model.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
/** 商品评价 */
|
||||
export interface ShopGoodsEvaluate {
|
||||
id: number
|
||||
orderId: number
|
||||
orderGoodsId: number
|
||||
goodsId: number
|
||||
goodsName?: string
|
||||
goodsImage?: string
|
||||
userId: number
|
||||
nickname: string
|
||||
avatar?: string
|
||||
rating: number
|
||||
content: string
|
||||
images?: string[]
|
||||
isAnonymous: boolean
|
||||
createTime: string
|
||||
/** 商家回复 */
|
||||
reply?: string
|
||||
replyTime?: string
|
||||
}
|
||||
|
||||
/** 提交评价参数 */
|
||||
export interface SubmitEvaluateParams {
|
||||
orderId: number
|
||||
orderGoodsId: number
|
||||
goodsId: number
|
||||
rating: number
|
||||
content: string
|
||||
images?: string[]
|
||||
isAnonymous?: boolean
|
||||
}
|
||||
|
||||
/** 分页参数 */
|
||||
export interface EvaluatePageParams {
|
||||
page?: number
|
||||
pageSize?: number
|
||||
goodsId?: number
|
||||
orderId?: number
|
||||
}
|
||||
44
src_bak/api/shop/shopGoodsFavorite/index.ts
Normal file
44
src_bak/api/shop/shopGoodsFavorite/index.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
import type { ShopGoodsFavorite, ShopGoodsFavoriteParam } from './model'
|
||||
|
||||
/**
|
||||
* 解包 API 响应
|
||||
* request 工具默认 returnRaw=true,返回完整 {code, message, data} 包装
|
||||
* 此函数提取内层 data 字段,兼容 data 为 null/undefined 的情况
|
||||
*/
|
||||
function unwrap<T>(res: any): T {
|
||||
if (res && typeof res === 'object' && 'data' in res) {
|
||||
return res.data as T
|
||||
}
|
||||
return res as T
|
||||
}
|
||||
|
||||
// 添加收藏
|
||||
export async function addShopGoodsFavorite(data: { goodsId: number }) {
|
||||
const res = await request.post('/shop/goods/favorite/add', data)
|
||||
return unwrap<boolean>(res)
|
||||
}
|
||||
|
||||
// 取消收藏
|
||||
export async function removeShopGoodsFavorite(data: { goodsId: number }) {
|
||||
const res = await request.post('/shop/goods/favorite/remove', data)
|
||||
return unwrap<boolean>(res)
|
||||
}
|
||||
|
||||
// 查询收藏状态(返回 boolean:true=已收藏, false=未收藏)
|
||||
export async function getShopGoodsFavoriteStatus(params: { goodsId: number }) {
|
||||
const res = await request.get('/shop/goods/favorite/status', params)
|
||||
return !!unwrap<boolean>(res) // 确保返回纯布尔值
|
||||
}
|
||||
|
||||
// 收藏列表
|
||||
export async function listShopGoodsFavorite(params: ShopGoodsFavoriteParam) {
|
||||
const res = await request.get('/shop/goods/favorite/list', params)
|
||||
return unwrap<ShopGoodsFavorite[]>(res) || []
|
||||
}
|
||||
|
||||
// 收藏列表(分页)
|
||||
export async function pageShopGoodsFavorite(params: ShopGoodsFavoriteParam) {
|
||||
const res = await request.get('/shop/goods/favorite/page', params)
|
||||
return unwrap<{ list: ShopGoodsFavorite[]; total: number }>(res) || { list: [], total: 0 }
|
||||
}
|
||||
15
src_bak/api/shop/shopGoodsFavorite/model.ts
Normal file
15
src_bak/api/shop/shopGoodsFavorite/model.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
export interface ShopGoodsFavorite {
|
||||
favoriteId?: number
|
||||
userId?: number
|
||||
goodsId?: number
|
||||
createTime?: string
|
||||
goodsName?: string
|
||||
goodsImage?: string
|
||||
salePrice?: string
|
||||
}
|
||||
|
||||
export interface ShopGoodsFavoriteParam {
|
||||
page?: number
|
||||
limit?: number
|
||||
userId?: number
|
||||
}
|
||||
101
src_bak/api/shop/shopGoodsRoleCommission/index.ts
Normal file
101
src_bak/api/shop/shopGoodsRoleCommission/index.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import { ShopGoodsRoleCommission, ShopGoodsRoleCommissionParam } from '@/api/shop/shopGoodsRoleCommission/model';
|
||||
|
||||
/**
|
||||
* 分页查询商品绑定角色的分润金额
|
||||
*/
|
||||
export async function pageShopGoodsRoleCommission(params: ShopGoodsRoleCommissionParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopGoodsRoleCommission>>>(
|
||||
'/shop/shop-goods-role-commission/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品绑定角色的分润金额列表
|
||||
*/
|
||||
export async function listShopGoodsRoleCommission(params?: ShopGoodsRoleCommissionParam) {
|
||||
const res = await request.get<ApiResult<ShopGoodsRoleCommission[]>>(
|
||||
'/shop/shop-goods-role-commission',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品绑定角色的分润金额
|
||||
*/
|
||||
export async function addShopGoodsRoleCommission(data: ShopGoodsRoleCommission) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-role-commission',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品绑定角色的分润金额
|
||||
*/
|
||||
export async function updateShopGoodsRoleCommission(data: ShopGoodsRoleCommission) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-role-commission',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品绑定角色的分润金额
|
||||
*/
|
||||
export async function removeShopGoodsRoleCommission(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-role-commission/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品绑定角色的分润金额
|
||||
*/
|
||||
export async function removeBatchShopGoodsRoleCommission(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-role-commission/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品绑定角色的分润金额
|
||||
*/
|
||||
export async function getShopGoodsRoleCommission(id: number) {
|
||||
const res = await request.get<ApiResult<ShopGoodsRoleCommission>>(
|
||||
'/shop/shop-goods-role-commission/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
35
src_bak/api/shop/shopGoodsRoleCommission/model/index.ts
Normal file
35
src_bak/api/shop/shopGoodsRoleCommission/model/index.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 商品绑定角色的分润金额
|
||||
*/
|
||||
export interface ShopGoodsRoleCommission {
|
||||
//
|
||||
id?: number;
|
||||
//
|
||||
roleId?: number;
|
||||
//
|
||||
goodsId?: number;
|
||||
//
|
||||
sku?: string;
|
||||
//
|
||||
amount?: string;
|
||||
// 状态, 0正常, 1异常
|
||||
status?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
//
|
||||
sortNumber?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品绑定角色的分润金额搜索条件
|
||||
*/
|
||||
export interface ShopGoodsRoleCommissionParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
113
src_bak/api/shop/shopGoodsSku/index.ts
Normal file
113
src_bak/api/shop/shopGoodsSku/index.ts
Normal file
@@ -0,0 +1,113 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import { ShopGoodsSpec } from '@/api/shop/shopGoodsSpec/model';
|
||||
import { ShopGoodsSku, ShopGoodsSkuParam } from '@/api/shop/shopGoodsSku/model';
|
||||
|
||||
export async function generateGoodsSku(data: ShopGoodsSpec) {
|
||||
const res = await request.post<ApiResult<ShopGoodsSku[]>>(
|
||||
'/shop/goods-sku/generateGoodsSku',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询商品sku列表
|
||||
*/
|
||||
export async function pageShopGoodsSku(params: ShopGoodsSkuParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopGoodsSku>>>(
|
||||
'/shop/shop-goods-sku/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品sku列表列表
|
||||
*/
|
||||
export async function listShopGoodsSku(params?: ShopGoodsSkuParam) {
|
||||
const res = await request.get<ApiResult<ShopGoodsSku[]>>(
|
||||
'/shop/shop-goods-sku',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品sku列表
|
||||
*/
|
||||
export async function addShopGoodsSku(data: ShopGoodsSku) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-sku',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品sku列表
|
||||
*/
|
||||
export async function updateShopGoodsSku(data: ShopGoodsSku) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-sku',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品sku列表
|
||||
*/
|
||||
export async function removeShopGoodsSku(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-sku/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品sku列表
|
||||
*/
|
||||
export async function removeBatchShopGoodsSku(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-sku/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品sku列表
|
||||
*/
|
||||
export async function getShopGoodsSku(id: number) {
|
||||
const res = await request.get<ApiResult<ShopGoodsSku>>(
|
||||
'/shop/shop-goods-sku/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
50
src_bak/api/shop/shopGoodsSku/model/index.ts
Normal file
50
src_bak/api/shop/shopGoodsSku/model/index.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商品sku列表
|
||||
*/
|
||||
export interface ShopGoodsSku {
|
||||
// 主键ID
|
||||
id?: number;
|
||||
// 商品ID
|
||||
goodsId?: number;
|
||||
// 商品属性索引值 (attr_value|attr_value[|....])
|
||||
sku?: string;
|
||||
// 商品图片
|
||||
image?: string;
|
||||
// 商品价格
|
||||
price?: string;
|
||||
// 市场价格
|
||||
salePrice?: string;
|
||||
// 成本价
|
||||
cost?: string;
|
||||
// 库存
|
||||
stock?: number;
|
||||
// sku编码
|
||||
skuNo?: string;
|
||||
// 商品条码
|
||||
barCode?: string;
|
||||
// 重量
|
||||
weight?: string;
|
||||
// 体积
|
||||
volume?: string;
|
||||
// 唯一值
|
||||
uuid?: string;
|
||||
// 状态, 0正常, 1异常
|
||||
status?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
images?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品sku列表搜索条件
|
||||
*/
|
||||
export interface ShopGoodsSkuParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
101
src_bak/api/shop/shopGoodsSpec/index.ts
Normal file
101
src_bak/api/shop/shopGoodsSpec/index.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopGoodsSpec, ShopGoodsSpecParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询商品多规格
|
||||
*/
|
||||
export async function pageShopGoodsSpec(params: ShopGoodsSpecParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopGoodsSpec>>>(
|
||||
'/shop/shop-goods-spec/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品多规格列表
|
||||
*/
|
||||
export async function listShopGoodsSpec(params?: ShopGoodsSpecParam) {
|
||||
const res = await request.get<ApiResult<ShopGoodsSpec[]>>(
|
||||
'/shop/shop-goods-spec',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品多规格
|
||||
*/
|
||||
export async function addShopGoodsSpec(data: ShopGoodsSpec) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-spec',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品多规格
|
||||
*/
|
||||
export async function updateShopGoodsSpec(data: ShopGoodsSpec) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-spec',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品多规格
|
||||
*/
|
||||
export async function removeShopGoodsSpec(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-spec/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品多规格
|
||||
*/
|
||||
export async function removeBatchShopGoodsSpec(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-spec/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品多规格
|
||||
*/
|
||||
export async function getShopGoodsSpec(id: number) {
|
||||
const res = await request.get<ApiResult<ShopGoodsSpec>>(
|
||||
'/shop/shop-goods-spec/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
29
src_bak/api/shop/shopGoodsSpec/model/index.ts
Normal file
29
src_bak/api/shop/shopGoodsSpec/model/index.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商品多规格
|
||||
*/
|
||||
export interface ShopGoodsSpec {
|
||||
// 主键
|
||||
id?: number;
|
||||
// 商品ID
|
||||
goodsId?: number;
|
||||
// 规格ID
|
||||
specId?: number;
|
||||
// 规格名称
|
||||
specName?: string;
|
||||
// 规格值
|
||||
specValue?: string;
|
||||
// 活动类型 0=商品,1=秒杀,2=砍价,3=拼团
|
||||
type?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品多规格搜索条件
|
||||
*/
|
||||
export interface ShopGoodsSpecParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
36
src_bak/api/shop/shopGroupBuy/index.ts
Normal file
36
src_bak/api/shop/shopGroupBuy/index.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import request from '@/utils/request'
|
||||
import type {
|
||||
ShopGroupBuy,
|
||||
ShopGroupBuyRecord,
|
||||
ShopGroupBuyPageParams,
|
||||
} from './model'
|
||||
|
||||
/** 获取拼团商品列表 */
|
||||
export function pageShopGroupBuy(params: ShopGroupBuyPageParams = {}) {
|
||||
return request.post<{ items: ShopGroupBuy[]; total: number }>('/shopGroupBuy/page', params)
|
||||
}
|
||||
|
||||
/** 获取拼团商品详情 */
|
||||
export function getShopGroupBuy(id: number) {
|
||||
return request.post<ShopGroupBuy>('/shopGroupBuy/get', { id })
|
||||
}
|
||||
|
||||
/** 获取进行中的拼团记录(可参团) */
|
||||
export function listShopGroupBuyRecords(groupBuyId: number) {
|
||||
return request.post<ShopGroupBuyRecord[]>('/shopGroupBuy/listRecords', { groupBuyId })
|
||||
}
|
||||
|
||||
/** 发起拼团 */
|
||||
export function createGroupBuy(data: { groupBuyId: number; goodsId: number; skuId: number; quantity: number }) {
|
||||
return request.post<ShopGroupBuyRecord>('/shopGroupBuy/create', data)
|
||||
}
|
||||
|
||||
/** 参与拼团 */
|
||||
export function joinGroupBuy(data: { recordId: number; goodsId: number; skuId: number; quantity: number }) {
|
||||
return request.post<ShopGroupBuyRecord>('/shopGroupBuy/join', data)
|
||||
}
|
||||
|
||||
/** 获取我的拼团记录 */
|
||||
export function myGroupBuyRecords(params: { page?: number; pageSize?: number } = {}) {
|
||||
return request.post<{ items: ShopGroupBuyRecord[]; total: number }>('/shopGroupBuy/myRecords', params)
|
||||
}
|
||||
61
src_bak/api/shop/shopGroupBuy/model.ts
Normal file
61
src_bak/api/shop/shopGroupBuy/model.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
/** 拼团活动 */
|
||||
export interface ShopGroupBuy {
|
||||
id: number
|
||||
goodsId: number
|
||||
goodsName?: string
|
||||
goodsImage?: string
|
||||
/** 拼团价格 */
|
||||
groupPrice: number
|
||||
/** 成团人数 */
|
||||
groupSize: number
|
||||
/** 已参团人数 */
|
||||
currentSize: number
|
||||
/** 开始时间 */
|
||||
startTime: string
|
||||
/** 结束时间 */
|
||||
endTime: string
|
||||
/** 状态:0-未开始 1-进行中 2-已结束 */
|
||||
status: number
|
||||
/** 商品详情 */
|
||||
product?: {
|
||||
id: number
|
||||
name: string
|
||||
image: string
|
||||
price: number
|
||||
}
|
||||
}
|
||||
|
||||
/** 拼团记录 */
|
||||
export interface ShopGroupBuyRecord {
|
||||
id: number
|
||||
groupBuyId: number
|
||||
userId: number
|
||||
/** 团长ID */
|
||||
leaderId: number
|
||||
/** 是否团长 */
|
||||
isLeader: boolean
|
||||
/** 参团人数 */
|
||||
memberCount: number
|
||||
/** 状态:0-待成团 1-已成团 2-已失败 */
|
||||
status: number
|
||||
/** 过期时间 */
|
||||
expireTime: string
|
||||
/** 成员列表 */
|
||||
members?: ShopGroupBuyMember[]
|
||||
}
|
||||
|
||||
/** 拼团成员 */
|
||||
export interface ShopGroupBuyMember {
|
||||
id: number
|
||||
userId: number
|
||||
nickname: string
|
||||
avatar: string
|
||||
joinTime: string
|
||||
}
|
||||
|
||||
/** 分页参数 */
|
||||
export interface ShopGroupBuyPageParams {
|
||||
page?: number
|
||||
pageSize?: number
|
||||
status?: number
|
||||
}
|
||||
278
src_bak/api/shop/shopInvite/index.ts
Normal file
278
src_bak/api/shop/shopInvite/index.ts
Normal file
@@ -0,0 +1,278 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import { BaseUrl } from '@/config/app';
|
||||
|
||||
/**
|
||||
* 小程序码生成参数
|
||||
*/
|
||||
export interface MiniProgramCodeParam {
|
||||
// 小程序页面路径
|
||||
page?: string;
|
||||
// 场景值,最大32个可见字符
|
||||
scene: string;
|
||||
// 二维码宽度,单位 px,最小 280px,最大 1280px
|
||||
width?: number;
|
||||
// 是否检查页面是否存在
|
||||
checkPath?: boolean;
|
||||
// 环境版本
|
||||
envVersion?: 'release' | 'trial' | 'develop';
|
||||
}
|
||||
|
||||
/**
|
||||
* 邀请关系参数
|
||||
*/
|
||||
export interface InviteRelationParam {
|
||||
// 邀请人ID
|
||||
inviterId: number;
|
||||
// 被邀请人ID
|
||||
inviteeId: number;
|
||||
// 邀请来源
|
||||
source: string;
|
||||
// 场景值
|
||||
scene?: string;
|
||||
// 邀请时间
|
||||
inviteTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定推荐关系参数
|
||||
*/
|
||||
export interface BindRefereeParam {
|
||||
// 推荐人ID
|
||||
dealerId: number;
|
||||
// 被推荐人ID (可选,如果不传则使用当前登录用户)
|
||||
userId?: number;
|
||||
// 推荐来源
|
||||
source?: string;
|
||||
// 场景值
|
||||
scene?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 邀请统计数据
|
||||
*/
|
||||
export interface InviteStats {
|
||||
// 总邀请数
|
||||
totalInvites: number;
|
||||
// 成功注册数
|
||||
successfulRegistrations: number;
|
||||
// 转化率
|
||||
conversionRate: number;
|
||||
// 今日邀请数
|
||||
todayInvites: number;
|
||||
// 本月邀请数
|
||||
monthlyInvites: number;
|
||||
// 邀请来源统计
|
||||
sourceStats: InviteSourceStat[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 邀请来源统计
|
||||
*/
|
||||
export interface InviteSourceStat {
|
||||
source: string;
|
||||
count: number;
|
||||
successCount: number;
|
||||
conversionRate: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 邀请记录
|
||||
*/
|
||||
export interface InviteRecord {
|
||||
id?: number;
|
||||
inviterId?: number;
|
||||
inviteeId?: number;
|
||||
inviterName?: string;
|
||||
inviteeName?: string;
|
||||
source?: string;
|
||||
scene?: string;
|
||||
status?: 'pending' | 'registered' | 'activated';
|
||||
inviteTime?: string;
|
||||
registerTime?: string;
|
||||
activateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 邀请记录查询参数
|
||||
*/
|
||||
export interface InviteRecordParam {
|
||||
page?: number;
|
||||
limit?: number;
|
||||
inviterId?: number;
|
||||
status?: string;
|
||||
source?: string;
|
||||
startTime?: string;
|
||||
endTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成小程序码
|
||||
*/
|
||||
export async function generateMiniProgramCode(data: MiniProgramCodeParam) {
|
||||
try {
|
||||
const url = '/wx-login/getOrderQRCodeUnlimited/' + data.scene;
|
||||
// 由于接口直接返回图片buffer,我们直接构建完整的URL
|
||||
return `${BaseUrl}${url}`;
|
||||
} catch (error: any) {
|
||||
throw new Error(error.message || '生成小程序码失败');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成邀请小程序码
|
||||
*/
|
||||
export async function generateInviteCode(inviterId: number) {
|
||||
const scene = `uid_${inviterId}`;
|
||||
|
||||
return generateMiniProgramCode({
|
||||
page: 'pages/index/index',
|
||||
scene: scene,
|
||||
width: 180,
|
||||
checkPath: true,
|
||||
envVersion: 'trial'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 建立邀请关系 (旧接口,保留兼容性)
|
||||
*/
|
||||
export async function createInviteRelation(data: InviteRelationParam) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/invite/create-relation',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定推荐关系 (新接口)
|
||||
*/
|
||||
export async function bindRefereeRelation(data: BindRefereeParam) {
|
||||
try {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-referee',
|
||||
{
|
||||
dealerId: data.dealerId,
|
||||
userId: data.userId,
|
||||
source: data.source || 'qrcode',
|
||||
scene: data.scene
|
||||
}
|
||||
);
|
||||
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
|
||||
throw new Error(res.message || '绑定推荐关系失败');
|
||||
} catch (error: any) {
|
||||
console.error('绑定推荐关系API调用失败:', error);
|
||||
throw new Error(error.message || '绑定推荐关系失败');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理邀请场景值
|
||||
*/
|
||||
export async function processInviteScene(scene: string, userId: number) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/invite/process-scene',
|
||||
{ scene, userId }
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取邀请统计数据
|
||||
*/
|
||||
export async function getInviteStats(inviterId: number) {
|
||||
const res = await request.get<ApiResult<InviteStats>>(
|
||||
`/invite/stats/${inviterId}`
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询邀请记录
|
||||
*/
|
||||
export async function pageInviteRecords(params: InviteRecordParam) {
|
||||
const res = await request.get<ApiResult<PageResult<InviteRecord>>>(
|
||||
'/invite/records/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取我的邀请记录
|
||||
*/
|
||||
export async function getMyInviteRecords(params: InviteRecordParam) {
|
||||
const res = await request.get<ApiResult<PageResult<InviteRecord>>>(
|
||||
'/invite/my-records',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证邀请码有效性
|
||||
*/
|
||||
export async function validateInviteCode(scene: string) {
|
||||
const res = await request.post<ApiResult<{ valid: boolean; inviterId?: number; source?: string }>>(
|
||||
'/invite/validate-code',
|
||||
{ scene }
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新邀请状态
|
||||
*/
|
||||
export async function updateInviteStatus(inviteId: number, status: 'registered' | 'activated') {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
`/invite/update-status/${inviteId}`,
|
||||
{ status }
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取邀请排行榜
|
||||
*/
|
||||
export async function getInviteRanking(params?: { limit?: number; period?: 'day' | 'week' | 'month' }) {
|
||||
const res = await request.get<ApiResult<Array<{
|
||||
inviterId: number;
|
||||
inviterName: string;
|
||||
inviteCount: number;
|
||||
successCount: number;
|
||||
conversionRate: number;
|
||||
}>>>(
|
||||
'/invite/ranking',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
279
src_bak/api/shop/shopInvite/model/index.ts
Normal file
279
src_bak/api/shop/shopInvite/model/index.ts
Normal file
@@ -0,0 +1,279 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 邀请记录表
|
||||
*/
|
||||
export interface InviteRecord {
|
||||
// 主键ID
|
||||
id?: number;
|
||||
// 邀请人ID
|
||||
inviterId?: number;
|
||||
// 被邀请人ID
|
||||
inviteeId?: number;
|
||||
// 邀请人姓名
|
||||
inviterName?: string;
|
||||
// 被邀请人姓名
|
||||
inviteeName?: string;
|
||||
// 邀请来源 (qrcode, link, share等)
|
||||
source?: string;
|
||||
// 场景值
|
||||
scene?: string;
|
||||
// 邀请状态: pending-待注册, registered-已注册, activated-已激活
|
||||
status?: 'pending' | 'registered' | 'activated';
|
||||
// 邀请时间
|
||||
inviteTime?: string;
|
||||
// 注册时间
|
||||
registerTime?: string;
|
||||
// 激活时间
|
||||
activateTime?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 邀请统计表
|
||||
*/
|
||||
export interface InviteStats {
|
||||
// 主键ID
|
||||
id?: number;
|
||||
// 邀请人ID
|
||||
inviterId?: number;
|
||||
// 统计日期
|
||||
statDate?: string;
|
||||
// 总邀请数
|
||||
totalInvites?: number;
|
||||
// 成功注册数
|
||||
successfulRegistrations?: number;
|
||||
// 激活用户数
|
||||
activatedUsers?: number;
|
||||
// 转化率
|
||||
conversionRate?: number;
|
||||
// 今日邀请数
|
||||
todayInvites?: number;
|
||||
// 本周邀请数
|
||||
weeklyInvites?: number;
|
||||
// 本月邀请数
|
||||
monthlyInvites?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 邀请来源统计表
|
||||
*/
|
||||
export interface InviteSourceStats {
|
||||
// 主键ID
|
||||
id?: number;
|
||||
// 邀请人ID
|
||||
inviterId?: number;
|
||||
// 来源类型
|
||||
source?: string;
|
||||
// 来源名称
|
||||
sourceName?: string;
|
||||
// 邀请数量
|
||||
inviteCount?: number;
|
||||
// 成功数量
|
||||
successCount?: number;
|
||||
// 转化率
|
||||
conversionRate?: number;
|
||||
// 统计日期
|
||||
statDate?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 小程序码记录表
|
||||
*/
|
||||
export interface MiniProgramCode {
|
||||
// 主键ID
|
||||
id?: number;
|
||||
// 邀请人ID
|
||||
inviterId?: number;
|
||||
// 场景值
|
||||
scene?: string;
|
||||
// 小程序码URL
|
||||
codeUrl?: string;
|
||||
// 页面路径
|
||||
pagePath?: string;
|
||||
// 二维码宽度
|
||||
width?: number;
|
||||
// 环境版本
|
||||
envVersion?: string;
|
||||
// 过期时间
|
||||
expireTime?: string;
|
||||
// 使用次数
|
||||
useCount?: number;
|
||||
// 最后使用时间
|
||||
lastUseTime?: string;
|
||||
// 状态: active-有效, expired-过期, disabled-禁用
|
||||
status?: 'active' | 'expired' | 'disabled';
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 邀请记录搜索条件
|
||||
*/
|
||||
export interface InviteRecordParam extends PageParam {
|
||||
// 邀请人ID
|
||||
inviterId?: number;
|
||||
// 被邀请人ID
|
||||
inviteeId?: number;
|
||||
// 邀请状态
|
||||
status?: string;
|
||||
// 邀请来源
|
||||
source?: string;
|
||||
// 开始时间
|
||||
startTime?: string;
|
||||
// 结束时间
|
||||
endTime?: string;
|
||||
// 关键词搜索
|
||||
keywords?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 邀请统计搜索条件
|
||||
*/
|
||||
export interface InviteStatsParam extends PageParam {
|
||||
// 邀请人ID
|
||||
inviterId?: number;
|
||||
// 统计开始日期
|
||||
startDate?: string;
|
||||
// 统计结束日期
|
||||
endDate?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 邀请来源统计搜索条件
|
||||
*/
|
||||
export interface InviteSourceStatsParam extends PageParam {
|
||||
// 邀请人ID
|
||||
inviterId?: number;
|
||||
// 来源类型
|
||||
source?: string;
|
||||
// 统计开始日期
|
||||
startDate?: string;
|
||||
// 统计结束日期
|
||||
endDate?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 小程序码搜索条件
|
||||
*/
|
||||
export interface MiniProgramCodeParam extends PageParam {
|
||||
// 邀请人ID
|
||||
inviterId?: number;
|
||||
// 状态
|
||||
status?: string;
|
||||
// 场景值
|
||||
scene?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 邀请排行榜数据
|
||||
*/
|
||||
export interface InviteRanking {
|
||||
// 邀请人ID
|
||||
inviterId?: number;
|
||||
// 邀请人姓名
|
||||
inviterName?: string;
|
||||
// 邀请人头像
|
||||
inviterAvatar?: string;
|
||||
// 邀请数量
|
||||
inviteCount?: number;
|
||||
// 成功数量
|
||||
successCount?: number;
|
||||
// 转化率
|
||||
conversionRate?: number;
|
||||
// 排名
|
||||
rank?: number;
|
||||
// 奖励金额
|
||||
rewardAmount?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 邀请奖励配置
|
||||
*/
|
||||
export interface InviteRewardConfig {
|
||||
// 主键ID
|
||||
id?: number;
|
||||
// 奖励类型: register-注册奖励, activate-激活奖励, order-订单奖励
|
||||
rewardType?: string;
|
||||
// 奖励名称
|
||||
rewardName?: string;
|
||||
// 奖励金额
|
||||
rewardAmount?: number;
|
||||
// 奖励积分
|
||||
rewardPoints?: number;
|
||||
// 奖励优惠券ID
|
||||
couponId?: number;
|
||||
// 是否启用
|
||||
enabled?: boolean;
|
||||
// 生效时间
|
||||
effectTime?: string;
|
||||
// 失效时间
|
||||
expireTime?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 邀请奖励记录
|
||||
*/
|
||||
export interface InviteRewardRecord {
|
||||
// 主键ID
|
||||
id?: number;
|
||||
// 邀请记录ID
|
||||
inviteRecordId?: number;
|
||||
// 邀请人ID
|
||||
inviterId?: number;
|
||||
// 被邀请人ID
|
||||
inviteeId?: number;
|
||||
// 奖励类型
|
||||
rewardType?: string;
|
||||
// 奖励金额
|
||||
rewardAmount?: number;
|
||||
// 奖励积分
|
||||
rewardPoints?: number;
|
||||
// 优惠券ID
|
||||
couponId?: number;
|
||||
// 发放状态: pending-待发放, issued-已发放, failed-发放失败
|
||||
status?: 'pending' | 'issued' | 'failed';
|
||||
// 发放时间
|
||||
issueTime?: string;
|
||||
// 失败原因
|
||||
failReason?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
166
src_bak/api/shop/shopInvoiceTitle/index.ts
Normal file
166
src_bak/api/shop/shopInvoiceTitle/index.ts
Normal file
@@ -0,0 +1,166 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopInvoiceTitle, ShopInvoiceTitleParam, ShopInvoiceRecord, ShopInvoiceRecordParam, InvoiceApplyRequest } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询发票抬头
|
||||
*/
|
||||
export async function pageShopInvoiceTitle(params: ShopInvoiceTitleParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopInvoiceTitle>>>(
|
||||
'/shop/shop-invoice-title/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询发票抬头列表
|
||||
*/
|
||||
export async function listShopInvoiceTitle(params?: ShopInvoiceTitleParam) {
|
||||
const res = await request.get<ApiResult<ShopInvoiceTitle[]>>(
|
||||
'/shop/shop-invoice-title',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加发票抬头
|
||||
*/
|
||||
export async function addShopInvoiceTitle(data: ShopInvoiceTitle) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-invoice-title',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改发票抬头
|
||||
*/
|
||||
export async function updateShopInvoiceTitle(data: ShopInvoiceTitle) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-invoice-title',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除发票抬头
|
||||
*/
|
||||
export async function removeShopInvoiceTitle(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-invoice-title/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询发票抬头
|
||||
*/
|
||||
export async function getShopInvoiceTitle(id: number) {
|
||||
const res = await request.get<ApiResult<ShopInvoiceTitle>>(
|
||||
'/shop/shop-invoice-title/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置默认发票抬头
|
||||
*/
|
||||
export async function setDefaultInvoiceTitle(id: number) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-invoice-title/set-default/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询发票记录
|
||||
*/
|
||||
export async function pageShopInvoiceRecord(params: ShopInvoiceRecordParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopInvoiceRecord>>>(
|
||||
'/shop/shop-invoice-record/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询发票记录列表
|
||||
*/
|
||||
export async function listShopInvoiceRecord(params?: ShopInvoiceRecordParam) {
|
||||
const res = await request.get<ApiResult<ShopInvoiceRecord[]>>(
|
||||
'/shop/shop-invoice-record',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请发票
|
||||
*/
|
||||
export async function applyInvoice(data: InvoiceApplyRequest) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-invoice-record/apply',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询发票记录
|
||||
*/
|
||||
export async function getShopInvoiceRecord(id: number) {
|
||||
const res = await request.get<ApiResult<ShopInvoiceRecord>>(
|
||||
'/shop/shop-invoice-record/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户可开票订单列表
|
||||
*/
|
||||
export async function listInvoiceableOrders() {
|
||||
const res = await request.get<ApiResult<ShopInvoiceRecord[]>>(
|
||||
'/shop/shop-invoice-record/invoiceable-orders'
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
155
src_bak/api/shop/shopInvoiceTitle/model.ts
Normal file
155
src_bak/api/shop/shopInvoiceTitle/model.ts
Normal file
@@ -0,0 +1,155 @@
|
||||
/**
|
||||
* 发票抬头表
|
||||
*/
|
||||
export interface ShopInvoiceTitle {
|
||||
/** 主键ID */
|
||||
id?: number;
|
||||
/** 用户ID */
|
||||
userId?: number;
|
||||
/** 抬头类型: personal-个人, company-企业 */
|
||||
type?: 'personal' | 'company';
|
||||
/** 发票抬头名称 */
|
||||
name?: string;
|
||||
/** 税号(企业必填) */
|
||||
taxNumber?: string;
|
||||
/** 注册地址 */
|
||||
address?: string;
|
||||
/** 注册电话 */
|
||||
phone?: string;
|
||||
/** 开户银行 */
|
||||
bankName?: string;
|
||||
/** 银行账号 */
|
||||
bankAccount?: string;
|
||||
/** 接收邮箱 */
|
||||
email?: string;
|
||||
/** 是否默认: 0-否, 1-是 */
|
||||
isDefault?: number;
|
||||
/** 商城ID */
|
||||
tenantId?: number;
|
||||
/** 创建时间 */
|
||||
createTime?: string;
|
||||
/** 修改时间 */
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发票抬头查询参数
|
||||
*/
|
||||
export interface ShopInvoiceTitleParam {
|
||||
/** 主键ID */
|
||||
id?: number;
|
||||
/** 用户ID */
|
||||
userId?: number;
|
||||
/** 抬头类型 */
|
||||
type?: string;
|
||||
/** 是否默认 */
|
||||
isDefault?: number;
|
||||
/** 第几页 */
|
||||
page?: number;
|
||||
/** 每页多少条 */
|
||||
limit?: number;
|
||||
/** 排序字段 */
|
||||
sort?: string;
|
||||
/** 排序方式 */
|
||||
order?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发票申请记录
|
||||
*/
|
||||
export interface ShopInvoiceRecord {
|
||||
/** 主键ID */
|
||||
id?: number;
|
||||
/** 用户ID */
|
||||
userId?: number;
|
||||
/** 用户昵称 */
|
||||
userNickName?: string;
|
||||
/** 订单ID */
|
||||
orderId?: number;
|
||||
/** 订单编号 */
|
||||
orderNo?: string;
|
||||
/** 发票抬头ID */
|
||||
titleId?: number;
|
||||
/** 发票类型: normal-普通发票, vat-增值税发票 */
|
||||
invoiceType?: 'normal' | 'vat';
|
||||
/** 发票抬头 */
|
||||
titleName?: string;
|
||||
/** 税号 */
|
||||
taxNumber?: string;
|
||||
/** 发票金额 */
|
||||
amount?: number;
|
||||
/** 发票状态: 0-待处理, 1-开票中, 2-已开票, 3-开票失败 */
|
||||
status?: number;
|
||||
/** 发票流水号 */
|
||||
invoiceNo?: string;
|
||||
/** 发票URL */
|
||||
invoiceUrl?: string;
|
||||
/** 申请时间 */
|
||||
applyTime?: string;
|
||||
/** 开票时间 */
|
||||
invoiceTime?: string;
|
||||
/** 商城ID */
|
||||
tenantId?: number;
|
||||
/** 创建时间 */
|
||||
createTime?: string;
|
||||
/** 修改时间 */
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发票申请参数
|
||||
*/
|
||||
export interface ShopInvoiceRecordParam {
|
||||
/** 主键ID */
|
||||
id?: number;
|
||||
/** 用户ID */
|
||||
userId?: number;
|
||||
/** 订单ID */
|
||||
orderId?: number;
|
||||
/** 发票抬头ID */
|
||||
titleId?: number;
|
||||
/** 发票类型 */
|
||||
invoiceType?: string;
|
||||
/** 发票状态 */
|
||||
status?: number;
|
||||
/** 第几页 */
|
||||
page?: number;
|
||||
/** 每页多少条 */
|
||||
limit?: number;
|
||||
/** 排序字段 */
|
||||
sort?: string;
|
||||
/** 排序方式 */
|
||||
order?: string;
|
||||
/** 起始时间 */
|
||||
createTimeStart?: string;
|
||||
/** 结束时间 */
|
||||
createTimeEnd?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发票申请请求
|
||||
*/
|
||||
export interface InvoiceApplyRequest {
|
||||
/** 订单ID */
|
||||
orderId: number;
|
||||
/** 发票抬头ID */
|
||||
titleId: number;
|
||||
/** 发票类型 */
|
||||
invoiceType?: 'normal' | 'vat';
|
||||
/** 接收邮箱(电子发票) */
|
||||
email?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发票状态枚举
|
||||
*/
|
||||
export enum InvoiceStatusEnum {
|
||||
/** 待处理 */
|
||||
PENDING = 0,
|
||||
/** 开票中 */
|
||||
PROCESSING = 1,
|
||||
/** 已开票 */
|
||||
COMPLETED = 2,
|
||||
/** 开票失败 */
|
||||
FAILED = 3,
|
||||
}
|
||||
258
src_bak/api/shop/shopLogistics/index.ts
Normal file
258
src_bak/api/shop/shopLogistics/index.ts
Normal file
@@ -0,0 +1,258 @@
|
||||
import { request } from '@/utils/request'
|
||||
|
||||
// 物流信息接口
|
||||
export interface LogisticsInfo {
|
||||
expressCompany: string // 快递公司代码
|
||||
expressCompanyName: string // 快递公司名称
|
||||
expressNo: string // 快递单号
|
||||
status: string // 物流状态
|
||||
updateTime: string // 更新时间
|
||||
estimatedTime?: string // 预计送达时间
|
||||
currentLocation?: string // 当前位置
|
||||
senderInfo?: {
|
||||
name: string
|
||||
phone: string
|
||||
address: string
|
||||
}
|
||||
receiverInfo?: {
|
||||
name: string
|
||||
phone: string
|
||||
address: string
|
||||
}
|
||||
}
|
||||
|
||||
// 物流跟踪记录
|
||||
export interface LogisticsTrack {
|
||||
time: string
|
||||
location: string
|
||||
status: string
|
||||
description: string
|
||||
isCompleted: boolean
|
||||
}
|
||||
|
||||
// 物流查询响应
|
||||
export interface LogisticsResponse {
|
||||
success: boolean
|
||||
data: {
|
||||
logisticsInfo: LogisticsInfo
|
||||
trackList: LogisticsTrack[]
|
||||
}
|
||||
message?: string
|
||||
}
|
||||
|
||||
// 支持的快递公司
|
||||
export const EXPRESS_COMPANIES = {
|
||||
'SF': '顺丰速运',
|
||||
'YTO': '圆通速递',
|
||||
'ZTO': '中通快递',
|
||||
'STO': '申通快递',
|
||||
'YD': '韵达速递',
|
||||
'HTKY': '百世快递',
|
||||
'JD': '京东物流',
|
||||
'EMS': '中国邮政',
|
||||
'YUNDA': '韵达快递',
|
||||
'JTSD': '极兔速递',
|
||||
'DBKD': '德邦快递',
|
||||
'UC': '优速快递'
|
||||
}
|
||||
|
||||
// 查询物流信息
|
||||
export const queryLogistics = async (params: {
|
||||
orderId?: string
|
||||
expressNo: string
|
||||
expressCompany: string
|
||||
}): Promise<LogisticsResponse> => {
|
||||
try {
|
||||
// 调用真实的物流查询API
|
||||
const response = await request({
|
||||
url: '/logistics/query',
|
||||
method: 'POST',
|
||||
data: params
|
||||
})
|
||||
|
||||
return response
|
||||
} catch (error) {
|
||||
console.error('查询物流信息失败:', error)
|
||||
// 抛出错误而不是返回 Mock 数据
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated 已弃用 - Mock 数据仅用于开发调试
|
||||
* 生产环境应删除此函数
|
||||
*/
|
||||
const getMockLogisticsData = (params: {
|
||||
orderId?: string
|
||||
expressNo: string
|
||||
expressCompany: string
|
||||
}): LogisticsResponse => {
|
||||
const now = new Date()
|
||||
const yesterday = new Date(now.getTime() - 24 * 60 * 60 * 1000)
|
||||
const twoDaysAgo = new Date(now.getTime() - 2 * 24 * 60 * 60 * 1000)
|
||||
const threeDaysAgo = new Date(now.getTime() - 3 * 24 * 60 * 60 * 1000)
|
||||
|
||||
const mockData: LogisticsResponse = {
|
||||
success: true,
|
||||
data: {
|
||||
logisticsInfo: {
|
||||
expressCompany: params.expressCompany,
|
||||
expressCompanyName: EXPRESS_COMPANIES[params.expressCompany] || params.expressCompany,
|
||||
expressNo: params.expressNo,
|
||||
status: '运输中',
|
||||
updateTime: now.toISOString(),
|
||||
estimatedTime: new Date(now.getTime() + 24 * 60 * 60 * 1000).toISOString(),
|
||||
currentLocation: '北京市朝阳区',
|
||||
senderInfo: {
|
||||
name: '商家仓库',
|
||||
phone: '400-123-4567',
|
||||
address: '上海市浦东新区张江高科技园区'
|
||||
},
|
||||
receiverInfo: {
|
||||
name: '张三',
|
||||
phone: '138****5678',
|
||||
address: '北京市朝阳区三里屯街道'
|
||||
}
|
||||
},
|
||||
trackList: [
|
||||
{
|
||||
time: now.toISOString(),
|
||||
location: '北京市朝阳区',
|
||||
status: '运输中',
|
||||
description: '快件正在运输途中,预计今日送达,请保持手机畅通',
|
||||
isCompleted: false
|
||||
},
|
||||
{
|
||||
time: new Date(now.getTime() - 2 * 60 * 60 * 1000).toISOString(),
|
||||
location: '北京转运中心',
|
||||
status: '已发出',
|
||||
description: '快件已从北京转运中心发出,正在派送途中',
|
||||
isCompleted: true
|
||||
},
|
||||
{
|
||||
time: new Date(now.getTime() - 6 * 60 * 60 * 1000).toISOString(),
|
||||
location: '北京转运中心',
|
||||
status: '已到达',
|
||||
description: '快件已到达北京转运中心,正在进行分拣',
|
||||
isCompleted: true
|
||||
},
|
||||
{
|
||||
time: yesterday.toISOString(),
|
||||
location: '天津转运中心',
|
||||
status: '已发出',
|
||||
description: '快件已从天津转运中心发出',
|
||||
isCompleted: true
|
||||
},
|
||||
{
|
||||
time: new Date(yesterday.getTime() - 4 * 60 * 60 * 1000).toISOString(),
|
||||
location: '天津转运中心',
|
||||
status: '已到达',
|
||||
description: '快件已到达天津转运中心',
|
||||
isCompleted: true
|
||||
},
|
||||
{
|
||||
time: twoDaysAgo.toISOString(),
|
||||
location: '上海转运中心',
|
||||
status: '已发出',
|
||||
description: '快件已从上海转运中心发出',
|
||||
isCompleted: true
|
||||
},
|
||||
{
|
||||
time: new Date(twoDaysAgo.getTime() - 2 * 60 * 60 * 1000).toISOString(),
|
||||
location: '上海转运中心',
|
||||
status: '已到达',
|
||||
description: '快件已到达上海转运中心,正在进行分拣',
|
||||
isCompleted: true
|
||||
},
|
||||
{
|
||||
time: threeDaysAgo.toISOString(),
|
||||
location: '上海市浦东新区',
|
||||
status: '已发货',
|
||||
description: '商家已发货,快件已交给快递公司',
|
||||
isCompleted: true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
return mockData
|
||||
}
|
||||
|
||||
// 获取快递公司列表
|
||||
export const getExpressCompanies = () => {
|
||||
return Object.entries(EXPRESS_COMPANIES).map(([code, name]) => ({
|
||||
code,
|
||||
name
|
||||
}))
|
||||
}
|
||||
|
||||
// 根据快递单号自动识别快递公司
|
||||
export const detectExpressCompany = (expressNo: string): string => {
|
||||
// 这里可以根据快递单号的规则来自动识别快递公司
|
||||
// 实际项目中可以使用第三方服务的自动识别API
|
||||
|
||||
if (expressNo.startsWith('SF')) return 'SF'
|
||||
if (expressNo.startsWith('YT')) return 'YTO'
|
||||
if (expressNo.startsWith('ZT')) return 'ZTO'
|
||||
if (expressNo.startsWith('ST')) return 'STO'
|
||||
if (expressNo.startsWith('YD')) return 'YD'
|
||||
if (expressNo.startsWith('JD')) return 'JD'
|
||||
if (expressNo.startsWith('EMS')) return 'EMS'
|
||||
|
||||
// 默认返回顺丰
|
||||
return 'SF'
|
||||
}
|
||||
|
||||
// 格式化物流状态
|
||||
export const formatLogisticsStatus = (status: string): {
|
||||
text: string
|
||||
color: string
|
||||
icon: string
|
||||
} => {
|
||||
const statusMap = {
|
||||
'已发货': { text: '已发货', color: '#1890ff', icon: '📦' },
|
||||
'运输中': { text: '运输中', color: '#52c41a', icon: '🚚' },
|
||||
'派送中': { text: '派送中', color: '#faad14', icon: '🏃' },
|
||||
'已签收': { text: '已签收', color: '#52c41a', icon: '✅' },
|
||||
'异常': { text: '异常', color: '#ff4d4f', icon: '⚠️' },
|
||||
'退回': { text: '退回', color: '#ff4d4f', icon: '↩️' }
|
||||
}
|
||||
|
||||
return statusMap[status] || { text: status, color: '#666', icon: '📋' }
|
||||
}
|
||||
|
||||
// 计算预计送达时间
|
||||
export const calculateEstimatedTime = (
|
||||
sendTime: string,
|
||||
expressCompany: string,
|
||||
distance?: number
|
||||
): string => {
|
||||
const sendDate = new Date(sendTime)
|
||||
let estimatedDays = 3 // 默认3天
|
||||
|
||||
// 根据快递公司调整预计时间
|
||||
switch (expressCompany) {
|
||||
case 'SF':
|
||||
estimatedDays = 1 // 顺丰次日达
|
||||
break
|
||||
case 'JD':
|
||||
estimatedDays = 1 // 京东次日达
|
||||
break
|
||||
case 'YTO':
|
||||
case 'ZTO':
|
||||
case 'STO':
|
||||
estimatedDays = 2 // 三通一达2天
|
||||
break
|
||||
default:
|
||||
estimatedDays = 3
|
||||
}
|
||||
|
||||
// 根据距离调整(如果有距离信息)
|
||||
if (distance) {
|
||||
if (distance > 2000) estimatedDays += 1 // 超过2000公里加1天
|
||||
if (distance > 3000) estimatedDays += 1 // 超过3000公里再加1天
|
||||
}
|
||||
|
||||
const estimatedDate = new Date(sendDate.getTime() + estimatedDays * 24 * 60 * 60 * 1000)
|
||||
return estimatedDate.toISOString()
|
||||
}
|
||||
29
src_bak/api/shop/shopMemberBenefit.ts
Normal file
29
src_bak/api/shop/shopMemberBenefit.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 获取可用权益包列表 */
|
||||
export function getBenefitPackageList() {
|
||||
return request.get('/shop/shop-member-benefit-package/list');
|
||||
}
|
||||
|
||||
/** 获取权益包详情 */
|
||||
export function getBenefitPackageDetail(id: number) {
|
||||
return request.get(`/shop/shop-member-benefit-package/${id}`);
|
||||
}
|
||||
|
||||
/** 申请兑换 */
|
||||
export function exchangeBenefitPackage(data: {
|
||||
packageId: number;
|
||||
addressId?: number;
|
||||
}) {
|
||||
return request.post('/shop/shop-member-benefit-exchange/exchange', data);
|
||||
}
|
||||
|
||||
/** 我的兑换记录 */
|
||||
export function getMyExchangeList(params?: any) {
|
||||
return request.get('/shop/shop-member-benefit-exchange/my/list', params);
|
||||
}
|
||||
|
||||
/** 取消兑换 */
|
||||
export function cancelExchange(id: number) {
|
||||
return request.post(`/shop/shop-member-benefit-exchange/cancel/${id}`);
|
||||
}
|
||||
113
src_bak/api/shop/shopMemberCenter.ts
Normal file
113
src_bak/api/shop/shopMemberCenter.ts
Normal file
@@ -0,0 +1,113 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
|
||||
/**
|
||||
* 会员中心数据 - 整合分销商相关信息
|
||||
*/
|
||||
export interface MemberCenterData {
|
||||
// 基本信息
|
||||
memberLevel: string; // 会员等级名称
|
||||
memberLevelId: number; // 会员等级ID
|
||||
isDealer: boolean; // 是否是分销商
|
||||
// 佣金信息
|
||||
commission: number; // 可提现佣金
|
||||
totalCommission: number; // 累计佣金
|
||||
frozenCommission: number; // 冻结佣金
|
||||
// 团队信息
|
||||
teamCount: number; // 团队人数
|
||||
activeCount: number; // 活跃人数
|
||||
memberCount: number; // 会员人数
|
||||
// 推广信息
|
||||
inviteCode: string; // 邀请码
|
||||
qrCode: string; // 推广二维码
|
||||
}
|
||||
|
||||
/**
|
||||
* 佣金明细记录
|
||||
*/
|
||||
export interface CommissionRecord {
|
||||
id: number;
|
||||
type: number; // 1=佣金收入, 2=佣金提现, 3=佣金退回
|
||||
amount: number; // 金额
|
||||
status: number; // 状态: 0=待审核, 10=审核通过, 20=待收款, 30=已拒绝, 40=已完成
|
||||
remark: string; // 备注
|
||||
createTime: string; // 创建时间
|
||||
updateTime: string; // 更新时间
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取会员中心数据
|
||||
*/
|
||||
export async function getMemberCenterData() {
|
||||
const res = await request.get<ApiResult<MemberCenterData>>('/shop/shop-dealer-user/info');
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
// 如果接口不存在,返回默认数据
|
||||
return {
|
||||
memberLevel: '普通会员',
|
||||
memberLevelId: 0,
|
||||
isDealer: false,
|
||||
commission: 0,
|
||||
totalCommission: 0,
|
||||
frozenCommission: 0,
|
||||
teamCount: 0,
|
||||
activeCount: 0,
|
||||
memberCount: 0,
|
||||
inviteCode: '',
|
||||
qrCode: '',
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取佣金明细列表
|
||||
*/
|
||||
export async function listCommissionRecord(params?: { page?: number; limit?: number }) {
|
||||
const res = await request.get<ApiResult<{
|
||||
list: CommissionRecord[];
|
||||
total: number;
|
||||
}>>('/shop/shop-commission-record/page', params);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return { list: [], total: 0 };
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分销商资金信息
|
||||
*/
|
||||
export async function getDealerCapital() {
|
||||
const res = await request.get<ApiResult<{
|
||||
balance: number; // 账户余额
|
||||
totalEarning: number; // 累计收益
|
||||
frozenAmount: number; // 冻结金额
|
||||
withdrawAmount: number; // 已提现金额
|
||||
}>>('/shop/shop-dealer-capital/summary');
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return {
|
||||
balance: 0,
|
||||
totalEarning: 0,
|
||||
frozenAmount: 0,
|
||||
withdrawAmount: 0,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分销设置信息(用于会员升级)
|
||||
*/
|
||||
export async function getDealerSetting() {
|
||||
const res = await request.get<ApiResult<{
|
||||
upgradeCondition: string; // 升级条件描述
|
||||
upgradeAmount: number; // 升级所需消费金额
|
||||
commissionRate: number; // 佣金比例
|
||||
selfBuyRate: number; // 自购返利比例
|
||||
levelName: string; // 等级名称
|
||||
levelIcon: string; // 等级图标
|
||||
}[]>>('/shop/shop-commission-role/list');
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return [];
|
||||
}
|
||||
108
src_bak/api/shop/shopMemberRegister.ts
Normal file
108
src_bak/api/shop/shopMemberRegister.ts
Normal file
@@ -0,0 +1,108 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
|
||||
/**
|
||||
* 会员注册记录相关API
|
||||
*/
|
||||
|
||||
/**
|
||||
* 会员注册记录
|
||||
*/
|
||||
export interface MemberRegister {
|
||||
id: number;
|
||||
dealerId: number;
|
||||
dealerName?: string;
|
||||
dealerPhone?: string;
|
||||
phone: string;
|
||||
realName?: string;
|
||||
memberFee: number;
|
||||
memberFeeStatus: number;
|
||||
registerFee: number;
|
||||
registerFeeStatus: number;
|
||||
userId?: number;
|
||||
nickName?: string;
|
||||
status: number;
|
||||
comments?: string;
|
||||
createTime: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册费支付信息
|
||||
*/
|
||||
export interface RegisterPayInfo {
|
||||
id: number;
|
||||
phone: string;
|
||||
realName?: string;
|
||||
registerFee: number;
|
||||
dealerName?: string;
|
||||
dealerPhone?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取我的下级注册列表
|
||||
*/
|
||||
export async function getMyRegisterList(params?: { page?: number; limit?: number }) {
|
||||
const res = await request.get<ApiResult<MemberRegister[]>>('/shop/shop-member-register/my/list', params);
|
||||
return res.data || [];
|
||||
}
|
||||
|
||||
/**
|
||||
* 录入下级
|
||||
*/
|
||||
export async function addSubordinate(data: { phone: string; realName?: string }) {
|
||||
const res = await request.post<ApiResult<null>>('/shop/shop-member-register/add', data);
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改下级信息
|
||||
*/
|
||||
export async function updateSubordinate(data: { id: number; phone?: string; realName?: string }) {
|
||||
const res = await request.put<ApiResult<null>>('/shop/shop-member-register/update', data);
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查手机号是否可注册
|
||||
*/
|
||||
export async function checkPhone(phone: string) {
|
||||
const res = await request.get<ApiResult<{
|
||||
canRegister: boolean;
|
||||
message?: string;
|
||||
registerFee?: number;
|
||||
memberFee?: number;
|
||||
}>>('/shop/shop-member-register/check', { phone });
|
||||
return res.data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取注册费支付信息
|
||||
*/
|
||||
export async function getRegisterPayInfo(phone: string) {
|
||||
const res = await request.get<ApiResult<RegisterPayInfo>>('/shop/shop-member-register/pay/info', { phone });
|
||||
return res.data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户的注册状态
|
||||
*/
|
||||
export async function getMyRegisterStatus() {
|
||||
const res = await request.get<ApiResult<{
|
||||
isDealer: boolean;
|
||||
dealerId?: number;
|
||||
dealerName?: string;
|
||||
register?: MemberRegister;
|
||||
}>>('/shop/shop-member-register/my/status');
|
||||
return res.data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取会员配置信息
|
||||
*/
|
||||
export async function getMemberConfig() {
|
||||
const res = await request.get<ApiResult<{
|
||||
memberFee: number;
|
||||
registerFee: number;
|
||||
}>>('/shop/shop-member-register/config');
|
||||
return res.data;
|
||||
}
|
||||
101
src_bak/api/shop/shopMerchant/index.ts
Normal file
101
src_bak/api/shop/shopMerchant/index.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopMerchant, ShopMerchantParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询商户
|
||||
*/
|
||||
export async function pageShopMerchant(params: ShopMerchantParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopMerchant>>>(
|
||||
'/shop/shop-merchant/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商户列表
|
||||
*/
|
||||
export async function listShopMerchant(params?: ShopMerchantParam) {
|
||||
const res = await request.get<ApiResult<ShopMerchant[]>>(
|
||||
'/shop/shop-merchant',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商户
|
||||
*/
|
||||
export async function addShopMerchant(data: ShopMerchant) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商户
|
||||
*/
|
||||
export async function updateShopMerchant(data: ShopMerchant) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商户
|
||||
*/
|
||||
export async function removeShopMerchant(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商户
|
||||
*/
|
||||
export async function removeBatchShopMerchant(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商户
|
||||
*/
|
||||
export async function getShopMerchant(id: number) {
|
||||
const res = await request.get<ApiResult<ShopMerchant>>(
|
||||
'/shop/shop-merchant/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
95
src_bak/api/shop/shopMerchant/model/index.ts
Normal file
95
src_bak/api/shop/shopMerchant/model/index.ts
Normal file
@@ -0,0 +1,95 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 商户
|
||||
*/
|
||||
export interface ShopMerchant {
|
||||
// ID
|
||||
merchantId?: number;
|
||||
// 商户名称
|
||||
merchantName?: string;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
// 商户类型
|
||||
type?: number;
|
||||
// 商户图标
|
||||
image?: string;
|
||||
// 商户手机号
|
||||
phone?: string;
|
||||
// 商户姓名
|
||||
realName?: string;
|
||||
// 店铺类型
|
||||
shopType?: string;
|
||||
// 项目分类
|
||||
itemType?: string;
|
||||
// 商户分类
|
||||
category?: string;
|
||||
// 商户经营分类
|
||||
merchantCategoryId?: number;
|
||||
// 商户分类
|
||||
merchantCategoryTitle?: string;
|
||||
// 经纬度
|
||||
lngAndLat?: string;
|
||||
//
|
||||
lng?: string;
|
||||
//
|
||||
lat?: string;
|
||||
// 所在省份
|
||||
province?: string;
|
||||
// 所在城市
|
||||
city?: string;
|
||||
// 所在辖区
|
||||
region?: string;
|
||||
// 详细地址
|
||||
address?: string;
|
||||
// 手续费
|
||||
commission?: string;
|
||||
// 关键字
|
||||
keywords?: string;
|
||||
// 资质图片
|
||||
files?: string;
|
||||
// 营业时间
|
||||
businessTime?: string;
|
||||
// 文章内容
|
||||
content?: string;
|
||||
// 每小时价格
|
||||
price?: string;
|
||||
// 是否自营
|
||||
ownStore?: number;
|
||||
// 是否可以快递
|
||||
canExpress?: string;
|
||||
// 是否推荐
|
||||
recommend?: number;
|
||||
// 是否营业
|
||||
isOn?: number;
|
||||
//
|
||||
startTime?: string;
|
||||
//
|
||||
endTime?: string;
|
||||
// 是否需要审核
|
||||
goodsReview?: number;
|
||||
// 管理入口
|
||||
adminUrl?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 所有人
|
||||
userId?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商户搜索条件
|
||||
*/
|
||||
export interface ShopMerchantParam extends PageParam {
|
||||
merchantId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
101
src_bak/api/shop/shopMerchantAccount/index.ts
Normal file
101
src_bak/api/shop/shopMerchantAccount/index.ts
Normal file
@@ -0,0 +1,101 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopMerchantAccount, ShopMerchantAccountParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询商户账号
|
||||
*/
|
||||
export async function pageShopMerchantAccount(params: ShopMerchantAccountParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopMerchantAccount>>>(
|
||||
'/shop/shop-merchant-account/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商户账号列表
|
||||
*/
|
||||
export async function listShopMerchantAccount(params?: ShopMerchantAccountParam) {
|
||||
const res = await request.get<ApiResult<ShopMerchantAccount[]>>(
|
||||
'/shop/shop-merchant-account',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商户账号
|
||||
*/
|
||||
export async function addShopMerchantAccount(data: ShopMerchantAccount) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-account',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商户账号
|
||||
*/
|
||||
export async function updateShopMerchantAccount(data: ShopMerchantAccount) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-account',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商户账号
|
||||
*/
|
||||
export async function removeShopMerchantAccount(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-account/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商户账号
|
||||
*/
|
||||
export async function removeBatchShopMerchantAccount(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-account/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商户账号
|
||||
*/
|
||||
export async function getShopMerchantAccount(id: number) {
|
||||
const res = await request.get<ApiResult<ShopMerchantAccount>>(
|
||||
'/shop/shop-merchant-account/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
39
src_bak/api/shop/shopMerchantAccount/model/index.ts
Normal file
39
src_bak/api/shop/shopMerchantAccount/model/index.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 商户账号
|
||||
*/
|
||||
export interface ShopMerchantAccount {
|
||||
// ID
|
||||
id?: number;
|
||||
// 商户手机号
|
||||
phone?: string;
|
||||
// 真实姓名
|
||||
realName?: string;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 角色ID
|
||||
roleId?: number;
|
||||
// 角色名称
|
||||
roleName?: string;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商户账号搜索条件
|
||||
*/
|
||||
export interface ShopMerchantAccountParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
115
src_bak/api/shop/shopMerchantApply/index.ts
Normal file
115
src_bak/api/shop/shopMerchantApply/index.ts
Normal file
@@ -0,0 +1,115 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopMerchantApply, ShopMerchantApplyParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询商户入驻申请
|
||||
*/
|
||||
export async function pageShopMerchantApply(params: ShopMerchantApplyParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopMerchantApply>>>(
|
||||
'/shop/shop-merchant-apply/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商户入驻申请列表
|
||||
*/
|
||||
export async function listShopMerchantApply(params?: ShopMerchantApplyParam) {
|
||||
const res = await request.get<ApiResult<ShopMerchantApply[]>>(
|
||||
'/shop/shop-merchant-apply',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商户入驻申请
|
||||
*/
|
||||
export async function addShopMerchantApply(data: ShopMerchantApply) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-apply',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商户入驻申请
|
||||
*/
|
||||
export async function updateShopMerchantApply(data: ShopMerchantApply) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-apply',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
// 审核通过
|
||||
export async function checkShopMerchantApply(data: ShopMerchantApply) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-apply/check',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商户入驻申请
|
||||
*/
|
||||
export async function removeShopMerchantApply(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-apply/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商户入驻申请
|
||||
*/
|
||||
export async function removeBatchShopMerchantApply(
|
||||
data: (number | undefined)[]
|
||||
) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-apply/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商户入驻申请
|
||||
*/
|
||||
export async function getShopMerchantApply(id: number) {
|
||||
const res = await request.get<ApiResult<ShopMerchantApply>>(
|
||||
'/shop/shop-merchant-apply/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
72
src_bak/api/shop/shopMerchantApply/model/index.ts
Normal file
72
src_bak/api/shop/shopMerchantApply/model/index.ts
Normal file
@@ -0,0 +1,72 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 商户入驻申请
|
||||
*/
|
||||
export interface ShopMerchantApply {
|
||||
// ID
|
||||
applyId?: number;
|
||||
// 类型
|
||||
type?: number;
|
||||
// 主体名称
|
||||
merchantName?: string;
|
||||
// 证件号码
|
||||
merchantCode?: string;
|
||||
// 商户图标
|
||||
image?: string;
|
||||
// 商户手机号
|
||||
phone?: string;
|
||||
// 商户姓名
|
||||
realName?: string;
|
||||
// 身份证号码
|
||||
idCard?: string;
|
||||
// 店铺类型
|
||||
shopType?: string;
|
||||
// 商户分类
|
||||
category?: string;
|
||||
// 手续费
|
||||
commission?: string;
|
||||
// 关键字
|
||||
keywords?: string;
|
||||
// 营业执照
|
||||
yyzz?: string;
|
||||
// 身份证正面
|
||||
sfz1?: string;
|
||||
// 身份证反面
|
||||
sfz2?: string;
|
||||
// 资质图片
|
||||
files?: string;
|
||||
// 所有人
|
||||
userId?: number;
|
||||
// 是否自营
|
||||
ownStore?: number;
|
||||
// 是否推荐
|
||||
recommend?: number;
|
||||
// 是否需要审核
|
||||
goodsReview?: number;
|
||||
// 工作负责人
|
||||
name2?: string;
|
||||
// 驳回原因
|
||||
reason?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商户入驻申请搜索条件
|
||||
*/
|
||||
export interface ShopMerchantApplyParam extends PageParam {
|
||||
applyId?: number;
|
||||
userId?: number;
|
||||
shopType?: string;
|
||||
phone?: string;
|
||||
keywords?: string;
|
||||
}
|
||||
103
src_bak/api/shop/shopMerchantCount/index.ts
Normal file
103
src_bak/api/shop/shopMerchantCount/index.ts
Normal file
@@ -0,0 +1,103 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopMerchantCount, ShopMerchantCountParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询门店销售统计表
|
||||
*/
|
||||
export async function pageShopMerchantCount(params: ShopMerchantCountParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopMerchantCount>>>(
|
||||
'/shop/shop-merchant-count/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询门店销售统计表列表
|
||||
*/
|
||||
export async function listShopMerchantCount(params?: ShopMerchantCountParam) {
|
||||
const res = await request.get<ApiResult<ShopMerchantCount[]>>(
|
||||
'/shop/shop-merchant-count',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加门店销售统计表
|
||||
*/
|
||||
export async function addShopMerchantCount(data: ShopMerchantCount) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-count',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改门店销售统计表
|
||||
*/
|
||||
export async function updateShopMerchantCount(data: ShopMerchantCount) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-count',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除门店销售统计表
|
||||
*/
|
||||
export async function removeShopMerchantCount(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-count/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除门店销售统计表
|
||||
*/
|
||||
export async function removeBatchShopMerchantCount(
|
||||
data: (number | undefined)[]
|
||||
) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-count/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询门店销售统计表
|
||||
*/
|
||||
export async function getShopMerchantCount(id: number) {
|
||||
const res = await request.get<ApiResult<ShopMerchantCount>>(
|
||||
'/shop/shop-merchant-count/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
29
src_bak/api/shop/shopMerchantCount/model/index.ts
Normal file
29
src_bak/api/shop/shopMerchantCount/model/index.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 门店销售统计表
|
||||
*/
|
||||
export interface ShopMerchantCount {
|
||||
// ID
|
||||
id?: number;
|
||||
// 店铺名称
|
||||
name?: string;
|
||||
// 店铺说明
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 门店销售统计表搜索条件
|
||||
*/
|
||||
export interface ShopMerchantCountParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
103
src_bak/api/shop/shopMerchantType/index.ts
Normal file
103
src_bak/api/shop/shopMerchantType/index.ts
Normal file
@@ -0,0 +1,103 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopMerchantType, ShopMerchantTypeParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询商户类型
|
||||
*/
|
||||
export async function pageShopMerchantType(params: ShopMerchantTypeParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopMerchantType>>>(
|
||||
'/shop/shop-merchant-type/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商户类型列表
|
||||
*/
|
||||
export async function listShopMerchantType(params?: ShopMerchantTypeParam) {
|
||||
const res = await request.get<ApiResult<ShopMerchantType[]>>(
|
||||
'/shop/shop-merchant-type',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商户类型
|
||||
*/
|
||||
export async function addShopMerchantType(data: ShopMerchantType) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-type',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商户类型
|
||||
*/
|
||||
export async function updateShopMerchantType(data: ShopMerchantType) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-type',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商户类型
|
||||
*/
|
||||
export async function removeShopMerchantType(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-type/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商户类型
|
||||
*/
|
||||
export async function removeBatchShopMerchantType(
|
||||
data: (number | undefined)[]
|
||||
) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-type/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商户类型
|
||||
*/
|
||||
export async function getShopMerchantType(id: number) {
|
||||
const res = await request.get<ApiResult<ShopMerchantType>>(
|
||||
'/shop/shop-merchant-type/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
30
src_bak/api/shop/shopMerchantType/model/index.ts
Normal file
30
src_bak/api/shop/shopMerchantType/model/index.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 商户类型
|
||||
*/
|
||||
export interface ShopMerchantType {
|
||||
// ID
|
||||
id?: number;
|
||||
// 店铺类型
|
||||
name?: string;
|
||||
// 店铺入驻条件
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
value?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商户类型搜索条件
|
||||
*/
|
||||
export interface ShopMerchantTypeParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
37
src_bak/api/shop/shopMessage/index.ts
Normal file
37
src_bak/api/shop/shopMessage/index.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import request from '@/utils/request'
|
||||
import type { ShopMessage } from './model'
|
||||
|
||||
/** 获取消息列表 */
|
||||
export function listShopMessage(params?: {
|
||||
page?: number
|
||||
limit?: number
|
||||
type?: string
|
||||
isRead?: boolean
|
||||
}) {
|
||||
return request.get<{ code: number; data: { list: ShopMessage[]; total: number } }>('/user/message/list', params)
|
||||
}
|
||||
|
||||
/** 获取消息详情 */
|
||||
export function getShopMessage(id: string) {
|
||||
return request.get<{ code: number; data: ShopMessage }>(`/user/message/${id}`)
|
||||
}
|
||||
|
||||
/** 标记消息已读 */
|
||||
export function readShopMessage(id: string) {
|
||||
return request.put<{ code: number }>(`/user/message/read/${id}`)
|
||||
}
|
||||
|
||||
/** 删除消息 */
|
||||
export function deleteShopMessage(id: string) {
|
||||
return request.del<{ code: number }>(`/user/message/${id}`)
|
||||
}
|
||||
|
||||
/** 全部标记已读 */
|
||||
export function readAllShopMessage() {
|
||||
return request.put<{ code: number }>('/user/message/read-all')
|
||||
}
|
||||
|
||||
/** 获取未读消息数量 */
|
||||
export function getUnreadMessageCount() {
|
||||
return request.get<{ code: number; data: { count: number } }>('/user/message/unread-count')
|
||||
}
|
||||
20
src_bak/api/shop/shopMessage/model/index.ts
Normal file
20
src_bak/api/shop/shopMessage/model/index.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
/** 消息类型 */
|
||||
export type MessageType = 'system' | 'order' | 'activity'
|
||||
|
||||
/** 消息 */
|
||||
export interface ShopMessage {
|
||||
/** 消息ID */
|
||||
id: string
|
||||
/** 消息类型 */
|
||||
type: MessageType
|
||||
/** 消息标题 */
|
||||
title: string
|
||||
/** 消息内容 */
|
||||
content: string
|
||||
/** 是否已读 */
|
||||
isRead: boolean
|
||||
/** 创建时间 */
|
||||
createdAt: string
|
||||
/** 相关链接(可选) */
|
||||
link?: string
|
||||
}
|
||||
140
src_bak/api/shop/shopNotification/index.ts
Normal file
140
src_bak/api/shop/shopNotification/index.ts
Normal file
@@ -0,0 +1,140 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopNotification, ShopNotificationParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询消息通知
|
||||
*/
|
||||
export async function pageShopNotification(params: ShopNotificationParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopNotification>>>(
|
||||
'/shop/shop-notification/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询全部消息通知
|
||||
*/
|
||||
export async function listShopNotification(params?: ShopNotificationParam) {
|
||||
const res = await request.get<ApiResult<ShopNotification[]>>(
|
||||
'/shop/shop-notification',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询消息通知
|
||||
*/
|
||||
export async function getShopNotification(id: number) {
|
||||
const res = await request.get<ApiResult<ShopNotification>>(
|
||||
'/shop/shop-notification/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加消息通知
|
||||
*/
|
||||
export async function addShopNotification(data: ShopNotification) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-notification',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改消息通知
|
||||
*/
|
||||
export async function updateShopNotification(data: ShopNotification) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-notification',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除消息通知
|
||||
*/
|
||||
export async function removeShopNotification(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-notification/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户消息列表
|
||||
*/
|
||||
export async function getShopNotificationByUserId(userId: number) {
|
||||
const res = await request.get<ApiResult<ShopNotification[]>>(
|
||||
'/shop/shop-notification/user/' + userId
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 标记消息已读
|
||||
*/
|
||||
export async function markShopNotificationAsRead(id: number, userId: number) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-notification/read/' + id + '?userId=' + userId,
|
||||
null
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 标记全部已读
|
||||
*/
|
||||
export async function markAllShopNotificationAsRead(userId: number) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-notification/read-all?userId=' + userId,
|
||||
null
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取未读消息数量
|
||||
*/
|
||||
export async function getShopNotificationUnreadCount(userId: number) {
|
||||
const res = await request.get<ApiResult<number>>(
|
||||
'/shop/shop-notification/unread-count',
|
||||
{ userId }
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
25
src_bak/api/shop/shopNotification/model/index.ts
Normal file
25
src_bak/api/shop/shopNotification/model/index.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
export interface ShopNotification {
|
||||
id?: number;
|
||||
userId?: number;
|
||||
type?: number; // 1系统通知 2订单消息 3优惠活动 4物流通知
|
||||
title?: string;
|
||||
content?: string;
|
||||
relationId?: number;
|
||||
relationType?: string;
|
||||
isRead?: number; // 0未读 1已读
|
||||
readTime?: string;
|
||||
tenantId?: number;
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
export interface ShopNotificationParam {
|
||||
id?: number;
|
||||
userId?: number;
|
||||
type?: number;
|
||||
title?: string;
|
||||
isRead?: number;
|
||||
tenantId?: number;
|
||||
keywords?: string;
|
||||
createTimeStart?: string;
|
||||
createTimeEnd?: string;
|
||||
}
|
||||
194
src_bak/api/shop/shopOrder/index.ts
Normal file
194
src_bak/api/shop/shopOrder/index.ts
Normal file
@@ -0,0 +1,194 @@
|
||||
import request, { ErrorType, RequestError } from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopOrder, ShopOrderParam, OrderCreateRequest } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询订单
|
||||
*/
|
||||
export async function pageShopOrder(params: ShopOrderParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopOrder>>>(
|
||||
'/shop/shop-order/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
*/
|
||||
export async function listShopOrder(params?: ShopOrderParam) {
|
||||
const res = await request.get<ApiResult<ShopOrder[]>>(
|
||||
'/shop/shop-order',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加订单
|
||||
*/
|
||||
export async function addShopOrder(data: ShopOrder) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-order',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单
|
||||
*/
|
||||
export async function updateShopOrder(data: ShopOrder) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-order',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单
|
||||
*/
|
||||
export async function removeShopOrder(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-order/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除订单
|
||||
*/
|
||||
export async function removeBatchShopOrder(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/shop/shop-order/batch',
|
||||
{ ids: data.filter(Boolean) }
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询订单
|
||||
*/
|
||||
export async function getShopOrder(id: number) {
|
||||
const res = await request.get<ApiResult<ShopOrder>>(
|
||||
'/shop/shop-order/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信支付返回数据
|
||||
*/
|
||||
export interface WxPayResult {
|
||||
prepayId: string;
|
||||
orderNo: string;
|
||||
timeStamp: string;
|
||||
nonceStr: string;
|
||||
package: string;
|
||||
signType: string;
|
||||
paySign: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单重新发起支付(对"已创建但未支付"的订单生成新的预支付参数,不应重复创建订单)
|
||||
*
|
||||
* 说明:不同后端版本可能暴露不同路径,这里做兼容探测;若全部失败,调用方可自行降级处理。
|
||||
*/
|
||||
export interface OrderPrepayRequest {
|
||||
orderId: number;
|
||||
payType: number;
|
||||
}
|
||||
|
||||
export async function prepayShopOrder(data: OrderPrepayRequest) {
|
||||
const urls = [
|
||||
'/shop/shop-order/pay',
|
||||
'/shop/shop-order/prepay',
|
||||
'/shop/shop-order/repay'
|
||||
];
|
||||
|
||||
let lastError: unknown;
|
||||
let businessError: unknown;
|
||||
for (const url of urls) {
|
||||
try {
|
||||
const res = await request.post<ApiResult<WxPayResult>>(url, data, { showError: false });
|
||||
// request.ts 在 code!=0 时会直接 throw;走到这里通常都是 code===0
|
||||
if (res.code === 0) return res.data;
|
||||
} catch (e) {
|
||||
// 若已命中"业务错误"(例如订单已取消/已支付),优先保留该错误用于向上提示;
|
||||
// 不要被后续的 404/网络错误覆盖掉,避免调用方误判为"不支持该接口"而降级走创建订单。
|
||||
if (!businessError && e instanceof RequestError && e.type === ErrorType.BUSINESS_ERROR) {
|
||||
businessError = e;
|
||||
} else {
|
||||
lastError = e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Promise.reject(businessError || lastError || new Error('发起支付失败'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建订单
|
||||
*/
|
||||
export async function createOrder(data: OrderCreateRequest) {
|
||||
// Java 后端期望 camelCase 字段,直接传
|
||||
const res = await request.post<ApiResult<WxPayResult>>(
|
||||
'/shop/shop-order',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修复订单支付状态
|
||||
*/
|
||||
export async function repairOrder(data: ShopOrder) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-order/repair',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 申请|同意退款
|
||||
*/
|
||||
export async function refundShopOrder(data: ShopOrder) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-order/refund',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
231
src_bak/api/shop/shopOrder/model/index.ts
Normal file
231
src_bak/api/shop/shopOrder/model/index.ts
Normal file
@@ -0,0 +1,231 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
import type { ShopOrderGoods } from '@/api/shop/shopOrderGoods/model';
|
||||
|
||||
/**
|
||||
* 订单
|
||||
*/
|
||||
export interface ShopOrder {
|
||||
// 订单号
|
||||
orderId?: number;
|
||||
// 订单编号
|
||||
orderNo?: string;
|
||||
// 订单类型,0商城订单 1预定订单/外卖 2会员卡
|
||||
type?: number;
|
||||
// 标题
|
||||
title?: string;
|
||||
// 快递/自提
|
||||
deliveryType?: number;
|
||||
// 下单渠道,0小程序预定 1俱乐部训练场 3活动订场
|
||||
channel?: number;
|
||||
// 微信支付订单号
|
||||
transactionId?: string;
|
||||
// 微信退款订单号
|
||||
refundOrder?: string;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 商户名称
|
||||
merchantName?: string;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
// 归属门店ID(shop_store.id)
|
||||
storeId?: number;
|
||||
// 归属门店名称
|
||||
storeName?: string;
|
||||
// 配送员用户ID(优先级派单)
|
||||
riderId?: number;
|
||||
// 发货仓库ID
|
||||
warehouseId?: number;
|
||||
// 使用的优惠券id
|
||||
couponId?: number;
|
||||
// 使用的会员卡id
|
||||
cardId?: string;
|
||||
// 关联管理员id
|
||||
adminId?: number;
|
||||
// 核销管理员id
|
||||
confirmId?: number;
|
||||
// IC卡号
|
||||
icCard?: string;
|
||||
// 头像
|
||||
avatar?: string;
|
||||
// 真实姓名
|
||||
realName?: string;
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
// 手机号码(脱敏)
|
||||
mobile?: string;
|
||||
// 关联收货地址
|
||||
addressId?: number;
|
||||
// 收货地址
|
||||
address?: string;
|
||||
//
|
||||
addressLat?: string;
|
||||
//
|
||||
addressLng?: string;
|
||||
// 自提店铺id
|
||||
selfTakeMerchantId?: number;
|
||||
// 自提店铺
|
||||
selfTakeMerchantName?: string;
|
||||
// 配送开始时间
|
||||
sendStartTime?: string;
|
||||
// 配送结束时间
|
||||
sendEndTime?: string;
|
||||
// 配送员送达拍照(选填)
|
||||
sendEndImg?: string;
|
||||
// 发货店铺id
|
||||
expressMerchantId?: number;
|
||||
// 发货店铺
|
||||
expressMerchantName?: string;
|
||||
// 订单总额
|
||||
totalPrice?: string;
|
||||
// 减少的金额,使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格
|
||||
reducePrice?: string;
|
||||
// 实际付款
|
||||
payPrice?: string;
|
||||
// 用于统计
|
||||
price?: string;
|
||||
// 价钱,用于积分赠送
|
||||
money?: string;
|
||||
// 退款金额
|
||||
refundMoney?: string;
|
||||
// 教练价格
|
||||
coachPrice?: string;
|
||||
// 购买数量
|
||||
totalNum?: number;
|
||||
// 教练id
|
||||
coachId?: number;
|
||||
// 商品ID
|
||||
formId?: number;
|
||||
// 支付的用户id
|
||||
payUserId?: number;
|
||||
// 0余额支付, 1微信支付,102微信Native,2会员卡支付,3支付宝,4现金,5POS机,6VIP月卡,7VIP年卡,8VIP次卡,9IC月卡,10IC年卡,11IC次卡,12免费,13VIP充值卡,14IC充值卡,15积分支付,16VIP季卡,17IC季卡,18代付
|
||||
payType?: number;
|
||||
// 代付支付方式,0余额支付, 1微信支付,102微信Native,2会员卡支付,3支付宝,4现金,5POS机,6VIP月卡,7VIP年卡,8VIP次卡,9IC月卡,10IC年卡,11IC次卡,12免费,13VIP充值卡,14IC充值卡,15积分支付,16VIP季卡,17IC季卡,18代付
|
||||
friendPayType?: number;
|
||||
// 0未付款,1已付款
|
||||
payStatus?: boolean;
|
||||
// 0未使用,1已完成,2已取消,3取消中,4退款申请中,5退款被拒绝,6退款成功,7客户端申请退款
|
||||
orderStatus?: number;
|
||||
// 发货状态(10未发货 20已发货 30部分发货)
|
||||
deliveryStatus?: number;
|
||||
// 发货时间
|
||||
deliveryTime?: string;
|
||||
// 优惠类型:0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡,5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡
|
||||
couponType?: number;
|
||||
// 优惠说明
|
||||
couponDesc?: string;
|
||||
// 二维码地址,保存订单号,支付成功后才生成
|
||||
qrcode?: string;
|
||||
// vip月卡年卡、ic月卡年卡回退次数
|
||||
returnNum?: number;
|
||||
// vip充值回退金额
|
||||
returnMoney?: string;
|
||||
// 预约详情开始时间数组
|
||||
startTime?: string;
|
||||
// 是否已开具发票:0未开发票,1已开发票,2不能开具发票
|
||||
isInvoice?: number;
|
||||
// 发票流水号
|
||||
invoiceNo?: string;
|
||||
// 支付时间
|
||||
payTime?: string;
|
||||
// 退款时间
|
||||
refundTime?: string;
|
||||
// 申请退款时间
|
||||
refundApplyTime?: string;
|
||||
// 过期时间
|
||||
expirationTime?: string;
|
||||
// 对账情况:0=未对账;1=已对账;3=已对账,金额对不上;4=未查询到该订单
|
||||
checkBill?: number;
|
||||
// 订单是否已结算(0未结算 1已结算)
|
||||
isSettled?: number;
|
||||
// 系统版本号 0当前版本 value=其他版本
|
||||
version?: number;
|
||||
// 用户id
|
||||
userId?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 自提码
|
||||
selfTakeCode?: string;
|
||||
// 是否已收到赠品
|
||||
hasTakeGift?: string;
|
||||
// 订单商品项
|
||||
orderGoods?: ShopOrderGoods[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单商品项
|
||||
*/
|
||||
export interface OrderGoodsItem {
|
||||
goodsId: number;
|
||||
quantity: number;
|
||||
skuId?: number;
|
||||
specInfo?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建订单请求
|
||||
*/
|
||||
export interface OrderCreateRequest {
|
||||
// 商品信息列表
|
||||
goodsItems: OrderGoodsItem[];
|
||||
// 归属门店ID(shop_store.id)
|
||||
storeId?: number;
|
||||
// 归属门店名称(可选)
|
||||
storeName?: string;
|
||||
// 配送员用户ID(优先级派单)
|
||||
riderId?: number;
|
||||
// 发货仓库ID
|
||||
warehouseId?: number;
|
||||
// 收货地址ID
|
||||
addressId?: number;
|
||||
// 支付方式
|
||||
payType: number;
|
||||
// 优惠券ID
|
||||
couponId?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 配送开始时间(用于预约/配送时间)
|
||||
sendStartTime?: string;
|
||||
// 配送方式 0快递 1自提
|
||||
deliveryType?: number;
|
||||
// 自提店铺ID
|
||||
selfTakeMerchantId?: number;
|
||||
// 订单标题(可选,后端会自动生成)
|
||||
title?: string;
|
||||
// 配送方式:elevator(电梯) / stairs(步梯) / groundFloor(一楼商铺/其他)
|
||||
deliveryMethod?: string;
|
||||
// 楼层(步梯+送上楼时有值,从2开始)
|
||||
deliveryFloor?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单搜索条件
|
||||
*/
|
||||
export interface ShopOrderParam extends PageParam {
|
||||
orderId?: number;
|
||||
orderNo?: string;
|
||||
phone?: string;
|
||||
payStatus?: number;
|
||||
orderStatus?: number;
|
||||
payType?: number;
|
||||
isInvoice?: boolean;
|
||||
userId?: number;
|
||||
// 归属门店ID(shop_store.id)
|
||||
storeId?: number;
|
||||
// 配送员用户ID
|
||||
riderId?: number;
|
||||
// 发货仓库ID
|
||||
warehouseId?: number;
|
||||
keywords?: string;
|
||||
deliveryStatus?: number;
|
||||
statusFilter?: number;
|
||||
}
|
||||
30
src_bak/api/shop/shopOrderGoods/index.ts
Normal file
30
src_bak/api/shop/shopOrderGoods/index.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import type { ShopOrderGoods } from '@/api/shop/shopOrderGoods/model';
|
||||
|
||||
/**
|
||||
* 根据订单ID查询订单商品列表
|
||||
*/
|
||||
export async function listShopOrderGoodsByOrderId(orderId: number) {
|
||||
const res = await request.get<ApiResult<ShopOrderGoods[]>>(
|
||||
'/shop/shop-order-goods',
|
||||
{ orderId }
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID查询订单商品
|
||||
*/
|
||||
export async function getShopOrderGoods(id: number) {
|
||||
const res = await request.get<ApiResult<ShopOrderGoods>>(
|
||||
'/shop/shop-order-goods/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
70
src_bak/api/shop/shopOrderGoods/model/index.ts
Normal file
70
src_bak/api/shop/shopOrderGoods/model/index.ts
Normal file
@@ -0,0 +1,70 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商品信息
|
||||
*/
|
||||
export interface ShopOrderGoods {
|
||||
// 自增ID
|
||||
id?: number;
|
||||
// 关联订单表id
|
||||
orderId?: number;
|
||||
// 订单标识
|
||||
orderCode?: string;
|
||||
// 关联商户ID
|
||||
merchantId?: number;
|
||||
// 商户名称
|
||||
merchantName?: string;
|
||||
// 商品封面图
|
||||
image?: string;
|
||||
// 关联商品id
|
||||
goodsId?: number;
|
||||
// 商品名称
|
||||
goodsName?: string;
|
||||
// 商品规格
|
||||
spec?: string;
|
||||
//
|
||||
skuId?: number;
|
||||
// 单价
|
||||
price?: string;
|
||||
// 购买数量
|
||||
totalNum?: number;
|
||||
// 0 未付款 1已付款,2无需付款或占用状态
|
||||
payStatus?: number;
|
||||
// 0未使用,1已完成,2已取消,3取消中,4退款申请中,5退款被拒绝,6退款成功,7客户端申请退款
|
||||
orderStatus?: number;
|
||||
// 是否免费:0收费、1免费
|
||||
isFree?: string;
|
||||
// 系统版本 0当前版本 其他版本
|
||||
version?: number;
|
||||
// 预约时间段
|
||||
timePeriod?: string;
|
||||
// 预定日期
|
||||
dateTime?: string;
|
||||
// 开场时间
|
||||
startTime?: string;
|
||||
// 结束时间
|
||||
endTime?: string;
|
||||
// 毫秒时间戳
|
||||
timeFlag?: string;
|
||||
// 过期时间
|
||||
expirationTime?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 用户id
|
||||
userId?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 更新时间
|
||||
updateTime?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品信息搜索条件
|
||||
*/
|
||||
export interface ShopOrderGoodsParam extends PageParam {
|
||||
id?: number;
|
||||
orderId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
52
src_bak/api/shop/shopOrderRefund/index.ts
Normal file
52
src_bak/api/shop/shopOrderRefund/index.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export interface RefundDetail {
|
||||
orderNo: string;
|
||||
refundMoney: string;
|
||||
reason: string;
|
||||
status: number;
|
||||
statusText: string;
|
||||
time: string;
|
||||
steps: RefundStep[];
|
||||
}
|
||||
|
||||
export interface RefundStep {
|
||||
title: string;
|
||||
desc: string;
|
||||
time: string;
|
||||
done: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取退款详情
|
||||
* @param orderId 订单ID
|
||||
* @returns 退款详情
|
||||
*/
|
||||
export async function getRefundDetail(orderId: string): Promise<RefundDetail> {
|
||||
try {
|
||||
const res = await request.get('/order/refund/detail', {
|
||||
params: { orderId }
|
||||
});
|
||||
return res.data;
|
||||
} catch (error) {
|
||||
console.error('获取退款详情失败', error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消退款申请
|
||||
* @param orderId 订单ID
|
||||
* @returns 是否成功
|
||||
*/
|
||||
export async function cancelRefund(orderId: string): Promise<boolean> {
|
||||
try {
|
||||
const res = await request.post('/order/refund/cancel', {
|
||||
data: { orderId }
|
||||
});
|
||||
return res.code === 0;
|
||||
} catch (error) {
|
||||
console.error('取消退款失败', error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
66
src_bak/api/shop/shopPointsOrder/index.ts
Normal file
66
src_bak/api/shop/shopPointsOrder/index.ts
Normal file
@@ -0,0 +1,66 @@
|
||||
import request from '@/utils/request'
|
||||
import type { ApiResult, PageResult } from '@/api'
|
||||
import type { ShopPointsOrder, PointsOrderStatus, CreatePointsOrderParams } from './model'
|
||||
|
||||
export type { ShopPointsOrder, PointsOrderStatus, CreatePointsOrderParams } from './model'
|
||||
|
||||
/** 查询积分订单列表参数 */
|
||||
export interface ListShopPointsOrderParams {
|
||||
page?: number
|
||||
limit?: number
|
||||
status?: PointsOrderStatus
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询积分订单列表
|
||||
*/
|
||||
export async function listShopPointsOrder(params?: ListShopPointsOrderParams) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopPointsOrder>>>(
|
||||
'/shop/shop-points-order/page',
|
||||
params
|
||||
)
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取积分订单详情
|
||||
*/
|
||||
export async function getShopPointsOrder(id: string) {
|
||||
const res = await request.get<ApiResult<ShopPointsOrder>>(
|
||||
'/shop/shop-points-order/' + id
|
||||
)
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建积分兑换订单
|
||||
*/
|
||||
export async function createPointsOrder(data: CreatePointsOrderParams) {
|
||||
const res = await request.post<ApiResult<ShopPointsOrder>>(
|
||||
'/shop/shop-points-order',
|
||||
data
|
||||
)
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消积分订单
|
||||
*/
|
||||
export async function cancelShopPointsOrder(id: string) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-points-order/cancel/' + id
|
||||
)
|
||||
if (res.code === 0) {
|
||||
return true
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
62
src_bak/api/shop/shopPointsOrder/model/index.ts
Normal file
62
src_bak/api/shop/shopPointsOrder/model/index.ts
Normal file
@@ -0,0 +1,62 @@
|
||||
/** 积分订单状态 */
|
||||
export type PointsOrderStatus = 'pending' | 'paid' | 'shipped' | 'completed' | 'cancelled'
|
||||
|
||||
/** 积分订单商品 */
|
||||
export interface PointsOrderItem {
|
||||
/** 商品ID */
|
||||
goodsId: string
|
||||
/** 商品名称 */
|
||||
goodsName: string
|
||||
/** 商品图片 */
|
||||
goodsImage: string
|
||||
/** 兑换积分 */
|
||||
points: number
|
||||
/** 补差价金额 */
|
||||
moneyAmount?: string
|
||||
/** 数量 */
|
||||
quantity: number
|
||||
}
|
||||
|
||||
/** 积分订单 */
|
||||
export interface ShopPointsOrder {
|
||||
/** 订单ID */
|
||||
id: string
|
||||
/** 订单号 */
|
||||
orderNo: string
|
||||
/** 订单状态 */
|
||||
status: PointsOrderStatus
|
||||
/** 总积分 */
|
||||
totalPoints: number
|
||||
/** 补差价金额 */
|
||||
moneyAmount?: string
|
||||
/** 支付方式: 1微信 0余额 */
|
||||
payType?: number
|
||||
/** 商品列表 */
|
||||
items: PointsOrderItem[]
|
||||
/** 收货人 */
|
||||
receiverName?: string
|
||||
/** 收货电话 */
|
||||
receiverPhone?: string
|
||||
/** 收货地址 */
|
||||
address: string
|
||||
/** 物流单号 */
|
||||
trackingNo?: string
|
||||
/** 物流公司 */
|
||||
trackingCompany?: string
|
||||
/** 创建时间 */
|
||||
createdAt: string
|
||||
/** 更新时间 */
|
||||
updatedAt?: string
|
||||
}
|
||||
|
||||
/** 创建积分订单参数 */
|
||||
export interface CreatePointsOrderParams {
|
||||
/** 商品ID */
|
||||
productId: number
|
||||
/** 数量 */
|
||||
quantity?: number
|
||||
/** 收货地址ID(实物商品必填) */
|
||||
addressId?: number
|
||||
/** 支付方式: 1微信 0余额(补差价时必填) */
|
||||
payType?: number
|
||||
}
|
||||
44
src_bak/api/shop/shopPointsProduct/index.ts
Normal file
44
src_bak/api/shop/shopPointsProduct/index.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
import type { ApiResult, PageResult } from '@/api'
|
||||
import type { ShopPointsProduct, ShopPointsProductParam } from './model'
|
||||
|
||||
/**
|
||||
* 分页查询积分兑换商品表
|
||||
*/
|
||||
export async function pageShopPointsProduct(params: ShopPointsProductParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopPointsProduct>>>(
|
||||
'/shop/shop-points-product/page',
|
||||
params
|
||||
)
|
||||
if (res.code === 0) {
|
||||
return res.data
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询积分兑换商品表列表
|
||||
*/
|
||||
export async function listShopPointsProduct(params?: ShopPointsProductParam) {
|
||||
const res = await request.get<ApiResult<ShopPointsProduct[]>>(
|
||||
'/shop/shop-points-product',
|
||||
params
|
||||
)
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询积分兑换商品详情
|
||||
*/
|
||||
export async function getShopPointsProduct(id: number) {
|
||||
const res = await request.get<ApiResult<ShopPointsProduct>>(
|
||||
'/shop/shop-points-product/' + id
|
||||
)
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
51
src_bak/api/shop/shopPointsProduct/model/index.ts
Normal file
51
src_bak/api/shop/shopPointsProduct/model/index.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* 积分兑换商品表
|
||||
*/
|
||||
export interface ShopPointsProduct {
|
||||
/** ID */
|
||||
id?: number
|
||||
/** 商品名称 */
|
||||
productName?: string
|
||||
/** 商品图片 */
|
||||
productImage?: string
|
||||
/** 商品类型: 0实物 1优惠券 2虚拟商品 */
|
||||
productType?: number
|
||||
/** 优惠券ID(商品类型为优惠券时) */
|
||||
couponId?: number
|
||||
/** 兑换所需积分 */
|
||||
pointsPrice?: number
|
||||
/** 补差价金额 */
|
||||
moneyPrice?: string
|
||||
/** 库存 */
|
||||
stock?: number
|
||||
/** 兑换量 */
|
||||
sales?: number
|
||||
/** 商品描述 */
|
||||
description?: string
|
||||
/** 是否热门: 0否 1是 */
|
||||
isHot?: number
|
||||
/** 状态: 0下架 1上架 */
|
||||
status?: number
|
||||
/** 排序号 */
|
||||
sortNumber?: number
|
||||
/** 创建时间 */
|
||||
createTime?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* 积分兑换商品搜索条件
|
||||
*/
|
||||
export interface ShopPointsProductParam {
|
||||
/** 页码 */
|
||||
page?: number
|
||||
/** 每页数量 */
|
||||
limit?: number
|
||||
/** ID */
|
||||
id?: number
|
||||
/** 关键词 */
|
||||
keywords?: string
|
||||
/** 是否热门 */
|
||||
isHot?: number
|
||||
/** 状态 */
|
||||
status?: number
|
||||
}
|
||||
35
src_bak/api/shop/shopRecharge/index.ts
Normal file
35
src_bak/api/shop/shopRecharge/index.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import request from '@/utils/request'
|
||||
import type { ApiResult } from '@/api'
|
||||
import type { UserRecharge, RechargeRequest } from './model'
|
||||
|
||||
export type { UserRecharge, RechargeRequest }
|
||||
|
||||
/**
|
||||
* 创建用户充值订单
|
||||
* 注意:后端可能需要实现此接口
|
||||
*/
|
||||
export async function createUserRecharge(data: RechargeRequest): Promise<UserRecharge> {
|
||||
const res = await request.post<ApiResult<UserRecharge>>(
|
||||
'/shop/shop-recharge/create',
|
||||
data
|
||||
)
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 发起充值支付
|
||||
* 注意:后端可能需要实现此接口
|
||||
*/
|
||||
export async function payUserRecharge(rechargeId: number): Promise<any> {
|
||||
const res = await request.post<ApiResult<any>>(
|
||||
'/shop/shop-recharge/pay',
|
||||
{ rechargeId }
|
||||
)
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
17
src_bak/api/shop/shopRecharge/model/index.ts
Normal file
17
src_bak/api/shop/shopRecharge/model/index.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* 用户充值类型定义
|
||||
*/
|
||||
|
||||
export interface UserRecharge {
|
||||
rechargeId?: number
|
||||
orderNo?: string
|
||||
amount?: string
|
||||
payType?: number
|
||||
payStatus?: number
|
||||
createTime?: string
|
||||
}
|
||||
|
||||
export interface RechargeRequest {
|
||||
amount: string
|
||||
payType: number
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user