优化网站导航模块

This commit is contained in:
2024-08-23 22:28:24 +08:00
parent 1d81fa9270
commit 13832d9de0
964 changed files with 90774 additions and 31362 deletions

View File

@@ -0,0 +1,106 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { UserCard, UserCardParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询会员卡
*/
export async function pageUserCard(params: UserCardParam) {
const res = await request.get<ApiResult<PageResult<UserCard>>>(
MODULES_API_URL + '/booking/user-card/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询会员卡列表
*/
export async function listUserCard(params?: UserCardParam) {
const res = await request.get<ApiResult<UserCard[]>>(
MODULES_API_URL + '/booking/user-card',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加会员卡
*/
export async function addUserCard(data: UserCard) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/booking/user-card',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改会员卡
*/
export async function updateUserCard(data: UserCard) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/booking/user-card',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除会员卡
*/
export async function removeUserCard(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/booking/user-card/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除会员卡
*/
export async function removeBatchUserCard(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/booking/user-card/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询会员卡
*/
export async function getUserCard(id: number) {
const res = await request.get<ApiResult<UserCard>>(
MODULES_API_URL + '/booking/user-card/' + 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,109 @@
import type { PageParam } from '@/api';
/**
* 会员卡
*/
export interface UserCard {
//
id?: number;
// 用户id
userId?: number;
// sid场馆id集合适用的场馆
sid?: string;
// 用户id
uid?: number;
// vip卡id
vid?: number;
// 开卡人id
aid?: number;
// 微信订单号
wechatOrder?: string;
// 卡号
code?: string;
// 会员卡名称
name?: string;
// 真实姓名
username?: string;
// 手机号码
phone?: string;
// vip购卡价格
price?: string;
// 会员卡介绍
desc?: string;
// 会员卡说明
info?: string;
// vip卡折扣率
discount?: string;
// 使用次数
count?: number;
// 每使用一次减少的金额
eachMoney?: string;
// 剩余金额
remainingMoney?: string;
// 续费累加次数
number?: number;
// 剩余次数
num?: number;
// 付款状态,1已付款2未付款
status?: number;
// 会员卡年限
term?: number;
// 月限
month?: number;
// IC卡类型1年卡2次卡3月卡4会员IC卡5充值卡
type?: number;
// 卡类型1成人卡2儿童卡
cardType?: number;
// vip卡等级类型1特殊vip卡2普通vip卡
vipType?: number;
// 特殊卡开发凭证图
pic?: string;
// 价格组
prices?: string;
// 1微信支付2支付宝支付3现金4POS机刷卡15平安健康卡
payType?: number;
// 是否赠送积分1赠送2不赠送
isIntegral?: number;
// 是否已开具发票1已开发票2未开发票
isInvoice?: number;
// vip卡到期时间
expireTime?: number;
// 紧急联系人
urgentName?: string;
// 紧急联系人号码
urgentPhone?: string;
// 卡号
cardNum?: string;
// 密码
password?: string;
// 使用时间
useTime?: number;
// 创建时间
createTime?: number;
//
updateTime?: number;
// 身份证号码
idCard?: string;
// 备注
remark?: string;
// 备注
comments?: string;
// 排序号
sortNumber?: number;
// 租户id
tenantId?: number;
}
/**
* 会员卡搜索条件
*/
export interface UserCardParam extends PageParam {
id?: number;
type?: number;
typeName?: string;
userId?: number;
username?: string;
phone?: string;
cardNum?: string;
keywords?: string;
}