优化网站导航模块
This commit is contained in:
106
modules/api/booking_____/userCard/index.ts
Normal file
106
modules/api/booking_____/userCard/index.ts
Normal 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));
|
||||
}
|
||||
109
modules/api/booking_____/userCard/model/index.ts
Normal file
109
modules/api/booking_____/userCard/model/index.ts
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user