feat(user): 新增收货地址管理及售后申请页面
- 新增地址类型定义,增强前端地址数据结构 - 新增地址编辑页面,支持地址智能识别和定位选点功能 - 地址编辑支持省市区选择及默认地址设置 - 新增地址列表页面,支持地址展示、删除、编辑和选择功能 - 实现售后申请页面,支持选择售后类型和退款原因 - 售后申请支持商品选择、退款金额计算和凭证上传 - 新增售后详情页面,支持售后状态展示及申请取消 - 优化页面加载和用户交互体验,增加错误提示和权限处理
This commit is contained in:
48
src_bak/api/shop/shopRechargeCode/index.ts
Normal file
48
src_bak/api/shop/shopRechargeCode/index.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import request from '@/utils/request'
|
||||
import type { ApiResult, PageResult } from '@/api'
|
||||
import type { ShopRechargeCode, ShopRechargeCodeParam } from './model'
|
||||
|
||||
/**
|
||||
* 使用兑换码充值
|
||||
*/
|
||||
export async function useRechargeCode(code: string) {
|
||||
const res = await request.post<ApiResult<ShopRechargeCode>>(
|
||||
'/shop/recharge-code/use',
|
||||
{ code }
|
||||
)
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取兑换码信息
|
||||
*/
|
||||
export async function getRechargeCodeInfo(code: string) {
|
||||
const res = await request.get<ApiResult<ShopRechargeCode>>(
|
||||
'/shop/recharge-code/info',
|
||||
{ code }
|
||||
)
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询用户兑换记录
|
||||
*/
|
||||
export async function pageRechargeCodeRecords(params: {
|
||||
page?: number
|
||||
limit?: number
|
||||
}) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopRechargeCode>>>(
|
||||
'/shop/recharge-code/records',
|
||||
params
|
||||
)
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
28
src_bak/api/shop/shopRechargeCode/model/index.ts
Normal file
28
src_bak/api/shop/shopRechargeCode/model/index.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* 充值兑换码类型定义
|
||||
*/
|
||||
|
||||
export interface ShopRechargeCode {
|
||||
id: number
|
||||
code: string
|
||||
amount: string
|
||||
userId?: number
|
||||
status: number // 0-未使用, 1-已使用, 2-已过期
|
||||
generateType: number // 1-管理员生成, 2-批量生成
|
||||
batchNo?: string
|
||||
expireTime?: string
|
||||
usedAt?: string
|
||||
balanceBefore?: string
|
||||
balanceAfter?: string
|
||||
createTime: string
|
||||
updateTime: string
|
||||
}
|
||||
|
||||
export interface ShopRechargeCodeParam {
|
||||
page?: number
|
||||
limit?: number
|
||||
code?: string
|
||||
status?: number
|
||||
batchNo?: string
|
||||
userId?: number
|
||||
}
|
||||
Reference in New Issue
Block a user