1
This commit is contained in:
107
src/api/shop/shopActivity/index.ts
Normal file
107
src/api/shop/shopActivity/index.ts
Normal file
@@ -0,0 +1,107 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopActivity, ShopActivityParam, ShopActivityFormField } from './model';
|
||||
|
||||
export type { ShopActivityFormField };
|
||||
|
||||
/**
|
||||
* 分页查询活动表
|
||||
*/
|
||||
export async function pageShopActivity(params: ShopActivityParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopActivity>>>(
|
||||
'/shop/shop-activity/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询活动表列表
|
||||
*/
|
||||
export async function listShopActivity(params?: ShopActivityParam) {
|
||||
const res = await request.get<ApiResult<ShopActivity[]>>(
|
||||
'/shop/shop-activity',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加活动表
|
||||
*/
|
||||
export async function addShopActivity(data: ShopActivity) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-activity',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改活动表
|
||||
*/
|
||||
export async function updateShopActivity(data: ShopActivity) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-activity',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除活动表
|
||||
*/
|
||||
export async function removeShopActivity(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-activity/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除活动表
|
||||
*/
|
||||
export async function removeBatchShopActivity(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-activity/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询活动表
|
||||
*/
|
||||
export async function getShopActivity(id: number) {
|
||||
const res = await request.get<ApiResult<ShopActivity>>(
|
||||
'/shop/shop-activity/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
52
src/api/shop/shopActivity/model/index.ts
Normal file
52
src/api/shop/shopActivity/model/index.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 活动表
|
||||
*/
|
||||
export interface ShopActivity {
|
||||
// 活动ID
|
||||
id?: number;
|
||||
// 活动名称
|
||||
name?: string;
|
||||
// 活动描述
|
||||
description?: string;
|
||||
// 活动封面图
|
||||
image?: string;
|
||||
// 活动banner图
|
||||
banner?: string;
|
||||
// 活动类型: 1满减 2折扣 3秒杀 4拼团
|
||||
type?: number;
|
||||
// 开始时间
|
||||
startTime?: string;
|
||||
// 结束时间
|
||||
endTime?: string;
|
||||
// 状态: 0未开始 1进行中 2已结束
|
||||
status?: number;
|
||||
// 活动规则(JSON)
|
||||
rules?: string;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 租户ID
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 活动表搜索条件
|
||||
*/
|
||||
export interface ShopActivityParam extends PageParam {
|
||||
id?: number;
|
||||
// 活动名称
|
||||
name?: string;
|
||||
// 活动类型
|
||||
type?: number;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 租户ID
|
||||
tenantId?: number;
|
||||
}
|
||||
105
src/api/shop/shopActivitySignup/index.ts
Normal file
105
src/api/shop/shopActivitySignup/index.ts
Normal file
@@ -0,0 +1,105 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopActivitySignup, ShopActivitySignupParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询活动报名表
|
||||
*/
|
||||
export async function pageShopActivitySignup(params: ShopActivitySignupParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopActivitySignup>>>(
|
||||
'/shop/shop-activity-signup/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询活动报名表列表
|
||||
*/
|
||||
export async function listShopActivitySignup(params?: ShopActivitySignupParam) {
|
||||
const res = await request.get<ApiResult<ShopActivitySignup[]>>(
|
||||
'/shop/shop-activity-signup',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加活动报名表
|
||||
*/
|
||||
export async function addShopActivitySignup(data: ShopActivitySignup) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-activity-signup',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改活动报名表
|
||||
*/
|
||||
export async function updateShopActivitySignup(data: ShopActivitySignup) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-activity-signup',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除活动报名表
|
||||
*/
|
||||
export async function removeShopActivitySignup(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-activity-signup/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除活动报名表
|
||||
*/
|
||||
export async function removeBatchShopActivitySignup(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-activity-signup/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询活动报名表
|
||||
*/
|
||||
export async function getShopActivitySignup(id: number) {
|
||||
const res = await request.get<ApiResult<ShopActivitySignup>>(
|
||||
'/shop/shop-activity-signup/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
41
src/api/shop/shopActivitySignup/model/index.ts
Normal file
41
src/api/shop/shopActivitySignup/model/index.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 活动报名表
|
||||
*/
|
||||
export interface ShopActivitySignup {
|
||||
// 报名ID
|
||||
signupId?: string;
|
||||
// 活动ID
|
||||
activityId?: string;
|
||||
// 用户ID
|
||||
userId?: string;
|
||||
// 报名表单填写数据JSON
|
||||
formData?: string;
|
||||
// 支付金额
|
||||
payAmount?: string;
|
||||
// 支付状态: 0未支付 1已支付
|
||||
payStatus?: number;
|
||||
// 支付时间
|
||||
payTime?: string;
|
||||
// 第三方交易号
|
||||
transactionId?: string;
|
||||
// 状态: 0已报名 1已取消
|
||||
status?: number;
|
||||
// 是否删除: 0否 1是
|
||||
deleted?: number;
|
||||
// 租户ID
|
||||
tenantId?: string;
|
||||
//
|
||||
createTime?: string;
|
||||
//
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 活动报名表搜索条件
|
||||
*/
|
||||
export interface ShopActivitySignupParam extends PageParam {
|
||||
signupId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
102
src/api/shop/shopCategory/index.ts
Normal file
102
src/api/shop/shopCategory/index.ts
Normal file
@@ -0,0 +1,102 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopCategory, ShopCategoryParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商品分类
|
||||
*/
|
||||
export async function pageShopCategory(params: ShopCategoryParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopCategory>>>(
|
||||
MODULES_API_URL + '/shop/shop-category/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询全部商品分类
|
||||
*/
|
||||
export async function listShopCategory(params?: ShopCategoryParam) {
|
||||
const res = await request.get<ApiResult<ShopCategory[]>>(
|
||||
MODULES_API_URL + '/shop/shop-category',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品分类
|
||||
*/
|
||||
export async function getShopCategory(id: number) {
|
||||
const res = await request.get<ApiResult<ShopCategory>>(
|
||||
MODULES_API_URL + '/shop/shop-category/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品分类
|
||||
*/
|
||||
export async function addShopCategory(data: ShopCategory) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-category',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品分类
|
||||
*/
|
||||
export async function updateShopCategory(data: ShopCategory) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-category',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品分类
|
||||
*/
|
||||
export async function removeShopCategory(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-category/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品分类
|
||||
*/
|
||||
export async function removeBatchShopCategory(
|
||||
data: (number | undefined)[]
|
||||
) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-category/batch',
|
||||
{ data }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
57
src/api/shop/shopCommissionRecord.ts
Normal file
57
src/api/shop/shopCommissionRecord.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type {
|
||||
ShopCommissionRecord,
|
||||
ShopCommissionRecordParam,
|
||||
ShopCommissionStats
|
||||
} from './model';
|
||||
|
||||
/**
|
||||
* 分页查询佣金记录
|
||||
*/
|
||||
export async function getCommissionRecordPage(
|
||||
params: ShopCommissionRecordParam
|
||||
) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopCommissionRecord>>>(
|
||||
'/shop/shop-commission-record/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取佣金记录列表(向后兼容,返回 { data: { list, total } } 格式)
|
||||
*/
|
||||
export function getCommissionRecordList(params: ShopCommissionRecordParam) {
|
||||
return request.get('/shop/shop-commission-record/page', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动触发佣金结算
|
||||
*/
|
||||
export async function settleCommission() {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-commission-record/settle'
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取佣金统计
|
||||
*/
|
||||
export async function getCommissionStats(params?: ShopCommissionRecordParam) {
|
||||
const res = await request.get<ApiResult<ShopCommissionStats>>(
|
||||
'/shop/shop-commission-record/stats',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
59
src/api/shop/shopCommissionRecord/model/index.ts
Normal file
59
src/api/shop/shopCommissionRecord/model/index.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 佣金记录
|
||||
*/
|
||||
export interface ShopCommissionRecord {
|
||||
// 记录ID
|
||||
recordId?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 用户昵称
|
||||
userNickname?: string;
|
||||
// 订单ID
|
||||
orderId?: number;
|
||||
// 订单编号
|
||||
orderNo?: string;
|
||||
// 佣金金额
|
||||
commissionAmount?: number;
|
||||
// 佣金比例
|
||||
commissionRate?: number;
|
||||
// 上级用户ID
|
||||
parentUserId?: number;
|
||||
// 上级用户昵称
|
||||
parentUserNickname?: string;
|
||||
// 佣金类型: 1-直接佣金 2-间接佣金
|
||||
commissionType?: number;
|
||||
// 状态: 0-待结算 1-已结算 2-已取消
|
||||
status?: number;
|
||||
// 结算时间
|
||||
settleTime?: string;
|
||||
// 创建时间
|
||||
createdTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 佣金记录查询参数
|
||||
*/
|
||||
export interface ShopCommissionRecordParam extends PageParam {
|
||||
userId?: number;
|
||||
orderId?: number;
|
||||
status?: number;
|
||||
commissionType?: number;
|
||||
createTimeStart?: string;
|
||||
createTimeEnd?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 佣金统计
|
||||
*/
|
||||
export interface ShopCommissionStats {
|
||||
// 待结算佣金
|
||||
pendingCommission?: number;
|
||||
// 已结算佣金
|
||||
settledCommission?: number;
|
||||
// 总佣金
|
||||
totalCommission?: number;
|
||||
// 今日佣金
|
||||
todayCommission?: number;
|
||||
}
|
||||
107
src/api/shop/shopCommissionRole/index.ts
Normal file
107
src/api/shop/shopCommissionRole/index.ts
Normal file
@@ -0,0 +1,107 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopCommissionRole, ShopCommissionRoleParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询分红角色
|
||||
*/
|
||||
export async function pageShopCommissionRole(params: ShopCommissionRoleParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopCommissionRole>>>(
|
||||
'/shop/shop-commission-role/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分红角色列表
|
||||
*/
|
||||
export async function listShopCommissionRole(params?: ShopCommissionRoleParam) {
|
||||
const res = await request.get<ApiResult<ShopCommissionRole[]>>(
|
||||
'/shop/shop-commission-role',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加分红角色
|
||||
*/
|
||||
export async function addShopCommissionRole(data: ShopCommissionRole) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-commission-role',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改分红角色
|
||||
*/
|
||||
export async function updateShopCommissionRole(data: ShopCommissionRole) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-commission-role',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分红角色
|
||||
*/
|
||||
export async function removeShopCommissionRole(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-commission-role/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除分红角色
|
||||
*/
|
||||
export async function removeBatchShopCommissionRole(
|
||||
data: (number | undefined)[]
|
||||
) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-commission-role/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询分红角色
|
||||
*/
|
||||
export async function getShopCommissionRole(id: number) {
|
||||
const res = await request.get<ApiResult<ShopCommissionRole>>(
|
||||
'/shop/shop-commission-role/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
35
src/api/shop/shopCommissionRole/model/index.ts
Normal file
35
src/api/shop/shopCommissionRole/model/index.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 分红角色
|
||||
*/
|
||||
export interface ShopCommissionRole {
|
||||
//
|
||||
id?: number;
|
||||
//
|
||||
title?: string;
|
||||
//
|
||||
provinceId?: number;
|
||||
//
|
||||
cityId?: number;
|
||||
//
|
||||
regionId?: number;
|
||||
// 状态, 0正常, 1异常
|
||||
status?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
//
|
||||
sortNumber?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分红角色搜索条件
|
||||
*/
|
||||
export interface ShopCommissionRoleParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
105
src/api/shop/shopCommunity/index.ts
Normal file
105
src/api/shop/shopCommunity/index.ts
Normal file
@@ -0,0 +1,105 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopCommunity, ShopCommunityParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询小区
|
||||
*/
|
||||
export async function pageShopCommunity(params: ShopCommunityParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopCommunity>>>(
|
||||
'/shop/shop-community/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询小区列表
|
||||
*/
|
||||
export async function listShopCommunity(params?: ShopCommunityParam) {
|
||||
const res = await request.get<ApiResult<ShopCommunity[]>>(
|
||||
'/shop/shop-community',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加小区
|
||||
*/
|
||||
export async function addShopCommunity(data: ShopCommunity) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-community',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改小区
|
||||
*/
|
||||
export async function updateShopCommunity(data: ShopCommunity) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-community',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除小区
|
||||
*/
|
||||
export async function removeShopCommunity(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-community/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除小区
|
||||
*/
|
||||
export async function removeBatchShopCommunity(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-community/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询小区
|
||||
*/
|
||||
export async function getShopCommunity(id: number) {
|
||||
const res = await request.get<ApiResult<ShopCommunity>>(
|
||||
'/shop/shop-community/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
35
src/api/shop/shopCommunity/model/index.ts
Normal file
35
src/api/shop/shopCommunity/model/index.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 小区
|
||||
*/
|
||||
export interface ShopCommunity {
|
||||
// ID
|
||||
id?: number;
|
||||
// 小区名称
|
||||
name?: string;
|
||||
// 小区编号
|
||||
code?: string;
|
||||
// 详细地址
|
||||
address?: string;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态, 0正常, 1冻结
|
||||
status?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 小区搜索条件
|
||||
*/
|
||||
export interface ShopCommunityParam extends PageParam {
|
||||
id?: number;
|
||||
name?: string;
|
||||
code?: string;
|
||||
keywords?: string;
|
||||
}
|
||||
96
src/api/shop/shopCoupon/index.ts
Normal file
96
src/api/shop/shopCoupon/index.ts
Normal file
@@ -0,0 +1,96 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopCoupon, ShopCouponParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询优惠券
|
||||
*/
|
||||
export async function pageShopCoupon(params: ShopCouponParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopCoupon>>>(
|
||||
'/shop/shop-coupon/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询优惠券列表
|
||||
*/
|
||||
export async function listShopCoupon(params?: ShopCouponParam) {
|
||||
const res = await request.get<ApiResult<ShopCoupon[]>>('/shop/shop-coupon', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加优惠券
|
||||
*/
|
||||
export async function addShopCoupon(data: ShopCoupon) {
|
||||
const res = await request.post<ApiResult<unknown>>('/shop/shop-coupon', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改优惠券
|
||||
*/
|
||||
export async function updateShopCoupon(data: ShopCoupon) {
|
||||
const res = await request.put<ApiResult<unknown>>('/shop/shop-coupon', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除优惠券
|
||||
*/
|
||||
export async function removeShopCoupon(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-coupon/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除优惠券
|
||||
*/
|
||||
export async function removeBatchShopCoupon(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-coupon/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询优惠券
|
||||
*/
|
||||
export async function getShopCoupon(id: number) {
|
||||
const res = await request.get<ApiResult<ShopCoupon>>(
|
||||
'/shop/shop-coupon/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
85
src/api/shop/shopCoupon/model/index.ts
Normal file
85
src/api/shop/shopCoupon/model/index.ts
Normal file
@@ -0,0 +1,85 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
import { ShopCouponApplyCate } from '@/api/shop/shopCouponApplyCate/model';
|
||||
import { ShopCouponApplyItem } from '@/api/shop/shopCouponApplyItem/model';
|
||||
|
||||
/**
|
||||
* 优惠券
|
||||
*/
|
||||
export interface ShopCoupon {
|
||||
// id
|
||||
id?: number;
|
||||
// 优惠券名称
|
||||
name?: string;
|
||||
// 优惠券描述
|
||||
description?: string;
|
||||
// 优惠券类型(10满减券 20折扣券 30免费券 40无门槛券 50场地使用券)
|
||||
type?: number;
|
||||
// 满减券-减免金额
|
||||
reducePrice?: string;
|
||||
// 折扣券-折扣率(0-100)
|
||||
discount?: number;
|
||||
// 最低消费金额
|
||||
minPrice?: string;
|
||||
// 到期类型(10领取后生效 20固定时间)
|
||||
expireType?: number;
|
||||
// 领取后生效-有效天数
|
||||
expireDay?: number;
|
||||
// 有效期开始时间
|
||||
startTime?: string | Date;
|
||||
// 有效期结束时间
|
||||
endTime?: string | Date;
|
||||
// 适用范围(10全部商品 20指定商品 30指定分类)
|
||||
applyRange?: number;
|
||||
// 适用范围配置(json格式)
|
||||
applyRangeConfig?: string;
|
||||
// 是否过期(0未过期 1已过期)
|
||||
isExpire?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 状态, 0正常, 1禁用
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 创建用户ID
|
||||
userId?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string | Date;
|
||||
// 修改时间
|
||||
updateTime?: string | Date;
|
||||
// 发放总数量(-1表示无限制)
|
||||
totalCount?: number;
|
||||
// 已发放数量
|
||||
issuedCount?: number;
|
||||
// 每人限领数量(-1表示无限制)
|
||||
limitPerUser?: number;
|
||||
// 是否启用(0禁用 1启用)
|
||||
enabled?: string;
|
||||
// 发放对象(0全部用户 1仅会员 2仅非会员 3指定用户)
|
||||
receiveTarget?: number;
|
||||
// 指定用户ID列表(JSON数组格式),receiveTarget=3时使用
|
||||
receiveUserIds?: string;
|
||||
// 场地使用券-场地类型
|
||||
venueType?: number;
|
||||
// 场地使用券-指定场地ID
|
||||
venueId?: number;
|
||||
// 场地使用券-可用次数(-1表示无限制)
|
||||
useCount?: number;
|
||||
// 场地使用券-使用时长(分钟)
|
||||
useDuration?: number;
|
||||
couponApplyCateList?: ShopCouponApplyCate[];
|
||||
couponApplyItemList?: ShopCouponApplyItem[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 优惠券搜索条件
|
||||
*/
|
||||
export interface ShopCouponParam extends PageParam {
|
||||
id?: number;
|
||||
name?: string;
|
||||
type?: number;
|
||||
keywords?: string;
|
||||
expireType?: number;
|
||||
isExpire?: number;
|
||||
}
|
||||
9
src/api/shop/shopCouponApplyCate/model/index.ts
Normal file
9
src/api/shop/shopCouponApplyCate/model/index.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* 优惠券
|
||||
*/
|
||||
export interface ShopCouponApplyCate {
|
||||
id?: number;
|
||||
couponId?: number;
|
||||
cateId?: number;
|
||||
cateLevel?: number;
|
||||
}
|
||||
9
src/api/shop/shopCouponApplyItem/model/index.ts
Normal file
9
src/api/shop/shopCouponApplyItem/model/index.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* 优惠券
|
||||
*/
|
||||
export interface ShopCouponApplyItem {
|
||||
id?: number;
|
||||
couponId?: number;
|
||||
type?: number;
|
||||
pk?: number;
|
||||
}
|
||||
161
src/api/shop/shopDealerApply/index.ts
Normal file
161
src/api/shop/shopDealerApply/index.ts
Normal file
@@ -0,0 +1,161 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopDealerApply, ShopDealerApplyParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询分销商申请记录表
|
||||
*/
|
||||
export async function pageShopDealerApply(params: ShopDealerApplyParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopDealerApply>>>(
|
||||
'/shop/shop-dealer-apply/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分销商申请记录表列表
|
||||
*/
|
||||
export async function listShopDealerApply(params?: ShopDealerApplyParam) {
|
||||
const res = await request.get<ApiResult<ShopDealerApply[]>>(
|
||||
'/shop/shop-dealer-apply',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加分销商申请记录表
|
||||
*/
|
||||
export async function addShopDealerApply(data: ShopDealerApply) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-apply',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改分销商申请记录表
|
||||
*/
|
||||
export async function updateShopDealerApply(data: ShopDealerApply) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-apply',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分销商申请记录表
|
||||
*/
|
||||
export async function removeShopDealerApply(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-apply/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除分销商申请记录表
|
||||
*/
|
||||
export async function removeBatchShopDealerApply(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-apply/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询分销商申请记录表
|
||||
*/
|
||||
export async function getShopDealerApply(id: number) {
|
||||
const res = await request.get<ApiResult<ShopDealerApply>>(
|
||||
'/shop/shop-dealer-apply/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核通过分销商申请
|
||||
*/
|
||||
export async function approveShopDealerApply(id: number) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
`/shop/shop-dealer-apply/${id}/approve`
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 驳回分销商申请
|
||||
*/
|
||||
export async function rejectShopDealerApply(
|
||||
id: number,
|
||||
data: { rejectReason: string }
|
||||
) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
`/shop/shop-dealer-apply/${id}/reject`,
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量审核通过分销商申请
|
||||
*/
|
||||
export async function batchApproveShopDealerApply(ids: number[]) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-apply/batch-approve',
|
||||
{ ids }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入经销商申请
|
||||
*/
|
||||
export async function importShopDealerApplies(file: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-apply/import',
|
||||
formData
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
61
src/api/shop/shopDealerApply/model/index.ts
Normal file
61
src/api/shop/shopDealerApply/model/index.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 分销商申请记录表
|
||||
*/
|
||||
export interface ShopDealerApply {
|
||||
// 主键ID
|
||||
applyId?: number;
|
||||
// 类型
|
||||
type?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 昵称
|
||||
nickName?: string;
|
||||
// 姓名
|
||||
realName?: string;
|
||||
// 经销商名称
|
||||
dealerName?: string;
|
||||
// 手机号
|
||||
mobile?: string;
|
||||
// 分销比例
|
||||
rate?: number;
|
||||
// 推荐人用户ID
|
||||
refereeId?: number;
|
||||
// 推荐人姓名
|
||||
refereeName?: string;
|
||||
// 申请方式(10需后台审核 20无需审核)
|
||||
applyType?: number;
|
||||
// 申请时间
|
||||
applyTime?: string | number | Date;
|
||||
// 审核状态 (10待审核 20审核通过 30驳回)
|
||||
applyStatus?: number;
|
||||
// 审核时间
|
||||
auditTime?: string | number | Date;
|
||||
// 驳回原因
|
||||
rejectReason?: string;
|
||||
comments?: string;
|
||||
// 商城ID
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销商申请记录表搜索条件
|
||||
*/
|
||||
export interface ShopDealerApplyParam extends PageParam {
|
||||
applyId?: number;
|
||||
userId?: number;
|
||||
realName?: string;
|
||||
dealerName?: string;
|
||||
mobile?: string;
|
||||
refereeId?: number;
|
||||
applyType?: number;
|
||||
applyStatus?: number;
|
||||
startTime?: string;
|
||||
endTime?: string;
|
||||
keywords?: string;
|
||||
}
|
||||
107
src/api/shop/shopDealerCapital/index.ts
Normal file
107
src/api/shop/shopDealerCapital/index.ts
Normal file
@@ -0,0 +1,107 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopDealerCapital, ShopDealerCapitalParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询分销商资金明细表
|
||||
*/
|
||||
export async function pageShopDealerCapital(params: ShopDealerCapitalParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopDealerCapital>>>(
|
||||
'/shop/shop-dealer-capital/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分销商资金明细表列表
|
||||
*/
|
||||
export async function listShopDealerCapital(params?: ShopDealerCapitalParam) {
|
||||
const res = await request.get<ApiResult<ShopDealerCapital[]>>(
|
||||
'/shop/shop-dealer-capital',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加分销商资金明细表
|
||||
*/
|
||||
export async function addShopDealerCapital(data: ShopDealerCapital) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-capital',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改分销商资金明细表
|
||||
*/
|
||||
export async function updateShopDealerCapital(data: ShopDealerCapital) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-capital',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分销商资金明细表
|
||||
*/
|
||||
export async function removeShopDealerCapital(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-capital/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除分销商资金明细表
|
||||
*/
|
||||
export async function removeBatchShopDealerCapital(
|
||||
data: (number | undefined)[]
|
||||
) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-capital/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询分销商资金明细表
|
||||
*/
|
||||
export async function getShopDealerCapital(id: number) {
|
||||
const res = await request.get<ApiResult<ShopDealerCapital>>(
|
||||
'/shop/shop-dealer-capital/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
43
src/api/shop/shopDealerCapital/model/index.ts
Normal file
43
src/api/shop/shopDealerCapital/model/index.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 分销商资金明细表
|
||||
*/
|
||||
export interface ShopDealerCapital {
|
||||
// 主键ID
|
||||
id?: number;
|
||||
// 分销商用户ID
|
||||
userId?: number;
|
||||
// 分销商昵称
|
||||
nickName?: string;
|
||||
// 订单ID
|
||||
orderId?: number;
|
||||
// 订单编号
|
||||
orderNo?: string;
|
||||
// 订单状态 (1已完成 4退款申请中 6已退款)
|
||||
orderStatus?: number;
|
||||
// 资金流动类型 (10佣金收入 20提现支出 30转账支出 40转账收入)
|
||||
flowType?: number;
|
||||
// 金额
|
||||
money?: string;
|
||||
// 描述
|
||||
comments?: string;
|
||||
// 对方用户ID
|
||||
toUserId?: number;
|
||||
// 商城ID
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销商资金明细表搜索条件
|
||||
*/
|
||||
export interface ShopDealerCapitalParam extends PageParam {
|
||||
id?: number;
|
||||
userId?: number;
|
||||
toUserId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
234
src/api/shop/shopDealerOrder/index.ts
Normal file
234
src/api/shop/shopDealerOrder/index.ts
Normal file
@@ -0,0 +1,234 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopDealerOrder, ShopDealerOrderParam } from './model';
|
||||
import { utils, writeFile } from 'xlsx';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { getTenantId } from '@/utils/domain';
|
||||
|
||||
/**
|
||||
* 分页查询分销商订单记录表
|
||||
*/
|
||||
export async function pageShopDealerOrder(params: ShopDealerOrderParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopDealerOrder>>>(
|
||||
'/shop/shop-dealer-order/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分销商订单记录表列表
|
||||
*/
|
||||
export async function listShopDealerOrder(params?: ShopDealerOrderParam) {
|
||||
const res = await request.get<ApiResult<ShopDealerOrder[]>>(
|
||||
'/shop/shop-dealer-order',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加分销商订单记录表
|
||||
*/
|
||||
export async function addShopDealerOrder(data: ShopDealerOrder) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改分销商订单记录表
|
||||
*/
|
||||
export async function updateShopDealerOrder(data: ShopDealerOrder) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分销商订单记录表
|
||||
*/
|
||||
export async function removeShopDealerOrder(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-order/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除分销商订单记录表
|
||||
*/
|
||||
export async function removeBatchShopDealerOrder(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-order/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询分销商订单记录表
|
||||
*/
|
||||
export async function getShopDealerOrder(id: number) {
|
||||
const res = await request.get<ApiResult<ShopDealerOrder>>(
|
||||
'/shop/shop-dealer-order/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入分销商订单
|
||||
*/
|
||||
export async function importShopDealerOrder(file: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-order/import',
|
||||
formData
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动触发单条订单佣金解冻
|
||||
*/
|
||||
export async function unfreezeShopDealerOrder(orderNo: string) {
|
||||
const res = await request.post<ApiResult<string>>(
|
||||
'/shop/shop-dealer-order/unfreeze',
|
||||
{ orderNo }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出分销商订单
|
||||
*/
|
||||
export async function exportShopDealerOrder(params?: ShopDealerOrderParam) {
|
||||
// 显示导出加载提示
|
||||
message.loading('正在准备导出数据...', 0);
|
||||
|
||||
try {
|
||||
// 获取数据
|
||||
const list = await listShopDealerOrder(params);
|
||||
|
||||
if (!list || list.length === 0) {
|
||||
message.destroy();
|
||||
message.warning('没有数据可以导出');
|
||||
return;
|
||||
}
|
||||
|
||||
// 构建导出数据
|
||||
const array: (string | number)[][] = [
|
||||
[
|
||||
'订单ID',
|
||||
'买家用户ID',
|
||||
'订单总金额',
|
||||
'一级分销商ID',
|
||||
'一级佣金',
|
||||
'二级分销商ID',
|
||||
'二级佣金',
|
||||
'三级分销商ID',
|
||||
'三级佣金',
|
||||
'订单状态',
|
||||
'结算状态',
|
||||
'结算时间',
|
||||
'创建时间'
|
||||
]
|
||||
];
|
||||
|
||||
list.forEach((order: ShopDealerOrder) => {
|
||||
array.push([
|
||||
order.orderId || '',
|
||||
order.userId || '',
|
||||
order.orderPrice || '0',
|
||||
order.firstUserId || '',
|
||||
order.firstMoney || '0',
|
||||
order.secondUserId || '',
|
||||
order.secondMoney || '0',
|
||||
order.thirdUserId || '',
|
||||
order.thirdMoney || '0',
|
||||
order.isInvalid === 0 ? '有效' : '失效',
|
||||
order.isSettled === 0 ? '未结算' : '已结算',
|
||||
order.settleTime ? new Date(order.settleTime).toLocaleString() : '',
|
||||
order.createTime || ''
|
||||
]);
|
||||
});
|
||||
|
||||
// 创建工作簿
|
||||
const sheetName = `shop_dealer_order_${getTenantId()}`;
|
||||
const workbook = {
|
||||
SheetNames: [sheetName],
|
||||
Sheets: {}
|
||||
};
|
||||
|
||||
const sheet = utils.aoa_to_sheet(array);
|
||||
workbook.Sheets[sheetName] = sheet;
|
||||
|
||||
// 设置列宽
|
||||
sheet['!cols'] = [
|
||||
{ wch: 15 }, // 订单ID
|
||||
{ wch: 12 }, // 买家用户ID
|
||||
{ wch: 12 }, // 订单总金额
|
||||
{ wch: 15 }, // 一级分销商ID
|
||||
{ wch: 12 }, // 一级佣金
|
||||
{ wch: 15 }, // 二级分销商ID
|
||||
{ wch: 12 }, // 二级佣金
|
||||
{ wch: 15 }, // 三级分销商ID
|
||||
{ wch: 12 }, // 三级佣金
|
||||
{ wch: 10 }, // 订单状态
|
||||
{ wch: 10 }, // 结算状态
|
||||
{ wch: 20 }, // 结算时间
|
||||
{ wch: 20 } // 创建时间
|
||||
];
|
||||
|
||||
message.destroy();
|
||||
message.loading('正在生成Excel文件...', 0);
|
||||
|
||||
// 延迟写入文件,确保消息提示显示
|
||||
setTimeout(() => {
|
||||
writeFile(workbook, `${sheetName}.xlsx`);
|
||||
message.destroy();
|
||||
message.success(`成功导出 ${list.length} 条记录`);
|
||||
}, 1000);
|
||||
} catch (error: any) {
|
||||
message.destroy();
|
||||
message.error(error.message || '导出失败,请重试');
|
||||
}
|
||||
}
|
||||
83
src/api/shop/shopDealerOrder/model/index.ts
Normal file
83
src/api/shop/shopDealerOrder/model/index.ts
Normal file
@@ -0,0 +1,83 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 分销商订单记录表
|
||||
*/
|
||||
export interface ShopDealerOrder {
|
||||
// 主键ID
|
||||
id?: number;
|
||||
// 买家用户ID
|
||||
userId?: number;
|
||||
// 商品名称
|
||||
title?: string;
|
||||
// 买家用户昵称
|
||||
nickname?: string;
|
||||
// 真实姓名
|
||||
realName?: string;
|
||||
// 订单编号
|
||||
orderNo?: string;
|
||||
// 订单总金额(不含运费)
|
||||
orderPrice?: string;
|
||||
// 结算金额
|
||||
settledPrice?: string;
|
||||
// 换算成度
|
||||
degreePrice?: string;
|
||||
// 支付金额
|
||||
payPrice?: string;
|
||||
// 分销商用户id(一级)
|
||||
firstUserId?: number;
|
||||
// 分销商用户id(二级)
|
||||
secondUserId?: number;
|
||||
// 分销商用户id(三级)
|
||||
thirdUserId?: number;
|
||||
// 分销佣金(一级)
|
||||
firstMoney?: string;
|
||||
// 分销佣金(二级)
|
||||
secondMoney?: string;
|
||||
// 分销佣金(三级)
|
||||
thirdMoney?: string;
|
||||
// 一级分销商昵称
|
||||
firstNickname?: string;
|
||||
// 二级分销商昵称
|
||||
secondNickname?: string;
|
||||
// 三级分销商昵称
|
||||
thirdNickname?: string;
|
||||
// 分销比例
|
||||
rate?: number;
|
||||
// 商品单价
|
||||
price?: string;
|
||||
// 订单月份
|
||||
month?: string;
|
||||
// 订单是否失效(0未失效 1已失效)
|
||||
isInvalid?: number;
|
||||
// 佣金结算(0未结算 1已结算)
|
||||
isSettled?: number;
|
||||
// 结算时间
|
||||
settleTime?: number;
|
||||
// 是否解冻(0否 1是)
|
||||
isUnfreeze?: number;
|
||||
// 解冻时间
|
||||
unfreezeTime?: number;
|
||||
// 订单备注
|
||||
comments?: string;
|
||||
// 商城ID
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销商订单记录表搜索条件
|
||||
*/
|
||||
export interface ShopDealerOrderParam extends PageParam {
|
||||
id?: number;
|
||||
orderNo?: string;
|
||||
productName?: string;
|
||||
userId?: number;
|
||||
isInvalid?: number;
|
||||
isSettled?: number;
|
||||
myOrder?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
138
src/api/shop/shopDealerPoster/index.ts
Normal file
138
src/api/shop/shopDealerPoster/index.ts
Normal file
@@ -0,0 +1,138 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ShopDealerPoster, ShopDealerPosterParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询分销商海报设置
|
||||
*/
|
||||
export async function pageShopDealerPoster(params: ShopDealerPosterParam) {
|
||||
const res = await request.get('/shop/dealer/poster/page', { params });
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分销商海报设置列表
|
||||
*/
|
||||
export async function listShopDealerPoster(params?: ShopDealerPosterParam) {
|
||||
const res = await request.get('/shop/dealer/poster/list', { params });
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询分销商海报设置
|
||||
*/
|
||||
export async function getShopDealerPoster(id: number) {
|
||||
const res = await request.get('/shop/dealer/poster/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前海报配置
|
||||
*/
|
||||
export async function getCurrentPosterConfig() {
|
||||
const res = await request.get('/shop/dealer/poster/config');
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加分销商海报设置
|
||||
*/
|
||||
export async function addShopDealerPoster(data: ShopDealerPoster) {
|
||||
const res = await request.post('/shop/dealer/poster', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改分销商海报设置
|
||||
*/
|
||||
export async function updateShopDealerPoster(data: ShopDealerPoster) {
|
||||
const res = await request.put('/shop/dealer/poster', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存海报配置
|
||||
*/
|
||||
export async function savePosterConfig(data: any) {
|
||||
const res = await request.post('/shop/dealer/poster/config', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分销商海报设置
|
||||
*/
|
||||
export async function removeShopDealerPoster(id: number) {
|
||||
const res = await request.delete('/shop/dealer/poster/' + id);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除分销商海报设置
|
||||
*/
|
||||
export async function removeBatchShopDealerPoster(ids: (number | undefined)[]) {
|
||||
const res = await request.delete('/shop/dealer/poster/batch', { data: ids });
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成海报
|
||||
*/
|
||||
export async function generatePoster(userId: number, config?: any) {
|
||||
const res = await request.post('/shop/dealer/poster/generate', {
|
||||
userId,
|
||||
config
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传海报背景图片
|
||||
*/
|
||||
export async function uploadPosterBackground(file: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
|
||||
const res = await request.post(
|
||||
'/shop/dealer/poster/upload/background',
|
||||
formData,
|
||||
{
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
93
src/api/shop/shopDealerPoster/model/index.ts
Normal file
93
src/api/shop/shopDealerPoster/model/index.ts
Normal file
@@ -0,0 +1,93 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 分销商海报设置
|
||||
*/
|
||||
export interface ShopDealerPoster {
|
||||
// 主键ID
|
||||
id?: number;
|
||||
// 海报名称
|
||||
name?: string;
|
||||
// 背景图片URL
|
||||
backgroundImage?: string;
|
||||
// 海报配置(JSON格式)
|
||||
config?: string;
|
||||
// 是否启用
|
||||
enabled?: boolean;
|
||||
// 是否默认
|
||||
isDefault?: boolean;
|
||||
// 排序
|
||||
sort?: number;
|
||||
// 商城ID
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string | Date;
|
||||
// 修改时间
|
||||
updateTime?: string | Date;
|
||||
}
|
||||
|
||||
/**
|
||||
* 海报配置
|
||||
*/
|
||||
export interface PosterConfig {
|
||||
// 背景图片
|
||||
backgroundImage?: string;
|
||||
// 海报尺寸
|
||||
width?: number;
|
||||
height?: number;
|
||||
// 是否显示头像
|
||||
showAvatar?: boolean;
|
||||
// 头像URL
|
||||
avatarUrl?: string;
|
||||
// 头像宽度
|
||||
avatarWidth?: number;
|
||||
// 头像形状 circle|square
|
||||
avatarShape?: string;
|
||||
// 是否显示昵称
|
||||
showNickname?: boolean;
|
||||
// 昵称
|
||||
nickname?: string;
|
||||
// 昵称字体大小
|
||||
nicknameFontSize?: number;
|
||||
// 昵称颜色
|
||||
nicknameColor?: string;
|
||||
// 是否显示二维码
|
||||
showQrcode?: boolean;
|
||||
// 二维码URL
|
||||
qrcodeUrl?: string;
|
||||
// 二维码宽度
|
||||
qrcodeWidth?: number;
|
||||
// 元素位置配置
|
||||
elements?: {
|
||||
avatar?: { x: number; y: number };
|
||||
nickname?: { x: number; y: number };
|
||||
qrcode?: { x: number; y: number };
|
||||
[key: string]: { x: number; y: number } | undefined;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销商海报设置搜索条件
|
||||
*/
|
||||
export interface ShopDealerPosterParam extends PageParam {
|
||||
id?: number;
|
||||
name?: string;
|
||||
enabled?: boolean;
|
||||
keywords?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 海报生成参数
|
||||
*/
|
||||
export interface PosterGenerateParam {
|
||||
// 用户ID
|
||||
userId: number;
|
||||
// 海报配置
|
||||
config?: PosterConfig;
|
||||
// 用户信息
|
||||
userInfo?: {
|
||||
nickname?: string;
|
||||
avatar?: string;
|
||||
qrcode?: string;
|
||||
};
|
||||
}
|
||||
108
src/api/shop/shopDealerRecord/index.ts
Normal file
108
src/api/shop/shopDealerRecord/index.ts
Normal file
@@ -0,0 +1,108 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopDealerRecord, ShopDealerRecordParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询客户跟进情况
|
||||
*/
|
||||
export async function pageShopDealerRecord(params: ShopDealerRecordParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopDealerRecord>>>(
|
||||
MODULES_API_URL + '/shop/shop-dealer-record/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询客户跟进情况列表
|
||||
*/
|
||||
export async function listShopDealerRecord(params?: ShopDealerRecordParam) {
|
||||
const res = await request.get<ApiResult<ShopDealerRecord[]>>(
|
||||
MODULES_API_URL + '/shop/shop-dealer-record',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加客户跟进情况
|
||||
*/
|
||||
export async function addShopDealerRecord(data: ShopDealerRecord) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-dealer-record',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改客户跟进情况
|
||||
*/
|
||||
export async function updateShopDealerRecord(data: ShopDealerRecord) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-dealer-record',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除客户跟进情况
|
||||
*/
|
||||
export async function removeShopDealerRecord(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-dealer-record/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除客户跟进情况
|
||||
*/
|
||||
export async function removeBatchShopDealerRecord(
|
||||
data: (number | undefined)[]
|
||||
) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-dealer-record/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询客户跟进情况
|
||||
*/
|
||||
export async function getShopDealerRecord(id: number) {
|
||||
const res = await request.get<ApiResult<ShopDealerRecord>>(
|
||||
MODULES_API_URL + '/shop/shop-dealer-record/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
39
src/api/shop/shopDealerRecord/model/index.ts
Normal file
39
src/api/shop/shopDealerRecord/model/index.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 客户跟进情况
|
||||
*/
|
||||
export interface ShopDealerRecord {
|
||||
// ID
|
||||
id?: number;
|
||||
// 上级id, 0是顶级
|
||||
parentId?: number;
|
||||
// 客户ID
|
||||
dealerId?: number;
|
||||
// 内容
|
||||
content?: string;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态, 0待处理, 1已完成
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 客户跟进情况搜索条件
|
||||
*/
|
||||
export interface ShopDealerRecordParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
107
src/api/shop/shopDealerReferee/index.ts
Normal file
107
src/api/shop/shopDealerReferee/index.ts
Normal file
@@ -0,0 +1,107 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopDealerReferee, ShopDealerRefereeParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询分销商推荐关系表
|
||||
*/
|
||||
export async function pageShopDealerReferee(params: ShopDealerRefereeParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopDealerReferee>>>(
|
||||
'/shop/shop-dealer-referee/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分销商推荐关系表列表
|
||||
*/
|
||||
export async function listShopDealerReferee(params?: ShopDealerRefereeParam) {
|
||||
const res = await request.get<ApiResult<ShopDealerReferee[]>>(
|
||||
'/shop/shop-dealer-referee',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加分销商推荐关系表
|
||||
*/
|
||||
export async function addShopDealerReferee(data: ShopDealerReferee) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-referee',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改分销商推荐关系表
|
||||
*/
|
||||
export async function updateShopDealerReferee(data: ShopDealerReferee) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-referee',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分销商推荐关系表
|
||||
*/
|
||||
export async function removeShopDealerReferee(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-referee/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除分销商推荐关系表
|
||||
*/
|
||||
export async function removeBatchShopDealerReferee(
|
||||
data: (number | undefined)[]
|
||||
) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-referee/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询分销商推荐关系表
|
||||
*/
|
||||
export async function getShopDealerReferee(id: number) {
|
||||
const res = await request.get<ApiResult<ShopDealerReferee>>(
|
||||
'/shop/shop-dealer-referee/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
48
src/api/shop/shopDealerReferee/model/index.ts
Normal file
48
src/api/shop/shopDealerReferee/model/index.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 分销商推荐关系表
|
||||
*/
|
||||
export interface ShopDealerReferee {
|
||||
// 主键ID
|
||||
id?: number;
|
||||
// 分销商用户ID
|
||||
dealerId?: number;
|
||||
// 分销商名称
|
||||
dealerName?: string;
|
||||
// 分销商头像
|
||||
dealerAvatar?: string;
|
||||
// 分销商手机号
|
||||
dealerPhone?: string;
|
||||
// 用户id(被推荐人)
|
||||
userId?: number;
|
||||
// 昵称
|
||||
nickname?: string;
|
||||
// 头像
|
||||
avatar?: string;
|
||||
// 别名
|
||||
alias?: string;
|
||||
// 手机号
|
||||
phone?: string;
|
||||
// 推荐关系层级(1,2,3)
|
||||
level?: number;
|
||||
// 商城ID
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销商推荐关系表搜索条件
|
||||
*/
|
||||
export interface ShopDealerRefereeParam extends PageParam {
|
||||
id?: number;
|
||||
dealerId?: number;
|
||||
userId?: number;
|
||||
level?: number;
|
||||
startTime?: string;
|
||||
endTime?: string;
|
||||
keywords?: string;
|
||||
}
|
||||
107
src/api/shop/shopDealerSetting/index.ts
Normal file
107
src/api/shop/shopDealerSetting/index.ts
Normal file
@@ -0,0 +1,107 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopDealerSetting, ShopDealerSettingParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询分销商设置表
|
||||
*/
|
||||
export async function pageShopDealerSetting(params: ShopDealerSettingParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopDealerSetting>>>(
|
||||
'/shop/shop-dealer-setting/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分销商设置表列表
|
||||
*/
|
||||
export async function listShopDealerSetting(params?: ShopDealerSettingParam) {
|
||||
const res = await request.get<ApiResult<ShopDealerSetting[]>>(
|
||||
'/shop/shop-dealer-setting',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加分销商设置表
|
||||
*/
|
||||
export async function addShopDealerSetting(data: ShopDealerSetting) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-setting',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改分销商设置表
|
||||
*/
|
||||
export async function updateShopDealerSetting(data: ShopDealerSetting) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-setting',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分销商设置表
|
||||
*/
|
||||
export async function removeShopDealerSetting(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-setting/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除分销商设置表
|
||||
*/
|
||||
export async function removeBatchShopDealerSetting(
|
||||
data: (number | undefined)[]
|
||||
) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-setting/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询分销商设置表
|
||||
*/
|
||||
export async function getShopDealerSetting(id: number) {
|
||||
const res = await request.get<ApiResult<ShopDealerSetting>>(
|
||||
'/shop/shop-dealer-setting/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
25
src/api/shop/shopDealerSetting/model/index.ts
Normal file
25
src/api/shop/shopDealerSetting/model/index.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 分销商设置表
|
||||
*/
|
||||
export interface ShopDealerSetting {
|
||||
// 设置项标示
|
||||
key?: string;
|
||||
// 设置项描述
|
||||
describe?: string;
|
||||
// 设置内容(json格式)
|
||||
values?: string;
|
||||
// 商城ID
|
||||
tenantId?: number;
|
||||
// 更新时间
|
||||
updateTime?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销商设置表搜索条件
|
||||
*/
|
||||
export interface ShopDealerSettingParam extends PageParam {
|
||||
key?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
137
src/api/shop/shopDealerUser/index.ts
Normal file
137
src/api/shop/shopDealerUser/index.ts
Normal file
@@ -0,0 +1,137 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopDealerUser, ShopDealerUserParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询分销商用户记录表
|
||||
*/
|
||||
export async function pageShopDealerUser(params: ShopDealerUserParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopDealerUser>>>(
|
||||
'/shop/shop-dealer-user/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分销商用户记录表列表
|
||||
*/
|
||||
export async function listShopDealerUser(params?: ShopDealerUserParam) {
|
||||
const res = await request.get<ApiResult<ShopDealerUser[]>>(
|
||||
'/shop/shop-dealer-user',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加分销商用户记录表
|
||||
*/
|
||||
export async function addShopDealerUser(data: ShopDealerUser) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改分销商用户记录表
|
||||
*/
|
||||
export async function updateShopDealerUser(data: ShopDealerUser) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分销商用户记录表
|
||||
*/
|
||||
export async function removeShopDealerUser(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-user/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除分销商用户记录表
|
||||
*/
|
||||
export async function removeBatchShopDealerUser(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-user/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询分销商用户记录表
|
||||
*/
|
||||
export async function getShopDealerUser(id: number) {
|
||||
const res = await request.get<ApiResult<ShopDealerUser>>(
|
||||
'/shop/shop-dealer-user/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入分销商用户
|
||||
*/
|
||||
export async function importShopDealerUsers(file: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-user/import',
|
||||
formData,
|
||||
{
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出分销商用户
|
||||
*/
|
||||
export async function exportShopDealerUsers(params?: ShopDealerUserParam) {
|
||||
const res = await request.get<Blob>('/shop/shop-dealer-user/export', {
|
||||
params,
|
||||
responseType: 'blob'
|
||||
});
|
||||
return res.data;
|
||||
}
|
||||
72
src/api/shop/shopDealerUser/model/index.ts
Normal file
72
src/api/shop/shopDealerUser/model/index.ts
Normal file
@@ -0,0 +1,72 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 分销商用户记录表
|
||||
*/
|
||||
export interface ShopDealerUser {
|
||||
// 主键ID
|
||||
id?: number;
|
||||
// 类型 0经销商 1企业 2集团
|
||||
type?: number;
|
||||
// 自增ID
|
||||
userId?: number;
|
||||
// 头像
|
||||
avatar?: string;
|
||||
// 店铺名称
|
||||
dealerName?: string;
|
||||
// 小区名称
|
||||
community?: string;
|
||||
// 姓名
|
||||
realName?: string;
|
||||
// 手机号
|
||||
mobile?: string;
|
||||
// 支付密码
|
||||
payPassword?: string;
|
||||
// 当前可提现佣金
|
||||
money?: string;
|
||||
// 已冻结佣金
|
||||
freezeMoney?: string;
|
||||
// 累积提现佣金
|
||||
totalMoney?: string;
|
||||
// 佣金比例
|
||||
rate?: string;
|
||||
// 单价
|
||||
price?: string;
|
||||
// 推荐人用户ID
|
||||
refereeId?: number;
|
||||
// 成员数量(一级)
|
||||
firstNum?: number;
|
||||
// 成员数量(二级)
|
||||
secondNum?: number;
|
||||
// 成员数量(三级)
|
||||
thirdNum?: number;
|
||||
// 专属二维码
|
||||
qrcode?: string;
|
||||
// 配送员所属门店
|
||||
shopName?: string;
|
||||
// 是否删除
|
||||
isDelete?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string | Date;
|
||||
// 修改时间
|
||||
updateTime?: string | Date;
|
||||
// 扩展字段,用于编辑表单
|
||||
shopDealerUserId?: number;
|
||||
shopDealerUserName?: string;
|
||||
status?: number;
|
||||
comments?: string;
|
||||
sortNumber?: number;
|
||||
image?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销商用户记录表搜索条件
|
||||
*/
|
||||
export interface ShopDealerUserParam extends PageParam {
|
||||
id?: number;
|
||||
realName?: string;
|
||||
mobile?: string;
|
||||
keywords?: string;
|
||||
}
|
||||
107
src/api/shop/shopDealerWithdraw/index.ts
Normal file
107
src/api/shop/shopDealerWithdraw/index.ts
Normal file
@@ -0,0 +1,107 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopDealerWithdraw, ShopDealerWithdrawParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询分销商提现明细表
|
||||
*/
|
||||
export async function pageShopDealerWithdraw(params: ShopDealerWithdrawParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopDealerWithdraw>>>(
|
||||
'/shop/shop-dealer-withdraw/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分销商提现明细表列表
|
||||
*/
|
||||
export async function listShopDealerWithdraw(params?: ShopDealerWithdrawParam) {
|
||||
const res = await request.get<ApiResult<ShopDealerWithdraw[]>>(
|
||||
'/shop/shop-dealer-withdraw',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加分销商提现明细表
|
||||
*/
|
||||
export async function addShopDealerWithdraw(data: ShopDealerWithdraw) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-withdraw',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改分销商提现明细表
|
||||
*/
|
||||
export async function updateShopDealerWithdraw(data: ShopDealerWithdraw) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-withdraw',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分销商提现明细表
|
||||
*/
|
||||
export async function removeShopDealerWithdraw(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-withdraw/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除分销商提现明细表
|
||||
*/
|
||||
export async function removeBatchShopDealerWithdraw(
|
||||
data: (number | undefined)[]
|
||||
) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-dealer-withdraw/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询分销商提现明细表
|
||||
*/
|
||||
export async function getShopDealerWithdraw(id: number) {
|
||||
const res = await request.get<ApiResult<ShopDealerWithdraw>>(
|
||||
'/shop/shop-dealer-withdraw/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
63
src/api/shop/shopDealerWithdraw/model/index.ts
Normal file
63
src/api/shop/shopDealerWithdraw/model/index.ts
Normal file
@@ -0,0 +1,63 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 分销商提现明细表
|
||||
*/
|
||||
export interface ShopDealerWithdraw {
|
||||
// 主键ID
|
||||
id?: number;
|
||||
// 分销商用户ID
|
||||
userId?: number;
|
||||
// 真实姓名
|
||||
realName?: string;
|
||||
// 昵称
|
||||
nickname?: string;
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
// 头像
|
||||
avatar?: string;
|
||||
// 提现金额
|
||||
money?: string;
|
||||
// 打款方式 (10微信 20支付宝 30银行卡)
|
||||
payType?: number;
|
||||
// 支付宝姓名
|
||||
alipayName?: string;
|
||||
// 支付宝账号
|
||||
alipayAccount?: string;
|
||||
// 微信姓名
|
||||
wechatAccount?: string;
|
||||
// 微信账号
|
||||
wechatName?: string;
|
||||
// 开户行名称
|
||||
bankName?: string;
|
||||
// 银行开户名
|
||||
bankAccount?: string;
|
||||
// 银行卡号
|
||||
bankCard?: string;
|
||||
// 申请状态 (10待审核 20审核通过 30驳回 40已打款)
|
||||
applyStatus?: number;
|
||||
// 审核时间
|
||||
auditTime?: any;
|
||||
// 驳回原因
|
||||
rejectReason?: string;
|
||||
// 来源客户端(APP、H5、小程序等)
|
||||
platform?: string;
|
||||
// 上传支付凭证
|
||||
image?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销商提现明细表搜索条件
|
||||
*/
|
||||
export interface ShopDealerWithdrawParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
129
src/api/shop/shopEvent/index.ts
Normal file
129
src/api/shop/shopEvent/index.ts
Normal file
@@ -0,0 +1,129 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopEvent, ShopEventParam, ShopEventRegistration, ShopEventRegistrationParam } from './model';
|
||||
|
||||
export type { ShopEvent, ShopEventParam, ShopEventRegistration, ShopEventRegistrationParam };
|
||||
|
||||
/**
|
||||
* 分页查询赛事
|
||||
*/
|
||||
export async function pageShopEvent(params: ShopEventParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopEvent>>>(
|
||||
'/shop/shop-event/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询赛事列表
|
||||
*/
|
||||
export async function listShopEvent(params?: ShopEventParam) {
|
||||
const res = await request.get<ApiResult<ShopEvent[]>>(
|
||||
'/shop/shop-event',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询赛事
|
||||
*/
|
||||
export async function getShopEvent(id: number) {
|
||||
const res = await request.get<ApiResult<ShopEvent>>(
|
||||
'/shop/shop-event/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加赛事
|
||||
*/
|
||||
export async function addShopEvent(data: ShopEvent) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-event',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改赛事
|
||||
*/
|
||||
export async function updateShopEvent(data: ShopEvent) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-event',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除赛事
|
||||
*/
|
||||
export async function removeShopEvent(id: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-event/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除赛事
|
||||
*/
|
||||
export async function removeBatchShopEvent(ids: number[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-event/batch',
|
||||
{ data: ids }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询赛事报名记录
|
||||
*/
|
||||
export async function pageShopEventRegistration(params: ShopEventRegistrationParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopEventRegistration>>>(
|
||||
'/shop/shop-event-registration/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据赛事ID查询报名记录
|
||||
*/
|
||||
export async function listShopEventRegistration(eventId: number) {
|
||||
const res = await request.get<ApiResult<ShopEventRegistration[]>>(
|
||||
'/shop/shop-event-registration',
|
||||
{ params: { eventId } }
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
119
src/api/shop/shopEvent/model.ts
Normal file
119
src/api/shop/shopEvent/model.ts
Normal file
@@ -0,0 +1,119 @@
|
||||
/**
|
||||
* 赛事相关接口
|
||||
*/
|
||||
export interface ShopEvent {
|
||||
/** 赛事ID */
|
||||
id?: number;
|
||||
/** 赛事名称 */
|
||||
name?: string;
|
||||
/** 赛事描述 */
|
||||
description?: string;
|
||||
/** 封面图 */
|
||||
image?: string;
|
||||
/** banner图 */
|
||||
banner?: string;
|
||||
/** 赛事日期 */
|
||||
eventDate?: string;
|
||||
/** 赛事地点 */
|
||||
location?: string;
|
||||
/** 名额上限,0=不限 */
|
||||
maxParticipants?: number;
|
||||
/** 报名费,0=免费 */
|
||||
entryFee?: number;
|
||||
/** 尺码选项,逗号分隔 */
|
||||
sizeOptions?: string;
|
||||
/** 是否必填姓名 */
|
||||
requireName?: number;
|
||||
/** 是否必填手机 */
|
||||
requirePhone?: number;
|
||||
/** 是否必填身份证 */
|
||||
requireIdCard?: number;
|
||||
/** 是否必填尺码 */
|
||||
requireSize?: number;
|
||||
/** 状态: 0=未开始 1=报名中 2=已截止 3=已结束 */
|
||||
status?: number;
|
||||
/** 是否热门 */
|
||||
isHot?: number;
|
||||
/** 租户ID */
|
||||
tenantId?: number;
|
||||
/** 创建时间 */
|
||||
createTime?: string;
|
||||
/** 修改时间 */
|
||||
updateTime?: string;
|
||||
/** 已缴费报名人数(非数据库字段) */
|
||||
paidCount?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 赛事查询参数
|
||||
*/
|
||||
export interface ShopEventParam {
|
||||
/** 关键词 */
|
||||
keyword?: string;
|
||||
/** 状态 */
|
||||
status?: number;
|
||||
/** 页码 */
|
||||
page?: number;
|
||||
/** 每页条数 */
|
||||
limit?: number;
|
||||
/** 租户ID */
|
||||
tenantId?: number;
|
||||
/** 排序字段 */
|
||||
orderField?: string;
|
||||
/** 排序方向 */
|
||||
sortOrder?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 赛事报名记录
|
||||
*/
|
||||
export interface ShopEventRegistration {
|
||||
/** 自增ID */
|
||||
id?: number;
|
||||
/** 赛事ID */
|
||||
eventId?: number;
|
||||
/** 用户ID */
|
||||
userId?: number;
|
||||
/** 姓名 */
|
||||
realName?: string;
|
||||
/** 手机号 */
|
||||
phone?: string;
|
||||
/** 身份证号 */
|
||||
idCard?: string;
|
||||
/** 服装尺码 */
|
||||
size?: string;
|
||||
/** 动态表单数据(JSON) */
|
||||
formData?: string;
|
||||
/** 应缴报名费 */
|
||||
entryFee?: number;
|
||||
/** 支付状态: 0=待缴费 1=已缴费 2=已取消 */
|
||||
payStatus?: number;
|
||||
/** 支付订单号 */
|
||||
orderNo?: string;
|
||||
/** 缴费时间 */
|
||||
paidAt?: string;
|
||||
/** 租户ID */
|
||||
tenantId?: number;
|
||||
/** 创建时间 */
|
||||
createTime?: string;
|
||||
/** 修改时间 */
|
||||
updateTime?: string;
|
||||
/** 赛事名称(非数据库字段) */
|
||||
eventName?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 赛事报名记录查询参数
|
||||
*/
|
||||
export interface ShopEventRegistrationParam {
|
||||
/** 赛事ID */
|
||||
eventId?: number;
|
||||
/** 支付状态 */
|
||||
payStatus?: number;
|
||||
/** 关键词 */
|
||||
keyword?: string;
|
||||
/** 页码 */
|
||||
page?: number;
|
||||
/** 每页条数 */
|
||||
limit?: number;
|
||||
}
|
||||
102
src/api/shop/shopExpress/index.ts
Normal file
102
src/api/shop/shopExpress/index.ts
Normal file
@@ -0,0 +1,102 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopExpress, ShopExpressParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询物流公司
|
||||
*/
|
||||
export async function pageShopExpress(params: ShopExpressParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopExpress>>>(
|
||||
'/shop/shop-express/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物流公司列表
|
||||
*/
|
||||
export async function listShopExpress(params?: ShopExpressParam) {
|
||||
const res = await request.get<ApiResult<ShopExpress[]>>(
|
||||
'/shop/shop-express',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加物流公司
|
||||
*/
|
||||
export async function addShopExpress(data: ShopExpress) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-express',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物流公司
|
||||
*/
|
||||
export async function updateShopExpress(data: ShopExpress) {
|
||||
const res = await request.put<ApiResult<unknown>>('/shop/shop-express', data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除物流公司
|
||||
*/
|
||||
export async function removeShopExpress(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-express/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除物流公司
|
||||
*/
|
||||
export async function removeBatchShopExpress(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-express/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询物流公司
|
||||
*/
|
||||
export async function getShopExpress(id: number) {
|
||||
const res = await request.get<ApiResult<ShopExpress>>(
|
||||
'/shop/shop-express/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
35
src/api/shop/shopExpress/model/index.ts
Normal file
35
src/api/shop/shopExpress/model/index.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 物流公司
|
||||
*/
|
||||
export interface ShopExpress {
|
||||
// 物流公司ID
|
||||
expressId?: number;
|
||||
// 物流公司名称
|
||||
expressName?: string;
|
||||
// 物流公司编码 (微信)
|
||||
wxCode?: string;
|
||||
// 物流公司编码 (快递100)
|
||||
kuaidi100Code?: string;
|
||||
// 物流公司编码 (快递鸟)
|
||||
kdniaoCode?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 物流公司搜索条件
|
||||
*/
|
||||
export interface ShopExpressParam extends PageParam {
|
||||
expressId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
111
src/api/shop/shopExpressTemplate/index.ts
Normal file
111
src/api/shop/shopExpressTemplate/index.ts
Normal file
@@ -0,0 +1,111 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopExpressTemplate, ShopExpressTemplateParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询运费模板
|
||||
*/
|
||||
export async function pageShopExpressTemplate(
|
||||
params: ShopExpressTemplateParam
|
||||
) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopExpressTemplate>>>(
|
||||
'/shop/shop-express-template/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询运费模板列表
|
||||
*/
|
||||
export async function listShopExpressTemplate(
|
||||
params?: ShopExpressTemplateParam
|
||||
) {
|
||||
const res = await request.get<ApiResult<ShopExpressTemplate[]>>(
|
||||
'/shop/shop-express-template',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加运费模板
|
||||
*/
|
||||
export async function addShopExpressTemplate(data: ShopExpressTemplate) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-express-template',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改运费模板
|
||||
*/
|
||||
export async function updateShopExpressTemplate(data: ShopExpressTemplate) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-express-template',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除运费模板
|
||||
*/
|
||||
export async function removeShopExpressTemplate(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-express-template/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除运费模板
|
||||
*/
|
||||
export async function removeBatchShopExpressTemplate(
|
||||
data: (number | undefined)[]
|
||||
) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-express-template/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询运费模板
|
||||
*/
|
||||
export async function getShopExpressTemplate(id: number) {
|
||||
const res = await request.get<ApiResult<ShopExpressTemplate>>(
|
||||
'/shop/shop-express-template/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
43
src/api/shop/shopExpressTemplate/model/index.ts
Normal file
43
src/api/shop/shopExpressTemplate/model/index.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 运费模板
|
||||
*/
|
||||
export interface ShopExpressTemplate {
|
||||
//
|
||||
id?: number;
|
||||
//
|
||||
type?: string;
|
||||
//
|
||||
title?: string;
|
||||
// 收件价格
|
||||
firstAmount?: string;
|
||||
// 续件价格
|
||||
extraAmount?: string;
|
||||
// 状态, 0已发布, 1待审核 2已驳回 3违规内容
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 首件数量/重量
|
||||
firstNum?: string;
|
||||
// 续件数量/重量
|
||||
extraNum?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 运费模板搜索条件
|
||||
*/
|
||||
export interface ShopExpressTemplateParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
117
src/api/shop/shopExpressTemplateDetail/index.ts
Normal file
117
src/api/shop/shopExpressTemplateDetail/index.ts
Normal file
@@ -0,0 +1,117 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type {
|
||||
ShopExpressTemplateDetail,
|
||||
ShopExpressTemplateDetailParam
|
||||
} from './model';
|
||||
|
||||
/**
|
||||
* 分页查询运费模板
|
||||
*/
|
||||
export async function pageShopExpressTemplateDetail(
|
||||
params: ShopExpressTemplateDetailParam
|
||||
) {
|
||||
const res = await request.get<
|
||||
ApiResult<PageResult<ShopExpressTemplateDetail>>
|
||||
>('/shop/shop-express-template-detail/page', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询运费模板列表
|
||||
*/
|
||||
export async function listShopExpressTemplateDetail(
|
||||
params?: ShopExpressTemplateDetailParam
|
||||
) {
|
||||
const res = await request.get<ApiResult<ShopExpressTemplateDetail[]>>(
|
||||
'/shop/shop-express-template-detail',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加运费模板
|
||||
*/
|
||||
export async function addShopExpressTemplateDetail(
|
||||
data: ShopExpressTemplateDetail
|
||||
) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-express-template-detail',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改运费模板
|
||||
*/
|
||||
export async function updateShopExpressTemplateDetail(
|
||||
data: ShopExpressTemplateDetail
|
||||
) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-express-template-detail',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除运费模板
|
||||
*/
|
||||
export async function removeShopExpressTemplateDetail(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-express-template-detail/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除运费模板
|
||||
*/
|
||||
export async function removeBatchShopExpressTemplateDetail(
|
||||
data: (number | undefined)[]
|
||||
) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-express-template-detail/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询运费模板
|
||||
*/
|
||||
export async function getShopExpressTemplateDetail(id: number) {
|
||||
const res = await request.get<ApiResult<ShopExpressTemplateDetail>>(
|
||||
'/shop/shop-express-template-detail/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
45
src/api/shop/shopExpressTemplateDetail/model/index.ts
Normal file
45
src/api/shop/shopExpressTemplateDetail/model/index.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 运费模板
|
||||
*/
|
||||
export interface ShopExpressTemplateDetail {
|
||||
//
|
||||
id?: number;
|
||||
//
|
||||
templateId?: number;
|
||||
// 0按件
|
||||
type?: string;
|
||||
//
|
||||
provinceId?: number;
|
||||
//
|
||||
cityId?: number;
|
||||
// 首件数量/重量
|
||||
firstNum?: string;
|
||||
// 收件价格
|
||||
firstAmount?: string;
|
||||
// 续件价格
|
||||
extraAmount?: string;
|
||||
// 续件数量/重量
|
||||
extraNum?: string;
|
||||
// 状态, 0已发布, 1待审核 2已驳回 3违规内容
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
//
|
||||
sortNumber?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 运费模板搜索条件
|
||||
*/
|
||||
export interface ShopExpressTemplateDetailParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
130
src/api/shop/shopGift/index.ts
Normal file
130
src/api/shop/shopGift/index.ts
Normal file
@@ -0,0 +1,130 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api/index';
|
||||
import type { ShopGift, ShopGiftParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询礼品卡
|
||||
*/
|
||||
export async function pageShopGift(params: ShopGiftParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopGift>>>(
|
||||
MODULES_API_URL + '/shop/shop-gift/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询礼品卡列表
|
||||
*/
|
||||
export async function listShopGift(params?: ShopGiftParam) {
|
||||
const res = await request.get<ApiResult<ShopGift[]>>(
|
||||
MODULES_API_URL + '/shop/shop-gift',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加礼品卡
|
||||
*/
|
||||
export async function addShopGift(data: ShopGift) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-gift',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成礼品卡
|
||||
*/
|
||||
export async function makeShopGift(data: ShopGift) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-gift/make',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改礼品卡
|
||||
*/
|
||||
export async function updateShopGift(data: ShopGift) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-gift',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除礼品卡
|
||||
*/
|
||||
export async function removeShopGift(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-gift/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除礼品卡
|
||||
*/
|
||||
export async function removeBatchShopGift(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-gift/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询礼品卡
|
||||
*/
|
||||
export async function getShopGift(id: number) {
|
||||
const res = await request.get<ApiResult<ShopGift>>(
|
||||
MODULES_API_URL + '/shop/shop-gift/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function exportShopGift(ids?: number[]) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-gift/export',
|
||||
ids
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
61
src/api/shop/shopGift/model/index.ts
Normal file
61
src/api/shop/shopGift/model/index.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 礼品卡
|
||||
*/
|
||||
export interface ShopGift {
|
||||
//
|
||||
id?: number;
|
||||
//
|
||||
name?: string;
|
||||
// 秘钥
|
||||
code?: string;
|
||||
// 商品ID
|
||||
goodsId?: number;
|
||||
// 商品名称
|
||||
goodsName?: string;
|
||||
// 面值
|
||||
faceValue?: string;
|
||||
// 领取时间
|
||||
takeTime?: string;
|
||||
// 核销时间
|
||||
verificationTime?: string;
|
||||
// 操作人ID
|
||||
operatorUserId?: number;
|
||||
// 操作人
|
||||
operatorUserName?: string;
|
||||
// 操作备注
|
||||
operatorRemarks?: string;
|
||||
// 使用地址
|
||||
useLocation?: string;
|
||||
// 是否展示
|
||||
isShow?: boolean;
|
||||
// 状态, 0上架 1待上架 2待审核 3审核不通过
|
||||
status?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 昵称
|
||||
nickName?: string;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
num?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 礼品卡搜索条件
|
||||
*/
|
||||
export interface ShopGiftParam extends PageParam {
|
||||
id?: number;
|
||||
code?: string;
|
||||
keywords?: string;
|
||||
}
|
||||
132
src/api/shop/shopGoods/index.ts
Normal file
132
src/api/shop/shopGoods/index.ts
Normal file
@@ -0,0 +1,132 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopGoods, ShopGoodsParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商品
|
||||
*/
|
||||
export async function pageShopGoods(params: ShopGoodsParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopGoods>>>(
|
||||
MODULES_API_URL + '/shop/shop-goods/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品列表
|
||||
*/
|
||||
export async function listShopGoods(params?: ShopGoodsParam) {
|
||||
const res = await request.get<ApiResult<ShopGoods[]>>(
|
||||
MODULES_API_URL + '/shop/shop-goods',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品
|
||||
*/
|
||||
export async function addShopGoods(data: ShopGoods) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-goods',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品
|
||||
*/
|
||||
export async function updateShopGoods(data: ShopGoods) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-goods',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品
|
||||
*/
|
||||
export async function removeShopGoods(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-goods/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品
|
||||
*/
|
||||
export async function removeBatchShopGoods(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-goods/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品
|
||||
*/
|
||||
export async function getShopGoods(id: number) {
|
||||
const res = await request.get<ApiResult<ShopGoods>>(
|
||||
MODULES_API_URL + '/shop/shop-goods/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function getCount(params: ShopGoodsParam) {
|
||||
const res = await request.get(MODULES_API_URL + '/shop/shop-goods/data', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入商品
|
||||
*/
|
||||
export async function importShopGoods(file: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-goods/import',
|
||||
formData
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
167
src/api/shop/shopGoods/model/index.ts
Normal file
167
src/api/shop/shopGoods/model/index.ts
Normal file
@@ -0,0 +1,167 @@
|
||||
import type { PageParam } from '@/api';
|
||||
import { ShopGoodsSpec } from '@/api/shop/shopGoodsSpec/model';
|
||||
import { ShopGoodsSku } from '@/api/shop/shopGoodsSku/model';
|
||||
import { ShopGoodsRoleCommission } from '@/api/shop/shopGoodsRoleCommission/model';
|
||||
|
||||
export interface GoodsCount {
|
||||
totalNum: number;
|
||||
totalNum2: number;
|
||||
totalNum3: number;
|
||||
totalNum4: number;
|
||||
}
|
||||
/**
|
||||
* 商品记录表
|
||||
*/
|
||||
export interface ShopGoods {
|
||||
// 自增ID
|
||||
goodsId?: number;
|
||||
// 类型 1实物商品 2虚拟商品
|
||||
type?: number;
|
||||
// 商品编码
|
||||
code?: string;
|
||||
// 商品名称
|
||||
name?: string;
|
||||
// 商品标题
|
||||
goodsName?: string;
|
||||
// 商品封面图
|
||||
image?: string;
|
||||
video?: string;
|
||||
// 商品详情
|
||||
content?: string;
|
||||
canExpress?: number;
|
||||
// 商品分类
|
||||
category?: string;
|
||||
// 商品分类ID
|
||||
categoryId?: number;
|
||||
parentName?: string;
|
||||
categoryName?: string;
|
||||
// 一级分类
|
||||
categoryParent?: string;
|
||||
// 二级分类
|
||||
categoryChildren?: string;
|
||||
// 商品规格 0单规格 1多规格
|
||||
specs?: number;
|
||||
commissionRole?: number;
|
||||
// 货架
|
||||
position?: string;
|
||||
// 套餐价格
|
||||
buyingPrice?: string;
|
||||
// 商品价格
|
||||
price?: string;
|
||||
originPrice?: string;
|
||||
// 销售价格
|
||||
salePrice?: string;
|
||||
chainStorePrice?: string;
|
||||
chainStoreRate?: string;
|
||||
memberStoreRate?: string;
|
||||
memberMarketRate?: string;
|
||||
memberStoreCommission?: string;
|
||||
supplierCommission?: string;
|
||||
coopCommission?: string;
|
||||
memberStorePrice?: string;
|
||||
memberMarketPrice?: string;
|
||||
// 经销商价格
|
||||
dealerPrice?: string;
|
||||
// 有赠品
|
||||
buyingGift?: boolean;
|
||||
// 有赠品
|
||||
priceGift?: boolean;
|
||||
// 有赠品
|
||||
dealerGift?: boolean;
|
||||
buyingGiftNum?: number;
|
||||
priceGiftNum?: number;
|
||||
priceGiftName?: string;
|
||||
dealerGiftNum?: number;
|
||||
// 库存计算方式(10下单减库存 20付款减库存)
|
||||
deductStockType?: number;
|
||||
// 封面图
|
||||
files?: string;
|
||||
// 销量
|
||||
sales?: number;
|
||||
isNew?: number;
|
||||
// 库存
|
||||
stock?: number;
|
||||
// 商品重量
|
||||
goodsWeight?: number;
|
||||
// 消费赚取积分
|
||||
gainIntegral?: number;
|
||||
// 推荐
|
||||
recommend?: number;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 商户名称
|
||||
merchantName?: string;
|
||||
supplierMerchantId?: number;
|
||||
supplierName?: string;
|
||||
// 状态(0:未上架,1:上架)
|
||||
isShow?: boolean;
|
||||
// 状态, 0上架 1待上架 2待审核 3审核不通过
|
||||
status?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
// 显示规格名
|
||||
specName?: string;
|
||||
// 商品规格
|
||||
goodsSpecs?: ShopGoodsSpec[];
|
||||
goodsRoleCommission?: ShopGoodsRoleCommission[];
|
||||
// 商品sku列表
|
||||
goodsSkus?: ShopGoodsSku[];
|
||||
// 单位名称
|
||||
unitName?: string;
|
||||
expressTemplateId?: number;
|
||||
canUseDate?: string;
|
||||
ensureTag?: string;
|
||||
expiredDay?: number;
|
||||
|
||||
// --- 分销/佣金(新字段,后端保持 snake_case)---
|
||||
// 是否开启分销佣金:0关闭 1开启
|
||||
isOpenCommission?: number;
|
||||
// 分佣类型:10固定金额 20百分比
|
||||
commissionType?: number;
|
||||
// 一级/二级/三级分销佣金(单位以服务端为准)
|
||||
firstMoney?: number;
|
||||
secondMoney?: number;
|
||||
thirdMoney?: number;
|
||||
// 一级/二级分润(单位以服务端为准)
|
||||
firstDividend?: number;
|
||||
secondDividend?: number;
|
||||
// 配送奖金
|
||||
deliveryMoney?: number;
|
||||
// 活动方式:0全平台 1新用户专享
|
||||
activityType?: number;
|
||||
// 配送方式:0送上门 1限自提
|
||||
deliveryMode?: number;
|
||||
}
|
||||
|
||||
export interface BathSet {
|
||||
price?: number;
|
||||
salePrice?: number;
|
||||
stock?: number;
|
||||
skuNo?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品记录表搜索条件
|
||||
*/
|
||||
export interface ShopGoodsParam extends PageParam {
|
||||
parentId?: number;
|
||||
categoryId?: number;
|
||||
goodsId?: number;
|
||||
status?: number;
|
||||
goodsName?: string;
|
||||
isShow?: number;
|
||||
stock?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
108
src/api/shop/shopGoodsCategory/index.ts
Normal file
108
src/api/shop/shopGoodsCategory/index.ts
Normal file
@@ -0,0 +1,108 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopGoodsCategory, ShopGoodsCategoryParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商品分类
|
||||
*/
|
||||
export async function pageShopGoodsCategory(params: ShopGoodsCategoryParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopGoodsCategory>>>(
|
||||
MODULES_API_URL + '/shop/shop-goods-category/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品分类列表
|
||||
*/
|
||||
export async function listShopGoodsCategory(params?: ShopGoodsCategoryParam) {
|
||||
const res = await request.get<ApiResult<ShopGoodsCategory[]>>(
|
||||
MODULES_API_URL + '/shop/shop-goods-category',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品分类
|
||||
*/
|
||||
export async function addShopGoodsCategory(data: ShopGoodsCategory) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-goods-category',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品分类
|
||||
*/
|
||||
export async function updateShopGoodsCategory(data: ShopGoodsCategory) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-goods-category',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品分类
|
||||
*/
|
||||
export async function removeShopGoodsCategory(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-goods-category/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品分类
|
||||
*/
|
||||
export async function removeBatchShopGoodsCategory(
|
||||
data: (number | undefined)[]
|
||||
) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-goods-category/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品分类
|
||||
*/
|
||||
export async function getShopGoodsCategory(id: number) {
|
||||
const res = await request.get<ApiResult<ShopGoodsCategory>>(
|
||||
MODULES_API_URL + '/shop/shop-goods-category/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
65
src/api/shop/shopGoodsCategory/model/index.ts
Normal file
65
src/api/shop/shopGoodsCategory/model/index.ts
Normal file
@@ -0,0 +1,65 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商品分类
|
||||
*/
|
||||
export interface ShopGoodsCategory {
|
||||
// 商品分类ID
|
||||
categoryId?: number;
|
||||
// 分类标识
|
||||
categoryCode?: string;
|
||||
// 分类名称
|
||||
title?: string;
|
||||
// 类型 0商城分类 1外卖分类
|
||||
type?: number;
|
||||
// 分类图片
|
||||
image?: string;
|
||||
// 上级分类ID
|
||||
parentId?: number;
|
||||
// 路由/链接地址
|
||||
path?: string;
|
||||
// 组件路径
|
||||
component?: string;
|
||||
// 绑定的页面
|
||||
pageId?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 商品数量
|
||||
count?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)
|
||||
hide?: number;
|
||||
// 是否推荐
|
||||
recommend?: number;
|
||||
// 是否显示在首页
|
||||
showIndex?: number;
|
||||
// 商铺ID
|
||||
merchantId?: number;
|
||||
// 状态, 0正常, 1禁用
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
// 子菜单
|
||||
children?: ShopGoodsCategory[];
|
||||
key?: number;
|
||||
value?: number;
|
||||
label?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品分类搜索条件
|
||||
*/
|
||||
export interface ShopGoodsCategoryParam extends PageParam {
|
||||
categoryId?: number;
|
||||
keywords?: string;
|
||||
type?: number;
|
||||
}
|
||||
106
src/api/shop/shopGoodsCoupon/index.ts
Normal file
106
src/api/shop/shopGoodsCoupon/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api/index';
|
||||
import type { ShopGoodsCoupon, ShopGoodsCouponParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商品优惠券表
|
||||
*/
|
||||
export async function pageShopGoodsCoupon(params: ShopGoodsCouponParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopGoodsCoupon>>>(
|
||||
MODULES_API_URL + '/shop/shop-goods-coupon/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品优惠券表列表
|
||||
*/
|
||||
export async function listShopGoodsCoupon(params?: ShopGoodsCouponParam) {
|
||||
const res = await request.get<ApiResult<ShopGoodsCoupon[]>>(
|
||||
MODULES_API_URL + '/shop/shop-goods-coupon',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品优惠券表
|
||||
*/
|
||||
export async function addShopGoodsCoupon(data: ShopGoodsCoupon) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-goods-coupon',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品优惠券表
|
||||
*/
|
||||
export async function updateShopGoodsCoupon(data: ShopGoodsCoupon) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-goods-coupon',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品优惠券表
|
||||
*/
|
||||
export async function removeShopGoodsCoupon(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-goods-coupon/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品优惠券表
|
||||
*/
|
||||
export async function removeBatchShopGoodsCoupon(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-goods-coupon/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品优惠券表
|
||||
*/
|
||||
export async function getShopGoodsCoupon(id: number) {
|
||||
const res = await request.get<ApiResult<ShopGoodsCoupon>>(
|
||||
MODULES_API_URL + '/shop/shop-goods-coupon/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
37
src/api/shop/shopGoodsCoupon/model/index.ts
Normal file
37
src/api/shop/shopGoodsCoupon/model/index.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 商品优惠券表
|
||||
*/
|
||||
export interface ShopGoodsCoupon {
|
||||
//
|
||||
id?: number;
|
||||
// 商品id
|
||||
goodsId?: number;
|
||||
// 优惠劵id
|
||||
issueCouponId?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 状态, 0正常, 1冻结
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品优惠券表搜索条件
|
||||
*/
|
||||
export interface ShopGoodsCouponParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
119
src/api/shop/shopGoodsRoleCommission/index.ts
Normal file
119
src/api/shop/shopGoodsRoleCommission/index.ts
Normal file
@@ -0,0 +1,119 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
import {
|
||||
ShopGoodsRoleCommission,
|
||||
ShopGoodsRoleCommissionParam
|
||||
} from '@/api/shop/shopGoodsRoleCommission/model';
|
||||
|
||||
/**
|
||||
* 分页查询商品绑定角色的分润金额
|
||||
*/
|
||||
export async function pageShopGoodsRoleCommission(
|
||||
params: ShopGoodsRoleCommissionParam
|
||||
) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopGoodsRoleCommission>>>(
|
||||
MODULES_API_URL + '/shop/shop-goods-role-commission/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品绑定角色的分润金额列表
|
||||
*/
|
||||
export async function listShopGoodsRoleCommission(
|
||||
params?: ShopGoodsRoleCommissionParam
|
||||
) {
|
||||
const res = await request.get<ApiResult<ShopGoodsRoleCommission[]>>(
|
||||
MODULES_API_URL + '/shop/shop-goods-role-commission',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品绑定角色的分润金额
|
||||
*/
|
||||
export async function addShopGoodsRoleCommission(
|
||||
data: ShopGoodsRoleCommission
|
||||
) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-goods-role-commission',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品绑定角色的分润金额
|
||||
*/
|
||||
export async function updateShopGoodsRoleCommission(
|
||||
data: ShopGoodsRoleCommission
|
||||
) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-goods-role-commission',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品绑定角色的分润金额
|
||||
*/
|
||||
export async function removeShopGoodsRoleCommission(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-goods-role-commission/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品绑定角色的分润金额
|
||||
*/
|
||||
export async function removeBatchShopGoodsRoleCommission(
|
||||
data: (number | undefined)[]
|
||||
) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-goods-role-commission/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品绑定角色的分润金额
|
||||
*/
|
||||
export async function getShopGoodsRoleCommission(id: number) {
|
||||
const res = await request.get<ApiResult<ShopGoodsRoleCommission>>(
|
||||
MODULES_API_URL + '/shop/shop-goods-role-commission/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
35
src/api/shop/shopGoodsRoleCommission/model/index.ts
Normal file
35
src/api/shop/shopGoodsRoleCommission/model/index.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商品绑定角色的分润金额
|
||||
*/
|
||||
export interface ShopGoodsRoleCommission {
|
||||
//
|
||||
id?: number;
|
||||
//
|
||||
roleId?: number;
|
||||
//
|
||||
goodsId?: number;
|
||||
//
|
||||
sku?: string;
|
||||
//
|
||||
amount?: string;
|
||||
// 状态, 0正常, 1异常
|
||||
status?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
//
|
||||
sortNumber?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品绑定角色的分润金额搜索条件
|
||||
*/
|
||||
export interface ShopGoodsRoleCommissionParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
118
src/api/shop/shopGoodsSku/index.ts
Normal file
118
src/api/shop/shopGoodsSku/index.ts
Normal file
@@ -0,0 +1,118 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
import { ShopGoodsSpec } from '@/api/shop/shopGoodsSpec/model';
|
||||
import { ShopGoodsSku, ShopGoodsSkuParam } from '@/api/shop/shopGoodsSku/model';
|
||||
|
||||
export async function generateGoodsSku(data: ShopGoodsSpec) {
|
||||
const res = await request.post<ApiResult<ShopGoodsSku[]>>(
|
||||
MODULES_API_URL + '/shop/goods-sku/generateGoodsSku',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询商品sku列表
|
||||
*/
|
||||
export async function pageShopGoodsSku(params: ShopGoodsSkuParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopGoodsSku>>>(
|
||||
MODULES_API_URL + '/shop/shop-goods-sku/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品sku列表列表
|
||||
*/
|
||||
export async function listShopGoodsSku(params?: ShopGoodsSkuParam) {
|
||||
const res = await request.get<ApiResult<ShopGoodsSku[]>>(
|
||||
MODULES_API_URL + '/shop/shop-goods-sku',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品sku列表
|
||||
*/
|
||||
export async function addShopGoodsSku(data: ShopGoodsSku) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-goods-sku',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品sku列表
|
||||
*/
|
||||
export async function updateShopGoodsSku(data: ShopGoodsSku) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-goods-sku',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品sku列表
|
||||
*/
|
||||
export async function removeShopGoodsSku(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-goods-sku/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品sku列表
|
||||
*/
|
||||
export async function removeBatchShopGoodsSku(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-goods-sku/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品sku列表
|
||||
*/
|
||||
export async function getShopGoodsSku(id: number) {
|
||||
const res = await request.get<ApiResult<ShopGoodsSku>>(
|
||||
MODULES_API_URL + '/shop/shop-goods-sku/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
50
src/api/shop/shopGoodsSku/model/index.ts
Normal file
50
src/api/shop/shopGoodsSku/model/index.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商品sku列表
|
||||
*/
|
||||
export interface ShopGoodsSku {
|
||||
// 主键ID
|
||||
id?: number;
|
||||
// 商品ID
|
||||
goodsId?: number;
|
||||
// 商品属性索引值 (attr_value|attr_value[|....])
|
||||
sku?: string;
|
||||
// 商品图片
|
||||
image?: string;
|
||||
// 商品价格
|
||||
price?: string;
|
||||
// 市场价格
|
||||
salePrice?: string;
|
||||
// 成本价
|
||||
cost?: string;
|
||||
// 库存
|
||||
stock?: number;
|
||||
// sku编码
|
||||
skuNo?: string;
|
||||
// 商品条码
|
||||
barCode?: string;
|
||||
// 重量
|
||||
weight?: string;
|
||||
// 体积
|
||||
volume?: string;
|
||||
// 唯一值
|
||||
uuid?: string;
|
||||
// 状态, 0正常, 1异常
|
||||
status?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
images?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品sku列表搜索条件
|
||||
*/
|
||||
export interface ShopGoodsSkuParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
105
src/api/shop/shopGoodsSpec/index.ts
Normal file
105
src/api/shop/shopGoodsSpec/index.ts
Normal file
@@ -0,0 +1,105 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopGoodsSpec, ShopGoodsSpecParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询商品多规格
|
||||
*/
|
||||
export async function pageShopGoodsSpec(params: ShopGoodsSpecParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopGoodsSpec>>>(
|
||||
'/shop/shop-goods-spec/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品多规格列表
|
||||
*/
|
||||
export async function listShopGoodsSpec(params?: ShopGoodsSpecParam) {
|
||||
const res = await request.get<ApiResult<ShopGoodsSpec[]>>(
|
||||
'/shop/shop-goods-spec',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品多规格
|
||||
*/
|
||||
export async function addShopGoodsSpec(data: ShopGoodsSpec) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-spec',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品多规格
|
||||
*/
|
||||
export async function updateShopGoodsSpec(data: ShopGoodsSpec) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-spec',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品多规格
|
||||
*/
|
||||
export async function removeShopGoodsSpec(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-spec/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品多规格
|
||||
*/
|
||||
export async function removeBatchShopGoodsSpec(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-goods-spec/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品多规格
|
||||
*/
|
||||
export async function getShopGoodsSpec(id: number) {
|
||||
const res = await request.get<ApiResult<ShopGoodsSpec>>(
|
||||
'/shop/shop-goods-spec/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
29
src/api/shop/shopGoodsSpec/model/index.ts
Normal file
29
src/api/shop/shopGoodsSpec/model/index.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商品多规格
|
||||
*/
|
||||
export interface ShopGoodsSpec {
|
||||
// 主键
|
||||
id?: number;
|
||||
// 商品ID
|
||||
goodsId?: number;
|
||||
// 规格ID
|
||||
specId?: number;
|
||||
// 规格名称
|
||||
specName?: string;
|
||||
// 规格值
|
||||
specValue?: string;
|
||||
// 活动类型 0=商品,1=秒杀,2=砍价,3=拼团
|
||||
type?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品多规格搜索条件
|
||||
*/
|
||||
export interface ShopGoodsSpecParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
116
src/api/shop/shopMemberBenefit.ts
Normal file
116
src/api/shop/shopMemberBenefit.ts
Normal file
@@ -0,0 +1,116 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type {
|
||||
ShopMemberBenefitPackage,
|
||||
ShopMemberBenefitPackageParam,
|
||||
ShopMemberBenefitExchange,
|
||||
ShopMemberBenefitExchangeParam,
|
||||
ShipRequest
|
||||
} from './model';
|
||||
|
||||
/**
|
||||
* 分页查询权益包列表
|
||||
*/
|
||||
export async function getBenefitPackagePage(
|
||||
params: ShopMemberBenefitPackageParam
|
||||
) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopMemberBenefitPackage>>>(
|
||||
'/shop/shop-member-benefit-package/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增权益包
|
||||
*/
|
||||
export async function addBenefitPackage(data: ShopMemberBenefitPackage) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-member-benefit-package',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改权益包
|
||||
*/
|
||||
export async function updateBenefitPackage(data: ShopMemberBenefitPackage) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-member-benefit-package',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除权益包
|
||||
*/
|
||||
export async function deleteBenefitPackage(id: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
`/shop/shop-member-benefit-package/${id}`
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询兑换记录
|
||||
*/
|
||||
export async function getBenefitExchangePage(
|
||||
params: ShopMemberBenefitExchangeParam
|
||||
) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopMemberBenefitExchange>>>(
|
||||
'/shop/shop-member-benefit-exchange/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取兑换记录列表(向后兼容)
|
||||
*/
|
||||
export function getBenefitExchangeList(params: ShopMemberBenefitExchangeParam) {
|
||||
return request.get('/shop/shop-member-benefit-exchange/page', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 发货
|
||||
*/
|
||||
export async function shipBenefitExchange(id: number, data: ShipRequest) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
`/shop/shop-member-benefit-exchange/ship/${id}`,
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 标记完成
|
||||
*/
|
||||
export async function completeBenefitExchange(id: number) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
`/shop/shop-member-benefit-exchange/complete/${id}`
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
102
src/api/shop/shopMemberBenefit/model/index.ts
Normal file
102
src/api/shop/shopMemberBenefit/model/index.ts
Normal file
@@ -0,0 +1,102 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 会员权益包
|
||||
*/
|
||||
export interface ShopMemberBenefitPackage {
|
||||
// 权益包ID
|
||||
packageId?: number;
|
||||
// 权益包名称
|
||||
packageName?: string;
|
||||
// 权益包描述
|
||||
packageDesc?: string;
|
||||
// 权益图标
|
||||
packageIcon?: string;
|
||||
// 权益内容(JSON格式)
|
||||
packageContent?: string;
|
||||
// 价格
|
||||
price?: number;
|
||||
// 原价
|
||||
originalPrice?: number;
|
||||
// 库存
|
||||
stock?: number;
|
||||
// 已兑换数量
|
||||
exchangeCount?: number;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 状态: 0-下架 1-上架
|
||||
status?: number;
|
||||
// 是否启用配送
|
||||
deliveryEnabled?: number;
|
||||
// 创建时间
|
||||
createdTime?: string;
|
||||
// 更新时间
|
||||
updatedTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员权益包查询参数
|
||||
*/
|
||||
export interface ShopMemberBenefitPackageParam extends PageParam {
|
||||
status?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员权益兑换记录
|
||||
*/
|
||||
export interface ShopMemberBenefitExchange {
|
||||
// 兑换记录ID
|
||||
exchangeId?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 用户昵称
|
||||
userNickname?: string;
|
||||
// 权益包ID
|
||||
packageId?: number;
|
||||
// 权益包名称
|
||||
packageName?: string;
|
||||
// 订单ID
|
||||
orderId?: number;
|
||||
// 订单编号
|
||||
orderNo?: string;
|
||||
// 收货人姓名
|
||||
receiverName?: string;
|
||||
// 收货人电话
|
||||
receiverPhone?: string;
|
||||
// 收货地址
|
||||
receiverAddress?: string;
|
||||
// 快递公司
|
||||
expressCompany?: string;
|
||||
// 快递单号
|
||||
expressNo?: string;
|
||||
// 发货时间
|
||||
shipTime?: string;
|
||||
// 完成时间
|
||||
completeTime?: string;
|
||||
// 状态: 0-待发货 1-已发货 2-已完成 3-已取消
|
||||
status?: number;
|
||||
// 创建时间
|
||||
createdTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员权益兑换查询参数
|
||||
*/
|
||||
export interface ShopMemberBenefitExchangeParam extends PageParam {
|
||||
userId?: number;
|
||||
packageId?: number;
|
||||
status?: number;
|
||||
createTimeStart?: string;
|
||||
createTimeEnd?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发货请求
|
||||
*/
|
||||
export interface ShipRequest {
|
||||
// 快递公司
|
||||
expressCompany: string;
|
||||
// 快递单号
|
||||
expressNo: string;
|
||||
}
|
||||
29
src/api/shop/shopMemberRegister.ts
Normal file
29
src/api/shop/shopMemberRegister.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
/**
|
||||
* 获取会员注册记录列表(管理员)
|
||||
*/
|
||||
export function getMemberRegisterList(params: any) {
|
||||
return request.get('/shop/shop-member-register/page', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认收款(会员费)
|
||||
*/
|
||||
export function confirmMemberFee(id: number) {
|
||||
return request.post(`/shop/shop-member-register/confirm/member-fee/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认注册费支付
|
||||
*/
|
||||
export function confirmRegisterFee(id: number) {
|
||||
return request.post(`/shop/shop-member-register/confirm/register-fee/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取会员注册统计
|
||||
*/
|
||||
export function getMemberRegisterStats() {
|
||||
return request.get('/shop/shop-member-register/stats');
|
||||
}
|
||||
106
src/api/shop/shopMerchant/index.ts
Normal file
106
src/api/shop/shopMerchant/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api/index';
|
||||
import type { ShopMerchant, ShopMerchantParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商户
|
||||
*/
|
||||
export async function pageShopMerchant(params: ShopMerchantParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopMerchant>>>(
|
||||
MODULES_API_URL + '/shop/shop-merchant/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商户列表
|
||||
*/
|
||||
export async function listShopMerchant(params?: ShopMerchantParam) {
|
||||
const res = await request.get<ApiResult<ShopMerchant[]>>(
|
||||
MODULES_API_URL + '/shop/shop-merchant',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商户
|
||||
*/
|
||||
export async function addShopMerchant(data: ShopMerchant) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-merchant',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商户
|
||||
*/
|
||||
export async function updateShopMerchant(data: ShopMerchant) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-merchant',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商户
|
||||
*/
|
||||
export async function removeShopMerchant(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-merchant/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商户
|
||||
*/
|
||||
export async function removeBatchShopMerchant(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-merchant/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商户
|
||||
*/
|
||||
export async function getShopMerchant(id: number) {
|
||||
const res = await request.get<ApiResult<ShopMerchant>>(
|
||||
MODULES_API_URL + '/shop/shop-merchant/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
95
src/api/shop/shopMerchant/model/index.ts
Normal file
95
src/api/shop/shopMerchant/model/index.ts
Normal file
@@ -0,0 +1,95 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 商户
|
||||
*/
|
||||
export interface ShopMerchant {
|
||||
// ID
|
||||
merchantId?: number;
|
||||
// 商户名称
|
||||
merchantName?: string;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
// 商户类型
|
||||
type?: number;
|
||||
// 商户图标
|
||||
image?: string;
|
||||
// 商户手机号
|
||||
phone?: string;
|
||||
// 商户姓名
|
||||
realName?: string;
|
||||
// 店铺类型
|
||||
shopType?: string;
|
||||
// 项目分类
|
||||
itemType?: string;
|
||||
// 商户分类
|
||||
category?: string;
|
||||
// 商户经营分类
|
||||
merchantCategoryId?: number;
|
||||
// 商户分类
|
||||
merchantCategoryTitle?: string;
|
||||
// 经纬度
|
||||
lngAndLat?: string;
|
||||
//
|
||||
lng?: string;
|
||||
//
|
||||
lat?: string;
|
||||
// 所在省份
|
||||
province?: string;
|
||||
// 所在城市
|
||||
city?: string;
|
||||
// 所在辖区
|
||||
region?: string;
|
||||
// 详细地址
|
||||
address?: string;
|
||||
// 手续费
|
||||
commission?: string;
|
||||
// 关键字
|
||||
keywords?: string;
|
||||
// 资质图片
|
||||
files?: string;
|
||||
// 营业时间
|
||||
businessTime?: string;
|
||||
// 文章内容
|
||||
content?: string;
|
||||
// 每小时价格
|
||||
price?: string;
|
||||
// 是否自营
|
||||
ownStore?: number;
|
||||
// 是否可以快递
|
||||
canExpress?: string;
|
||||
// 是否推荐
|
||||
recommend?: number;
|
||||
// 是否营业
|
||||
isOn?: number;
|
||||
//
|
||||
startTime?: string;
|
||||
//
|
||||
endTime?: string;
|
||||
// 是否需要审核
|
||||
goodsReview?: number;
|
||||
// 管理入口
|
||||
adminUrl?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 所有人
|
||||
userId?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商户搜索条件
|
||||
*/
|
||||
export interface ShopMerchantParam extends PageParam {
|
||||
merchantId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
112
src/api/shop/shopMerchantAccount/index.ts
Normal file
112
src/api/shop/shopMerchantAccount/index.ts
Normal file
@@ -0,0 +1,112 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopMerchantAccount, ShopMerchantAccountParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商户账号
|
||||
*/
|
||||
export async function pageShopMerchantAccount(
|
||||
params: ShopMerchantAccountParam
|
||||
) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopMerchantAccount>>>(
|
||||
MODULES_API_URL + '/shop/shop-merchant-account/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商户账号列表
|
||||
*/
|
||||
export async function listShopMerchantAccount(
|
||||
params?: ShopMerchantAccountParam
|
||||
) {
|
||||
const res = await request.get<ApiResult<ShopMerchantAccount[]>>(
|
||||
MODULES_API_URL + '/shop/shop-merchant-account',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商户账号
|
||||
*/
|
||||
export async function addShopMerchantAccount(data: ShopMerchantAccount) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-merchant-account',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商户账号
|
||||
*/
|
||||
export async function updateShopMerchantAccount(data: ShopMerchantAccount) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-merchant-account',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商户账号
|
||||
*/
|
||||
export async function removeShopMerchantAccount(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-merchant-account/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商户账号
|
||||
*/
|
||||
export async function removeBatchShopMerchantAccount(
|
||||
data: (number | undefined)[]
|
||||
) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-merchant-account/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商户账号
|
||||
*/
|
||||
export async function getShopMerchantAccount(id: number) {
|
||||
const res = await request.get<ApiResult<ShopMerchantAccount>>(
|
||||
MODULES_API_URL + '/shop/shop-merchant-account/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
39
src/api/shop/shopMerchantAccount/model/index.ts
Normal file
39
src/api/shop/shopMerchantAccount/model/index.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商户账号
|
||||
*/
|
||||
export interface ShopMerchantAccount {
|
||||
// ID
|
||||
id?: number;
|
||||
// 商户手机号
|
||||
phone?: string;
|
||||
// 真实姓名
|
||||
realName?: string;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 角色ID
|
||||
roleId?: number;
|
||||
// 角色名称
|
||||
roleName?: string;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商户账号搜索条件
|
||||
*/
|
||||
export interface ShopMerchantAccountParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
131
src/api/shop/shopMerchantApply/index.ts
Normal file
131
src/api/shop/shopMerchantApply/index.ts
Normal file
@@ -0,0 +1,131 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopMerchantApply, ShopMerchantApplyParam } from './model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商户入驻申请
|
||||
*/
|
||||
export async function pageShopMerchantApply(params: ShopMerchantApplyParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopMerchantApply>>>(
|
||||
SERVER_API_URL + '/shop/shop-merchant-apply/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商户入驻申请列表
|
||||
*/
|
||||
export async function listShopMerchantApply(params?: ShopMerchantApplyParam) {
|
||||
const res = await request.get<ApiResult<ShopMerchantApply[]>>(
|
||||
SERVER_API_URL + '/shop/shop-merchant-apply',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商户入驻申请
|
||||
*/
|
||||
export async function addShopMerchantApply(data: ShopMerchantApply) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-merchant-apply',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商户入驻申请
|
||||
*/
|
||||
export async function updateShopMerchantApply(data: ShopMerchantApply) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/shop/shop-merchant-apply',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
// 审核通过
|
||||
export async function checkShopMerchantApply(data: ShopMerchantApply) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/shop/shop-merchant-apply/check',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
// 根据入驻申请创建商户
|
||||
export async function createMerchantFromApply(applyId: number) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/shop/shop-merchant-apply/create-merchant/' + applyId
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商户入驻申请
|
||||
*/
|
||||
export async function removeShopMerchantApply(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/shop/shop-merchant-apply/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商户入驻申请
|
||||
*/
|
||||
export async function removeBatchShopMerchantApply(
|
||||
data: (number | undefined)[]
|
||||
) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/shop/shop-merchant-apply/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商户入驻申请
|
||||
*/
|
||||
export async function getShopMerchantApply(id: number) {
|
||||
const res = await request.get<ApiResult<ShopMerchantApply>>(
|
||||
SERVER_API_URL + '/shop/shop-merchant-apply/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
74
src/api/shop/shopMerchantApply/model/index.ts
Normal file
74
src/api/shop/shopMerchantApply/model/index.ts
Normal file
@@ -0,0 +1,74 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商户入驻申请
|
||||
*/
|
||||
export interface ShopMerchantApply {
|
||||
// ID
|
||||
applyId?: number;
|
||||
// 类型
|
||||
type?: number;
|
||||
// 证件类型
|
||||
idType?: string;
|
||||
// 主体名称
|
||||
merchantName?: string;
|
||||
// 证件号码
|
||||
merchantCode?: string;
|
||||
// 商户图标
|
||||
image?: string;
|
||||
// 商户手机号
|
||||
phone?: string;
|
||||
// 商户姓名
|
||||
realName?: string;
|
||||
// 身份证号码
|
||||
idCard?: string;
|
||||
// 店铺类型
|
||||
shopType?: string;
|
||||
// 商户分类
|
||||
category?: string;
|
||||
// 手续费
|
||||
commission?: string;
|
||||
// 关键字
|
||||
keywords?: string;
|
||||
// 营业执照
|
||||
yyzz?: string;
|
||||
// 身份证正面
|
||||
sfz1?: string;
|
||||
// 身份证反面
|
||||
sfz2?: string;
|
||||
// 资质图片
|
||||
files?: string;
|
||||
// 所有人
|
||||
userId?: number;
|
||||
// 是否自营
|
||||
ownStore?: number;
|
||||
// 是否推荐
|
||||
recommend?: number;
|
||||
// 是否需要审核
|
||||
goodsReview?: number;
|
||||
// 工作负责人
|
||||
name2?: string;
|
||||
// 驳回原因
|
||||
reason?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商户入驻申请搜索条件
|
||||
*/
|
||||
export interface ShopMerchantApplyParam extends PageParam {
|
||||
applyId?: number;
|
||||
userId?: number;
|
||||
shopType?: string;
|
||||
phone?: string;
|
||||
keywords?: string;
|
||||
}
|
||||
108
src/api/shop/shopMerchantCount/index.ts
Normal file
108
src/api/shop/shopMerchantCount/index.ts
Normal file
@@ -0,0 +1,108 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopMerchantCount, ShopMerchantCountParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询门店销售统计表
|
||||
*/
|
||||
export async function pageShopMerchantCount(params: ShopMerchantCountParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopMerchantCount>>>(
|
||||
MODULES_API_URL + '/shop/shop-merchant-count/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询门店销售统计表列表
|
||||
*/
|
||||
export async function listShopMerchantCount(params?: ShopMerchantCountParam) {
|
||||
const res = await request.get<ApiResult<ShopMerchantCount[]>>(
|
||||
MODULES_API_URL + '/shop/shop-merchant-count',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加门店销售统计表
|
||||
*/
|
||||
export async function addShopMerchantCount(data: ShopMerchantCount) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-merchant-count',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改门店销售统计表
|
||||
*/
|
||||
export async function updateShopMerchantCount(data: ShopMerchantCount) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-merchant-count',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除门店销售统计表
|
||||
*/
|
||||
export async function removeShopMerchantCount(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-merchant-count/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除门店销售统计表
|
||||
*/
|
||||
export async function removeBatchShopMerchantCount(
|
||||
data: (number | undefined)[]
|
||||
) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-merchant-count/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询门店销售统计表
|
||||
*/
|
||||
export async function getShopMerchantCount(id: number) {
|
||||
const res = await request.get<ApiResult<ShopMerchantCount>>(
|
||||
MODULES_API_URL + '/shop/shop-merchant-count/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
29
src/api/shop/shopMerchantCount/model/index.ts
Normal file
29
src/api/shop/shopMerchantCount/model/index.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 门店销售统计表
|
||||
*/
|
||||
export interface ShopMerchantCount {
|
||||
// ID
|
||||
id?: number;
|
||||
// 店铺名称
|
||||
name?: string;
|
||||
// 店铺说明
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 门店销售统计表搜索条件
|
||||
*/
|
||||
export interface ShopMerchantCountParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
108
src/api/shop/shopMerchantType/index.ts
Normal file
108
src/api/shop/shopMerchantType/index.ts
Normal file
@@ -0,0 +1,108 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopMerchantType, ShopMerchantTypeParam } from './model';
|
||||
import { SERVER_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商户类型
|
||||
*/
|
||||
export async function pageShopMerchantType(params: ShopMerchantTypeParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopMerchantType>>>(
|
||||
SERVER_API_URL + '/shop/shop-merchant-type/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商户类型列表
|
||||
*/
|
||||
export async function listShopMerchantType(params?: ShopMerchantTypeParam) {
|
||||
const res = await request.get<ApiResult<ShopMerchantType[]>>(
|
||||
SERVER_API_URL + '/shop/shop-merchant-type',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商户类型
|
||||
*/
|
||||
export async function addShopMerchantType(data: ShopMerchantType) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/shop/shop-merchant-type',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商户类型
|
||||
*/
|
||||
export async function updateShopMerchantType(data: ShopMerchantType) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/shop/shop-merchant-type',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商户类型
|
||||
*/
|
||||
export async function removeShopMerchantType(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/shop/shop-merchant-type/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商户类型
|
||||
*/
|
||||
export async function removeBatchShopMerchantType(
|
||||
data: (number | undefined)[]
|
||||
) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/shop/shop-merchant-type/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商户类型
|
||||
*/
|
||||
export async function getShopMerchantType(id: number) {
|
||||
const res = await request.get<ApiResult<ShopMerchantType>>(
|
||||
SERVER_API_URL + '/shop/shop-merchant-type/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
30
src/api/shop/shopMerchantType/model/index.ts
Normal file
30
src/api/shop/shopMerchantType/model/index.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商户类型
|
||||
*/
|
||||
export interface ShopMerchantType {
|
||||
// ID
|
||||
id?: number;
|
||||
// 店铺类型
|
||||
name?: string;
|
||||
// 店铺入驻条件
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
value?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商户类型搜索条件
|
||||
*/
|
||||
export interface ShopMerchantTypeParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
152
src/api/shop/shopOrder/index.ts
Normal file
152
src/api/shop/shopOrder/index.ts
Normal file
@@ -0,0 +1,152 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopOrder, ShopOrderParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询订单
|
||||
*/
|
||||
export async function pageShopOrder(params: ShopOrderParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopOrder>>>(
|
||||
MODULES_API_URL + '/shop/shop-order/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
*/
|
||||
export async function listShopOrder(params?: ShopOrderParam) {
|
||||
const res = await request.get<ApiResult<ShopOrder[]>>(
|
||||
MODULES_API_URL + '/shop/shop-order',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加订单
|
||||
*/
|
||||
export async function addShopOrder(data: ShopOrder) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单
|
||||
*/
|
||||
export async function updateShopOrder(data: ShopOrder) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单
|
||||
*/
|
||||
export async function removeShopOrder(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-order/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除订单
|
||||
*/
|
||||
export async function removeBatchShopOrder(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-order/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询订单
|
||||
*/
|
||||
export async function getShopOrder(id: number) {
|
||||
const res = await request.get<ApiResult<ShopOrder>>(
|
||||
MODULES_API_URL + '/shop/shop-order/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单
|
||||
*/
|
||||
export async function repairOrder(data: ShopOrder) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-order/repair',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计订单总金额(只统计有效订单)
|
||||
*/
|
||||
export async function shopOrderTotal(params?: ShopOrderParam) {
|
||||
const res = await request.get<ApiResult<ShopOrder[]>>(
|
||||
MODULES_API_URL + '/shop/shop-order/total',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
// 即使没有数据也返回空数组,而不是抛出错误
|
||||
return res.data.data || [];
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 申请|同意退款
|
||||
*/
|
||||
export async function refundShopOrder(data: ShopOrder) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-order/refund',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
189
src/api/shop/shopOrder/model/index.ts
Normal file
189
src/api/shop/shopOrder/model/index.ts
Normal file
@@ -0,0 +1,189 @@
|
||||
import type { PageParam } from '@/api';
|
||||
import { OrderGoods } from '@/api/system/orderGoods/model';
|
||||
|
||||
/**
|
||||
* 订单
|
||||
*/
|
||||
export interface ShopOrder {
|
||||
// 订单号
|
||||
orderId?: number;
|
||||
// 订单编号
|
||||
orderNo?: string;
|
||||
// 订单类型,0商城订单 1预定订单/外卖 2会员卡
|
||||
type?: number;
|
||||
// 快递/自提
|
||||
deliveryType?: number;
|
||||
// 下单渠道,0小程序预定 1俱乐部训练场 3活动订场
|
||||
channel?: number;
|
||||
// 微信支付订单号
|
||||
transactionId?: string;
|
||||
// 微信退款订单号
|
||||
refundOrder?: string;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 商户名称
|
||||
merchantName?: string;
|
||||
// 商户编号
|
||||
merchantCode?: string;
|
||||
// 使用的优惠券id
|
||||
couponId?: number;
|
||||
// 使用的会员卡id
|
||||
cardId?: string;
|
||||
// 关联管理员id
|
||||
adminId?: number;
|
||||
// 核销管理员id
|
||||
confirmId?: number;
|
||||
// IC卡号
|
||||
icCard?: string;
|
||||
// 头像
|
||||
avatar?: string;
|
||||
// 昵称(部分接口会返回)
|
||||
nickname?: string;
|
||||
// 兼容字段:部分接口可能返回 name
|
||||
name?: string;
|
||||
// 真实姓名
|
||||
realName?: string;
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
// 手机号码(脱敏)
|
||||
mobile?: string;
|
||||
// 收货地址
|
||||
address?: string;
|
||||
//
|
||||
addressLat?: string;
|
||||
//
|
||||
addressLng?: string;
|
||||
// 自提店铺id
|
||||
selfTakeMerchantId?: number;
|
||||
// 自提店铺
|
||||
selfTakeMerchantName?: string;
|
||||
// 配送开始时间
|
||||
sendStartTime?: string;
|
||||
// 配送结束时间
|
||||
sendEndTime?: string;
|
||||
// 发货店铺id
|
||||
expressMerchantId?: number;
|
||||
// 发货店铺
|
||||
expressMerchantName?: string;
|
||||
// 订单总额
|
||||
totalPrice?: string;
|
||||
// 减少的金额,使用VIP会员折扣、优惠券抵扣、优惠券折扣后减去的价格
|
||||
reducePrice?: string;
|
||||
// 实际付款
|
||||
payPrice?: string;
|
||||
// 用于统计
|
||||
price?: string;
|
||||
// 价钱,用于积分赠送
|
||||
money?: string;
|
||||
// 退款金额
|
||||
refundMoney?: string;
|
||||
// 教练价格
|
||||
coachPrice?: string;
|
||||
// 购买数量
|
||||
totalNum?: number;
|
||||
// 教练id
|
||||
coachId?: number;
|
||||
// 支付的用户id
|
||||
payUserId?: number;
|
||||
// 0余额支付, 1微信支付,102微信Native,2会员卡支付,3支付宝,4现金,5POS机,6VIP月卡,7VIP年卡,8VIP次卡,9IC月卡,10IC年卡,11IC次卡,12免费,13VIP充值卡,14IC充值卡,15积分支付,16VIP季卡,17IC季卡,18代付
|
||||
payType?: number;
|
||||
// 代付支付方式,0余额支付, 1微信支付,102微信Native,2会员卡支付,3支付宝,4现金,5POS机,6VIP月卡,7VIP年卡,8VIP次卡,9IC月卡,10IC年卡,11IC次卡,12免费,13VIP充值卡,14IC充值卡,15积分支付,16VIP季卡,17IC季卡,18代付
|
||||
friendPayType?: number;
|
||||
// 0未付款,1已付款
|
||||
payStatus?: number;
|
||||
// 0未使用,1已完成,2已取消,3取消中,4退款申请中,5退款被拒绝,6退款成功,7客户端申请退款
|
||||
orderStatus?: number;
|
||||
// 发货状态(10未发货 20已发货 30部分发货)
|
||||
deliveryStatus?: number;
|
||||
// 发货时间
|
||||
deliveryTime?: string;
|
||||
// 发货备注/无需发货备注
|
||||
deliveryNote?: string;
|
||||
// 快递公司id
|
||||
expressId?: number;
|
||||
// 快递公司名称
|
||||
expressName?: string;
|
||||
// 物流单号
|
||||
expressNo?: string;
|
||||
// 发货人
|
||||
sendName?: string;
|
||||
// 发货人联系方式
|
||||
sendPhone?: string;
|
||||
// 发货地址
|
||||
sendAddress?: string;
|
||||
// 优惠类型:0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡,5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡
|
||||
couponType?: number;
|
||||
// 优惠说明
|
||||
couponDesc?: string;
|
||||
// 二维码地址,保存订单号,支付成功后才生成
|
||||
qrcode?: string;
|
||||
// vip月卡年卡、ic月卡年卡回退次数
|
||||
returnNum?: number;
|
||||
// vip充值回退金额
|
||||
returnMoney?: string;
|
||||
// 预约详情开始时间数组
|
||||
startTime?: string;
|
||||
// 是否已开具发票:0未开发票,1已开发票,2不能开具发票
|
||||
isInvoice?: number;
|
||||
// 发票流水号
|
||||
invoiceNo?: string;
|
||||
// 支付时间
|
||||
payTime?: string;
|
||||
// 退款时间
|
||||
refundTime?: string;
|
||||
// 申请退款时间
|
||||
refundApplyTime?: string;
|
||||
// 过期时间
|
||||
expirationTime?: string;
|
||||
// 对账情况:0=未对账;1=已对账;3=已对账,金额对不上;4=未查询到该订单
|
||||
checkBill?: number;
|
||||
// 订单是否已结算(0未结算 1已结算)
|
||||
isSettled?: number;
|
||||
// 系统版本号 0当前版本 value=其他版本
|
||||
version?: number;
|
||||
// 买家备注
|
||||
buyerRemarks: undefined;
|
||||
// 商家备注
|
||||
merchantRemarks: undefined;
|
||||
// 用户id
|
||||
userId?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 自提码
|
||||
selfTakeCode?: string;
|
||||
// 是否已收到赠品
|
||||
hasTakeGift?: string;
|
||||
// 发货信息
|
||||
shopOrderDelivery?: any;
|
||||
// 订单商品
|
||||
orderGoods?: OrderGoods[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单搜索条件
|
||||
*/
|
||||
export interface ShopOrderParam extends PageParam {
|
||||
orderId?: number;
|
||||
orderNo?: string;
|
||||
type?: number;
|
||||
phone?: string;
|
||||
userId?: number;
|
||||
payUserId?: number;
|
||||
nickname?: string;
|
||||
payStatus?: number;
|
||||
orderStatus?: number;
|
||||
payType?: number;
|
||||
isInvoice?: boolean;
|
||||
statusFilter?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/shop/shopOrderGoods/index.ts
Normal file
106
src/api/shop/shopOrderGoods/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopOrderGoods, ShopOrderGoodsParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商品信息
|
||||
*/
|
||||
export async function pageShopOrderGoods(params: ShopOrderGoodsParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopOrderGoods>>>(
|
||||
MODULES_API_URL + '/shop/shop-order-goods/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品信息列表
|
||||
*/
|
||||
export async function listShopOrderGoods(params?: ShopOrderGoodsParam) {
|
||||
const res = await request.get<ApiResult<ShopOrderGoods[]>>(
|
||||
MODULES_API_URL + '/shop/shop-order-goods',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品信息
|
||||
*/
|
||||
export async function addShopOrderGoods(data: ShopOrderGoods) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-order-goods',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品信息
|
||||
*/
|
||||
export async function updateShopOrderGoods(data: ShopOrderGoods) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-order-goods',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品信息
|
||||
*/
|
||||
export async function removeShopOrderGoods(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-order-goods/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品信息
|
||||
*/
|
||||
export async function removeBatchShopOrderGoods(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-order-goods/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品信息
|
||||
*/
|
||||
export async function getShopOrderGoods(id: number) {
|
||||
const res = await request.get<ApiResult<ShopOrderGoods>>(
|
||||
MODULES_API_URL + '/shop/shop-order-goods/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
71
src/api/shop/shopOrderGoods/model/index.ts
Normal file
71
src/api/shop/shopOrderGoods/model/index.ts
Normal file
@@ -0,0 +1,71 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商品信息
|
||||
*/
|
||||
export interface ShopOrderGoods {
|
||||
// 自增ID
|
||||
id?: number;
|
||||
// 关联订单表id
|
||||
orderId?: number;
|
||||
// 订单标识
|
||||
orderCode?: string;
|
||||
// 关联商户ID
|
||||
merchantId?: number;
|
||||
// 商户名称
|
||||
merchantName?: string;
|
||||
// 商品封面图
|
||||
image?: string;
|
||||
// 关联商品id
|
||||
goodsId?: number;
|
||||
// 商品名称
|
||||
goodsName?: string;
|
||||
// 商品规格
|
||||
spec?: string;
|
||||
//
|
||||
skuId?: number;
|
||||
// 单价
|
||||
price?: string;
|
||||
// 购买数量
|
||||
totalNum?: number;
|
||||
// 0 未付款 1已付款,2无需付款或占用状态
|
||||
payStatus?: number;
|
||||
// 0未使用,1已完成,2已取消,3取消中,4退款申请中,5退款被拒绝,6退款成功,7客户端申请退款
|
||||
orderStatus?: number;
|
||||
// 是否免费:0收费、1免费
|
||||
isFree?: string;
|
||||
// 系统版本 0当前版本 其他版本
|
||||
version?: number;
|
||||
// 预约时间段
|
||||
timePeriod?: string;
|
||||
// 预定日期
|
||||
dateTime?: string;
|
||||
// 开场时间
|
||||
startTime?: string;
|
||||
// 结束时间
|
||||
endTime?: string;
|
||||
// 毫秒时间戳
|
||||
timeFlag?: string;
|
||||
// 过期时间
|
||||
expirationTime?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 用户id
|
||||
userId?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 更新时间
|
||||
updateTime?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品信息搜索条件
|
||||
*/
|
||||
export interface ShopOrderGoodsParam extends PageParam {
|
||||
id?: number;
|
||||
orderId?: number;
|
||||
orderNo?: string;
|
||||
keywords?: string;
|
||||
}
|
||||
133
src/api/shop/shopPointsProduct.ts
Normal file
133
src/api/shop/shopPointsProduct.ts
Normal file
@@ -0,0 +1,133 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 积分兑换商品模型
|
||||
*/
|
||||
export interface ShopPointsProduct {
|
||||
id?: number;
|
||||
productName?: string;
|
||||
productImage?: string;
|
||||
productType?: number;
|
||||
couponId?: number;
|
||||
images?: string;
|
||||
description?: string;
|
||||
pointsPrice?: number;
|
||||
moneyPrice?: number;
|
||||
stock?: number;
|
||||
sales?: number;
|
||||
isHot?: number;
|
||||
sortNumber?: number;
|
||||
status?: number;
|
||||
deleted?: number;
|
||||
tenantId?: number;
|
||||
createTime?: string;
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 积分兑换商品查询参数
|
||||
*/
|
||||
export interface ShopPointsProductParam {
|
||||
page?: number;
|
||||
limit?: number;
|
||||
productName?: string;
|
||||
status?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询积分兑换商品
|
||||
*/
|
||||
export async function pageShopPointsProduct(params: ShopPointsProductParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopPointsProduct>>>(
|
||||
MODULES_API_URL + '/shop/shop-points-product/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询积分兑换商品列表
|
||||
*/
|
||||
export async function listShopPointsProduct(params?: ShopPointsProductParam) {
|
||||
const res = await request.get<ApiResult<ShopPointsProduct[]>>(
|
||||
MODULES_API_URL + '/shop/shop-points-product',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取积分兑换商品详情
|
||||
*/
|
||||
export async function getShopPointsProduct(id: number) {
|
||||
const res = await request.get<ApiResult<ShopPointsProduct>>(
|
||||
MODULES_API_URL + '/shop/shop-points-product/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加积分兑换商品
|
||||
*/
|
||||
export async function addShopPointsProduct(data: ShopPointsProduct) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-points-product',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改积分兑换商品
|
||||
*/
|
||||
export async function updateShopPointsProduct(data: ShopPointsProduct) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-points-product',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除积分兑换商品
|
||||
*/
|
||||
export async function removeShopPointsProduct(id: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-points-product/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除积分兑换商品
|
||||
*/
|
||||
export async function removeShopPointsProductBatch(ids: number[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-points-product/batch',
|
||||
{ data: { ids } }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
98
src/api/shop/shopRechargeCode/index.ts
Normal file
98
src/api/shop/shopRechargeCode/index.ts
Normal file
@@ -0,0 +1,98 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type {
|
||||
ShopRechargeCode,
|
||||
ShopRechargeCodeParam,
|
||||
BatchGenerateParams,
|
||||
BatchGenerateResult
|
||||
} from './model';
|
||||
|
||||
/**
|
||||
* 分页查询兑换码
|
||||
*/
|
||||
export async function pageRechargeCode(params: ShopRechargeCodeParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopRechargeCode>>>(
|
||||
'/shop/recharge-code/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成兑换码
|
||||
* @param amount 充值金额
|
||||
* @param quantity 生成数量
|
||||
* @param expireDays 过期天数
|
||||
*/
|
||||
export async function generateRechargeCode(
|
||||
amount: number,
|
||||
quantity: number = 1,
|
||||
expireDays: number = 30
|
||||
) {
|
||||
const res = await request.post<ApiResult<ShopRechargeCode[]>>(
|
||||
'/shop/recharge-code/generate',
|
||||
null,
|
||||
{ params: { amount, quantity, expireDays } }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量生成兑换码
|
||||
*/
|
||||
export async function batchGenerateRechargeCode(params: BatchGenerateParams) {
|
||||
const res = await request.post<ApiResult<BatchGenerateResult>>(
|
||||
'/shop/recharge-code/batch-generate',
|
||||
params
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取兑换码信息
|
||||
*/
|
||||
export async function getRechargeCodeInfo(code: string) {
|
||||
const res = await request.get<ApiResult<ShopRechargeCode>>(
|
||||
'/shop/recharge-code/info',
|
||||
{ params: { code } }
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据批次号导出兑换码列表
|
||||
*/
|
||||
export async function exportRechargeCodeByBatch(batchNo: string) {
|
||||
const res = await request.get<ApiResult<ShopRechargeCode[]>>(
|
||||
`/shop/recharge-code/export/${batchNo}`
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除兑换码
|
||||
*/
|
||||
export async function removeRechargeCode(id: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
`/shop/recharge-code/${id}`
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
75
src/api/shop/shopRechargeCode/model/index.ts
Normal file
75
src/api/shop/shopRechargeCode/model/index.ts
Normal file
@@ -0,0 +1,75 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 充值兑换码
|
||||
*/
|
||||
export interface ShopRechargeCode {
|
||||
// ID
|
||||
id?: number;
|
||||
// 兑换码
|
||||
code?: string;
|
||||
// 充值金额
|
||||
amount?: string | number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 状态: 0-未使用, 1-已使用, 2-已过期
|
||||
status?: number;
|
||||
// 生成方式: 1-管理员生成, 2-批量生成
|
||||
generateType?: number;
|
||||
// 批次号
|
||||
batchNo?: string;
|
||||
// 过期时间
|
||||
expireTime?: string;
|
||||
// 使用时间
|
||||
usedAt?: string;
|
||||
// 使用前的余额
|
||||
balanceBefore?: string | number;
|
||||
// 使用后的余额
|
||||
balanceAfter?: string | number;
|
||||
// 租户ID
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
// 是否删除
|
||||
deleted?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 兑换码搜索条件
|
||||
*/
|
||||
export interface ShopRechargeCodeParam extends PageParam {
|
||||
// 兑换码
|
||||
code?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 批次号
|
||||
batchNo?: string;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量生成兑换码参数
|
||||
*/
|
||||
export interface BatchGenerateParams {
|
||||
// 预设金额列表
|
||||
presetAmounts: number[];
|
||||
// 每个金额生成的数量
|
||||
quantityPerAmount?: number;
|
||||
// 过期天数
|
||||
expireDays?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量生成结果
|
||||
*/
|
||||
export interface BatchGenerateResult {
|
||||
// 兑换码列表
|
||||
codes: ShopRechargeCode[];
|
||||
// 总数量
|
||||
totalCount: number;
|
||||
// 批次号
|
||||
batchNo: string;
|
||||
}
|
||||
30
src/api/shop/shopRechargeRecord/index.ts
Normal file
30
src/api/shop/shopRechargeRecord/index.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopRechargeRecord, ShopRechargeRecordParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询充值记录
|
||||
*/
|
||||
export async function pageRechargeRecord(params: ShopRechargeRecordParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopRechargeRecord>>>(
|
||||
'/shop/recharge-record/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取充值记录详情
|
||||
*/
|
||||
export async function getRechargeRecordById(id: number) {
|
||||
const res = await request.get<ApiResult<ShopRechargeRecord>>(
|
||||
`/shop/recharge-record/${id}`
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
37
src/api/shop/shopRechargeRecord/model.ts
Normal file
37
src/api/shop/shopRechargeRecord/model.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* 充值记录
|
||||
*/
|
||||
export interface ShopRechargeRecord {
|
||||
// ID
|
||||
id?: number;
|
||||
// 兑换码ID
|
||||
codeId?: number;
|
||||
// 兑换码
|
||||
code?: string;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 充值金额
|
||||
amount?: string | number;
|
||||
// 充值前余额
|
||||
balanceBefore?: string | number;
|
||||
// 充值后余额
|
||||
balanceAfter?: string | number;
|
||||
// 租户ID
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 充值记录搜索条件
|
||||
*/
|
||||
export interface ShopRechargeRecordParam extends PageParam {
|
||||
// 兑换码
|
||||
code?: string;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 关键字搜索
|
||||
keywords?: string;
|
||||
}
|
||||
128
src/api/shop/shopSetting/index.ts
Normal file
128
src/api/shop/shopSetting/index.ts
Normal file
@@ -0,0 +1,128 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopSetting, ShopSettingParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询商城设置
|
||||
*/
|
||||
export async function pageShopSetting(params: ShopSettingParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopSetting>>>(
|
||||
'/shop/shop-setting/page',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商城设置列表
|
||||
*/
|
||||
export async function listShopSetting(params?: ShopSettingParam) {
|
||||
const res = await request.get<ApiResult<ShopSetting[]>>(
|
||||
'/shop/shop-setting',
|
||||
{ params }
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据分类获取设置列表
|
||||
*/
|
||||
export async function getShopSettingByCategory(category: string) {
|
||||
const res = await request.get<ApiResult<ShopSetting[]>>(
|
||||
`/shop/shop-setting/category/${category}`
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分类设置值(Map格式)
|
||||
*/
|
||||
export async function getShopSettingCategoryValues(category: string) {
|
||||
const res = await request.get<ApiResult<Record<string, string>>>(
|
||||
`/shop/shop-setting/category/${category}/values`
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据key获取完整设置
|
||||
*/
|
||||
export async function getShopSettingByKey(key: string) {
|
||||
const res = await request.get<ApiResult<ShopSetting>>(
|
||||
`/shop/shop-setting/info/${key}`
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存或更新设置
|
||||
*/
|
||||
export async function saveShopSetting(data: ShopSetting) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-setting',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新设置
|
||||
*/
|
||||
export async function updateShopSetting(data: ShopSetting) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-setting',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量保存分类设置(主要使用方式)
|
||||
*/
|
||||
export async function batchSaveShopSetting(
|
||||
category: string,
|
||||
values: Record<string, unknown>
|
||||
) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
`/shop/shop-setting/batch/${category}`,
|
||||
values
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设置
|
||||
*/
|
||||
export async function removeShopSetting(settingId: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
`/shop/shop-setting/${settingId}`
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
90
src/api/shop/shopSetting/model/index.ts
Normal file
90
src/api/shop/shopSetting/model/index.ts
Normal file
@@ -0,0 +1,90 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商城设置
|
||||
*/
|
||||
export interface ShopSetting {
|
||||
// 设置ID
|
||||
settingId?: number;
|
||||
// 设置分类: basic/order/points/dealer/notify/payment
|
||||
category?: string;
|
||||
// 设置项标识
|
||||
settingKey?: string;
|
||||
// 设置项名称
|
||||
settingName?: string;
|
||||
// 设置值(JSON格式)
|
||||
settingValue?: string;
|
||||
// 设置类型: string/number/boolean/json
|
||||
valueType?: string;
|
||||
// 设置说明
|
||||
description?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 是否启用 0否 1是
|
||||
isEnabled?: number;
|
||||
// 是否公开(前端可读)0否 1是
|
||||
isPublic?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createdTime?: number;
|
||||
// 更新时间
|
||||
updatedTime?: number;
|
||||
|
||||
/* ——— 基础设置 ——— */
|
||||
shopName?: string;
|
||||
shopLogo?: string;
|
||||
shopDesc?: string;
|
||||
shopPhone?: string;
|
||||
shopAddress?: string;
|
||||
shopEnabled?: boolean | number;
|
||||
|
||||
/* ——— 订单设置 ——— */
|
||||
orderAutoConfirmDays?: number;
|
||||
orderAutoCloseMins?: number;
|
||||
orderAutoCommentDays?: number;
|
||||
orderFreightFreeAmount?: number;
|
||||
orderRefundEnabled?: boolean | number;
|
||||
|
||||
/* ——— 积分设置 ——— */
|
||||
pointsEnabled?: boolean | number;
|
||||
pointsSigninEnabled?: boolean | number;
|
||||
pointsSigninAmount?: number;
|
||||
pointsOrderRate?: number;
|
||||
pointsExchangeRate?: number;
|
||||
|
||||
/* ——— 分销设置 ——— */
|
||||
dealerEnabled?: boolean | number;
|
||||
dealerApplyEnabled?: boolean | number;
|
||||
dealerLevel1Rate?: number;
|
||||
dealerLevel2Rate?: number;
|
||||
dealerWithdrawMin?: number;
|
||||
|
||||
/* ——— 通知设置 ——— */
|
||||
notifyOrderEnabled?: boolean | number;
|
||||
notifyPayEnabled?: boolean | number;
|
||||
notifyRefundEnabled?: boolean | number;
|
||||
notifyShipEnabled?: boolean | number;
|
||||
notifySignEnabled?: boolean | number;
|
||||
|
||||
/* ——— 支付设置 ——— */
|
||||
payWechatEnabled?: boolean | number;
|
||||
payWechatAppId?: string;
|
||||
payWechatMchId?: string;
|
||||
payWechatApiKey?: string;
|
||||
payAlipayEnabled?: boolean | number;
|
||||
payAlipayAppId?: string;
|
||||
payAlipayPrivateKey?: string;
|
||||
payAlipayPublicKey?: string;
|
||||
payBalanceEnabled?: boolean | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商城设置搜索条件
|
||||
*/
|
||||
export interface ShopSettingParam extends PageParam {
|
||||
settingId?: number;
|
||||
category?: string;
|
||||
settingKey?: string;
|
||||
keywords?: string;
|
||||
}
|
||||
122
src/api/shop/shopSpec/index.ts
Normal file
122
src/api/shop/shopSpec/index.ts
Normal file
@@ -0,0 +1,122 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
import { ShopSpec, ShopSpecParam } from '@/api/shop/shopSpec/model';
|
||||
|
||||
/**
|
||||
* 分页查询规格
|
||||
*/
|
||||
export async function pageShopSpec(params: ShopSpecParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopSpec>>>(
|
||||
MODULES_API_URL + '/shop/shop-spec/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询规格列表
|
||||
*/
|
||||
export async function listShopSpec(params?: ShopSpecParam) {
|
||||
const res = await request.get<ApiResult<ShopSpec[]>>(
|
||||
MODULES_API_URL + '/shop/shop-spec',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加规格
|
||||
*/
|
||||
export async function addShopSpec(data: ShopSpec) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-spec',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改规格
|
||||
*/
|
||||
export async function updateShopSpec(data: ShopSpec) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-spec',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除规格
|
||||
*/
|
||||
export async function removeShopSpec(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-spec/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除规格
|
||||
*/
|
||||
export async function removeBatchShopSpec(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-spec/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询规格
|
||||
*/
|
||||
export async function getShopSpec(id: number) {
|
||||
const res = await request.get<ApiResult<ShopSpec>>(
|
||||
MODULES_API_URL + '/shop/shop-spec/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步更新:将该规格模板的规格值批量更新到所有使用该模板的商品
|
||||
* @param specId 规格ID
|
||||
* @returns 更新数量等信息
|
||||
*/
|
||||
export async function syncGoodsSpec(specId: number) {
|
||||
const res = await request.post<ApiResult<{ updatedCount: number }>>(
|
||||
MODULES_API_URL + '/shop/shop-spec/sync-goods-spec',
|
||||
{ specId }
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
38
src/api/shop/shopSpec/model/index.ts
Normal file
38
src/api/shop/shopSpec/model/index.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
export interface ShopSpec {
|
||||
// 规格ID
|
||||
specId?: number;
|
||||
// 规格名称
|
||||
specName?: string;
|
||||
// 规格值
|
||||
specValue?: string;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 创建用户
|
||||
userId?: number;
|
||||
// 更新者
|
||||
updater?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态, 0正常, 1待修,2异常已修,3异常未修
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
value?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 规格搜索条件
|
||||
*/
|
||||
export interface ShopSpecParam extends PageParam {
|
||||
specId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
105
src/api/shop/shopSpecValue/index.ts
Normal file
105
src/api/shop/shopSpecValue/index.ts
Normal file
@@ -0,0 +1,105 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopSpecValue, ShopSpecValueParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询规格值
|
||||
*/
|
||||
export async function pageShopSpecValue(params: ShopSpecValueParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopSpecValue>>>(
|
||||
'/shop/shop-spec-value/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询规格值列表
|
||||
*/
|
||||
export async function listShopSpecValue(params?: ShopSpecValueParam) {
|
||||
const res = await request.get<ApiResult<ShopSpecValue[]>>(
|
||||
'/shop/shop-spec-value',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加规格值
|
||||
*/
|
||||
export async function addShopSpecValue(data: ShopSpecValue) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-spec-value',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改规格值
|
||||
*/
|
||||
export async function updateShopSpecValue(data: ShopSpecValue) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-spec-value',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除规格值
|
||||
*/
|
||||
export async function removeShopSpecValue(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-spec-value/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除规格值
|
||||
*/
|
||||
export async function removeBatchShopSpecValue(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-spec-value/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询规格值
|
||||
*/
|
||||
export async function getShopSpecValue(id: number) {
|
||||
const res = await request.get<ApiResult<ShopSpecValue>>(
|
||||
'/shop/shop-spec-value/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
31
src/api/shop/shopSpecValue/model/index.ts
Normal file
31
src/api/shop/shopSpecValue/model/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 规格值
|
||||
*/
|
||||
export interface ShopSpecValue {
|
||||
// 规格值ID
|
||||
specValueId?: number;
|
||||
// 规格组ID
|
||||
specId?: number;
|
||||
// 规格值
|
||||
specValue?: string;
|
||||
// 规格值图片(颜色类规格色板图)
|
||||
image?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 规格值搜索条件
|
||||
*/
|
||||
export interface ShopSpecValueParam extends PageParam {
|
||||
specValueId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
156
src/api/shop/shopStore/index.ts
Normal file
156
src/api/shop/shopStore/index.ts
Normal file
@@ -0,0 +1,156 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopStore, ShopStoreParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询门店
|
||||
*/
|
||||
export async function pageShopStore(params: ShopStoreParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopStore>>>(
|
||||
'/shop/shop-store/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询门店列表
|
||||
*/
|
||||
export async function listShopStore(params?: ShopStoreParam) {
|
||||
const res = await request.get<ApiResult<ShopStore[]>>(
|
||||
'/shop/shop-store',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加门店
|
||||
*/
|
||||
export async function addShopStore(data: ShopStore) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-store',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改门店
|
||||
*/
|
||||
export async function updateShopStore(data: ShopStore) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-store',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除门店
|
||||
*/
|
||||
export async function removeShopStore(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-store/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除门店
|
||||
*/
|
||||
export async function removeBatchShopStore(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-store/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询门店
|
||||
*/
|
||||
export async function getShopStore(id: number) {
|
||||
const res = await request.get<ApiResult<ShopStore>>(
|
||||
'/shop/shop-store/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置门店账号密码
|
||||
*/
|
||||
export async function resetStorePassword(data: {
|
||||
id?: number;
|
||||
userId?: number;
|
||||
password: string;
|
||||
}) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-store/reset-password',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 门店账号密码登录
|
||||
*/
|
||||
export async function storeLogin(data: {
|
||||
phone: string;
|
||||
password: string;
|
||||
}) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-store/store-login',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查门店名称是否存在
|
||||
*/
|
||||
export async function checkStoreNameExist(name: string, excludeId?: number) {
|
||||
const res = await request.get<ApiResult<boolean>>(
|
||||
'/shop/shop-store/check-name',
|
||||
{
|
||||
params: { name, excludeId }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
65
src/api/shop/shopStore/model/index.ts
Normal file
65
src/api/shop/shopStore/model/index.ts
Normal file
@@ -0,0 +1,65 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 门店
|
||||
*/
|
||||
export interface ShopStore {
|
||||
// 自增ID
|
||||
id?: number;
|
||||
// 店铺名称
|
||||
name?: string;
|
||||
// 门店地址
|
||||
address?: string;
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
// 对外联系电话
|
||||
contactPhone?: string;
|
||||
// 邮箱
|
||||
email?: string;
|
||||
// 门店经理
|
||||
managerName?: string;
|
||||
// 门店banner
|
||||
shopBanner?: string;
|
||||
// 所在省份
|
||||
province?: string;
|
||||
// 所在城市
|
||||
city?: string;
|
||||
// 所在辖区
|
||||
region?: string;
|
||||
// 经度和纬度
|
||||
lngAndLat?: string;
|
||||
// 位置
|
||||
location?:string;
|
||||
// 区域
|
||||
district?: string;
|
||||
// 轮廓
|
||||
points?: string;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 是否删除
|
||||
isDelete?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
// 登录密码(虚拟字段,不入库)
|
||||
password?: string;
|
||||
// 用户名(虚拟字段,不入库)
|
||||
username?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 门店搜索条件
|
||||
*/
|
||||
export interface ShopStoreParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
105
src/api/shop/shopStoreFence/index.ts
Normal file
105
src/api/shop/shopStoreFence/index.ts
Normal file
@@ -0,0 +1,105 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopStoreFence, ShopStoreFenceParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询黄家明_电子围栏
|
||||
*/
|
||||
export async function pageShopStoreFence(params: ShopStoreFenceParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopStoreFence>>>(
|
||||
'/shop/shop-store-fence/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询黄家明_电子围栏列表
|
||||
*/
|
||||
export async function listShopStoreFence(params?: ShopStoreFenceParam) {
|
||||
const res = await request.get<ApiResult<ShopStoreFence[]>>(
|
||||
'/shop/shop-store-fence',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加黄家明_电子围栏
|
||||
*/
|
||||
export async function addShopStoreFence(data: ShopStoreFence) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-store-fence',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改黄家明_电子围栏
|
||||
*/
|
||||
export async function updateShopStoreFence(data: ShopStoreFence) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-store-fence',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除黄家明_电子围栏
|
||||
*/
|
||||
export async function removeShopStoreFence(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-store-fence/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除黄家明_电子围栏
|
||||
*/
|
||||
export async function removeBatchShopStoreFence(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-store-fence/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询黄家明_电子围栏
|
||||
*/
|
||||
export async function getShopStoreFence(id: number) {
|
||||
const res = await request.get<ApiResult<ShopStoreFence>>(
|
||||
'/shop/shop-store-fence/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
43
src/api/shop/shopStoreFence/model/index.ts
Normal file
43
src/api/shop/shopStoreFence/model/index.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 黄家明_电子围栏
|
||||
*/
|
||||
export interface ShopStoreFence {
|
||||
// 自增ID
|
||||
id?: number;
|
||||
// 围栏名称
|
||||
name?: string;
|
||||
// 类型 0圆形 1方形
|
||||
type?: number;
|
||||
// 定位
|
||||
location?: string;
|
||||
// 经度
|
||||
longitude?: string;
|
||||
// 纬度
|
||||
latitude?: string;
|
||||
// 区域
|
||||
district?: string;
|
||||
// 电子围栏轮廓
|
||||
points?: string;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态, 0正常, 1冻结
|
||||
status?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 黄家明_电子围栏搜索条件
|
||||
*/
|
||||
export interface ShopStoreFenceParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
105
src/api/shop/shopStoreRider/index.ts
Normal file
105
src/api/shop/shopStoreRider/index.ts
Normal file
@@ -0,0 +1,105 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopStoreRider, ShopStoreRiderParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询配送员
|
||||
*/
|
||||
export async function pageShopStoreRider(params: ShopStoreRiderParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopStoreRider>>>(
|
||||
'/shop/shop-store-rider/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询配送员列表
|
||||
*/
|
||||
export async function listShopStoreRider(params?: ShopStoreRiderParam) {
|
||||
const res = await request.get<ApiResult<ShopStoreRider[]>>(
|
||||
'/shop/shop-store-rider',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加配送员
|
||||
*/
|
||||
export async function addShopStoreRider(data: ShopStoreRider) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-store-rider',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改配送员
|
||||
*/
|
||||
export async function updateShopStoreRider(data: ShopStoreRider) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-store-rider',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除配送员
|
||||
*/
|
||||
export async function removeShopStoreRider(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-store-rider/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除配送员
|
||||
*/
|
||||
export async function removeBatchShopStoreRider(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-store-rider/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询配送员
|
||||
*/
|
||||
export async function getShopStoreRider(id: number) {
|
||||
const res = await request.get<ApiResult<ShopStoreRider>>(
|
||||
'/shop/shop-store-rider/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
65
src/api/shop/shopStoreRider/model/index.ts
Normal file
65
src/api/shop/shopStoreRider/model/index.ts
Normal file
@@ -0,0 +1,65 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 配送员
|
||||
*/
|
||||
export interface ShopStoreRider {
|
||||
// 主键ID
|
||||
id?: string;
|
||||
// 门店ID(shop_store.id)
|
||||
storeId?: number;
|
||||
// 门店名称(后端联表返回,提交时可不传)
|
||||
storeName?: string;
|
||||
// 配送点ID(shop_dealer.id)
|
||||
dealerId?: number;
|
||||
// 骑手编号(可选)
|
||||
riderNo?: string;
|
||||
// 姓名
|
||||
realName?: string;
|
||||
// 手机号
|
||||
mobile?: string;
|
||||
// 头像
|
||||
avatar?: string;
|
||||
// 身份证号(可选)
|
||||
idCardNo?: string;
|
||||
// 状态:1启用;0禁用
|
||||
status?: number;
|
||||
// 接单状态:0休息/下线;1在线;2忙碌
|
||||
workStatus?: number;
|
||||
// 是否开启自动派单:1是;0否
|
||||
autoDispatchEnabled?: number;
|
||||
// 派单优先级(同小区多骑手时可用,值越大越优先)
|
||||
dispatchPriority?: number;
|
||||
// 最大同时配送单数(0表示不限制)
|
||||
maxOnhandOrders?: number;
|
||||
// 是否计算工资(提成):1计算;0不计算(如三方配送点可设0)
|
||||
commissionCalcEnabled?: number;
|
||||
// 水每桶提成金额(元/桶)
|
||||
waterBucketUnitFee?: string;
|
||||
// 其他商品提成方式:1按订单固定金额;2按订单金额比例;3按商品规则(另表)
|
||||
otherGoodsCommissionType?: number;
|
||||
// 其他商品提成值:固定金额(元)或比例(%)
|
||||
otherGoodsCommissionValue?: string;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 是否删除
|
||||
isDelete?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 配送员搜索条件
|
||||
*/
|
||||
export interface ShopStoreRiderParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
137
src/api/shop/shopStoreUser/index.ts
Normal file
137
src/api/shop/shopStoreUser/index.ts
Normal file
@@ -0,0 +1,137 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopStoreUser, ShopStoreUserParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询店员
|
||||
*/
|
||||
export async function pageShopStoreUser(params: ShopStoreUserParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopStoreUser>>>(
|
||||
'/shop/shop-store-user/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询店员列表
|
||||
*/
|
||||
export async function listShopStoreUser(params?: ShopStoreUserParam) {
|
||||
const res = await request.get<ApiResult<ShopStoreUser[]>>(
|
||||
'/shop/shop-store-user',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加店员
|
||||
*/
|
||||
export async function addShopStoreUser(data: ShopStoreUser) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-store-user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改店员
|
||||
*/
|
||||
export async function updateShopStoreUser(data: ShopStoreUser) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-store-user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除店员
|
||||
*/
|
||||
export async function removeShopStoreUser(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-store-user/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除店员
|
||||
*/
|
||||
export async function removeBatchShopStoreUser(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-store-user/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询店员
|
||||
*/
|
||||
export async function getShopStoreUser(id: number) {
|
||||
const res = await request.get<ApiResult<ShopStoreUser>>(
|
||||
'/shop/shop-store-user/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据手机号查询关联用户
|
||||
*/
|
||||
export async function getUserByPhone(phone: string) {
|
||||
const res = await request.get<ApiResult<any>>(
|
||||
'/shop/shop-store-user/getUserByPhone',
|
||||
{
|
||||
params: { phone }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 店员角色类型
|
||||
*/
|
||||
export const ROLE_TYPE_OPTIONS = [
|
||||
{ label: '门店经理', value: 1 },
|
||||
{ label: '店员', value: 2 }
|
||||
];
|
||||
|
||||
/**
|
||||
* 店员状态
|
||||
*/
|
||||
export const STATUS_OPTIONS = [
|
||||
{ label: '正常', value: 0, color: 'green' },
|
||||
{ label: '禁用', value: 1, color: 'red' }
|
||||
];
|
||||
58
src/api/shop/shopStoreUser/model/index.ts
Normal file
58
src/api/shop/shopStoreUser/model/index.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 店员
|
||||
*/
|
||||
export interface ShopStoreUser {
|
||||
// 主键ID
|
||||
id?: number;
|
||||
// 门店ID
|
||||
storeId?: number;
|
||||
// 系统用户ID
|
||||
userId?: number;
|
||||
// 姓名
|
||||
name?: string;
|
||||
// 手机号
|
||||
phone?: string;
|
||||
// 头像
|
||||
image?: string;
|
||||
// 角色类型: 1-门店经理, 2-店员
|
||||
roleType?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 状态: 0-正常, 1-禁用
|
||||
status?: number;
|
||||
// 是否删除
|
||||
isDelete?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
// ========== 关联字段 ==========
|
||||
// 门店名称
|
||||
storeName?: string;
|
||||
// 用户账号
|
||||
username?: string;
|
||||
// 用户昵称
|
||||
nickname?: string;
|
||||
// 用户头像
|
||||
avatar?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 店员搜索条件
|
||||
*/
|
||||
export interface ShopStoreUserParam extends PageParam {
|
||||
id?: number;
|
||||
storeId?: number;
|
||||
userId?: number;
|
||||
name?: string;
|
||||
phone?: string;
|
||||
roleType?: number;
|
||||
status?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
105
src/api/shop/shopStoreWarehouse/index.ts
Normal file
105
src/api/shop/shopStoreWarehouse/index.ts
Normal file
@@ -0,0 +1,105 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopStoreWarehouse, ShopStoreWarehouseParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询仓库
|
||||
*/
|
||||
export async function pageShopStoreWarehouse(params: ShopStoreWarehouseParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopStoreWarehouse>>>(
|
||||
'/shop/shop-store-warehouse/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询仓库列表
|
||||
*/
|
||||
export async function listShopStoreWarehouse(params?: ShopStoreWarehouseParam) {
|
||||
const res = await request.get<ApiResult<ShopStoreWarehouse[]>>(
|
||||
'/shop/shop-store-warehouse',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加仓库
|
||||
*/
|
||||
export async function addShopStoreWarehouse(data: ShopStoreWarehouse) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-store-warehouse',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改仓库
|
||||
*/
|
||||
export async function updateShopStoreWarehouse(data: ShopStoreWarehouse) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-store-warehouse',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除仓库
|
||||
*/
|
||||
export async function removeShopStoreWarehouse(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-store-warehouse/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除仓库
|
||||
*/
|
||||
export async function removeBatchShopStoreWarehouse(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-store-warehouse/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询仓库
|
||||
*/
|
||||
export async function getShopStoreWarehouse(id: number) {
|
||||
const res = await request.get<ApiResult<ShopStoreWarehouse>>(
|
||||
'/shop/shop-store-warehouse/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
51
src/api/shop/shopStoreWarehouse/model/index.ts
Normal file
51
src/api/shop/shopStoreWarehouse/model/index.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 仓库
|
||||
*/
|
||||
export interface ShopStoreWarehouse {
|
||||
// 自增ID
|
||||
id?: number;
|
||||
// 仓库名称
|
||||
name?: string;
|
||||
// 唯一标识
|
||||
code?: string;
|
||||
// 类型 中心仓,区域仓,门店仓
|
||||
type?: string;
|
||||
// 仓库地址
|
||||
address?: string;
|
||||
// 真实姓名
|
||||
realName?: string;
|
||||
// 联系电话
|
||||
phone?: string;
|
||||
// 所在省份
|
||||
province?: string;
|
||||
// 所在城市
|
||||
city?: string;
|
||||
// 所在辖区
|
||||
region?: string;
|
||||
// 经纬度
|
||||
lngAndLat?: string;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 是否删除
|
||||
isDelete?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 仓库搜索条件
|
||||
*/
|
||||
export interface ShopStoreWarehouseParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/shop/shopUser/index.ts
Normal file
106
src/api/shop/shopUser/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopUser, ShopUserParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询用户记录表
|
||||
*/
|
||||
export async function pageShopUser(params: ShopUserParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopUser>>>(
|
||||
MODULES_API_URL + '/shop/shop-user/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户记录表列表
|
||||
*/
|
||||
export async function listShopUser(params?: ShopUserParam) {
|
||||
const res = await request.get<ApiResult<ShopUser[]>>(
|
||||
MODULES_API_URL + '/shop/shop-user',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加用户记录表
|
||||
*/
|
||||
export async function addShopUser(data: ShopUser) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户记录表
|
||||
*/
|
||||
export async function updateShopUser(data: ShopUser) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户记录表
|
||||
*/
|
||||
export async function removeShopUser(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-user/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除用户记录表
|
||||
*/
|
||||
export async function removeBatchShopUser(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-user/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询用户记录表
|
||||
*/
|
||||
export async function getShopUser(id: number) {
|
||||
const res = await request.get<ApiResult<ShopUser>>(
|
||||
MODULES_API_URL + '/shop/shop-user/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
163
src/api/shop/shopUser/model/index.ts
Normal file
163
src/api/shop/shopUser/model/index.ts
Normal file
@@ -0,0 +1,163 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 用户记录表
|
||||
*/
|
||||
export interface ShopUser {
|
||||
// 用户id
|
||||
userId?: number;
|
||||
// 用户类型 0个人用户 1企业用户 2其他
|
||||
type?: number;
|
||||
// 账号
|
||||
username?: string;
|
||||
// 密码
|
||||
password?: string;
|
||||
// 昵称
|
||||
nickname?: string;
|
||||
// 手机号
|
||||
phone?: string;
|
||||
// 性别 1男 2女
|
||||
sex?: number;
|
||||
// 职务
|
||||
position?: string;
|
||||
// 注册来源客户端 (APP、H5、MP-WEIXIN等)
|
||||
platform?: string;
|
||||
// 邮箱
|
||||
email?: string;
|
||||
// 邮箱是否验证, 0否, 1是
|
||||
emailVerified?: number;
|
||||
// 别名
|
||||
alias?: string;
|
||||
// 真实姓名
|
||||
realName?: string;
|
||||
// 证件号码
|
||||
idCard?: string;
|
||||
// 出生日期
|
||||
birthday?: string;
|
||||
// 所在国家
|
||||
country?: string;
|
||||
// 所在省份
|
||||
province?: string;
|
||||
// 所在城市
|
||||
city?: string;
|
||||
// 所在辖区
|
||||
region?: string;
|
||||
// 街道地址
|
||||
address?: string;
|
||||
// 经度
|
||||
longitude?: string;
|
||||
// 纬度
|
||||
latitude?: string;
|
||||
// 用户可用余额
|
||||
balance?: string;
|
||||
// 已提现金额
|
||||
cashedMoney?: string;
|
||||
// 用户可用积分
|
||||
points?: number;
|
||||
// 用户总支付的金额
|
||||
payMoney?: string;
|
||||
// 实际消费的金额(不含退款)
|
||||
expendMoney?: string;
|
||||
// 密码
|
||||
payPassword?: string;
|
||||
// 会员等级ID
|
||||
gradeId?: number;
|
||||
// 行业分类
|
||||
category?: string;
|
||||
// 个人简介
|
||||
introduction?: string;
|
||||
// 机构id
|
||||
organizationId?: number;
|
||||
// 会员分组ID
|
||||
groupId?: number;
|
||||
// 头像
|
||||
avatar?: string;
|
||||
// 背景图
|
||||
bgImage?: string;
|
||||
// 用户编码
|
||||
userCode?: string;
|
||||
// 是否已实名认证
|
||||
certification?: number;
|
||||
// 年龄
|
||||
age?: number;
|
||||
// 是否线下会员
|
||||
offline?: string;
|
||||
// 关注数
|
||||
followers?: number;
|
||||
// 粉丝数
|
||||
fans?: number;
|
||||
// 点赞数
|
||||
likes?: number;
|
||||
// 评论数
|
||||
commentNumbers?: number;
|
||||
// 是否推荐
|
||||
recommend?: number;
|
||||
// 微信openid
|
||||
openid?: string;
|
||||
// 微信公众号openid
|
||||
officeOpenid?: string;
|
||||
// 微信unionID
|
||||
unionid?: string;
|
||||
// 客户端ID
|
||||
clientId?: string;
|
||||
// 不允许办卡
|
||||
notAllowVip?: string;
|
||||
// 是否管理员
|
||||
isAdmin?: string;
|
||||
// 是否企业管理员
|
||||
isOrganizationAdmin?: string;
|
||||
// 累计登录次数
|
||||
loginNum?: number;
|
||||
// 企业ID
|
||||
companyId?: number;
|
||||
// 可管理的场馆
|
||||
merchants?: string;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 商户名称
|
||||
merchantName?: string;
|
||||
// 商户头像
|
||||
merchantAvatar?: string;
|
||||
// 第三方系统的用户ID
|
||||
uid?: number;
|
||||
// 专家角色
|
||||
expertType?: string;
|
||||
// 过期时间
|
||||
expireTime?: number;
|
||||
// 最后结算时间
|
||||
settlementTime?: string;
|
||||
// 资质
|
||||
aptitude?: string;
|
||||
// 行业类型(父级)
|
||||
industryParent?: string;
|
||||
// 行业类型(子级)
|
||||
industryChild?: string;
|
||||
// 头衔
|
||||
title?: string;
|
||||
// 安装的产品ID
|
||||
templateId?: number;
|
||||
// 插件安装状态(仅对超超管判断) 0未安装 1已安装
|
||||
installed?: number;
|
||||
// 特长
|
||||
speciality?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态, 0在线, 1离线
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户记录表搜索条件
|
||||
*/
|
||||
export interface ShopUserParam extends PageParam {
|
||||
userId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/shop/shopUserAddress/index.ts
Normal file
106
src/api/shop/shopUserAddress/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopUserAddress, ShopUserAddressParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询收货地址
|
||||
*/
|
||||
export async function pageShopUserAddress(params: ShopUserAddressParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopUserAddress>>>(
|
||||
MODULES_API_URL + '/shop/shop-user-address/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询收货地址列表
|
||||
*/
|
||||
export async function listShopUserAddress(params?: ShopUserAddressParam) {
|
||||
const res = await request.get<ApiResult<ShopUserAddress[]>>(
|
||||
MODULES_API_URL + '/shop/shop-user-address',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加收货地址
|
||||
*/
|
||||
export async function addShopUserAddress(data: ShopUserAddress) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-user-address',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改收货地址
|
||||
*/
|
||||
export async function updateShopUserAddress(data: ShopUserAddress) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-user-address',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除收货地址
|
||||
*/
|
||||
export async function removeShopUserAddress(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-user-address/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除收货地址
|
||||
*/
|
||||
export async function removeBatchShopUserAddress(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/shop-user-address/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询收货地址
|
||||
*/
|
||||
export async function getShopUserAddress(id: number) {
|
||||
const res = await request.get<ApiResult<ShopUserAddress>>(
|
||||
MODULES_API_URL + '/shop/shop-user-address/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
49
src/api/shop/shopUserAddress/model/index.ts
Normal file
49
src/api/shop/shopUserAddress/model/index.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 收货地址
|
||||
*/
|
||||
export interface ShopUserAddress {
|
||||
// 主键ID
|
||||
id?: number;
|
||||
// 姓名
|
||||
name?: string;
|
||||
// 手机号码
|
||||
phone?: string;
|
||||
// 所在国家
|
||||
country?: string;
|
||||
// 所在省份
|
||||
province?: string;
|
||||
// 所在城市
|
||||
city?: string;
|
||||
// 所在辖区
|
||||
region?: string;
|
||||
// 收货地址
|
||||
address?: string;
|
||||
// 收货地址
|
||||
fullAddress?: string;
|
||||
//
|
||||
lat?: string;
|
||||
//
|
||||
lng?: string;
|
||||
// 1先生 2女士
|
||||
gender?: number;
|
||||
// 家、公司、学校
|
||||
type?: string;
|
||||
// 默认收货地址
|
||||
isDefault?: string;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 收货地址搜索条件
|
||||
*/
|
||||
export interface ShopUserAddressParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
105
src/api/shop/shopUserCoupon/index.ts
Normal file
105
src/api/shop/shopUserCoupon/index.ts
Normal file
@@ -0,0 +1,105 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopUserCoupon, ShopUserCouponParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询用户优惠券
|
||||
*/
|
||||
export async function pageShopUserCoupon(params: ShopUserCouponParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopUserCoupon>>>(
|
||||
'/shop/shop-user-coupon/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户优惠券列表
|
||||
*/
|
||||
export async function listShopUserCoupon(params?: ShopUserCouponParam) {
|
||||
const res = await request.get<ApiResult<ShopUserCoupon[]>>(
|
||||
'/shop/shop-user-coupon',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加用户优惠券
|
||||
*/
|
||||
export async function addShopUserCoupon(data: ShopUserCoupon) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-user-coupon',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户优惠券
|
||||
*/
|
||||
export async function updateShopUserCoupon(data: ShopUserCoupon) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-user-coupon',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户优惠券
|
||||
*/
|
||||
export async function removeShopUserCoupon(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-user-coupon/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除用户优惠券
|
||||
*/
|
||||
export async function removeBatchShopUserCoupon(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-user-coupon/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询用户优惠券
|
||||
*/
|
||||
export async function getShopUserCoupon(id: number) {
|
||||
const res = await request.get<ApiResult<ShopUserCoupon>>(
|
||||
'/shop/shop-user-coupon/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
61
src/api/shop/shopUserCoupon/model/index.ts
Normal file
61
src/api/shop/shopUserCoupon/model/index.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 用户优惠券
|
||||
*/
|
||||
export interface ShopUserCoupon {
|
||||
// id
|
||||
id?: string;
|
||||
// 优惠券模板ID
|
||||
couponId?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 优惠券名称
|
||||
name?: string;
|
||||
// 优惠券描述
|
||||
description?: string;
|
||||
// 优惠券类型(10满减券 20折扣券 30免费劵)
|
||||
type?: number;
|
||||
// 满减券-减免金额
|
||||
reducePrice?: string;
|
||||
// 折扣券-折扣率(0-100)
|
||||
discount?: number;
|
||||
// 最低消费金额
|
||||
minPrice?: string;
|
||||
// 适用范围(10全部商品 20指定商品 30指定分类)
|
||||
applyRange?: number;
|
||||
// 适用范围配置(json格式)
|
||||
applyRangeConfig?: string;
|
||||
// 有效期开始时间
|
||||
startTime?: string;
|
||||
// 有效期结束时间
|
||||
endTime?: string;
|
||||
// 使用状态(0未使用 1已使用 2已过期)
|
||||
status?: number;
|
||||
// 使用时间
|
||||
useTime?: string;
|
||||
// 使用订单ID
|
||||
orderId?: string;
|
||||
// 使用订单号
|
||||
orderNo?: string;
|
||||
// 获取方式(10主动领取 20系统发放 30活动赠送)
|
||||
obtainType?: number;
|
||||
// 获取来源描述
|
||||
obtainSource?: string;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户优惠券搜索条件
|
||||
*/
|
||||
export interface ShopUserCouponParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
105
src/api/shop/shopUserReferee/index.ts
Normal file
105
src/api/shop/shopUserReferee/index.ts
Normal file
@@ -0,0 +1,105 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ShopUserReferee, ShopUserRefereeParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询用户推荐关系表
|
||||
*/
|
||||
export async function pageShopUserReferee(params: ShopUserRefereeParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopUserReferee>>>(
|
||||
'/shop/shop-user-referee/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户推荐关系表列表
|
||||
*/
|
||||
export async function listShopUserReferee(params?: ShopUserRefereeParam) {
|
||||
const res = await request.get<ApiResult<ShopUserReferee[]>>(
|
||||
'/shop/shop-user-referee',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加用户推荐关系表
|
||||
*/
|
||||
export async function addShopUserReferee(data: ShopUserReferee) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/shop/shop-user-referee',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户推荐关系表
|
||||
*/
|
||||
export async function updateShopUserReferee(data: ShopUserReferee) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-user-referee',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户推荐关系表
|
||||
*/
|
||||
export async function removeShopUserReferee(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-user-referee/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除用户推荐关系表
|
||||
*/
|
||||
export async function removeBatchShopUserReferee(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/shop/shop-user-referee/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询用户推荐关系表
|
||||
*/
|
||||
export async function getShopUserReferee(id: number) {
|
||||
const res = await request.get<ApiResult<ShopUserReferee>>(
|
||||
'/shop/shop-user-referee/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user