Files
pingxiangcard/src/api/types.ts
T

260 lines
4.7 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/** 用户信息 */
export interface UserInfo {
id: number
nickname: string
avatarUrl: string
phone?: string
}
/** 微信登录结果 */
export interface WxLoginResult {
accessToken: string
refreshToken: string
userId: number
openId: string
mobile: string
expiresTime: string
}
/** 年卡基本信息 */
export interface CardInfo {
id: string
name: string
price: number
originalPrice: number
coverImage: string
description: string
scenicCount: number
}
/** 年卡详情 */
export interface CardDetail extends CardInfo {
benefits: string[]
scenicSpots: ScenicSpot[]
validDays: number
detail: string
}
/** 景区信息 */
export interface ScenicSpot {
id: string
name: string
image: string
address?: string
}
/** 我的年卡 */
export interface MyCard {
id: string
cardId: string
cardName: string
coverImage: string
userName: string
expireDate: string
status: 'active' | 'expired' | 'inactive'
}
/** 激活年卡参数 */
export interface ActivateParams {
realName: string
idCard: string
phone: string
}
/** 入园码信息 */
export interface QrCodeInfo {
qrCode: string
expireTime: string
cardName: string
userName: string
expireDate: string
}
/** 订单信息 */
export interface OrderInfo {
id: string
cardId: string
cardName: string
price: number
status: 'pending' | 'paid' | 'cancelled'
createTime: string
}
/** 创建订单参数 */
export interface CreateOrderParams {
cardId: string
}
/** 模拟支付结果 */
export interface MockPayResult {
success: boolean
orderId: string
}
/** 景区场次 */
export interface ScenicSession {
id: number
scenicId: number
date: string
startTime: string
endTime: string
stock: number
remainStock: number
}
/** 预约记录 */
export interface ReserveRecord {
id: number
scenicId: number
scenicName: string
date: string
session: string
status: 'pending' | 'confirmed' | 'cancelled' | 'used'
userName?: string
maskedId?: string
cardType?: string
cardNo?: string
applyTime?: string
cancelTime?: string
verifyTime?: string
verifyPhoto?: string
}
/** 公告 */
export interface Notice {
id: number
title: string
content: string
body?: string
publishTime: string
isTop: boolean
}
/** 首页快捷入口 */
export interface QuickAction {
id: number
icon: string
label: string
path: string
}
/** 首页弹窗公告 */
export interface Announcement {
id: number
type?: string
typeLabel?: string
title: string
date?: string
content: string
body?: string
}
/** 订单详情 */
export interface OrderDetail extends OrderInfo {
orderNo?: string
payTime?: string
payChannel?: string
redeemCode?: string
activatedTime?: string
refundedTime?: string
originalPrice?: number
cardType?: string
}
/** FAQ 条目 */
export interface FaqItem {
q: string
a: Array<{ text: string; highlight?: boolean; copy?: string }>
}
/** 分页结果 */
export interface PageResult<T> {
list: T[]
total: number
page: number
pageSize: number
}
/** OAuth2 微信登录结果 */
export interface OAuth2LoginResult {
mobile: string
openId: string
userId: number
}
/** 用户年卡列表项(来自 /zhy-api/cardBag/userCardList) */
export interface UserCardListItem {
cardNo: string
// xuchao: 卡种ID(后端 CardBagBean.cardModelId),人脸预检与卡种过滤均在用
cardModelId: number
cardModelName: string
validityTime: string
cardModelPic: string
thirdId: string
needFaceImgFlag?: boolean
}
/** 用户信息与入园码(来自 /zhy-api/cardBag/qrAndUserInfo) */
export interface QrAndUserInfoResult {
userName: string
qrCode: string
img: string
mobile: string
idType: string
idNo: string
}
/** 分页请求参数 */
export interface PageQuery {
page: number
pageSize: number
}
/** Banner 项(来自 mp-api/mpContent/queryList) */
export interface BannerItem {
id: number
channel: string
type: string
title: string
content: string | null
imageUrl: string
videoUrl?: string | null
linkUrl: string
sortOrder: number
category: string | null
createdTime: string
}
/** 创建订单参数(open-api/pingXiang/createOrder) */
export interface CreateOrderParams {
cardModleId: string
buyNum: number
skuId: string
mobile: string
couponId: string
}
/** 创建订单结果 */
export interface CreateOrderResult {
orderId: string
outTradeNo: string
}
/** 预支付参数(open-api/pingXiang/prepay) */
export interface PrepayParams {
openId: string
orderNo: string
description: string
amount: number
}
/** 预支付结果(含微信支付调起参数) */
export interface PrepayResult {
appId: string
timeStamp: string
nonce: string
pack: string
signType: string
paySign: string
}