优化网站导航模块

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 { ThinkCard, ThinkCardParam } from './model';
import { THINK_API_URL } from '@/config/setting';
/**
* 分页查询
*/
export async function pageThinkCard(params: ThinkCardParam) {
const res = await request.get<ApiResult<PageResult<ThinkCard>>>(
THINK_API_URL + '/think/think-card/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询列表
*/
export async function listThinkCard(params?: ThinkCardParam) {
const res = await request.get<ApiResult<ThinkCard[]>>(
THINK_API_URL + '/think/think-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 addThinkCard(data: ThinkCard) {
const res = await request.post<ApiResult<unknown>>(
THINK_API_URL + '/think/think-card',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改
*/
export async function updateThinkCard(data: ThinkCard) {
const res = await request.put<ApiResult<unknown>>(
THINK_API_URL + '/think/think-card',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除
*/
export async function removeThinkCard(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
THINK_API_URL + '/think/think-card/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除
*/
export async function removeBatchThinkCard(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
THINK_API_URL + '/think/think-card/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询
*/
export async function getThinkCard(id: number) {
const res = await request.get<ApiResult<ThinkCard>>(
THINK_API_URL + '/think/think-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,94 @@
import type { PageParam } from '@/api';
/**
*
*/
export interface ThinkCard {
//
id?: 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;
}
/**
* 搜索条件
*/
export interface ThinkCardParam extends PageParam {
id?: number;
keywords?: string;
}