feat(user): 新增收货地址管理及售后申请页面
- 新增地址类型定义,增强前端地址数据结构 - 新增地址编辑页面,支持地址智能识别和定位选点功能 - 地址编辑支持省市区选择及默认地址设置 - 新增地址列表页面,支持地址展示、删除、编辑和选择功能 - 实现售后申请页面,支持选择售后类型和退款原因 - 售后申请支持商品选择、退款金额计算和凭证上传 - 新增售后详情页面,支持售后状态展示及申请取消 - 优化页面加载和用户交互体验,增加错误提示和权限处理
This commit is contained in:
66
src_bak/api/shop/shopPointsOrder/index.ts
Normal file
66
src_bak/api/shop/shopPointsOrder/index.ts
Normal file
@@ -0,0 +1,66 @@
|
||||
import request from '@/utils/request'
|
||||
import type { ApiResult, PageResult } from '@/api'
|
||||
import type { ShopPointsOrder, PointsOrderStatus, CreatePointsOrderParams } from './model'
|
||||
|
||||
export type { ShopPointsOrder, PointsOrderStatus, CreatePointsOrderParams } from './model'
|
||||
|
||||
/** 查询积分订单列表参数 */
|
||||
export interface ListShopPointsOrderParams {
|
||||
page?: number
|
||||
limit?: number
|
||||
status?: PointsOrderStatus
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询积分订单列表
|
||||
*/
|
||||
export async function listShopPointsOrder(params?: ListShopPointsOrderParams) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopPointsOrder>>>(
|
||||
'/shop/shop-points-order/page',
|
||||
params
|
||||
)
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取积分订单详情
|
||||
*/
|
||||
export async function getShopPointsOrder(id: string) {
|
||||
const res = await request.get<ApiResult<ShopPointsOrder>>(
|
||||
'/shop/shop-points-order/' + id
|
||||
)
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建积分兑换订单
|
||||
*/
|
||||
export async function createPointsOrder(data: CreatePointsOrderParams) {
|
||||
const res = await request.post<ApiResult<ShopPointsOrder>>(
|
||||
'/shop/shop-points-order',
|
||||
data
|
||||
)
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消积分订单
|
||||
*/
|
||||
export async function cancelShopPointsOrder(id: string) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/shop/shop-points-order/cancel/' + id
|
||||
)
|
||||
if (res.code === 0) {
|
||||
return true
|
||||
}
|
||||
return Promise.reject(new Error(res.message))
|
||||
}
|
||||
Reference in New Issue
Block a user