feat: mall api
							parent
							
								
									23aacea84c
								
							
						
					
					
						commit
						dbb9a33fda
					
				|  | @ -0,0 +1,45 @@ | ||||||
|  | import type { PageParam, PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace BannerApi { | ||||||
|  |   /** Banner 信息 */ | ||||||
|  |   export interface Banner { | ||||||
|  |     id: number; | ||||||
|  |     title: string; | ||||||
|  |     picUrl: string; | ||||||
|  |     status: number; | ||||||
|  |     url: string; | ||||||
|  |     position: number; | ||||||
|  |     sort: number; | ||||||
|  |     memo: string; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询Banner管理列表 */ | ||||||
|  | export function getBannerPage(params: PageParam) { | ||||||
|  |   return requestClient.get<PageResult<BannerApi.Banner>>( | ||||||
|  |     '/promotion/banner/page', | ||||||
|  |     { params }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询Banner管理详情 */ | ||||||
|  | export function getBanner(id: number) { | ||||||
|  |   return requestClient.get<BannerApi.Banner>(`/promotion/banner/get?id=${id}`); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 新增Banner管理 */ | ||||||
|  | export function createBanner(data: BannerApi.Banner) { | ||||||
|  |   return requestClient.post('/promotion/banner/create', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 修改Banner管理 */ | ||||||
|  | export function updateBanner(data: BannerApi.Banner) { | ||||||
|  |   return requestClient.put('/promotion/banner/update', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 删除Banner管理 */ | ||||||
|  | export function deleteBanner(id: number) { | ||||||
|  |   return requestClient.delete(`/promotion/banner/delete?id=${id}`); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,53 @@ | ||||||
|  | import type { PageParam, PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace BrandApi { | ||||||
|  |   /** 商品品牌 */ | ||||||
|  |   export interface Brand { | ||||||
|  |     /** 品牌编号 */ | ||||||
|  |     id?: number; | ||||||
|  |     /** 品牌名称 */ | ||||||
|  |     name: string; | ||||||
|  |     /** 品牌图片 */ | ||||||
|  |     picUrl: string; | ||||||
|  |     /** 品牌排序 */ | ||||||
|  |     sort?: number; | ||||||
|  |     /** 品牌描述 */ | ||||||
|  |     description?: string; | ||||||
|  |     /** 开启状态 */ | ||||||
|  |     status: number; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 创建商品品牌 */ | ||||||
|  | export function createBrand(data: BrandApi.Brand) { | ||||||
|  |   return requestClient.post('/product/brand/create', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 更新商品品牌 */ | ||||||
|  | export function updateBrand(data: BrandApi.Brand) { | ||||||
|  |   return requestClient.put('/product/brand/update', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 删除商品品牌 */ | ||||||
|  | export function deleteBrand(id: number) { | ||||||
|  |   return requestClient.delete(`/product/brand/delete?id=${id}`); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得商品品牌 */ | ||||||
|  | export function getBrand(id: number) { | ||||||
|  |   return requestClient.get<BrandApi.Brand>(`/product/brand/get?id=${id}`); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得商品品牌列表 */ | ||||||
|  | export function getBrandPage(params: PageParam) { | ||||||
|  |   return requestClient.get<PageResult<BrandApi.Brand>>('/product/brand/page', { | ||||||
|  |     params, | ||||||
|  |   }); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得商品品牌精简信息列表 */ | ||||||
|  | export function getSimpleBrandList() { | ||||||
|  |   return requestClient.get<BrandApi.Brand[]>('/product/brand/list-all-simple'); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,51 @@ | ||||||
|  | import type { PageParam, PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace CategoryApi { | ||||||
|  |   /** 产品分类 */ | ||||||
|  |   export interface Category { | ||||||
|  |     /** 分类编号 */ | ||||||
|  |     id?: number; | ||||||
|  |     /** 父分类编号 */ | ||||||
|  |     parentId?: number; | ||||||
|  |     /** 分类名称 */ | ||||||
|  |     name: string; | ||||||
|  |     /** 移动端分类图 */ | ||||||
|  |     picUrl: string; | ||||||
|  |     /** 分类排序 */ | ||||||
|  |     sort: number; | ||||||
|  |     /** 开启状态 */ | ||||||
|  |     status: number; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 创建商品分类 */ | ||||||
|  | export function createCategory(data: CategoryApi.Category) { | ||||||
|  |   return requestClient.post('/product/category/create', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 更新商品分类 */ | ||||||
|  | export function updateCategory(data: CategoryApi.Category) { | ||||||
|  |   return requestClient.put('/product/category/update', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 删除商品分类 */ | ||||||
|  | export function deleteCategory(id: number) { | ||||||
|  |   return requestClient.delete(`/product/category/delete?id=${id}`); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得商品分类 */ | ||||||
|  | export function getCategory(id: number) { | ||||||
|  |   return requestClient.get<CategoryApi.Category>( | ||||||
|  |     `/product/category/get?id=${id}`, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得商品分类列表 */ | ||||||
|  | export function getCategoryList(params: PageParam) { | ||||||
|  |   return requestClient.get<PageResult<CategoryApi.Category>>( | ||||||
|  |     '/product/category/list', | ||||||
|  |     { params }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,69 @@ | ||||||
|  | import type { PageParam, PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace CommentApi { | ||||||
|  |   /** 商品评论 */ | ||||||
|  |   export interface Comment { | ||||||
|  |     id: number; | ||||||
|  |     userId: number; | ||||||
|  |     userNickname: string; | ||||||
|  |     userAvatar: string; | ||||||
|  |     anonymous: boolean; | ||||||
|  |     orderId: number; | ||||||
|  |     orderItemId: number; | ||||||
|  |     spuId: number; | ||||||
|  |     spuName: string; | ||||||
|  |     skuId: number; | ||||||
|  |     visible: boolean; | ||||||
|  |     scores: number; | ||||||
|  |     descriptionScores: number; | ||||||
|  |     benefitScores: number; | ||||||
|  |     content: string; | ||||||
|  |     picUrls: string; | ||||||
|  |     replyStatus: boolean; | ||||||
|  |     replyUserId: number; | ||||||
|  |     replyContent: string; | ||||||
|  |     replyTime: Date; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 评论可见性更新 */ | ||||||
|  |   export interface CommentVisibleUpdate { | ||||||
|  |     id: number; | ||||||
|  |     visible: boolean; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 评论回复 */ | ||||||
|  |   export interface CommentReply { | ||||||
|  |     id: number; | ||||||
|  |     replyContent: string; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询商品评论列表 */ | ||||||
|  | export function getCommentPage(params: PageParam) { | ||||||
|  |   return requestClient.get<PageResult<CommentApi.Comment>>( | ||||||
|  |     '/product/comment/page', | ||||||
|  |     { params }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询商品评论详情 */ | ||||||
|  | export function getComment(id: number) { | ||||||
|  |   return requestClient.get<CommentApi.Comment>(`/product/comment/get?id=${id}`); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 添加自评 */ | ||||||
|  | export function createComment(data: CommentApi.Comment) { | ||||||
|  |   return requestClient.post('/product/comment/create', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 显示 / 隐藏评论 */ | ||||||
|  | export function updateCommentVisible(data: CommentApi.CommentVisibleUpdate) { | ||||||
|  |   return requestClient.put('/product/comment/update-visible', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 商家回复 */ | ||||||
|  | export function replyComment(data: CommentApi.CommentReply) { | ||||||
|  |   return requestClient.put('/product/comment/reply', data); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,23 @@ | ||||||
|  | import type { PageParam, PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace FavoriteApi { | ||||||
|  |   /** 商品收藏 */ | ||||||
|  |   export interface Favorite { | ||||||
|  |     /** 收藏编号 */ | ||||||
|  |     id?: number; | ||||||
|  |     /** 用户编号 */ | ||||||
|  |     userId?: string; | ||||||
|  |     /** 商品 SPU 编号 */ | ||||||
|  |     spuId?: null | number; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得商品收藏列表 */ | ||||||
|  | export function getFavoritePage(params: PageParam) { | ||||||
|  |   return requestClient.get<PageResult<FavoriteApi.Favorite>>( | ||||||
|  |     '/product/favorite/page', | ||||||
|  |     { params }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,29 @@ | ||||||
|  | import type { PageParam, PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace HistoryApi { | ||||||
|  |   /** 商品浏览记录 */ | ||||||
|  |   export interface BrowseHistory { | ||||||
|  |     /** 记录编号 */ | ||||||
|  |     id?: number; | ||||||
|  |     /** 用户编号 */ | ||||||
|  |     userId?: number; | ||||||
|  |     /** 商品 SPU 编号 */ | ||||||
|  |     spuId?: number; | ||||||
|  |     /** 浏览时间 */ | ||||||
|  |     createTime?: Date; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * 获得商品浏览记录分页 | ||||||
|  |  * | ||||||
|  |  * @param params 请求参数 | ||||||
|  |  */ | ||||||
|  | export function getBrowseHistoryPage(params: PageParam) { | ||||||
|  |   return requestClient.get<PageResult<HistoryApi.BrowseHistory>>( | ||||||
|  |     '/product/browse-history/page', | ||||||
|  |     { params }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,109 @@ | ||||||
|  | import type { PageParam, PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace PropertyApi { | ||||||
|  |   /** 商品属性 */ | ||||||
|  |   export interface Property { | ||||||
|  |     /** 属性编号 */ | ||||||
|  |     id?: number; | ||||||
|  |     /** 名称 */ | ||||||
|  |     name: string; | ||||||
|  |     /** 备注 */ | ||||||
|  |     remark?: string; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 属性值 */ | ||||||
|  |   export interface PropertyValue { | ||||||
|  |     /** 属性值编号 */ | ||||||
|  |     id?: number; | ||||||
|  |     /** 属性项的编号 */ | ||||||
|  |     propertyId?: number; | ||||||
|  |     /** 名称 */ | ||||||
|  |     name: string; | ||||||
|  |     /** 备注 */ | ||||||
|  |     remark?: string; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 属性值查询参数 */ | ||||||
|  |   export interface PropertyValueQuery extends PageParam { | ||||||
|  |     propertyId?: number; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 创建属性项 */ | ||||||
|  | export function createProperty(data: PropertyApi.Property) { | ||||||
|  |   return requestClient.post('/product/property/create', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 更新属性项 */ | ||||||
|  | export function updateProperty(data: PropertyApi.Property) { | ||||||
|  |   return requestClient.put('/product/property/update', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 删除属性项 */ | ||||||
|  | export function deleteProperty(id: number) { | ||||||
|  |   return requestClient.delete(`/product/property/delete?id=${id}`); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得属性项 */ | ||||||
|  | export function getProperty(id: number) { | ||||||
|  |   return requestClient.get<PropertyApi.Property>( | ||||||
|  |     `/product/property/get?id=${id}`, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得属性项分页 */ | ||||||
|  | export function getPropertyPage(params: PageParam) { | ||||||
|  |   return requestClient.get<PageResult<PropertyApi.Property>>( | ||||||
|  |     '/product/property/page', | ||||||
|  |     { params }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得属性项精简列表 */ | ||||||
|  | export function getPropertySimpleList() { | ||||||
|  |   return requestClient.get<PropertyApi.Property[]>( | ||||||
|  |     '/product/property/simple-list', | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得属性值分页 */ | ||||||
|  | export function getPropertyValuePage(params: PropertyApi.PropertyValueQuery) { | ||||||
|  |   return requestClient.get<PageResult<PropertyApi.PropertyValue>>( | ||||||
|  |     '/product/property/value/page', | ||||||
|  |     { params }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得属性值 */ | ||||||
|  | export function getPropertyValue(id: number) { | ||||||
|  |   return requestClient.get<PropertyApi.PropertyValue>( | ||||||
|  |     `/product/property/value/get?id=${id}`, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 创建属性值 */ | ||||||
|  | export function createPropertyValue(data: PropertyApi.PropertyValue) { | ||||||
|  |   return requestClient.post('/product/property/value/create', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 更新属性值 */ | ||||||
|  | export function updatePropertyValue(data: PropertyApi.PropertyValue) { | ||||||
|  |   return requestClient.put('/product/property/value/update', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 删除属性值 */ | ||||||
|  | export function deletePropertyValue(id: number) { | ||||||
|  |   return requestClient.delete(`/product/property/value/delete?id=${id}`); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得属性值精简列表 */ | ||||||
|  | export function getPropertyValueSimpleList(propertyId: number) { | ||||||
|  |   return requestClient.get<PropertyApi.PropertyValue[]>( | ||||||
|  |     '/product/property/value/simple-list', | ||||||
|  |     { | ||||||
|  |       params: { propertyId }, | ||||||
|  |     }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,177 @@ | ||||||
|  | import type { PageParam, PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace SpuApi { | ||||||
|  |   /** 商品属性 */ | ||||||
|  |   export interface Property { | ||||||
|  |     /** 属性编号 */ | ||||||
|  |     propertyId?: number; | ||||||
|  |     /** 属性名称 */ | ||||||
|  |     propertyName?: string; | ||||||
|  |     /** 属性值编号 */ | ||||||
|  |     valueId?: number; | ||||||
|  |     /** 属性值名称 */ | ||||||
|  |     valueName?: string; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 商品 SKU */ | ||||||
|  |   export interface Sku { | ||||||
|  |     /** 商品 SKU 编号 */ | ||||||
|  |     id?: number; | ||||||
|  |     /** 商品 SKU 名称 */ | ||||||
|  |     name?: string; | ||||||
|  |     /** SPU 编号 */ | ||||||
|  |     spuId?: number; | ||||||
|  |     /** 属性数组 */ | ||||||
|  |     properties?: Property[]; | ||||||
|  |     /** 商品价格 */ | ||||||
|  |     price?: number | string; | ||||||
|  |     /** 市场价 */ | ||||||
|  |     marketPrice?: number | string; | ||||||
|  |     /** 成本价 */ | ||||||
|  |     costPrice?: number | string; | ||||||
|  |     /** 商品条码 */ | ||||||
|  |     barCode?: string; | ||||||
|  |     /** 图片地址 */ | ||||||
|  |     picUrl?: string; | ||||||
|  |     /** 库存 */ | ||||||
|  |     stock?: number; | ||||||
|  |     /** 商品重量,单位:kg 千克 */ | ||||||
|  |     weight?: number; | ||||||
|  |     /** 商品体积,单位:m^3 平米 */ | ||||||
|  |     volume?: number; | ||||||
|  |     /** 一级分销的佣金 */ | ||||||
|  |     firstBrokeragePrice?: number | string; | ||||||
|  |     /** 二级分销的佣金 */ | ||||||
|  |     secondBrokeragePrice?: number | string; | ||||||
|  |     /** 商品销量 */ | ||||||
|  |     salesCount?: number; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 优惠券模板 */ | ||||||
|  |   export interface GiveCouponTemplate { | ||||||
|  |     /** 优惠券编号 */ | ||||||
|  |     id?: number; | ||||||
|  |     /** 优惠券名称 */ | ||||||
|  |     name?: string; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 商品 SPU */ | ||||||
|  |   export interface Spu { | ||||||
|  |     /** 商品编号 */ | ||||||
|  |     id?: number; | ||||||
|  |     /** 商品名称 */ | ||||||
|  |     name?: string; | ||||||
|  |     /** 商品分类 */ | ||||||
|  |     categoryId?: number; | ||||||
|  |     /** 关键字 */ | ||||||
|  |     keyword?: string; | ||||||
|  |     /** 单位 */ | ||||||
|  |     unit?: number | undefined; | ||||||
|  |     /** 商品封面图 */ | ||||||
|  |     picUrl?: string; | ||||||
|  |     /** 商品轮播图 */ | ||||||
|  |     sliderPicUrls?: string[]; | ||||||
|  |     /** 商品简介 */ | ||||||
|  |     introduction?: string; | ||||||
|  |     /** 配送方式 */ | ||||||
|  |     deliveryTypes?: number[]; | ||||||
|  |     /** 运费模版 */ | ||||||
|  |     deliveryTemplateId?: number | undefined; | ||||||
|  |     /** 商品品牌编号 */ | ||||||
|  |     brandId?: number; | ||||||
|  |     /** 商品规格 */ | ||||||
|  |     specType?: boolean; | ||||||
|  |     /** 分销类型 */ | ||||||
|  |     subCommissionType?: boolean; | ||||||
|  |     /** sku数组 */ | ||||||
|  |     skus?: Sku[]; | ||||||
|  |     /** 商品详情 */ | ||||||
|  |     description?: string; | ||||||
|  |     /** 商品排序 */ | ||||||
|  |     sort?: number; | ||||||
|  |     /** 赠送积分 */ | ||||||
|  |     giveIntegral?: number; | ||||||
|  |     /** 虚拟销量 */ | ||||||
|  |     virtualSalesCount?: number; | ||||||
|  |     /** 商品价格 */ | ||||||
|  |     price?: number; | ||||||
|  |     /** 商品拼团价格 */ | ||||||
|  |     combinationPrice?: number; | ||||||
|  |     /** 商品秒杀价格 */ | ||||||
|  |     seckillPrice?: number; | ||||||
|  |     /** 商品销量 */ | ||||||
|  |     salesCount?: number; | ||||||
|  |     /** 市场价 */ | ||||||
|  |     marketPrice?: number; | ||||||
|  |     /** 成本价 */ | ||||||
|  |     costPrice?: number; | ||||||
|  |     /** 商品库存 */ | ||||||
|  |     stock?: number; | ||||||
|  |     /** 商品创建时间 */ | ||||||
|  |     createTime?: Date; | ||||||
|  |     /** 商品状态 */ | ||||||
|  |     status?: number; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 商品状态更新 */ | ||||||
|  |   export interface StatusUpdate { | ||||||
|  |     /** 商品编号 */ | ||||||
|  |     id: number; | ||||||
|  |     /** 商品状态 */ | ||||||
|  |     status: number; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得商品 SPU 列表 */ | ||||||
|  | export function getSpuPage(params: PageParam) { | ||||||
|  |   return requestClient.get<PageResult<SpuApi.Spu>>('/product/spu/page', { | ||||||
|  |     params, | ||||||
|  |   }); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得商品 SPU 列表 tabsCount */ | ||||||
|  | export function getTabsCount() { | ||||||
|  |   return requestClient.get<Record<string, number>>('/product/spu/get-count'); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 创建商品 SPU */ | ||||||
|  | export function createSpu(data: SpuApi.Spu) { | ||||||
|  |   return requestClient.post('/product/spu/create', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 更新商品 SPU */ | ||||||
|  | export function updateSpu(data: SpuApi.Spu) { | ||||||
|  |   return requestClient.put('/product/spu/update', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 更新商品 SPU 状态 */ | ||||||
|  | export function updateStatus(data: SpuApi.StatusUpdate) { | ||||||
|  |   return requestClient.put('/product/spu/update-status', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得商品 SPU */ | ||||||
|  | export function getSpu(id: number) { | ||||||
|  |   return requestClient.get<SpuApi.Spu>(`/product/spu/get-detail?id=${id}`); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得商品 SPU 详情列表 */ | ||||||
|  | export function getSpuDetailList(ids: number[]) { | ||||||
|  |   return requestClient.get<SpuApi.Spu[]>(`/product/spu/list?spuIds=${ids}`); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 删除商品 SPU */ | ||||||
|  | export function deleteSpu(id: number) { | ||||||
|  |   return requestClient.delete(`/product/spu/delete?id=${id}`); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 导出商品 SPU Excel */ | ||||||
|  | export function exportSpu(params: PageParam) { | ||||||
|  |   return requestClient.download('/product/spu/export', { params }); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得商品 SPU 精简列表 */ | ||||||
|  | export function getSpuSimpleList() { | ||||||
|  |   return requestClient.get<SpuApi.Spu[]>('/product/spu/list-all-simple'); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,65 @@ | ||||||
|  | import type { PageParam, PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace ArticleApi { | ||||||
|  |   /** 文章管理 */ | ||||||
|  |   export interface Article { | ||||||
|  |     /** 文章编号 */ | ||||||
|  |     id: number; | ||||||
|  |     /** 分类编号 */ | ||||||
|  |     categoryId: number; | ||||||
|  |     /** 文章标题 */ | ||||||
|  |     title: string; | ||||||
|  |     /** 作者 */ | ||||||
|  |     author: string; | ||||||
|  |     /** 封面图 */ | ||||||
|  |     picUrl: string; | ||||||
|  |     /** 文章简介 */ | ||||||
|  |     introduction: string; | ||||||
|  |     /** 浏览数量 */ | ||||||
|  |     browseCount: string; | ||||||
|  |     /** 排序 */ | ||||||
|  |     sort: number; | ||||||
|  |     /** 状态 */ | ||||||
|  |     status: number; | ||||||
|  |     /** 商品编号 */ | ||||||
|  |     spuId: number; | ||||||
|  |     /** 是否热门 */ | ||||||
|  |     recommendHot: boolean; | ||||||
|  |     /** 是否轮播图 */ | ||||||
|  |     recommendBanner: boolean; | ||||||
|  |     /** 文章内容 */ | ||||||
|  |     content: string; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询文章管理列表 */ | ||||||
|  | export function getArticlePage(params: PageParam) { | ||||||
|  |   return requestClient.get<PageResult<ArticleApi.Article>>( | ||||||
|  |     '/promotion/article/page', | ||||||
|  |     { params }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询文章管理详情 */ | ||||||
|  | export function getArticle(id: number) { | ||||||
|  |   return requestClient.get<ArticleApi.Article>( | ||||||
|  |     `/promotion/article/get?id=${id}`, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 新增文章管理 */ | ||||||
|  | export function createArticle(data: ArticleApi.Article) { | ||||||
|  |   return requestClient.post('/promotion/article/create', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 修改文章管理 */ | ||||||
|  | export function updateArticle(data: ArticleApi.Article) { | ||||||
|  |   return requestClient.put('/promotion/article/update', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 删除文章管理 */ | ||||||
|  | export function deleteArticle(id: number) { | ||||||
|  |   return requestClient.delete(`/promotion/article/delete?id=${id}`); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,60 @@ | ||||||
|  | import type { PageParam, PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace ArticleCategoryApi { | ||||||
|  |   /** 文章分类 */ | ||||||
|  |   export interface ArticleCategory { | ||||||
|  |     /** 分类编号 */ | ||||||
|  |     id: number; | ||||||
|  |     /** 分类名称 */ | ||||||
|  |     name: string; | ||||||
|  |     /** 分类图片 */ | ||||||
|  |     picUrl: string; | ||||||
|  |     /** 状态 */ | ||||||
|  |     status: number; | ||||||
|  |     /** 排序 */ | ||||||
|  |     sort: number; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询文章分类列表 */ | ||||||
|  | export function getArticleCategoryPage(params: PageParam) { | ||||||
|  |   return requestClient.get<PageResult<ArticleCategoryApi.ArticleCategory>>( | ||||||
|  |     '/promotion/article-category/page', | ||||||
|  |     { params }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询文章分类精简信息列表 */ | ||||||
|  | export function getSimpleArticleCategoryList() { | ||||||
|  |   return requestClient.get<ArticleCategoryApi.ArticleCategory[]>( | ||||||
|  |     '/promotion/article-category/list-all-simple', | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询文章分类详情 */ | ||||||
|  | export function getArticleCategory(id: number) { | ||||||
|  |   return requestClient.get<ArticleCategoryApi.ArticleCategory>( | ||||||
|  |     `/promotion/article-category/get?id=${id}`, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 新增文章分类 */ | ||||||
|  | export function createArticleCategory( | ||||||
|  |   data: ArticleCategoryApi.ArticleCategory, | ||||||
|  | ) { | ||||||
|  |   return requestClient.post('/promotion/article-category/create', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 修改文章分类 */ | ||||||
|  | export function updateArticleCategory( | ||||||
|  |   data: ArticleCategoryApi.ArticleCategory, | ||||||
|  | ) { | ||||||
|  |   return requestClient.put('/promotion/article-category/update', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 删除文章分类 */ | ||||||
|  | export function deleteArticleCategory(id: number) { | ||||||
|  |   return requestClient.delete(`/promotion/article-category/delete?id=${id}`); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,106 @@ | ||||||
|  | import type { PageParam, PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import type { SpuApi } from '#/api/mall/product/spu'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace BargainActivityApi { | ||||||
|  |   /** 砍价活动 */ | ||||||
|  |   export interface BargainActivity { | ||||||
|  |     /** 活动编号 */ | ||||||
|  |     id?: number; | ||||||
|  |     /** 活动名称 */ | ||||||
|  |     name?: string; | ||||||
|  |     /** 开始时间 */ | ||||||
|  |     startTime?: Date; | ||||||
|  |     /** 结束时间 */ | ||||||
|  |     endTime?: Date; | ||||||
|  |     /** 状态 */ | ||||||
|  |     status?: number; | ||||||
|  |     /** 达到该人数,才能砍到低价 */ | ||||||
|  |     helpMaxCount?: number; | ||||||
|  |     /** 最大帮砍次数 */ | ||||||
|  |     bargainCount?: number; | ||||||
|  |     /** 最大购买次数 */ | ||||||
|  |     totalLimitCount?: number; | ||||||
|  |     /** 商品 SPU 编号 */ | ||||||
|  |     spuId: number; | ||||||
|  |     /** 商品 SKU 编号 */ | ||||||
|  |     skuId: number; | ||||||
|  |     /** 砍价起始价格,单位分 */ | ||||||
|  |     bargainFirstPrice: number; | ||||||
|  |     /** 砍价底价 */ | ||||||
|  |     bargainMinPrice: number; | ||||||
|  |     /** 活动库存 */ | ||||||
|  |     stock: number; | ||||||
|  |     /** 用户每次砍价的最小金额,单位:分 */ | ||||||
|  |     randomMinPrice?: number; | ||||||
|  |     /** 用户每次砍价的最大金额,单位:分 */ | ||||||
|  |     randomMaxPrice?: number; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 砍价活动所需属性。选择的商品和属性的时候使用方便使用活动的通用封装 */ | ||||||
|  |   export interface BargainProduct { | ||||||
|  |     /** 商品 SPU 编号 */ | ||||||
|  |     spuId: number; | ||||||
|  |     /** 商品 SKU 编号 */ | ||||||
|  |     skuId: number; | ||||||
|  |     /** 砍价起始价格,单位分 */ | ||||||
|  |     bargainFirstPrice: number; | ||||||
|  |     /** 砍价底价 */ | ||||||
|  |     bargainMinPrice: number; | ||||||
|  |     /** 活动库存 */ | ||||||
|  |     stock: number; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 扩展 SKU 配置 */ | ||||||
|  |   export type SkuExtension = { | ||||||
|  |     /** 砍价活动配置 */ | ||||||
|  |     productConfig: BargainProduct; | ||||||
|  |   } & SpuApi.Sku; | ||||||
|  | 
 | ||||||
|  |   /** 扩展 SPU 配置 */ | ||||||
|  |   export interface SpuExtension extends SpuApi.Spu { | ||||||
|  |     /** SKU 列表 */ | ||||||
|  |     skus: SkuExtension[]; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询砍价活动列表 */ | ||||||
|  | export function getBargainActivityPage(params: PageParam) { | ||||||
|  |   return requestClient.get<PageResult<BargainActivityApi.BargainActivity>>( | ||||||
|  |     '/promotion/bargain-activity/page', | ||||||
|  |     { params }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询砍价活动详情 */ | ||||||
|  | export function getBargainActivity(id: number) { | ||||||
|  |   return requestClient.get<BargainActivityApi.BargainActivity>( | ||||||
|  |     `/promotion/bargain-activity/get?id=${id}`, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 新增砍价活动 */ | ||||||
|  | export function createBargainActivity( | ||||||
|  |   data: BargainActivityApi.BargainActivity, | ||||||
|  | ) { | ||||||
|  |   return requestClient.post('/promotion/bargain-activity/create', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 修改砍价活动 */ | ||||||
|  | export function updateBargainActivity( | ||||||
|  |   data: BargainActivityApi.BargainActivity, | ||||||
|  | ) { | ||||||
|  |   return requestClient.put('/promotion/bargain-activity/update', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 关闭砍价活动 */ | ||||||
|  | export function closeBargainActivity(id: number) { | ||||||
|  |   return requestClient.put(`/promotion/bargain-activity/close?id=${id}`); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 删除砍价活动 */ | ||||||
|  | export function deleteBargainActivity(id: number) { | ||||||
|  |   return requestClient.delete(`/promotion/bargain-activity/delete?id=${id}`); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,27 @@ | ||||||
|  | import type { PageParam, PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace BargainHelpApi { | ||||||
|  |   /** 砍价记录 */ | ||||||
|  |   export interface BargainHelp { | ||||||
|  |     /** 记录编号 */ | ||||||
|  |     id: number; | ||||||
|  |     /** 砍价记录编号 */ | ||||||
|  |     record: number; | ||||||
|  |     /** 用户编号 */ | ||||||
|  |     userId: number; | ||||||
|  |     /** 砍掉金额 */ | ||||||
|  |     reducePrice: number; | ||||||
|  |     /** 结束时间 */ | ||||||
|  |     endTime: Date; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询砍价记录列表 */ | ||||||
|  | export function getBargainHelpPage(params: PageParam) { | ||||||
|  |   return requestClient.get<PageResult<BargainHelpApi.BargainHelp>>( | ||||||
|  |     '/promotion/bargain-help/page', | ||||||
|  |     { params }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,37 @@ | ||||||
|  | import type { PageParam, PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace BargainRecordApi { | ||||||
|  |   /** 砍价记录 */ | ||||||
|  |   export interface BargainRecord { | ||||||
|  |     /** 记录编号 */ | ||||||
|  |     id: number; | ||||||
|  |     /** 活动编号 */ | ||||||
|  |     activityId: number; | ||||||
|  |     /** 用户编号 */ | ||||||
|  |     userId: number; | ||||||
|  |     /** 商品 SPU 编号 */ | ||||||
|  |     spuId: number; | ||||||
|  |     /** 商品 SKU 编号 */ | ||||||
|  |     skuId: number; | ||||||
|  |     /** 砍价起始价格 */ | ||||||
|  |     bargainFirstPrice: number; | ||||||
|  |     /** 砍价价格 */ | ||||||
|  |     bargainPrice: number; | ||||||
|  |     /** 状态 */ | ||||||
|  |     status: number; | ||||||
|  |     /** 订单编号 */ | ||||||
|  |     orderId: number; | ||||||
|  |     /** 结束时间 */ | ||||||
|  |     endTime: Date; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询砍价记录列表 */ | ||||||
|  | export function getBargainRecordPage(params: PageParam) { | ||||||
|  |   return requestClient.get<PageResult<BargainRecordApi.BargainRecord>>( | ||||||
|  |     '/promotion/bargain-record/page', | ||||||
|  |     { params }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,111 @@ | ||||||
|  | import type { PageParam, PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import type { SpuApi } from '#/api/mall/product/spu'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace CombinationActivityApi { | ||||||
|  |   /** 拼团活动所需属性 */ | ||||||
|  |   export interface CombinationProduct { | ||||||
|  |     /** 商品 SPU 编号 */ | ||||||
|  |     spuId: number; | ||||||
|  |     /** 商品 SKU 编号 */ | ||||||
|  |     skuId: number; | ||||||
|  |     /** 拼团价格 */ | ||||||
|  |     combinationPrice: number; | ||||||
|  |   } | ||||||
|  |   /** 拼团活动 */ | ||||||
|  |   export interface CombinationActivity { | ||||||
|  |     /** 活动编号 */ | ||||||
|  |     id?: number; | ||||||
|  |     /** 活动名称 */ | ||||||
|  |     name?: string; | ||||||
|  |     /** 商品 SPU 编号 */ | ||||||
|  |     spuId?: number; | ||||||
|  |     /** 总限购数量 */ | ||||||
|  |     totalLimitCount?: number; | ||||||
|  |     /** 单次限购数量 */ | ||||||
|  |     singleLimitCount?: number; | ||||||
|  |     /** 开始时间 */ | ||||||
|  |     startTime?: Date; | ||||||
|  |     /** 结束时间 */ | ||||||
|  |     endTime?: Date; | ||||||
|  |     /** 用户数量 */ | ||||||
|  |     userSize?: number; | ||||||
|  |     /** 总数量 */ | ||||||
|  |     totalCount?: number; | ||||||
|  |     /** 成功数量 */ | ||||||
|  |     successCount?: number; | ||||||
|  |     /** 订单用户数量 */ | ||||||
|  |     orderUserCount?: number; | ||||||
|  |     /** 虚拟成团 */ | ||||||
|  |     virtualGroup?: number; | ||||||
|  |     /** 状态 */ | ||||||
|  |     status?: number; | ||||||
|  |     /** 限制时长 */ | ||||||
|  |     limitDuration?: number; | ||||||
|  |     /** 拼团价格 */ | ||||||
|  |     combinationPrice?: number; | ||||||
|  |     /** 商品列表 */ | ||||||
|  |     products: CombinationProduct[]; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 扩展 SKU 配置 */ | ||||||
|  |   export type SkuExtension = { | ||||||
|  |     /** 拼团活动配置 */ | ||||||
|  |     productConfig: CombinationProduct; | ||||||
|  |   } & SpuApi.Sku; | ||||||
|  | 
 | ||||||
|  |   /** 扩展 SPU 配置 */ | ||||||
|  |   export interface SpuExtension extends SpuApi.Spu { | ||||||
|  |     /** SKU 列表 */ | ||||||
|  |     skus: SkuExtension[]; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询拼团活动列表 */ | ||||||
|  | export function getCombinationActivityPage(params: PageParam) { | ||||||
|  |   return requestClient.get< | ||||||
|  |     PageResult<CombinationActivityApi.CombinationActivity> | ||||||
|  |   >('/promotion/combination-activity/page', { params }); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询拼团活动详情 */ | ||||||
|  | export function getCombinationActivity(id: number) { | ||||||
|  |   return requestClient.get<CombinationActivityApi.CombinationActivity>( | ||||||
|  |     `/promotion/combination-activity/get?id=${id}`, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得拼团活动列表,基于活动编号数组 */ | ||||||
|  | export function getCombinationActivityListByIds(ids: number[]) { | ||||||
|  |   return requestClient.get<CombinationActivityApi.CombinationActivity[]>( | ||||||
|  |     `/promotion/combination-activity/list-by-ids?ids=${ids}`, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 新增拼团活动 */ | ||||||
|  | export function createCombinationActivity( | ||||||
|  |   data: CombinationActivityApi.CombinationActivity, | ||||||
|  | ) { | ||||||
|  |   return requestClient.post('/promotion/combination-activity/create', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 修改拼团活动 */ | ||||||
|  | export function updateCombinationActivity( | ||||||
|  |   data: CombinationActivityApi.CombinationActivity, | ||||||
|  | ) { | ||||||
|  |   return requestClient.put('/promotion/combination-activity/update', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 关闭拼团活动 */ | ||||||
|  | export function closeCombinationActivity(id: number) { | ||||||
|  |   return requestClient.put(`/promotion/combination-activity/close?id=${id}`); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 删除拼团活动 */ | ||||||
|  | export function deleteCombinationActivity(id: number) { | ||||||
|  |   return requestClient.delete( | ||||||
|  |     `/promotion/combination-activity/delete?id=${id}`, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,62 @@ | ||||||
|  | import type { PageParam, PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace CombinationRecordApi { | ||||||
|  |   /** 拼团记录 */ | ||||||
|  |   export interface CombinationRecord { | ||||||
|  |     /** 拼团记录编号 */ | ||||||
|  |     id: number; | ||||||
|  |     /** 拼团活动编号 */ | ||||||
|  |     activityId: number; | ||||||
|  |     /** 用户昵称 */ | ||||||
|  |     nickname: string; | ||||||
|  |     /** 用户头像 */ | ||||||
|  |     avatar: string; | ||||||
|  |     /** 团长编号 */ | ||||||
|  |     headId: number; | ||||||
|  |     /** 过期时间 */ | ||||||
|  |     expireTime: string; | ||||||
|  |     /** 可参团人数 */ | ||||||
|  |     userSize: number; | ||||||
|  |     /** 已参团人数 */ | ||||||
|  |     userCount: number; | ||||||
|  |     /** 拼团状态 */ | ||||||
|  |     status: number; | ||||||
|  |     /** 商品名字 */ | ||||||
|  |     spuName: string; | ||||||
|  |     /** 商品图片 */ | ||||||
|  |     picUrl: string; | ||||||
|  |     /** 是否虚拟成团 */ | ||||||
|  |     virtualGroup: boolean; | ||||||
|  |     /** 开始时间 (订单付款后开始的时间) */ | ||||||
|  |     startTime: string; | ||||||
|  |     /** 结束时间(成团时间/失败时间) */ | ||||||
|  |     endTime: string; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 拼团记录概要信息 */ | ||||||
|  |   export interface RecordSummary { | ||||||
|  |     /** 待成团数量 */ | ||||||
|  |     pendingCount: number; | ||||||
|  |     /** 已成团数量 */ | ||||||
|  |     successCount: number; | ||||||
|  |     /** 已失败数量 */ | ||||||
|  |     failCount: number; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询拼团记录列表 */ | ||||||
|  | export function getCombinationRecordPage(params: PageParam) { | ||||||
|  |   return requestClient.get<PageResult<CombinationRecordApi.CombinationRecord>>( | ||||||
|  |     '/promotion/combination-record/page', | ||||||
|  |     { params }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得拼团记录的概要信息 */ | ||||||
|  | export function getCombinationRecordSummary() { | ||||||
|  |   return requestClient.get<CombinationRecordApi.RecordSummary>( | ||||||
|  |     '/promotion/combination-record/get-summary', | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,67 @@ | ||||||
|  | import type { PageParam, PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace CouponApi { | ||||||
|  |   /** 优惠券 */ | ||||||
|  |   export interface Coupon { | ||||||
|  |     /** 优惠券编号 */ | ||||||
|  |     id: number; | ||||||
|  |     /** 优惠券名称 */ | ||||||
|  |     name: string; | ||||||
|  |     /** 优惠券状态 */ | ||||||
|  |     status: number; | ||||||
|  |     /** 优惠券类型 */ | ||||||
|  |     type: number; | ||||||
|  |     /** 优惠券金额 */ | ||||||
|  |     price: number; | ||||||
|  |     /** 使用门槛 */ | ||||||
|  |     usePrice: number; | ||||||
|  |     /** 商品范围 */ | ||||||
|  |     productScope: number; | ||||||
|  |     /** 商品编号数组 */ | ||||||
|  |     productSpuIds: number[]; | ||||||
|  |     /** 有效期类型 */ | ||||||
|  |     validityType: number; | ||||||
|  |     /** 固定日期-生效开始时间 */ | ||||||
|  |     validStartTime: Date; | ||||||
|  |     /** 固定日期-生效结束时间 */ | ||||||
|  |     validEndTime: Date; | ||||||
|  |     /** 领取日期-开始天数 */ | ||||||
|  |     fixedStartTerm: number; | ||||||
|  |     /** 领取日期-结束天数 */ | ||||||
|  |     fixedEndTerm: number; | ||||||
|  |     /** 每人限领个数 */ | ||||||
|  |     takeLimitCount: number; | ||||||
|  |     /** 是否设置满多少金额可用 */ | ||||||
|  |     usePriceEnabled: boolean; | ||||||
|  |     /** 商品分类编号数组 */ | ||||||
|  |     productCategoryIds: number[]; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 发送优惠券 */ | ||||||
|  |   export interface SendCoupon { | ||||||
|  |     /** 优惠券编号 */ | ||||||
|  |     couponId: number; | ||||||
|  |     /** 用户编号数组 */ | ||||||
|  |     userIds: number[]; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 删除优惠劵 */ | ||||||
|  | export function deleteCoupon(id: number) { | ||||||
|  |   return requestClient.delete(`/promotion/coupon/delete?id=${id}`); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得优惠劵分页 */ | ||||||
|  | export function getCouponPage(params: PageParam) { | ||||||
|  |   return requestClient.get<PageResult<CouponApi.Coupon>>( | ||||||
|  |     '/promotion/coupon/page', | ||||||
|  |     { params }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 发送优惠券 */ | ||||||
|  | export function sendCoupon(data: CouponApi.SendCoupon) { | ||||||
|  |   return requestClient.post('/promotion/coupon/send', data); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,108 @@ | ||||||
|  | import type { PageParam, PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace CouponTemplateApi { | ||||||
|  |   /** 优惠券模板 */ | ||||||
|  |   export interface CouponTemplate { | ||||||
|  |     /** 模板编号 */ | ||||||
|  |     id: number; | ||||||
|  |     /** 模板名称 */ | ||||||
|  |     name: string; | ||||||
|  |     /** 状态 */ | ||||||
|  |     status: number; | ||||||
|  |     /** 发放数量 */ | ||||||
|  |     totalCount: number; | ||||||
|  |     /** 每人限领个数 */ | ||||||
|  |     takeLimitCount: number; | ||||||
|  |     /** 领取方式 */ | ||||||
|  |     takeType: number; | ||||||
|  |     /** 使用门槛 */ | ||||||
|  |     usePrice: number; | ||||||
|  |     /** 商品范围 */ | ||||||
|  |     productScope: number; | ||||||
|  |     /** 商品范围值 */ | ||||||
|  |     productScopeValues: number[]; | ||||||
|  |     /** 有效期类型 */ | ||||||
|  |     validityType: number; | ||||||
|  |     /** 固定日期-生效开始时间 */ | ||||||
|  |     validStartTime: Date; | ||||||
|  |     /** 固定日期-生效结束时间 */ | ||||||
|  |     validEndTime: Date; | ||||||
|  |     /** 领取日期-开始天数 */ | ||||||
|  |     fixedStartTerm: number; | ||||||
|  |     /** 领取日期-结束天数 */ | ||||||
|  |     fixedEndTerm: number; | ||||||
|  |     /** 优惠类型 */ | ||||||
|  |     discountType: number; | ||||||
|  |     /** 折扣百分比 */ | ||||||
|  |     discountPercent: number; | ||||||
|  |     /** 优惠金额 */ | ||||||
|  |     discountPrice: number; | ||||||
|  |     /** 折扣上限 */ | ||||||
|  |     discountLimitPrice: number; | ||||||
|  |     /** 已领取数量 */ | ||||||
|  |     takeCount: number; | ||||||
|  |     /** 已使用数量 */ | ||||||
|  |     useCount: number; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 优惠券模板状态更新 */ | ||||||
|  |   export interface StatusUpdate { | ||||||
|  |     /** 模板编号 */ | ||||||
|  |     id: number; | ||||||
|  |     /** 状态 */ | ||||||
|  |     status: 0 | 1; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 创建优惠劵模板 */ | ||||||
|  | export function createCouponTemplate(data: CouponTemplateApi.CouponTemplate) { | ||||||
|  |   return requestClient.post('/promotion/coupon-template/create', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 更新优惠劵模板 */ | ||||||
|  | export function updateCouponTemplate(data: CouponTemplateApi.CouponTemplate) { | ||||||
|  |   return requestClient.put('/promotion/coupon-template/update', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 更新优惠劵模板的状态 */ | ||||||
|  | export function updateCouponTemplateStatus(id: number, status: 0 | 1) { | ||||||
|  |   const data: CouponTemplateApi.StatusUpdate = { id, status }; | ||||||
|  |   return requestClient.put('/promotion/coupon-template/update-status', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 删除优惠劵模板 */ | ||||||
|  | export function deleteCouponTemplate(id: number) { | ||||||
|  |   return requestClient.delete(`/promotion/coupon-template/delete?id=${id}`); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得优惠劵模板 */ | ||||||
|  | export function getCouponTemplate(id: number) { | ||||||
|  |   return requestClient.get<CouponTemplateApi.CouponTemplate>( | ||||||
|  |     `/promotion/coupon-template/get?id=${id}`, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得优惠劵模板分页 */ | ||||||
|  | export function getCouponTemplatePage(params: PageParam) { | ||||||
|  |   return requestClient.get<PageResult<CouponTemplateApi.CouponTemplate>>( | ||||||
|  |     '/promotion/coupon-template/page', | ||||||
|  |     { params }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得优惠劵模板列表 */ | ||||||
|  | export function getCouponTemplateList(ids: number[]) { | ||||||
|  |   return requestClient.get<CouponTemplateApi.CouponTemplate[]>( | ||||||
|  |     `/promotion/coupon-template/list?ids=${ids}`, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 导出优惠劵模板 Excel */ | ||||||
|  | export function exportCouponTemplateExcel(params: PageParam) { | ||||||
|  |   return requestClient.get('/promotion/coupon-template/export-excel', { | ||||||
|  |     params, | ||||||
|  |     responseType: 'blob', | ||||||
|  |   }); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,92 @@ | ||||||
|  | import type { PageParam, PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import type { SpuApi } from '#/api/mall/product/spu'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace DiscountActivityApi { | ||||||
|  |   /** 限时折扣相关属性 */ | ||||||
|  |   export interface DiscountProduct { | ||||||
|  |     /** 商品 SPU 编号 */ | ||||||
|  |     spuId: number; | ||||||
|  |     /** 商品 SKU 编号 */ | ||||||
|  |     skuId: number; | ||||||
|  |     /** 折扣类型 */ | ||||||
|  |     discountType: number; | ||||||
|  |     /** 折扣百分比 */ | ||||||
|  |     discountPercent: number; | ||||||
|  |     /** 折扣价格 */ | ||||||
|  |     discountPrice: number; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 限时折扣活动 */ | ||||||
|  |   export interface DiscountActivity { | ||||||
|  |     /** 活动编号 */ | ||||||
|  |     id?: number; | ||||||
|  |     /** 商品 SPU 编号 */ | ||||||
|  |     spuId?: number; | ||||||
|  |     /** 活动名称 */ | ||||||
|  |     name?: string; | ||||||
|  |     /** 状态 */ | ||||||
|  |     status?: number; | ||||||
|  |     /** 备注 */ | ||||||
|  |     remark?: string; | ||||||
|  |     /** 开始时间 */ | ||||||
|  |     startTime?: Date; | ||||||
|  |     /** 结束时间 */ | ||||||
|  |     endTime?: Date; | ||||||
|  |     /** 商品列表 */ | ||||||
|  |     products?: DiscountProduct[]; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 扩展 SKU 配置 */ | ||||||
|  |   export type SkuExtension = { | ||||||
|  |     /** 限时折扣配置 */ | ||||||
|  |     productConfig: DiscountProduct; | ||||||
|  |   } & SpuApi.Sku; | ||||||
|  | 
 | ||||||
|  |   /** 扩展 SPU 配置 */ | ||||||
|  |   export interface SpuExtension extends SpuApi.Spu { | ||||||
|  |     /** SKU 列表 */ | ||||||
|  |     skus: SkuExtension[]; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询限时折扣活动列表 */ | ||||||
|  | export function getDiscountActivityPage(params: PageParam) { | ||||||
|  |   return requestClient.get<PageResult<DiscountActivityApi.DiscountActivity>>( | ||||||
|  |     '/promotion/discount-activity/page', | ||||||
|  |     { params }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询限时折扣活动详情 */ | ||||||
|  | export function getDiscountActivity(id: number) { | ||||||
|  |   return requestClient.get<DiscountActivityApi.DiscountActivity>( | ||||||
|  |     `/promotion/discount-activity/get?id=${id}`, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 新增限时折扣活动 */ | ||||||
|  | export function createDiscountActivity( | ||||||
|  |   data: DiscountActivityApi.DiscountActivity, | ||||||
|  | ) { | ||||||
|  |   return requestClient.post('/promotion/discount-activity/create', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 修改限时折扣活动 */ | ||||||
|  | export function updateDiscountActivity( | ||||||
|  |   data: DiscountActivityApi.DiscountActivity, | ||||||
|  | ) { | ||||||
|  |   return requestClient.put('/promotion/discount-activity/update', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 关闭限时折扣活动 */ | ||||||
|  | export function closeDiscountActivity(id: number) { | ||||||
|  |   return requestClient.put(`/promotion/discount-activity/close?id=${id}`); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 删除限时折扣活动 */ | ||||||
|  | export function deleteDiscountActivity(id: number) { | ||||||
|  |   return requestClient.delete(`/promotion/discount-activity/delete?id=${id}`); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,61 @@ | ||||||
|  | import type { PageParam, PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace DiyPageApi { | ||||||
|  |   /** 装修页面 */ | ||||||
|  |   export interface DiyPage { | ||||||
|  |     /** 页面编号 */ | ||||||
|  |     id?: number; | ||||||
|  |     /** 模板编号 */ | ||||||
|  |     templateId?: number; | ||||||
|  |     /** 页面名称 */ | ||||||
|  |     name: string; | ||||||
|  |     /** 备注 */ | ||||||
|  |     remark: string; | ||||||
|  |     /** 预览图片地址数组 */ | ||||||
|  |     previewPicUrls: string[]; | ||||||
|  |     /** 页面属性 */ | ||||||
|  |     property: string; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询装修页面列表 */ | ||||||
|  | export function getDiyPagePage(params: PageParam) { | ||||||
|  |   return requestClient.get<PageResult<DiyPageApi.DiyPage>>( | ||||||
|  |     '/promotion/diy-page/page', | ||||||
|  |     { params }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询装修页面详情 */ | ||||||
|  | export function getDiyPage(id: number) { | ||||||
|  |   return requestClient.get<DiyPageApi.DiyPage>( | ||||||
|  |     `/promotion/diy-page/get?id=${id}`, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 新增装修页面 */ | ||||||
|  | export function createDiyPage(data: DiyPageApi.DiyPage) { | ||||||
|  |   return requestClient.post('/promotion/diy-page/create', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 修改装修页面 */ | ||||||
|  | export function updateDiyPage(data: DiyPageApi.DiyPage) { | ||||||
|  |   return requestClient.put('/promotion/diy-page/update', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 删除装修页面 */ | ||||||
|  | export function deleteDiyPage(id: number) { | ||||||
|  |   return requestClient.delete(`/promotion/diy-page/delete?id=${id}`); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得装修页面属性 */ | ||||||
|  | export function getDiyPageProperty(id: number) { | ||||||
|  |   return requestClient.get<string>(`/promotion/diy-page/get-property?id=${id}`); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 更新装修页面属性 */ | ||||||
|  | export function updateDiyPageProperty(data: DiyPageApi.DiyPage) { | ||||||
|  |   return requestClient.put('/promotion/diy-page/update-property', data); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,78 @@ | ||||||
|  | import type { PageParam, PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import type { DiyPageApi } from './page'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace DiyTemplateApi { | ||||||
|  |   /** 装修模板 */ | ||||||
|  |   export interface DiyTemplate { | ||||||
|  |     /** 模板编号 */ | ||||||
|  |     id?: number; | ||||||
|  |     /** 模板名称 */ | ||||||
|  |     name: string; | ||||||
|  |     /** 是否使用 */ | ||||||
|  |     used: boolean; | ||||||
|  |     /** 使用时间 */ | ||||||
|  |     usedTime?: Date; | ||||||
|  |     /** 备注 */ | ||||||
|  |     remark: string; | ||||||
|  |     /** 预览图片地址数组 */ | ||||||
|  |     previewPicUrls: string[]; | ||||||
|  |     /** 模板属性 */ | ||||||
|  |     property: string; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 装修模板属性(包含页面列表) */ | ||||||
|  |   export interface DiyTemplateProperty extends DiyTemplate { | ||||||
|  |     /** 页面列表 */ | ||||||
|  |     pages: DiyPageApi.DiyPage[]; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询装修模板列表 */ | ||||||
|  | export function getDiyTemplatePage(params: PageParam) { | ||||||
|  |   return requestClient.get<PageResult<DiyTemplateApi.DiyTemplate>>( | ||||||
|  |     '/promotion/diy-template/page', | ||||||
|  |     { params }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询装修模板详情 */ | ||||||
|  | export function getDiyTemplate(id: number) { | ||||||
|  |   return requestClient.get<DiyTemplateApi.DiyTemplate>( | ||||||
|  |     `/promotion/diy-template/get?id=${id}`, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 新增装修模板 */ | ||||||
|  | export function createDiyTemplate(data: DiyTemplateApi.DiyTemplate) { | ||||||
|  |   return requestClient.post('/promotion/diy-template/create', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 修改装修模板 */ | ||||||
|  | export function updateDiyTemplate(data: DiyTemplateApi.DiyTemplate) { | ||||||
|  |   return requestClient.put('/promotion/diy-template/update', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 删除装修模板 */ | ||||||
|  | export function deleteDiyTemplate(id: number) { | ||||||
|  |   return requestClient.delete(`/promotion/diy-template/delete?id=${id}`); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 使用装修模板 */ | ||||||
|  | export function useDiyTemplate(id: number) { | ||||||
|  |   return requestClient.put(`/promotion/diy-template/use?id=${id}`); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得装修模板属性 */ | ||||||
|  | export function getDiyTemplateProperty(id: number) { | ||||||
|  |   return requestClient.get<DiyTemplateApi.DiyTemplateProperty>( | ||||||
|  |     `/promotion/diy-template/get-property?id=${id}`, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 更新装修模板属性 */ | ||||||
|  | export function updateDiyTemplateProperty(data: DiyTemplateApi.DiyTemplate) { | ||||||
|  |   return requestClient.put('/promotion/diy-template/update-property', data); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,70 @@ | ||||||
|  | import type { PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace KeFuConversationApi { | ||||||
|  |   /** 客服会话 */ | ||||||
|  |   export interface Conversation { | ||||||
|  |     /** 编号 */ | ||||||
|  |     id: number; | ||||||
|  |     /** 会话所属用户 */ | ||||||
|  |     userId: number; | ||||||
|  |     /** 会话所属用户头像 */ | ||||||
|  |     userAvatar: string; | ||||||
|  |     /** 会话所属用户昵称 */ | ||||||
|  |     userNickname: string; | ||||||
|  |     /** 最后聊天时间 */ | ||||||
|  |     lastMessageTime: Date; | ||||||
|  |     /** 最后聊天内容 */ | ||||||
|  |     lastMessageContent: string; | ||||||
|  |     /** 最后发送的消息类型 */ | ||||||
|  |     lastMessageContentType: number; | ||||||
|  |     /** 管理端置顶 */ | ||||||
|  |     adminPinned: boolean; | ||||||
|  |     /** 用户是否可见 */ | ||||||
|  |     userDeleted: boolean; | ||||||
|  |     /** 管理员是否可见 */ | ||||||
|  |     adminDeleted: boolean; | ||||||
|  |     /** 管理员未读消息数 */ | ||||||
|  |     adminUnreadMessageCount: number; | ||||||
|  |     /** 创建时间 */ | ||||||
|  |     createTime?: string; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 会话置顶请求 */ | ||||||
|  |   export interface ConversationPinnedUpdate { | ||||||
|  |     /** 会话编号 */ | ||||||
|  |     id: number; | ||||||
|  |     /** 是否置顶 */ | ||||||
|  |     pinned: boolean; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得客服会话列表 */ | ||||||
|  | export function getConversationList() { | ||||||
|  |   return requestClient.get<PageResult<KeFuConversationApi.Conversation>>( | ||||||
|  |     '/promotion/kefu-conversation/list', | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得客服会话 */ | ||||||
|  | export function getConversation(id: number) { | ||||||
|  |   return requestClient.get<KeFuConversationApi.Conversation>( | ||||||
|  |     `/promotion/kefu-conversation/get?id=${id}`, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 客服会话置顶 */ | ||||||
|  | export function updateConversationPinned( | ||||||
|  |   data: KeFuConversationApi.ConversationPinnedUpdate, | ||||||
|  | ) { | ||||||
|  |   return requestClient.put( | ||||||
|  |     '/promotion/kefu-conversation/update-conversation-pinned', | ||||||
|  |     data, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 删除客服会话 */ | ||||||
|  | export function deleteConversation(id: number) { | ||||||
|  |   return requestClient.delete(`/promotion/kefu-conversation/delete?id=${id}`); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,67 @@ | ||||||
|  | import type { PageParam, PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace KeFuMessageApi { | ||||||
|  |   /** 客服消息 */ | ||||||
|  |   export interface Message { | ||||||
|  |     /** 编号 */ | ||||||
|  |     id: number; | ||||||
|  |     /** 会话编号 */ | ||||||
|  |     conversationId: number; | ||||||
|  |     /** 发送人编号 */ | ||||||
|  |     senderId: number; | ||||||
|  |     /** 发送人头像 */ | ||||||
|  |     senderAvatar: string; | ||||||
|  |     /** 发送人类型 */ | ||||||
|  |     senderType: number; | ||||||
|  |     /** 接收人编号 */ | ||||||
|  |     receiverId: number; | ||||||
|  |     /** 接收人类型 */ | ||||||
|  |     receiverType: number; | ||||||
|  |     /** 消息类型 */ | ||||||
|  |     contentType: number; | ||||||
|  |     /** 消息内容 */ | ||||||
|  |     content: string; | ||||||
|  |     /** 是否已读 */ | ||||||
|  |     readStatus: boolean; | ||||||
|  |     /** 创建时间 */ | ||||||
|  |     createTime: Date; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 发送消息请求 */ | ||||||
|  |   export interface MessageSend { | ||||||
|  |     /** 会话编号 */ | ||||||
|  |     conversationId: number; | ||||||
|  |     /** 消息类型 */ | ||||||
|  |     contentType: number; | ||||||
|  |     /** 消息内容 */ | ||||||
|  |     content: string; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 消息列表查询参数 */ | ||||||
|  |   export interface MessageQuery extends PageParam { | ||||||
|  |     /** 会话编号 */ | ||||||
|  |     conversationId: number; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 发送客服消息 */ | ||||||
|  | export function sendKeFuMessage(data: KeFuMessageApi.MessageSend) { | ||||||
|  |   return requestClient.post('/promotion/kefu-message/send', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 更新客服消息已读状态 */ | ||||||
|  | export function updateKeFuMessageReadStatus(conversationId: number) { | ||||||
|  |   return requestClient.put( | ||||||
|  |     `/promotion/kefu-message/update-read-status?conversationId=${conversationId}`, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得消息列表(流式加载) */ | ||||||
|  | export function getKeFuMessageList(params: KeFuMessageApi.MessageQuery) { | ||||||
|  |   return requestClient.get<PageResult<KeFuMessageApi.Message>>( | ||||||
|  |     '/promotion/kefu-message/list', | ||||||
|  |     { params }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,127 @@ | ||||||
|  | import type { PageParam, PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import type { SpuApi } from '#/api/mall/product/spu'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace PointActivityApi { | ||||||
|  |   /** 积分商城商品 */ | ||||||
|  |   export interface PointProduct { | ||||||
|  |     /** 积分商城商品编号 */ | ||||||
|  |     id?: number; | ||||||
|  |     /** 积分商城活动 id */ | ||||||
|  |     activityId?: number; | ||||||
|  |     /** 商品 SPU 编号 */ | ||||||
|  |     spuId?: number; | ||||||
|  |     /** 商品 SKU 编号 */ | ||||||
|  |     skuId: number; | ||||||
|  |     /** 可兑换数量 */ | ||||||
|  |     count: number; | ||||||
|  |     /** 兑换积分 */ | ||||||
|  |     point: number; | ||||||
|  |     /** 兑换金额,单位:分 */ | ||||||
|  |     price: number; | ||||||
|  |     /** 积分商城商品库存 */ | ||||||
|  |     stock: number; | ||||||
|  |     /** 积分商城商品状态 */ | ||||||
|  |     activityStatus?: number; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 积分商城活动 */ | ||||||
|  |   export interface PointActivity { | ||||||
|  |     /** 积分商城活动编号 */ | ||||||
|  |     id: number; | ||||||
|  |     /** 积分商城活动商品 */ | ||||||
|  |     spuId: number; | ||||||
|  |     /** 活动状态 */ | ||||||
|  |     status: number; | ||||||
|  |     /** 积分商城活动库存 */ | ||||||
|  |     stock: number; | ||||||
|  |     /** 积分商城活动总库存 */ | ||||||
|  |     totalStock: number; | ||||||
|  |     /** 备注 */ | ||||||
|  |     remark?: string; | ||||||
|  |     /** 排序 */ | ||||||
|  |     sort: number; | ||||||
|  |     /** 创建时间 */ | ||||||
|  |     createTime: string; | ||||||
|  |     /** 积分商城商品 */ | ||||||
|  |     products: PointProduct[]; | ||||||
|  |     /** 商品名称 */ | ||||||
|  |     spuName: string; | ||||||
|  |     /** 商品主图 */ | ||||||
|  |     picUrl: string; | ||||||
|  |     /** 商品市场价,单位:分 */ | ||||||
|  |     marketPrice: number; | ||||||
|  |     /** 兑换积分 */ | ||||||
|  |     point: number; | ||||||
|  |     /** 兑换金额,单位:分 */ | ||||||
|  |     price: number; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 扩展 SKU 配置 */ | ||||||
|  |   export type SkuExtension = { | ||||||
|  |     /** 积分商城商品配置 */ | ||||||
|  |     productConfig: PointProduct; | ||||||
|  |   } & SpuApi.Sku; | ||||||
|  | 
 | ||||||
|  |   /** 扩展 SPU 配置 */ | ||||||
|  |   export interface SpuExtension extends SpuApi.Spu { | ||||||
|  |     /** SKU 列表 */ | ||||||
|  |     skus: SkuExtension[]; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 扩展 SPU 配置(带积分信息) */ | ||||||
|  |   export interface SpuExtensionWithPoint extends SpuApi.Spu { | ||||||
|  |     /** 积分商城活动库存 */ | ||||||
|  |     pointStock: number; | ||||||
|  |     /** 积分商城活动总库存 */ | ||||||
|  |     pointTotalStock: number; | ||||||
|  |     /** 兑换积分 */ | ||||||
|  |     point: number; | ||||||
|  |     /** 兑换金额,单位:分 */ | ||||||
|  |     pointPrice: number; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询积分商城活动分页 */ | ||||||
|  | export function getPointActivityPage(params: PageParam) { | ||||||
|  |   return requestClient.get<PageResult<PointActivityApi.PointActivity>>( | ||||||
|  |     '/promotion/point-activity/page', | ||||||
|  |     { params }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询积分商城活动详情 */ | ||||||
|  | export function getPointActivity(id: number) { | ||||||
|  |   return requestClient.get<PointActivityApi.PointActivity>( | ||||||
|  |     `/promotion/point-activity/get?id=${id}`, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询积分商城活动列表,基于活动编号数组 */ | ||||||
|  | export function getPointActivityListByIds(ids: number[]) { | ||||||
|  |   return requestClient.get<PointActivityApi.PointActivity[]>( | ||||||
|  |     `/promotion/point-activity/list-by-ids?ids=${ids}`, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 新增积分商城活动 */ | ||||||
|  | export function createPointActivity(data: PointActivityApi.PointActivity) { | ||||||
|  |   return requestClient.post('/promotion/point-activity/create', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 修改积分商城活动 */ | ||||||
|  | export function updatePointActivity(data: PointActivityApi.PointActivity) { | ||||||
|  |   return requestClient.put('/promotion/point-activity/update', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 删除积分商城活动 */ | ||||||
|  | export function deletePointActivity(id: number) { | ||||||
|  |   return requestClient.delete(`/promotion/point-activity/delete?id=${id}`); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 关闭积分商城活动 */ | ||||||
|  | export function closePointActivity(id: number) { | ||||||
|  |   return requestClient.put(`/promotion/point-activity/close?id=${id}`); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,84 @@ | ||||||
|  | import type { PageParam, PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace RewardActivityApi { | ||||||
|  |   /** 优惠规则 */ | ||||||
|  |   export interface RewardRule { | ||||||
|  |     /** 满足金额 */ | ||||||
|  |     limit?: number; | ||||||
|  |     /** 优惠金额 */ | ||||||
|  |     discountPrice?: number; | ||||||
|  |     /** 是否包邮 */ | ||||||
|  |     freeDelivery?: boolean; | ||||||
|  |     /** 赠送积分 */ | ||||||
|  |     point: number; | ||||||
|  |     /** 赠送优惠券数量 */ | ||||||
|  |     giveCouponTemplateCounts?: { | ||||||
|  |       [key: number]: number; | ||||||
|  |     }; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 满减送活动 */ | ||||||
|  |   export interface RewardActivity { | ||||||
|  |     /** 活动编号 */ | ||||||
|  |     id?: number; | ||||||
|  |     /** 活动名称 */ | ||||||
|  |     name?: string; | ||||||
|  |     /** 开始时间 */ | ||||||
|  |     startTime?: Date; | ||||||
|  |     /** 结束时间 */ | ||||||
|  |     endTime?: Date; | ||||||
|  |     /** 开始和结束时间(仅前端使用) */ | ||||||
|  |     startAndEndTime?: Date[]; | ||||||
|  |     /** 备注 */ | ||||||
|  |     remark?: string; | ||||||
|  |     /** 条件类型 */ | ||||||
|  |     conditionType?: number; | ||||||
|  |     /** 商品范围 */ | ||||||
|  |     productScope?: number; | ||||||
|  |     /** 优惠规则列表 */ | ||||||
|  |     rules: RewardRule[]; | ||||||
|  |     /** 商品范围值(仅表单使用):值为品类编号列表、商品编号列表 */ | ||||||
|  |     productScopeValues?: number[]; | ||||||
|  |     /** 商品分类编号列表(仅表单使用) */ | ||||||
|  |     productCategoryIds?: number[]; | ||||||
|  |     /** 商品 SPU 编号列表(仅表单使用) */ | ||||||
|  |     productSpuIds?: number[]; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 新增满减送活动 */ | ||||||
|  | export function createRewardActivity(data: RewardActivityApi.RewardActivity) { | ||||||
|  |   return requestClient.post('/promotion/reward-activity/create', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 更新满减送活动 */ | ||||||
|  | export function updateRewardActivity(data: RewardActivityApi.RewardActivity) { | ||||||
|  |   return requestClient.put('/promotion/reward-activity/update', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询满减送活动列表 */ | ||||||
|  | export function getRewardActivityPage(params: PageParam) { | ||||||
|  |   return requestClient.get<PageResult<RewardActivityApi.RewardActivity>>( | ||||||
|  |     '/promotion/reward-activity/page', | ||||||
|  |     { params }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询满减送活动详情 */ | ||||||
|  | export function getReward(id: number) { | ||||||
|  |   return requestClient.get<RewardActivityApi.RewardActivity>( | ||||||
|  |     `/promotion/reward-activity/get?id=${id}`, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 删除满减送活动 */ | ||||||
|  | export function deleteRewardActivity(id: number) { | ||||||
|  |   return requestClient.delete(`/promotion/reward-activity/delete?id=${id}`); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 关闭满减送活动 */ | ||||||
|  | export function closeRewardActivity(id: number) { | ||||||
|  |   return requestClient.put(`/promotion/reward-activity/close?id=${id}`); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,117 @@ | ||||||
|  | import type { PageParam, PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import type { SpuApi } from '#/api/mall/product/spu'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace SeckillActivityApi { | ||||||
|  |   /** 秒杀商品 */ | ||||||
|  |   export interface SeckillProduct { | ||||||
|  |     /** 商品 SKU 编号 */ | ||||||
|  |     skuId: number; | ||||||
|  |     /** 商品 SPU 编号 */ | ||||||
|  |     spuId: number; | ||||||
|  |     /** 秒杀价格 */ | ||||||
|  |     seckillPrice: number; | ||||||
|  |     /** 秒杀库存 */ | ||||||
|  |     stock: number; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 秒杀活动 */ | ||||||
|  |   export interface SeckillActivity { | ||||||
|  |     /** 活动编号 */ | ||||||
|  |     id?: number; | ||||||
|  |     /** 商品 SPU 编号 */ | ||||||
|  |     spuId?: number; | ||||||
|  |     /** 活动名称 */ | ||||||
|  |     name?: string; | ||||||
|  |     /** 活动状态 */ | ||||||
|  |     status?: number; | ||||||
|  |     /** 备注 */ | ||||||
|  |     remark?: string; | ||||||
|  |     /** 开始时间 */ | ||||||
|  |     startTime?: Date; | ||||||
|  |     /** 结束时间 */ | ||||||
|  |     endTime?: Date; | ||||||
|  |     /** 排序 */ | ||||||
|  |     sort?: number; | ||||||
|  |     /** 配置编号 */ | ||||||
|  |     configIds?: string; | ||||||
|  |     /** 订单数量 */ | ||||||
|  |     orderCount?: number; | ||||||
|  |     /** 用户数量 */ | ||||||
|  |     userCount?: number; | ||||||
|  |     /** 总金额 */ | ||||||
|  |     totalPrice?: number; | ||||||
|  |     /** 总限购数量 */ | ||||||
|  |     totalLimitCount?: number; | ||||||
|  |     /** 单次限购数量 */ | ||||||
|  |     singleLimitCount?: number; | ||||||
|  |     /** 秒杀库存 */ | ||||||
|  |     stock?: number; | ||||||
|  |     /** 秒杀总库存 */ | ||||||
|  |     totalStock?: number; | ||||||
|  |     /** 秒杀价格 */ | ||||||
|  |     seckillPrice?: number; | ||||||
|  |     /** 秒杀商品列表 */ | ||||||
|  |     products?: SeckillProduct[]; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 扩展 SKU 配置 */ | ||||||
|  |   export type SkuExtension = { | ||||||
|  |     /** 秒杀商品配置 */ | ||||||
|  |     productConfig: SeckillProduct; | ||||||
|  |   } & SpuApi.Sku; | ||||||
|  | 
 | ||||||
|  |   /** 扩展 SPU 配置 */ | ||||||
|  |   export interface SpuExtension extends SpuApi.Spu { | ||||||
|  |     /** SKU 列表 */ | ||||||
|  |     skus: SkuExtension[]; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询秒杀活动列表 */ | ||||||
|  | export function getSeckillActivityPage(params: PageParam) { | ||||||
|  |   return requestClient.get<PageResult<SeckillActivityApi.SeckillActivity>>( | ||||||
|  |     '/promotion/seckill-activity/page', | ||||||
|  |     { params }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询秒杀活动列表,基于活动编号数组 */ | ||||||
|  | export function getSeckillActivityListByIds(ids: number[]) { | ||||||
|  |   return requestClient.get<SeckillActivityApi.SeckillActivity[]>( | ||||||
|  |     `/promotion/seckill-activity/list-by-ids?ids=${ids}`, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询秒杀活动详情 */ | ||||||
|  | export function getSeckillActivity(id: number) { | ||||||
|  |   return requestClient.get<SeckillActivityApi.SeckillActivity>( | ||||||
|  |     `/promotion/seckill-activity/get?id=${id}`, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 新增秒杀活动 */ | ||||||
|  | export function createSeckillActivity( | ||||||
|  |   data: SeckillActivityApi.SeckillActivity, | ||||||
|  | ) { | ||||||
|  |   return requestClient.post('/promotion/seckill-activity/create', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 修改秒杀活动 */ | ||||||
|  | export function updateSeckillActivity( | ||||||
|  |   data: SeckillActivityApi.SeckillActivity, | ||||||
|  | ) { | ||||||
|  |   return requestClient.put('/promotion/seckill-activity/update', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 关闭秒杀活动 */ | ||||||
|  | export function closeSeckillActivity(id: number) { | ||||||
|  |   return requestClient.put(`/promotion/seckill-activity/close?id=${id}`); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 删除秒杀活动 */ | ||||||
|  | export function deleteSeckillActivity(id: number) { | ||||||
|  |   return requestClient.delete(`/promotion/seckill-activity/delete?id=${id}`); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,74 @@ | ||||||
|  | import type { PageParam, PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace SeckillConfigApi { | ||||||
|  |   /** 秒杀时段 */ | ||||||
|  |   export interface SeckillConfig { | ||||||
|  |     /** 编号 */ | ||||||
|  |     id: number; | ||||||
|  |     /** 秒杀时段名称 */ | ||||||
|  |     name: string; | ||||||
|  |     /** 开始时间点 */ | ||||||
|  |     startTime: string; | ||||||
|  |     /** 结束时间点 */ | ||||||
|  |     endTime: string; | ||||||
|  |     /** 秒杀轮播图 */ | ||||||
|  |     sliderPicUrls: string[]; | ||||||
|  |     /** 活动状态 */ | ||||||
|  |     status: number; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 时段配置状态更新 */ | ||||||
|  |   export interface StatusUpdate { | ||||||
|  |     /** 编号 */ | ||||||
|  |     id: number; | ||||||
|  |     /** 状态 */ | ||||||
|  |     status: number; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询秒杀时段分页 */ | ||||||
|  | export function getSeckillConfigPage(params: PageParam) { | ||||||
|  |   return requestClient.get<PageResult<SeckillConfigApi.SeckillConfig>>( | ||||||
|  |     '/promotion/seckill-config/page', | ||||||
|  |     { params }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询秒杀时段列表 */ | ||||||
|  | export function getSimpleSeckillConfigList() { | ||||||
|  |   return requestClient.get<SeckillConfigApi.SeckillConfig[]>( | ||||||
|  |     '/promotion/seckill-config/list', | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询秒杀时段详情 */ | ||||||
|  | export function getSeckillConfig(id: number) { | ||||||
|  |   return requestClient.get<SeckillConfigApi.SeckillConfig>( | ||||||
|  |     `/promotion/seckill-config/get?id=${id}`, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 新增秒杀时段 */ | ||||||
|  | export function createSeckillConfig(data: SeckillConfigApi.SeckillConfig) { | ||||||
|  |   return requestClient.post('/promotion/seckill-config/create', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 修改秒杀时段 */ | ||||||
|  | export function updateSeckillConfig(data: SeckillConfigApi.SeckillConfig) { | ||||||
|  |   return requestClient.put('/promotion/seckill-config/update', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 删除秒杀时段 */ | ||||||
|  | export function deleteSeckillConfig(id: number) { | ||||||
|  |   return requestClient.delete(`/promotion/seckill-config/delete?id=${id}`); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 修改时段配置状态 */ | ||||||
|  | export function updateSeckillConfigStatus(id: number, status: number) { | ||||||
|  |   return requestClient.put('/promotion/seckill-config/update-status', { | ||||||
|  |     id, | ||||||
|  |     status, | ||||||
|  |   }); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,5 @@ | ||||||
|  | /** 数据对照 Response VO */ | ||||||
|  | export interface DataComparisonRespVO<T> { | ||||||
|  |   value: T; | ||||||
|  |   reference: T; | ||||||
|  | } | ||||||
|  | @ -0,0 +1,131 @@ | ||||||
|  | import type { DataComparisonRespVO } from './common'; | ||||||
|  | 
 | ||||||
|  | import { formatDate } from '@vben/utils'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace MemberStatisticsApi { | ||||||
|  |   /** 会员分析 Request VO */ | ||||||
|  |   export interface AnalyseReq { | ||||||
|  |     times: Date[]; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 会员分析对照数据 Response VO */ | ||||||
|  |   export interface AnalyseComparison { | ||||||
|  |     registerUserCount: number; | ||||||
|  |     visitUserCount: number; | ||||||
|  |     rechargeUserCount: number; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 会员分析 Response VO */ | ||||||
|  |   export interface Analyse { | ||||||
|  |     visitUserCount: number; | ||||||
|  |     orderUserCount: number; | ||||||
|  |     payUserCount: number; | ||||||
|  |     atv: number; | ||||||
|  |     comparison: DataComparisonRespVO<AnalyseComparison>; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 会员地区统计 Response VO */ | ||||||
|  |   export interface AreaStatistics { | ||||||
|  |     areaId: number; | ||||||
|  |     areaName: string; | ||||||
|  |     userCount: number; | ||||||
|  |     orderCreateUserCount: number; | ||||||
|  |     orderPayUserCount: number; | ||||||
|  |     orderPayPrice: number; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 会员性别统计 Response VO */ | ||||||
|  |   export interface SexStatistics { | ||||||
|  |     sex: number; | ||||||
|  |     userCount: number; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 会员统计 Response VO */ | ||||||
|  |   export interface Summary { | ||||||
|  |     userCount: number; | ||||||
|  |     rechargeUserCount: number; | ||||||
|  |     rechargePrice: number; | ||||||
|  |     expensePrice: number; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 会员终端统计 Response VO */ | ||||||
|  |   export interface TerminalStatistics { | ||||||
|  |     terminal: number; | ||||||
|  |     userCount: number; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 会员数量统计 Response VO */ | ||||||
|  |   export interface Count { | ||||||
|  |     /** 用户访问量 */ | ||||||
|  |     visitUserCount: string; | ||||||
|  |     /** 注册用户数量 */ | ||||||
|  |     registerUserCount: number; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 会员注册数量 Response VO */ | ||||||
|  |   export interface RegisterCount { | ||||||
|  |     date: string; | ||||||
|  |     count: number; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询会员统计 */ | ||||||
|  | export function getMemberSummary() { | ||||||
|  |   return requestClient.get<MemberStatisticsApi.Summary>( | ||||||
|  |     '/statistics/member/summary', | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询会员分析数据 */ | ||||||
|  | export function getMemberAnalyse(params: MemberStatisticsApi.AnalyseReq) { | ||||||
|  |   return requestClient.get<MemberStatisticsApi.Analyse>( | ||||||
|  |     '/statistics/member/analyse', | ||||||
|  |     { | ||||||
|  |       params: { | ||||||
|  |         times: [formatDate(params.times[0]), formatDate(params.times[1])], | ||||||
|  |       }, | ||||||
|  |     }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 按照省份,查询会员统计列表 */ | ||||||
|  | export function getMemberAreaStatisticsList() { | ||||||
|  |   return requestClient.get<MemberStatisticsApi.AreaStatistics[]>( | ||||||
|  |     '/statistics/member/area-statistics-list', | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 按照性别,查询会员统计列表 */ | ||||||
|  | export function getMemberSexStatisticsList() { | ||||||
|  |   return requestClient.get<MemberStatisticsApi.SexStatistics[]>( | ||||||
|  |     '/statistics/member/sex-statistics-list', | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 按照终端,查询会员统计列表 */ | ||||||
|  | export function getMemberTerminalStatisticsList() { | ||||||
|  |   return requestClient.get<MemberStatisticsApi.TerminalStatistics[]>( | ||||||
|  |     '/statistics/member/terminal-statistics-list', | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得用户数量量对照 */ | ||||||
|  | export function getUserCountComparison() { | ||||||
|  |   return requestClient.get<DataComparisonRespVO<MemberStatisticsApi.Count>>( | ||||||
|  |     '/statistics/member/user-count-comparison', | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得会员注册数量列表 */ | ||||||
|  | export function getMemberRegisterCountList(beginTime: Date, endTime: Date) { | ||||||
|  |   return requestClient.get<MemberStatisticsApi.RegisterCount[]>( | ||||||
|  |     '/statistics/member/register-count-list', | ||||||
|  |     { | ||||||
|  |       params: { | ||||||
|  |         times: [formatDate(beginTime), formatDate(endTime)], | ||||||
|  |       }, | ||||||
|  |     }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,16 @@ | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace PayStatisticsApi { | ||||||
|  |   /** 支付统计 */ | ||||||
|  |   export interface PaySummaryRespVO { | ||||||
|  |     /** 充值金额,单位分 */ | ||||||
|  |     rechargePrice: number; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获取钱包充值金额 */ | ||||||
|  | export function getWalletRechargePrice() { | ||||||
|  |   return requestClient.get<PayStatisticsApi.PaySummaryRespVO>( | ||||||
|  |     '/statistics/pay/summary', | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,69 @@ | ||||||
|  | import type { PageParam, PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import type { DataComparisonRespVO } from './common'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace ProductStatisticsApi { | ||||||
|  |   /** 商品统计数据 */ | ||||||
|  |   export interface ProductStatistics { | ||||||
|  |     /** 编号 */ | ||||||
|  |     id: number; | ||||||
|  |     /** 统计日期 */ | ||||||
|  |     day: string; | ||||||
|  |     /** 商品 SPU 编号 */ | ||||||
|  |     spuId: number; | ||||||
|  |     /** 商品 SPU 名称 */ | ||||||
|  |     spuName: string; | ||||||
|  |     /** 商品 SPU 图片 */ | ||||||
|  |     spuPicUrl: string; | ||||||
|  |     /** 浏览次数 */ | ||||||
|  |     browseCount: number; | ||||||
|  |     /** 浏览人数 */ | ||||||
|  |     browseUserCount: number; | ||||||
|  |     /** 收藏次数 */ | ||||||
|  |     favoriteCount: number; | ||||||
|  |     /** 加购次数 */ | ||||||
|  |     cartCount: number; | ||||||
|  |     /** 下单次数 */ | ||||||
|  |     orderCount: number; | ||||||
|  |     /** 支付次数 */ | ||||||
|  |     orderPayCount: number; | ||||||
|  |     /** 支付金额 */ | ||||||
|  |     orderPayPrice: number; | ||||||
|  |     /** 售后次数 */ | ||||||
|  |     afterSaleCount: number; | ||||||
|  |     /** 退款金额 */ | ||||||
|  |     afterSaleRefundPrice: number; | ||||||
|  |     /** 浏览转化率 */ | ||||||
|  |     browseConvertPercent: number; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得商品统计分析 */ | ||||||
|  | export function getProductStatisticsAnalyse(params: PageParam) { | ||||||
|  |   return requestClient.get< | ||||||
|  |     DataComparisonRespVO<ProductStatisticsApi.ProductStatistics> | ||||||
|  |   >('/statistics/product/analyse', { params }); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得商品状况明细 */ | ||||||
|  | export function getProductStatisticsList(params: PageParam) { | ||||||
|  |   return requestClient.get<ProductStatisticsApi.ProductStatistics[]>( | ||||||
|  |     '/statistics/product/list', | ||||||
|  |     { params }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 导出获得商品状况明细 Excel */ | ||||||
|  | export function exportProductStatisticsExcel(params: PageParam) { | ||||||
|  |   return requestClient.download('/statistics/product/export-excel', { params }); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得商品排行榜分页 */ | ||||||
|  | export function getProductStatisticsRankPage(params: PageParam) { | ||||||
|  |   return requestClient.get<PageResult<ProductStatisticsApi.ProductStatistics>>( | ||||||
|  |     '/statistics/product/rank-page', | ||||||
|  |     { params }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,135 @@ | ||||||
|  | import type { DataComparisonRespVO } from './common'; | ||||||
|  | 
 | ||||||
|  | import { formatDate } from '@vben/utils'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace TradeStatisticsApi { | ||||||
|  |   /** 交易统计 Response VO */ | ||||||
|  |   export interface TradeSummary { | ||||||
|  |     yesterdayOrderCount: number; | ||||||
|  |     monthOrderCount: number; | ||||||
|  |     yesterdayPayPrice: number; | ||||||
|  |     monthPayPrice: number; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 交易状况 Request VO */ | ||||||
|  |   export interface TradeTrendReq { | ||||||
|  |     times: [Date, Date]; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 交易状况统计 Response VO */ | ||||||
|  |   export interface TradeTrendSummary { | ||||||
|  |     time: string; | ||||||
|  |     turnoverPrice: number; | ||||||
|  |     orderPayPrice: number; | ||||||
|  |     rechargePrice: number; | ||||||
|  |     expensePrice: number; | ||||||
|  |     walletPayPrice: number; | ||||||
|  |     brokerageSettlementPrice: number; | ||||||
|  |     afterSaleRefundPrice: number; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 交易订单数量 Response VO */ | ||||||
|  |   export interface TradeOrderCount { | ||||||
|  |     /** 待发货 */ | ||||||
|  |     undelivered?: number; | ||||||
|  |     /** 待核销 */ | ||||||
|  |     pickUp?: number; | ||||||
|  |     /** 退款中 */ | ||||||
|  |     afterSaleApply?: number; | ||||||
|  |     /** 提现待审核 */ | ||||||
|  |     auditingWithdraw?: number; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 交易订单统计 Response VO */ | ||||||
|  |   export interface TradeOrderSummary { | ||||||
|  |     /** 支付订单商品数 */ | ||||||
|  |     orderPayCount?: number; | ||||||
|  |     /** 总支付金额,单位:分 */ | ||||||
|  |     orderPayPrice?: number; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 订单量趋势统计 Response VO */ | ||||||
|  |   export interface TradeOrderTrend { | ||||||
|  |     /** 日期 */ | ||||||
|  |     date: string; | ||||||
|  |     /** 订单数量 */ | ||||||
|  |     orderPayCount: number; | ||||||
|  |     /** 订单支付金额 */ | ||||||
|  |     orderPayPrice: number; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 时间参数需要格式化, 确保接口能识别 */ | ||||||
|  | const formatDateParam = (params: TradeStatisticsApi.TradeTrendReq) => { | ||||||
|  |   return { | ||||||
|  |     times: [formatDate(params.times[0]), formatDate(params.times[1])], | ||||||
|  |   } as TradeStatisticsApi.TradeTrendReq; | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | /** 查询交易统计 */ | ||||||
|  | export function getTradeStatisticsSummary() { | ||||||
|  |   return requestClient.get< | ||||||
|  |     DataComparisonRespVO<TradeStatisticsApi.TradeSummary> | ||||||
|  |   >('/statistics/trade/summary'); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得交易状况统计 */ | ||||||
|  | export function getTradeStatisticsAnalyse( | ||||||
|  |   params: TradeStatisticsApi.TradeTrendReq, | ||||||
|  | ) { | ||||||
|  |   return requestClient.get< | ||||||
|  |     DataComparisonRespVO<TradeStatisticsApi.TradeTrendSummary> | ||||||
|  |   >('/statistics/trade/analyse', { params: formatDateParam(params) }); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得交易状况明细 */ | ||||||
|  | export function getTradeStatisticsList( | ||||||
|  |   params: TradeStatisticsApi.TradeTrendReq, | ||||||
|  | ) { | ||||||
|  |   return requestClient.get<TradeStatisticsApi.TradeTrendSummary[]>( | ||||||
|  |     '/statistics/trade/list', | ||||||
|  |     { params: formatDateParam(params) }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 导出交易状况明细 */ | ||||||
|  | export function exportTradeStatisticsExcel( | ||||||
|  |   params: TradeStatisticsApi.TradeTrendReq, | ||||||
|  | ) { | ||||||
|  |   return requestClient.download('/statistics/trade/export-excel', { | ||||||
|  |     params: formatDateParam(params), | ||||||
|  |   }); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得交易订单数量 */ | ||||||
|  | export function getOrderCount() { | ||||||
|  |   return requestClient.get<TradeStatisticsApi.TradeOrderCount>( | ||||||
|  |     '/statistics/trade/order-count', | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得交易订单数量对照 */ | ||||||
|  | export function getOrderComparison() { | ||||||
|  |   return requestClient.get< | ||||||
|  |     DataComparisonRespVO<TradeStatisticsApi.TradeOrderSummary> | ||||||
|  |   >('/statistics/trade/order-comparison'); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得订单量趋势统计 */ | ||||||
|  | export function getOrderCountTrendComparison( | ||||||
|  |   type: number, | ||||||
|  |   beginTime: Date, | ||||||
|  |   endTime: Date, | ||||||
|  | ) { | ||||||
|  |   return requestClient.get< | ||||||
|  |     DataComparisonRespVO<TradeStatisticsApi.TradeOrderTrend>[] | ||||||
|  |   >('/statistics/trade/order-count-trend', { | ||||||
|  |     params: { | ||||||
|  |       type, | ||||||
|  |       beginTime: formatDate(beginTime), | ||||||
|  |       endTime: formatDate(endTime), | ||||||
|  |     }, | ||||||
|  |   }); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,127 @@ | ||||||
|  | import type { PageParam, PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace AfterSaleApi { | ||||||
|  |   /** 商品属性 */ | ||||||
|  |   export interface ProductProperty { | ||||||
|  |     /** 属性的编号 */ | ||||||
|  |     propertyId?: null | number; | ||||||
|  |     /** 属性的名称 */ | ||||||
|  |     propertyName?: string; | ||||||
|  |     /** 属性值的编号 */ | ||||||
|  |     valueId?: null | number; | ||||||
|  |     /** 属性值的名称 */ | ||||||
|  |     valueName?: string; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 交易售后 */ | ||||||
|  |   export interface AfterSale { | ||||||
|  |     /** 售后编号,主键自增 */ | ||||||
|  |     id?: null | number; | ||||||
|  |     /** 售后单号 */ | ||||||
|  |     no?: string; | ||||||
|  |     /** 退款状态 */ | ||||||
|  |     status?: null | number; | ||||||
|  |     /** 售后方式 */ | ||||||
|  |     way?: null | number; | ||||||
|  |     /** 售后类型 */ | ||||||
|  |     type?: null | number; | ||||||
|  |     /** 用户编号 */ | ||||||
|  |     userId?: null | number; | ||||||
|  |     /** 申请原因 */ | ||||||
|  |     applyReason?: string; | ||||||
|  |     /** 补充描述 */ | ||||||
|  |     applyDescription?: string; | ||||||
|  |     /** 补充凭证图片 */ | ||||||
|  |     applyPicUrls?: string[]; | ||||||
|  |     /** 交易订单编号 */ | ||||||
|  |     orderId?: null | number; | ||||||
|  |     /** 订单流水号 */ | ||||||
|  |     orderNo?: string; | ||||||
|  |     /** 交易订单项编号 */ | ||||||
|  |     orderItemId?: null | number; | ||||||
|  |     /** 商品 SPU 编号 */ | ||||||
|  |     spuId?: null | number; | ||||||
|  |     /** 商品 SPU 名称 */ | ||||||
|  |     spuName?: string; | ||||||
|  |     /** 商品 SKU 编号 */ | ||||||
|  |     skuId?: null | number; | ||||||
|  |     /** 属性数组 */ | ||||||
|  |     properties?: ProductProperty[]; | ||||||
|  |     /** 商品图片 */ | ||||||
|  |     picUrl?: string; | ||||||
|  |     /** 退货商品数量 */ | ||||||
|  |     count?: null | number; | ||||||
|  |     /** 审批时间 */ | ||||||
|  |     auditTime?: Date; | ||||||
|  |     /** 审批人 */ | ||||||
|  |     auditUserId?: null | number; | ||||||
|  |     /** 审批备注 */ | ||||||
|  |     auditReason?: string; | ||||||
|  |     /** 退款金额,单位:分 */ | ||||||
|  |     refundPrice?: null | number; | ||||||
|  |     /** 支付退款编号 */ | ||||||
|  |     payRefundId?: null | number; | ||||||
|  |     /** 退款时间 */ | ||||||
|  |     refundTime?: Date; | ||||||
|  |     /** 退货物流公司编号 */ | ||||||
|  |     logisticsId?: null | number; | ||||||
|  |     /** 退货物流单号 */ | ||||||
|  |     logisticsNo?: string; | ||||||
|  |     /** 退货时间 */ | ||||||
|  |     deliveryTime?: Date; | ||||||
|  |     /** 收货时间 */ | ||||||
|  |     receiveTime?: Date; | ||||||
|  |     /** 收货备注 */ | ||||||
|  |     receiveReason?: string; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 拒绝售后请求 */ | ||||||
|  |   export interface DisagreeRequest { | ||||||
|  |     /** 售后编号 */ | ||||||
|  |     id: number; | ||||||
|  |     /** 拒绝原因 */ | ||||||
|  |     reason: string; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得交易售后分页 */ | ||||||
|  | export function getAfterSalePage(params: PageParam) { | ||||||
|  |   return requestClient.get<PageResult<AfterSaleApi.AfterSale>>( | ||||||
|  |     '/trade/after-sale/page', | ||||||
|  |     { params }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得交易售后详情 */ | ||||||
|  | export function getAfterSale(id: number) { | ||||||
|  |   return requestClient.get<AfterSaleApi.AfterSale>( | ||||||
|  |     `/trade/after-sale/get-detail?id=${id}`, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 同意售后 */ | ||||||
|  | export function agree(id: number) { | ||||||
|  |   return requestClient.put(`/trade/after-sale/agree?id=${id}`); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 拒绝售后 */ | ||||||
|  | export function disagree(data: AfterSaleApi.DisagreeRequest) { | ||||||
|  |   return requestClient.put('/trade/after-sale/disagree', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 确认收货 */ | ||||||
|  | export function receive(id: number) { | ||||||
|  |   return requestClient.put(`/trade/after-sale/receive?id=${id}`); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 拒绝收货 */ | ||||||
|  | export function refuse(id: number) { | ||||||
|  |   return requestClient.put(`/trade/after-sale/refuse?id=${id}`); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 确认退款 */ | ||||||
|  | export function refund(id: number) { | ||||||
|  |   return requestClient.put(`/trade/after-sale/refund?id=${id}`); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,46 @@ | ||||||
|  | import type { PageParam, PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace BrokerageRecordApi { | ||||||
|  |   /** 佣金记录 */ | ||||||
|  |   export interface BrokerageRecord { | ||||||
|  |     /** 编号 */ | ||||||
|  |     id: number; | ||||||
|  |     /** 用户编号 */ | ||||||
|  |     userId: number; | ||||||
|  |     /** 用户昵称 */ | ||||||
|  |     userNickname: string; | ||||||
|  |     /** 用户头像 */ | ||||||
|  |     userAvatar: string; | ||||||
|  |     /** 佣金金额,单位:分 */ | ||||||
|  |     price: number; | ||||||
|  |     /** 佣金类型 */ | ||||||
|  |     type: number; | ||||||
|  |     /** 关联订单编号 */ | ||||||
|  |     orderId: number; | ||||||
|  |     /** 关联订单号 */ | ||||||
|  |     orderNo: string; | ||||||
|  |     /** 创建时间 */ | ||||||
|  |     createTime: Date; | ||||||
|  |     /** 状态 */ | ||||||
|  |     status: number; | ||||||
|  |     /** 结算时间 */ | ||||||
|  |     settlementTime: Date; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询佣金记录列表 */ | ||||||
|  | export function getBrokerageRecordPage(params: PageParam) { | ||||||
|  |   return requestClient.get<PageResult<BrokerageRecordApi.BrokerageRecord>>( | ||||||
|  |     '/trade/brokerage-record/page', | ||||||
|  |     { params }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询佣金记录详情 */ | ||||||
|  | export function getBrokerageRecord(id: number) { | ||||||
|  |   return requestClient.get<BrokerageRecordApi.BrokerageRecord>( | ||||||
|  |     `/trade/brokerage-record/get?id=${id}`, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,95 @@ | ||||||
|  | import type { PageParam, PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace BrokerageUserApi { | ||||||
|  |   /** 分销用户 */ | ||||||
|  |   export interface BrokerageUser { | ||||||
|  |     /** 编号 */ | ||||||
|  |     id: number; | ||||||
|  |     /** 推广员编号 */ | ||||||
|  |     bindUserId: number; | ||||||
|  |     /** 推广员绑定时间 */ | ||||||
|  |     bindUserTime: Date; | ||||||
|  |     /** 是否启用分销 */ | ||||||
|  |     brokerageEnabled: boolean; | ||||||
|  |     /** 分销资格时间 */ | ||||||
|  |     brokerageTime: Date; | ||||||
|  |     /** 可提现金额,单位:分 */ | ||||||
|  |     price: number; | ||||||
|  |     /** 冻结金额,单位:分 */ | ||||||
|  |     frozenPrice: number; | ||||||
|  |     /** 用户昵称 */ | ||||||
|  |     nickname: string; | ||||||
|  |     /** 用户头像 */ | ||||||
|  |     avatar: string; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 创建分销用户请求 */ | ||||||
|  |   export interface CreateRequest { | ||||||
|  |     /** 用户编号 */ | ||||||
|  |     userId: number; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 修改推广员请求 */ | ||||||
|  |   export interface UpdateBindUserRequest { | ||||||
|  |     /** 用户编号 */ | ||||||
|  |     userId: number; | ||||||
|  |     /** 推广员编号 */ | ||||||
|  |     bindUserId: number; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 清除推广员请求 */ | ||||||
|  |   export interface ClearBindUserRequest { | ||||||
|  |     /** 用户编号 */ | ||||||
|  |     userId: number; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 修改推广资格请求 */ | ||||||
|  |   export interface UpdateBrokerageEnabledRequest { | ||||||
|  |     /** 用户编号 */ | ||||||
|  |     userId: number; | ||||||
|  |     /** 是否启用分销 */ | ||||||
|  |     brokerageEnabled: boolean; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 创建分销用户 */ | ||||||
|  | export function createBrokerageUser(data: BrokerageUserApi.CreateRequest) { | ||||||
|  |   return requestClient.post('/trade/brokerage-user/create', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询分销用户列表 */ | ||||||
|  | export function getBrokerageUserPage(params: PageParam) { | ||||||
|  |   return requestClient.get<PageResult<BrokerageUserApi.BrokerageUser>>( | ||||||
|  |     '/trade/brokerage-user/page', | ||||||
|  |     { params }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询分销用户详情 */ | ||||||
|  | export function getBrokerageUser(id: number) { | ||||||
|  |   return requestClient.get<BrokerageUserApi.BrokerageUser>( | ||||||
|  |     `/trade/brokerage-user/get?id=${id}`, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 修改推广员 */ | ||||||
|  | export function updateBindUser(data: BrokerageUserApi.UpdateBindUserRequest) { | ||||||
|  |   return requestClient.put('/trade/brokerage-user/update-bind-user', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 清除推广员 */ | ||||||
|  | export function clearBindUser(data: BrokerageUserApi.ClearBindUserRequest) { | ||||||
|  |   return requestClient.put('/trade/brokerage-user/clear-bind-user', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 修改推广资格 */ | ||||||
|  | export function updateBrokerageEnabled( | ||||||
|  |   data: BrokerageUserApi.UpdateBrokerageEnabledRequest, | ||||||
|  | ) { | ||||||
|  |   return requestClient.put( | ||||||
|  |     '/trade/brokerage-user/update-brokerage-enable', | ||||||
|  |     data, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,82 @@ | ||||||
|  | import type { PageParam, PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace BrokerageWithdrawApi { | ||||||
|  |   /** 佣金提现 */ | ||||||
|  |   export interface BrokerageWithdraw { | ||||||
|  |     /** 编号 */ | ||||||
|  |     id: number; | ||||||
|  |     /** 用户编号 */ | ||||||
|  |     userId: number; | ||||||
|  |     /** 提现金额,单位:分 */ | ||||||
|  |     price: number; | ||||||
|  |     /** 手续费,单位:分 */ | ||||||
|  |     feePrice: number; | ||||||
|  |     /** 总金额,单位:分 */ | ||||||
|  |     totalPrice: number; | ||||||
|  |     /** 提现类型 */ | ||||||
|  |     type: number; | ||||||
|  |     /** 用户名称 */ | ||||||
|  |     userName: string; | ||||||
|  |     /** 用户账号 */ | ||||||
|  |     userAccount: string; | ||||||
|  |     /** 银行名称 */ | ||||||
|  |     bankName: string; | ||||||
|  |     /** 银行地址 */ | ||||||
|  |     bankAddress: string; | ||||||
|  |     /** 收款码地址 */ | ||||||
|  |     qrCodeUrl: string; | ||||||
|  |     /** 状态 */ | ||||||
|  |     status: number; | ||||||
|  |     /** 审核备注 */ | ||||||
|  |     auditReason: string; | ||||||
|  |     /** 审核时间 */ | ||||||
|  |     auditTime: Date; | ||||||
|  |     /** 备注 */ | ||||||
|  |     remark: string; | ||||||
|  |     /** 支付转账编号 */ | ||||||
|  |     payTransferId?: number; | ||||||
|  |     /** 转账渠道编码 */ | ||||||
|  |     transferChannelCode?: string; | ||||||
|  |     /** 转账时间 */ | ||||||
|  |     transferTime?: Date; | ||||||
|  |     /** 转账错误信息 */ | ||||||
|  |     transferErrorMsg?: string; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 驳回申请请求 */ | ||||||
|  |   export interface RejectRequest { | ||||||
|  |     /** 编号 */ | ||||||
|  |     id: number; | ||||||
|  |     /** 驳回原因 */ | ||||||
|  |     auditReason: string; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询佣金提现列表 */ | ||||||
|  | export function getBrokerageWithdrawPage(params: PageParam) { | ||||||
|  |   return requestClient.get<PageResult<BrokerageWithdrawApi.BrokerageWithdraw>>( | ||||||
|  |     '/trade/brokerage-withdraw/page', | ||||||
|  |     { params }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询佣金提现详情 */ | ||||||
|  | export function getBrokerageWithdraw(id: number) { | ||||||
|  |   return requestClient.get<BrokerageWithdrawApi.BrokerageWithdraw>( | ||||||
|  |     `/trade/brokerage-withdraw/get?id=${id}`, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 佣金提现 - 通过申请 */ | ||||||
|  | export function approveBrokerageWithdraw(id: number) { | ||||||
|  |   return requestClient.put(`/trade/brokerage-withdraw/approve?id=${id}`); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 审核佣金提现 - 驳回申请 */ | ||||||
|  | export function rejectBrokerageWithdraw( | ||||||
|  |   data: BrokerageWithdrawApi.RejectRequest, | ||||||
|  | ) { | ||||||
|  |   return requestClient.put('/trade/brokerage-withdraw/reject', data); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,35 @@ | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace TradeConfigApi { | ||||||
|  |   /** 交易中心配置 */ | ||||||
|  |   export interface Config { | ||||||
|  |     /** 是否启用分销 */ | ||||||
|  |     brokerageEnabled: boolean; | ||||||
|  |     /** 分销资格条件 */ | ||||||
|  |     brokerageEnabledCondition: number; | ||||||
|  |     /** 分销绑定模式 */ | ||||||
|  |     brokerageBindMode: number; | ||||||
|  |     /** 分销海报图 */ | ||||||
|  |     brokeragePosterUrls: string; | ||||||
|  |     /** 一级分销比例 */ | ||||||
|  |     brokerageFirstPercent: number; | ||||||
|  |     /** 二级分销比例 */ | ||||||
|  |     brokerageSecondPercent: number; | ||||||
|  |     /** 最小提现金额,单位:分 */ | ||||||
|  |     brokerageWithdrawMinPrice: number; | ||||||
|  |     /** 冻结天数 */ | ||||||
|  |     brokerageFrozenDays: number; | ||||||
|  |     /** 提现类型 */ | ||||||
|  |     brokerageWithdrawTypes: string; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询交易中心配置详情 */ | ||||||
|  | export function getTradeConfig() { | ||||||
|  |   return requestClient.get<TradeConfigApi.Config>('/trade/config/get'); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 保存交易中心配置 */ | ||||||
|  | export function saveTradeConfig(data: TradeConfigApi.Config) { | ||||||
|  |   return requestClient.put('/trade/config/save', data); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,79 @@ | ||||||
|  | import type { PageParam, PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace DeliveryExpressApi { | ||||||
|  |   /** 快递公司 */ | ||||||
|  |   export interface DeliveryExpress { | ||||||
|  |     /** 编号 */ | ||||||
|  |     id: number; | ||||||
|  |     /** 快递公司编码 */ | ||||||
|  |     code: string; | ||||||
|  |     /** 快递公司名称 */ | ||||||
|  |     name: string; | ||||||
|  |     /** 快递公司 logo */ | ||||||
|  |     logo: string; | ||||||
|  |     /** 排序 */ | ||||||
|  |     sort: number; | ||||||
|  |     /** 状态 */ | ||||||
|  |     status: number; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 快递公司精简信息 */ | ||||||
|  |   export interface SimpleDeliveryExpress { | ||||||
|  |     /** 编号 */ | ||||||
|  |     id: number; | ||||||
|  |     /** 快递公司编码 */ | ||||||
|  |     code: string; | ||||||
|  |     /** 快递公司名称 */ | ||||||
|  |     name: string; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询快递公司列表 */ | ||||||
|  | export function getDeliveryExpressPage(params: PageParam) { | ||||||
|  |   return requestClient.get<PageResult<DeliveryExpressApi.DeliveryExpress>>( | ||||||
|  |     '/trade/delivery/express/page', | ||||||
|  |     { params }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询快递公司详情 */ | ||||||
|  | export function getDeliveryExpress(id: number) { | ||||||
|  |   return requestClient.get<DeliveryExpressApi.DeliveryExpress>( | ||||||
|  |     `/trade/delivery/express/get?id=${id}`, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 获得快递公司精简信息列表 */ | ||||||
|  | export function getSimpleDeliveryExpressList() { | ||||||
|  |   return requestClient.get<DeliveryExpressApi.SimpleDeliveryExpress[]>( | ||||||
|  |     '/trade/delivery/express/list-all-simple', | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 新增快递公司 */ | ||||||
|  | export function createDeliveryExpress( | ||||||
|  |   data: DeliveryExpressApi.DeliveryExpress, | ||||||
|  | ) { | ||||||
|  |   return requestClient.post('/trade/delivery/express/create', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 修改快递公司 */ | ||||||
|  | export function updateDeliveryExpress( | ||||||
|  |   data: DeliveryExpressApi.DeliveryExpress, | ||||||
|  | ) { | ||||||
|  |   return requestClient.put('/trade/delivery/express/update', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 删除快递公司 */ | ||||||
|  | export function deleteDeliveryExpress(id: number) { | ||||||
|  |   return requestClient.delete(`/trade/delivery/express/delete?id=${id}`); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 导出快递公司 Excel */ | ||||||
|  | export function exportDeliveryExpress(params: PageParam) { | ||||||
|  |   return requestClient.download('/trade/delivery/express/export-excel', { | ||||||
|  |     params, | ||||||
|  |   }); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,95 @@ | ||||||
|  | import type { PageParam, PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace DeliveryExpressTemplateApi { | ||||||
|  |   /** 运费模板计费 */ | ||||||
|  |   export interface TemplateCharge { | ||||||
|  |     /** 区域编号列表 */ | ||||||
|  |     areaIds: number[]; | ||||||
|  |     /** 首件数量 */ | ||||||
|  |     startCount: number; | ||||||
|  |     /** 首件价格,单位:分 */ | ||||||
|  |     startPrice: number; | ||||||
|  |     /** 续件数量 */ | ||||||
|  |     extraCount: number; | ||||||
|  |     /** 续件价格,单位:分 */ | ||||||
|  |     extraPrice: number; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 运费模板包邮 */ | ||||||
|  |   export interface TemplateFree { | ||||||
|  |     /** 区域编号列表 */ | ||||||
|  |     areaIds: number[]; | ||||||
|  |     /** 包邮件数 */ | ||||||
|  |     freeCount: number; | ||||||
|  |     /** 包邮金额,单位:分 */ | ||||||
|  |     freePrice: number; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 快递运费模板 */ | ||||||
|  |   export interface ExpressTemplate { | ||||||
|  |     /** 编号 */ | ||||||
|  |     id: number; | ||||||
|  |     /** 模板名称 */ | ||||||
|  |     name: string; | ||||||
|  |     /** 计费方式 */ | ||||||
|  |     chargeMode: number; | ||||||
|  |     /** 排序 */ | ||||||
|  |     sort: number; | ||||||
|  |     /** 计费区域列表 */ | ||||||
|  |     templateCharge: TemplateCharge[]; | ||||||
|  |     /** 包邮区域列表 */ | ||||||
|  |     templateFree: TemplateFree[]; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 运费模板精简信息 */ | ||||||
|  |   export interface SimpleTemplate { | ||||||
|  |     /** 编号 */ | ||||||
|  |     id: number; | ||||||
|  |     /** 模板名称 */ | ||||||
|  |     name: string; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询快递运费模板列表 */ | ||||||
|  | export function getDeliveryExpressTemplatePage(params: PageParam) { | ||||||
|  |   return requestClient.get< | ||||||
|  |     PageResult<DeliveryExpressTemplateApi.ExpressTemplate> | ||||||
|  |   >('/trade/delivery/express-template/page', { params }); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询快递运费模板详情 */ | ||||||
|  | export function getDeliveryExpressTemplate(id: number) { | ||||||
|  |   return requestClient.get<DeliveryExpressTemplateApi.ExpressTemplate>( | ||||||
|  |     `/trade/delivery/express-template/get?id=${id}`, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询快递运费模板详情 */ | ||||||
|  | export function getSimpleTemplateList() { | ||||||
|  |   return requestClient.get<DeliveryExpressTemplateApi.SimpleTemplate[]>( | ||||||
|  |     '/trade/delivery/express-template/list-all-simple', | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 新增快递运费模板 */ | ||||||
|  | export function createDeliveryExpressTemplate( | ||||||
|  |   data: DeliveryExpressTemplateApi.ExpressTemplate, | ||||||
|  | ) { | ||||||
|  |   return requestClient.post('/trade/delivery/express-template/create', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 修改快递运费模板 */ | ||||||
|  | export function updateDeliveryExpressTemplate( | ||||||
|  |   data: DeliveryExpressTemplateApi.ExpressTemplate, | ||||||
|  | ) { | ||||||
|  |   return requestClient.put('/trade/delivery/express-template/update', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 删除快递运费模板 */ | ||||||
|  | export function deleteDeliveryExpressTemplate(id: number) { | ||||||
|  |   return requestClient.delete( | ||||||
|  |     `/trade/delivery/express-template/delete?id=${id}`, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,91 @@ | ||||||
|  | import type { PageParam, PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace DeliveryPickUpStoreApi { | ||||||
|  |   /** 自提门店 */ | ||||||
|  |   export interface PickUpStore { | ||||||
|  |     /** 编号 */ | ||||||
|  |     id: number; | ||||||
|  |     /** 门店名称 */ | ||||||
|  |     name: string; | ||||||
|  |     /** 门店简介 */ | ||||||
|  |     introduction: string; | ||||||
|  |     /** 联系电话 */ | ||||||
|  |     phone: string; | ||||||
|  |     /** 区域编号 */ | ||||||
|  |     areaId: number; | ||||||
|  |     /** 详细地址 */ | ||||||
|  |     detailAddress: string; | ||||||
|  |     /** 门店 logo */ | ||||||
|  |     logo: string; | ||||||
|  |     /** 营业开始时间 */ | ||||||
|  |     openingTime: string; | ||||||
|  |     /** 营业结束时间 */ | ||||||
|  |     closingTime: string; | ||||||
|  |     /** 纬度 */ | ||||||
|  |     latitude: number; | ||||||
|  |     /** 经度 */ | ||||||
|  |     longitude: number; | ||||||
|  |     /** 状态 */ | ||||||
|  |     status: number; | ||||||
|  |     /** 绑定用户编号组数 */ | ||||||
|  |     verifyUserIds: number[]; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 绑定自提店员请求 */ | ||||||
|  |   export interface BindStaffRequest { | ||||||
|  |     /** 门店编号 */ | ||||||
|  |     storeId: number; | ||||||
|  |     /** 用户编号列表 */ | ||||||
|  |     userIds: number[]; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询自提门店列表 */ | ||||||
|  | export function getDeliveryPickUpStorePage(params: PageParam) { | ||||||
|  |   return requestClient.get<PageResult<DeliveryPickUpStoreApi.PickUpStore>>( | ||||||
|  |     '/trade/delivery/pick-up-store/page', | ||||||
|  |     { params }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询自提门店详情 */ | ||||||
|  | export function getDeliveryPickUpStore(id: number) { | ||||||
|  |   return requestClient.get<DeliveryPickUpStoreApi.PickUpStore>( | ||||||
|  |     `/trade/delivery/pick-up-store/get?id=${id}`, | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询自提门店精简列表 */ | ||||||
|  | export function getSimpleDeliveryPickUpStoreList() { | ||||||
|  |   return requestClient.get<DeliveryPickUpStoreApi.PickUpStore[]>( | ||||||
|  |     '/trade/delivery/pick-up-store/simple-list', | ||||||
|  |   ); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 新增自提门店 */ | ||||||
|  | export function createDeliveryPickUpStore( | ||||||
|  |   data: DeliveryPickUpStoreApi.PickUpStore, | ||||||
|  | ) { | ||||||
|  |   return requestClient.post('/trade/delivery/pick-up-store/create', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 修改自提门店 */ | ||||||
|  | export function updateDeliveryPickUpStore( | ||||||
|  |   data: DeliveryPickUpStoreApi.PickUpStore, | ||||||
|  | ) { | ||||||
|  |   return requestClient.put('/trade/delivery/pick-up-store/update', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 删除自提门店 */ | ||||||
|  | export function deleteDeliveryPickUpStore(id: number) { | ||||||
|  |   return requestClient.delete(`/trade/delivery/pick-up-store/delete?id=${id}`); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 绑定自提店员 */ | ||||||
|  | export function bindStoreStaffId( | ||||||
|  |   data: DeliveryPickUpStoreApi.BindStaffRequest, | ||||||
|  | ) { | ||||||
|  |   return requestClient.post('/trade/delivery/pick-up-store/bind', data); | ||||||
|  | } | ||||||
|  | @ -0,0 +1,291 @@ | ||||||
|  | import type { PageParam, PageResult } from '@vben/request'; | ||||||
|  | 
 | ||||||
|  | import { requestClient } from '#/api/request'; | ||||||
|  | 
 | ||||||
|  | export namespace OrderApi { | ||||||
|  |   /** 商品属性 */ | ||||||
|  |   export interface ProductProperty { | ||||||
|  |     /** 属性的编号 */ | ||||||
|  |     propertyId?: null | number; | ||||||
|  |     /** 属性的名称 */ | ||||||
|  |     propertyName?: string; | ||||||
|  |     /** 属性值的编号 */ | ||||||
|  |     valueId?: null | number; | ||||||
|  |     /** 属性值的名称 */ | ||||||
|  |     valueName?: string; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 订单项 */ | ||||||
|  |   export interface OrderItem { | ||||||
|  |     /** 编号 */ | ||||||
|  |     id?: null | number; | ||||||
|  |     /** 用户编号 */ | ||||||
|  |     userId?: null | number; | ||||||
|  |     /** 订单编号 */ | ||||||
|  |     orderId?: null | number; | ||||||
|  |     /** 商品 SPU 编号 */ | ||||||
|  |     spuId?: null | number; | ||||||
|  |     /** 商品 SPU 名称 */ | ||||||
|  |     spuName?: string; | ||||||
|  |     /** 商品 SKU 编号 */ | ||||||
|  |     skuId?: null | number; | ||||||
|  |     /** 商品图片 */ | ||||||
|  |     picUrl?: string; | ||||||
|  |     /** 购买数量 */ | ||||||
|  |     count?: null | number; | ||||||
|  |     /** 商品原价(总) */ | ||||||
|  |     originalPrice?: null | number; | ||||||
|  |     /** 商品原价(单) */ | ||||||
|  |     originalUnitPrice?: null | number; | ||||||
|  |     /** 商品优惠(总) */ | ||||||
|  |     discountPrice?: null | number; | ||||||
|  |     /** 商品实付金额(总) */ | ||||||
|  |     payPrice?: null | number; | ||||||
|  |     /** 子订单分摊金额(总) */ | ||||||
|  |     orderPartPrice?: null | number; | ||||||
|  |     /** 分摊后子订单实付金额(总) */ | ||||||
|  |     orderDividePrice?: null | number; | ||||||
|  |     /** 售后状态 */ | ||||||
|  |     afterSaleStatus?: null | number; | ||||||
|  |     /** 属性数组 */ | ||||||
|  |     properties?: ProductProperty[]; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 订单日志 */ | ||||||
|  |   export interface OrderLog { | ||||||
|  |     /** 日志内容 */ | ||||||
|  |     content?: string; | ||||||
|  |     /** 创建时间 */ | ||||||
|  |     createTime?: Date; | ||||||
|  |     /** 用户类型 */ | ||||||
|  |     userType?: number; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 订单 */ | ||||||
|  |   export interface Order { | ||||||
|  |     /** 订单编号 */ | ||||||
|  |     id?: null | number; | ||||||
|  |     /** 订单流水号 */ | ||||||
|  |     no?: string; | ||||||
|  |     /** 下单时间 */ | ||||||
|  |     createTime?: Date | null; | ||||||
|  |     /** 订单类型 */ | ||||||
|  |     type?: null | number; | ||||||
|  |     /** 订单来源 */ | ||||||
|  |     terminal?: null | number; | ||||||
|  |     /** 用户编号 */ | ||||||
|  |     userId?: null | number; | ||||||
|  |     /** 用户 IP */ | ||||||
|  |     userIp?: string; | ||||||
|  |     /** 用户备注 */ | ||||||
|  |     userRemark?: string; | ||||||
|  |     /** 订单状态 */ | ||||||
|  |     status?: null | number; | ||||||
|  |     /** 购买的商品数量 */ | ||||||
|  |     productCount?: null | number; | ||||||
|  |     /** 订单完成时间 */ | ||||||
|  |     finishTime?: Date | null; | ||||||
|  |     /** 订单取消时间 */ | ||||||
|  |     cancelTime?: Date | null; | ||||||
|  |     /** 取消类型 */ | ||||||
|  |     cancelType?: null | number; | ||||||
|  |     /** 商家备注 */ | ||||||
|  |     remark?: string; | ||||||
|  |     /** 支付订单编号 */ | ||||||
|  |     payOrderId?: null | number; | ||||||
|  |     /** 是否已支付 */ | ||||||
|  |     payStatus?: boolean; | ||||||
|  |     /** 付款时间 */ | ||||||
|  |     payTime?: Date | null; | ||||||
|  |     /** 支付渠道 */ | ||||||
|  |     payChannelCode?: string; | ||||||
|  |     /** 商品原价(总) */ | ||||||
|  |     totalPrice?: null | number; | ||||||
|  |     /** 订单优惠(总) */ | ||||||
|  |     discountPrice?: null | number; | ||||||
|  |     /** 运费金额 */ | ||||||
|  |     deliveryPrice?: null | number; | ||||||
|  |     /** 订单调价(总) */ | ||||||
|  |     adjustPrice?: null | number; | ||||||
|  |     /** 应付金额(总) */ | ||||||
|  |     payPrice?: null | number; | ||||||
|  |     /** 发货方式 */ | ||||||
|  |     deliveryType?: null | number; | ||||||
|  |     /** 自提门店编号 */ | ||||||
|  |     pickUpStoreId?: number; | ||||||
|  |     /** 自提核销码 */ | ||||||
|  |     pickUpVerifyCode?: string; | ||||||
|  |     /** 配送模板编号 */ | ||||||
|  |     deliveryTemplateId?: null | number; | ||||||
|  |     /** 发货物流公司编号 */ | ||||||
|  |     logisticsId?: null | number; | ||||||
|  |     /** 发货物流单号 */ | ||||||
|  |     logisticsNo?: string; | ||||||
|  |     /** 发货时间 */ | ||||||
|  |     deliveryTime?: Date | null; | ||||||
|  |     /** 收货时间 */ | ||||||
|  |     receiveTime?: Date | null; | ||||||
|  |     /** 收件人名称 */ | ||||||
|  |     receiverName?: string; | ||||||
|  |     /** 收件人手机 */ | ||||||
|  |     receiverMobile?: string; | ||||||
|  |     /** 收件人邮编 */ | ||||||
|  |     receiverPostCode?: null | number; | ||||||
|  |     /** 收件人地区编号 */ | ||||||
|  |     receiverAreaId?: null | number; | ||||||
|  |     /** 收件人地区名字 */ | ||||||
|  |     receiverAreaName?: string; | ||||||
|  |     /** 收件人详细地址 */ | ||||||
|  |     receiverDetailAddress?: string; | ||||||
|  |     /** 售后状态 */ | ||||||
|  |     afterSaleStatus?: null | number; | ||||||
|  |     /** 退款金额 */ | ||||||
|  |     refundPrice?: null | number; | ||||||
|  |     /** 优惠劵编号 */ | ||||||
|  |     couponId?: null | number; | ||||||
|  |     /** 优惠劵减免金额 */ | ||||||
|  |     couponPrice?: null | number; | ||||||
|  |     /** 积分抵扣的金额 */ | ||||||
|  |     pointPrice?: null | number; | ||||||
|  |     /** VIP 减免金额 */ | ||||||
|  |     vipPrice?: null | number; | ||||||
|  |     /** 订单项列表 */ | ||||||
|  |     items?: OrderItem[]; | ||||||
|  |     /** 下单用户信息 */ | ||||||
|  |     user?: { | ||||||
|  |       /** 用户头像 */ | ||||||
|  |       avatar?: string; | ||||||
|  |       /** 用户编号 */ | ||||||
|  |       id?: null | number; | ||||||
|  |       /** 用户昵称 */ | ||||||
|  |       nickname?: string; | ||||||
|  |     }; | ||||||
|  |     /** 推广用户信息 */ | ||||||
|  |     brokerageUser?: { | ||||||
|  |       /** 用户头像 */ | ||||||
|  |       avatar?: string; | ||||||
|  |       /** 用户编号 */ | ||||||
|  |       id?: null | number; | ||||||
|  |       /** 用户昵称 */ | ||||||
|  |       nickname?: string; | ||||||
|  |     }; | ||||||
|  |     /** 订单操作日志 */ | ||||||
|  |     logs?: OrderLog[]; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 交易订单统计 */ | ||||||
|  |   export interface OrderSummary { | ||||||
|  |     /** 订单数量 */ | ||||||
|  |     orderCount?: number; | ||||||
|  |     /** 订单金额 */ | ||||||
|  |     orderPayPrice?: string; | ||||||
|  |     /** 退款单数 */ | ||||||
|  |     afterSaleCount?: number; | ||||||
|  |     /** 退款金额 */ | ||||||
|  |     afterSalePrice?: string; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 订单发货请求 */ | ||||||
|  |   export interface DeliveryRequest { | ||||||
|  |     /** 订单编号 */ | ||||||
|  |     id?: number; | ||||||
|  |     /** 物流公司编号 */ | ||||||
|  |     logisticsId: null | number; | ||||||
|  |     /** 物流编号 */ | ||||||
|  |     logisticsNo: string; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 订单备注请求 */ | ||||||
|  |   export interface RemarkRequest { | ||||||
|  |     /** 订单编号 */ | ||||||
|  |     id: number; | ||||||
|  |     /** 备注 */ | ||||||
|  |     remark: string; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 订单调价请求 */ | ||||||
|  |   export interface PriceRequest { | ||||||
|  |     /** 订单编号 */ | ||||||
|  |     id: number; | ||||||
|  |     /** 调整金额,单位:分 */ | ||||||
|  |     adjustPrice: number; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   /** 订单地址请求 */ | ||||||
|  |   export interface AddressRequest { | ||||||
|  |     /** 订单编号 */ | ||||||
|  |     id: number; | ||||||
|  |     /** 收件人名称 */ | ||||||
|  |     receiverName: string; | ||||||
|  |     /** 收件人手机 */ | ||||||
|  |     receiverMobile: string; | ||||||
|  |     /** 收件人地区编号 */ | ||||||
|  |     receiverAreaId: number; | ||||||
|  |     /** 收件人详细地址 */ | ||||||
|  |     receiverDetailAddress: string; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询交易订单列表 */ | ||||||
|  | export function getOrderPage(params: PageParam) { | ||||||
|  |   return requestClient.get<PageResult<OrderApi.Order>>('/trade/order/page', { | ||||||
|  |     params, | ||||||
|  |   }); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询交易订单统计 */ | ||||||
|  | export function getOrderSummary(params: PageParam) { | ||||||
|  |   return requestClient.get<OrderApi.OrderSummary>('/trade/order/summary', { | ||||||
|  |     params, | ||||||
|  |   }); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询交易订单详情 */ | ||||||
|  | export function getOrder(id: number) { | ||||||
|  |   return requestClient.get<OrderApi.Order>(`/trade/order/get-detail?id=${id}`); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询交易订单物流详情 */ | ||||||
|  | export function getExpressTrackList(id: number) { | ||||||
|  |   return requestClient.get(`/trade/order/get-express-track-list?id=${id}`); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 订单发货 */ | ||||||
|  | export function deliveryOrder(data: OrderApi.DeliveryRequest) { | ||||||
|  |   return requestClient.put('/trade/order/delivery', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 订单备注 */ | ||||||
|  | export function updateOrderRemark(data: OrderApi.RemarkRequest) { | ||||||
|  |   return requestClient.put('/trade/order/update-remark', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 订单调价 */ | ||||||
|  | export function updateOrderPrice(data: OrderApi.PriceRequest) { | ||||||
|  |   return requestClient.put('/trade/order/update-price', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 修改订单地址 */ | ||||||
|  | export function updateOrderAddress(data: OrderApi.AddressRequest) { | ||||||
|  |   return requestClient.put('/trade/order/update-address', data); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 订单核销 */ | ||||||
|  | export function pickUpOrder(id: number) { | ||||||
|  |   return requestClient.put(`/trade/order/pick-up-by-id?id=${id}`); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 订单核销 */ | ||||||
|  | export function pickUpOrderByVerifyCode(pickUpVerifyCode: string) { | ||||||
|  |   return requestClient.put('/trade/order/pick-up-by-verify-code', { | ||||||
|  |     params: { pickUpVerifyCode }, | ||||||
|  |   }); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /** 查询核销码对应的订单 */ | ||||||
|  | export function getOrderByPickUpVerifyCode(pickUpVerifyCode: string) { | ||||||
|  |   return requestClient.get<OrderApi.Order>( | ||||||
|  |     '/trade/order/get-by-pick-up-verify-code', | ||||||
|  |     { params: { pickUpVerifyCode } }, | ||||||
|  |   ); | ||||||
|  | } | ||||||
		Loading…
	
		Reference in New Issue
	
	 xingyu4j
						xingyu4j