优化小程序菜单管理功能

This commit is contained in:
gxwebsoft
2024-06-01 02:45:33 +08:00
parent 4bae8599e1
commit e3fb9ba283
36 changed files with 2161 additions and 430 deletions

View File

@@ -10,6 +10,10 @@ export interface Card {
cardName?: string;
// 会员卡标识
cardCode?: string;
// 会员卡类型
type?: string;
// 成人儿童
cardType?: number;
// 会员卡图片
image?: string;
// 价格
@@ -30,6 +34,8 @@ export interface Card {
merchantName?: string;
// 商户类型
merchantType?: string;
// 可使用的场馆ID
merchantIds?: string;
// 备注
comments?: string;
// 状态

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;
}

View File

@@ -0,0 +1,106 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { UserCardLog, UserCardLogParam } from './model';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询明细表
*/
export async function pageUserCardLog(params: UserCardLogParam) {
const res = await request.get<ApiResult<PageResult<UserCardLog>>>(
MODULES_API_URL + '/booking/user-card-log/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询明细表列表
*/
export async function listUserCardLog(params?: UserCardLogParam) {
const res = await request.get<ApiResult<UserCardLog[]>>(
MODULES_API_URL + '/booking/user-card-log',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加明细表
*/
export async function addUserCardLog(data: UserCardLog) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/booking/user-card-log',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改明细表
*/
export async function updateUserCardLog(data: UserCardLog) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/booking/user-card-log',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除明细表
*/
export async function removeUserCardLog(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/booking/user-card-log/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除明细表
*/
export async function removeBatchUserCardLog(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/booking/user-card-log/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询明细表
*/
export async function getUserCardLog(id: number) {
const res = await request.get<ApiResult<UserCardLog>>(
MODULES_API_URL + '/booking/user-card-log/' + 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,49 @@
import type { PageParam } from '@/api';
/**
* 明细表
*/
export interface UserCardLog {
// 主键ID
logId?: number;
// 用户ID
userId?: number;
// IC卡类型1年卡2次卡3月卡4会员IC卡5充值卡
type?: number;
// 变动金额
money?: string;
// 变动后余额
balance?: string;
// 管理员备注
remark?: string;
// 订单编号
orderNo?: string;
// 操作人ID
adminId?: number;
// 排序(数字越小越靠前)
sortNumber?: number;
// 备注
comments?: string;
// 状态, 0正常, 1冻结
status?: number;
// 是否删除, 0否, 1是
deleted?: number;
// 商户ID
merchantId?: number;
// 商户编码
merchantCode?: string;
// 租户id
tenantId?: number;
// 注册时间
createTime?: string;
// 修改时间
updateTime?: string;
}
/**
* 明细表搜索条件
*/
export interface UserCardLogParam extends PageParam {
logId?: number;
keywords?: string;
}

View File

@@ -50,6 +50,8 @@ export interface MpMenu {
goodsId?: number;
// 用户ID
userId?: number;
// 是否管理人员可见
adminShow?: number;
// 设为首页
home?: number;
// 排序(数字越小越靠前)

View File

@@ -17,6 +17,8 @@ export interface Merchant {
realName?: string;
// 店铺类型
shopType?: string;
// 项目类型
itemType?: string;
// 商户分类
category?: string;
// 商户坐标
@@ -75,5 +77,7 @@ export interface Merchant {
*/
export interface MerchantParam extends PageParam {
merchantId?: number;
merchantIds?: string;
merchantCodes?: string;
keywords?: string;
}

View File

@@ -7,6 +7,10 @@ import { OrderInfo } from '@/api/shop/orderInfo/model';
export interface Order {
// 订单号
orderId?: number;
// 订单类型
type?: number;
// 下单渠道
channel?: number;
// 订单编号
orderNo?: string;
// 微信支付订单号

View File

@@ -2,6 +2,7 @@ import type { PageParam } from '@/api';
import type { Role } from '../../role/model';
import type { Menu } from '../../menu/model';
import { Company } from '@/api/system/company/model';
import { Merchant } from "@/api/shop/merchant/model";
/**
* 用户
@@ -65,6 +66,8 @@ export interface User {
deliveryTime?: string;
receiptTime?: string;
merchantId?: number;
// 可管理的商户
merchants?: string;
// 创建时间
createTime?: string;
// 租户ID