修复:智能判断订单商品orderGoods和订单信息orderInfo的显示问题

This commit is contained in:
2024-09-14 15:41:55 +08:00
parent ea5a48fa29
commit befa701207
11 changed files with 548 additions and 320 deletions

View File

@@ -53,8 +53,8 @@ export async function addCmsDomain(data: CmsDomain) {
* 修改网站域名记录表
*/
export async function updateCmsDomain(data: CmsDomain) {
const res = await request.put<ApiResult<unknown>>(
SERVER_API_URL + '/cms/cms-domain',
const res = await request.post<ApiResult<unknown>>(
SERVER_API_URL + '/cms/cms-domain/domain',
data
);
if (res.data.code === 0) {

View File

@@ -1,4 +1,6 @@
import type { PageParam } from '@/api';
import { ShopOrderGoods } from '@/api/shop/shopOrderGoods/model';
import { OrderInfo } from '@/api/shop/orderInfo/model';
/**
*
@@ -23,6 +25,10 @@ export interface Order {
// 商户编号
merchantCode?: string;
couponId?: number;
cardId?: number;
confirmId?: number;
icCard?: string;
userId?: number;
// 用户id
uid?: number;
// 使用的优惠券id
@@ -37,6 +43,7 @@ export interface Order {
code?: string;
// 真实姓名
name?: string;
realName?: string;
// 手机号码
phone?: string;
// 订单总额
@@ -89,6 +96,8 @@ export interface Order {
expirationTime?: string;
// 对账情况1=已对账2=未对账3=已对账金额对不上4=未查询到该订单
checkBill?: number;
isSettled?: boolean;
version?: string;
// 备注
comments?: string;
// 排序号
@@ -97,6 +106,8 @@ export interface Order {
deleted?: number;
// 租户id
tenantId?: number;
orderInfo?: OrderInfo[];
orderGoods?: ShopOrderGoods[];
}
/**

View File

@@ -0,0 +1,106 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { OrderGoods, OrderGoodsParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询
*/
export async function pageOrderGoods(params: OrderGoodsParam) {
const res = await request.get<ApiResult<PageResult<OrderGoods>>>(
MODULES_API_URL + '/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 listOrderGoods(params?: OrderGoodsParam) {
const res = await request.get<ApiResult<OrderGoods[]>>(
MODULES_API_URL + '/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 addOrderGoods(data: OrderGoods) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/shop/order-goods',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改
*/
export async function updateOrderGoods(data: OrderGoods) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/shop/order-goods',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除
*/
export async function removeOrderGoods(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/order-goods/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除
*/
export async function removeBatchOrderGoods(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/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 getOrderGoods(id: number) {
const res = await request.get<ApiResult<OrderGoods>>(
MODULES_API_URL + '/shop/order-goods/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -0,0 +1,58 @@
import type { PageParam } from '@/api';
/**
*
*/
export interface OrderGoods {
//
id?: number;
// 关联订单表id
oid?: number;
// 关联场馆id
sid?: number;
// 关联场地id
fid?: number;
// 场馆
siteName?: string;
// 场地
fieldName?: string;
// 预约时间段
dateTime?: string;
// 单价
price?: string;
// 儿童价
childrenPrice?: string;
// 成人人数
adultNum?: string;
// 儿童人数
childrenNum?: string;
// 1已付款2未付款3无需付款或占用状态
payStatus?: string;
// 是否免费1免费、2收费
isFree?: string;
// 是否支持儿童票1支持2不支持
isChildren?: string;
// 预订类型1全场2半场
type?: string;
// 组合数据:日期+时间段+场馆id+场地id
mergeData?: string;
// 开场时间
startTime?: number;
// 下单时间
orderTime?: number;
// 毫秒时间戳
timeFlag?: string;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
}
/**
* 搜索条件
*/
export interface OrderGoodsParam extends PageParam {
id?: number;
orderId?: number;
keywords?: string;
}