feat(distribution): 实现分销员中心完整功能

- 新增分销业绩统计页面,包含时间范围筛选和自定义日期选择功能
- 重构分销认证页面,改为跳转至招募页面申请分销员身份
- 添加分销商品访问记录功能,支持分享追踪和佣金计算
- 更新分销历史记录页面,优化数据结构和显示字段
- 完全重写分销员首页,包含用户信息、收益统计、等级系统等功能
This commit is contained in:
pikachu1995@126.com
2026-08-05 18:07:27 +08:00
parent 6754a54f1b
commit 7d3daf2f02
34 changed files with 10053 additions and 2530 deletions

View File

@@ -528,6 +528,48 @@ export function serviceStatusList (val) {
return statusList[val];
}
/**
* 格式化商品规格展示(兼容 SKU JSON 与纯文本)
*/
export function formatGoodsSpecs(specs) {
if (specs === null || specs === undefined) {
return '默认'
}
const trimmed = String(specs).trim()
if (!trimmed) {
return '默认'
}
if (!trimmed.startsWith('{') && !trimmed.startsWith('[')) {
return trimmed
}
try {
const data = JSON.parse(trimmed)
if (!data || typeof data !== 'object' || Array.isArray(data)) {
return trimmed
}
const parts = []
Object.keys(data).forEach((key) => {
if (key === 'images') {
return
}
const value = data[key]
if (value === null || value === undefined || value === '') {
return
}
if (typeof value === 'object') {
return
}
const text = String(value).trim()
if (text) {
parts.push(text)
}
})
return parts.length ? parts.join(' ') : '默认'
} catch (e) {
return '默认'
}
}
/**
* 订单状态列表
*/