refactor(shop): 移除品牌管理功能

- 删除了 shopBrand2 相关的 API、组件和页面
- 优化了 shopCoupon 和 shopExpress 页面的日期格式显示
- 更新了 shopCoupon 编辑组件,增加了日期选择器并优化了数据格式
This commit is contained in:
2025-08-12 12:42:58 +08:00
parent 17e6effe70
commit 5c203d7f30
9 changed files with 56 additions and 641 deletions

View File

@@ -1,105 +0,0 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ShopBrand2, ShopBrand2Param } from './model';
/**
* 分页查询品牌
*/
export async function pageShopBrand2(params: ShopBrand2Param) {
const res = await request.get<ApiResult<PageResult<ShopBrand2>>>(
'/shop/shop-brand2/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询品牌列表
*/
export async function listShopBrand2(params?: ShopBrand2Param) {
const res = await request.get<ApiResult<ShopBrand2[]>>(
'/shop/shop-brand2',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加品牌
*/
export async function addShopBrand2(data: ShopBrand2) {
const res = await request.post<ApiResult<unknown>>(
'/shop/shop-brand2',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改品牌
*/
export async function updateShopBrand2(data: ShopBrand2) {
const res = await request.put<ApiResult<unknown>>(
'/shop/shop-brand2',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除品牌
*/
export async function removeShopBrand2(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
'/shop/shop-brand2/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除品牌
*/
export async function removeBatchShopBrand2(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
'/shop/shop-brand2/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询品牌
*/
export async function getShopBrand2(id: number) {
const res = await request.get<ApiResult<ShopBrand2>>(
'/shop/shop-brand2/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -1,31 +0,0 @@
import type { PageParam } from '@/api';
/**
* 品牌
*/
export interface ShopBrand2 {
// ID
brandId?: number;
// 品牌名称
brandName?: string;
// 图标
image?: string;
// 备注
comments?: string;
// 状态
status?: number;
// 排序号
sortNumber?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
}
/**
* 品牌搜索条件
*/
export interface ShopBrand2Param extends PageParam {
brandId?: number;
keywords?: string;
}

View File

@@ -25,9 +25,9 @@ export interface ShopCoupon {
// 领取后生效-有效天数
expireDay?: number;
// 有效期开始时间
startTime?: string;
startTime?: string | Date;
// 有效期结束时间
endTime?: string;
endTime?: string | Date;
// 适用范围(10全部商品 20指定商品 30指定分类)
applyRange?: number;
// 适用范围配置(json格式)
@@ -45,9 +45,9 @@ export interface ShopCoupon {
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
createTime?: string | Date;
// 修改时间
updateTime?: string;
updateTime?: string | Date;
// 发放总数量(-1表示无限制)
totalCount?: number;
// 已发放数量