删除无用代码

This commit is contained in:
2025-06-26 16:40:55 +08:00
parent d75fb55eec
commit cf1c69b6d6
74 changed files with 438 additions and 5506 deletions

View File

@@ -1,17 +1,14 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api/index';
import type { OrderGoods, OrderGoodsParam } from './model';
import {SERVER_API_URL} from '@/config/setting';
/**
* 分页查询订单商品
*/
export async function pageOrderGoods(params: OrderGoodsParam) {
const res = await request.get<ApiResult<PageResult<OrderGoods>>>(
SERVER_API_URL + '/system/order-goods/page',
{
params
}
'/shop/shop-goods/page',
params
);
if (res.code === 0) {
return res.data;
@@ -24,10 +21,8 @@ export async function pageOrderGoods(params: OrderGoodsParam) {
*/
export async function listOrderGoods(params?: OrderGoodsParam) {
const res = await request.get<ApiResult<OrderGoods[]>>(
SERVER_API_URL + '/system/order-goods',
{
params
}
'/shop/shop-goods',
params
);
if (res.code === 0 && res.data) {
return res.data;
@@ -40,7 +35,7 @@ export async function listOrderGoods(params?: OrderGoodsParam) {
*/
export async function addOrderGoods(data: OrderGoods) {
const res = await request.post<ApiResult<unknown>>(
SERVER_API_URL + '/system/order-goods',
'/shop/shop-goods',
data
);
if (res.code === 0) {
@@ -54,7 +49,7 @@ export async function addOrderGoods(data: OrderGoods) {
*/
export async function updateOrderGoods(data: OrderGoods) {
const res = await request.put<ApiResult<unknown>>(
SERVER_API_URL + '/system/order-goods',
'/shop/shop-goods',
data
);
if (res.code === 0) {
@@ -68,7 +63,7 @@ export async function updateOrderGoods(data: OrderGoods) {
*/
export async function removeOrderGoods(id?: number) {
const res = await request.del<ApiResult<unknown>>(
SERVER_API_URL + '/system/order-goods/' + id
'/shop/shop-goods/' + id
);
if (res.code === 0) {
return res.message;
@@ -81,7 +76,7 @@ export async function removeOrderGoods(id?: number) {
*/
export async function removeBatchOrderGoods(data: (number | undefined)[]) {
const res = await request.del<ApiResult<unknown>>(
SERVER_API_URL + '/system/order-goods/batch',
'/shop/shop-goods/batch',
{
data
}
@@ -97,7 +92,7 @@ export async function removeBatchOrderGoods(data: (number | undefined)[]) {
*/
export async function getOrderGoods(id: number) {
const res = await request.get<ApiResult<OrderGoods>>(
SERVER_API_URL + '/system/order-goods/' + id
'/shop/shop-goods/' + id
);
if (res.code === 0 && res.data) {
return res.data;

View File

@@ -1,4 +1,4 @@
import type { PageParam } from '@/api';
import type { PageParam } from '@/api/index';
/**
* 订单商品
@@ -12,6 +12,8 @@ export interface OrderGoods {
orderId?: number;
// 项目ID
itemId?: number;
// 商品ID
goodsId?: number;
// 实际付款
payPrice?: string;
// 购买数量
@@ -51,5 +53,6 @@ export interface OrderGoods {
*/
export interface OrderGoodsParam extends PageParam {
id?: number;
orderId?: number; // 添加 orderId 属性
keywords?: string;
}