refactor: 品牌 IDE 切换为 BCD,并补齐微信 OpenID 迁移与定价工作台
All checks were successful
Build and Deploy Front / deploy (push) Successful in 4m6s
All checks were successful
Build and Deploy Front / deploy (push) Successful in 4m6s
用户可见文案与运单/工号示例改为 BCD;登录/注册支持换公众号昵称+手机号迁移 OpenID;定价工作台页面随路由一并合入。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
47f67e5aec
commit
19ccc085d8
@ -5,6 +5,8 @@
|
||||
"ComponentPublicInstance": true,
|
||||
"ComputedRef": true,
|
||||
"DirectiveBinding": true,
|
||||
"EdiAdvisorOpenOptions": true,
|
||||
"EdiBatchOpenOptions": true,
|
||||
"EffectScope": true,
|
||||
"ExtractDefaultPropTypes": true,
|
||||
"ExtractPropTypes": true,
|
||||
@ -16,7 +18,9 @@
|
||||
"McpCapabilityGuide": true,
|
||||
"McpCapabilityId": true,
|
||||
"McpFieldHint": true,
|
||||
"NanaBatchOpenOptions": true,
|
||||
"OpsGuideContext": true,
|
||||
"OpsGuideModule": true,
|
||||
"OpsGuideModuleId": true,
|
||||
"PriceAskContext": true,
|
||||
"PriceAskIntent": true,
|
||||
"PropType": true,
|
||||
@ -34,6 +38,7 @@
|
||||
"asyncComputed": true,
|
||||
"autoResetRef": true,
|
||||
"buildAskAdvisorQuery": true,
|
||||
"buildOpsGuideContext": true,
|
||||
"buildPriceAskPrefill": true,
|
||||
"buildWaybillContextFromRow": true,
|
||||
"computed": true,
|
||||
@ -80,6 +85,7 @@
|
||||
"isReactive": true,
|
||||
"isReadonly": true,
|
||||
"isRef": true,
|
||||
"listOpsGuideModules": true,
|
||||
"makeDestructurable": true,
|
||||
"mapActions": true,
|
||||
"mapGetters": true,
|
||||
@ -205,6 +211,8 @@
|
||||
"useDocumentVisibility": true,
|
||||
"useDraggable": true,
|
||||
"useDropZone": true,
|
||||
"useEdiAdvisorPanel": true,
|
||||
"useEdiBatchPanel": true,
|
||||
"useElementBounding": true,
|
||||
"useElementByPoint": true,
|
||||
"useElementHover": true,
|
||||
@ -251,7 +259,6 @@
|
||||
"useMouseInElement": true,
|
||||
"useMousePressed": true,
|
||||
"useMutationObserver": true,
|
||||
"useNanaBatchPanel": true,
|
||||
"useNavigatorLanguage": true,
|
||||
"useNetwork": true,
|
||||
"useNow": true,
|
||||
|
||||
17
README.md
17
README.md
@ -94,6 +94,23 @@ npm run build
|
||||
npm run lint
|
||||
```
|
||||
|
||||
### 页面路由与 Vite 代理(硬刷新 / 直链)
|
||||
|
||||
部分模块的**页面 path** 与后端 API 共用同一代理前缀(如 `/channel`、`/marketing`、`/finance`)。开发模式下地址栏回车、F5、外链直开时,请求会先走 Vite `server.proxy`;若未把 SPA 路径 bypass 掉,会打到后端并得到空白页 / 404。
|
||||
|
||||
新增与 API 同前缀的前端页面时,必须同步改 `vite.config.ts`:
|
||||
|
||||
1. **对应前缀的 `proxy.*.bypass` 白名单**(如 `/channel` 的 `channelSpaPrefixes`)加入页面 path,返回 `'/index.html'`
|
||||
2. **插件 `exclude-frontend-routes-from-proxy` 的 `frontendRoutes`(或 `frontendRoutesExact`)** 同样加入该 path
|
||||
|
||||
约定:
|
||||
|
||||
- 页面 path 用**驼峰**(如 `/channel/pricingWorkbench`)
|
||||
- 后端 API 尽量用 **kebab-case**(如 `/channel/pricing-workbench/preview`),避免与 SPA 前缀冲突
|
||||
- 改完 `vite.config.ts` 后需**重启** `pnpm dev` 才生效
|
||||
|
||||
渠道现有 SPA bypass 示例:`salesProducts`、`serviceChannels`、`pricingWorkbench`、`guide` 等(完整列表见 `vite.config.ts`)。
|
||||
|
||||
## 部署说明
|
||||
|
||||
1. 安装依赖 `pnpm i`
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# IDE 跨境物流 · 2 个月获客方案(务实版)
|
||||
# BCD 跨境物流 · 2 个月获客方案(务实版)
|
||||
|
||||
> 基于现有 OMS:**渠道代理门户**(专属链接/海报、名下客户与运单、预估→待结算→已打款返佣)+ **会员/优惠券/C2C 裂变**。
|
||||
> 只写能马上干、系统已支持或运营线下能补齐的事;砍掉未上线能力(代理推代理终身分成、系统内提现、设备指纹四重防刷、毛利自动算销售提成等)。
|
||||
|
||||
@ -1902,7 +1902,7 @@ JWT → mapId(user.userid INT)
|
||||
"requestId": "string", // 幂等键 t_order.RequestId//可选;重复则直接返回已有订单结果
|
||||
"clientNo": "string", // 客户单号 t_order.ClientNo//可选
|
||||
"trackNo": "string", // 跟踪号 t_order.TrackNo//可选
|
||||
"serviceNo": "string", // 运单号 t_order.ServiceNo//可选;未传时服务端自动生成(IDE 前缀)
|
||||
"serviceNo": "string", // 运单号 t_order.ServiceNo//可选;未传时服务端自动生成(BCD 前缀)
|
||||
"productCode": "string", // 产品代码 t_order.ProductCode//必填
|
||||
"channelCode": "string", // 渠道代码 t_order.ChannelCode
|
||||
"cargoAttribute": "string", // 货物属性 t_order.CargoAttribute:general-普货,electronics-3c&带电,sensitive-敏感货//必填
|
||||
@ -2059,7 +2059,7 @@ JWT → mapId(user.userid INT)
|
||||
- 命中处理:**不创建订单**,直接返回失败(错误信息需明确「收件地址命中黑名单区域」),不进入草稿落库及后续流程。
|
||||
|
||||
5. 创建订单草稿
|
||||
- **`ServiceNo`**:请求体 `serviceNo` 为空时,服务端自动生成唯一运单号(**`IDE` + `yyMMddHHmmss` + 4 位随机数**,年份取后两位如 2026→26);`trackNo` 为空则落库 `NULL`。
|
||||
- **`ServiceNo`**:请求体 `serviceNo` 为空时,服务端自动生成唯一运单号(**`BCD` + `yyMMddHHmmss` + 4 位随机数**,年份取后两位如 2026→26);`trackNo` 为空则落库 `NULL`。
|
||||
- 插入 `t_order`:
|
||||
- 写入字段:`ServiceNo`、`ClientNo`、`TrackNo`、`ProductCode`、`ChannelCode`、`ConsigneeCountry`、`CargoAttribute`、`ExportCustomsMode`、`OrderStatus`、`WarehouseId`、`CustomerId`、`IsCod`、`CodCurrency`、`CodSum`、`IsIntercept`、`IsRemote`、`PredeclareFailReason`、`SalesProductRulesVersion`、`SalesProductPriceVersion`、审计字段。
|
||||
- 处理规则:
|
||||
@ -2184,7 +2184,7 @@ JWT → mapId(user.userid INT)
|
||||
| 会话客户 | `ResolveEffectiveCustomerAsync` → 写 `input.CustomerId = sessionCustomer.Id` |
|
||||
| 必填校验 | 另含 **`declaredCurrency`、`quantity`(>0)**、申报明细 **`enName/unitPrice/unitWeight/quantity`**;**`clientNo` 非必填** |
|
||||
| `channelCode` | 未传时默认 **`product.ProductCode`** |
|
||||
| `serviceNo` | 自定义时查重,冲突 → **「运单号已存在」**;否则 **`IDE{yyMMddHHmmss}{4位随机}`** |
|
||||
| `serviceNo` | 自定义时查重,冲突 → **「运单号已存在」**;否则 **`BCD{yyMMddHHmmss}{4位随机}`** |
|
||||
| 快照 | 见 **§4.3.5**(DB 发布 + Live 降级,**无 Redis**) |
|
||||
| 应付/排货 | **创建时不执行**;入库时 **TryConfirm**(失败 → `pendingAllocation`) |
|
||||
| 成功 | `OrderStatus=predeclared`;清空 `AllocationPendingReason`;触发系统面单生成写入 **`t_order_file.systemLabel`**;响应 **`labelUrl`** 读文件表(未就绪可为空) |
|
||||
@ -6751,7 +6751,7 @@ ValidateParcelCreateInputAsync
|
||||
|
||||
```json
|
||||
{
|
||||
"waybillNo": "IDE2607221859123456",
|
||||
"waybillNo": "BCD2607221859123456",
|
||||
"weight": 2.5,
|
||||
"length": 20,
|
||||
"width": 15,
|
||||
@ -6772,7 +6772,7 @@ ValidateParcelCreateInputAsync
|
||||
"msg": "success",
|
||||
"data": {
|
||||
"id": 1,
|
||||
"waybillNo": "IDE2607221859123456",
|
||||
"waybillNo": "BCD2607221859123456",
|
||||
"weight": 2.5,
|
||||
"length": 20,
|
||||
"width": 15,
|
||||
@ -6828,7 +6828,7 @@ ValidateParcelCreateInputAsync
|
||||
"items": [
|
||||
{
|
||||
"id": 1,
|
||||
"waybillNo": "IDE2607221859123456",
|
||||
"waybillNo": "BCD2607221859123456",
|
||||
"weight": 2.5,
|
||||
"length": 20,
|
||||
"width": 15,
|
||||
@ -6873,7 +6873,7 @@ ValidateParcelCreateInputAsync
|
||||
|
||||
```json
|
||||
{
|
||||
"waybillNo": "IDE2607221859123456",
|
||||
"waybillNo": "BCD2607221859123456",
|
||||
"weight": 2.5,
|
||||
"length": 20,
|
||||
"width": 15,
|
||||
@ -6895,7 +6895,7 @@ ValidateParcelCreateInputAsync
|
||||
"msg": "success",
|
||||
"data": {
|
||||
"id": 1,
|
||||
"waybillNo": "IDE2607221859123456",
|
||||
"waybillNo": "BCD2607221859123456",
|
||||
"weight": 2.5,
|
||||
"length": 20,
|
||||
"width": 15,
|
||||
@ -6958,7 +6958,7 @@ ValidateParcelCreateInputAsync
|
||||
"items": [
|
||||
{
|
||||
"id": 1,
|
||||
"waybillNo": "IDE2607221859123456",
|
||||
"waybillNo": "BCD2607221859123456",
|
||||
"weight": 2.5,
|
||||
"length": 20,
|
||||
"width": 15,
|
||||
@ -7008,7 +7008,7 @@ ValidateParcelCreateInputAsync
|
||||
|
||||
```json
|
||||
{
|
||||
"number": "IDE2607221859123456",
|
||||
"number": "BCD2607221859123456",
|
||||
"numberType": "waybill",
|
||||
"labelTemplateId": 1
|
||||
}
|
||||
@ -7024,7 +7024,7 @@ ValidateParcelCreateInputAsync
|
||||
"msg": "success",
|
||||
"data": {
|
||||
"id": 1,
|
||||
"waybillNo": "IDE2607221859123456",
|
||||
"waybillNo": "BCD2607221859123456",
|
||||
"customerOrderNo": "",
|
||||
"trackingNo": "",
|
||||
"otherNumber": "",
|
||||
@ -7068,7 +7068,7 @@ ValidateParcelCreateInputAsync
|
||||
"items": [
|
||||
{
|
||||
"id": 1,
|
||||
"waybillNo": "IDE2607221859123456",
|
||||
"waybillNo": "BCD2607221859123456",
|
||||
"customerOrderNo": "CUST001",
|
||||
"trackingNo": "TRK001",
|
||||
"otherNumber": "",
|
||||
@ -8506,7 +8506,7 @@ GET /customer/account-flow/list?page=1&pageSize=50&bizType=orderPay&startTime=20
|
||||
| 迭代日期 | 迭代编号 | 迭代功能 | 变更模块 | 备注 |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| 2026-07-28 | 20260728-01 | 订单附件表 + 系统面单落文件表 | 订单 §1.5.4、§2.3、§4.1、§4.2.1、**§4.2.12**、§4.4.1、§4.4.1.8、§4.4.1.12、§4.4.1.17、§4.4.3.1、§10.6.1 | `t_order_file`;废弃订单 `LabelUrl`/`LabelGenerate*`;客户只读 systemLabel;下游 labelUrl→downstreamLabel |
|
||||
| 2026-07-22 | 20260722-01 | 查价/下单/入库/出库链路加固;待排货;运单号 IDE | 订单 §2.3、§4.3.5、§4.4.2.1、§4.4.3.1、§6.3;附录 §10.3.1;新手指引 `/order/guide` | 查价可选尺寸+参考价;创建仅 forecast 应收;入库可选排货→`pendingAllocation`;运单号 `IDE{yyMMddHHmmss}{4位随机}` |
|
||||
| 2026-07-22 | 20260722-01 | 查价/下单/入库/出库链路加固;待排货;运单号 BCD | 订单 §2.3、§4.3.5、§4.4.2.1、§4.4.3.1、§6.3;附录 §10.3.1;新手指引 `/order/guide` | 查价可选尺寸+参考价;创建仅 forecast 应收;入库可选排货→`pendingAllocation`;运单号 `BCD{yyMMddHHmmss}{4位随机}` |
|
||||
| 2026-07-19 | 20260719-01 | 店铺订单创建物流 / 物流&代发 | 订单 §4.1、§2.3、§4.2.11、**§4.4.7**;附录权限 | 校对弹窗;`batch-create-logistics` / `batch-create-fulfill`;与匹配库存分流 |
|
||||
| 2026-07-15 | 20260715-01 | 客户发件地址 + 揽收订单 | 订单 §4.1、§4.2.1、§4.2.10、§4.4.1.1、§4.4.4、§4.4.5;附录 §10.3.9 | 地址簿 `t_customer_sender_address`;`OrderSource=pickup` 复用小包创建;菜单客户/订单 |
|
||||
| 2026-07-04 | 20260704-01 | 创建问题件 / 创建理赔件 | 订单 §4.2.1、§4.2.9、§4.4.1.13~§4.4.1.16;渠道 §5.3.0.7;附录 §10.3.6~§10.3.8 | 问题模板消费;`t_order_exception_event`;权限 `Order.Problematic.Create` 等 |
|
||||
|
||||
44
docs/定价工作台说明.md
Normal file
44
docs/定价工作台说明.md
Normal file
@ -0,0 +1,44 @@
|
||||
# 定价工作台说明
|
||||
|
||||
路由:`/channel/pricingWorkbench`
|
||||
权限资源:`Channel.PricingWorkbench`(Query / Preview / Apply / AiAssist)
|
||||
|
||||
## 标准操作顺序
|
||||
|
||||
1. **选渠道**:多选服务渠道买价(优先已发布快照;无快照则读草稿并警告)。摘要默认折叠;币种不一致会提示并禁用预览。
|
||||
2. **定规则**:毛利率、差异阈值、排除渠道;可选「对比现网卖价」与「改规则后自动重算」。
|
||||
3. **预览合成**:对齐分区/重量段,最低买价合成,毛利率硬计算。改规则后结果标过期,可一键重算;超阈值差异可「用 AI 解释」。
|
||||
4. **回写草稿**:有效预览后展开目标销售产品 / 价格项 / 客户组;成功后可跳转销售产品发布。
|
||||
|
||||
成本合成:每个「分区 × 重量段」取参与渠道中的**最低买价**。
|
||||
毛利率硬计算:`sell = ceil(buy / (1 - m), 分)`;禁止以 AI 填数当唯一真相。
|
||||
|
||||
## 与发布 / 审批衔接
|
||||
|
||||
| 步骤 | 位置 | 说明 |
|
||||
|------|------|------|
|
||||
| 生成草稿 | 定价工作台 → 回写草稿 | `POST /channel/pricing-workbench/apply`,`Publish=false` |
|
||||
| AI 风险分析 | 销售产品 → 价格发布 | 沿用 `PricePublishAiAssistDrawer` / 发布风险 skill |
|
||||
| 发布审批 | 销售产品现有流程 | `Channel.SalesProduct.PublishPrice` 审批定义 |
|
||||
|
||||
工作台 AI 默认收起;负责调毛利/排除渠道后触发同一套 preview 硬计算,以及解释相对现网卖价超阈值差异。正式出账仍以销售产品发布快照为准。
|
||||
|
||||
## 差异闸门
|
||||
|
||||
预览入参 `diffThreshold`(默认 15%):相对现网卖价 `|Δ|` 超过阈值的格进入 `diffRisks`。需在规则区选择「对比现网卖价」销售产品后,差异列表才有数据。
|
||||
|
||||
## 审计
|
||||
|
||||
`apply` 成功时写结构化日志:操作人、销售产品、价格项、渠道列表、毛利率、明细行数、可选 `analysisNote`。响应体带 `audit` 字段便于前端展示。
|
||||
|
||||
## 首期非目标
|
||||
|
||||
- 自动发布卖价、自动改排货分配
|
||||
- 跨币种汇兑(币种不一致直接阻断)
|
||||
- 用 AI 替代计费引擎出账
|
||||
|
||||
## API
|
||||
|
||||
- `GET /channel/pricing-workbench/channel-summaries?serviceChannelIds=1,2`
|
||||
- `POST /channel/pricing-workbench/preview`
|
||||
- `POST /channel/pricing-workbench/apply`
|
||||
14
index.html
14
index.html
@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<script>
|
||||
/* 首屏前判定 H5/语言,避免 body 绘出后再改「IDE」→「IDE客户中心」造成字号/布局抖 */
|
||||
/* 首屏前判定 H5/语言,避免 body 绘出后再改「BCD」→「BCD客户中心」造成字号/布局抖 */
|
||||
(function () {
|
||||
var path = location.pathname || '';
|
||||
var search = location.search || '';
|
||||
@ -80,13 +80,13 @@
|
||||
/* 运营端 /h5/admin 勿复用客户中心标题,避免浏览器顶栏串文案 */
|
||||
document.title = isAdminH5
|
||||
? isEn
|
||||
? 'IDE Ops Center'
|
||||
: 'IDE运营中心'
|
||||
? 'BCD Ops Center'
|
||||
: 'BCD运营中心'
|
||||
: isH5
|
||||
? isEn
|
||||
? 'IDE Customer Center'
|
||||
: 'IDE客户中心'
|
||||
: 'IDE I Faster & Simpler';
|
||||
? 'BCD Customer Center'
|
||||
: 'BCD客户中心'
|
||||
: 'BCD I Faster & Simpler';
|
||||
} catch (e2) {}
|
||||
if (path === '/login') {
|
||||
var plane = document.createElement('link');
|
||||
@ -104,7 +104,7 @@
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"
|
||||
/>
|
||||
<title>IDE I Faster & Simpler</title>
|
||||
<title>BCD I Faster & Simpler</title>
|
||||
<link rel="stylesheet" type="text/css" media="print" href="/print-lock.css" />
|
||||
<!-- DNS 预解析,加速资源加载 -->
|
||||
<link rel="dns-prefetch" href="//43.139.210.35" />
|
||||
|
||||
@ -3,10 +3,10 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>9610跨境电商出口方案选择指南 | IDE国际物流</title>
|
||||
<meta name="description" content="IDE 9610跨境电商出口指南:报关、退税与专线物流怎么选,一看就懂。">
|
||||
<meta property="og:title" content="9610跨境电商出口方案选择指南 | IDE国际物流">
|
||||
<meta property="og:description" content="IDE 9610跨境电商出口指南:报关、退税与专线物流怎么选,一看就懂。">
|
||||
<title>9610跨境电商出口方案选择指南 | BCD国际物流</title>
|
||||
<meta name="description" content="BCD 9610跨境电商出口指南:报关、退税与专线物流怎么选,一看就懂。">
|
||||
<meta property="og:title" content="9610跨境电商出口方案选择指南 | BCD国际物流">
|
||||
<meta property="og:description" content="BCD 9610跨境电商出口指南:报关、退税与专线物流怎么选,一看就懂。">
|
||||
<meta property="og:image" content="https://ideship.com/site/img/og-cover.png">
|
||||
<meta property="og:url" content="https://ideship.com/9610.html">
|
||||
<meta property="og:type" content="website">
|
||||
@ -543,7 +543,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<div class="site-topbar">
|
||||
<a class="site-topbar__brand" href="/">IDE</a>
|
||||
<a class="site-topbar__brand" href="/">BCD</a>
|
||||
<a class="site-topbar__login" id="site-login-btn" href="/login">登录</a>
|
||||
</div>
|
||||
<script>
|
||||
@ -565,7 +565,7 @@
|
||||
<div class="container">
|
||||
|
||||
<div class="header">
|
||||
<div class="brand">IDE 国际物流 · 跨境电商出口专家</div>
|
||||
<div class="brand">BCD 国际物流 · 跨境电商出口专家</div>
|
||||
<h1>9610 跨境电商出口方案选择指南</h1>
|
||||
<p>3分钟找到最适合你的报关与税务方案</p>
|
||||
</div>
|
||||
@ -644,7 +644,7 @@
|
||||
</ul>
|
||||
<div class="sol-result">→ 货物快速合规出境,操作最简</div>
|
||||
<div class="sol-tip">
|
||||
<strong>⚠ 风险提示:</strong>基础通关模式下,如企业未规范处理税务,可能被视同内销征税(<strong>13%增值税 + 25%企业所得税 + 滞纳金 + 罚款</strong>)。建议业务量增长后及时升级为无票免征或退税方案,IDE 可免费为您评估升级路径。
|
||||
<strong>⚠ 风险提示:</strong>基础通关模式下,如企业未规范处理税务,可能被视同内销征税(<strong>13%增值税 + 25%企业所得税 + 滞纳金 + 罚款</strong>)。建议业务量增长后及时升级为无票免征或退税方案,BCD 可免费为您评估升级路径。
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -731,7 +731,7 @@
|
||||
</table>
|
||||
|
||||
<!-- ===== 我们的服务 ===== -->
|
||||
<div class="section-title">三、IDE 能为您提供的服务</div>
|
||||
<div class="section-title">三、BCD 能为您提供的服务</div>
|
||||
<div class="service-grid">
|
||||
<div class="service-card">
|
||||
<div class="svc-icon">📋</div>
|
||||
@ -799,15 +799,15 @@
|
||||
</div>
|
||||
<div class="mode-result">
|
||||
<strong>适用:有海关备案、要积累出口数据的中大型卖家</strong>
|
||||
全流程自己把控,数据归自己,IDE可提供全程代办服务。
|
||||
全流程自己把控,数据归自己,BCD可提供全程代办服务。
|
||||
</div>
|
||||
</div>
|
||||
<div class="mode-card double">
|
||||
<h4>代理出口(双抬头)</h4>
|
||||
<div class="mode-sub">境内发货人 = IDE物流,生产销售单位 = 电商企业</div>
|
||||
<div class="mode-sub">境内发货人 = BCD物流,生产销售单位 = 电商企业</div>
|
||||
<div class="mode-field">
|
||||
<span class="label">境内发货人</span>
|
||||
<span class="value">IDE 国际物流</span>
|
||||
<span class="value">BCD 国际物流</span>
|
||||
</div>
|
||||
<div class="mode-field">
|
||||
<span class="label">生产销售单位</span>
|
||||
@ -823,16 +823,16 @@
|
||||
</div>
|
||||
<div class="mode-field">
|
||||
<span class="label">收汇</span>
|
||||
<span class="value">IDE代收或企业自收</span>
|
||||
<span class="value">BCD代收或企业自收</span>
|
||||
</div>
|
||||
<div class="mode-result">
|
||||
<strong>适用:无报关团队、希望一站式操作的中小卖家</strong>
|
||||
IDE负责报关申报,卖家凭报关单+代理委托协议退税,简便高效。
|
||||
BCD负责报关申报,卖家凭报关单+代理委托协议退税,简便高效。
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mode-note">
|
||||
<strong>重要提醒:</strong>不管单抬头还是双抬头,<strong>生产销售单位必须是电商企业自己</strong>,才能正常办理退税。如果您不确定自己适合哪种模式,IDE 免费为您提供方案咨询。
|
||||
<strong>重要提醒:</strong>不管单抬头还是双抬头,<strong>生产销售单位必须是电商企业自己</strong>,才能正常办理退税。如果您不确定自己适合哪种模式,BCD 免费为您提供方案咨询。
|
||||
</div>
|
||||
|
||||
<!-- ===== 注意事项 ===== -->
|
||||
@ -855,7 +855,7 @@
|
||||
<!-- ===== CTA ===== -->
|
||||
<div class="cta-box">
|
||||
<h3>不确定选哪种方案?免费为您定制</h3>
|
||||
<p>IDE 国际物流 · 专注跨境电商出口通关与东南亚专线物流</p>
|
||||
<p>BCD 国际物流 · 专注跨境电商出口通关与东南亚专线物流</p>
|
||||
<div class="cta-contact">
|
||||
<span>📞 咨询热线:13048804956</span>
|
||||
<span>✉️ 邮箱:13048804956@163.com</span>
|
||||
@ -863,7 +863,7 @@
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
本指南仅供参考,具体操作以海关及税务部门最新规定为准 · IDE 国际物流
|
||||
本指南仅供参考,具体操作以海关及税务部门最新规定为准 · BCD 国际物流
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@ -60,6 +60,7 @@ export type AiSkillItem = {
|
||||
|
||||
export const AI_SKILL_SCENES = [
|
||||
{ value: 'pricePublish', label: '价格发布风险' },
|
||||
{ value: 'pricingWorkbench', label: '定价工作台' },
|
||||
{ value: 'autoTriggerFormula', label: '自动触发公式' },
|
||||
{ value: 'receiverAddressParse', label: '收件地址解析' },
|
||||
{ value: 'itfxPrefixScript', label: '接口通前置脚本' },
|
||||
|
||||
133
src/api/channel/pricingWorkbench.ts
Normal file
133
src/api/channel/pricingWorkbench.ts
Normal file
@ -0,0 +1,133 @@
|
||||
import { axiosInstance } from '@/api/rbac'
|
||||
import { assertBusinessOk, omsUrl, unwrapData } from '@/api/oms/common'
|
||||
|
||||
export type PricingWorkbenchChannelSummary = {
|
||||
serviceChannelId: number
|
||||
channelName: string
|
||||
currency: string
|
||||
costItem: string
|
||||
priceName: string
|
||||
zoneCount: number
|
||||
weightSegmentCount: number
|
||||
detailCount: number
|
||||
fromPublishedSnapshot: boolean
|
||||
lastPublishTime?: string | null
|
||||
publishVersion?: string | null
|
||||
warning?: string | null
|
||||
}
|
||||
|
||||
export type PricingWorkbenchCell = {
|
||||
zone: string
|
||||
/** 可读分区名(省/市/国家或分区方案名);回写仍用 zone 原键 */
|
||||
zoneLabel?: string | null
|
||||
weightSegment: string
|
||||
buyPrice?: number | null
|
||||
sellPrice?: number | null
|
||||
appliedMarginRate?: number | null
|
||||
verifiedMargin?: number | null
|
||||
sourceChannelId?: number | null
|
||||
sourceChannelName?: string | null
|
||||
calculationFormula?: string
|
||||
flag?: string | null
|
||||
onlineDeltaRatio?: number | null
|
||||
onlineSellPrice?: number | null
|
||||
}
|
||||
|
||||
export type PricingWorkbenchDiffRisk = {
|
||||
zone: string
|
||||
weightSegment: string
|
||||
onlineSell?: number | null
|
||||
suggestedSell?: number | null
|
||||
deltaRatio: number
|
||||
message: string
|
||||
}
|
||||
|
||||
export type PricingWorkbenchPreviewInput = {
|
||||
serviceChannelIds: number[]
|
||||
marginRate?: number
|
||||
zoneMarginRates?: Record<string, number>
|
||||
weightMarginRates?: Record<string, number>
|
||||
excludeChannelIds?: number[]
|
||||
costItem?: string
|
||||
moneyScale?: number
|
||||
diffThreshold?: number
|
||||
compareSalesProductId?: number
|
||||
comparePriceId?: number
|
||||
compareCustomerGroupKey?: string
|
||||
}
|
||||
|
||||
export type PricingWorkbenchPreviewOutput = {
|
||||
currency: string
|
||||
marginRate: number
|
||||
costStrategy: string
|
||||
channels: PricingWorkbenchChannelSummary[]
|
||||
zones: string[]
|
||||
/** zone 原键 → 展示名 */
|
||||
zoneLabels?: Record<string, string>
|
||||
weightSegments: string[]
|
||||
cells: PricingWorkbenchCell[]
|
||||
blockers: string[]
|
||||
warnings: string[]
|
||||
diffRisks: PricingWorkbenchDiffRisk[]
|
||||
summary: string
|
||||
audit?: Record<string, any>
|
||||
}
|
||||
|
||||
export type PricingWorkbenchApplyInput = {
|
||||
preview: PricingWorkbenchPreviewInput
|
||||
salesProductId: number
|
||||
priceId?: number | null
|
||||
priceName?: string
|
||||
costItem?: string
|
||||
costUnit?: string
|
||||
customerGroupKey: string
|
||||
analysisNote?: string
|
||||
sellOverrides?: Record<string, number>
|
||||
}
|
||||
|
||||
export type PricingWorkbenchApplyOutput = {
|
||||
salesProductId: number
|
||||
priceId: number
|
||||
detailCount: number
|
||||
createdPrice: boolean
|
||||
message: string
|
||||
audit?: Record<string, any>
|
||||
}
|
||||
|
||||
function normalizeKeys<T extends Record<string, any>>(raw: any): T {
|
||||
if (!raw || typeof raw !== 'object') return raw
|
||||
if (Array.isArray(raw)) return raw.map((x) => normalizeKeys(x)) as any
|
||||
const out: Record<string, any> = {}
|
||||
for (const [k, v] of Object.entries(raw)) {
|
||||
const camel = k.charAt(0).toLowerCase() + k.slice(1)
|
||||
out[camel] = v != null && typeof v === 'object' ? normalizeKeys(v as any) : v
|
||||
}
|
||||
return out as T
|
||||
}
|
||||
|
||||
/** GET /channel/pricing-workbench/channel-summaries */
|
||||
export async function getPricingWorkbenchChannelSummaries(serviceChannelIds: number[]) {
|
||||
const res = await axiosInstance.get(omsUrl('/channel/pricing-workbench/channel-summaries'), {
|
||||
params: { serviceChannelIds: serviceChannelIds.join(',') },
|
||||
})
|
||||
assertBusinessOk(res.data)
|
||||
const data = unwrapData<any>(res.data) ?? res.data?.data ?? res.data
|
||||
const list = Array.isArray(data) ? data : data?.items ?? data?.Items ?? []
|
||||
return (list as any[]).map((x) => normalizeKeys<PricingWorkbenchChannelSummary>(x))
|
||||
}
|
||||
|
||||
/** POST /channel/pricing-workbench/preview */
|
||||
export async function previewPricingWorkbench(body: PricingWorkbenchPreviewInput) {
|
||||
const res = await axiosInstance.post(omsUrl('/channel/pricing-workbench/preview'), body)
|
||||
assertBusinessOk(res.data)
|
||||
const data = unwrapData<any>(res.data) ?? res.data?.data ?? res.data
|
||||
return normalizeKeys<PricingWorkbenchPreviewOutput>(data)
|
||||
}
|
||||
|
||||
/** POST /channel/pricing-workbench/apply — 仅草稿,不发布 */
|
||||
export async function applyPricingWorkbench(body: PricingWorkbenchApplyInput) {
|
||||
const res = await axiosInstance.post(omsUrl('/channel/pricing-workbench/apply'), body)
|
||||
assertBusinessOk(res.data)
|
||||
const data = unwrapData<any>(res.data) ?? res.data?.data ?? res.data
|
||||
return normalizeKeys<PricingWorkbenchApplyOutput>(data)
|
||||
}
|
||||
@ -6,6 +6,7 @@ import type {
|
||||
WeChatCustomerRegisterInput,
|
||||
WeChatCustomerRegisterResult,
|
||||
WeChatOAuthUserInfo,
|
||||
WeChatOpenidRebindInput,
|
||||
WxFollowQrcodeResult,
|
||||
WxLoginQrcodeResult,
|
||||
WxLoginResult,
|
||||
@ -26,7 +27,13 @@ function unwrapOrSelf<T>(body: unknown): T {
|
||||
'accessToken' in record ||
|
||||
'openid' in record ||
|
||||
'appId' in record ||
|
||||
'AppId' in record
|
||||
'AppId' in record ||
|
||||
'needOpenidMigrate' in record ||
|
||||
'NeedOpenidMigrate' in record ||
|
||||
'suggestOpenidMigrate' in record ||
|
||||
'SuggestOpenidMigrate' in record ||
|
||||
'migrateTicket' in record ||
|
||||
'MigrateTicket' in record
|
||||
) {
|
||||
return body as T;
|
||||
}
|
||||
@ -99,13 +106,54 @@ export async function wxLogin(loginUuid: string): Promise<WxLoginResult> {
|
||||
/** 微信网页授权登录(H5 点按钮,无需扫码) */
|
||||
export async function wxOAuthLogin(code: string): Promise<WxLoginResult> {
|
||||
const res = await axiosInstance.post(omsUrl('/rbac/auth/wx-oauth-login'), { code });
|
||||
const data = unwrapOrSelf<WxLoginResult & Record<string, unknown>>(res.data);
|
||||
return {
|
||||
...data,
|
||||
needOpenidMigrate: Boolean(
|
||||
data.needOpenidMigrate ?? data.NeedOpenidMigrate ?? false,
|
||||
),
|
||||
migrateTicket: String(
|
||||
data.migrateTicket ?? data.MigrateTicket ?? '',
|
||||
).trim() || undefined,
|
||||
nickname:
|
||||
(data.nickname as string | undefined) ??
|
||||
(data.Nickname as string | undefined) ??
|
||||
null,
|
||||
};
|
||||
}
|
||||
|
||||
/** 换公众号:ticket + 手机号确认,仅更新 WechatOpenid 并返回登录态 */
|
||||
export async function rebindOpenidByPhone(
|
||||
input: WeChatOpenidRebindInput,
|
||||
): Promise<WxLoginResult> {
|
||||
const res = await axiosInstance.post(omsUrl('/wechat/customer/rebind-openid'), input);
|
||||
return unwrapOrSelf<WxLoginResult>(res.data);
|
||||
}
|
||||
|
||||
/** OAuth code 换取微信用户信息 */
|
||||
export async function getOAuthUserInfo(code: string): Promise<WeChatOAuthUserInfo> {
|
||||
const res = await axiosInstance.post(omsUrl('/wechat/oauth/user-info'), { code });
|
||||
return unwrapOrSelf<WeChatOAuthUserInfo>(res.data);
|
||||
const data = unwrapOrSelf<WeChatOAuthUserInfo & Record<string, unknown>>(res.data);
|
||||
return {
|
||||
...data,
|
||||
alreadyBound: Boolean(data.alreadyBound ?? data.AlreadyBound ?? false),
|
||||
suggestOpenidMigrate: Boolean(
|
||||
data.suggestOpenidMigrate ?? data.SuggestOpenidMigrate ?? false,
|
||||
),
|
||||
migrateTicket: String(
|
||||
data.migrateTicket ?? data.MigrateTicket ?? '',
|
||||
).trim() || undefined,
|
||||
nickname:
|
||||
(data.nickname as string | undefined) ??
|
||||
(data.Nickname as string | undefined),
|
||||
openid: String(data.openid ?? data.Openid ?? '').trim(),
|
||||
unionid:
|
||||
(data.unionid as string | undefined) ??
|
||||
(data.Unionid as string | undefined),
|
||||
headimgurl:
|
||||
(data.headimgurl as string | undefined) ??
|
||||
(data.Headimgurl as string | undefined),
|
||||
};
|
||||
}
|
||||
|
||||
/** 微信授权注册客户 */
|
||||
|
||||
@ -39,6 +39,16 @@ export interface WeChatOAuthUserInfo {
|
||||
unionid?: string;
|
||||
/** 已绑定客户时后端可返回 */
|
||||
alreadyBound?: boolean;
|
||||
/** 新 OpenID 未绑定但昵称命中存量主客户 */
|
||||
suggestOpenidMigrate?: boolean;
|
||||
/** 迁移凭证(约 10 分钟) */
|
||||
migrateTicket?: string;
|
||||
}
|
||||
|
||||
/** 换公众号:手机号确认更新 OpenID */
|
||||
export interface WeChatOpenidRebindInput {
|
||||
ticket: string;
|
||||
phone: string;
|
||||
}
|
||||
|
||||
export interface WeChatProfileInput {
|
||||
@ -73,4 +83,8 @@ export interface WeChatCustomerBindInput {
|
||||
wechat: WeChatProfileInput;
|
||||
}
|
||||
|
||||
export type WxLoginResult = LoginResultDto;
|
||||
export type WxLoginResult = LoginResultDto & {
|
||||
needOpenidMigrate?: boolean;
|
||||
migrateTicket?: string;
|
||||
nickname?: string | null;
|
||||
};
|
||||
|
||||
16
src/auto-imports.d.ts
vendored
16
src/auto-imports.d.ts
vendored
@ -13,6 +13,7 @@ declare global {
|
||||
const asyncComputed: typeof import('@vueuse/core')['asyncComputed']
|
||||
const autoResetRef: typeof import('@vueuse/core')['autoResetRef']
|
||||
const buildAskAdvisorQuery: typeof import('./composables/useAskAdvisor')['buildAskAdvisorQuery']
|
||||
const buildOpsGuideContext: typeof import('./composables/opsGuideKnowledge')['buildOpsGuideContext']
|
||||
const buildPriceAskPrefill: typeof import('./composables/priceAskAdvisor')['buildPriceAskPrefill']
|
||||
const buildWaybillContextFromRow: typeof import('./composables/useAskAdvisor')['buildWaybillContextFromRow']
|
||||
const computed: typeof import('vue')['computed']
|
||||
@ -59,6 +60,7 @@ declare global {
|
||||
const isReactive: typeof import('vue')['isReactive']
|
||||
const isReadonly: typeof import('vue')['isReadonly']
|
||||
const isRef: typeof import('vue')['isRef']
|
||||
const listOpsGuideModules: typeof import('./composables/opsGuideKnowledge')['listOpsGuideModules']
|
||||
const makeDestructurable: typeof import('@vueuse/core')['makeDestructurable']
|
||||
const mapActions: typeof import('pinia')['mapActions']
|
||||
const mapGetters: typeof import('pinia')['mapGetters']
|
||||
@ -184,6 +186,8 @@ declare global {
|
||||
const useDocumentVisibility: typeof import('@vueuse/core')['useDocumentVisibility']
|
||||
const useDraggable: typeof import('@vueuse/core')['useDraggable']
|
||||
const useDropZone: typeof import('@vueuse/core')['useDropZone']
|
||||
const useEdiAdvisorPanel: typeof import('./composables/useEdiAdvisorPanel')['useEdiAdvisorPanel']
|
||||
const useEdiBatchPanel: typeof import('./composables/useEdiBatchPanel')['useEdiBatchPanel']
|
||||
const useElementBounding: typeof import('@vueuse/core')['useElementBounding']
|
||||
const useElementByPoint: typeof import('@vueuse/core')['useElementByPoint']
|
||||
const useElementHover: typeof import('@vueuse/core')['useElementHover']
|
||||
@ -230,7 +234,6 @@ declare global {
|
||||
const useMouseInElement: typeof import('@vueuse/core')['useMouseInElement']
|
||||
const useMousePressed: typeof import('@vueuse/core')['useMousePressed']
|
||||
const useMutationObserver: typeof import('@vueuse/core')['useMutationObserver']
|
||||
const useEdiBatchPanel: typeof import('./composables/useEdiBatchPanel')['useEdiBatchPanel']
|
||||
const useNavigatorLanguage: typeof import('@vueuse/core')['useNavigatorLanguage']
|
||||
const useNetwork: typeof import('@vueuse/core')['useNetwork']
|
||||
const useNow: typeof import('@vueuse/core')['useNow']
|
||||
@ -339,12 +342,18 @@ declare global {
|
||||
export type { McpCapabilityId, McpFieldHint, McpCapabilityGuide } from './composables/assistantMcpGuide'
|
||||
import('./composables/assistantMcpGuide')
|
||||
// @ts-ignore
|
||||
export type { OpsGuideModuleId, OpsGuideModule, OpsGuideContext } from './composables/opsGuideKnowledge'
|
||||
import('./composables/opsGuideKnowledge')
|
||||
// @ts-ignore
|
||||
export type { PriceAskIntent, PriceAskContext } from './composables/priceAskAdvisor'
|
||||
import('./composables/priceAskAdvisor')
|
||||
// @ts-ignore
|
||||
export type { WaybillSource, WaybillContext } from './composables/useAskAdvisor'
|
||||
import('./composables/useAskAdvisor')
|
||||
// @ts-ignore
|
||||
export type { EdiAdvisorOpenOptions } from './composables/useEdiAdvisorPanel'
|
||||
import('./composables/useEdiAdvisorPanel')
|
||||
// @ts-ignore
|
||||
export type { EdiBatchOpenOptions } from './composables/useEdiBatchPanel'
|
||||
import('./composables/useEdiBatchPanel')
|
||||
// @ts-ignore
|
||||
@ -370,6 +379,7 @@ declare module 'vue' {
|
||||
readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']>
|
||||
readonly autoResetRef: UnwrapRef<typeof import('@vueuse/core')['autoResetRef']>
|
||||
readonly buildAskAdvisorQuery: UnwrapRef<typeof import('./composables/useAskAdvisor')['buildAskAdvisorQuery']>
|
||||
readonly buildOpsGuideContext: UnwrapRef<typeof import('./composables/opsGuideKnowledge')['buildOpsGuideContext']>
|
||||
readonly buildPriceAskPrefill: UnwrapRef<typeof import('./composables/priceAskAdvisor')['buildPriceAskPrefill']>
|
||||
readonly buildWaybillContextFromRow: UnwrapRef<typeof import('./composables/useAskAdvisor')['buildWaybillContextFromRow']>
|
||||
readonly computed: UnwrapRef<typeof import('vue')['computed']>
|
||||
@ -416,6 +426,7 @@ declare module 'vue' {
|
||||
readonly isReactive: UnwrapRef<typeof import('vue')['isReactive']>
|
||||
readonly isReadonly: UnwrapRef<typeof import('vue')['isReadonly']>
|
||||
readonly isRef: UnwrapRef<typeof import('vue')['isRef']>
|
||||
readonly listOpsGuideModules: UnwrapRef<typeof import('./composables/opsGuideKnowledge')['listOpsGuideModules']>
|
||||
readonly makeDestructurable: UnwrapRef<typeof import('@vueuse/core')['makeDestructurable']>
|
||||
readonly mapActions: UnwrapRef<typeof import('pinia')['mapActions']>
|
||||
readonly mapGetters: UnwrapRef<typeof import('pinia')['mapGetters']>
|
||||
@ -541,6 +552,8 @@ declare module 'vue' {
|
||||
readonly useDocumentVisibility: UnwrapRef<typeof import('@vueuse/core')['useDocumentVisibility']>
|
||||
readonly useDraggable: UnwrapRef<typeof import('@vueuse/core')['useDraggable']>
|
||||
readonly useDropZone: UnwrapRef<typeof import('@vueuse/core')['useDropZone']>
|
||||
readonly useEdiAdvisorPanel: UnwrapRef<typeof import('./composables/useEdiAdvisorPanel')['useEdiAdvisorPanel']>
|
||||
readonly useEdiBatchPanel: UnwrapRef<typeof import('./composables/useEdiBatchPanel')['useEdiBatchPanel']>
|
||||
readonly useElementBounding: UnwrapRef<typeof import('@vueuse/core')['useElementBounding']>
|
||||
readonly useElementByPoint: UnwrapRef<typeof import('@vueuse/core')['useElementByPoint']>
|
||||
readonly useElementHover: UnwrapRef<typeof import('@vueuse/core')['useElementHover']>
|
||||
@ -587,7 +600,6 @@ declare module 'vue' {
|
||||
readonly useMouseInElement: UnwrapRef<typeof import('@vueuse/core')['useMouseInElement']>
|
||||
readonly useMousePressed: UnwrapRef<typeof import('@vueuse/core')['useMousePressed']>
|
||||
readonly useMutationObserver: UnwrapRef<typeof import('@vueuse/core')['useMutationObserver']>
|
||||
readonly useEdiBatchPanel: UnwrapRef<typeof import('./composables/useEdiBatchPanel')['useEdiBatchPanel']>
|
||||
readonly useNavigatorLanguage: UnwrapRef<typeof import('@vueuse/core')['useNavigatorLanguage']>
|
||||
readonly useNetwork: UnwrapRef<typeof import('@vueuse/core')['useNetwork']>
|
||||
readonly useNow: UnwrapRef<typeof import('@vueuse/core')['useNow']>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/* ===== OMS AI Advisor — IDE-style logistics advisor shell ===== */
|
||||
/* ===== OMS AI Advisor — BCD-style logistics advisor shell ===== */
|
||||
|
||||
.ai-advisor-shell {
|
||||
--kc-primary: var(--app-primary-color, #2d8c8c);
|
||||
@ -432,8 +432,8 @@
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.ai-history-sidebar,
|
||||
.ai-advisor-app {
|
||||
/* 卡片壳只给助手浮层/页面态按需覆盖;勿写裸 .ai-advisor-app,会串到官网首页 */
|
||||
.ai-history-sidebar {
|
||||
border-radius: 18px;
|
||||
border: 1px solid var(--app-card-border);
|
||||
background: var(--app-elevated-bg);
|
||||
@ -717,7 +717,8 @@
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ai-advisor-app {
|
||||
/* 限定在助手壳内,避免官网 #ai-advisor-shell 同名节点吃到内边距/裁切 */
|
||||
.ai-advisor-shell .ai-advisor-app {
|
||||
--ai-thread-max: 48rem;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
@ -999,8 +1000,8 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* —— Main scroll area —— */
|
||||
.ai-app-main {
|
||||
/* —— Main scroll area(仅助手壳;官网有自己的 .ai-app-main) —— */
|
||||
.ai-advisor-shell .ai-app-main {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow-y: auto;
|
||||
@ -1011,21 +1012,21 @@
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.ai-app-main--welcome {
|
||||
.ai-advisor-shell .ai-app-main--welcome {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.ai-app-main::-webkit-scrollbar {
|
||||
.ai-advisor-shell .ai-app-main::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
|
||||
.ai-app-main::-webkit-scrollbar-thumb {
|
||||
.ai-advisor-shell .ai-app-main::-webkit-scrollbar-thumb {
|
||||
background: rgba(27, 42, 107, 0.15);
|
||||
border-radius: 999px;
|
||||
}
|
||||
|
||||
/* —— Welcome (empty state) —— */
|
||||
.ai-welcome {
|
||||
/* —— Welcome (empty state);限定助手壳,避免官网首页被 48rem 对话栏宽掐窄 —— */
|
||||
.ai-advisor-shell .ai-welcome {
|
||||
width: 100%;
|
||||
max-width: var(--ai-thread-max, 48rem);
|
||||
margin-inline: auto;
|
||||
@ -1349,7 +1350,8 @@
|
||||
}
|
||||
|
||||
/* —— Composer (sticky) —— */
|
||||
.ai-composer-wrap {
|
||||
/* 限定助手壳,避免官网欢迎态同名 wrap/composer 被对话栏宽与圆角串染 */
|
||||
.ai-advisor-shell .ai-composer-wrap {
|
||||
flex-shrink: 0;
|
||||
width: 100%;
|
||||
max-width: var(--ai-thread-max, 48rem);
|
||||
@ -1358,7 +1360,7 @@
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.ai-composer {
|
||||
.ai-advisor-shell .ai-composer {
|
||||
padding: 10px 12px;
|
||||
border-radius: 24px;
|
||||
border: 1px solid rgba(27, 42, 107, 0.1);
|
||||
@ -1370,13 +1372,13 @@
|
||||
-webkit-backdrop-filter: blur(8px);
|
||||
}
|
||||
|
||||
.ai-composer-form {
|
||||
.ai-advisor-shell .ai-composer-form {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.ai-composer-input {
|
||||
.ai-advisor-shell .ai-composer-input {
|
||||
flex: 1;
|
||||
min-height: 44px;
|
||||
max-height: 120px;
|
||||
@ -1392,15 +1394,15 @@
|
||||
-webkit-text-size-adjust: 100%;
|
||||
}
|
||||
|
||||
.ai-composer-input:focus {
|
||||
.ai-advisor-shell .ai-composer-input:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.ai-composer-input::placeholder {
|
||||
.ai-advisor-shell .ai-composer-input::placeholder {
|
||||
color: #c9cdd4;
|
||||
}
|
||||
|
||||
.ai-composer-send {
|
||||
.ai-advisor-shell .ai-composer-send {
|
||||
flex-shrink: 0;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
@ -1416,20 +1418,20 @@
|
||||
transition: transform 0.15s ease, filter 0.15s ease, background 0.15s ease;
|
||||
}
|
||||
|
||||
.ai-composer-send .arco-icon,
|
||||
.ai-composer-send svg {
|
||||
.ai-advisor-shell .ai-composer-send .arco-icon,
|
||||
.ai-advisor-shell .ai-composer-send svg {
|
||||
width: 1.15em;
|
||||
height: 1.15em;
|
||||
color: inherit;
|
||||
fill: currentColor;
|
||||
}
|
||||
|
||||
.ai-composer-send:hover:not(:disabled) {
|
||||
.ai-advisor-shell .ai-composer-send:hover:not(:disabled) {
|
||||
filter: brightness(1.05);
|
||||
transform: scale(1.04);
|
||||
}
|
||||
|
||||
.ai-composer-send:disabled {
|
||||
.ai-advisor-shell .ai-composer-send:disabled {
|
||||
background: var(--color-fill-3);
|
||||
color: #c9cdd4;
|
||||
opacity: 1;
|
||||
@ -1587,7 +1589,7 @@
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ai-advisor-app {
|
||||
.ai-advisor-shell .ai-advisor-app {
|
||||
padding: 10px 10px 12px;
|
||||
}
|
||||
|
||||
|
||||
@ -51,22 +51,34 @@
|
||||
position="right"
|
||||
:disabled="!compactLayout"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
class="customer-side-rail__item"
|
||||
:class="{ active: isActive(item) }"
|
||||
:aria-current="isActive(item) ? 'page' : undefined"
|
||||
:data-nav-path="getCustomerNavPath(item)"
|
||||
@pointerenter="prefetch(item)"
|
||||
@click="onNavigate(item)"
|
||||
>
|
||||
<span class="customer-side-rail__icon">
|
||||
<component :is="getSubMenuIcon(item, undefined, MENU_NAME_TO_LOCALE_KEY)" />
|
||||
</span>
|
||||
<span class="customer-side-rail__text customer-side-rail__fade">
|
||||
{{ formatTitle(item) }}
|
||||
</span>
|
||||
</button>
|
||||
<div class="customer-side-rail__item-wrap">
|
||||
<button
|
||||
type="button"
|
||||
class="customer-side-rail__item"
|
||||
:class="{ active: isActive(item) }"
|
||||
:aria-current="isActive(item) ? 'page' : undefined"
|
||||
:data-nav-path="getCustomerNavPath(item)"
|
||||
@pointerenter="prefetch(item)"
|
||||
@click="onNavigate(item)"
|
||||
>
|
||||
<span class="customer-side-rail__icon">
|
||||
<component :is="getSubMenuIcon(item, undefined, MENU_NAME_TO_LOCALE_KEY)" />
|
||||
</span>
|
||||
<span class="customer-side-rail__text customer-side-rail__fade">
|
||||
{{ formatTitle(item) }}
|
||||
</span>
|
||||
</button>
|
||||
<button
|
||||
v-if="!compactLayout"
|
||||
type="button"
|
||||
class="customer-side-rail__refresh"
|
||||
:title="t('nav.sideRail.refresh')"
|
||||
:aria-label="t('nav.sideRail.refresh')"
|
||||
@click.stop="onRefresh(item)"
|
||||
>
|
||||
<icon-refresh />
|
||||
</button>
|
||||
</div>
|
||||
</a-tooltip>
|
||||
</section>
|
||||
</div>
|
||||
@ -166,8 +178,11 @@ import {
|
||||
IconDoubleLeft,
|
||||
IconDoubleRight,
|
||||
IconPrinter,
|
||||
IconRefresh,
|
||||
} from '@arco-design/web-vue/es/icon'
|
||||
import { useCurrentWarehouseStore } from '@/store'
|
||||
import { useCurrentWarehouseStore, useTabBarStore } from '@/store'
|
||||
import type { TagProps } from '@/store/modules/tab-bar/types'
|
||||
import { pub } from '@/utils/pub'
|
||||
import { useRbacUserStore } from '@/store/modules/rbac-user'
|
||||
import { getWarehouseList } from '@/api/system/warehouse'
|
||||
import { getSubMenuIcon } from '@/utils/menu-icon'
|
||||
@ -209,6 +224,7 @@ const route = useRoute()
|
||||
const router = useRouter()
|
||||
const rbacUserStore = useRbacUserStore()
|
||||
const warehouseStore = useCurrentWarehouseStore()
|
||||
const tabBarStore = useTabBarStore()
|
||||
const printConnectionState = useHiprintClientState()
|
||||
|
||||
/** 与 CSS transition 时长一致(Linear 风格约 300ms) */
|
||||
@ -451,6 +467,49 @@ function onNavigate(item: CustomerNavItem) {
|
||||
router.push(targetPath).catch(() => undefined)
|
||||
}
|
||||
|
||||
function resolveRefreshCacheKey(targetPath: string) {
|
||||
const resolved = router.resolve(targetPath)
|
||||
const matchedName = resolved.matched.at(-1)?.name ?? resolved.name
|
||||
if (matchedName) return String(matchedName)
|
||||
return (resolved.path || '/').split('?')[0]
|
||||
}
|
||||
|
||||
/** 侧栏菜单刷新:与顶栏页签同一套剔缓存 → bump key → 回填缓存 */
|
||||
async function onRefresh(item: CustomerNavItem) {
|
||||
let targetPath = getCustomerNavPath(item)
|
||||
if (!targetPath || regexUrl.test(targetPath)) return
|
||||
if (!targetPath.startsWith('/')) targetPath = `/${targetPath}`
|
||||
|
||||
const portalPanel = resolvePortalDrawerPanel(targetPath)
|
||||
if (portalPanel) {
|
||||
openPortalSideDrawer(portalPanel)
|
||||
return
|
||||
}
|
||||
|
||||
if (router.currentRoute.value.path !== targetPath) {
|
||||
await router.push(targetPath).catch(() => undefined)
|
||||
}
|
||||
|
||||
const cacheKey = resolveRefreshCacheKey(targetPath)
|
||||
if (!cacheKey) return
|
||||
|
||||
await nextTick()
|
||||
tabBarStore.deleteCache({ name: cacheKey } as TagProps)
|
||||
await nextTick()
|
||||
tabBarStore.bumpRouteRefresh(cacheKey)
|
||||
await nextTick()
|
||||
|
||||
const ignoreCache = !!router.currentRoute.value.meta?.ignoreCache
|
||||
if (!ignoreCache) {
|
||||
tabBarStore.addCache(cacheKey)
|
||||
}
|
||||
|
||||
pub('page:refresh', {
|
||||
routeName: cacheKey,
|
||||
fullPath: router.currentRoute.value.fullPath,
|
||||
})
|
||||
}
|
||||
|
||||
async function onPrintConnectionClick() {
|
||||
if (printConnectionState.connecting) return
|
||||
try {
|
||||
@ -716,6 +775,53 @@ onUnmounted(() => {
|
||||
background: var(--color-border-2, rgba(0, 0, 0, 0.08));
|
||||
}
|
||||
|
||||
&__item-wrap {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
&__refresh {
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
top: 50%;
|
||||
z-index: 1;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
background: transparent;
|
||||
color: var(--color-text-3);
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
transform: translateY(-50%);
|
||||
transition:
|
||||
opacity 0.14s ease,
|
||||
color 0.14s ease,
|
||||
background-color 0.14s ease;
|
||||
|
||||
&:hover {
|
||||
color: var(--app-primary-color, rgb(var(--primary-6)));
|
||||
background: color-mix(in srgb, var(--app-primary-color, #1d7281) 10%, #fff);
|
||||
}
|
||||
}
|
||||
|
||||
&__item-wrap:hover &__refresh {
|
||||
opacity: 1;
|
||||
pointer-events: auto;
|
||||
background: color-mix(in srgb, #fff 92%, transparent);
|
||||
}
|
||||
|
||||
&__item-wrap:hover &__refresh:hover {
|
||||
background: color-mix(in srgb, var(--app-primary-color, #1d7281) 10%, #fff);
|
||||
}
|
||||
|
||||
&__item {
|
||||
position: relative;
|
||||
display: flex;
|
||||
@ -974,6 +1080,10 @@ onUnmounted(() => {
|
||||
margin: 4px auto 6px;
|
||||
}
|
||||
|
||||
.customer-side-rail__item-wrap {
|
||||
width: 40px;
|
||||
}
|
||||
|
||||
.customer-side-rail__item {
|
||||
width: 40px;
|
||||
min-height: 40px;
|
||||
|
||||
@ -75,10 +75,10 @@ const COUNTRY_HINT =
|
||||
const WEIGHT_HINT =
|
||||
/(\d+(\.\d+)?)\s*(kg|KG|公斤|千克)|(?:重量|实重)\s*[::]?\s*\d+(\.\d+)?|(?:约|大概)\s*\d+(\.\d+)?\s*(kg|KG|公斤|千克)?/i
|
||||
|
||||
/** IDE 运单、跟踪号等 */
|
||||
/** BCD 运单、跟踪号等 */
|
||||
const ORDER_NO_LOOSE = /[A-Za-z][A-Za-z0-9\-_]{5,}/
|
||||
const ORDER_NO_STRICT =
|
||||
/\b(IDE\d{8,}|(?:YD|SF|YT|NF|LT)[A-Za-z0-9]{6,}|(?:[A-Z]{2,}\d{8,}))\b/i
|
||||
/\b((?:BCD|IDE)\d{8,}|(?:YD|SF|YT|NF|LT)[A-Za-z0-9]{6,}|(?:[A-Z]{2,}\d{8,}))\b/i
|
||||
|
||||
const CARGO_HINT =
|
||||
/品名|货物|普货|敏感|衣服|服装|鞋|化妆品|lipstick|手机|电池|粉末|液体|食品|寄|发/i
|
||||
|
||||
@ -24,7 +24,7 @@ export function useSystemConfig() {
|
||||
loading.value = true;
|
||||
// RBAC 系统使用默认配置
|
||||
const defaultConfig = {
|
||||
SYS_NAME: 'IDE(即配)',
|
||||
SYS_NAME: 'BCD(即配)',
|
||||
SYS_VERSION: 'v1.0.0',
|
||||
SYS_LOGO: '/src/assets/logo.png',
|
||||
SYS_FULL_NAME: 'Immediate Delivery Express',
|
||||
|
||||
@ -733,6 +733,12 @@ const CORE_GROUPS: PageButtonGroup[] = [
|
||||
{ code: 'RollbackVersion', name: '回滚到此版本' },
|
||||
{ code: 'PublishConfirm', name: '发布' },
|
||||
]),
|
||||
B('Channel.PricingWorkbench', [
|
||||
{ code: 'Query', name: '查询' },
|
||||
{ code: 'Preview', name: '预览合成' },
|
||||
{ code: 'Apply', name: '回写草稿卖价' },
|
||||
{ code: 'AiAssist', name: 'AI 辅助' },
|
||||
]),
|
||||
B('Channel.PriceArea', [
|
||||
{ code: 'Query', name: '查询' },
|
||||
{ code: 'Create', name: '新增' },
|
||||
|
||||
@ -15,7 +15,7 @@ export default {
|
||||
'ediAssistant.greet.night': 'Still up late',
|
||||
'ediAssistant.quickLabel': 'Common questions',
|
||||
'ediAssistant.welcomeMsg':
|
||||
"Hi — I'm Edi, your IDE logistics buddy. Tap below or type your own question.",
|
||||
"Hi — I'm Edi, your BCD logistics buddy. Tap below or type your own question.",
|
||||
'ediAssistant.historyTitle': 'Chat history',
|
||||
'ediAssistant.newChat': 'New chat',
|
||||
'ediAssistant.emptyHistory': 'No conversations yet',
|
||||
@ -70,12 +70,12 @@ export default {
|
||||
'ediAssistant.quickAfterSales': 'Something went wrong?',
|
||||
'ediAssistant.quickHuman': 'Talk to online advisor',
|
||||
'ediAssistant.replySmall':
|
||||
'Yes~ IDE welcomes SMB sellers and shipments others decline — special routes, complex cargo, and low-volume orders are in scope. Tell me origin, destination, and cargo type to get started.',
|
||||
'Yes~ BCD welcomes SMB sellers and shipments others decline — special routes, complex cargo, and low-volume orders are in scope. Tell me origin, destination, and cargo type to get started.',
|
||||
'ediAssistant.replyPrice':
|
||||
'For a quote, destination country + actual weight (kg) is enough — e.g. US 0.5kg. Postal code/dims help; origin city is not required.',
|
||||
'ediAssistant.replyQuoteSpeed':
|
||||
'With country + weight we can return an indicative quote right away; final billing follows inbound weight and product rules.',
|
||||
'ediAssistant.trackHint': 'Just send the waybill number to track, e.g. IDE2607281746002926',
|
||||
'ediAssistant.trackHint': 'Just send the waybill number to track, e.g. BCD2607281746002926',
|
||||
'ediAssistant.replyVisibility':
|
||||
'You get milestone updates from pickup to delivery — pickup, export, line-haul, customs, and final delivery. We try to flag delays early too.',
|
||||
'ediAssistant.replyAfterSales':
|
||||
@ -96,7 +96,7 @@ export default {
|
||||
'ediAssistant.noAdvisor': 'No exclusive advisor assigned yet',
|
||||
'ediAssistant.noWechatQr': 'WeChat QR code not uploaded',
|
||||
'ediAssistant.greeting':
|
||||
"Hi, I'm Edi~ your IDE logistics buddy.\n\nAsk me about tracking, transit times, declared values, customs, and more. What shall we start with?",
|
||||
"Hi, I'm Edi~ your BCD logistics buddy.\n\nAsk me about tracking, transit times, declared values, customs, and more. What shall we start with?",
|
||||
'ediAssistant.send': 'Send',
|
||||
'ediAssistant.close': 'Close',
|
||||
'ediAssistant.back': 'Back',
|
||||
|
||||
@ -14,7 +14,7 @@ export default {
|
||||
'ediAssistant.greet.evening': '晚上好',
|
||||
'ediAssistant.greet.night': '这么晚还在忙呀',
|
||||
'ediAssistant.quickLabel': '常见问题',
|
||||
'ediAssistant.welcomeMsg': '你好呀,我是艾迪,IDE 的物流小助手~可以直接问我,也可以点下面的入口。',
|
||||
'ediAssistant.welcomeMsg': '你好呀,我是艾迪,BCD 的物流小助手~可以直接问我,也可以点下面的入口。',
|
||||
'ediAssistant.historyTitle': '历史记录',
|
||||
'ediAssistant.newChat': '新会话',
|
||||
'ediAssistant.emptyHistory': '还没有会话哦',
|
||||
@ -68,12 +68,12 @@ export default {
|
||||
'ediAssistant.quickAfterSales': '出问题了怎么办?',
|
||||
'ediAssistant.quickHuman': '联系在线顾问',
|
||||
'ediAssistant.replySmall':
|
||||
'可以的~ IDE 很欢迎中小卖家和别人不太接的单:特殊线路、复杂货型、小批量都在服务范围内。告诉我起运地、目的地和货型,咱们就开始吧。',
|
||||
'可以的~ BCD 很欢迎中小卖家和别人不太接的单:特殊线路、复杂货型、小批量都在服务范围内。告诉我起运地、目的地和货型,咱们就开始吧。',
|
||||
'ediAssistant.replyPrice':
|
||||
'查价只需目的国和实重(kg)就好,例如:美国 0.5kg。有邮编/尺寸会更准;不需要起运地哦。',
|
||||
'ediAssistant.replyQuoteSpeed':
|
||||
'提交目的国和重量后可以马上试算参考价;正式出账以入仓重与产品规则为准~',
|
||||
'ediAssistant.trackHint': '直接发送运单号即可查轨迹,例如:IDE2607281746002926',
|
||||
'ediAssistant.trackHint': '直接发送运单号即可查轨迹,例如:BCD2607281746002926',
|
||||
'ediAssistant.replyVisibility':
|
||||
'从揽收到签收都有关键节点更新——揽收、出口、干线、清关、妥投。异常升级前我们也会尽量提前打招呼~',
|
||||
'ediAssistant.replyAfterSales':
|
||||
@ -93,7 +93,7 @@ export default {
|
||||
'ediAssistant.noAdvisor': '暂未分配专属顾问',
|
||||
'ediAssistant.noWechatQr': '暂未上传微信二维码',
|
||||
'ediAssistant.greeting':
|
||||
'嗨,我是艾迪~ IDE 的物流小助手\n\n查轨迹、渠道时效、申报价值和清关问题,都可以问我。今天想先聊哪一件呀?',
|
||||
'嗨,我是艾迪~ BCD 的物流小助手\n\n查轨迹、渠道时效、申报价值和清关问题,都可以问我。今天想先聊哪一件呀?',
|
||||
'ediAssistant.send': '发送',
|
||||
'ediAssistant.close': '关闭',
|
||||
'ediAssistant.back': '返回',
|
||||
|
||||
@ -1243,6 +1243,7 @@ export default {
|
||||
'menu.channel.channelGuide': 'Getting Started',
|
||||
'menu.channel.salesProducts': 'Sales Products',
|
||||
'menu.channel.serviceChannels': 'Service Channels',
|
||||
'menu.channel.pricingWorkbench': 'Pricing Workbench',
|
||||
'menu.channel.priceArea': 'Price Area',
|
||||
'menu.channel.blacklist': 'Blacklist',
|
||||
'menu.channel.remoteZones': 'Remote Zones',
|
||||
@ -1838,6 +1839,7 @@ export default {
|
||||
'nav.contactService.whseName': 'Warehouse name',
|
||||
'nav.sideRail.collapse': 'Collapse menu',
|
||||
'nav.sideRail.expand': 'Expand menu',
|
||||
'nav.sideRail.refresh': 'Refresh page',
|
||||
'nav.userMenu.logout': 'Log out',
|
||||
'nav.userMenu.pageSettings': 'Page settings',
|
||||
'nav.userMenu.language': 'Language',
|
||||
|
||||
@ -518,7 +518,7 @@ export default {
|
||||
|
||||
'marketing.register.title': 'Register',
|
||||
'marketing.register.subtitle': 'Member pricing and welcome benefits',
|
||||
'marketing.register.brandHint': 'Welcome to IDE customer portal',
|
||||
'marketing.register.brandHint': 'Welcome to BCD customer portal',
|
||||
'marketing.register.brandHint.web': 'Register with email & phone',
|
||||
'marketing.register.brandHint.wechat': 'Register with WeChat',
|
||||
'marketing.register.choose.web': 'Web register',
|
||||
|
||||
@ -515,9 +515,9 @@ export default {
|
||||
|
||||
'marketing.register.title': '客户注册',
|
||||
'marketing.register.subtitle': '注册即享会员价与新人福利',
|
||||
'marketing.register.brandHint': '欢迎注册 IDE 客户门户',
|
||||
'marketing.register.brandHint.web': '网页注册 IDE 客户账号',
|
||||
'marketing.register.brandHint.wechat': '微信扫码注册 IDE 客户账号',
|
||||
'marketing.register.brandHint': '欢迎注册 BCD 客户门户',
|
||||
'marketing.register.brandHint.web': '网页注册 BCD 客户账号',
|
||||
'marketing.register.brandHint.wechat': '微信扫码注册 BCD 客户账号',
|
||||
'marketing.register.choose.web': '网页注册',
|
||||
'marketing.register.choose.webDesc': '填写资料,立即开通客户门户',
|
||||
'marketing.register.choose.wechat': '微信注册',
|
||||
|
||||
@ -1233,6 +1233,7 @@ export default {
|
||||
'menu.channel.channelGuide': '新手指引',
|
||||
'menu.channel.salesProducts': '销售产品',
|
||||
'menu.channel.serviceChannels': '服务渠道',
|
||||
'menu.channel.pricingWorkbench': '定价工作台',
|
||||
'menu.channel.priceArea': '价格分区',
|
||||
'menu.channel.blacklist': '黑名单区',
|
||||
'menu.channel.remoteZones': '偏远分区',
|
||||
@ -1592,6 +1593,7 @@ export default {
|
||||
'nav.contactService.whseName': '仓库名称',
|
||||
'nav.sideRail.collapse': '收起菜单',
|
||||
'nav.sideRail.expand': '展开菜单',
|
||||
'nav.sideRail.refresh': '刷新当前页面',
|
||||
'nav.userMenu.logout': '退出登录',
|
||||
'nav.userMenu.pageSettings': '页面配置',
|
||||
'nav.userMenu.language': '语言',
|
||||
|
||||
@ -43,6 +43,16 @@ const CHANNEL: AppRouteRecordRaw = {
|
||||
menuPermission: 'Channel.ServiceChannels',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'pricingWorkbench',
|
||||
name: 'PricingWorkbench',
|
||||
component: () => import('@/views/channel/pricingWorkbench/index.vue'),
|
||||
meta: {
|
||||
locale: 'menu.channel.pricingWorkbench',
|
||||
requiresAuth: true,
|
||||
menuPermission: 'Channel.PricingWorkbench',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'priceArea',
|
||||
name: 'PriceArea',
|
||||
|
||||
@ -39,6 +39,6 @@ export const AGENT_INVITE_TEMPLATES: Array<{
|
||||
key: 'formal',
|
||||
label: '商务简介',
|
||||
build: (code, url) =>
|
||||
`【IDE Express 渠道邀请】请通过专属链接完成注册绑定:${url}\n代理编号:${code}\n注册后即可查价下单,运单派送完成后按约定结算返佣。`,
|
||||
`【BCD Express 渠道邀请】请通过专属链接完成注册绑定:${url}\n代理编号:${code}\n注册后即可查价下单,运单派送完成后按约定结算返佣。`,
|
||||
},
|
||||
]
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/** 新增客户/注册时默认登录密码 */
|
||||
export const DEFAULT_CUSTOMER_PASSWORD = 'IDE123456'
|
||||
export const DEFAULT_CUSTOMER_PASSWORD = 'BCD123456'
|
||||
|
||||
/** 至少包含字母与数字 */
|
||||
export const LETTER_AND_DIGIT_PASSWORD_RE = /^(?=.*[A-Za-z])(?=.*\d).+$/
|
||||
|
||||
@ -41,7 +41,7 @@ export function buildInviteShareText(inviteCode: string, inviteUrl: string): str
|
||||
const code = inviteCode.trim();
|
||||
const url = inviteUrl.trim();
|
||||
if (!code || !url) return url || code;
|
||||
return `【IDE Express】送你一个专属邀请,微信打开链接注册即可:${url}\n邀请码:${code}`;
|
||||
return `【BCD Express】送你一个专属邀请,微信打开链接注册即可:${url}\n邀请码:${code}`;
|
||||
}
|
||||
|
||||
/** 渠道代理分享话术(默认微信私聊) */
|
||||
|
||||
@ -44,6 +44,7 @@ export const SUB_MENU_DEFAULT_ICONS: Record<string, string> = {
|
||||
'menu.channel.channelGuide': 'IconBook',
|
||||
'menu.channel.salesProducts': 'IconTag',
|
||||
'menu.channel.serviceChannels': 'IconSend',
|
||||
'menu.channel.pricingWorkbench': 'IconApps',
|
||||
'menu.channel.priceArea': 'IconLocation',
|
||||
'menu.channel.blacklist': 'IconCloseCircle',
|
||||
'menu.channel.remoteZones': 'IconCompass',
|
||||
|
||||
@ -154,6 +154,8 @@ const routeNameMap: Record<string, string> = {
|
||||
'/channel/autoTrigger': 'AutoTrigger',
|
||||
'channel_issue_template': 'IssueTemplate',
|
||||
'/channel/issueTemplate': 'IssueTemplate',
|
||||
'channel_pricing_workbench': 'PricingWorkbench',
|
||||
'/channel/pricingWorkbench': 'PricingWorkbench',
|
||||
|
||||
// 可以继续添加其他映射...
|
||||
};
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/** 工号规则:IDE + 至少 3 位数字,如 IDE001、IDE012、IDE1000 */
|
||||
const EMPLOYEE_NO_PATTERN = /^IDE(\d{3,})$/i
|
||||
/** 工号规则:BCD + 至少 3 位数字;生成时兼容历史 IDE 前缀序号。 */
|
||||
const EMPLOYEE_NO_PATTERN = /^(?:BCD|IDE)(\d{3,})$/i
|
||||
|
||||
export function generateEmployeeNo(
|
||||
existing: Array<{ employeeNo?: string | null; EmployeeNo?: string | null }>,
|
||||
@ -13,5 +13,9 @@ export function generateEmployeeNo(
|
||||
}
|
||||
}
|
||||
const next = max + 1
|
||||
return `IDE${String(next).padStart(3, '0')}`
|
||||
return `BCD${String(next).padStart(3, '0')}`
|
||||
}
|
||||
|
||||
export function isValidEmployeeNo(employeeNo: string): boolean {
|
||||
return /^(?:BCD|IDE)(\d{3,})$/i.test(employeeNo.trim())
|
||||
}
|
||||
|
||||
@ -203,12 +203,12 @@ export const SAMPLE_PICKUP_FEE_BODY = `{
|
||||
|
||||
export const SAMPLE_TRACK_BODY = `{
|
||||
"clientNo": "CLI-20261005-001",
|
||||
"serviceNo": "IDE2607281746002926"
|
||||
"serviceNo": "BCD2607281746002926"
|
||||
}`;
|
||||
|
||||
export const SAMPLE_FILES_BODY = `{
|
||||
"clientNo": "CLI-20261005-001",
|
||||
"serviceNo": "IDE2607281746002926",
|
||||
"serviceNo": "BCD2607281746002926",
|
||||
"fileType": "systemLabel"
|
||||
}`;
|
||||
|
||||
@ -218,7 +218,7 @@ export const SAMPLE_PARCEL_RESPONSE = `{
|
||||
"data": {
|
||||
"orderId": 10001,
|
||||
"clientNo": "CLI-20261005-001",
|
||||
"serviceNo": "IDE2607281746002926",
|
||||
"serviceNo": "BCD2607281746002926",
|
||||
"trackNo": "",
|
||||
"labelUrl": "https://files.example.com/labels/10001.pdf",
|
||||
"consigneeCountry": "US",
|
||||
@ -250,7 +250,7 @@ export const SAMPLE_TRACK_RESPONSE = `{
|
||||
"data": {
|
||||
"orderId": 10001,
|
||||
"clientNo": "CLI-20261005-001",
|
||||
"serviceNo": "IDE2607281746002926",
|
||||
"serviceNo": "BCD2607281746002926",
|
||||
"trackNo": "1Z999AA10123456784",
|
||||
"events": [
|
||||
{
|
||||
@ -272,7 +272,7 @@ export const SAMPLE_FILES_RESPONSE = `{
|
||||
"data": {
|
||||
"orderId": 10001,
|
||||
"clientNo": "CLI-20261005-001",
|
||||
"serviceNo": "IDE2607281746002926",
|
||||
"serviceNo": "BCD2607281746002926",
|
||||
"fileType": "systemLabel",
|
||||
"files": [
|
||||
{
|
||||
|
||||
@ -0,0 +1,413 @@
|
||||
<template>
|
||||
<div class="pw-ai-panel">
|
||||
<div class="pw-ai-head">
|
||||
<span class="pw-ai-title">{{ titleText }}</span>
|
||||
<a class="config-link" href="javascript:;" @click="goConfig">配置</a>
|
||||
</div>
|
||||
<p class="pw-ai-intro">{{ introText }}</p>
|
||||
|
||||
<details class="advanced-panel">
|
||||
<summary>模型设置</summary>
|
||||
<div class="field">
|
||||
<label class="label">Provider</label>
|
||||
<a-select
|
||||
v-model="providerKey"
|
||||
:loading="providersLoading"
|
||||
placeholder="选择 Provider"
|
||||
allow-search
|
||||
@change="onProviderChange"
|
||||
>
|
||||
<a-option
|
||||
v-for="p in enabledProviders"
|
||||
:key="p.providerKey"
|
||||
:value="p.providerKey"
|
||||
:label="p.displayName || p.providerKey"
|
||||
/>
|
||||
</a-select>
|
||||
<a-select
|
||||
v-model="modelId"
|
||||
class="mt-8"
|
||||
placeholder="模型"
|
||||
allow-create
|
||||
allow-search
|
||||
>
|
||||
<a-option v-for="m in modelOptions" :key="m.modelId" :value="m.modelId">
|
||||
{{ m.modelId }}
|
||||
</a-option>
|
||||
</a-select>
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<div class="field">
|
||||
<label class="label">指令</label>
|
||||
<a-textarea
|
||||
v-model="prompt"
|
||||
:auto-size="{ minRows: 2, maxRows: 5 }"
|
||||
:placeholder="defaultPrompt"
|
||||
:disabled="loading"
|
||||
@keydown.ctrl.enter.exact.prevent="run"
|
||||
/>
|
||||
<div class="quick-prompts">
|
||||
<button
|
||||
v-for="(q, i) in quickPrompts.slice(0, 3)"
|
||||
:key="i"
|
||||
type="button"
|
||||
class="quick-chip"
|
||||
:disabled="loading"
|
||||
@click="prompt = q"
|
||||
>
|
||||
{{ q.length > 16 ? `${q.slice(0, 16)}…` : q }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a-button
|
||||
type="primary"
|
||||
long
|
||||
class="app-btn-primary-soft"
|
||||
:loading="loading"
|
||||
:disabled="!canSend"
|
||||
@click="run"
|
||||
>
|
||||
{{ loading ? '分析中…' : '分析并应用规则' }}
|
||||
</a-button>
|
||||
|
||||
<div v-if="errorMsg" class="error-box">{{ errorMsg }}</div>
|
||||
|
||||
<div v-if="parsed || rawReply" class="result-block">
|
||||
<div class="section-label">结果</div>
|
||||
<p v-if="parsed?.summary" class="summary">{{ parsed.summary }}</p>
|
||||
<ul v-if="parsed?.risks?.length" class="risk-list">
|
||||
<li v-for="(r, idx) in parsed.risks" :key="idx">{{ r }}</li>
|
||||
</ul>
|
||||
<p v-if="parsed?.advice" class="advice">建议:{{ parsed.advice }}</p>
|
||||
<details v-if="rawReply" class="raw-details">
|
||||
<summary>原始回复</summary>
|
||||
<pre class="raw-pre">{{ rawReply }}</pre>
|
||||
</details>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Message } from '@arco-design/web-vue'
|
||||
import { computed, onMounted, ref, watch } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { chatAi, listAiProviders } from '@/api/ai'
|
||||
import type { PricingWorkbenchDiffRisk, PricingWorkbenchPreviewOutput } from '@/api/channel/pricingWorkbench'
|
||||
import {
|
||||
resolveProviderModelTags,
|
||||
type AiProviderItem,
|
||||
} from '@/views/system/aiAssistant/providerCatalog'
|
||||
import {
|
||||
PRICING_WORKBENCH_AI_DEFAULT_PROMPT,
|
||||
PRICING_WORKBENCH_AI_QUICK_PROMPTS,
|
||||
buildPricingWorkbenchAiShortSystemPrompt,
|
||||
buildPricingWorkbenchAiSystemPrompt,
|
||||
buildPricingWorkbenchUserContent,
|
||||
parsePricingWorkbenchAiReply,
|
||||
slimPreviewForAi,
|
||||
type ParsedPricingWorkbenchAi,
|
||||
type PricingWorkbenchAiRulePatch,
|
||||
} from '../pricingWorkbenchAiSkill'
|
||||
|
||||
const STORAGE_KEY = 'oms.pricingWorkbench.ai'
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
mode?: 'rules' | 'diff'
|
||||
marginRate: number
|
||||
channelIds: number[]
|
||||
channelNames?: string[]
|
||||
excludeChannelIds?: number[]
|
||||
preview?: PricingWorkbenchPreviewOutput | null
|
||||
diffRisks?: PricingWorkbenchDiffRisk[]
|
||||
}>(),
|
||||
{ mode: 'rules' },
|
||||
)
|
||||
|
||||
const emit = defineEmits<{
|
||||
applyPatch: [patch: PricingWorkbenchAiRulePatch]
|
||||
}>()
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
const titleText = computed(() => (props.mode === 'diff' ? 'AI 差异说明' : 'AI 调规则'))
|
||||
const introText = computed(() =>
|
||||
props.mode === 'diff'
|
||||
? '解释相对现网卖价涨跌与风险;改规则将触发硬计算重算。'
|
||||
: '自然语言调毛利或排除渠道;数字一律走后端硬计算。',
|
||||
)
|
||||
const defaultPrompt = computed(() =>
|
||||
props.mode === 'diff'
|
||||
? '请根据超阈值差异给出中文风险摘要,并建议是否调毛利或排除某渠道。'
|
||||
: PRICING_WORKBENCH_AI_DEFAULT_PROMPT,
|
||||
)
|
||||
const quickPrompts = computed(() =>
|
||||
props.mode === 'diff'
|
||||
? [
|
||||
'相对现网卖价涨幅过大的格子给风险摘要',
|
||||
'解释为何部分格子用了某渠道买价',
|
||||
'把默认毛利调到 20%,并说明影响',
|
||||
]
|
||||
: PRICING_WORKBENCH_AI_QUICK_PROMPTS,
|
||||
)
|
||||
|
||||
const providersLoading = ref(false)
|
||||
const providers = ref<AiProviderItem[]>([])
|
||||
const providerKey = ref('')
|
||||
const modelId = ref('')
|
||||
const prompt = ref('')
|
||||
const loading = ref(false)
|
||||
const errorMsg = ref('')
|
||||
const rawReply = ref('')
|
||||
const parsed = ref<ParsedPricingWorkbenchAi | null>(null)
|
||||
|
||||
const enabledProviders = computed(() =>
|
||||
providers.value.filter((p) => p.enabled && Boolean(p.apiKey)),
|
||||
)
|
||||
const selectedProvider = computed(
|
||||
() => enabledProviders.value.find((p) => p.providerKey === providerKey.value) ?? null,
|
||||
)
|
||||
const modelOptions = computed(() => {
|
||||
const p = selectedProvider.value
|
||||
if (!p) return []
|
||||
return resolveProviderModelTags(p)
|
||||
})
|
||||
const canSend = computed(
|
||||
() => Boolean(providerKey.value && modelId.value && prompt.value.trim()) && !loading.value,
|
||||
)
|
||||
|
||||
function goConfig() {
|
||||
router.push({ path: '/system/aiAssistant' })
|
||||
}
|
||||
|
||||
function loadPrefs() {
|
||||
try {
|
||||
const raw = localStorage.getItem(STORAGE_KEY)
|
||||
if (!raw) return
|
||||
const data = JSON.parse(raw) as { providerKey?: string; modelId?: string; prompt?: string }
|
||||
if (data.providerKey) providerKey.value = data.providerKey
|
||||
if (data.modelId) modelId.value = data.modelId
|
||||
if (data.prompt?.trim()) prompt.value = data.prompt
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
}
|
||||
|
||||
function savePrefs() {
|
||||
try {
|
||||
localStorage.setItem(
|
||||
STORAGE_KEY,
|
||||
JSON.stringify({
|
||||
providerKey: providerKey.value,
|
||||
modelId: modelId.value,
|
||||
prompt: prompt.value.trim() || defaultPrompt.value,
|
||||
}),
|
||||
)
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
}
|
||||
|
||||
function onProviderChange() {
|
||||
const opts = modelOptions.value
|
||||
if (!opts.some((m) => m.modelId === modelId.value)) {
|
||||
modelId.value = opts[0]?.modelId ?? ''
|
||||
}
|
||||
savePrefs()
|
||||
}
|
||||
|
||||
async function loadProviders() {
|
||||
providersLoading.value = true
|
||||
try {
|
||||
const items = await listAiProviders()
|
||||
providers.value = (items ?? []) as AiProviderItem[]
|
||||
if (!providerKey.value) {
|
||||
const def =
|
||||
enabledProviders.value.find((p) => p.isDefault) ?? enabledProviders.value[0]
|
||||
providerKey.value = def?.providerKey ?? ''
|
||||
}
|
||||
onProviderChange()
|
||||
} catch (e: any) {
|
||||
errorMsg.value = e?.message || '加载 AI Provider 失败'
|
||||
} finally {
|
||||
providersLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function run() {
|
||||
if (!canSend.value) return
|
||||
loading.value = true
|
||||
errorMsg.value = ''
|
||||
rawReply.value = ''
|
||||
parsed.value = null
|
||||
savePrefs()
|
||||
try {
|
||||
const userContent = buildPricingWorkbenchUserContent({
|
||||
userPrompt: prompt.value.trim(),
|
||||
marginRate: props.marginRate,
|
||||
channelIds: props.channelIds,
|
||||
channelNames: props.channelNames,
|
||||
excludeChannelIds: props.excludeChannelIds,
|
||||
summary: props.preview?.summary,
|
||||
diffRisks: props.diffRisks ?? props.preview?.diffRisks,
|
||||
previewSlim: slimPreviewForAi(props.preview),
|
||||
})
|
||||
const res = await chatAi({
|
||||
providerKey: providerKey.value,
|
||||
model: modelId.value,
|
||||
scene: 'pricingWorkbench',
|
||||
messages: [
|
||||
{ role: 'system', content: buildPricingWorkbenchAiSystemPrompt() },
|
||||
{ role: 'system', content: buildPricingWorkbenchAiShortSystemPrompt() },
|
||||
{ role: 'user', content: userContent },
|
||||
],
|
||||
})
|
||||
rawReply.value = res?.content || ''
|
||||
parsed.value = parsePricingWorkbenchAiReply(rawReply.value)
|
||||
if (parsed.value.patch && (parsed.value.patch.needRecalc || parsed.value.patch.marginRate != null)) {
|
||||
emit('applyPatch', parsed.value.patch)
|
||||
Message.success('已解析规则变更,正在按硬计算重算')
|
||||
} else {
|
||||
Message.success('分析完成')
|
||||
}
|
||||
} catch (e: any) {
|
||||
errorMsg.value = e?.message || 'AI 调用失败'
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
watch(prompt, () => savePrefs())
|
||||
|
||||
watch(
|
||||
() => props.mode,
|
||||
() => {
|
||||
if (!prompt.value.trim()) prompt.value = defaultPrompt.value
|
||||
},
|
||||
{ immediate: true },
|
||||
)
|
||||
|
||||
onMounted(() => {
|
||||
loadPrefs()
|
||||
if (!prompt.value.trim()) prompt.value = defaultPrompt.value
|
||||
loadProviders()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.pw-ai-panel {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
height: 100%;
|
||||
min-height: 0;
|
||||
overflow: auto;
|
||||
padding: 12px;
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.pw-ai-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.pw-ai-title {
|
||||
font-weight: 600;
|
||||
color: var(--color-text-1);
|
||||
}
|
||||
.config-link {
|
||||
font-size: 12px;
|
||||
color: var(--app-primary-color);
|
||||
}
|
||||
.pw-ai-intro {
|
||||
margin: 0;
|
||||
font-size: 12px;
|
||||
color: var(--color-text-3);
|
||||
line-height: 1.5;
|
||||
}
|
||||
.advanced-panel {
|
||||
border: 1px solid var(--color-border-2);
|
||||
border-radius: 6px;
|
||||
padding: 8px 10px;
|
||||
font-size: 12px;
|
||||
summary {
|
||||
cursor: pointer;
|
||||
color: var(--color-text-2);
|
||||
user-select: none;
|
||||
}
|
||||
}
|
||||
.field {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
}
|
||||
.label {
|
||||
font-size: 12px;
|
||||
color: var(--color-text-2);
|
||||
}
|
||||
.mt-8 {
|
||||
margin-top: 8px;
|
||||
}
|
||||
.quick-prompts {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px;
|
||||
}
|
||||
.quick-chip {
|
||||
border: 1px solid var(--color-border-2);
|
||||
background: #f7f8fa;
|
||||
border-radius: 4px;
|
||||
padding: 2px 8px;
|
||||
font-size: 12px;
|
||||
cursor: pointer;
|
||||
color: var(--color-text-2);
|
||||
}
|
||||
.quick-chip:hover:not(:disabled) {
|
||||
border-color: var(--app-primary-color);
|
||||
color: var(--app-primary-color);
|
||||
}
|
||||
.error-box {
|
||||
padding: 8px;
|
||||
background: #ffece8;
|
||||
color: #cb272d;
|
||||
border-radius: 4px;
|
||||
font-size: 12px;
|
||||
}
|
||||
.result-block {
|
||||
border-top: 1px solid var(--color-border-2);
|
||||
padding-top: 8px;
|
||||
}
|
||||
.section-label {
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
.summary {
|
||||
margin: 0 0 8px;
|
||||
font-size: 13px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
.risk-list {
|
||||
margin: 0;
|
||||
padding-left: 18px;
|
||||
font-size: 12px;
|
||||
color: var(--color-text-2);
|
||||
line-height: 1.6;
|
||||
}
|
||||
.advice {
|
||||
font-size: 12px;
|
||||
color: var(--color-text-2);
|
||||
}
|
||||
.raw-pre {
|
||||
white-space: pre-wrap;
|
||||
font-size: 11px;
|
||||
max-height: 160px;
|
||||
overflow: auto;
|
||||
background: #f7f8fa;
|
||||
padding: 8px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
</style>
|
||||
1540
src/views/channel/pricingWorkbench/index.vue
Normal file
1540
src/views/channel/pricingWorkbench/index.vue
Normal file
File diff suppressed because it is too large
Load Diff
186
src/views/channel/pricingWorkbench/pricingWorkbenchAiSkill.ts
Normal file
186
src/views/channel/pricingWorkbench/pricingWorkbenchAiSkill.ts
Normal file
@ -0,0 +1,186 @@
|
||||
import type { PricingWorkbenchDiffRisk, PricingWorkbenchPreviewOutput } from '@/api/channel/pricingWorkbench'
|
||||
|
||||
/** 与定价工作台 AI 侧栏对齐的运行时 skill */
|
||||
|
||||
export type PricingWorkbenchAiRulePatch = {
|
||||
/** 新的默认毛利率 0~1 */
|
||||
marginRate?: number
|
||||
/** 排除渠道 Id */
|
||||
excludeChannelIds?: number[]
|
||||
/** 分区毛利覆盖 */
|
||||
zoneMarginRates?: Record<string, number>
|
||||
/** 是否需要服务端硬计算重算 */
|
||||
needRecalc?: boolean
|
||||
/** 中文说明 */
|
||||
explanation?: string
|
||||
}
|
||||
|
||||
export type ParsedPricingWorkbenchAi = {
|
||||
patch: PricingWorkbenchAiRulePatch
|
||||
summary?: string
|
||||
risks: string[]
|
||||
advice?: string
|
||||
raw: string
|
||||
}
|
||||
|
||||
const SKILL_CORE = `你是 OMS「定价工作台」助手:根据多渠道最低买价与毛利率规则,帮助调整规则并解释相对现网卖价的风险。
|
||||
|
||||
## 硬约束(必须遵守)
|
||||
1. 禁止直接编造最终卖价数字当唯一真相;数字必须由后端硬计算:sell = ceil(buy / (1-m), 分)
|
||||
2. 你只输出「规则变更」与中文说明;需要改价时标记 needRecalc=true
|
||||
3. 成本合成策略固定为各格最低买价(min)
|
||||
|
||||
## 产出格式(必须严格遵守,先 JSON 再中文)
|
||||
|
||||
\`\`\`json
|
||||
{
|
||||
"marginRate": 0.25,
|
||||
"excludeChannelIds": [],
|
||||
"zoneMarginRates": {},
|
||||
"needRecalc": true,
|
||||
"explanation": "一句话说明规则调整"
|
||||
}
|
||||
\`\`\`
|
||||
|
||||
总评:高风险 | 中风险 | 低风险 | 无显著差异
|
||||
摘要:…
|
||||
风险点:
|
||||
1. …
|
||||
建议:…
|
||||
|
||||
- marginRate 为 0~1 小数(25% → 0.25)
|
||||
- 用户只是问「为什么用了渠道 A」时:needRecalc=false,在 explanation/风险点解释
|
||||
- 不要编造上下文中不存在的渠道 Id 或分区
|
||||
`
|
||||
|
||||
export function buildPricingWorkbenchAiSystemPrompt(): string {
|
||||
return SKILL_CORE
|
||||
}
|
||||
|
||||
export function buildPricingWorkbenchAiShortSystemPrompt(): string {
|
||||
return (
|
||||
'你是 OMS 定价工作台助手。输出 JSON 规则变更(marginRate/excludeChannelIds/zoneMarginRates/needRecalc)' +
|
||||
'再附中文总评/摘要/风险点/建议。禁止编造最终卖价数字。'
|
||||
)
|
||||
}
|
||||
|
||||
export const PRICING_WORKBENCH_AI_DEFAULT_SKILL_KEY = 'oms-pricing-workbench'
|
||||
export const PRICING_WORKBENCH_AI_DEFAULT_PROMPT =
|
||||
'请根据当前预览与差异风险,检查毛利是否合理,并给出是否需要调毛利或排除某渠道的建议。'
|
||||
|
||||
export const PRICING_WORKBENCH_AI_QUICK_PROMPTS = [
|
||||
'把默认毛利调到 20%,并说明影响',
|
||||
'解释为何部分格子用了某渠道买价',
|
||||
'相对现网卖价涨幅过大的格子给风险摘要',
|
||||
'排除最贵的渠道后重新评估',
|
||||
]
|
||||
|
||||
export function buildPricingWorkbenchUserContent(input: {
|
||||
userPrompt: string
|
||||
marginRate: number
|
||||
channelIds: number[]
|
||||
channelNames?: string[]
|
||||
excludeChannelIds?: number[]
|
||||
summary?: string
|
||||
diffRisks?: PricingWorkbenchDiffRisk[]
|
||||
previewSlim?: string
|
||||
}): string {
|
||||
const lines: string[] = [
|
||||
`用户指令:${input.userPrompt}`,
|
||||
`当前默认毛利率:${input.marginRate}`,
|
||||
`参与渠道 Id:${input.channelIds.join(',') || '无'}`,
|
||||
]
|
||||
if (input.channelNames?.length) {
|
||||
lines.push(`渠道名:${input.channelNames.join(' / ')}`)
|
||||
}
|
||||
if (input.excludeChannelIds?.length) {
|
||||
lines.push(`已排除渠道:${input.excludeChannelIds.join(',')}`)
|
||||
}
|
||||
if (input.summary) lines.push(`预览摘要:${input.summary}`)
|
||||
if (input.diffRisks?.length) {
|
||||
lines.push('超阈值差异:')
|
||||
input.diffRisks.slice(0, 30).forEach((r, i) => {
|
||||
lines.push(`${i + 1}. ${r.message}`)
|
||||
})
|
||||
}
|
||||
if (input.previewSlim) {
|
||||
lines.push('预览精简:')
|
||||
lines.push(input.previewSlim.slice(0, 6000))
|
||||
}
|
||||
return lines.join('\n')
|
||||
}
|
||||
|
||||
export function slimPreviewForAi(preview: PricingWorkbenchPreviewOutput | null | undefined): string {
|
||||
if (!preview) return ''
|
||||
const cells = (preview.cells || [])
|
||||
.filter((c) => c.sellPrice != null || c.flag)
|
||||
.slice(0, 80)
|
||||
.map((c) => ({
|
||||
z: c.zoneLabel || c.zone,
|
||||
w: c.weightSegment,
|
||||
buy: c.buyPrice,
|
||||
sell: c.sellPrice,
|
||||
src: c.sourceChannelId,
|
||||
flag: c.flag,
|
||||
d: c.onlineDeltaRatio,
|
||||
}))
|
||||
return JSON.stringify(
|
||||
{
|
||||
currency: preview.currency,
|
||||
marginRate: preview.marginRate,
|
||||
zones: preview.zones?.slice(0, 40),
|
||||
weights: preview.weightSegments?.slice(0, 40),
|
||||
blockers: preview.blockers,
|
||||
warnings: preview.warnings?.slice(0, 10),
|
||||
cells,
|
||||
diffRisks: preview.diffRisks?.slice(0, 20),
|
||||
},
|
||||
null,
|
||||
0,
|
||||
)
|
||||
}
|
||||
|
||||
export function parsePricingWorkbenchAiReply(raw: string): ParsedPricingWorkbenchAi {
|
||||
const text = String(raw || '').trim()
|
||||
const patch: PricingWorkbenchAiRulePatch = { needRecalc: false }
|
||||
let summary: string | undefined
|
||||
const risks: string[] = []
|
||||
let advice: string | undefined
|
||||
|
||||
const jsonMatch = text.match(/```json\s*([\s\S]*?)```/i) || text.match(/\{[\s\S]*"needRecalc"[\s\S]*\}/)
|
||||
if (jsonMatch) {
|
||||
try {
|
||||
const body = jsonMatch[1] || jsonMatch[0]
|
||||
const obj = JSON.parse(body)
|
||||
if (typeof obj.marginRate === 'number') patch.marginRate = obj.marginRate
|
||||
if (Array.isArray(obj.excludeChannelIds)) {
|
||||
patch.excludeChannelIds = obj.excludeChannelIds.map((x: any) => Number(x)).filter((n: number) => n > 0)
|
||||
}
|
||||
if (obj.zoneMarginRates && typeof obj.zoneMarginRates === 'object') {
|
||||
patch.zoneMarginRates = obj.zoneMarginRates
|
||||
}
|
||||
if (typeof obj.needRecalc === 'boolean') patch.needRecalc = obj.needRecalc
|
||||
if (typeof obj.explanation === 'string') patch.explanation = obj.explanation
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
}
|
||||
|
||||
const summaryMatch = text.match(/摘要[::]\s*(.+)/)
|
||||
if (summaryMatch) summary = summaryMatch[1].trim()
|
||||
const adviceMatch = text.match(/建议[::]\s*(.+)/)
|
||||
if (adviceMatch) advice = adviceMatch[1].trim()
|
||||
|
||||
const riskBlock = text.match(/风险点[::]([\s\S]*?)(?:建议[::]|$)/)
|
||||
if (riskBlock) {
|
||||
riskBlock[1]
|
||||
.split('\n')
|
||||
.map((l) => l.replace(/^\s*\d+[\.\)、]\s*/, '').trim())
|
||||
.filter((l) => l && l !== '无')
|
||||
.forEach((l) => risks.push(l))
|
||||
}
|
||||
|
||||
if (!summary && patch.explanation) summary = patch.explanation
|
||||
|
||||
return { patch, summary, risks, advice, raw: text }
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
export default {
|
||||
'h5Admin.center.title': 'Ops Center',
|
||||
'h5Admin.documentTitle': 'IDE Ops Center',
|
||||
'h5Admin.documentTitle': 'BCD Ops Center',
|
||||
'h5Admin.tab.workplace': 'Home',
|
||||
'h5Admin.tab.monitor': 'Monitor',
|
||||
'h5Admin.tab.orders': 'Shipments',
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
export default {
|
||||
'h5Admin.center.title': '运营中心',
|
||||
'h5Admin.documentTitle': 'IDE运营中心',
|
||||
'h5Admin.documentTitle': 'BCD运营中心',
|
||||
'h5Admin.tab.workplace': '工作台',
|
||||
'h5Admin.tab.monitor': '监控',
|
||||
'h5Admin.tab.orders': '运单',
|
||||
|
||||
@ -0,0 +1,112 @@
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { Message } from '@arco-design/web-vue';
|
||||
import { rebindOpenidByPhone, type WxLoginResult } from '@/api/wechat';
|
||||
|
||||
defineOptions({ name: 'WechatOpenidMigrateModal' });
|
||||
|
||||
const props = defineProps<{
|
||||
visible: boolean;
|
||||
nickname?: string | null;
|
||||
ticket?: string | null;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
'update:visible': [value: boolean];
|
||||
success: [result: WxLoginResult];
|
||||
cancel: [];
|
||||
}>();
|
||||
|
||||
const { t } = useI18n();
|
||||
const phone = ref('');
|
||||
const submitting = ref(false);
|
||||
|
||||
const tip = computed(() =>
|
||||
t('wechat.openidMigrate.tip', {
|
||||
nickname: props.nickname?.trim() || t('wechat.register.wxUser'),
|
||||
}),
|
||||
);
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(v) => {
|
||||
if (v) {
|
||||
phone.value = '';
|
||||
submitting.value = false;
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
function close() {
|
||||
emit('update:visible', false);
|
||||
}
|
||||
|
||||
function handleCancel() {
|
||||
close();
|
||||
emit('cancel');
|
||||
}
|
||||
|
||||
async function handleBeforeOk(): Promise<boolean> {
|
||||
const ticket = props.ticket?.trim();
|
||||
const phoneVal = phone.value.trim();
|
||||
if (!ticket) {
|
||||
Message.error(t('wechat.openidMigrate.ticketExpired'));
|
||||
return false;
|
||||
}
|
||||
if (!phoneVal) {
|
||||
Message.warning(t('wechat.openidMigrate.phoneRequired'));
|
||||
return false;
|
||||
}
|
||||
|
||||
submitting.value = true;
|
||||
try {
|
||||
const result = await rebindOpenidByPhone({ ticket, phone: phoneVal });
|
||||
if (!result?.accessToken) {
|
||||
Message.error(t('wechat.openidMigrate.failed'));
|
||||
return false;
|
||||
}
|
||||
emit('success', result);
|
||||
return true;
|
||||
} catch (e: any) {
|
||||
Message.error(e?.message || t('wechat.openidMigrate.failed'));
|
||||
return false;
|
||||
} finally {
|
||||
submitting.value = false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<a-modal
|
||||
:visible="visible"
|
||||
:title="t('wechat.openidMigrate.title')"
|
||||
:ok-text="t('wechat.openidMigrate.confirm')"
|
||||
:cancel-text="t('wechat.openidMigrate.cancel')"
|
||||
:ok-loading="submitting"
|
||||
unmount-on-close
|
||||
:mask-closable="false"
|
||||
:on-before-ok="handleBeforeOk"
|
||||
@update:visible="(v: boolean) => emit('update:visible', v)"
|
||||
@cancel="handleCancel"
|
||||
>
|
||||
<p class="wx-openid-migrate__tip">{{ tip }}</p>
|
||||
<a-input
|
||||
v-model="phone"
|
||||
size="large"
|
||||
allow-clear
|
||||
:placeholder="t('wechat.openidMigrate.phonePlaceholder')"
|
||||
maxlength="16"
|
||||
@press-enter="handleOk"
|
||||
/>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.wx-openid-migrate__tip {
|
||||
margin: 0 0 12px;
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
color: var(--color-text-2);
|
||||
}
|
||||
</style>
|
||||
@ -1,6 +1,6 @@
|
||||
export default {
|
||||
'h5.center.title': 'Customer Center',
|
||||
'h5.documentTitle': 'IDE Customer Center',
|
||||
'h5.documentTitle': 'BCD Customer Center',
|
||||
'h5.noticePopup.title': 'Notice',
|
||||
'h5.noticePopup.markRead': 'Mark as read',
|
||||
'h5.noticePopup.later': 'Later',
|
||||
@ -315,9 +315,9 @@ export default {
|
||||
'h5.wxQr.success': 'Signed in',
|
||||
|
||||
'h5.login.title': 'Sign in',
|
||||
'h5.login.brand': 'IDE Customer Center',
|
||||
'h5.login.brandName': 'IDE',
|
||||
'h5.login.brandHint': 'Welcome to your IDE portal',
|
||||
'h5.login.brand': 'BCD Customer Center',
|
||||
'h5.login.brandName': 'BCD',
|
||||
'h5.login.brandHint': 'Welcome to your BCD portal',
|
||||
'h5.login.backToSite': 'Back to website',
|
||||
'h5.login.tab.wechat': 'WeChat',
|
||||
'h5.login.tab.password': 'Account',
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
export default {
|
||||
'h5.center.title': '客户中心',
|
||||
'h5.documentTitle': 'IDE客户中心',
|
||||
'h5.documentTitle': 'BCD客户中心',
|
||||
'h5.noticePopup.title': '公告',
|
||||
'h5.noticePopup.markRead': '已读',
|
||||
'h5.noticePopup.later': '稍后',
|
||||
@ -314,9 +314,9 @@ export default {
|
||||
'h5.wxQr.success': '登录成功',
|
||||
|
||||
'h5.login.title': '登录',
|
||||
'h5.login.brand': 'IDE客户中心',
|
||||
'h5.login.brandName': 'IDE',
|
||||
'h5.login.brandHint': '欢迎登录 IDE 客户门户',
|
||||
'h5.login.brand': 'BCD客户中心',
|
||||
'h5.login.brandName': 'BCD',
|
||||
'h5.login.brandHint': '欢迎登录 BCD 客户门户',
|
||||
'h5.login.backToSite': '返回官网',
|
||||
'h5.login.tab.wechat': '微信登录',
|
||||
'h5.login.tab.password': '账号登录',
|
||||
|
||||
@ -112,6 +112,14 @@
|
||||
>
|
||||
<div class="h5-login-agreement">{{ agreementContent }}</div>
|
||||
</a-modal>
|
||||
|
||||
<WechatOpenidMigrateModal
|
||||
v-model:visible="migrateVisible"
|
||||
:nickname="migrateNickname"
|
||||
:ticket="migrateTicket"
|
||||
@success="onMigrateSuccess"
|
||||
@cancel="onMigrateCancel"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -132,7 +140,8 @@ import logoImg from '@/assets/logo2.png';
|
||||
import LoginLangToggle from '@/views/login/components/LoginLangToggle.vue';
|
||||
import H5LoginPortalSwitch from '@/views/h5/components/H5LoginPortalSwitch.vue';
|
||||
import WechatOAuthLoginButton from '../components/WechatOAuthLoginButton.vue';
|
||||
import { wxOAuthLogin } from '@/api/wechat';
|
||||
import WechatOpenidMigrateModal from '../components/WechatOpenidMigrateModal.vue';
|
||||
import { wxOAuthLogin, type WxLoginResult } from '@/api/wechat';
|
||||
import {
|
||||
parseAfterLoginPathFromOAuthState,
|
||||
redirectToWeChatOAuth,
|
||||
@ -148,6 +157,9 @@ const rbacUserStore = useRbacUserStore();
|
||||
const form = reactive({ account: '', password: '' });
|
||||
const agreementChecked = ref(false);
|
||||
const loading = ref(false);
|
||||
const migrateVisible = ref(false);
|
||||
const migrateTicket = ref('');
|
||||
const migrateNickname = ref('');
|
||||
const errorBox = ref('');
|
||||
const agreementVisible = ref(false);
|
||||
const agreementTitle = ref('');
|
||||
@ -238,6 +250,27 @@ async function finishLogin() {
|
||||
}
|
||||
}
|
||||
|
||||
async function applyWxLoginResult(result: WxLoginResult) {
|
||||
const ok = await rbacUserStore.loginByWxResult(result);
|
||||
if (!ok) {
|
||||
Message.error(t('h5.login.failed'));
|
||||
oauthBusy.value = false;
|
||||
await router.replace({ path: route.path, query: stripOAuthQuery() });
|
||||
return;
|
||||
}
|
||||
await finishLogin();
|
||||
}
|
||||
|
||||
async function onMigrateSuccess(result: WxLoginResult) {
|
||||
oauthBusy.value = true;
|
||||
await applyWxLoginResult(result);
|
||||
}
|
||||
|
||||
function onMigrateCancel() {
|
||||
oauthBusy.value = false;
|
||||
Message.info(t('wechat.openidMigrate.cancelled'));
|
||||
}
|
||||
|
||||
async function consumeOAuthCode(code: string) {
|
||||
if (oauthConsuming) return;
|
||||
oauthConsuming = true;
|
||||
@ -245,15 +278,16 @@ async function consumeOAuthCode(code: string) {
|
||||
errorBox.value = '';
|
||||
try {
|
||||
const result = await wxOAuthLogin(code);
|
||||
const ok = await rbacUserStore.loginByWxResult(result);
|
||||
if (!ok) {
|
||||
Message.error(t('h5.login.failed'));
|
||||
if (result.needOpenidMigrate && result.migrateTicket) {
|
||||
migrateTicket.value = result.migrateTicket;
|
||||
migrateNickname.value = result.nickname || '';
|
||||
oauthBusy.value = false;
|
||||
migrateVisible.value = true;
|
||||
await router.replace({ path: route.path, query: stripOAuthQuery() });
|
||||
return;
|
||||
}
|
||||
// 成功后保持全屏过渡直到离开本页,勿 toast / 勿先露出登录表单
|
||||
await finishLogin();
|
||||
await applyWxLoginResult(result);
|
||||
} catch (e: any) {
|
||||
const msg = loginErrorForUser(e?.message || '') || t('h5.login.oauthFailed');
|
||||
Message.error(msg);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
export default {
|
||||
'brand.name': 'IDE',
|
||||
'brand.name': 'BCD',
|
||||
'brand.fullName': 'Immediate Delivery Express',
|
||||
'brand.shortName': 'IDE',
|
||||
'brand.shortName': 'BCD',
|
||||
'login.form.password.errMsg': 'Password cannot be empty',
|
||||
'login.form.login.success': 'Login successful',
|
||||
'login.form.login.failed': 'Login failed, please check your account and password',
|
||||
@ -16,9 +16,9 @@
|
||||
'login.form.account.errMsg.agent': 'Please enter agent code',
|
||||
'login.form.account.hint.customer': 'Sign in with phone, email, or customer code',
|
||||
'login.form.login': 'Login',
|
||||
'login.form.brandHint.customer': 'Welcome to your IDE portal',
|
||||
'login.form.brandHint.admin': 'Welcome to IDE Operations Console',
|
||||
'login.form.brandHint.agent': 'Welcome to IDE Channel Agent Portal',
|
||||
'login.form.brandHint.customer': 'Welcome to your BCD portal',
|
||||
'login.form.brandHint.admin': 'Welcome to BCD Operations Console',
|
||||
'login.form.brandHint.agent': 'Welcome to BCD Channel Agent Portal',
|
||||
'login.brand.suffix.agent': 'Channel Agent',
|
||||
'login.switchToWechat': 'Sign in with WeChat',
|
||||
'login.switchToAccount': 'Account and password',
|
||||
@ -46,10 +46,10 @@
|
||||
'login.theme.toNight': 'Switch to night mode',
|
||||
'login.lang.toEn': 'Switch to English',
|
||||
'login.lang.toZh': 'Switch to Chinese',
|
||||
'login.hero.title': 'IDE',
|
||||
'login.hero.title': 'BCD',
|
||||
'login.hero.tagline': 'Faster · Simpler · Professional',
|
||||
'login.hero.desc.customer':
|
||||
'Clear quotes, smooth booking, live tracking. AI flags risks and suggests the next step—so from pickup to delivery, IDE keeps every shipment visible, on time, and accounted for.',
|
||||
'Clear quotes, smooth booking, live tracking. AI flags risks and suggests the next step—so from pickup to delivery, BCD keeps every shipment visible, on time, and accounted for.',
|
||||
'login.hero.admin.brief': 'Own three things — and make AI your co-pilot',
|
||||
'login.hero.admin.pillar.care.title': 'More Professional',
|
||||
'login.hero.admin.pillar.care.desc': 'Right lanes · No dropped issues · Clear end-to-end',
|
||||
@ -104,10 +104,10 @@
|
||||
'login.care.close': 'Close',
|
||||
'login.care.birthday': '{name}, happy birthday! Thanks for taking care of every shipment.',
|
||||
'login.care.birthdaySoon': '{name}, your birthday is coming — warm wishes in advance.',
|
||||
'login.care.tenure': '{name}, {days} days with IDE — thank you for your dedication.',
|
||||
'login.care.tenureMilestone': '{name}, day {days} with IDE — today is worth remembering.',
|
||||
'login.care.tenure': '{name}, {days} days with BCD — thank you for your dedication.',
|
||||
'login.care.tenureMilestone': '{name}, day {days} with BCD — today is worth remembering.',
|
||||
'login.care.tenureAnniversary':
|
||||
'{name}, happy {years}-year anniversary with IDE — thank you for going the distance.',
|
||||
'{name}, happy {years}-year anniversary with BCD — thank you for going the distance.',
|
||||
'login.care.holidayToast.newYear': '{name}, Happy New Year — steady start to the year.',
|
||||
'login.care.holidayToast.springFestival':
|
||||
'{name}, Happy Spring Festival — still on duty over the holiday? That\'s dedication.',
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
export default {
|
||||
'brand.name': 'IDE',
|
||||
'brand.name': 'BCD',
|
||||
'brand.fullName': 'Immediate Delivery Express',
|
||||
'brand.shortName': '即配',
|
||||
'login.form.password.errMsg': '密码不能为空',
|
||||
@ -16,9 +16,9 @@
|
||||
'login.form.account.errMsg.agent': '请输入代理编号',
|
||||
'login.form.account.hint.customer': '支持手机号、邮箱或客户编号登录',
|
||||
'login.form.login': '登录',
|
||||
'login.form.brandHint.customer': '欢迎登录 IDE 客户门户',
|
||||
'login.form.brandHint.admin': '欢迎登录 IDE 运营管理后台',
|
||||
'login.form.brandHint.agent': '欢迎登录 IDE 渠道代理门户',
|
||||
'login.form.brandHint.customer': '欢迎登录 BCD 客户门户',
|
||||
'login.form.brandHint.admin': '欢迎登录 BCD 运营管理后台',
|
||||
'login.form.brandHint.agent': '欢迎登录 BCD 渠道代理门户',
|
||||
'login.brand.suffix.agent': '渠道代理',
|
||||
'login.switchToWechat': '微信扫码登录',
|
||||
'login.switchToAccount': '账号密码登录',
|
||||
@ -46,10 +46,10 @@
|
||||
'login.theme.toNight': '切换为夜间模式',
|
||||
'login.lang.toEn': '切换为 English',
|
||||
'login.lang.toZh': '切换为中文',
|
||||
'login.hero.title': 'IDE',
|
||||
'login.hero.title': 'BCD',
|
||||
'login.hero.tagline': 'Faster · Simpler · Professional',
|
||||
'login.hero.desc.customer':
|
||||
'查价说得清、下单走得顺、轨迹跟得上。AI 帮你看风险、提建议、少踩坑——从揽收到签收,IDE 陪你把每一票发好、盯紧、交代清楚。',
|
||||
'查价说得清、下单走得顺、轨迹跟得上。AI 帮你看风险、提建议、少踩坑——从揽收到签收,BCD 陪你把每一票发好、盯紧、交代清楚。',
|
||||
'login.hero.admin.brief': '开工前对齐三件事,并让 AI 成为搭档',
|
||||
'login.hero.admin.pillar.care.title': '更专业',
|
||||
'login.hero.admin.pillar.care.desc': '线路选对 · 异常不丢 · 全程说得清',
|
||||
@ -97,7 +97,7 @@
|
||||
'login.care.close': '关闭',
|
||||
'login.care.birthday': '{name},生日快乐!感谢你一直把每一票照顾得很好。',
|
||||
'login.care.birthdaySoon': '{name},生日快到了,提前送上祝福。',
|
||||
'login.care.tenure': '{name},已与 IDE 并肩 {days} 天,谢谢你的付出。',
|
||||
'login.care.tenure': '{name},已与 BCD 并肩 {days} 天,谢谢你的付出。',
|
||||
'login.care.tenureMilestone': '{name},并肩第 {days} 天,今天值得被记住。',
|
||||
'login.care.tenureAnniversary': '{name},入职 {years} 周年快乐!感谢你一路把货送远。',
|
||||
'login.care.holidayToast.newYear': '{name},元旦快乐,新年第一班也稳稳的。',
|
||||
|
||||
@ -142,7 +142,7 @@ flowchart TD
|
||||
|
||||
| 步骤 | 内容 |
|
||||
|------|------|
|
||||
| 运单号 | `IDE` + `yyMMddHHmmss` + 4 位随机 |
|
||||
| 运单号 | `BCD` + `yyMMddHHmmss` + 4 位随机 |
|
||||
| `t_order` | 产品、国家、快照版本;**此时不写 ChannelCode** |
|
||||
| 重量 | `forecast/receive/ship/downstream` 四行,同套长宽厚实重;`Cubic=L×W×H/1e6` |
|
||||
| 子表 | sender / recipient / declaration |
|
||||
@ -301,7 +301,7 @@ flowchart TD
|
||||
| 预报成功 | `predeclared` | 清空失败原因;可能仍有 `AllocationPendingReason` |
|
||||
| 预报失败 | `draft` | `PredeclareFailReason=具体错误` |
|
||||
|
||||
运单号格式:`IDE` + `yyMMddHHmmss` + 4 位随机。
|
||||
运单号格式:`BCD` + `yyMMddHHmmss` + 4 位随机。
|
||||
|
||||
---
|
||||
|
||||
|
||||
@ -143,7 +143,7 @@
|
||||
|
||||
### 4.2 运单号
|
||||
|
||||
- 系统自动生成,一般以 **IDE** 开头(如 `IDE2607221859123456`)
|
||||
- 系统自动生成,一般以 **BCD** 开头(如 `BCD2607221859123456`)
|
||||
- 客户单号是客户自己的编号;运单号是系统给客户查件用的号
|
||||
|
||||
### 4.3 黑名单 vs 偏远(别混)
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
export default {
|
||||
'marketing.register.title': 'Register',
|
||||
'marketing.register.subtitle': 'Member pricing and welcome benefits',
|
||||
'marketing.register.brandHint': 'Welcome to IDE customer portal',
|
||||
'marketing.register.brandHint': 'Welcome to BCD customer portal',
|
||||
'marketing.register.brandHint.web': 'Register with email & phone',
|
||||
'marketing.register.brandHint.wechat': 'Register with WeChat',
|
||||
'marketing.register.choose.web': 'Web register',
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
export default {
|
||||
'marketing.register.title': '客户注册',
|
||||
'marketing.register.subtitle': '注册即享会员价与新人福利',
|
||||
'marketing.register.brandHint': '欢迎注册 IDE 客户门户',
|
||||
'marketing.register.brandHint.web': '网页注册 IDE 客户账号',
|
||||
'marketing.register.brandHint.wechat': '微信扫码注册 IDE 客户账号',
|
||||
'marketing.register.brandHint': '欢迎注册 BCD 客户门户',
|
||||
'marketing.register.brandHint.web': '网页注册 BCD 客户账号',
|
||||
'marketing.register.brandHint.wechat': '微信扫码注册 BCD 客户账号',
|
||||
'marketing.register.choose.web': '网页注册',
|
||||
'marketing.register.choose.webDesc': '填写资料,立即开通客户门户',
|
||||
'marketing.register.choose.wechat': '微信注册',
|
||||
|
||||
@ -17,18 +17,18 @@
|
||||
<div class="ai-app-main">
|
||||
<section class="ai-welcome" :class="{ 'is-hidden': chatting }">
|
||||
<div class="ai-welcome__hero">
|
||||
<!-- 飞机 + 左视图淡线跑道;机腹对齐 --runway-edge-top -->
|
||||
<div class="ai-welcome-airstrip">
|
||||
<div class="ai-welcome-plane" aria-hidden="true">
|
||||
<img
|
||||
src="/site/img/hero-plane-3d.webp"
|
||||
alt=""
|
||||
width="720"
|
||||
height="480"
|
||||
decoding="async"
|
||||
fetchpriority="high"
|
||||
/>
|
||||
</div>
|
||||
<!-- 飞机 / 跑道拆开,便于单独调间距与尺寸;机腹仍对齐 --runway-edge-top -->
|
||||
<div class="ai-welcome-plane" aria-hidden="true">
|
||||
<img
|
||||
src="/site/img/hero-plane-3d.webp"
|
||||
alt=""
|
||||
width="720"
|
||||
height="480"
|
||||
decoding="async"
|
||||
fetchpriority="high"
|
||||
/>
|
||||
</div>
|
||||
<div class="ai-welcome-runway">
|
||||
<SiteRunway :text="runwayTitle" />
|
||||
<h2 class="ai-welcome-title ai-welcome-title--sr">
|
||||
{{ runwayTitle }}
|
||||
@ -37,43 +37,45 @@
|
||||
<div class="ai-welcome__stack">
|
||||
<div class="ai-welcome__command">
|
||||
<div class="ai-ask">
|
||||
<div class="ai-ask__bar">
|
||||
<div
|
||||
class="ai-ask__dests"
|
||||
role="group"
|
||||
:aria-label="copy.destAria"
|
||||
@keydown="onDestKeydown"
|
||||
>
|
||||
<button
|
||||
v-for="(dest, index) in homeDests"
|
||||
:key="dest.id"
|
||||
type="button"
|
||||
class="ai-ask__dest"
|
||||
:aria-pressed="pickedDest === dest.id"
|
||||
:tabindex="index === destCursor ? 0 : -1"
|
||||
:disabled="busy"
|
||||
@click="pickDest(dest.id, index)"
|
||||
>
|
||||
{{ isZh ? dest.label.zh : dest.label.en }}
|
||||
</button>
|
||||
</div>
|
||||
<a
|
||||
class="ai-ask__cta"
|
||||
:href="loginUrl"
|
||||
@pointerenter="$emit('warm-login')"
|
||||
@focus="$emit('warm-login')"
|
||||
>{{ copy.heroCta }}</a>
|
||||
</div>
|
||||
<p class="ai-ask__hint">{{ copy.composeLead }}</p>
|
||||
<div class="ai-composer-slot--welcome">
|
||||
<EdiComposer
|
||||
v-if="!chatting"
|
||||
v-model="draft"
|
||||
:placeholder="copy.placeholder"
|
||||
:placeholder="copy.composeLead"
|
||||
:send-label="copy.sendLabel"
|
||||
:busy="busy"
|
||||
@submit="$emit('submit', draft)"
|
||||
/>
|
||||
>
|
||||
<template #footer>
|
||||
<div class="ai-ask__bar">
|
||||
<div
|
||||
class="ai-ask__dests"
|
||||
role="group"
|
||||
:aria-label="copy.destAria"
|
||||
@keydown="onDestKeydown"
|
||||
>
|
||||
<button
|
||||
v-for="(dest, index) in homeDests"
|
||||
:key="dest.id"
|
||||
type="button"
|
||||
class="ai-ask__dest"
|
||||
:aria-pressed="pickedDest === dest.id"
|
||||
:tabindex="index === destCursor ? 0 : -1"
|
||||
:disabled="busy"
|
||||
@click="pickDest(dest.id, index)"
|
||||
>
|
||||
{{ isZh ? dest.label.zh : dest.label.en }}
|
||||
</button>
|
||||
</div>
|
||||
<a
|
||||
class="ai-ask__cta"
|
||||
:href="loginUrl"
|
||||
@pointerenter="$emit('warm-login')"
|
||||
@focus="$emit('warm-login')"
|
||||
>{{ copy.heroCta }}</a>
|
||||
</div>
|
||||
</template>
|
||||
</EdiComposer>
|
||||
</div>
|
||||
</div>
|
||||
<p class="ai-welcome-trustline">{{ copy.trustLine }}</p>
|
||||
|
||||
@ -2,9 +2,9 @@
|
||||
<header id="header" class="header d-flex align-items-center fixed-top">
|
||||
<div class="container-fluid container-xl d-flex align-items-center justify-content-between">
|
||||
<a href="/" class="logo d-flex align-items-center" @click="$emit('home')">
|
||||
<img src="/site/img/logo1.png" alt="IDE logo" width="40" height="40" />
|
||||
<img src="/site/img/logo1.png" alt="BCD logo" width="40" height="40" />
|
||||
<span class="brand-lockup">
|
||||
<h1>IDE</h1>
|
||||
<h1>BCD</h1>
|
||||
<small class="brand-fullname">Immediate Delivery Express</small>
|
||||
</span>
|
||||
</a>
|
||||
|
||||
@ -135,7 +135,7 @@
|
||||
kicker: isZh ? '9610 · 快捷出货' : '9610 · fastest exit',
|
||||
title: isZh ? '基础通关服务' : 'Basic clearance',
|
||||
body: isZh
|
||||
? '仅需出货:物流商统一简易申报。出得快,但税务未规范可能被视同内销(增值税 + 所得税 + 滞纳金)。量起来后建议升到免征或退税,IDE 可评估路径。'
|
||||
? '仅需出货:物流商统一简易申报。出得快,但税务未规范可能被视同内销(增值税 + 所得税 + 滞纳金)。量起来后建议升到免征或退税,BCD 可评估路径。'
|
||||
: 'Ship-only: carrier files a simplified declaration. Fast, but unstructured tax handling can be treated as domestic sales. We can review an upgrade path when volume grows.',
|
||||
},
|
||||
}[card.type];
|
||||
@ -161,7 +161,7 @@
|
||||
}
|
||||
if (card.type === 'company') {
|
||||
return {
|
||||
kicker: isZh ? '关于我们' : 'About IDE',
|
||||
kicker: isZh ? '关于我们' : 'About BCD',
|
||||
title: isZh ? '中小卖家的跨境物流顾问' : 'Cross-border logistics for SMB sellers',
|
||||
body: isZh
|
||||
? '深圳宝安运营,备案主体可核(' + c.icp + ')。主做美欧与东南亚小包。接小批量、带电、别人不接的 9610。一人从报价跟到售后。'
|
||||
|
||||
@ -7,9 +7,9 @@
|
||||
<script lang="ts" setup>
|
||||
/**
|
||||
* 左视图淡线跑道:
|
||||
* - 上下边两端淡出(不封闭)
|
||||
* - 上下/中线用短横线(不是点),Y 吸附到背景点阵同一水平行
|
||||
* - 中线虚线在标题左右断开让位
|
||||
* - 标题:道面标识 + IDE 品牌蓝/其余橙 + 轻贴地阴影,逐字咻入
|
||||
* - 标题:道面标识 + BCD 品牌蓝/其余橙 + 轻贴地阴影,逐字咻入
|
||||
* - 通过 --runway-edge-top 把上边线位置交给飞机对齐
|
||||
*/
|
||||
import { onMounted, onUnmounted, ref, watch } from 'vue';
|
||||
@ -51,6 +51,21 @@
|
||||
let enterRaf = 0;
|
||||
let enterStart = 0;
|
||||
let enterDone = reduceMotion;
|
||||
const gridGap = isNarrow ? 20 : 18;
|
||||
/** 吸附布局只在 rebuild 算一次;paint 动画帧禁止读 rect/写 CSS,否则会跟飞机负 margin 互顶抖动 */
|
||||
let layout = {
|
||||
x0: 0,
|
||||
y0: 0,
|
||||
y1: 0,
|
||||
cy: 0,
|
||||
pw: 0,
|
||||
ph: 0,
|
||||
skew: 0,
|
||||
dashPhase: 0,
|
||||
ready: false,
|
||||
};
|
||||
let lastEdgeTop = '';
|
||||
let settleRaf = 0;
|
||||
|
||||
const easeOutCubic = (t: number) => 1 - (1 - t) ** 3;
|
||||
|
||||
@ -59,39 +74,82 @@
|
||||
|
||||
const syncEdgeTop = (y0: number) => {
|
||||
const px = `${Math.round(y0)}px`;
|
||||
if (px === lastEdgeTop) return;
|
||||
lastEdgeTop = px;
|
||||
root.style.setProperty('--runway-edge-top', px);
|
||||
const strip = root.closest('.ai-welcome-airstrip') as HTMLElement | null;
|
||||
strip?.style.setProperty('--runway-edge-top', px);
|
||||
const hero = root.closest('.ai-welcome__hero') as HTMLElement | null;
|
||||
hero?.style.setProperty('--runway-edge-top', px);
|
||||
const runway = root.closest('.ai-welcome-runway') as HTMLElement | null;
|
||||
runway?.style.setProperty('--runway-edge-top', px);
|
||||
};
|
||||
|
||||
const paint = () => {
|
||||
ctx.clearRect(0, 0, width, height);
|
||||
if (width < 40 || height < 24) return;
|
||||
const computeLayout = () => {
|
||||
if (width < 40 || height < 24) {
|
||||
layout.ready = false;
|
||||
return;
|
||||
}
|
||||
|
||||
const gridEl = document.querySelector(
|
||||
'.ai-shell-bg__dots, .ai-dot-grid',
|
||||
) as HTMLElement | null;
|
||||
const gRect = gridEl?.getBoundingClientRect();
|
||||
const cRect = canvas.getBoundingClientRect();
|
||||
const gH = Math.max(1, Math.floor(gRect?.height || window.innerHeight));
|
||||
const gW = Math.max(1, Math.floor(gRect?.width || window.innerWidth));
|
||||
const gRows = Math.ceil(gH / gridGap) + 1;
|
||||
const gCols = Math.ceil(gW / gridGap) + 1;
|
||||
const gOy = (gH - (gRows - 1) * gridGap) / 2;
|
||||
const gOx = (gW - (gCols - 1) * gridGap) / 2;
|
||||
const gTop = gRect?.top ?? 0;
|
||||
const gLeft = gRect?.left ?? 0;
|
||||
|
||||
const snapY = (localY: number) => {
|
||||
const screenY = cRect.top + localY;
|
||||
const inGrid = screenY - gTop;
|
||||
const row = Math.round((inGrid - gOy) / gridGap);
|
||||
return gTop + gOy + row * gridGap - cRect.top;
|
||||
};
|
||||
|
||||
const padX = width * 0.04;
|
||||
const padY = height * 0.16;
|
||||
const skew = Math.min(width * 0.14, 72);
|
||||
const x0 = padX;
|
||||
const y0 = padY;
|
||||
let y0 = snapY(padY);
|
||||
let y1 = snapY(padY + (height - padY * 2));
|
||||
if (Math.abs(y1 - y0) < gridGap * 0.5) y1 = y0 + gridGap;
|
||||
const pw = width - padX * 2 - skew;
|
||||
const ph = height - padY * 2;
|
||||
const ph = y1 - y0;
|
||||
let cy = snapY((y0 + y1) / 2);
|
||||
if (Math.abs(cy - y0) < 1) cy = y0 + gridGap;
|
||||
if (Math.abs(cy - y1) < 1) cy = y1 - gridGap;
|
||||
const dashPhase =
|
||||
(((cRect.left - (gLeft + gOx)) % gridGap) + gridGap) % gridGap;
|
||||
|
||||
layout = { x0, y0, y1, cy, pw, ph, skew, dashPhase, ready: pw >= 40 && ph >= 16 };
|
||||
syncEdgeTop(y0);
|
||||
if (pw < 40 || ph < 16) return;
|
||||
};
|
||||
|
||||
const paint = () => {
|
||||
ctx.clearRect(0, 0, width, height);
|
||||
if (width < 40 || height < 24 || !layout.ready) return;
|
||||
|
||||
const { x0, y0, y1, cy, pw, ph, skew, dashPhase } = layout;
|
||||
|
||||
const tl = { x: x0 + skew, y: y0 };
|
||||
const tr = { x: x0 + pw + skew, y: y0 };
|
||||
const br = { x: x0 + pw, y: y0 + ph };
|
||||
const bl = { x: x0, y: y0 + ph };
|
||||
const br = { x: x0 + pw, y: y1 };
|
||||
const bl = { x: x0, y: y1 };
|
||||
const ml = { x: (tl.x + bl.x) / 2, y: (tl.y + bl.y) / 2 };
|
||||
const mr = { x: (tr.x + br.x) / 2, y: (tr.y + br.y) / 2 };
|
||||
const cx = (tl.x + tr.x + br.x + bl.x) / 4;
|
||||
const cy = (tl.y + tr.y + br.y + bl.y) / 4;
|
||||
|
||||
// 中性灰(避免 slate 偏蓝)
|
||||
const edgeInk = 'rgba(120, 120, 120, 0.16)';
|
||||
const edgeFade = 'rgba(120, 120, 120, 0)';
|
||||
const midInk = 'rgba(120, 120, 120, 0.34)';
|
||||
const midFade = 'rgba(120, 120, 120, 0)';
|
||||
// 短横线 + 两端淡出;颜色贴近点阵,同水平行重合
|
||||
const edgeInk = 'rgba(15, 23, 42, 0.2)';
|
||||
const edgeFade = 'rgba(15, 23, 42, 0)';
|
||||
const midInk = 'rgba(15, 23, 42, 0.28)';
|
||||
const midFade = 'rgba(15, 23, 42, 0)';
|
||||
const dashLen = 7;
|
||||
const dashGap = Math.max(1, gridGap - dashLen);
|
||||
|
||||
const strokeFaded = (
|
||||
ax: number,
|
||||
@ -112,15 +170,17 @@
|
||||
ctx.lineTo(bx, by);
|
||||
ctx.strokeStyle = g;
|
||||
ctx.lineWidth = lineW;
|
||||
ctx.lineCap = 'round';
|
||||
ctx.lineCap = 'butt';
|
||||
ctx.stroke();
|
||||
};
|
||||
|
||||
const edgeW = isNarrow ? 1.25 : 1.5;
|
||||
ctx.setLineDash([7, 7]);
|
||||
ctx.setLineDash([dashLen, dashGap]);
|
||||
ctx.lineDashOffset = -dashPhase;
|
||||
strokeFaded(tl.x, tl.y, tr.x, tr.y, edgeInk, edgeFade, edgeW);
|
||||
strokeFaded(bl.x, bl.y, br.x, br.y, edgeInk, edgeFade, edgeW);
|
||||
ctx.setLineDash([]);
|
||||
ctx.lineDashOffset = 0;
|
||||
|
||||
const label = currentText.trim();
|
||||
const fontSize = Math.max(
|
||||
@ -141,31 +201,33 @@
|
||||
};
|
||||
const pointOnMid = (t: number) => ({
|
||||
x: lerp(ml.x, mr.x, t),
|
||||
y: lerp(ml.y, mr.y, t),
|
||||
y: cy, // 中线强制贴点阵水平行
|
||||
});
|
||||
|
||||
// 中线按终态留白,字滑进空隙
|
||||
ctx.setLineDash([6, 8]);
|
||||
// 中线短横,标题左右断开
|
||||
ctx.setLineDash([dashLen, dashGap]);
|
||||
ctx.lineDashOffset = -dashPhase;
|
||||
const tL = alongT(gapL);
|
||||
const tR = alongT(gapR);
|
||||
if (tL > 0.04) {
|
||||
const a = pointOnMid(0.02);
|
||||
const b = pointOnMid(Math.max(0.02, tL - 0.02));
|
||||
strokeFaded(a.x, a.y, b.x, b.y, midInk, midFade, 1);
|
||||
strokeFaded(a.x, a.y, b.x, b.y, midInk, midFade, 1.25);
|
||||
}
|
||||
if (tR < 0.96) {
|
||||
const a = pointOnMid(Math.min(0.98, tR + 0.02));
|
||||
const b = pointOnMid(0.98);
|
||||
strokeFaded(a.x, a.y, b.x, b.y, midInk, midFade, 1);
|
||||
strokeFaded(a.x, a.y, b.x, b.y, midInk, midFade, 1.25);
|
||||
}
|
||||
ctx.setLineDash([]);
|
||||
ctx.lineDashOffset = 0;
|
||||
|
||||
if (!label) return;
|
||||
|
||||
// 道面标识 + 双色(IDE 品牌蓝 / 其余主题橙)+ 轻贴地阴影
|
||||
// 道面标识 + 双色(BCD 品牌蓝 / 其余主题橙)+ 轻贴地阴影
|
||||
ctx.font = `600 ${fontSize}px "PingFang SC","Hiragino Sans GB","Microsoft YaHei","Segoe UI",sans-serif`;
|
||||
const chars = [...label];
|
||||
const brandMatch = label.match(/^IDE(\s*·\s*)?/);
|
||||
const brandMatch = label.match(/^BCD(\s*·\s*)?/);
|
||||
const brandLen = brandMatch ? [...brandMatch[0]].length : 0;
|
||||
const brandFill = 'rgba(2, 62, 138, 0.88)';
|
||||
const accentFill = 'rgba(233, 106, 38, 0.9)';
|
||||
@ -260,7 +322,15 @@
|
||||
canvas.style.width = `${width}px`;
|
||||
canvas.style.height = `${height}px`;
|
||||
ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
|
||||
computeLayout();
|
||||
paint();
|
||||
// 飞机负 margin 吃到新 edge-top 后再锁一次,避免首帧吸附来回跳
|
||||
if (settleRaf) cancelAnimationFrame(settleRaf);
|
||||
settleRaf = requestAnimationFrame(() => {
|
||||
settleRaf = 0;
|
||||
computeLayout();
|
||||
paint();
|
||||
});
|
||||
};
|
||||
|
||||
redraw = () => {
|
||||
@ -286,12 +356,19 @@
|
||||
|
||||
teardown = () => {
|
||||
stopEnter();
|
||||
if (settleRaf) {
|
||||
cancelAnimationFrame(settleRaf);
|
||||
settleRaf = 0;
|
||||
}
|
||||
ro.disconnect();
|
||||
redraw = null;
|
||||
replayEnter = null;
|
||||
lastEdgeTop = '';
|
||||
root.style.removeProperty('--runway-edge-top');
|
||||
const strip = root.closest('.ai-welcome-airstrip') as HTMLElement | null;
|
||||
strip?.style.removeProperty('--runway-edge-top');
|
||||
const hero = root.closest('.ai-welcome__hero') as HTMLElement | null;
|
||||
hero?.style.removeProperty('--runway-edge-top');
|
||||
const runway = root.closest('.ai-welcome-runway') as HTMLElement | null;
|
||||
runway?.style.removeProperty('--runway-edge-top');
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
@ -129,9 +129,9 @@
|
||||
type PanelId = 'routes' | 'services' | 'pricing' | 'about' | 'contact' | null;
|
||||
const NAV_PANELS: PanelId[] = ['routes', 'services', 'pricing', 'about', 'contact'];
|
||||
|
||||
const TITLE = 'IDE - 跨境物流,全球即递';
|
||||
const TITLE = 'BCD - 跨境物流,全球即递';
|
||||
const DESCRIPTION =
|
||||
'IDE 面向中小卖家的跨境物流。全球数字化一站式跨境物流服务商。注册登记后即可询价,一口价不砍,专属顾问跟到签收。';
|
||||
'BCD 面向中小卖家的跨境物流。全球数字化一站式跨境物流服务商。注册登记后即可询价,一口价不砍,专属顾问跟到签收。';
|
||||
|
||||
const router = useRouter();
|
||||
const lang = ref<'zh' | 'en'>('zh');
|
||||
@ -226,7 +226,7 @@
|
||||
ensureMeta('description', DESCRIPTION);
|
||||
ensureMeta(
|
||||
'keywords',
|
||||
'IDE, 跨境物流, 中小卖家, 9610, 疑难单, 出口退税, 欧美专线, 东南亚专线',
|
||||
'BCD, 跨境物流, 中小卖家, 9610, 疑难单, 出口退税, 欧美专线, 东南亚专线',
|
||||
);
|
||||
const origin = window.location.origin;
|
||||
ensureOg('og:title', TITLE);
|
||||
|
||||
@ -305,7 +305,7 @@ export function buildReply(
|
||||
}
|
||||
|
||||
export const SITE_NAV_TOPICS: Record<string, { intentId: string; label: { zh: string; en: string } }> = {
|
||||
about: { intentId: 'company', label: { zh: '关于我们', en: 'About IDE' } },
|
||||
about: { intentId: 'company', label: { zh: '关于我们', en: 'About BCD' } },
|
||||
pricing: { intentId: 'pricing', label: { zh: '价格怎么算?', en: 'How does pricing work?' } },
|
||||
contact: { intentId: 'human', label: { zh: '联系在线顾问', en: 'Talk to an online advisor' } },
|
||||
};
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
export const WELCOME_COPY = {
|
||||
en: {
|
||||
title: 'IDE · One-stop cross-border logistics advisor',
|
||||
titleShort: 'IDE · Logistics advisor',
|
||||
title: 'BCD · One-stop cross-border logistics advisor',
|
||||
titleShort: 'BCD · Logistics advisor',
|
||||
titleRest: 'One-stop cross-border logistics advisor',
|
||||
titleRestShort: 'Logistics advisor',
|
||||
placeholder: 'e.g. 5 kg general cargo to the US, how many days?',
|
||||
@ -35,8 +35,8 @@ export const WELCOME_COPY = {
|
||||
fallback: 'Quotes are in the customer system after you register. You can also talk to an advisor.',
|
||||
},
|
||||
zh: {
|
||||
title: 'IDE · 一站式跨境物流顾问',
|
||||
titleShort: 'IDE · 跨境物流顾问',
|
||||
title: 'BCD · 一站式跨境物流顾问',
|
||||
titleShort: 'BCD · 跨境物流顾问',
|
||||
titleRest: '一站式跨境物流顾问',
|
||||
titleRestShort: '跨境物流顾问',
|
||||
placeholder: '例如:发美国普货,5kg,要几天',
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/* ===== IDE Command Center ? header stays, stage fills the rest ===== */
|
||||
/* ===== BCD Command Center ? header stays, stage fills the rest ===== */
|
||||
|
||||
:root {
|
||||
--ai-header-h: 72px;
|
||||
@ -1300,6 +1300,14 @@ body.command-home .ai-stage-map--eu {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow: visible;
|
||||
/* 抵消 EdiAssistant 同名类的卡片壳/内边距,首页铺满舞台不做浮卡 */
|
||||
padding: 0;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
backdrop-filter: none;
|
||||
-webkit-backdrop-filter: none;
|
||||
}
|
||||
|
||||
/* History is a drawer, never a second brand column */
|
||||
@ -2559,8 +2567,11 @@ body.command-home .ai-stage-map--eu {
|
||||
align-items: center;
|
||||
min-height: 0;
|
||||
width: 100%;
|
||||
max-width: none; /* 勿吃助手 48rem 对话宽,否则意图条/精选线路会挤成一坨 */
|
||||
margin-inline: 0;
|
||||
padding: clamp(4px, 1.2vh, 16px) 0 16px;
|
||||
box-sizing: border-box;
|
||||
animation: none;
|
||||
}
|
||||
|
||||
.ai-welcome.is-hidden {
|
||||
@ -2579,7 +2590,8 @@ body.command-home .ai-stage-map--eu {
|
||||
}
|
||||
}
|
||||
|
||||
.ai-welcome-airstrip,
|
||||
.ai-welcome-plane,
|
||||
.ai-welcome-runway,
|
||||
.ai-welcome-trustline,
|
||||
.ai-intent-section,
|
||||
.ai-trust-bar {
|
||||
@ -2599,6 +2611,9 @@ body.command-home .ai-stage-map--eu {
|
||||
}
|
||||
|
||||
.ai-welcome__hero {
|
||||
/* 跑道上边线 Y 由 SiteRunway 写入;飞机单独一块也能读到 */
|
||||
--runway-edge-top: 14px;
|
||||
--plane-belly-inset: clamp(32px, 7vw, 56px);
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@ -2666,17 +2681,15 @@ body.command-home #navbar .site-nav-avatar:hover {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.ai-welcome-airstrip {
|
||||
/* 跑道上边线 Y,由 SiteRunway 写入;机腹再扣一点图内留白 */
|
||||
--runway-edge-top: 14px;
|
||||
--plane-belly-inset: clamp(32px, 7vw, 56px);
|
||||
.ai-welcome-runway {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
z-index: 1; /* 与点阵同视觉层,不做抬升浮层 */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
animation-delay: 0.1s;
|
||||
margin-top: 6.5px;
|
||||
animation-delay: 0.16s;
|
||||
}
|
||||
|
||||
/* 点阵标题的无障碍文案 */
|
||||
@ -2707,9 +2720,12 @@ body.command-home #navbar .site-nav-avatar:hover {
|
||||
.ai-ask {
|
||||
position: relative;
|
||||
isolation: isolate;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
overflow: visible;
|
||||
margin: 0;
|
||||
padding: 8px 4px 4px;
|
||||
padding: 4px 4px 2px;
|
||||
border-radius: 0;
|
||||
border: none;
|
||||
background: transparent;
|
||||
@ -2721,46 +2737,58 @@ body.command-home #navbar .site-nav-avatar:hover {
|
||||
.ai-ask__bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
margin: 0 0 10px;
|
||||
justify-content: flex-start;
|
||||
gap: 10px;
|
||||
min-width: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.ai-ask__cta {
|
||||
flex-shrink: 0;
|
||||
margin-left: auto;
|
||||
color: var(--ai-accent, #e96a26);
|
||||
font-size: 0.84rem;
|
||||
font-weight: 700;
|
||||
font-size: 0.7rem;
|
||||
font-weight: 650;
|
||||
letter-spacing: 0.01em;
|
||||
line-height: 1;
|
||||
text-decoration: none;
|
||||
white-space: nowrap;
|
||||
opacity: 0.92;
|
||||
}
|
||||
|
||||
.ai-ask__cta:hover,
|
||||
.ai-ask__cta:focus-visible {
|
||||
text-decoration: underline;
|
||||
text-underline-offset: 3px;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.ai-ask__dests {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
flex-wrap: nowrap;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
gap: 2px;
|
||||
min-width: 0;
|
||||
margin: 0;
|
||||
overflow-x: auto;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
|
||||
.ai-ask__dests::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ai-ask__dest {
|
||||
min-height: 34px;
|
||||
padding: 0 14px;
|
||||
border-radius: 999px;
|
||||
border: 1px solid rgba(18, 24, 32, 0.14);
|
||||
flex: 0 0 auto;
|
||||
min-height: 24px;
|
||||
padding: 0 6px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid transparent;
|
||||
background: transparent;
|
||||
color: #3d4754;
|
||||
color: #8b939e;
|
||||
font: inherit;
|
||||
font-size: 0.84rem;
|
||||
font-weight: 650;
|
||||
font-size: 0.7rem;
|
||||
font-weight: 500;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
transition:
|
||||
@ -2770,20 +2798,21 @@ body.command-home #navbar .site-nav-avatar:hover {
|
||||
}
|
||||
|
||||
.ai-ask__dest:hover:not(:disabled) {
|
||||
color: #023e8a;
|
||||
border-color: rgba(2, 62, 138, 0.4);
|
||||
background: rgba(2, 62, 138, 0.06);
|
||||
color: #4a5562;
|
||||
border-color: transparent;
|
||||
background: rgba(2, 62, 138, 0.05);
|
||||
}
|
||||
|
||||
.ai-ask__dest:focus-visible {
|
||||
outline: none;
|
||||
box-shadow: 0 0 0 3px rgba(2, 62, 138, 0.18);
|
||||
box-shadow: 0 0 0 2px rgba(2, 62, 138, 0.14);
|
||||
}
|
||||
|
||||
.ai-ask__dest[aria-pressed='true'] {
|
||||
color: #023e8a;
|
||||
border-color: rgba(2, 62, 138, 0.55);
|
||||
border-color: transparent;
|
||||
background: rgba(2, 62, 138, 0.1);
|
||||
font-weight: 650;
|
||||
}
|
||||
|
||||
.ai-ask__dest:disabled {
|
||||
@ -2791,12 +2820,6 @@ body.command-home #navbar .site-nav-avatar:hover {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.ai-ask__hint {
|
||||
margin: 0 0 12px;
|
||||
font-size: 0.8rem;
|
||||
line-height: 1.4;
|
||||
color: #6a7380;
|
||||
}
|
||||
|
||||
/* 意图区 · 双区分类网格(履约 3 + 代理 featured + 成长 3) */
|
||||
.ai-welcome-trustline {
|
||||
@ -3041,6 +3064,18 @@ body.command-home .ai-ask {
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
/* 防助手 CSS 串回欢迎态胶囊条;限宽仍由官网提问卡控制 */
|
||||
body.command-home .ai-composer-slot--welcome .ai-composer-wrap {
|
||||
max-width: min(900px, 100%) !important;
|
||||
width: 100% !important;
|
||||
margin-inline: auto !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
body.command-home .ai-composer-slot--welcome .ai-composer {
|
||||
border-radius: 14px !important;
|
||||
}
|
||||
|
||||
body.command-home .ai-featured-routes__card {
|
||||
backdrop-filter: blur(18px) saturate(160%) !important;
|
||||
-webkit-backdrop-filter: blur(18px) saturate(160%) !important;
|
||||
@ -3593,6 +3628,7 @@ body.command-home .ai-featured-routes__card {
|
||||
/* 负 margin = 上边线位置 + 机腹图内留白,让机腹贴住跑道上沿 */
|
||||
margin: 0 0 calc(-1 * (var(--runway-edge-top, 14px) + var(--plane-belly-inset, 40px)));
|
||||
pointer-events: none;
|
||||
animation-delay: 0.08s;
|
||||
}
|
||||
|
||||
.ai-welcome-plane img {
|
||||
@ -3630,8 +3666,9 @@ body.command-home .ai-featured-routes__card {
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.ai-welcome-plane,
|
||||
.ai-welcome-plane img,
|
||||
.ai-welcome-airstrip,
|
||||
.ai-welcome-runway,
|
||||
.ai-ask,
|
||||
.ai-welcome-trustline,
|
||||
.ai-intent-section,
|
||||
@ -3675,20 +3712,17 @@ body.command-home .ai-featured-routes__card {
|
||||
font-size: 0.78rem;
|
||||
}
|
||||
|
||||
body.command-home .ai-ask__hint {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
body.command-home .ai-home-dests {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
body.command-home .ai-composer-slot--welcome .ai-composer {
|
||||
min-height: 48px;
|
||||
padding: 8px 10px 8px 14px;
|
||||
min-height: 76px;
|
||||
padding: 12px 12px 10px;
|
||||
border-radius: 14px !important;
|
||||
}
|
||||
|
||||
body.command-home .ai-welcome-airstrip {
|
||||
body.command-home .ai-welcome__hero {
|
||||
--plane-belly-inset: clamp(18px, 4vw, 32px);
|
||||
}
|
||||
|
||||
@ -4747,19 +4781,42 @@ body.command-home .ai-welcome-compose__lead {
|
||||
color: var(--ai-text-3);
|
||||
}
|
||||
|
||||
/* 仅输入条本身轻描边,整块提问区不再套卡片 */
|
||||
/* Cursor 式提问卡:居中限宽,底栏更轻,避免拉满舞台显得空 */
|
||||
.ai-composer-slot--welcome .ai-composer-wrap {
|
||||
max-width: min(900px, 100%);
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.ai-composer-slot--welcome {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.ai-composer-slot--welcome .ai-composer {
|
||||
min-height: 56px;
|
||||
padding: 12px 12px 12px 18px;
|
||||
border-radius: 999px;
|
||||
border: 1px solid color-mix(in srgb, var(--ai-text, #121820) 12%, transparent) !important;
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) auto;
|
||||
grid-template-rows: auto auto;
|
||||
align-items: end;
|
||||
column-gap: 8px;
|
||||
row-gap: 8px;
|
||||
width: 100%;
|
||||
min-height: 0;
|
||||
padding: 12px 12px 10px;
|
||||
border-radius: 14px !important;
|
||||
border: 1px solid color-mix(in srgb, var(--ai-text, #121820) 11%, transparent) !important;
|
||||
outline: none;
|
||||
background: color-mix(in srgb, #fff 72%, transparent) !important;
|
||||
background: #fff !important;
|
||||
backdrop-filter: none !important;
|
||||
-webkit-backdrop-filter: none !important;
|
||||
box-shadow: none !important;
|
||||
box-shadow:
|
||||
0 1px 2px rgba(15, 23, 42, 0.03),
|
||||
0 6px 18px rgba(15, 23, 42, 0.045) !important;
|
||||
transition:
|
||||
border-color 0.18s var(--ai-ease),
|
||||
box-shadow 0.18s var(--ai-ease),
|
||||
background 0.18s var(--ai-ease);
|
||||
}
|
||||
|
||||
@ -4770,30 +4827,91 @@ body.command-home .ai-welcome-compose__lead {
|
||||
}
|
||||
|
||||
.ai-composer-slot--welcome .ai-composer:focus-within {
|
||||
border-color: color-mix(in srgb, var(--ai-brand, #023e8a) 42%, transparent) !important;
|
||||
border-color: color-mix(in srgb, var(--ai-brand, #023e8a) 34%, transparent) !important;
|
||||
outline: none;
|
||||
background: #fff !important;
|
||||
box-shadow: none !important;
|
||||
box-shadow:
|
||||
0 1px 2px rgba(15, 23, 42, 0.03),
|
||||
0 8px 22px rgba(15, 23, 42, 0.06),
|
||||
0 0 0 3px color-mix(in srgb, var(--ai-brand, #023e8a) 10%, transparent) !important;
|
||||
}
|
||||
|
||||
.ai-composer-slot--welcome .ai-composer-form {
|
||||
display: contents;
|
||||
}
|
||||
|
||||
.ai-composer-slot--welcome .ai-composer-input {
|
||||
grid-column: 1 / -1;
|
||||
grid-row: 1;
|
||||
width: 100%;
|
||||
min-height: 44px;
|
||||
max-height: 140px;
|
||||
padding: 2px 2px 8px;
|
||||
border-bottom: 1px solid color-mix(in srgb, var(--ai-text, #121820) 6%, transparent);
|
||||
color: var(--ai-text, #121820);
|
||||
font-size: 0.95rem;
|
||||
line-height: 1.45;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.ai-composer-slot--welcome .ai-composer-input::placeholder {
|
||||
color: var(--ai-text-3, #66707d);
|
||||
}
|
||||
|
||||
.ai-composer-slot--welcome .ai-ask__bar {
|
||||
grid-column: 1;
|
||||
grid-row: 2;
|
||||
align-self: center;
|
||||
padding-right: 2px;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.ai-composer-slot--welcome .ai-composer-send,
|
||||
.ai-composer-slot--welcome .ai-composer-send:hover:not(:disabled):not(.is-empty),
|
||||
.ai-composer-slot--welcome .ai-composer-send.is-empty {
|
||||
grid-column: 2;
|
||||
grid-row: 2;
|
||||
align-self: center;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border-radius: 999px;
|
||||
line-height: 0;
|
||||
box-shadow: none;
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.ai-composer-slot--welcome .ai-composer-send.is-empty,
|
||||
.ai-composer-slot--welcome .ai-composer-send.is-empty:hover {
|
||||
background: #e8eaed;
|
||||
color: #b0b5bd;
|
||||
opacity: 1;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.ai-composer-slot--welcome .ai-composer-send:not(.is-empty) {
|
||||
background: var(--ai-accent, #e96a26);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.ai-composer-slot--welcome .ai-composer-send:hover:not(:disabled):not(.is-empty) {
|
||||
background: var(--ai-accent-hover, #d45e1f);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.ai-composer-slot--welcome .ai-composer-send__mark {
|
||||
display: block;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
flex-shrink: 0;
|
||||
/* 上箭头 path 视觉重心略偏上,微下移让几何居中 */
|
||||
transform: translateY(0.5px);
|
||||
}
|
||||
|
||||
.ai-composer-dock {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@ -5128,7 +5246,7 @@ body.command-home .ai-welcome-compose__lead {
|
||||
padding-top: 2px;
|
||||
}
|
||||
|
||||
.ai-welcome-airstrip {
|
||||
.ai-welcome__hero {
|
||||
--plane-belly-inset: clamp(22px, 5vw, 40px);
|
||||
}
|
||||
|
||||
@ -5483,18 +5601,27 @@ body.command-home .ai-welcome-compose__lead {
|
||||
border-radius: 14px;
|
||||
}
|
||||
|
||||
.ai-composer,
|
||||
.ai-composer-slot--welcome .ai-composer {
|
||||
.ai-composer {
|
||||
min-height: 56px;
|
||||
padding: 10px 10px 10px 16px;
|
||||
border-radius: 14px;
|
||||
}
|
||||
|
||||
.ai-composer-slot--welcome .ai-composer {
|
||||
min-height: 80px;
|
||||
padding: 12px 12px 10px;
|
||||
border-radius: 14px !important;
|
||||
}
|
||||
|
||||
.ai-composer-input {
|
||||
min-height: 44px;
|
||||
font-size: 16px; /* iOS 避免自动放大 */
|
||||
}
|
||||
|
||||
.ai-composer-slot--welcome .ai-composer-input {
|
||||
min-height: 44px;
|
||||
}
|
||||
|
||||
.ai-composer-send,
|
||||
.ai-composer-slot--welcome .ai-composer-send {
|
||||
width: 32px;
|
||||
|
||||
@ -743,7 +743,7 @@ async function handleDelete(id?: string) {
|
||||
async function handleAddUser() {
|
||||
userIsEdit.value = false
|
||||
userCurrentId.value = ''
|
||||
let employeeNo = 'IDE001'
|
||||
let employeeNo = 'BCD001'
|
||||
try {
|
||||
const result = await getInternalUserList({ page: 1, pageSize: 1000 })
|
||||
employeeNo = generateEmployeeNo(result.items || [])
|
||||
|
||||
@ -355,7 +355,7 @@ function handleSearch() {
|
||||
async function handleAdd() {
|
||||
isEdit.value = false
|
||||
currentId.value = ''
|
||||
let employeeNo = 'IDE001'
|
||||
let employeeNo = 'BCD001'
|
||||
try {
|
||||
const result = await getInternalUserList({ page: 1, pageSize: 1000 })
|
||||
employeeNo = generateEmployeeNo(result.items || [])
|
||||
|
||||
@ -29,6 +29,21 @@ export default {
|
||||
'wechat.follow.later': 'Maybe later',
|
||||
'wechat.follow.openInWechat': 'Please open this page in WeChat to follow the official account',
|
||||
|
||||
'wechat.openidMigrate.title': 'Update WeChat binding',
|
||||
'wechat.openidMigrate.tip':
|
||||
'WeChat nickname “{nickname}” matches an existing customer. If you switched official accounts, enter that customer’s phone to update WeChat OpenID / UnionID.',
|
||||
'wechat.openidMigrate.phonePlaceholder': 'Enter phone number',
|
||||
'wechat.openidMigrate.phoneRequired': 'Phone number is required',
|
||||
'wechat.openidMigrate.confirm': 'Update and sign in',
|
||||
'wechat.openidMigrate.cancel': 'Not now',
|
||||
'wechat.openidMigrate.ticketExpired': 'Session expired. Please authorize again',
|
||||
'wechat.openidMigrate.failed': 'Failed to update WeChat binding',
|
||||
'wechat.openidMigrate.success': 'WeChat binding updated',
|
||||
'wechat.openidMigrate.cancelled':
|
||||
'Update cancelled. Sign in with password or register again',
|
||||
'wechat.openidMigrate.cancelledContinueRegister':
|
||||
'Update cancelled. You can continue registering a new account',
|
||||
|
||||
'wechat.register.title': 'Confirm registration',
|
||||
'wechat.register.subtitle': 'Confirm to finish',
|
||||
'wechat.register.success': 'Registered',
|
||||
|
||||
@ -24,6 +24,19 @@ export default {
|
||||
'wechat.follow.later': '稍后再说',
|
||||
'wechat.follow.openInWechat': '请在微信内打开本页后再关注公众号',
|
||||
|
||||
'wechat.openidMigrate.title': '更新微信绑定',
|
||||
'wechat.openidMigrate.tip':
|
||||
'检测到微信昵称「{nickname}」与已有客户相同。若您更换了公众号,请输入该客户手机号以更新微信绑定(OpenID / UnionID)。',
|
||||
'wechat.openidMigrate.phonePlaceholder': '请输入手机号',
|
||||
'wechat.openidMigrate.phoneRequired': '请输入手机号',
|
||||
'wechat.openidMigrate.confirm': '确认更新并登录',
|
||||
'wechat.openidMigrate.cancel': '暂不更新',
|
||||
'wechat.openidMigrate.ticketExpired': '凭证已失效,请重新授权',
|
||||
'wechat.openidMigrate.failed': '更新微信绑定失败',
|
||||
'wechat.openidMigrate.success': '微信绑定已更新',
|
||||
'wechat.openidMigrate.cancelled': '已取消更新,请使用账号密码登录或重新注册',
|
||||
'wechat.openidMigrate.cancelledContinueRegister': '已取消更新,可继续注册新账号',
|
||||
|
||||
'wechat.register.title': '确认注册',
|
||||
'wechat.register.subtitle': '确认资料后即可完成',
|
||||
'wechat.register.success': '注册成功',
|
||||
|
||||
@ -224,6 +224,14 @@
|
||||
>
|
||||
<p class="wechat-h5-auth-modal__desc">{{ t('wechat.common.authDesc') }}</p>
|
||||
</a-modal>
|
||||
|
||||
<WechatOpenidMigrateModal
|
||||
v-model:visible="migrateVisible"
|
||||
:nickname="migrateNickname"
|
||||
:ticket="migrateTicket"
|
||||
@success="onMigrateSuccess"
|
||||
@cancel="onMigrateCancel"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -238,6 +246,7 @@ import {
|
||||
getOAuthUserInfo,
|
||||
registerByWechat,
|
||||
type WeChatOAuthUserInfo,
|
||||
type WxLoginResult,
|
||||
} from '@/api/wechat';
|
||||
import { validateInviteCode } from '@/api/marketing/portal';
|
||||
import { validateAgentCode } from '@/api/agent';
|
||||
@ -267,7 +276,12 @@ import { isTimeoutError, withTimeout } from '@/utils/withTimeout';
|
||||
import { isWeChatBrowser, hideWeChatBrowserNav } from '@/utils/device';
|
||||
import { loginCustomerAfterWechatAuth } from '@/utils/wechatAuthLogin';
|
||||
import { markH5FollowPromptPending } from '@/utils/h5FollowPrompt';
|
||||
import { setToken } from '@/utils/auth';
|
||||
import { applyRbacUserToUserStore } from '@/utils/enter-system';
|
||||
import { ensureFullLocaleMessages } from '@/locale';
|
||||
import { useRbacUserStore } from '@/store/modules/rbac-user';
|
||||
import LoginLangToggle from '@/views/login/components/LoginLangToggle.vue';
|
||||
import WechatOpenidMigrateModal from '@/views/h5/customer-center/components/WechatOpenidMigrateModal.vue';
|
||||
|
||||
defineOptions({ name: 'WechatRegister' });
|
||||
|
||||
@ -286,6 +300,10 @@ const LOADING_SLOW_HINT_MS = 3500;
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const rbacUserStore = useRbacUserStore();
|
||||
const migrateVisible = ref(false);
|
||||
const migrateTicket = ref('');
|
||||
const migrateNickname = ref('');
|
||||
|
||||
function goCustomerCenter() {
|
||||
router.replace('/h5/me');
|
||||
@ -498,6 +516,30 @@ async function loadReferrer(code: string) {
|
||||
}
|
||||
}
|
||||
|
||||
async function onMigrateSuccess(result: WxLoginResult) {
|
||||
const ok = await rbacUserStore.loginByWxResult(result);
|
||||
if (!ok || !rbacUserStore.userInfo) {
|
||||
Message.error(t('wechat.openidMigrate.failed'));
|
||||
statusCode.value = 'ready';
|
||||
return;
|
||||
}
|
||||
if (rbacUserStore.token) {
|
||||
setToken(rbacUserStore.token);
|
||||
}
|
||||
applyRbacUserToUserStore(rbacUserStore.userInfo);
|
||||
await ensureFullLocaleMessages();
|
||||
Message.success(t('wechat.openidMigrate.success'));
|
||||
goCustomerCenter();
|
||||
}
|
||||
|
||||
function onMigrateCancel() {
|
||||
// 用户拒绝迁移:继续走新客户注册表单
|
||||
if (wxUserInfo.value?.openid) {
|
||||
statusCode.value = 'ready';
|
||||
}
|
||||
Message.info(t('wechat.openidMigrate.cancelledContinueRegister'));
|
||||
}
|
||||
|
||||
async function loadOAuthUserInfo(code: string) {
|
||||
beginLoading();
|
||||
try {
|
||||
@ -514,6 +556,11 @@ async function loadOAuthUserInfo(code: string) {
|
||||
formState.customerName = info.nickname || '';
|
||||
formState.password = DEFAULT_CUSTOMER_PASSWORD;
|
||||
statusCode.value = 'ready';
|
||||
if (info.suggestOpenidMigrate && info.migrateTicket) {
|
||||
migrateTicket.value = info.migrateTicket;
|
||||
migrateNickname.value = info.nickname || '';
|
||||
migrateVisible.value = true;
|
||||
}
|
||||
} catch (error) {
|
||||
if (isTimeoutError(error)) {
|
||||
statusCode.value = 'network-error';
|
||||
|
||||
@ -267,6 +267,7 @@ export default defineConfig(({ mode }) => {
|
||||
'/channel/issueTemplate',
|
||||
'/channel/labelDesign',
|
||||
'/channel/guide',
|
||||
'/channel/pricingWorkbench',
|
||||
];
|
||||
if (channelSpaPrefixes.some((p) => path === p || path.startsWith(`${p}/`))) {
|
||||
return '/index.html';
|
||||
@ -656,6 +657,7 @@ export default defineConfig(({ mode }) => {
|
||||
'/channel/issueTemplate',
|
||||
'/channel/labelDesign',
|
||||
'/channel/guide',
|
||||
'/channel/pricingWorkbench',
|
||||
// Marketing 相关前端路由(API 为 kebab-case,如 /marketing/member-level/list)
|
||||
'/marketing/guide',
|
||||
'/marketing/analysis',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user