feat: 商家端代码

This commit is contained in:
FlowerWater
2025-12-19 12:04:22 +08:00
parent 3c21b074c4
commit 9591234e70
22 changed files with 4776 additions and 210 deletions

View File

@@ -0,0 +1,92 @@
/**
* 商户端财务数据 Mock
*/
import type {
FinanceOverview,
Transaction,
Settlement,
WithdrawRecord,
} from '@/typings/merchant'
import {
TransactionType,
SettlementStatus,
WithdrawStatus,
} from '@/typings/merchant'
export const mockFinanceOverview: FinanceOverview = {
balance: 125680.50,
pendingSettlement: 23500.00,
monthIncome: 89600.00,
totalIncome: 568900.00,
}
export const mockTransactions: Transaction[] = [
{
id: '1',
type: TransactionType.INCOME,
amount: 2999.00,
balance: 125680.50,
orderNo: 'M202312170001',
remark: '订单收入',
createTime: '2024-12-17 10:31:00',
},
{
id: '2',
type: TransactionType.WITHDRAW,
amount: -5000.00,
balance: 122681.50,
remark: '提现到银行卡',
createTime: '2024-12-16 15:00:00',
},
{
id: '3',
type: TransactionType.INCOME,
amount: 1590.00,
balance: 127681.50,
orderNo: 'M202312170002',
remark: '订单收入',
createTime: '2024-12-17 09:46:00',
},
]
export const mockSettlements: Settlement[] = [
{
id: '1',
settlementNo: 'S202312150001',
amount: 35680.00,
orderCount: 128,
status: SettlementStatus.SETTLED,
period: '2024-12-01 ~ 2024-12-15',
settledTime: '2024-12-16 10:00:00',
createTime: '2024-12-15 23:59:59',
},
{
id: '2',
settlementNo: 'S202312310001',
amount: 23500.00,
orderCount: 86,
status: SettlementStatus.PENDING,
period: '2024-12-16 ~ 2024-12-31',
createTime: '2024-12-17 00:00:00',
},
]
export const mockWithdrawRecords: WithdrawRecord[] = [
{
id: '1',
amount: 5000.00,
bankName: '中国工商银行',
bankAccount: '**** **** **** 1234',
status: WithdrawStatus.COMPLETED,
applyTime: '2024-12-15 10:00:00',
completeTime: '2024-12-16 15:00:00',
},
{
id: '2',
amount: 10000.00,
bankName: '中国建设银行',
bankAccount: '**** **** **** 5678',
status: WithdrawStatus.PENDING,
applyTime: '2024-12-17 09:00:00',
},
]

View File

@@ -0,0 +1,82 @@
/**
* 商户端商品数据 Mock
*/
import type { MerchantGoods } from '@/typings/merchant'
import { GoodsStatus } from '@/typings/merchant'
export const mockMerchantGoods: MerchantGoods[] = [
{
id: '1',
name: '苹果 iPhone 15 Pro',
categoryId: '1',
categoryName: '手机',
brand: 'Apple',
price: 8999.00,
costPrice: 7500.00,
stock: 50,
sales: 128,
status: GoodsStatus.ON,
images: ['/static/goods/iphone15.jpg'],
description: '全新 iPhone 15 Pro搭载 A17 Pro 芯片',
specs: [
{ name: '颜色', values: ['黑色', '白色', '蓝色'] },
{ name: '存储', values: ['128GB', '256GB', '512GB'] },
],
skuList: [
{ id: 'sku1', specs: { '颜色': '黑色', '存储': '128GB' }, price: 7999, stock: 20, image: '' },
{ id: 'sku2', specs: { '颜色': '黑色', '存储': '256GB' }, price: 8999, stock: 15, image: '' },
{ id: 'sku3', specs: { '颜色': '白色', '存储': '128GB' }, price: 7999, stock: 10, image: '' },
{ id: 'sku4', specs: { '颜色': '白色', '存储': '256GB' }, price: 8999, stock: 5, image: '' },
],
createTime: '2024-12-01 10:00:00',
updateTime: '2024-12-17 10:00:00',
},
{
id: '2',
name: '华为 Mate 60 Pro',
categoryId: '1',
categoryName: '手机',
brand: 'HUAWEI',
price: 6999.00,
costPrice: 5800.00,
stock: 30,
sales: 86,
status: GoodsStatus.ON,
images: ['/static/goods/mate60.jpg'],
description: '华为 Mate 60 Pro搭载麒麟 9000S 芯片',
createTime: '2024-12-02 10:00:00',
updateTime: '2024-12-17 10:00:00',
},
{
id: '3',
name: '小米 14 Ultra',
categoryId: '1',
categoryName: '手机',
brand: 'Xiaomi',
price: 5999.00,
costPrice: 4800.00,
stock: 0,
sales: 56,
status: GoodsStatus.SOLD_OUT,
images: ['/static/goods/mi14.jpg'],
description: '小米 14 Ultra徕卡影像旗舰',
createTime: '2024-12-03 10:00:00',
updateTime: '2024-12-17 10:00:00',
},
{
id: '4',
name: 'AirPods Pro 2',
categoryId: '2',
categoryName: '耳机',
brand: 'Apple',
price: 1899.00,
costPrice: 1500.00,
stock: 100,
sales: 256,
status: GoodsStatus.ON,
images: ['/static/goods/airpods.jpg'],
description: 'AirPods Pro 第二代,主动降噪',
createTime: '2024-12-04 10:00:00',
updateTime: '2024-12-17 10:00:00',
},
]

View File

@@ -0,0 +1,8 @@
/**
* 商户端 Mock 数据统一导出
*/
export * from './stats'
export * from './order'
export * from './goods'
export * from './finance'
export * from './shop'

View File

@@ -0,0 +1,150 @@
/**
* 商户端订单数据 Mock
*/
import type { MerchantOrder } from '@/typings/merchant'
import { OrderStatus } from '@/typings/merchant'
export const mockMerchantOrders: MerchantOrder[] = [
{
id: '1',
orderNo: 'M202312170001',
customerName: '张三',
customerPhone: '138****8000',
status: OrderStatus.PENDING,
amount: 2999.00,
freight: 0,
payAmount: 2999.00,
remark: '请尽快发货',
goods: [
{
id: 'g1',
goodsId: '101',
name: '苹果 iPhone 15 Pro 256GB',
image: '/static/goods/iphone15.jpg',
skuName: '黑色 256GB',
price: 2999.00,
quantity: 1,
amount: 2999.00,
},
],
address: {
name: '张三',
phone: '13800138000',
province: '广东省',
city: '广州市',
district: '天河区',
detail: '体育西路123号',
},
createTime: '2024-12-17 10:30:00',
payTime: '2024-12-17 10:31:00',
},
{
id: '2',
orderNo: 'M202312170002',
customerName: '李四',
customerPhone: '139****9000',
status: OrderStatus.SHIPPING,
amount: 1580.00,
freight: 10,
payAmount: 1590.00,
goods: [
{
id: 'g2',
goodsId: '102',
name: '华为 Mate 60 Pro',
image: '/static/goods/mate60.jpg',
skuName: '白色 512GB',
price: 1580.00,
quantity: 1,
amount: 1580.00,
},
],
address: {
name: '李四',
phone: '13900139000',
province: '广东省',
city: '深圳市',
district: '南山区',
detail: '科技园南路456号',
},
createTime: '2024-12-17 09:45:00',
payTime: '2024-12-17 09:46:00',
},
{
id: '3',
orderNo: 'M202312170003',
customerName: '王五',
customerPhone: '137****7000',
status: OrderStatus.SHIPPED,
amount: 456.50,
freight: 0,
payAmount: 456.50,
goods: [
{
id: 'g3',
goodsId: '103',
name: '小米 14 Ultra',
image: '/static/goods/mi14.jpg',
skuName: '黑色 256GB',
price: 456.50,
quantity: 1,
amount: 456.50,
},
],
address: {
name: '王五',
phone: '13700137000',
province: '广东省',
city: '佛山市',
district: '禅城区',
detail: '祖庙路789号',
},
logistics: {
company: '顺丰速运',
trackingNo: 'SF1234567890',
status: '运输中',
traces: [
{ time: '2024-12-17 14:00:00', content: '快件已到达【广州转运中心】' },
{ time: '2024-12-17 10:00:00', content: '快件已从【深圳宝安区】发出' },
{ time: '2024-12-17 08:20:00', content: '快件已揽收' },
],
},
createTime: '2024-12-17 08:20:00',
payTime: '2024-12-17 08:21:00',
shipTime: '2024-12-17 08:30:00',
},
{
id: '4',
orderNo: 'M202312170004',
customerName: '赵六',
customerPhone: '136****6000',
status: OrderStatus.COMPLETED,
amount: 888.00,
freight: 0,
payAmount: 888.00,
goods: [
{
id: 'g4',
goodsId: '104',
name: 'AirPods Pro 2',
image: '/static/goods/airpods.jpg',
skuName: '默认',
price: 888.00,
quantity: 1,
amount: 888.00,
},
],
address: {
name: '赵六',
phone: '13600136000',
province: '广东省',
city: '东莞市',
district: '南城区',
detail: '宏图路100号',
},
createTime: '2024-12-16 15:00:00',
payTime: '2024-12-16 15:01:00',
shipTime: '2024-12-16 16:00:00',
completeTime: '2024-12-17 10:00:00',
},
]

View File

@@ -0,0 +1,14 @@
/**
* 商户端店铺数据 Mock
*/
import type { ShopInfo } from '@/typings/merchant'
export const mockShopInfo: ShopInfo = {
id: 'shop_001',
name: '数字广东旗舰店',
logo: '/static/images/shop-logo.jpg',
phone: '020-12345678',
address: '广东省广州市天河区体育西路123号',
businessHours: '09:00 - 22:00',
description: '专注数码产品销售,正品保障',
}

View File

@@ -0,0 +1,13 @@
/**
* 商户端统计数据 Mock
*/
import type { MerchantStats } from '@/typings/merchant'
export const mockMerchantStats: MerchantStats = {
todayOrders: 128,
pendingOrders: 23,
todaySales: 15680.50,
totalGoods: 356,
lowStockGoods: 12,
pendingSettlement: 8560.00,
}