完成换场地功能

This commit is contained in:
gxwebsoft
2024-05-23 15:42:41 +08:00
parent fc7752cb18
commit 757822f3ba
24 changed files with 2444 additions and 86 deletions

View File

@@ -0,0 +1,106 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { Emergency, EmergencyParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询紧急联系人管理
*/
export async function pageEmergency(params: EmergencyParam) {
const res = await request.get<ApiResult<PageResult<Emergency>>>(
MODULES_API_URL + '/booking/emergency/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询紧急联系人管理列表
*/
export async function listEmergency(params?: EmergencyParam) {
const res = await request.get<ApiResult<Emergency[]>>(
MODULES_API_URL + '/booking/emergency',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加紧急联系人管理
*/
export async function addEmergency(data: Emergency) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/booking/emergency',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改紧急联系人管理
*/
export async function updateEmergency(data: Emergency) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/booking/emergency',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除紧急联系人管理
*/
export async function removeEmergency(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/booking/emergency/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除紧急联系人管理
*/
export async function removeBatchEmergency(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/booking/emergency/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询紧急联系人管理
*/
export async function getEmergency(id: number) {
const res = await request.get<ApiResult<Emergency>>(
MODULES_API_URL + '/booking/emergency/' + 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,35 @@
import type { PageParam } from '@/api';
/**
* 紧急联系人管理
*/
export interface Emergency {
// ID
emergencyId?: number;
// 姓名
name?: string;
// 手机号
phone?: string;
// 关联用户
userId?: number;
// 商户ID
merchantId?: number;
// 备注
comments?: string;
// 状态
status?: number;
// 排序号
sortNumber?: number;
// 租户id
tenantId?: number;
// 创建时间
createTime?: string;
}
/**
* 紧急联系人管理搜索条件
*/
export interface EmergencyParam extends PageParam {
emergencyId?: number;
keywords?: string;
}

View File

@@ -1,4 +1,5 @@
import type { PageParam } from '@/api';
import { OrderInfo } from "@/api/shop/orderInfo/model";
/**
* 场馆场地
@@ -47,6 +48,9 @@ export interface Field {
tenantId?: number;
// 创建时间
createTime?: string;
orderId?: number;
orderInfoList?: OrderInfo[];
orderKey?: string;
}
/**

View File

@@ -1,4 +1,5 @@
import type { PageParam } from '@/api';
import { Field } from "@/api/booking/field/model";
/**
* 场地时段
@@ -40,6 +41,7 @@ export interface Period {
tenantId?: number;
// 创建时间
createTime?: string;
fieldList?: Field[];
}
/**
@@ -48,4 +50,10 @@ export interface Period {
export interface PeriodParam extends PageParam {
periodId?: number;
keywords?: string;
dateTime?: string;
isStatus?: number;
timePeriod?: string;
week?: number;
startTime?: string;
half?: number;
}

View File

@@ -0,0 +1,106 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { UserCoupon, UserCouponParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询我的优惠券
*/
export async function pageUserCoupon(params: UserCouponParam) {
const res = await request.get<ApiResult<PageResult<UserCoupon>>>(
MODULES_API_URL + '/booking/user-coupon/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询我的优惠券列表
*/
export async function listUserCoupon(params?: UserCouponParam) {
const res = await request.get<ApiResult<UserCoupon[]>>(
MODULES_API_URL + '/booking/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 addUserCoupon(data: UserCoupon) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/booking/user-coupon',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改我的优惠券
*/
export async function updateUserCoupon(data: UserCoupon) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/booking/user-coupon',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除我的优惠券
*/
export async function removeUserCoupon(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/booking/user-coupon/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除我的优惠券
*/
export async function removeBatchUserCoupon(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/booking/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 getUserCoupon(id: number) {
const res = await request.get<ApiResult<UserCoupon>>(
MODULES_API_URL + '/booking/user-coupon/' + 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,59 @@
import type { PageParam } from '@/api';
/**
* 我的优惠券
*/
export interface UserCoupon {
// id
id?: number;
// 优惠劵id
couponId?: number;
// 优惠券名称
name?: string;
// 优惠券类型(10满减券 20折扣券)
type?: number;
// 满减券-减免金额
reducePrice?: string;
// 折扣券-折扣率(0-100)
discount?: number;
// 最低消费金额
minPrice?: string;
// 到期类型(10领取后生效 20固定时间)
expireType?: number;
// 领取后生效-有效天数
expireDay?: number;
// 有效期开始时间
startTime?: number;
// 有效期结束时间
endTime?: number;
// 适用范围(10全部商品 20指定商品)
applyRange?: number;
// 适用范围配置(json格式)
applyRangeConfig?: string;
// 是否过期(0未过期 1已过期)
isExpire?: number;
// 是否已使用(0未使用 1已使用)
isUse?: number;
// 排序(数字越小越靠前)
sortNumber?: number;
// 状态, 0待使用, 1已使用, 2已失效
status?: number;
// 是否删除, 0否, 1是
deleted?: number;
// 用户ID
userId?: number;
// 租户id
tenantId?: number;
// 注册时间
createTime?: string;
// 修改时间
updateTime?: string;
}
/**
* 我的优惠券搜索条件
*/
export interface UserCouponParam extends PageParam {
id?: number;
keywords?: string;
}

View File

@@ -44,4 +44,7 @@ export interface PageParam {
createTimeStart?: string;
// 结束时间
createTimeEnd?: string;
showSoldStatus?: boolean;
dateTime?: string;
}

View File

@@ -43,6 +43,35 @@ export async function getUserInfo(): Promise<User> {
return Promise.reject(new Error(res.data.message));
}
/**
* 获取服务器时间(实时)
* @return
*/
export async function getServerTime() {
const res = await request.get<ApiResult<any>>(
MODULES_API_URL + '/cms/website/getServerTime'
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 获取未来7天的日期
* @return
*/
export async function getNext7day() {
const res = await request.get<ApiResult<any>>(
MODULES_API_URL + '/cms/website/getNext7day'
);
console.log('res.data.code: ', res.data.code);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 向子模块传递token
* @param url

View File

@@ -108,7 +108,11 @@ export interface OrderParam extends PageParam {
orderId?: number;
keywords?: string;
userId?: number;
week?: number;
isStatus?: number;
merchantId?: number;
merchantCode?: string;
merchantName?: string;
startTime?: string;
dateTime?: string;
}

View File

@@ -1,53 +1,65 @@
import type { PageParam } from '@/api';
/**
*
* 场地
*/
export interface OrderInfo {
//
// 自增ID
id?: number;
// 关联订单表id
oid?: number;
// 关联场馆id
sid?: number;
orderId?: number;
// 组合数据:日期+时间段+场馆id+场地id
orderCode?: string;
// 关联商户ID
merchantId?: number;
// 商户名称
merchantName?: string;
// 关联场地id
fid?: number;
// 场
siteName?: string;
// 场地
fieldId?: number;
// 场地名称
fieldName?: string;
// 预约时间段
dateTime?: string;
// 单价
price?: string;
// 儿童价
childrenPrice?: string;
// 成人人数
adultNum?: string;
adultNum?: number;
// 儿童人数
childrenNum?: string;
// 1已付款2未付款3无需付款或占用状态
payStatus?: string;
// 是否免费1免费、2收
childrenNum?: number;
// 0 未付款 1已付款2无需付款或占用状态
payStatus?: number;
// 是否免费:0收费、1免费
isFree?: string;
// 是否支持儿童票:1支持2不支持
// 是否支持儿童票:0不支持、1支持
isChildren?: string;
// 预订类型1全场2半场
type?: string;
// 组合数据:日期+时间段+场馆id+场地id
mergeData?: string;
// 系统版本 0当前版本 其他版本
version?: number;
// 预订类型0全场1半场
isHalf?: string;
// 预约时间段
timePeriod?: string;
// 预定日期
dateTime?: string;
// 开场时间
startTime?: number;
// 下单时间
orderTime?: number;
startTime?: string;
// 结束时间
endTime?: string;
// 毫秒时间戳
timeFlag?: string;
// 备注
comments?: string;
// 用户id
userId?: number;
// 租户id
tenantId?: number;
// 更新时间
updateTime?: string;
// 创建时间
createTime?: string;
}
/**
* 搜索条件
* 场地搜索条件
*/
export interface OrderInfoParam extends PageParam {
id?: number;

View File

@@ -0,0 +1,106 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { UserCoupon, UserCouponParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询我的优惠券
*/
export async function pageUserCoupon(params: UserCouponParam) {
const res = await request.get<ApiResult<PageResult<UserCoupon>>>(
MODULES_API_URL + '/booking/user-coupon/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询我的优惠券列表
*/
export async function listUserCoupon(params?: UserCouponParam) {
const res = await request.get<ApiResult<UserCoupon[]>>(
MODULES_API_URL + '/booking/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 addUserCoupon(data: UserCoupon) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/booking/user-coupon',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改我的优惠券
*/
export async function updateUserCoupon(data: UserCoupon) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/booking/user-coupon',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除我的优惠券
*/
export async function removeUserCoupon(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/booking/user-coupon/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除我的优惠券
*/
export async function removeBatchUserCoupon(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/booking/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 getUserCoupon(id: number) {
const res = await request.get<ApiResult<UserCoupon>>(
MODULES_API_URL + '/booking/user-coupon/' + 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,59 @@
import type { PageParam } from '@/api';
/**
* 我的优惠券
*/
export interface UserCoupon {
// id
id?: number;
// 优惠劵id
couponId?: number;
// 优惠券名称
name?: string;
// 优惠券类型(10满减券 20折扣券)
type?: number;
// 满减券-减免金额
reducePrice?: string;
// 折扣券-折扣率(0-100)
discount?: number;
// 最低消费金额
minPrice?: string;
// 到期类型(10领取后生效 20固定时间)
expireType?: number;
// 领取后生效-有效天数
expireDay?: number;
// 有效期开始时间
startTime?: number;
// 有效期结束时间
endTime?: number;
// 适用范围(10全部商品 20指定商品)
applyRange?: number;
// 适用范围配置(json格式)
applyRangeConfig?: string;
// 是否过期(0未过期 1已过期)
isExpire?: number;
// 是否已使用(0未使用 1已使用)
isUse?: number;
// 排序(数字越小越靠前)
sortNumber?: number;
// 状态, 0待使用, 1已使用, 2已失效
status?: number;
// 是否删除, 0否, 1是
deleted?: number;
// 用户ID
userId?: number;
// 租户id
tenantId?: number;
// 注册时间
createTime?: string;
// 修改时间
updateTime?: string;
}
/**
* 我的优惠券搜索条件
*/
export interface UserCouponParam extends PageParam {
id?: number;
keywords?: string;
}