优化网站导航模块

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
+106
View File
@@ -0,0 +1,106 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { ThinkVip, ThinkVipParam } from './model';
import { THINK_API_URL } from '@/config/setting';
/**
* 分页查询
*/
export async function pageThinkVip(params: ThinkVipParam) {
const res = await request.get<ApiResult<PageResult<ThinkVip>>>(
THINK_API_URL + '/think/think-vip/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询列表
*/
export async function listThinkVip(params?: ThinkVipParam) {
const res = await request.get<ApiResult<ThinkVip[]>>(
THINK_API_URL + '/think/think-vip',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加
*/
export async function addThinkVip(data: ThinkVip) {
const res = await request.post<ApiResult<unknown>>(
THINK_API_URL + '/think/think-vip',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改
*/
export async function updateThinkVip(data: ThinkVip) {
const res = await request.put<ApiResult<unknown>>(
THINK_API_URL + '/think/think-vip',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除
*/
export async function removeThinkVip(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
THINK_API_URL + '/think/think-vip/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除
*/
export async function removeBatchThinkVip(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
THINK_API_URL + '/think/think-vip/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询
*/
export async function getThinkVip(id: number) {
const res = await request.get<ApiResult<ThinkVip>>(
THINK_API_URL + '/think/think-vip/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
+59
View File
@@ -0,0 +1,59 @@
import type { PageParam } from '@/api';
/**
*
*/
export interface ThinkVip {
//
id?: number;
// sid场馆id集合,适用的场馆
sid?: string;
// 会员卡名称
name?: string;
// 会员卡价格
price?: number;
// 会员卡介绍
desc?: string;
// 会员卡说明
info?: string;
// 折扣率
discount?: string;
// 使用次数
count?: number;
// 每使用一次减少的金额
eachMoney?: number;
// 年限
term?: number;
// 月限
month?: number;
// 日限
day?: number;
// 排序
sort?: number;
// 会员卡类型:1年卡,2次卡,3月卡,4会员VIP,VIP充值卡
type?: number;
// 卡类型:1成人卡,2儿童卡
cardType?: number;
// vip卡等级类型:1特殊vip卡,2普通vip卡
vipType?: number;
// 特殊卡开发凭证图
pic?: string;
// VIP充值卡价格组
prices?: string;
// 是否赠送积分:1赠送,2不赠送
isIntegral?: number;
//
createTime?: number;
//
updateTime?: number;
// 是否有效:1是,0否
isUse?: number;
}
/**
* 搜索条件
*/
export interface ThinkVipParam extends PageParam {
id?: number;
keywords?: string;
}