1
This commit is contained in:
@@ -72,7 +72,7 @@ export const apiAdminMerchantPage = async (params: AdminMerchantPageParams, sign
|
||||
}
|
||||
|
||||
export const apiAdminMerchantCreate = async (params: AdminMerchantCreateParams, signal?: AbortSignal) => {
|
||||
const response = await axiosInstance.post<IBaseResponse<{ uid: number; merchantId: string; merchantNo: string }>>(
|
||||
const response = await axiosInstance.post<IBaseResponse<{ uid: string; merchantId: string; merchantNo: string }>>(
|
||||
'/api/v1/mall/admin/merchant_create',
|
||||
params,
|
||||
{ signal }
|
||||
@@ -103,7 +103,7 @@ export const apiAdminStorePage = async (params: AdminStorePageParams, signal?: A
|
||||
}
|
||||
|
||||
export const apiAdminStoreAudit = async (params: AdminStoreAuditParams, signal?: AbortSignal) => {
|
||||
const response = await axiosInstance.post<IBaseResponse<{ storeId: number; auditStatus: string }>>(
|
||||
const response = await axiosInstance.post<IBaseResponse<{ storeId: string; auditStatus: string }>>(
|
||||
'/api/v1/mall/admin/store_audit',
|
||||
params,
|
||||
{ signal }
|
||||
@@ -125,7 +125,7 @@ export const apiAdminGoodsPage = async (params: AdminGoodsPageParams, signal?: A
|
||||
}
|
||||
|
||||
export const apiAdminGoodsAudit = async (params: AdminGoodsAuditParams, signal?: AbortSignal) => {
|
||||
const response = await axiosInstance.post<IBaseResponse<{ spuId: number; auditStatus: string }>>(
|
||||
const response = await axiosInstance.post<IBaseResponse<{ spuId: string; auditStatus: string }>>(
|
||||
'/api/v1/mall/admin/goods_audit',
|
||||
params,
|
||||
{ signal }
|
||||
@@ -173,7 +173,7 @@ export const apiAdminCategoryTree = async (params: AdminCategoryTreeParams, sign
|
||||
}
|
||||
|
||||
export const apiAdminCategorySave = async (params: AdminCategorySaveParams, signal?: AbortSignal) => {
|
||||
const response = await axiosInstance.post<IBaseResponse<{ id: number; categoryLevel: number; categoryPath: string }>>(
|
||||
const response = await axiosInstance.post<IBaseResponse<{ id: string; categoryLevel: number; categoryPath: string }>>(
|
||||
'/api/v1/mall/admin/category_save',
|
||||
params,
|
||||
{ signal }
|
||||
@@ -182,7 +182,7 @@ export const apiAdminCategorySave = async (params: AdminCategorySaveParams, sign
|
||||
}
|
||||
|
||||
export const apiAdminCategoryDelete = async (params: AdminCategoryDeleteParams, signal?: AbortSignal) => {
|
||||
const response = await axiosInstance.post<IBaseResponse<{ id: number }>>(
|
||||
const response = await axiosInstance.post<IBaseResponse<{ id: string }>>(
|
||||
'/api/v1/mall/admin/category_delete',
|
||||
params,
|
||||
{ signal }
|
||||
@@ -204,7 +204,7 @@ export const apiAdminBannerPage = async (params: AdminBannerPageParams, signal?:
|
||||
}
|
||||
|
||||
export const apiAdminBannerSave = async (params: AdminBannerSaveParams, signal?: AbortSignal) => {
|
||||
const response = await axiosInstance.post<IBaseResponse<{ id: number }>>(
|
||||
const response = await axiosInstance.post<IBaseResponse<{ id: string }>>(
|
||||
'/api/v1/mall/admin/banner_save',
|
||||
params,
|
||||
{ signal }
|
||||
@@ -213,7 +213,7 @@ export const apiAdminBannerSave = async (params: AdminBannerSaveParams, signal?:
|
||||
}
|
||||
|
||||
export const apiAdminBannerDelete = async (params: AdminBannerDeleteParams, signal?: AbortSignal) => {
|
||||
const response = await axiosInstance.post<IBaseResponse<{ id: number }>>(
|
||||
const response = await axiosInstance.post<IBaseResponse<{ id: string }>>(
|
||||
'/api/v1/mall/admin/banner_delete',
|
||||
params,
|
||||
{ signal }
|
||||
@@ -241,7 +241,7 @@ export const apiAdminRecommendStoreSave = async (
|
||||
params: AdminRecommendStoreSaveParams,
|
||||
signal?: AbortSignal
|
||||
) => {
|
||||
const response = await axiosInstance.post<IBaseResponse<{ id: number; storeId: number }>>(
|
||||
const response = await axiosInstance.post<IBaseResponse<{ id: string; storeId: string }>>(
|
||||
'/api/v1/mall/admin/recommend_store_save',
|
||||
params,
|
||||
{ signal }
|
||||
@@ -269,7 +269,7 @@ export const apiAdminRecommendMerchantSave = async (
|
||||
params: AdminRecommendMerchantSaveParams,
|
||||
signal?: AbortSignal
|
||||
) => {
|
||||
const response = await axiosInstance.post<IBaseResponse<{ id: number; merchantId: string }>>(
|
||||
const response = await axiosInstance.post<IBaseResponse<{ id: string; merchantId: string }>>(
|
||||
'/api/v1/mall/admin/recommend_merchant_save',
|
||||
params,
|
||||
{ signal }
|
||||
@@ -281,7 +281,7 @@ export const apiAdminRecommendMerchantDelete = async (
|
||||
params: AdminRecommendMerchantDeleteParams,
|
||||
signal?: AbortSignal
|
||||
) => {
|
||||
const response = await axiosInstance.post<IBaseResponse<{ id: number }>>(
|
||||
const response = await axiosInstance.post<IBaseResponse<{ id: string }>>(
|
||||
'/api/v1/mall/admin/recommend_merchant_delete',
|
||||
params,
|
||||
{ signal }
|
||||
@@ -309,7 +309,7 @@ export const apiAdminSearchKeywordSave = async (
|
||||
params: AdminSearchKeywordSaveParams,
|
||||
signal?: AbortSignal
|
||||
) => {
|
||||
const response = await axiosInstance.post<IBaseResponse<{ id: number }>>(
|
||||
const response = await axiosInstance.post<IBaseResponse<{ id: string }>>(
|
||||
'/api/v1/mall/admin/search_keyword_save',
|
||||
params,
|
||||
{ signal }
|
||||
@@ -321,7 +321,7 @@ export const apiAdminSearchKeywordDelete = async (
|
||||
params: AdminSearchKeywordDeleteParams,
|
||||
signal?: AbortSignal
|
||||
) => {
|
||||
const response = await axiosInstance.post<IBaseResponse<{ id: number }>>(
|
||||
const response = await axiosInstance.post<IBaseResponse<{ id: string }>>(
|
||||
'/api/v1/mall/admin/search_keyword_delete',
|
||||
params,
|
||||
{ signal }
|
||||
@@ -349,7 +349,7 @@ export const apiAdminHomeChannelSave = async (
|
||||
params: AdminHomeChannelSaveParams,
|
||||
signal?: AbortSignal
|
||||
) => {
|
||||
const response = await axiosInstance.post<IBaseResponse<{ id: number }>>(
|
||||
const response = await axiosInstance.post<IBaseResponse<{ id: string }>>(
|
||||
'/api/v1/mall/admin/home_channel_save',
|
||||
params,
|
||||
{ signal }
|
||||
@@ -361,7 +361,7 @@ export const apiAdminHomeChannelDelete = async (
|
||||
params: AdminHomeChannelDeleteParams,
|
||||
signal?: AbortSignal
|
||||
) => {
|
||||
const response = await axiosInstance.post<IBaseResponse<{ id: number }>>(
|
||||
const response = await axiosInstance.post<IBaseResponse<{ id: string }>>(
|
||||
'/api/v1/mall/admin/home_channel_delete',
|
||||
params,
|
||||
{ signal }
|
||||
@@ -373,7 +373,7 @@ export const apiAdminRecommendStoreDelete = async (
|
||||
params: AdminRecommendStoreDeleteParams,
|
||||
signal?: AbortSignal
|
||||
) => {
|
||||
const response = await axiosInstance.post<IBaseResponse<{ id: number }>>(
|
||||
const response = await axiosInstance.post<IBaseResponse<{ id: string }>>(
|
||||
'/api/v1/mall/admin/recommend_store_delete',
|
||||
params,
|
||||
{ signal }
|
||||
|
||||
@@ -23,14 +23,14 @@ import {
|
||||
} from '@/utils/mall'
|
||||
|
||||
const DEFAULT_STATUS: EnabledStatus = 'enabled'
|
||||
const ROOT_PARENT_ID = 0
|
||||
const ROOT_PARENT_ID = '0'
|
||||
|
||||
interface CategorySearchValues {
|
||||
status?: EnabledStatus | ''
|
||||
}
|
||||
|
||||
interface CategoryFormValues {
|
||||
parentId: number
|
||||
parentId: string
|
||||
categoryName: string
|
||||
categoryIcon?: string
|
||||
sort?: number
|
||||
@@ -39,13 +39,13 @@ interface CategoryFormValues {
|
||||
|
||||
interface ParentTreeNode {
|
||||
title: string
|
||||
value: number
|
||||
value: string
|
||||
disabled?: boolean
|
||||
children: ParentTreeNode[]
|
||||
}
|
||||
|
||||
const collectDisabledParentIds = (node?: AdminCategoryItem | null): Set<number> => {
|
||||
const ids = new Set<number>()
|
||||
const collectDisabledParentIds = (node?: AdminCategoryItem | null): Set<string> => {
|
||||
const ids = new Set<string>()
|
||||
|
||||
const walk = (current?: AdminCategoryItem | null) => {
|
||||
if (!current) {
|
||||
@@ -61,7 +61,7 @@ const collectDisabledParentIds = (node?: AdminCategoryItem | null): Set<number>
|
||||
|
||||
const buildParentTreeChildren = (
|
||||
items: AdminCategoryItem[],
|
||||
disabledIds: Set<number>
|
||||
disabledIds: Set<string>
|
||||
): ParentTreeNode[] =>
|
||||
items.map(item => ({
|
||||
title: `${compactText(item.categoryName)} (ID: ${item.id})`,
|
||||
@@ -70,7 +70,7 @@ const buildParentTreeChildren = (
|
||||
children: buildParentTreeChildren(item.children, disabledIds),
|
||||
}))
|
||||
|
||||
const buildParentTreeData = (items: AdminCategoryItem[], disabledIds: Set<number>): ParentTreeNode[] => [
|
||||
const buildParentTreeData = (items: AdminCategoryItem[], disabledIds: Set<string>): ParentTreeNode[] => [
|
||||
{
|
||||
title: '顶级类目',
|
||||
value: ROOT_PARENT_ID,
|
||||
@@ -171,7 +171,7 @@ export default function CategoryManagementPage() {
|
||||
setSaving(true)
|
||||
const payload: AdminCategorySaveParams = {
|
||||
id: editingRecord?.id,
|
||||
parentId: Number(values.parentId ?? ROOT_PARENT_ID),
|
||||
parentId: values.parentId ?? ROOT_PARENT_ID,
|
||||
categoryName: values.categoryName.trim(),
|
||||
categoryIcon: values.categoryIcon?.trim() || undefined,
|
||||
sort: values.sort ?? 0,
|
||||
@@ -213,7 +213,7 @@ export default function CategoryManagementPage() {
|
||||
title: '父类目 ID',
|
||||
dataIndex: 'parentId',
|
||||
width: 106,
|
||||
render: value => Number(value || 0),
|
||||
render: value => value || ROOT_PARENT_ID,
|
||||
},
|
||||
{
|
||||
title: '层级',
|
||||
|
||||
@@ -63,7 +63,7 @@ const mergeMerchantOptions = (current: MerchantSelectOption[], next: MerchantSel
|
||||
|
||||
export default function GoodsReviewPage() {
|
||||
const [form] = Form.useForm<GoodsSearchValues>()
|
||||
const operatorId = useUserStore(state => state.token?.uid ?? 0)
|
||||
const operatorId = String(useUserStore(state => state.token?.uid ?? ''))
|
||||
const [loading, setLoading] = useState(false)
|
||||
const [auditLoading, setAuditLoading] = useState(false)
|
||||
const [merchantLoading, setMerchantLoading] = useState(false)
|
||||
|
||||
@@ -45,7 +45,7 @@ interface MerchantSearchValues {
|
||||
|
||||
export default function MerchantReviewPage() {
|
||||
const [form] = Form.useForm<MerchantSearchValues>()
|
||||
const operatorId = useUserStore(state => state.token?.uid ?? 0)
|
||||
const operatorId = String(useUserStore(state => state.token?.uid ?? ''))
|
||||
const [loading, setLoading] = useState(false)
|
||||
const [auditLoading, setAuditLoading] = useState(false)
|
||||
const [createLoading, setCreateLoading] = useState(false)
|
||||
@@ -182,7 +182,7 @@ export default function MerchantReviewPage() {
|
||||
try {
|
||||
setAuditLoading(true)
|
||||
await apiAdminMerchantAudit({
|
||||
merchantId: String(selectedRecord.id),
|
||||
merchantId: selectedRecord.id,
|
||||
auditStatus: values.auditStatus,
|
||||
remark: values.remark?.trim() || undefined,
|
||||
operatorId,
|
||||
|
||||
@@ -34,7 +34,7 @@ export default function OrderDetailPage() {
|
||||
const [detail, setDetail] = useState<OrderDetailInfo | null>(null)
|
||||
|
||||
useEffect(() => {
|
||||
const id = Number(orderId)
|
||||
const id = orderId?.trim()
|
||||
if (!id) {
|
||||
toast.error('订单 ID 无效')
|
||||
return
|
||||
|
||||
@@ -45,7 +45,7 @@ const normalizeFilterValues = (values: StoreSearchValues): AdminStorePageParams
|
||||
|
||||
export default function StoreReviewPage() {
|
||||
const [form] = Form.useForm<StoreSearchValues>()
|
||||
const operatorId = useUserStore(state => state.token?.uid ?? 0)
|
||||
const operatorId = String(useUserStore(state => state.token?.uid ?? ''))
|
||||
const [loading, setLoading] = useState(false)
|
||||
const [auditLoading, setAuditLoading] = useState(false)
|
||||
const [list, setList] = useState<StoreInfo[]>([])
|
||||
|
||||
@@ -34,8 +34,8 @@ export interface PageResult<T> {
|
||||
}
|
||||
|
||||
export interface MerchantInfo {
|
||||
id: number
|
||||
uid: number
|
||||
id: string
|
||||
uid: string
|
||||
merchantNo: string
|
||||
merchantName: string
|
||||
status: EnabledStatus
|
||||
@@ -56,7 +56,7 @@ export interface MerchantInfo {
|
||||
}
|
||||
|
||||
export interface StoreInfo {
|
||||
id: number
|
||||
id: string
|
||||
merchantId: string
|
||||
storeNo: string
|
||||
storeName: string
|
||||
@@ -80,10 +80,10 @@ export interface StoreInfo {
|
||||
}
|
||||
|
||||
export interface GoodsSummary {
|
||||
id: number
|
||||
id: string
|
||||
merchantId: string
|
||||
storeId: number
|
||||
categoryId: number
|
||||
storeId: string
|
||||
categoryId: string
|
||||
categoryName?: string
|
||||
spuNo: string
|
||||
spuName: string
|
||||
@@ -105,12 +105,12 @@ export interface GoodsSummary {
|
||||
}
|
||||
|
||||
export interface OrderItemInfo {
|
||||
id: number
|
||||
orderId: number
|
||||
tradeId: number
|
||||
id: string
|
||||
orderId: string
|
||||
tradeId: string
|
||||
orderNo: string
|
||||
spuId: number
|
||||
skuId: number
|
||||
spuId: string
|
||||
skuId: string
|
||||
spuName: string
|
||||
skuName: string
|
||||
coverUrl: string
|
||||
@@ -125,14 +125,14 @@ export interface OrderItemInfo {
|
||||
}
|
||||
|
||||
export interface OrderSummary {
|
||||
id: number
|
||||
tradeId: number
|
||||
id: string
|
||||
tradeId: string
|
||||
tradeNo: string
|
||||
orderNo: string
|
||||
memberId: number
|
||||
uid?: number
|
||||
memberId: string
|
||||
uid?: string
|
||||
merchantId: string
|
||||
storeId: number
|
||||
storeId: string
|
||||
merchantName?: string
|
||||
storeName: string
|
||||
orderStatus: OrderStatus
|
||||
@@ -151,14 +151,14 @@ export interface OrderSummary {
|
||||
}
|
||||
|
||||
export interface OrderDetailInfo {
|
||||
id: number
|
||||
tradeId: number
|
||||
id: string
|
||||
tradeId: string
|
||||
tradeNo: string
|
||||
orderNo: string
|
||||
memberId: number
|
||||
uid?: number
|
||||
memberId: string
|
||||
uid?: string
|
||||
merchantId: string
|
||||
storeId: number
|
||||
storeId: string
|
||||
merchantName?: string
|
||||
storeName: string
|
||||
orderStatus: OrderStatus
|
||||
@@ -219,7 +219,7 @@ export interface AdminMerchantAuditParams {
|
||||
merchantId: string
|
||||
auditStatus: Extract<AuditStatus, 'approved' | 'rejected'>
|
||||
remark?: string
|
||||
operatorId: number
|
||||
operatorId: string
|
||||
}
|
||||
|
||||
export interface AdminStorePageParams {
|
||||
@@ -232,15 +232,15 @@ export interface AdminStorePageParams {
|
||||
}
|
||||
|
||||
export interface AdminStoreAuditParams {
|
||||
storeId: number
|
||||
storeId: string
|
||||
auditStatus: Extract<AuditStatus, 'approved' | 'rejected'>
|
||||
remark?: string
|
||||
operatorId: number
|
||||
operatorId: string
|
||||
}
|
||||
|
||||
export interface AdminGoodsPageParams {
|
||||
merchantId?: string
|
||||
storeId?: number
|
||||
storeId?: string
|
||||
keyword?: string
|
||||
auditStatus?: AuditStatus
|
||||
saleStatus?: SaleStatus
|
||||
@@ -249,15 +249,15 @@ export interface AdminGoodsPageParams {
|
||||
}
|
||||
|
||||
export interface AdminGoodsAuditParams {
|
||||
spuId: number
|
||||
spuId: string
|
||||
auditStatus: Extract<AuditStatus, 'approved' | 'rejected'>
|
||||
remark?: string
|
||||
operatorId: number
|
||||
operatorId: string
|
||||
}
|
||||
|
||||
export interface AdminOrderPageParams {
|
||||
merchantId?: string
|
||||
storeId?: number
|
||||
storeId?: string
|
||||
tradeNo?: string
|
||||
orderNo?: string
|
||||
orderStatus?: OrderStatus
|
||||
@@ -267,12 +267,12 @@ export interface AdminOrderPageParams {
|
||||
}
|
||||
|
||||
export interface AdminOrderDetailParams {
|
||||
orderId: number
|
||||
orderId: string
|
||||
}
|
||||
|
||||
export interface AdminCategoryItem {
|
||||
id: number
|
||||
parentId: number
|
||||
id: string
|
||||
parentId: string
|
||||
categoryName: string
|
||||
categoryLevel: number
|
||||
categoryPath: string
|
||||
@@ -291,8 +291,8 @@ export interface AdminCategoryTreeParams {
|
||||
}
|
||||
|
||||
export interface AdminCategorySaveParams {
|
||||
id?: number
|
||||
parentId?: number
|
||||
id?: string
|
||||
parentId?: string
|
||||
categoryName: string
|
||||
categoryIcon?: string
|
||||
sort?: number
|
||||
@@ -300,13 +300,13 @@ export interface AdminCategorySaveParams {
|
||||
}
|
||||
|
||||
export interface AdminCategoryDeleteParams {
|
||||
id: number
|
||||
id: string
|
||||
}
|
||||
|
||||
export interface AdminRecommendStoreItem {
|
||||
id: number
|
||||
id: string
|
||||
positionCode: RecommendStorePositionCode
|
||||
storeId: number
|
||||
storeId: string
|
||||
merchantId: string
|
||||
storeName: string
|
||||
storeLogo: string
|
||||
@@ -334,9 +334,9 @@ export interface AdminRecommendStorePageParams {
|
||||
}
|
||||
|
||||
export interface AdminRecommendStoreSaveParams {
|
||||
id?: number
|
||||
id?: string
|
||||
positionCode: RecommendStorePositionCode
|
||||
storeId: number
|
||||
storeId: string
|
||||
mainCategoryName?: string
|
||||
recommendReason?: string
|
||||
rankScore?: number
|
||||
@@ -347,11 +347,11 @@ export interface AdminRecommendStoreSaveParams {
|
||||
}
|
||||
|
||||
export interface AdminRecommendStoreDeleteParams {
|
||||
id: number
|
||||
id: string
|
||||
}
|
||||
|
||||
export interface AdminBannerItem {
|
||||
id: number
|
||||
id: string
|
||||
title: string
|
||||
subTitle: string
|
||||
description: string
|
||||
@@ -377,7 +377,7 @@ export interface AdminBannerPageParams {
|
||||
}
|
||||
|
||||
export interface AdminBannerSaveParams {
|
||||
id?: number
|
||||
id?: string
|
||||
title: string
|
||||
subTitle?: string
|
||||
description?: string
|
||||
@@ -393,11 +393,11 @@ export interface AdminBannerSaveParams {
|
||||
}
|
||||
|
||||
export interface AdminBannerDeleteParams {
|
||||
id: number
|
||||
id: string
|
||||
}
|
||||
|
||||
export interface AdminRecommendMerchantItem {
|
||||
id: number
|
||||
id: string
|
||||
positionCode: RecommendMerchantPositionCode
|
||||
merchantId: string
|
||||
merchantName: string
|
||||
@@ -426,7 +426,7 @@ export interface AdminRecommendMerchantPageParams {
|
||||
}
|
||||
|
||||
export interface AdminRecommendMerchantSaveParams {
|
||||
id?: number
|
||||
id?: string
|
||||
positionCode: RecommendMerchantPositionCode
|
||||
merchantId: string
|
||||
mainCategoryName?: string
|
||||
@@ -439,11 +439,11 @@ export interface AdminRecommendMerchantSaveParams {
|
||||
}
|
||||
|
||||
export interface AdminRecommendMerchantDeleteParams {
|
||||
id: number
|
||||
id: string
|
||||
}
|
||||
|
||||
export interface AdminSearchKeywordItem {
|
||||
id: number
|
||||
id: string
|
||||
keyword: string
|
||||
sort: number
|
||||
status: EnabledStatus
|
||||
@@ -461,7 +461,7 @@ export interface AdminSearchKeywordPageParams {
|
||||
}
|
||||
|
||||
export interface AdminSearchKeywordSaveParams {
|
||||
id?: number
|
||||
id?: string
|
||||
keyword: string
|
||||
sort?: number
|
||||
status?: EnabledStatus
|
||||
@@ -470,11 +470,11 @@ export interface AdminSearchKeywordSaveParams {
|
||||
}
|
||||
|
||||
export interface AdminSearchKeywordDeleteParams {
|
||||
id: number
|
||||
id: string
|
||||
}
|
||||
|
||||
export interface AdminHomeChannelItem {
|
||||
id: number
|
||||
id: string
|
||||
title: string
|
||||
subTitle: string
|
||||
iconUrl: string
|
||||
@@ -496,7 +496,7 @@ export interface AdminHomeChannelPageParams {
|
||||
}
|
||||
|
||||
export interface AdminHomeChannelSaveParams {
|
||||
id?: number
|
||||
id?: string
|
||||
title: string
|
||||
subTitle?: string
|
||||
iconUrl?: string
|
||||
@@ -509,5 +509,5 @@ export interface AdminHomeChannelSaveParams {
|
||||
}
|
||||
|
||||
export interface AdminHomeChannelDeleteParams {
|
||||
id: number
|
||||
id: string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user