初始化
This commit is contained in:
commit
561cd27f81
1
.eslintignore
Normal file
1
.eslintignore
Normal file
@ -0,0 +1 @@
|
||||
coverage
|
||||
2
.githooks/pre-commit
Normal file
2
.githooks/pre-commit
Normal file
@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
node script/git-safety-check.cjs
|
||||
19
.gitignore
vendored
Normal file
19
.gitignore
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
logs/
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
node_modules/
|
||||
*-lock.json
|
||||
*-lock.yaml
|
||||
yarn.lock
|
||||
coverage/
|
||||
.idea/
|
||||
run/
|
||||
.DS_Store
|
||||
*.sw*
|
||||
*.un~
|
||||
typings/
|
||||
.nyc_output/
|
||||
config/config.local.js
|
||||
config/deploy.config.local.cjs
|
||||
versioning/*
|
||||
!versioning/.gitkeep
|
||||
36
.vscode/launch.json
vendored
Normal file
36
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "Egg Debug",
|
||||
"runtimeExecutable": "npm",
|
||||
"runtimeArgs": [
|
||||
"run",
|
||||
"dev",
|
||||
"--",
|
||||
"--inspect-brk"
|
||||
],
|
||||
"console": "integratedTerminal",
|
||||
"restart": true,
|
||||
"autoAttachChildProcesses": true
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "Egg Test",
|
||||
"runtimeExecutable": "npm",
|
||||
"runtimeArgs": [
|
||||
"run",
|
||||
"test:local",
|
||||
"--",
|
||||
"--inspect-brk"
|
||||
],
|
||||
"autoAttachChildProcesses": true
|
||||
}
|
||||
]
|
||||
}
|
||||
31
README.md
Normal file
31
README.md
Normal file
@ -0,0 +1,31 @@
|
||||
# ye4s
|
||||
|
||||
tbyc
|
||||
|
||||
## QuickStart
|
||||
|
||||
<!-- add docs here for user -->
|
||||
|
||||
see [egg docs][egg] for more detail.
|
||||
|
||||
### Development
|
||||
|
||||
```bash
|
||||
npm i
|
||||
npm run dev
|
||||
open http://localhost:7001/
|
||||
```
|
||||
|
||||
### Deploy
|
||||
|
||||
```bash
|
||||
npm start
|
||||
npm stop
|
||||
```
|
||||
|
||||
### npm scripts
|
||||
|
||||
- Use `npm run lint` to check code style.
|
||||
- Use `npm test` to run unit test.
|
||||
|
||||
[egg]: https://eggjs.org
|
||||
124
app/assets/about.html
Normal file
124
app/assets/about.html
Normal file
@ -0,0 +1,124 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="关于天豹WMS — 了解我们的 SaaS 仓储管理系统背后的团队与愿景。">
|
||||
<title>关于我们 — 天豹WMS</title>
|
||||
<link rel="canonical" href="https://wms.gztbyc.com/about.html">
|
||||
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'><rect width='64' height='64' rx='14' fill='%231a73e8'/><text x='32' y='44' font-size='36' text-anchor='middle' fill='white' font-family='sans-serif' font-weight='bold'>豹</text></svg>">
|
||||
<link rel="stylesheet" href="static/css/common.css">
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar" id="navbar">
|
||||
<div class="nav-inner">
|
||||
<a href="/" class="nav-logo"><div class="logo-icon">豹</div>天豹 WMS</a>
|
||||
<button class="menu-toggle" id="menuToggle" aria-label="菜单"><span></span><span></span><span></span></button>
|
||||
<div class="nav-links" id="navLinks">
|
||||
<a href="/">首页</a>
|
||||
<a href="features.html">功能</a>
|
||||
<a href="help.html">帮助</a>
|
||||
<a href="about.html" class="active">关于</a>
|
||||
<a href="news/index.html">资讯</a>
|
||||
<a href="https://wms.wms.gztbyc.com" class="nav-cta" target="_blank" rel="nofollow noopener noreferrer">登录系统</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<section class="page-hero">
|
||||
<div class="container">
|
||||
<div class="section-tag">关于我们</div>
|
||||
<h1 class="section-title">关于天豹WMS</h1>
|
||||
<p class="section-desc">致力于为中小型电商与仓储企业提供专业、稳定、高效的 SaaS 仓储管理服务。</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- 产品愿景 -->
|
||||
<section>
|
||||
<div class="container" style="max-width:800px">
|
||||
<div class="about-block">
|
||||
<h2>我们的愿景</h2>
|
||||
<p>天豹WMS 诞生于仓储运营的实际需求。我们深知中小型电商与三方仓储服务商在订单处理、库存管理、多平台对接等方面面临的痛点——系统复杂、对接成本高、运维负担重。因此,我们打造了这款基于 Egg.js 的企业级 WMS SaaS 服务,让仓储管理变得简单、高效。</p>
|
||||
</div>
|
||||
<div class="about-block">
|
||||
<h2>核心优势</h2>
|
||||
<div class="advantage-grid">
|
||||
<div class="advantage-item">
|
||||
<div class="adv-icon">🛡️</div>
|
||||
<h4>稳定可靠</h4>
|
||||
<p>基于 Egg.js 3.x 企业级框架,历经多年生产环境验证,保障 99.9% 服务可用性。</p>
|
||||
</div>
|
||||
<div class="advantage-item">
|
||||
<div class="adv-icon">🔗</div>
|
||||
<h4>平台标准对接</h4>
|
||||
<p>严格遵循阿里巴巴奇门协议,与淘宝/天猫等平台无缝集成,订单自动同步。</p>
|
||||
</div>
|
||||
<div class="advantage-item">
|
||||
<div class="adv-icon">📱</div>
|
||||
<h4>多端支持</h4>
|
||||
<p>Web 管理端、PDA 手持终端、移动 App、微信小程序全覆盖,仓库作业随时随地。</p>
|
||||
</div>
|
||||
<div class="advantage-item">
|
||||
<div class="adv-icon">🔒</div>
|
||||
<h4>数据安全</h4>
|
||||
<p>租户数据物理隔离,加密传输与存储,定期自动备份,保障您的数据安全无忧。</p>
|
||||
</div>
|
||||
<div class="advantage-item">
|
||||
<div class="adv-icon">⚡</div>
|
||||
<h4>快速开通</h4>
|
||||
<p>SaaS 模式无需部署,提交申请即可快速开通,专注业务无需关心运维。</p>
|
||||
</div>
|
||||
<div class="advantage-item">
|
||||
<div class="adv-icon">💬</div>
|
||||
<h4>及时响应</h4>
|
||||
<p>专业技术支持团队,企业版用户享专属客户经理与优先响应通道。</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="about-block">
|
||||
<h2>技术实力</h2>
|
||||
<div style="display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px;margin-top:20px">
|
||||
<div class="tech-tag">Egg.js 3.x</div>
|
||||
<div class="tech-tag">MySQL + Sequelize</div>
|
||||
<div class="tech-tag">Redis 缓存</div>
|
||||
<div class="tech-tag">JWT 认证</div>
|
||||
<div class="tech-tag">REST / XML-RPC</div>
|
||||
<div class="tech-tag">OpenAPI</div>
|
||||
<div class="tech-tag">腾讯云 COS</div>
|
||||
<div class="tech-tag">SOAP 物流接口</div>
|
||||
<div class="tech-tag">ExcelJS</div>
|
||||
<div class="tech-tag">EJS 模板引擎</div>
|
||||
<div class="tech-tag">Node.js ≥ 18</div>
|
||||
<div class="tech-tag">多租户隔离</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="about-block">
|
||||
<h2>联系我们</h2>
|
||||
<p>如需开通服务或有任何疑问,请联系系统管理员。企业版用户可联系专属客户经理获取优先支持。</p>
|
||||
<div style="display:flex;gap:16px;margin-top:20px;flex-wrap:wrap">
|
||||
<a href="https://wms.wms.gztbyc.com" class="btn btn-primary" target="_blank" rel="nofollow noopener noreferrer">申请开通服务 <span class="arrow">→</span></a>
|
||||
<a href="help.html" class="btn btn-outline">查看帮助文档 <span class="arrow">→</span></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="footer-inner">
|
||||
<div class="footer-left">
|
||||
<div class="footer-logo-icon">豹</div>
|
||||
<div class="footer-info"><strong>天豹 WMS</strong><br>专业 SaaS 仓储管理系统</div>
|
||||
</div>
|
||||
<div class="footer-right">
|
||||
<a href="/">首页</a>
|
||||
<a href="features.html">功能详情</a>
|
||||
<a href="help.html">帮助文档</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer-bottom">© 2026 天豹WMS(tianbao-wms) | wms.gztbyc.com | Version 3.0.0 | <a href="https://beian.miit.gov.cn/" target="_blank" rel="nofollow noopener" style="color:inherit;text-decoration:none">粤ICP备2023091787号-1</a></div>
|
||||
</footer>
|
||||
|
||||
<button class="back-to-top" id="backToTop" aria-label="回到顶部">↑</button>
|
||||
<script src="static/js/common.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
242
app/assets/features.html
Normal file
242
app/assets/features.html
Normal file
@ -0,0 +1,242 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="天豹WMS 功能详情 — 订单管理、库存管理、库位管理、多平台对接、打印管理等完整仓储功能展示。">
|
||||
<title>功能详情 — 天豹WMS</title>
|
||||
<link rel="canonical" href="https://wms.gztbyc.com/features.html">
|
||||
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'><rect width='64' height='64' rx='14' fill='%231a73e8'/><text x='32' y='44' font-size='36' text-anchor='middle' fill='white' font-family='sans-serif' font-weight='bold'>豹</text></svg>">
|
||||
<link rel="stylesheet" href="static/css/common.css">
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar" id="navbar">
|
||||
<div class="nav-inner">
|
||||
<a href="/" class="nav-logo"><div class="logo-icon">豹</div>天豹 WMS</a>
|
||||
<button class="menu-toggle" id="menuToggle" aria-label="菜单"><span></span><span></span><span></span></button>
|
||||
<div class="nav-links" id="navLinks">
|
||||
<a href="/">首页</a>
|
||||
<a href="features.html" class="active">功能</a>
|
||||
<a href="help.html">帮助</a>
|
||||
<a href="about.html">关于</a>
|
||||
<a href="news/index.html">资讯</a>
|
||||
<a href="https://wms.wms.gztbyc.com" class="nav-cta" target="_blank" rel="nofollow noopener noreferrer">登录系统</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<section class="page-hero">
|
||||
<div class="container">
|
||||
<div class="section-tag">产品功能</div>
|
||||
<h1 class="section-title">覆盖仓储运营全链路</h1>
|
||||
<p class="section-desc">从订单接入到出库配送,从库存管控到数据决策,十大功能模块一站式满足仓储管理需求。</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<div class="container">
|
||||
<!-- 订单管理 -->
|
||||
<div class="feat-section" id="order">
|
||||
<div class="feat-grid">
|
||||
<div class="feat-text">
|
||||
<span class="feat-num">01</span>
|
||||
<h2>订单全生命周期管理</h2>
|
||||
<p class="feat-lead">M1 → M6 状态机驱动的完整流转链路,每一个环节独立追踪、精准管控。</p>
|
||||
<div class="feat-flow"><span>M1 待审核</span><span>→</span><span>M2 待处理</span><span>→</span><span>M3 异常</span><span>→</span><span>M4 配送中</span><span>→</span><span>M5 配送异常</span><span>→</span><span>M6 归档</span></div>
|
||||
<ul class="check-list">
|
||||
<li>同步、打印、拣货、打包、验货、出库、拦截等环节独立状态追踪</li>
|
||||
<li>支持审核、驳回、取消、拦截、异常处理</li>
|
||||
<li>订单动态分表设计,按仓库维度物理隔离</li>
|
||||
<li>冷热数据分离,查询高效不卡顿</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="feat-visual"><div class="visual-box vb-blue">📦<br><small>订单流转看板</small></div></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 入库管理 -->
|
||||
<div class="feat-section" id="inbound">
|
||||
<div class="feat-grid reverse">
|
||||
<div class="feat-visual"><div class="visual-box vb-green">📥<br><small>入库流程看板</small></div></div>
|
||||
<div class="feat-text">
|
||||
<span class="feat-num">02</span>
|
||||
<h2>入库管理</h2>
|
||||
<p class="feat-lead">从 ASN 预到货通知到质检上架,全流程可追溯、可管控。</p>
|
||||
<ul class="check-list">
|
||||
<li><strong>ASN 管理</strong>:预到货通知单创建、查询、状态跟踪</li>
|
||||
<li><strong>收货作业</strong>:明细录入 → 商品绑定 → 质检 → 上架</li>
|
||||
<li>支持直入、退货入库、协同收货多种模式</li>
|
||||
<li>收货单维度统计与完成确认</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 出库与拣货 -->
|
||||
<div class="feat-section" id="outbound">
|
||||
<div class="feat-grid">
|
||||
<div class="feat-text">
|
||||
<span class="feat-num">03</span>
|
||||
<h2>出库与拣货</h2>
|
||||
<p class="feat-lead">波次策略自动匹配,拣货路径智能优化,复核打包一体化。</p>
|
||||
<ul class="check-list">
|
||||
<li>订单分配、波次策略智能匹配</li>
|
||||
<li>拣货任务生成与执行</li>
|
||||
<li>拣货车(Pick Cart)模式</li>
|
||||
<li>复核、打包、称重、出库确认流水线</li>
|
||||
<li>出库后配送状态实时追踪</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="feat-visual"><div class="visual-box vb-orange">📤<br><small>出库拣货看板</small></div></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 库存管理 -->
|
||||
<div class="feat-section" id="inventory">
|
||||
<div class="feat-grid reverse">
|
||||
<div class="feat-visual"><div class="visual-box vb-purple">📊<br><small>库存概览仪表盘</small></div></div>
|
||||
<div class="feat-text">
|
||||
<span class="feat-num">04</span>
|
||||
<h2>精细化库存管理</h2>
|
||||
<p class="feat-lead">多货主、多仓库独立核算,库存状态一目了然。</p>
|
||||
<ul class="check-list">
|
||||
<li>仓库库存管理(正品、残次、冻结、待检等状态)</li>
|
||||
<li>商品条码管理、批号/批次追踪</li>
|
||||
<li>库存变动流水记录,操作可追溯</li>
|
||||
<li>库存预警:安全库存、效期预警</li>
|
||||
<li>多货主、多仓库库存独立核算</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 库位管理 -->
|
||||
<div class="feat-section" id="location">
|
||||
<div class="feat-grid">
|
||||
<div class="feat-text">
|
||||
<span class="feat-num">05</span>
|
||||
<h2>库位精细化管理</h2>
|
||||
<p class="feat-lead">库区 → 货架 → 库位三级体系,自动计算最优拣货路径。</p>
|
||||
<ul class="check-list">
|
||||
<li><strong>三级管理</strong>:库区 → 货架 → 库位</li>
|
||||
<li>库位类型:存储位、拣货位、暂存区、不良品区等</li>
|
||||
<li>自动计算拣货路径与拣货优先级</li>
|
||||
<li>库位唯一码/条码管理</li>
|
||||
<li>移库、补货、分配验证</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="feat-visual"><div class="visual-box vb-cyan">🗺️<br><small>库位布局示意</small></div></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 多平台对接 -->
|
||||
<div class="feat-section" id="integration">
|
||||
<div class="feat-grid reverse">
|
||||
<div class="feat-visual"><div class="visual-box vb-blue">🔌<br><small>多平台对接</small></div></div>
|
||||
<div class="feat-text">
|
||||
<span class="feat-num">06</span>
|
||||
<h2>多平台、多接口无缝对接</h2>
|
||||
<p class="feat-lead">标准协议 + OpenAPI + 内部网关三套体系,覆盖所有对接场景。</p>
|
||||
<ul class="check-list">
|
||||
<li><strong>标准接口协议</strong>:严格遵循阿里巴巴奇门协议</li>
|
||||
<li><strong>OpenAPI</strong>:独立开放链路,支持第三方系统集成</li>
|
||||
<li><strong>多快递平台</strong>:拼多多、淘宝、抖音、快手、小红书等</li>
|
||||
<li><strong>内部网关</strong>:内网系统统一调用入口</li>
|
||||
<li>支持 REST、XML-RPC 多种协议</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 打印管理 -->
|
||||
<div class="feat-section" id="print">
|
||||
<div class="feat-grid">
|
||||
<div class="feat-text">
|
||||
<span class="feat-num">07</span>
|
||||
<h2>打印管理</h2>
|
||||
<p class="feat-lead">多平台电子面单一键打印,打印任务灵活分发。</p>
|
||||
<ul class="check-list">
|
||||
<li>电子面单一键打印,支持批量操作</li>
|
||||
<li>拣货单、发货单、装箱单等多类模板</li>
|
||||
<li>打印台管理、打印任务分发</li>
|
||||
<li>支持菜鸟、拼多多、京东、抖音、快手、小红书等平台打印模板</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="feat-visual"><div class="visual-box vb-green">🖨️<br><small>打印管理</small></div></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 系统管理 -->
|
||||
<div class="feat-section" id="admin">
|
||||
<div class="feat-grid reverse">
|
||||
<div class="feat-visual"><div class="visual-box vb-purple">⚙️<br><small>权限管理</small></div></div>
|
||||
<div class="feat-text">
|
||||
<span class="feat-num">08</span>
|
||||
<h2>系统管理与权限</h2>
|
||||
<p class="feat-lead">多角色、细粒度权限控制,操作全程留痕可追溯。</p>
|
||||
<ul class="check-list">
|
||||
<li>用户注册、登录、角色切换</li>
|
||||
<li>多平台角色上下文管理(Web / PDA / App / 微信 / 小程序)</li>
|
||||
<li>细粒度权限控制(角色 → 菜单 → 接口级别)</li>
|
||||
<li>操作日志留痕</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 数据仪表盘 -->
|
||||
<div class="feat-section" id="dashboard">
|
||||
<div class="feat-grid">
|
||||
<div class="feat-text">
|
||||
<span class="feat-num">09</span>
|
||||
<h2>数据仪表盘</h2>
|
||||
<p class="feat-lead">实时运营数据一览,辅助管理决策。</p>
|
||||
<ul class="check-list">
|
||||
<li>实时统计:待处理订单、今日新增、昨日新增</li>
|
||||
<li>出库趋势、快递比例、平台分布图表</li>
|
||||
<li>未分配/未打印/未拣货等运营数据一目了然</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="feat-visual"><div class="visual-box vb-orange">📈<br><small>数据仪表盘</small></div></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 辅助能力 -->
|
||||
<div class="feat-section" id="tools">
|
||||
<div class="feat-grid reverse">
|
||||
<div class="feat-visual"><div class="visual-box vb-cyan">🧰<br><small>辅助工具</small></div></div>
|
||||
<div class="feat-text">
|
||||
<span class="feat-num">10</span>
|
||||
<h2>辅助能力</h2>
|
||||
<p class="feat-lead">Excel 服务、IM 集成、文件管理、国际化一应俱全。</p>
|
||||
<ul class="check-list">
|
||||
<li><strong>Excel 服务</strong>:灵活生成/解析单 sheet 或多 sheet Excel</li>
|
||||
<li><strong>IM 集成</strong>:企业微信/钉钉即时消息通知</li>
|
||||
<li><strong>文件管理</strong>:腾讯云 COS 文件上传,图片/文档/APK 统一管理</li>
|
||||
<li><strong>国际化(i18n)</strong>:多语言键值管理与自动翻译</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="footer-inner">
|
||||
<div class="footer-left">
|
||||
<div class="footer-logo-icon">豹</div>
|
||||
<div class="footer-info"><strong>天豹 WMS</strong><br>专业 SaaS 仓储管理系统</div>
|
||||
</div>
|
||||
<div class="footer-right">
|
||||
<a href="/">首页</a>
|
||||
<a href="features.html">功能详情</a>
|
||||
<a href="help.html">帮助文档</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer-bottom">© 2026 天豹WMS(tianbao-wms) | wms.gztbyc.com | Version 3.0.0 | <a href="https://beian.miit.gov.cn/" target="_blank" rel="nofollow noopener" style="color:inherit;text-decoration:none">粤ICP备2023091787号-1</a></div>
|
||||
</footer>
|
||||
|
||||
<button class="back-to-top" id="backToTop" aria-label="回到顶部">↑</button>
|
||||
<script src="static/js/common.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
138
app/assets/help.html
Normal file
138
app/assets/help.html
Normal file
@ -0,0 +1,138 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="天豹WMS 帮助文档 — 常见问题、使用指南、接口文档,帮助您快速上手 SaaS 仓储管理系统。">
|
||||
<title>帮助文档 — 天豹WMS</title>
|
||||
<link rel="canonical" href="https://wms.gztbyc.com/help.html">
|
||||
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'><rect width='64' height='64' rx='14' fill='%231a73e8'/><text x='32' y='44' font-size='36' text-anchor='middle' fill='white' font-family='sans-serif' font-weight='bold'>豹</text></svg>">
|
||||
<link rel="stylesheet" href="static/css/common.css">
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar" id="navbar">
|
||||
<div class="nav-inner">
|
||||
<a href="/" class="nav-logo"><div class="logo-icon">豹</div>天豹 WMS</a>
|
||||
<button class="menu-toggle" id="menuToggle" aria-label="菜单"><span></span><span></span><span></span></button>
|
||||
<div class="nav-links" id="navLinks">
|
||||
<a href="/">首页</a>
|
||||
<a href="features.html">功能</a>
|
||||
<a href="help.html" class="active">帮助</a>
|
||||
<a href="about.html">关于</a>
|
||||
<a href="news/index.html">资讯</a>
|
||||
<a href="https://wms.wms.gztbyc.com" class="nav-cta" target="_blank" rel="nofollow noopener noreferrer">登录系统</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<section class="page-hero">
|
||||
<div class="container">
|
||||
<div class="section-tag">帮助中心</div>
|
||||
<h1 class="section-title">帮助文档与常见问题</h1>
|
||||
<p class="section-desc">快速了解如何使用天豹WMS,解决日常操作中的疑问。</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<div class="container" style="max-width:900px">
|
||||
<!-- 快速上手 -->
|
||||
<div class="help-section">
|
||||
<h2 class="help-cat">🚀 快速上手</h2>
|
||||
<div class="faq-list">
|
||||
<div class="faq-item">
|
||||
<h4>如何开通天豹WMS服务?</h4>
|
||||
<p>联系管理员提交企业信息与需求申请,审核通过后将为您创建租户账号。收到账号密码后即可登录系统,按引导完成仓库、库位、用户等基础配置即可开始使用。</p>
|
||||
</div>
|
||||
<div class="faq-item">
|
||||
<h4>如何配置电商平台对接?</h4>
|
||||
<p>登录系统后进入「系统设置 → 平台管理」,选择需要对接的平台(淘宝/拼多多/抖音/快手等),按提示填写 AppKey、AppSecret 等授权信息,保存后即可自动同步订单。</p>
|
||||
</div>
|
||||
<div class="faq-item">
|
||||
<h4>如何添加仓库和库位?</h4>
|
||||
<p>进入「基础数据 → 仓库管理」创建仓库,然后在「库位管理」中按库区 → 货架 → 库位的层级添加库位信息,支持 Excel 批量导入。</p>
|
||||
</div>
|
||||
<div class="faq-item">
|
||||
<h4>如何配置电子面单打印?</h4>
|
||||
<p>进入「系统设置 → 快递管理」,添加合作的快递公司并配置电子面单账号。在打印管理页面即可一键获取并打印电子面单。</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 订单管理 -->
|
||||
<div class="help-section">
|
||||
<h2 class="help-cat">📦 订单管理</h2>
|
||||
<div class="faq-list">
|
||||
<div class="faq-item">
|
||||
<h4>订单状态流转规则是什么?</h4>
|
||||
<p>订单从 M1(待审核)开始,审核通过进入 M2(待处理),分配库存和快递后进入 M4(配送中),签收后进入 M6(归档)。如遇异常则进入 M3(异常)或 M5(配送异常)状态。</p>
|
||||
</div>
|
||||
<div class="faq-item">
|
||||
<h4>如何处理异常订单?</h4>
|
||||
<p>异常订单会自动标记为 M3 状态并在异常列表中展示。您可以根据异常原因(缺货、地址错误、取消等)选择驳回、修改重试或取消订单。</p>
|
||||
</div>
|
||||
<div class="faq-item">
|
||||
<h4>是否支持订单拦截?</h4>
|
||||
<p>支持。对于 M2(待处理)状态的订单可直接拦截取消;对于已发货(M4)的订单,可发起拦截请求,系统将调用快递接口尝试拦截。</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 接口文档 -->
|
||||
<div class="help-section">
|
||||
<h2 class="help-cat">🔌 接口与集成</h2>
|
||||
<div class="faq-list">
|
||||
<div class="faq-item">
|
||||
<h4>如何使用 OpenAPI 对接?</h4>
|
||||
<p>在「系统设置 → OpenAPI」中生成 API Key 和 Secret,参考 API 文档进行对接。支持 RESTful 风格调用,提供出库单、入库单、库存查询、商品同步等接口。</p>
|
||||
</div>
|
||||
<div class="faq-item">
|
||||
<h4>标准接口协议支持哪些能力?</h4>
|
||||
<p>严格遵循阿里巴巴奇门协议,支持出库单接口、入库单接口、退货单接口、库存查询接口、商品同步接口、发货单接口等标准奇门接口。</p>
|
||||
</div>
|
||||
<div class="faq-item">
|
||||
<h4>能否对接内部 ERP 系统?</h4>
|
||||
<p>专业版及以上套餐可通过 OpenAPI 或内部网关对接企业内部 ERP、OMS、CRM 等系统。企业版支持定制对接方案。</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 账号与安全 -->
|
||||
<div class="help-section">
|
||||
<h2 class="help-cat">🔐 账号与安全</h2>
|
||||
<div class="faq-list">
|
||||
<div class="faq-item">
|
||||
<h4>如何管理用户权限?</h4>
|
||||
<p>管理员可在「系统设置 → 角色管理」中创建角色并分配菜单和接口权限,然后将用户关联到对应角色,实现细粒度权限控制。</p>
|
||||
</div>
|
||||
<div class="faq-item">
|
||||
<h4>是否支持多端登录?</h4>
|
||||
<p>支持 Web 管理端、PDA 手持终端、移动 App、微信小程序等多种终端登录,各终端角色权限独立管理。</p>
|
||||
</div>
|
||||
<div class="faq-item">
|
||||
<h4>忘记密码怎么办?</h4>
|
||||
<p>请联系系统管理员重置密码。管理员可在「系统设置 → 用户管理」中为指定用户重置登录密码。</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="footer-inner">
|
||||
<div class="footer-left">
|
||||
<div class="footer-logo-icon">豹</div>
|
||||
<div class="footer-info"><strong>天豹 WMS</strong><br>专业 SaaS 仓储管理系统</div>
|
||||
</div>
|
||||
<div class="footer-right">
|
||||
<a href="/">首页</a>
|
||||
<a href="features.html">功能详情</a>
|
||||
<a href="help.html">帮助文档</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer-bottom">© 2026 天豹WMS(tianbao-wms) | wms.gztbyc.com | Version 3.0.0 | <a href="https://beian.miit.gov.cn/" target="_blank" rel="nofollow noopener" style="color:inherit;text-decoration:none">粤ICP备2023091787号-1</a></div>
|
||||
</footer>
|
||||
|
||||
<button class="back-to-top" id="backToTop" aria-label="回到顶部">↑</button>
|
||||
<script src="static/js/common.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
676
app/assets/index.html
Normal file
676
app/assets/index.html
Normal file
@ -0,0 +1,676 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="天豹WMS(tianbao-wms)— 基于 Egg.js 的 SaaS 仓储管理系统,支持多快递平台对接、订单全生命周期管理、精细化库位管控,为中小型电商与仓储企业提供高效运营服务。">
|
||||
<meta name="keywords" content="WMS,仓储管理系统,天豹WMS,仓库管理,SaaS,订单管理,库存管理,库位管理,电商WMS">
|
||||
<meta name="author" content="tianbao-wms">
|
||||
<meta property="og:title" content="天豹WMS — 专业 SaaS 仓储管理系统">
|
||||
<meta property="og:description" content="基于 Egg.js 的 SaaS 仓储管理系统,支持多快递平台对接、订单全生命周期管理、精细化库位管控,助力仓储运营降本增效。">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:url" content="https://wms.gztbyc.com">
|
||||
<link rel="canonical" href="https://wms.gztbyc.com">
|
||||
<title>天豹WMS — 专业 SaaS 仓储管理系统</title>
|
||||
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'><rect width='64' height='64' rx='14' fill='%231a73e8'/><text x='32' y='44' font-size='36' text-anchor='middle' fill='white' font-family='sans-serif' font-weight='bold'>豹</text></svg>">
|
||||
<link rel="stylesheet" href="static/css/common.css">
|
||||
<style>
|
||||
/* ========== Hero (index only) ========== */
|
||||
.hero{min-height:100vh;display:flex;align-items:center;justify-content:center;position:relative;overflow:hidden;padding-top:64px;background:linear-gradient(135deg,#f0f7ff 0%,#e8f0fe 30%,#f8fafc 60%,#e8f0fe 100%)}
|
||||
.hero::before{content:'';position:absolute;top:-50%;left:-50%;width:200%;height:200%;background:radial-gradient(circle at 30% 50%,rgba(26,115,232,.06) 0%,transparent 50%),radial-gradient(circle at 70% 50%,rgba(26,115,232,.04) 0%,transparent 50%);animation:heroBgFloat 20s ease-in-out infinite}
|
||||
@keyframes heroBgFloat{0%,100%{transform:translate(0,0)}50%{transform:translate(2%,1%)}}
|
||||
.hero-grid{position:absolute;top:0;left:0;right:0;bottom:0;opacity:.03}
|
||||
.hero-grid::before{content:'';position:absolute;top:0;left:0;right:0;bottom:0;background-image:linear-gradient(var(--blue) 1px,transparent 1px),linear-gradient(90deg,var(--blue) 1px,transparent 1px);background-size:60px 60px}
|
||||
.hero-content{position:relative;text-align:center;max-width:800px;z-index:1;animation:fadeInUp .8s ease-out}
|
||||
@keyframes fadeInUp{from{opacity:0;transform:translateY(30px)}to{opacity:1;transform:translateY(0)}}
|
||||
.hero-badge{display:inline-flex;align-items:center;gap:8px;background:var(--white);border:1px solid var(--gray-200);border-radius:100px;padding:6px 18px;font-size:.85rem;color:var(--gray-700);margin-bottom:32px;box-shadow:var(--shadow)}
|
||||
.hero-badge .dot{width:8px;height:8px;background:#22c55e;border-radius:50%;animation:pulse 2s infinite}
|
||||
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.4}}
|
||||
.hero-title{font-size:3.2rem;font-weight:900;color:var(--gray-900);line-height:1.2;margin-bottom:20px;letter-spacing:-.5px}
|
||||
.hero-title span{background:linear-gradient(135deg,var(--blue),#4f8ff7);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text}
|
||||
.hero-subtitle{font-size:1.15rem;color:var(--gray-500);margin-bottom:40px;line-height:1.8;max-width:600px;margin-left:auto;margin-right:auto}
|
||||
.hero-buttons{display:flex;gap:16px;justify-content:center;flex-wrap:wrap}
|
||||
.btn{padding:14px 32px;border-radius:10px;font-size:.95rem;font-weight:600;cursor:pointer;transition:all var(--transition);display:inline-flex;align-items:center;gap:8px;border:none}
|
||||
.btn-primary{background:var(--blue);color:var(--white);box-shadow:0 4px 16px rgba(26,115,232,.3)}
|
||||
.btn-primary:hover{background:var(--blue-dark);transform:translateY(-2px);box-shadow:0 8px 24px rgba(26,115,232,.4)}
|
||||
.btn-outline{background:var(--white);color:var(--blue);border:2px solid var(--blue)}
|
||||
.btn-outline:hover{background:var(--blue-light);transform:translateY(-2px)}
|
||||
.btn .arrow{transition:transform var(--transition)}
|
||||
.btn:hover .arrow{transform:translateX(4px)}
|
||||
|
||||
/* ========== Stats Bar ========== */
|
||||
.stats-bar{background:var(--white);border-top:1px solid var(--gray-200);border-bottom:1px solid var(--gray-200)}
|
||||
.stats-inner{max-width:var(--max-width);margin:0 auto;display:flex;justify-content:center;gap:64px;padding:40px 24px;flex-wrap:wrap}
|
||||
.stat-item{text-align:center}
|
||||
.stat-num{font-size:2rem;font-weight:800;color:var(--blue)}
|
||||
.stat-label{font-size:.85rem;color:var(--gray-500);margin-top:4px}
|
||||
|
||||
/* ========== Positioning ========== */
|
||||
.positioning{background:var(--white)}
|
||||
.positioning-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:32px;max-width:var(--max-width);margin:0 auto}
|
||||
.positioning-card{background:var(--gray-50);border:1px solid var(--gray-200);border-radius:var(--radius);padding:36px 28px;text-align:center;transition:all var(--transition);position:relative;overflow:hidden}
|
||||
.positioning-card::before{content:'';position:absolute;top:0;left:0;right:0;height:3px;background:linear-gradient(90deg,var(--blue),#4f8ff7);transform:scaleX(0);transition:transform var(--transition)}
|
||||
.positioning-card:hover::before{transform:scaleX(1)}
|
||||
.positioning-card:hover{transform:translateY(-4px);box-shadow:var(--shadow-lg);border-color:transparent}
|
||||
.positioning-icon{width:56px;height:56px;background:var(--blue-light);border-radius:14px;display:flex;align-items:center;justify-content:center;margin:0 auto 20px;font-size:1.6rem}
|
||||
.positioning-card h3{font-size:1.15rem;font-weight:700;color:var(--gray-900);margin-bottom:8px}
|
||||
.positioning-card p{font-size:.9rem;color:var(--gray-500);line-height:1.7}
|
||||
|
||||
/* ========== Features ========== */
|
||||
.features{background:var(--gray-50)}
|
||||
.features-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:24px;max-width:var(--max-width);margin:0 auto}
|
||||
.feature-card{background:var(--white);border:1px solid var(--gray-200);border-radius:var(--radius);padding:32px;cursor:pointer;transition:all var(--transition)}
|
||||
.feature-card:hover{box-shadow:var(--shadow-lg);border-color:transparent;transform:translateY(-2px)}
|
||||
.feature-card.active{border-color:var(--blue);box-shadow:0 0 0 3px rgba(26,115,232,.1)}
|
||||
.feature-header{display:flex;align-items:flex-start;gap:16px;margin-bottom:16px}
|
||||
.feature-icon{width:48px;height:48px;border-radius:12px;display:flex;align-items:center;justify-content:center;font-size:1.5rem;flex-shrink:0}
|
||||
.fi-blue{background:#e8f0fe;color:var(--blue)}
|
||||
.fi-green{background:#dcfce7;color:#16a34a}
|
||||
.fi-orange{background:#fff7ed;color:#ea580c}
|
||||
.fi-purple{background:#f3e8ff;color:#9333ea}
|
||||
.fi-cyan{background:#ecfeff;color:#0891b2}
|
||||
.fi-rose{background:#fff1f2;color:#e11d48}
|
||||
.feature-header h3{font-size:1.1rem;font-weight:700;color:var(--gray-900)}
|
||||
.feature-header p{font-size:.88rem;color:var(--gray-500);margin-top:4px}
|
||||
.feature-detail{max-height:0;overflow:hidden;transition:max-height .4s ease,padding .4s ease}
|
||||
.feature-card.active .feature-detail{max-height:500px;padding-top:16px}
|
||||
.feature-detail ul{margin-top:8px}
|
||||
.feature-detail li{font-size:.85rem;color:var(--gray-500);padding:6px 0;padding-left:20px;position:relative;line-height:1.6}
|
||||
.feature-detail li::before{content:'';position:absolute;left:0;top:12px;width:6px;height:6px;background:var(--blue);border-radius:50%}
|
||||
.feature-toggle{display:inline-flex;align-items:center;gap:4px;font-size:.8rem;color:var(--blue);font-weight:600;margin-top:4px}
|
||||
.feature-toggle .chevron{transition:transform var(--transition)}
|
||||
.feature-card.active .chevron{transform:rotate(180deg)}
|
||||
|
||||
/* ========== Architecture ========== */
|
||||
.architecture{background:var(--white)}
|
||||
.arch-diagram{max-width:900px;margin:0 auto}
|
||||
.arch-row{display:flex;align-items:center;justify-content:center;gap:12px;margin-bottom:12px;flex-wrap:wrap}
|
||||
.arch-box{background:var(--white);border:2px solid var(--gray-200);border-radius:10px;padding:16px 20px;font-size:.88rem;font-weight:600;color:var(--gray-700);text-align:center;transition:all var(--transition);min-width:120px}
|
||||
.arch-box:hover{border-color:var(--blue);color:var(--blue);box-shadow:var(--shadow)}
|
||||
.arch-box.highlight{background:var(--blue-light);border-color:var(--blue);color:var(--blue)}
|
||||
.arch-arrow{color:var(--gray-300);font-size:1.2rem;font-weight:300}
|
||||
.arch-vline{display:flex;flex-direction:column;align-items:center;gap:8px;color:var(--gray-300);font-size:1.2rem}
|
||||
.arch-label{font-size:.8rem;color:var(--gray-500);text-align:center;margin-top:8px}
|
||||
|
||||
/* ========== Integration ========== */
|
||||
.integration{background:var(--gray-50)}
|
||||
.integration-grid{max-width:var(--max-width);margin:0 auto;display:grid;grid-template-columns:1fr 1fr;gap:40px;align-items:start}
|
||||
.int-card{background:var(--white);border-radius:var(--radius);padding:32px;border:1px solid var(--gray-200)}
|
||||
.int-card h3{font-size:1.1rem;font-weight:700;color:var(--gray-900);margin-bottom:16px;display:flex;align-items:center;gap:10px}
|
||||
.int-card h3 .int-icon{width:36px;height:36px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:1.1rem}
|
||||
.int-table{width:100%;border-collapse:collapse}
|
||||
.int-table th,.int-table td{padding:10px 14px;text-align:left;font-size:.85rem}
|
||||
.int-table th{background:var(--gray-50);color:var(--gray-700);font-weight:600;border-radius:6px}
|
||||
.int-table td{color:var(--gray-500);border-bottom:1px solid var(--gray-100)}
|
||||
.platform-badges{display:flex;flex-wrap:wrap;gap:10px;margin-top:24px}
|
||||
.platform-badge{background:var(--white);border:1px solid var(--gray-200);border-radius:8px;padding:10px 16px;font-size:.85rem;font-weight:600;color:var(--gray-700);display:flex;align-items:center;gap:8px;transition:all var(--transition)}
|
||||
.platform-badge:hover{border-color:var(--blue);color:var(--blue);box-shadow:var(--shadow)}
|
||||
.platform-badge img{width:20px;height:20px;border-radius:4px}
|
||||
|
||||
/* ========== Scenarios ========== */
|
||||
.scenarios{background:var(--white)}
|
||||
.scenario-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:32px;max-width:var(--max-width);margin:0 auto}
|
||||
.scenario-card{background:var(--gray-50);border-radius:var(--radius);padding:36px 28px;border:1px solid var(--gray-200);transition:all var(--transition)}
|
||||
.scenario-card:hover{box-shadow:var(--shadow-lg);border-color:transparent}
|
||||
.scenario-num{font-size:3rem;font-weight:900;color:var(--blue);opacity:.15;line-height:1;margin-bottom:12px}
|
||||
.scenario-card h3{font-size:1.1rem;font-weight:700;color:var(--gray-900);margin-bottom:10px}
|
||||
.scenario-card p{font-size:.88rem;color:var(--gray-500);line-height:1.7}
|
||||
.scenario-flow{display:flex;align-items:center;gap:8px;margin-top:16px;font-size:.78rem;color:var(--gray-500);flex-wrap:wrap}
|
||||
.scenario-flow .step{background:var(--blue-light);color:var(--blue);padding:4px 12px;border-radius:20px;font-weight:600;white-space:nowrap}
|
||||
|
||||
/* ========== Quickstart cards (index only) ========== */
|
||||
.quickstart{background:var(--gray-50)}
|
||||
.code-block{max-width:700px;margin:0 auto;background:var(--gray-900);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow-lg)}
|
||||
.code-header{display:flex;align-items:center;gap:8px;padding:14px 20px;background:rgba(255,255,255,.05);border-bottom:1px solid rgba(255,255,255,.08)}
|
||||
.code-dot{width:12px;height:12px;border-radius:50%}
|
||||
.code-dot:nth-child(1){background:#ef4444}.code-dot:nth-child(2){background:#f59e0b}.code-dot:nth-child(3){background:#22c55e}
|
||||
.code-title{margin-left:12px;font-size:.8rem;color:rgba(255,255,255,.5)}
|
||||
.code-content{padding:24px;overflow-x:auto}
|
||||
.code-content pre{margin:0;font-family:'Fira Code','JetBrains Mono','Cascadia Code',Consolas,monospace;font-size:.85rem;line-height:1.8;color:#e2e8f0}
|
||||
.code-content .comment{color:#64748b}
|
||||
.code-content .cmd{color:#38bdf8}
|
||||
|
||||
/* ========== Index Responsive ========== */
|
||||
@media(max-width:1024px){.positioning-grid,.scenario-grid{grid-template-columns:repeat(2,1fr)}.integration-grid{grid-template-columns:1fr}}
|
||||
@media(max-width:768px){
|
||||
.hero-title{font-size:2.2rem}.hero-subtitle{font-size:1rem}
|
||||
.positioning-grid,.scenario-grid{grid-template-columns:1fr}
|
||||
.features-grid{grid-template-columns:1fr}.stats-inner{gap:32px}
|
||||
}
|
||||
@media(max-width:480px){.hero-title{font-size:1.8rem}.hero-buttons{flex-direction:column;align-items:center}.arch-row{flex-direction:column}}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!-- ==================== NAVBAR ==================== -->
|
||||
<nav class="navbar" id="navbar">
|
||||
<div class="nav-inner">
|
||||
<a href="/" class="nav-logo">
|
||||
<div class="logo-icon">豹</div>
|
||||
天豹 WMS
|
||||
</a>
|
||||
<button class="menu-toggle" id="menuToggle" aria-label="菜单">
|
||||
<span></span><span></span><span></span>
|
||||
</button>
|
||||
<div class="nav-links" id="navLinks">
|
||||
<a href="/" class="active">首页</a>
|
||||
<a href="features.html">功能</a>
|
||||
<a href="help.html">帮助</a>
|
||||
<a href="about.html">关于</a>
|
||||
<a href="news/index.html">资讯</a>
|
||||
<a href="https://wms.wms.gztbyc.com" class="nav-cta" target="_blank" rel="nofollow noopener noreferrer">登录系统</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- ==================== HERO ==================== -->
|
||||
<section class="hero" id="hero">
|
||||
<div class="hero-grid"></div>
|
||||
<div class="hero-content">
|
||||
<div class="hero-badge">
|
||||
<span class="dot"></span> 内测阶段 — 限量开放体验
|
||||
</div>
|
||||
<h1 class="hero-title">
|
||||
专业 SaaS<br><span>仓储管理系统</span>
|
||||
</h1>
|
||||
<p class="hero-subtitle">
|
||||
基于 Egg.js 构建的企业级 WMS,支持多快递平台对接、订单全生命周期管理、精细化库位管控,为中小型电商与仓储企业提供稳定可靠的 SaaS 服务。
|
||||
</p>
|
||||
<div class="hero-buttons">
|
||||
<a href="https://wms.wms.gztbyc.com" class="btn btn-primary" target="_blank" rel="nofollow noopener noreferrer">申请内测资格 <span class="arrow">→</span></a>
|
||||
<a href="features.html" class="btn btn-outline">了解更多功能 <span class="arrow">→</span></a>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ==================== STATS BAR ==================== -->
|
||||
<div class="stats-bar">
|
||||
<div class="stats-inner">
|
||||
<div class="stat-item">
|
||||
<div class="stat-num">6+</div>
|
||||
<div class="stat-label">已对接电商平台</div>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<div class="stat-num">10+</div>
|
||||
<div class="stat-label">标准接口协议</div>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<div class="stat-num">M1~M6</div>
|
||||
<div class="stat-label">订单状态全流转</div>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<div class="stat-num">三级</div>
|
||||
<div class="stat-label">库位精细化管理</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ==================== POSITIONING ==================== -->
|
||||
<section class="positioning" id="positioning">
|
||||
<div class="container">
|
||||
<div class="section-header">
|
||||
<div class="section-tag">产品定位</div>
|
||||
<h2 class="section-title">专为中小型电商与仓储企业打造的 SaaS 服务</h2>
|
||||
<p class="section-desc">开箱即用、按需开通,无需自行部署与维护,专注业务运营即可。</p>
|
||||
</div>
|
||||
<div class="positioning-grid">
|
||||
<div class="positioning-card">
|
||||
<div class="positioning-icon">🔗</div>
|
||||
<h3>平台标准对接</h3>
|
||||
<p>严格遵循阿里巴巴奇门协议,支持出库单、入库单、退货单、库存查询、商品同步等标准接口,无缝接入淘宝/天猫生态。</p>
|
||||
</div>
|
||||
<div class="positioning-card">
|
||||
<div class="positioning-icon">🔄</div>
|
||||
<h3>订单全生命周期</h3>
|
||||
<p>从 M1 待审核到 M6 归档,状态机驱动的完整流转链路,覆盖同步、打印、拣货、打包、验货、出库、拦截全环节。</p>
|
||||
</div>
|
||||
<div class="positioning-card">
|
||||
<div class="positioning-icon">☁️</div>
|
||||
<h3>SaaS 云服务</h3>
|
||||
<p>无需部署、免运维,开通即用。提供标准接口协议、OpenAPI 链路与内部网关三套接入体系,安心聚焦业务。</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ==================== FEATURES ==================== -->
|
||||
<section class="features" id="features">
|
||||
<div class="container">
|
||||
<div class="section-header">
|
||||
<div class="section-tag">核心功能</div>
|
||||
<h2 class="section-title">覆盖仓储运营全链路</h2>
|
||||
<p class="section-desc">从订单接入到出库配送,从库存管控到数据决策,一站式满足仓储管理需求。点击卡片查看详情。</p>
|
||||
</div>
|
||||
<div class="features-grid">
|
||||
<!-- 1. 订单管理 -->
|
||||
<div class="feature-card" onclick="this.classList.toggle('active')">
|
||||
<div class="feature-header">
|
||||
<div class="feature-icon fi-blue">📦</div>
|
||||
<div>
|
||||
<h3>订单全生命周期管理</h3>
|
||||
<p>M1→M6 状态机驱动的完整流转</p>
|
||||
</div>
|
||||
</div>
|
||||
<span class="feature-toggle">展开详情 <span class="chevron">▾</span></span>
|
||||
<div class="feature-detail">
|
||||
<ul>
|
||||
<li><strong>M1 待审核 → M2 待处理 → M3 异常 → M4 配送中 → M5 配送异常 → M6 归档</strong></li>
|
||||
<li>完善的状态机驱动:同步、打印、拣货、打包、验货、出库、拦截等环节独立状态追踪</li>
|
||||
<li>支持审核、驳回、取消、拦截、异常处理</li>
|
||||
<li>订单动态分表设计,按仓库维度物理隔离,冷热数据分离</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 2. 多平台对接 -->
|
||||
<div class="feature-card" onclick="this.classList.toggle('active')">
|
||||
<div class="feature-header">
|
||||
<div class="feature-icon fi-purple">🔌</div>
|
||||
<div>
|
||||
<h3>多平台、多接口无缝对接</h3>
|
||||
<p>标准协议 + OpenAPI + 内部网关</p>
|
||||
</div>
|
||||
</div>
|
||||
<span class="feature-toggle">展开详情 <span class="chevron">▾</span></span>
|
||||
<div class="feature-detail">
|
||||
<ul>
|
||||
<li><strong>标准接口协议</strong>:出库单、入库单、退货单、库存查询、商品同步</li>
|
||||
<li><strong>OpenAPI</strong>:独立的开放 API 链路,支持第三方系统集成</li>
|
||||
<li><strong>多快递平台</strong>:拼多多、淘宝/天猫、快手、抖音、小红书等电子面单对接</li>
|
||||
<li><strong>内部网关</strong>:内网系统间调用的统一入口</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 3. 库存管理 -->
|
||||
<div class="feature-card" onclick="this.classList.toggle('active')">
|
||||
<div class="feature-header">
|
||||
<div class="feature-icon fi-green">📊</div>
|
||||
<div>
|
||||
<h3>精细化库存管理</h3>
|
||||
<p>多货主、多仓库独立核算</p>
|
||||
</div>
|
||||
</div>
|
||||
<span class="feature-toggle">展开详情 <span class="chevron">▾</span></span>
|
||||
<div class="feature-detail">
|
||||
<ul>
|
||||
<li>仓库库存管理(正品、残次、冻结等)</li>
|
||||
<li>商品条码管理、批号/批次追踪</li>
|
||||
<li>库存变动流水、库存预警</li>
|
||||
<li>多货主、多仓库库存独立核算</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 4. 库位管理 -->
|
||||
<div class="feature-card" onclick="this.classList.toggle('active')">
|
||||
<div class="feature-header">
|
||||
<div class="feature-icon fi-orange">🗺️</div>
|
||||
<div>
|
||||
<h3>库位精细化管理</h3>
|
||||
<p>库区 → 货架 → 库位三级管控</p>
|
||||
</div>
|
||||
</div>
|
||||
<span class="feature-toggle">展开详情 <span class="chevron">▾</span></span>
|
||||
<div class="feature-detail">
|
||||
<ul>
|
||||
<li>库区 → 货架 → 库位三级精细化管理</li>
|
||||
<li>库位类型:存储位、拣货位、暂存区、不良品区等</li>
|
||||
<li>自动计算拣货路径与拣货优先级</li>
|
||||
<li>库位唯一码/条码管理,移库、补货、分配验证</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 5. 入库管理 -->
|
||||
<div class="feature-card" onclick="this.classList.toggle('active')">
|
||||
<div class="feature-header">
|
||||
<div class="feature-icon fi-cyan">📥</div>
|
||||
<div>
|
||||
<h3>入库管理</h3>
|
||||
<p>ASN → 收货 → 质检 → 上架</p>
|
||||
</div>
|
||||
</div>
|
||||
<span class="feature-toggle">展开详情 <span class="chevron">▾</span></span>
|
||||
<div class="feature-detail">
|
||||
<ul>
|
||||
<li>ASN(预到货通知单)管理</li>
|
||||
<li>收货作业:明细录入 → 商品绑定 → 质检 → 上架</li>
|
||||
<li>支持直入、退货入库、协同收货</li>
|
||||
<li>收货单维度统计与完成确认</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 6. 出库与拣货 -->
|
||||
<div class="feature-card" onclick="this.classList.toggle('active')">
|
||||
<div class="feature-header">
|
||||
<div class="feature-icon fi-rose">📤</div>
|
||||
<div>
|
||||
<h3>出库与拣货</h3>
|
||||
<p>波次策略 + 拣货车模式</p>
|
||||
</div>
|
||||
</div>
|
||||
<span class="feature-toggle">展开详情 <span class="chevron">▾</span></span>
|
||||
<div class="feature-detail">
|
||||
<ul>
|
||||
<li>订单分配、波次策略匹配</li>
|
||||
<li>拣货任务生成与执行</li>
|
||||
<li>拣货车(Pick Cart)模式</li>
|
||||
<li>复核、打包、称重、出库确认,出库后配送状态追踪</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 7. 打印管理 -->
|
||||
<div class="feature-card" onclick="this.classList.toggle('active')">
|
||||
<div class="feature-header">
|
||||
<div class="feature-icon fi-blue">🖨️</div>
|
||||
<div>
|
||||
<h3>打印管理</h3>
|
||||
<p>多平台电子面单一键打印</p>
|
||||
</div>
|
||||
</div>
|
||||
<span class="feature-toggle">展开详情 <span class="chevron">▾</span></span>
|
||||
<div class="feature-detail">
|
||||
<ul>
|
||||
<li>电子面单一键打印</li>
|
||||
<li>拣货单、发货单、装箱单等模板</li>
|
||||
<li>打印台管理、打印任务分发</li>
|
||||
<li>支持菜鸟、拼多多、京东、抖音、快手、小红书等平台模板</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 8. 系统管理 -->
|
||||
<div class="feature-card" onclick="this.classList.toggle('active')">
|
||||
<div class="feature-header">
|
||||
<div class="feature-icon fi-purple">⚙️</div>
|
||||
<div>
|
||||
<h3>系统管理与权限</h3>
|
||||
<p>多角色、细粒度权限控制</p>
|
||||
</div>
|
||||
</div>
|
||||
<span class="feature-toggle">展开详情 <span class="chevron">▾</span></span>
|
||||
<div class="feature-detail">
|
||||
<ul>
|
||||
<li>用户注册、登录、角色切换</li>
|
||||
<li>多平台角色上下文管理(Web / PDA / App / 微信 / 小程序)</li>
|
||||
<li>细粒度权限控制(角色 → 菜单 → 接口级别)</li>
|
||||
<li>操作日志留痕</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 9. 数据仪表盘 -->
|
||||
<div class="feature-card" onclick="this.classList.toggle('active')">
|
||||
<div class="feature-header">
|
||||
<div class="feature-icon fi-green">📈</div>
|
||||
<div>
|
||||
<h3>数据仪表盘</h3>
|
||||
<p>实时统计与运营数据可视化</p>
|
||||
</div>
|
||||
</div>
|
||||
<span class="feature-toggle">展开详情 <span class="chevron">▾</span></span>
|
||||
<div class="feature-detail">
|
||||
<ul>
|
||||
<li>实时统计:待处理订单、今日新增、昨日新增</li>
|
||||
<li>出库趋势、快递比例、平台分布</li>
|
||||
<li>未分配/未打印/未拣货等运营数据一目了然</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 10. 辅助能力 -->
|
||||
<div class="feature-card" onclick="this.classList.toggle('active')">
|
||||
<div class="feature-header">
|
||||
<div class="feature-icon fi-orange">🧰</div>
|
||||
<div>
|
||||
<h3>辅助能力</h3>
|
||||
<p>Excel / IM / 文件管理 / i18n</p>
|
||||
</div>
|
||||
</div>
|
||||
<span class="feature-toggle">展开详情 <span class="chevron">▾</span></span>
|
||||
<div class="feature-detail">
|
||||
<ul>
|
||||
<li><strong>Excel 服务</strong>:灵活生成/解析单 sheet 或多 sheet Excel(Buffer / 文件 / HTTP 下载)</li>
|
||||
<li><strong>IM 集成</strong>:企业微信/钉钉即时消息通知</li>
|
||||
<li><strong>文件管理</strong>:腾讯云 COS 文件上传,图片/文档/APK 统一管理</li>
|
||||
<li><strong>国际化(i18n)</strong>:多语言键值管理与自动翻译</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ==================== ARCHITECTURE ==================== -->
|
||||
<section class="architecture" id="architecture">
|
||||
<div class="container">
|
||||
<div class="section-header">
|
||||
<div class="section-tag">技术架构</div>
|
||||
<h2 class="section-title">稳定可靠的技术体系</h2>
|
||||
<p class="section-desc">基于 Egg.js 3.x 的企业级分层架构,清晰分离路由、服务、数据层,保障 SaaS 服务的高可用与高性能。</p>
|
||||
</div>
|
||||
<div class="arch-diagram">
|
||||
<!-- 入口层 -->
|
||||
<div class="arch-row">
|
||||
<div class="arch-box highlight">Web 管理端</div>
|
||||
<div class="arch-box highlight">PDA / 移动端</div>
|
||||
<div class="arch-box highlight">第三方系统</div>
|
||||
<div class="arch-box highlight">电商平台</div>
|
||||
</div>
|
||||
<div class="arch-vline">↓</div>
|
||||
<!-- 路由层 -->
|
||||
<div class="arch-row">
|
||||
<div class="arch-box">/system<br><span class="arch-label">系统管理入口</span></div>
|
||||
<div class="arch-box">/qimen<br><span class="arch-label">奇门协议入口</span></div>
|
||||
<div class="arch-box">/openapi<br><span class="arch-label">开放 API 入口</span></div>
|
||||
<div class="arch-box">内部网关<br><span class="arch-label">内网系统调用</span></div>
|
||||
</div>
|
||||
<div class="arch-vline">↓</div>
|
||||
<!-- 中间件 & 服务层 -->
|
||||
<div class="arch-row">
|
||||
<div class="arch-box">JWT 认证</div>
|
||||
<div class="arch-box">权限中间件</div>
|
||||
<div class="arch-box">参数校验</div>
|
||||
<div class="arch-box">日志记录</div>
|
||||
</div>
|
||||
<div class="arch-vline">↓</div>
|
||||
<div class="arch-row">
|
||||
<div class="arch-box highlight">Service 业务层</div>
|
||||
</div>
|
||||
<div class="arch-vline">↓</div>
|
||||
<!-- 数据层 -->
|
||||
<div class="arch-row">
|
||||
<div class="arch-box">MySQL<br><span class="arch-label">Sequelize ORM</span></div>
|
||||
<div class="arch-box">Redis<br><span class="arch-label">多 DB 隔离</span></div>
|
||||
<div class="arch-box">腾讯云 COS<br><span class="arch-label">对象存储</span></div>
|
||||
<div class="arch-box">外部 API<br><span class="arch-label">快递/电商平台</span></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Tech Stack Table -->
|
||||
<div style="overflow-x:auto;margin-top:48px">
|
||||
<table style="width:100%;max-width:900px;margin:0 auto;border-collapse:collapse;font-size:.85rem">
|
||||
<thead>
|
||||
<tr style="border-bottom:2px solid var(--gray-200)">
|
||||
<th style="padding:12px 16px;text-align:left;color:var(--gray-700)">层级</th>
|
||||
<th style="padding:12px 16px;text-align:left;color:var(--gray-700)">技术选型</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr style="border-bottom:1px solid var(--gray-100)"><td style="padding:10px 16px;font-weight:600;color:var(--gray-700)">框架</td><td style="padding:10px 16px;color:var(--gray-500)">Egg.js 3.x</td></tr>
|
||||
<tr style="border-bottom:1px solid var(--gray-100)"><td style="padding:10px 16px;font-weight:600;color:var(--gray-700)">数据库</td><td style="padding:10px 16px;color:var(--gray-500)">MySQL(Sequelize ORM + mysql2)</td></tr>
|
||||
<tr style="border-bottom:1px solid var(--gray-100)"><td style="padding:10px 16px;font-weight:600;color:var(--gray-700)">缓存</td><td style="padding:10px 16px;color:var(--gray-500)">Redis(多 DB 隔离:缓存/打印)</td></tr>
|
||||
<tr style="border-bottom:1px solid var(--gray-100)"><td style="padding:10px 16px;font-weight:600;color:var(--gray-700)">认证</td><td style="padding:10px 16px;color:var(--gray-500)">JWT</td></tr>
|
||||
<tr style="border-bottom:1px solid var(--gray-100)"><td style="padding:10px 16px;font-weight:600;color:var(--gray-700)">接口协议</td><td style="padding:10px 16px;color:var(--gray-500)">REST / XML-RPC(奇门)/ OpenAPI</td></tr>
|
||||
<tr style="border-bottom:1px solid var(--gray-100)"><td style="padding:10px 16px;font-weight:600;color:var(--gray-700)">模板引擎</td><td style="padding:10px 16px;color:var(--gray-500)">EJS</td></tr>
|
||||
<tr style="border-bottom:1px solid var(--gray-100)"><td style="padding:10px 16px;font-weight:600;color:var(--gray-700)">对象存储</td><td style="padding:10px 16px;color:var(--gray-500)">腾讯云 COS、七牛云</td></tr>
|
||||
<tr style="border-bottom:1px solid var(--gray-100)"><td style="padding:10px 16px;font-weight:600;color:var(--gray-700)">物流接口</td><td style="padding:10px 16px;color:var(--gray-500)">SOAP</td></tr>
|
||||
<tr style="border-bottom:1px solid var(--gray-100)"><td style="padding:10px 16px;font-weight:600;color:var(--gray-700)">数据处理</td><td style="padding:10px 16px;color:var(--gray-500)">ExcelJS、Fast XML Parser</td></tr>
|
||||
<tr style="border-bottom:1px solid var(--gray-100)"><td style="padding:10px 16px;font-weight:600;color:var(--gray-700)">运行环境</td><td style="padding:10px 16px;color:var(--gray-500)">Node.js ≥ 18</td></tr>
|
||||
<tr><td style="padding:10px 16px;font-weight:600;color:var(--gray-700)">测试</td><td style="padding:10px 16px;color:var(--gray-500)">Egg Mock + ESLint</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ==================== INTEGRATION ==================== -->
|
||||
<section class="integration" id="integration">
|
||||
<div class="container">
|
||||
<div class="section-header">
|
||||
<div class="section-tag">接口与集成</div>
|
||||
<h2 class="section-title">标准、可靠的接口体系</h2>
|
||||
<p class="section-desc">三种接口通道满足不同集成场景需求,已适配主流电商与快递平台。</p>
|
||||
</div>
|
||||
<div class="integration-grid">
|
||||
<!-- 奇门接口 -->
|
||||
<div class="int-card">
|
||||
<h3><span class="int-icon" style="background:#e8f0fe;color:var(--blue)">🔗</span>标准接口协议</h3>
|
||||
<table class="int-table">
|
||||
<thead><tr><th>接口</th><th>说明</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td>出库单接口</td><td>订单下发、出库确认、状态回传</td></tr>
|
||||
<tr><td>入库单接口</td><td>ASN 推送、收货确认</td></tr>
|
||||
<tr><td>退货单接口</td><td>退货入库创建与确认</td></tr>
|
||||
<tr><td>库存查询</td><td>实时库存同步与查询</td></tr>
|
||||
<tr><td>商品同步</td><td>商品主数据同步与更新</td></tr>
|
||||
<tr><td>发货单接口</td><td>发货信息推送与物流同步</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- OpenAPI + 网关 -->
|
||||
<div>
|
||||
<div class="int-card" style="margin-bottom:24px">
|
||||
<h3><span class="int-icon" style="background:#f3e8ff;color:#9333ea">🔓</span>OpenAPI 开放链路</h3>
|
||||
<p style="font-size:.88rem;color:var(--gray-500);line-height:1.7">
|
||||
为第三方系统提供标准 RESTful API,支持自定义鉴权、限流、文档自动生成,便于 ERP、OMS、CRM 等外部系统深度集成。
|
||||
</p>
|
||||
</div>
|
||||
<div class="int-card">
|
||||
<h3><span class="int-icon" style="background:#ecfeff;color:#0891b2">🏠</span>内部网关</h3>
|
||||
<p style="font-size:.88rem;color:var(--gray-500);line-height:1.7">
|
||||
内网系统间调用的统一入口,支持服务发现、负载均衡与熔断降级,保障内部微服务间的高可用通信。
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 平台徽标 -->
|
||||
<div style="text-align:center;margin-top:48px">
|
||||
<p style="font-size:.85rem;color:var(--gray-500);margin-bottom:20px">已对接平台</p>
|
||||
<div class="platform-badges" style="justify-content:center">
|
||||
<div class="platform-badge">🍑 淘宝/天猫</div>
|
||||
<div class="platform-badge">📱 拼多多</div>
|
||||
<div class="platform-badge">🎵 抖音电商</div>
|
||||
<div class="platform-badge">⚡ 快手电商</div>
|
||||
<div class="platform-badge">🐕 京东</div>
|
||||
<div class="platform-badge">📕 小红书</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ==================== SCENARIOS ==================== -->
|
||||
<section class="scenarios" id="scenarios">
|
||||
<div class="container">
|
||||
<div class="section-header">
|
||||
<div class="section-tag">适用场景</div>
|
||||
<h2 class="section-title">灵活适配多种仓储业务模式</h2>
|
||||
<p class="section-desc">无论您是电商商家还是三方仓储服务商,天豹WMS SaaS 服务都能满足您的需求。</p>
|
||||
</div>
|
||||
<div class="scenario-grid">
|
||||
<div class="scenario-card">
|
||||
<div class="scenario-num">01</div>
|
||||
<h3>🛒 电商仓配一体</h3>
|
||||
<p>订单从电商平台自动推送到 WMS,完成审核、拣货、打包、出库全流程,电子面单一键获取并回传物流单号。</p>
|
||||
<div class="scenario-flow">
|
||||
<span class="step">平台推送</span>→<span class="step">WMS 处理</span>→<span class="step">快递发出</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="scenario-card">
|
||||
<div class="scenario-num">02</div>
|
||||
<h3>🏢 三方仓储服务</h3>
|
||||
<p>支持多货主、多仓库独立运营与核算,不同货主的库存、订单、费用完全隔离,一个系统管理全部客户。</p>
|
||||
</div>
|
||||
<div class="scenario-card">
|
||||
<div class="scenario-num">03</div>
|
||||
<h3>🔗 系统集成对接</h3>
|
||||
<p>通过 OpenAPI 与内部网关,轻松对接企业现有 ERP/OMS/CRM 系统,实现业务数据互通与流程自动化。</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ==================== QUICKSTART ==================== -->
|
||||
<section class="quickstart" id="quickstart">
|
||||
<div class="container">
|
||||
<div class="section-header">
|
||||
<div class="section-tag">开通流程</div>
|
||||
<h2 class="section-title">三步开通,即刻使用</h2>
|
||||
<p class="section-desc">无需部署,无需运维,在线申请即可开通 SaaS 服务。</p>
|
||||
</div>
|
||||
<div style="max-width:700px;margin:0 auto;display:grid;grid-template-columns:repeat(3,1fr);gap:24px;text-align:center">
|
||||
<div style="background:var(--white);border:1px solid var(--gray-200);border-radius:var(--radius);padding:32px 20px">
|
||||
<div style="width:48px;height:48px;background:var(--blue-light);border-radius:50%;display:flex;align-items:center;justify-content:center;margin:0 auto 16px;font-size:1.3rem;font-weight:700;color:var(--blue)">1</div>
|
||||
<h4 style="font-size:1rem;color:var(--gray-900);margin-bottom:8px">提交申请</h4>
|
||||
<p style="font-size:.82rem;color:var(--gray-500);line-height:1.6">填写企业信息与服务需求,管理员审核后为您创建租户账号。</p>
|
||||
</div>
|
||||
<div style="background:var(--white);border:1px solid var(--gray-200);border-radius:var(--radius);padding:32px 20px">
|
||||
<div style="width:48px;height:48px;background:var(--blue-light);border-radius:50%;display:flex;align-items:center;justify-content:center;margin:0 auto 16px;font-size:1.3rem;font-weight:700;color:var(--blue)">2</div>
|
||||
<h4 style="font-size:1rem;color:var(--gray-900);margin-bottom:8px">配置对接</h4>
|
||||
<p style="font-size:.82rem;color:var(--gray-500);line-height:1.6">配置电商平台与快递接口,设置仓库、库位、用户权限等基础数据。</p>
|
||||
</div>
|
||||
<div style="background:var(--white);border:1px solid var(--gray-200);border-radius:var(--radius);padding:32px 20px">
|
||||
<div style="width:48px;height:48px;background:var(--blue-light);border-radius:50%;display:flex;align-items:center;justify-content:center;margin:0 auto 16px;font-size:1.3rem;font-weight:700;color:var(--blue)">3</div>
|
||||
<h4 style="font-size:1rem;color:var(--gray-900);margin-bottom:8px">开始运营</h4>
|
||||
<p style="font-size:.82rem;color:var(--gray-500);line-height:1.6">登录系统即可开始处理订单、管理库存,高效运转仓储业务。</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ==================== FOOTER ==================== -->
|
||||
<footer class="footer">
|
||||
<div class="footer-inner">
|
||||
<div class="footer-left">
|
||||
<div class="footer-logo-icon">豹</div>
|
||||
<div class="footer-info">
|
||||
<strong style="color:var(--white)">天豹 WMS</strong><br>
|
||||
专业 SaaS 仓储管理系统
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer-right">
|
||||
<a href="features.html">功能详情</a>
|
||||
<a href="help.html">帮助文档</a>
|
||||
<a href="about.html">关于我们</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer-bottom">
|
||||
© 2026 天豹WMS(tianbao-wms) | wms.gztbyc.com | Version 3.0.0 | <a href="https://beian.miit.gov.cn/" target="_blank" rel="nofollow noopener" style="color:inherit;text-decoration:none">粤ICP备2023091787号-1</a>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- ==================== BACK TO TOP ==================== -->
|
||||
<button class="back-to-top" id="backToTop" aria-label="回到顶部">↑</button>
|
||||
|
||||
<script src="static/js/common.js"></script>
|
||||
<script>
|
||||
// Index-specific scroll reveal for index-only elements
|
||||
const observerOptions2 = { threshold: 0.1, rootMargin: '0px 0px -50px 0px' };
|
||||
const observer2 = new IntersectionObserver((entries) => {
|
||||
entries.forEach(entry => {
|
||||
if (entry.isIntersecting) {
|
||||
entry.target.style.opacity = '1';
|
||||
entry.target.style.transform = 'translateY(0)';
|
||||
}
|
||||
});
|
||||
}, observerOptions2);
|
||||
document.querySelectorAll('.positioning-card, .feature-card, .scenario-card, .int-card, .arch-box').forEach(el => {
|
||||
el.style.opacity = '0';
|
||||
el.style.transform = 'translateY(20px)';
|
||||
el.style.transition = 'opacity .6s ease, transform .6s ease';
|
||||
observer2.observe(el);
|
||||
});
|
||||
setTimeout(() => {
|
||||
document.querySelectorAll('.positioning-card, .feature-card, .scenario-card, .int-card, .arch-box').forEach(el => {
|
||||
const rect = el.getBoundingClientRect();
|
||||
if (rect.top < window.innerHeight) {
|
||||
el.style.opacity = '1';
|
||||
el.style.transform = 'translateY(0)';
|
||||
}
|
||||
});
|
||||
}, 200);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
107
app/assets/news/article-1.html
Normal file
107
app/assets/news/article-1.html
Normal file
@ -0,0 +1,107 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>天豹WMS v3.0.0 正式发布 — 天豹WMS 资讯</title>
|
||||
<meta name="description" content="天豹WMS v3.0.0 正式发布,全新数据仪表盘与智能波次策略引擎上线,拣货效率提升35%,查询速度提升60%。">
|
||||
<link rel="canonical" href="https://wms.gztbyc.com/news/article-1.html">
|
||||
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'><rect width='64' height='64' rx='14' fill='%231a73e8'/><text x='32' y='44' font-size='36' text-anchor='middle' fill='white' font-family='sans-serif' font-weight='bold'>豹</text></svg>">
|
||||
<link rel="stylesheet" href="../static/css/common.css">
|
||||
<style>
|
||||
.article-hero{background:linear-gradient(135deg,#f0f7ff 0%,#e8f0fe 30%,#f8fafc 60%,#e8f0fe 100%);padding:120px 24px 60px;text-align:center}
|
||||
.article-meta{display:flex;align-items:center;justify-content:center;gap:16px;margin-top:16px;font-size:.85rem;color:var(--gray-500);flex-wrap:wrap}
|
||||
.article-meta .cat-tag{background:var(--blue);color:var(--white);padding:2px 12px;border-radius:20px;font-size:.72rem;font-weight:600}
|
||||
.article-body{max-width:760px;margin:0 auto;padding:48px 24px 80px;font-size:.95rem;line-height:2;color:var(--gray-700)}
|
||||
.article-body h2{font-size:1.4rem;font-weight:800;color:var(--gray-900);margin:36px 0 16px}
|
||||
.article-body h3{font-size:1.1rem;font-weight:700;color:var(--gray-800);margin:24px 0 12px}
|
||||
.article-body p{margin-bottom:16px}
|
||||
.article-body ul{margin:12px 0 20px 24px;list-style:disc}
|
||||
.article-body li{margin-bottom:8px}
|
||||
.article-body .highlight-box{background:var(--blue-light);border-left:4px solid var(--blue);border-radius:0 var(--radius) var(--radius) 0;padding:20px 24px;margin:24px 0}
|
||||
.back-link{display:inline-flex;align-items:center;gap:6px;color:var(--blue);font-weight:600;font-size:.9rem;margin-bottom:32px}
|
||||
.back-link:hover{color:var(--blue-dark)}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar" id="navbar">
|
||||
<div class="nav-inner">
|
||||
<a href="/" class="nav-logo"><div class="logo-icon">豹</div>天豹 WMS</a>
|
||||
<button class="menu-toggle" id="menuToggle" aria-label="菜单"><span></span><span></span><span></span></button>
|
||||
<div class="nav-links" id="navLinks">
|
||||
<a href="/">首页</a>
|
||||
<a href="../features.html">功能</a>
|
||||
<a href="../help.html">帮助</a>
|
||||
<a href="../about.html">关于</a>
|
||||
<a href="index.html">资讯</a>
|
||||
<a href="https://wms.wms.gztbyc.com" class="nav-cta" target="_blank" rel="nofollow noopener noreferrer">登录系统</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<section class="article-hero">
|
||||
<div class="container">
|
||||
<a href="index.html" class="back-link">← 返回资讯列表</a>
|
||||
<h1 class="section-title" style="font-size:2rem;max-width:700px;margin:0 auto 8px">天豹WMS v3.0.0 正式发布:全新仪表盘与波次策略</h1>
|
||||
<div class="article-meta">
|
||||
<span class="cat-tag">产品更新</span>
|
||||
<span>2026-06-18</span>
|
||||
<span>天豹WMS 团队</span>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<article class="article-body">
|
||||
<p>我们很高兴地宣布,天豹WMS v3.0.0 正式发布!本次大版本更新聚焦于<strong>数据可视化</strong>与<strong>运营效率</strong>两大核心方向,带来了全新的数据仪表盘、智能波次策略引擎,以及多项性能和体验优化。</p>
|
||||
|
||||
<h2>全新数据仪表盘</h2>
|
||||
<p>v3.0.0 对仪表盘进行了全面重构,现在您可以在一屏之内掌握仓库运营的全貌:</p>
|
||||
<ul>
|
||||
<li><strong>实时订单统计</strong>:待处理订单、今日新增、昨日新增一目了然,支持按仓库、平台维度筛选</li>
|
||||
<li><strong>出库趋势图表</strong>:以可视化图表展示近 7 天 / 30 天出库量趋势,快速发现运营波动</li>
|
||||
<li><strong>快递比例分析</strong>:按快递公司统计出库占比,便于物流成本优化</li>
|
||||
<li><strong>平台分布视图</strong>:按淘宝、拼多多、抖音、快手等平台维度查看订单分布</li>
|
||||
<li><strong>运营预警卡片</strong>:未分配、未打印、未拣货等关键指标异常高亮提示</li>
|
||||
</ul>
|
||||
|
||||
<h2>智能波次策略引擎</h2>
|
||||
<p>拣货效率是仓储运营的核心指标。v3.0.0 引入了全新的波次策略引擎,支持:</p>
|
||||
<ul>
|
||||
<li><strong>多维度波次规则</strong>:按快递公司、平台、目的地、商品品类、订单数量等多维度自由组合波次规则</li>
|
||||
<li><strong>智能优先级排序</strong>:系统根据订单时效、库存分布自动计算最优波次执行顺序</li>
|
||||
<li><strong>动态波次调整</strong>:支持在波次执行过程中动态添加/移除订单,灵活应对突发情况</li>
|
||||
<li><strong>波次执行看板</strong>:实时展示波次执行进度、预计完成时间、效率指标</li>
|
||||
</ul>
|
||||
|
||||
<div class="highlight-box">
|
||||
<strong>📊 实测数据:</strong>某日处理 3000+ 单的电商仓库在使用新版波次策略后,拣货效率提升约 <strong>35%</strong>,人均日拣货量从 800 件提升至 1080 件。
|
||||
</div>
|
||||
|
||||
<h2>性能优化</h2>
|
||||
<ul>
|
||||
<li>订单列表查询速度提升 60%,万级数据量下秒级响应</li>
|
||||
<li>库存变动流水查询优化,支持多条件组合筛选</li>
|
||||
<li>前端资源加载优化,首屏渲染时间缩短 40%</li>
|
||||
</ul>
|
||||
|
||||
<h2>其他改进</h2>
|
||||
<ul>
|
||||
<li>Excel 导出支持自定义字段选择</li>
|
||||
<li>操作日志新增接口调用记录</li>
|
||||
<li>修复了部分已知 Bug</li>
|
||||
</ul>
|
||||
|
||||
<p>v3.0.0 已对所有用户自动升级生效,无需任何操作。如您有任何问题或建议,请联系系统管理员。感谢您一直以来对天豹WMS 的支持!</p>
|
||||
</article>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="footer-inner">
|
||||
<div class="footer-left"><div class="footer-logo-icon">豹</div><div class="footer-info"><strong>天豹 WMS</strong><br>专业 SaaS 仓储管理系统</div></div>
|
||||
<div class="footer-right"><a href="/">首页</a><a href="../features.html">功能详情</a><a href="../help.html">帮助文档</a><a href="index.html">资讯中心</a></div>
|
||||
</div>
|
||||
<div class="footer-bottom">© 2026 天豹WMS(tianbao-wms) | wms.gztbyc.com | Version 3.0.0 | <a href="https://beian.miit.gov.cn/" target="_blank" rel="nofollow noopener" style="color:inherit;text-decoration:none">粤ICP备2023091787号-1</a></div>
|
||||
</footer>
|
||||
<button class="back-to-top" id="backToTop" aria-label="回到顶部">↑</button>
|
||||
<script src="../static/js/common.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
88
app/assets/news/article-2.html
Normal file
88
app/assets/news/article-2.html
Normal file
@ -0,0 +1,88 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>2026 电商仓储趋势:智能化与精细化成为主旋律 — 天豹WMS 资讯</title>
|
||||
<meta name="description" content="2026年电商仓储行业趋势分析:智能波次拣货、多平台统一管理、SaaS化部署成为仓储管理三大方向。">
|
||||
<link rel="canonical" href="https://wms.gztbyc.com/news/article-2.html">
|
||||
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'><rect width='64' height='64' rx='14' fill='%231a73e8'/><text x='32' y='44' font-size='36' text-anchor='middle' fill='white' font-family='sans-serif' font-weight='bold'>豹</text></svg>">
|
||||
<link rel="stylesheet" href="../static/css/common.css">
|
||||
<style>
|
||||
.article-hero{background:linear-gradient(135deg,#f0f7ff 0%,#e8f0fe 30%,#f8fafc 60%,#e8f0fe 100%);padding:120px 24px 60px;text-align:center}
|
||||
.article-meta{display:flex;align-items:center;justify-content:center;gap:16px;margin-top:16px;font-size:.85rem;color:var(--gray-500);flex-wrap:wrap}
|
||||
.article-meta .cat-tag{background:#16a34a;color:var(--white);padding:2px 12px;border-radius:20px;font-size:.72rem;font-weight:600}
|
||||
.article-body{max-width:760px;margin:0 auto;padding:48px 24px 80px;font-size:.95rem;line-height:2;color:var(--gray-700)}
|
||||
.article-body h2{font-size:1.4rem;font-weight:800;color:var(--gray-900);margin:36px 0 16px}
|
||||
.article-body h3{font-size:1.1rem;font-weight:700;color:var(--gray-800);margin:24px 0 12px}
|
||||
.article-body p{margin-bottom:16px}
|
||||
.article-body ul{margin:12px 0 20px 24px;list-style:disc}
|
||||
.article-body li{margin-bottom:8px}
|
||||
.article-body .highlight-box{background:#dcfce7;border-left:4px solid #16a34a;border-radius:0 var(--radius) var(--radius) 0;padding:20px 24px;margin:24px 0}
|
||||
.back-link{display:inline-flex;align-items:center;gap:6px;color:var(--blue);font-weight:600;font-size:.9rem;margin-bottom:32px}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar" id="navbar">
|
||||
<div class="nav-inner">
|
||||
<a href="/" class="nav-logo"><div class="logo-icon">豹</div>天豹 WMS</a>
|
||||
<button class="menu-toggle" id="menuToggle" aria-label="菜单"><span></span><span></span><span></span></button>
|
||||
<div class="nav-links" id="navLinks">
|
||||
<a href="/">首页</a><a href="../features.html">功能</a>
|
||||
<a href="../help.html">帮助</a><a href="../about.html">关于</a><a href="index.html">资讯</a>
|
||||
<a href="https://wms.wms.gztbyc.com" class="nav-cta" target="_blank" rel="nofollow noopener noreferrer">登录系统</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<section class="article-hero">
|
||||
<div class="container">
|
||||
<a href="index.html" class="back-link">← 返回资讯列表</a>
|
||||
<h1 class="section-title" style="font-size:2rem;max-width:700px;margin:0 auto 8px">2026 电商仓储趋势:智能化与精细化成为主旋律</h1>
|
||||
<div class="article-meta"><span class="cat-tag">行业动态</span><span>2026-06-10</span><span>天豹WMS 团队</span></div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<article class="article-body">
|
||||
<p>2026 年,电商行业竞争进入深水区。随着各大平台对物流时效的要求日益严格,仓储管理已从"能发货"升级为"快发货、准发货、低成本发货"。智能化与精细化,成为仓储管理的两大核心关键词。</p>
|
||||
|
||||
<h2>趋势一:从人找货到系统指挥人</h2>
|
||||
<p>传统仓库依赖老员工的记忆和经验来找到商品位置,这种方式效率低下且无法规模化。现代 WMS 系统通过库位管理和拣货路径优化,让系统来告诉拣货员"去哪里、拿什么、拿多少",大幅降低了对人工经验的依赖。</p>
|
||||
<ul>
|
||||
<li>库区 → 货架 → 库位三级精细化管理成为标配</li>
|
||||
<li>自动计算最优拣货路径,减少无效走动</li>
|
||||
<li>PDA 扫码确认,杜绝错拣漏拣</li>
|
||||
</ul>
|
||||
|
||||
<h2>趋势二:多平台订单统一管理</h2>
|
||||
<p>如今一个商家往往同时在淘宝、拼多多、抖音、快手、京东、小红书等多个平台经营。如果没有统一的 WMS,就需要登录多个后台处理订单,效率极低且容易出错。</p>
|
||||
<p>天豹WMS 等新一代系统已实现多平台订单自动同步、统一处理、统一打印、统一发货,一个系统管理全部渠道订单。</p>
|
||||
|
||||
<h2>趋势三:波次策略大幅提升拣货效率</h2>
|
||||
<p>波次拣货是提升仓库效率的关键手段。将多个订单按一定规则合并为一个波次统一拣货,然后分播到各个订单,比逐个订单拣货效率高数倍。</p>
|
||||
<p>2026 年的趋势是 <strong>智能波次</strong>:系统根据快递公司、目的地、商品相似度等维度自动生成最优波次,而非人工手动分组。</p>
|
||||
|
||||
<div class="highlight-box">
|
||||
<strong>💡 行业数据:</strong>使用智能波次策略的仓库,平均拣货效率提升 30%~50%,大促期间可支撑 3~5 倍的日常单量。
|
||||
</div>
|
||||
|
||||
<h2>趋势四:SaaS 化部署成为主流</h2>
|
||||
<p>中小企业无需自建机房、无需雇佣运维团队,开通即用的 SaaS WMS 正在成为主流选择。SaaS 模式的优势明显:</p>
|
||||
<ul>
|
||||
<li>零部署成本,开通即用</li>
|
||||
<li>自动升级,始终使用最新版本</li>
|
||||
<li>按需付费,灵活扩展</li>
|
||||
<li>数据安全有保障,专业团队运维</li>
|
||||
</ul>
|
||||
|
||||
<p>总的来说,2026 年的仓储管理正在从"经验驱动"转向"数据驱动",从"人工决策"转向"智能决策"。选择一款专业的 WMS 系统,将成为电商企业在激烈竞争中胜出的关键一步。</p>
|
||||
</article>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="footer-inner"><div class="footer-left"><div class="footer-logo-icon">豹</div><div class="footer-info"><strong>天豹 WMS</strong><br>专业 SaaS 仓储管理系统</div></div><div class="footer-right"><a href="/">首页</a><a href="../features.html">功能详情</a><a href="../help.html">帮助文档</a><a href="index.html">资讯中心</a></div></div>
|
||||
<div class="footer-bottom">© 2026 天豹WMS(tianbao-wms) | wms.gztbyc.com | Version 3.0.0 | <a href="https://beian.miit.gov.cn/" target="_blank" rel="nofollow noopener" style="color:inherit;text-decoration:none">粤ICP备2023091787号-1</a></div>
|
||||
</footer>
|
||||
<button class="back-to-top" id="backToTop" aria-label="回到顶部">↑</button>
|
||||
<script src="../static/js/common.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
102
app/assets/news/article-3.html
Normal file
102
app/assets/news/article-3.html
Normal file
@ -0,0 +1,102 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>拣货效率提升 30%:波次策略配置最佳实践 — 天豹WMS 资讯</title>
|
||||
<meta name="description" content="三种波次策略配置方案实测:按快递公司、按商品相似度、按目的地分波次,拣货效率最高提升60%。">
|
||||
<link rel="canonical" href="https://wms.gztbyc.com/news/article-3.html">
|
||||
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'><rect width='64' height='64' rx='14' fill='%231a73e8'/><text x='32' y='44' font-size='36' text-anchor='middle' fill='white' font-family='sans-serif' font-weight='bold'>豹</text></svg>">
|
||||
<link rel="stylesheet" href="../static/css/common.css">
|
||||
<style>
|
||||
.article-hero{background:linear-gradient(135deg,#f0f7ff 0%,#e8f0fe 30%,#f8fafc 60%,#e8f0fe 100%);padding:120px 24px 60px;text-align:center}
|
||||
.article-meta{display:flex;align-items:center;justify-content:center;gap:16px;margin-top:16px;font-size:.85rem;color:var(--gray-500);flex-wrap:wrap}
|
||||
.article-meta .cat-tag{background:#ea580c;color:var(--white);padding:2px 12px;border-radius:20px;font-size:.72rem;font-weight:600}
|
||||
.article-body{max-width:760px;margin:0 auto;padding:48px 24px 80px;font-size:.95rem;line-height:2;color:var(--gray-700)}
|
||||
.article-body h2{font-size:1.4rem;font-weight:800;color:var(--gray-900);margin:36px 0 16px}
|
||||
.article-body h3{font-size:1.1rem;font-weight:700;color:var(--gray-800);margin:24px 0 12px}
|
||||
.article-body p{margin-bottom:16px}
|
||||
.article-body ul{margin:12px 0 20px 24px;list-style:disc}
|
||||
.article-body li{margin-bottom:8px}
|
||||
.article-body .highlight-box{background:#fff7ed;border-left:4px solid #ea580c;border-radius:0 var(--radius) var(--radius) 0;padding:20px 24px;margin:24px 0}
|
||||
.article-body table{width:100%;border-collapse:collapse;margin:20px 0;font-size:.88rem}
|
||||
.article-body th{background:var(--gray-50);padding:10px 14px;text-align:left;font-weight:600;border:1px solid var(--gray-200)}
|
||||
.article-body td{padding:10px 14px;border:1px solid var(--gray-200)}
|
||||
.back-link{display:inline-flex;align-items:center;gap:6px;color:var(--blue);font-weight:600;font-size:.9rem;margin-bottom:32px}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar" id="navbar">
|
||||
<div class="nav-inner">
|
||||
<a href="/" class="nav-logo"><div class="logo-icon">豹</div>天豹 WMS</a>
|
||||
<button class="menu-toggle" id="menuToggle" aria-label="菜单"><span></span><span></span><span></span></button>
|
||||
<div class="nav-links" id="navLinks">
|
||||
<a href="/">首页</a><a href="../features.html">功能</a>
|
||||
<a href="../help.html">帮助</a><a href="../about.html">关于</a><a href="index.html">资讯</a>
|
||||
<a href="https://wms.wms.gztbyc.com" class="nav-cta" target="_blank" rel="nofollow noopener noreferrer">登录系统</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<section class="article-hero">
|
||||
<div class="container">
|
||||
<a href="index.html" class="back-link">← 返回资讯列表</a>
|
||||
<h1 class="section-title" style="font-size:2rem;max-width:700px;margin:0 auto 8px">拣货效率提升 30%:波次策略配置最佳实践</h1>
|
||||
<div class="article-meta"><span class="cat-tag">使用技巧</span><span>2026-06-05</span><span>天豹WMS 团队</span></div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<article class="article-body">
|
||||
<p>波次策略是 WMS 中最能直接提升拣货效率的功能之一。合理配置波次策略,可以让仓库的拣货效率提升 30% 甚至更多。本文将分享三种经过实战验证的配置方案。</p>
|
||||
|
||||
<h2>什么是波次策略?</h2>
|
||||
<p>波次(Wave)是将多个待处理的订单按一定规则合并为一批,统一进行拣货作业的策略。相比逐个订单拣货,波次拣货可以减少拣货员在仓库中的无效走动,大幅提升效率。</p>
|
||||
|
||||
<h2>方案一:按快递公司分波次</h2>
|
||||
<p><strong>适用场景:</strong>日均单量 500~2000 单,使用 3 家以上快递公司。</p>
|
||||
<p><strong>配置方式:</strong>在波次策略中选择"按快递公司"维度,系统自动将相同快递的订单归入同一波次。拣货完成后直接按快递分播,无需二次分拣。</p>
|
||||
<p><strong>效果:</strong>减少分播环节工作量约 40%,尤其适合快递公司分时段揽收的场景。</p>
|
||||
|
||||
<h2>方案二:按商品相似度分波次</h2>
|
||||
<p><strong>适用场景:</strong>SKU 数量较多(500+),商品存放位置分散。</p>
|
||||
<p><strong>配置方式:</strong>系统根据订单中的商品相似度自动聚类,将包含相同或相近商品(同一库区/货架)的订单合并波次。</p>
|
||||
<p><strong>效果:</strong>拣货路径缩短约 50%,拣货员无需在仓库中来回穿梭。</p>
|
||||
|
||||
<div class="highlight-box">
|
||||
<strong>⚡ 实战技巧:</strong>将高频商品(占订单 80% 的 SKU)集中放置在靠近打包区的拣货位,配合商品相似度波次策略,效果最佳。
|
||||
</div>
|
||||
|
||||
<h2>方案三:按目的地分波次</h2>
|
||||
<p><strong>适用场景:</strong>发货量大、目的地集中(如同城、同省订单占比高)。</p>
|
||||
<p><strong>配置方式:</strong>按收货地址的省/市维度分波次,发往同一地区的订单统一处理。</p>
|
||||
|
||||
<h2>三种方案对比</h2>
|
||||
<table>
|
||||
<thead><tr><th>波次策略</th><th>效率提升</th><th>适用单量</th><th>实施难度</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td>按快递公司</td><td>20%~30%</td><td>500~2000 单/天</td><td>低</td></tr>
|
||||
<tr><td>按商品相似度</td><td>30%~50%</td><td>1000~5000 单/天</td><td>中</td></tr>
|
||||
<tr><td>按目的地</td><td>15%~25%</td><td>500+ 单/天</td><td>低</td></tr>
|
||||
<tr><td>多维度组合</td><td>40%~60%</td><td>2000+ 单/天</td><td>高</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h2>最佳实践总结</h2>
|
||||
<ul>
|
||||
<li><strong>从小步开始:</strong>建议先从单一维度波次策略开始,稳定运行一周后再逐步叠加其他维度</li>
|
||||
<li><strong>关注数据反馈:</strong>定期查看波次执行报告中的效率指标,根据实际数据调整策略参数</li>
|
||||
<li><strong>结合库位优化:</strong>波次策略与库位布局是相辅相成的,高频商品靠近打包区是基础</li>
|
||||
<li><strong>大促提前准备:</strong>大促前提前配置好波次策略模板,活动中可以快速切换</li>
|
||||
</ul>
|
||||
|
||||
<p>如需帮助配置波次策略,请登录天豹WMS 后在「系统设置 → 波次策略」中操作,或联系系统管理员获取支持。</p>
|
||||
</article>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="footer-inner"><div class="footer-left"><div class="footer-logo-icon">豹</div><div class="footer-info"><strong>天豹 WMS</strong><br>专业 SaaS 仓储管理系统</div></div><div class="footer-right"><a href="/">首页</a><a href="../features.html">功能详情</a><a href="../help.html">帮助文档</a><a href="index.html">资讯中心</a></div></div>
|
||||
<div class="footer-bottom">© 2026 天豹WMS(tianbao-wms) | wms.gztbyc.com | Version 3.0.0 | <a href="https://beian.miit.gov.cn/" target="_blank" rel="nofollow noopener" style="color:inherit;text-decoration:none">粤ICP备2023091787号-1</a></div>
|
||||
</footer>
|
||||
<button class="back-to-top" id="backToTop" aria-label="回到顶部">↑</button>
|
||||
<script src="../static/js/common.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
159
app/assets/news/index.html
Normal file
159
app/assets/news/index.html
Normal file
@ -0,0 +1,159 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="天豹WMS 资讯中心 — 产品更新、行业动态、使用技巧,掌握仓储管理最新资讯。">
|
||||
<title>资讯中心 — 天豹WMS</title>
|
||||
<link rel="canonical" href="https://wms.gztbyc.com/news/">
|
||||
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'><rect width='64' height='64' rx='14' fill='%231a73e8'/><text x='32' y='44' font-size='36' text-anchor='middle' fill='white' font-family='sans-serif' font-weight='bold'>豹</text></svg>">
|
||||
<link rel="stylesheet" href="../static/css/common.css">
|
||||
<style>
|
||||
.news-hero{background:linear-gradient(135deg,#f0f7ff 0%,#e8f0fe 30%,#f8fafc 60%,#e8f0fe 100%);padding-top:120px;padding-bottom:60px;text-align:center}
|
||||
.news-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:24px;max-width:var(--max-width);margin:0 auto;padding:0 24px 80px}
|
||||
.news-card{background:var(--white);border:1px solid var(--gray-200);border-radius:var(--radius);overflow:hidden;transition:all var(--transition);cursor:pointer}
|
||||
.news-card:hover{box-shadow:var(--shadow-lg);border-color:transparent;transform:translateY(-2px)}
|
||||
.news-card-image{height:180px;background:var(--gray-100);display:flex;align-items:center;justify-content:center;font-size:2.5rem;position:relative;overflow:hidden}
|
||||
.news-card-image .nimg-blue{background:linear-gradient(135deg,#e8f0fe,#dbeafe)}
|
||||
.news-card-image .nimg-green{background:linear-gradient(135deg,#dcfce7,#d1fae5)}
|
||||
.news-card-image .nimg-orange{background:linear-gradient(135deg,#fff7ed,#ffedd5)}
|
||||
.news-card-image .nimg-purple{background:linear-gradient(135deg,#f3e8ff,#ede9fe)}
|
||||
.news-category{position:absolute;top:12px;left:12px;background:var(--blue);color:var(--white);padding:4px 12px;border-radius:20px;font-size:.72rem;font-weight:600}
|
||||
.news-card-body{padding:24px}
|
||||
.news-card-body .news-date{font-size:.78rem;color:var(--gray-500);margin-bottom:8px}
|
||||
.news-card-body h3{font-size:1.1rem;font-weight:700;color:var(--gray-900);margin-bottom:8px;line-height:1.4}
|
||||
.news-card-body p{font-size:.85rem;color:var(--gray-500);line-height:1.6;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
|
||||
.news-card-body .read-more{display:inline-flex;align-items:center;gap:4px;font-size:.8rem;color:var(--blue);font-weight:600;margin-top:12px}
|
||||
.news-tabs{display:flex;justify-content:center;gap:8px;margin-bottom:40px;flex-wrap:wrap}
|
||||
.news-tab{padding:8px 20px;border-radius:20px;font-size:.85rem;font-weight:600;cursor:pointer;border:1px solid var(--gray-200);background:var(--white);color:var(--gray-700);transition:all var(--transition)}
|
||||
.news-tab:hover,.news-tab.active{background:var(--blue);color:var(--white);border-color:var(--blue)}
|
||||
@media(max-width:768px){.news-grid{grid-template-columns:1fr}}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar" id="navbar">
|
||||
<div class="nav-inner">
|
||||
<a href="/" class="nav-logo"><div class="logo-icon">豹</div>天豹 WMS</a>
|
||||
<button class="menu-toggle" id="menuToggle" aria-label="菜单"><span></span><span></span><span></span></button>
|
||||
<div class="nav-links" id="navLinks">
|
||||
<a href="/">首页</a>
|
||||
<a href="../features.html">功能</a>
|
||||
<a href="../help.html">帮助</a>
|
||||
<a href="../about.html">关于</a>
|
||||
<a href="index.html" class="active">资讯</a>
|
||||
<a href="https://wms.wms.gztbyc.com" class="nav-cta" target="_blank" rel="nofollow noopener noreferrer">登录系统</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<section class="news-hero">
|
||||
<div class="container">
|
||||
<div class="section-tag">资讯中心</div>
|
||||
<h1 class="section-title" style="font-size:2.2rem">产品动态与行业资讯</h1>
|
||||
<p class="section-desc" style="max-width:600px;margin:0 auto">了解天豹WMS 最新产品更新、仓储行业趋势与运营技巧。</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="news-tabs" id="newsTabs">
|
||||
<button class="news-tab active" data-cat="all">全部</button>
|
||||
<button class="news-tab" data-cat="update">产品更新</button>
|
||||
<button class="news-tab" data-cat="industry">行业动态</button>
|
||||
<button class="news-tab" data-cat="tips">使用技巧</button>
|
||||
</div>
|
||||
|
||||
<div class="news-grid" id="newsGrid">
|
||||
<!-- 文章1 -->
|
||||
<a href="article-1.html" class="news-card" data-cat="update">
|
||||
<div class="news-card-image" style="background:linear-gradient(135deg,#e8f0fe,#dbeafe)">📦<span class="news-category">产品更新</span></div>
|
||||
<div class="news-card-body">
|
||||
<div class="news-date">2026-06-18</div>
|
||||
<h3>天豹WMS v3.0.0 正式发布:全新仪表盘与波次策略</h3>
|
||||
<p>本次大版本更新带来全新的数据仪表盘、智能波次策略引擎,以及多项性能和体验优化,助力仓储运营效率再升级。</p>
|
||||
<span class="read-more">阅读全文 →</span>
|
||||
</div>
|
||||
</a>
|
||||
<!-- 文章2 -->
|
||||
<a href="article-2.html" class="news-card" data-cat="industry">
|
||||
<div class="news-card-image" style="background:linear-gradient(135deg,#dcfce7,#d1fae5)">📈<span class="news-category">行业动态</span></div>
|
||||
<div class="news-card-body">
|
||||
<div class="news-date">2026-06-10</div>
|
||||
<h3>2026 电商仓储趋势:智能化与精细化成为主旋律</h3>
|
||||
<p>随着电商平台竞争加剧,仓储管理的智能化、精细化水平成为商家降本增效的关键。WMS 系统在其中扮演着越来越重要的角色。</p>
|
||||
<span class="read-more">阅读全文 →</span>
|
||||
</div>
|
||||
</a>
|
||||
<!-- 文章3 -->
|
||||
<a href="article-3.html" class="news-card" data-cat="tips">
|
||||
<div class="news-card-image" style="background:linear-gradient(135deg,#fff7ed,#ffedd5)">💡<span class="news-category">使用技巧</span></div>
|
||||
<div class="news-card-body">
|
||||
<div class="news-date">2026-06-05</div>
|
||||
<h3>拣货效率提升 30%:波次策略配置最佳实践</h3>
|
||||
<p>合理配置波次策略可以显著提升拣货效率。本文分享三种实战配置方案,帮助你的仓库运营更加高效。</p>
|
||||
<span class="read-more">阅读全文 →</span>
|
||||
</div>
|
||||
</a>
|
||||
<!-- 文章4(即将上线) -->
|
||||
<a href="#" class="news-card" data-cat="update" onclick="alert('即将上线,敬请期待')">
|
||||
<div class="news-card-image" style="background:linear-gradient(135deg,#f3e8ff,#ede9fe)">🔌<span class="news-category">产品更新</span></div>
|
||||
<div class="news-card-body">
|
||||
<div class="news-date">2026-05-28</div>
|
||||
<h3>OpenAPI 接口升级:新增批量操作与 Webhook 回调</h3>
|
||||
<p>OpenAPI 全面升级,新增批量订单处理接口与 Webhook 事件回调机制,第三方系统集成更加灵活高效。</p>
|
||||
<span class="read-more">即将上线 →</span>
|
||||
</div>
|
||||
</a>
|
||||
<!-- 文章5(即将上线) -->
|
||||
<a href="#" class="news-card" data-cat="industry" onclick="alert('即将上线,敬请期待')">
|
||||
<div class="news-card-image" style="background:linear-gradient(135deg,#e8f0fe,#dbeafe)">🏪<span class="news-category">行业动态</span></div>
|
||||
<div class="news-card-body">
|
||||
<div class="news-date">2026-05-20</div>
|
||||
<h3>抖音电商仓配升级:WMS 如何应对直播电商的爆发式订单</h3>
|
||||
<p>直播电商带来的瞬时订单高峰对仓储系统提出了极高要求。了解 WMS 如何通过弹性架构应对大促挑战。</p>
|
||||
<span class="read-more">即将上线 →</span>
|
||||
</div>
|
||||
</a>
|
||||
<!-- 文章6(即将上线) -->
|
||||
<a href="#" class="news-card" data-cat="tips" onclick="alert('即将上线,敬请期待')">
|
||||
<div class="news-card-image" style="background:linear-gradient(135deg,#dcfce7,#d1fae5)">🖨️<span class="news-category">使用技巧</span></div>
|
||||
<div class="news-card-body">
|
||||
<div class="news-date">2026-05-15</div>
|
||||
<h3>电子面单打印全攻略:从配置到异常处理</h3>
|
||||
<p>一文搞定电子面单打印的所有环节,包括多平台配置、模板定制、批量打印和常见异常排查。</p>
|
||||
<span class="read-more">即将上线 →</span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="footer-inner">
|
||||
<div class="footer-left">
|
||||
<div class="footer-logo-icon">豹</div>
|
||||
<div class="footer-info"><strong>天豹 WMS</strong><br>专业 SaaS 仓储管理系统</div>
|
||||
</div>
|
||||
<div class="footer-right">
|
||||
<a href="/">首页</a>
|
||||
<a href="../features.html">功能详情</a>
|
||||
<a href="../help.html">帮助文档</a>
|
||||
<a href="index.html">资讯中心</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer-bottom">© 2026 天豹WMS(tianbao-wms) | wms.gztbyc.com | Version 3.0.0 | <a href="https://beian.miit.gov.cn/" target="_blank" rel="nofollow noopener" style="color:inherit;text-decoration:none">粤ICP备2023091787号-1</a></div>
|
||||
</footer>
|
||||
|
||||
<button class="back-to-top" id="backToTop" aria-label="回到顶部">↑</button>
|
||||
<script src="../static/js/common.js"></script>
|
||||
<script>
|
||||
// Category filter
|
||||
document.querySelectorAll('.news-tab').forEach(tab => {
|
||||
tab.addEventListener('click', () => {
|
||||
document.querySelectorAll('.news-tab').forEach(t => t.classList.remove('active'));
|
||||
tab.classList.add('active');
|
||||
const cat = tab.dataset.cat;
|
||||
document.querySelectorAll('.news-card').forEach(card => {
|
||||
card.style.display = (cat === 'all' || card.dataset.cat === cat) ? '' : 'none';
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1 @@
|
||||
const o=(o,t)=>{const c=o.__vccOpts||o;for(const[s,n]of t)c[s]=n;return c};export{o as _};
|
||||
@ -0,0 +1 @@
|
||||
.content[data-v-a93c1656]{flex-wrap:nowrap}.box[data-v-a93c1656]{width:100%}.list[data-v-a93c1656]{width:100%;height:100%;padding-bottom:0!important;box-sizing:border-box}
|
||||
31
app/assets/public/wechat_1.0.6/assets/index-B8U-SFxP.js
Normal file
31
app/assets/public/wechat_1.0.6/assets/index-B8U-SFxP.js
Normal file
File diff suppressed because one or more lines are too long
1
app/assets/public/wechat_1.0.6/assets/index-CeBosqgw.css
Normal file
1
app/assets/public/wechat_1.0.6/assets/index-CeBosqgw.css
Normal file
File diff suppressed because one or more lines are too long
1
app/assets/public/wechat_1.0.6/assets/index-D5HqLnJC.css
Normal file
1
app/assets/public/wechat_1.0.6/assets/index-D5HqLnJC.css
Normal file
@ -0,0 +1 @@
|
||||
.win-box[data-v-65bb06e6]{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.8);z-index:999;padding-left:60px;padding-top:40px;box-sizing:border-box}.win-box[data-v-65bb06e6] .win-win[data-v-65bb06e6]{position:absolute;width:700px;height:400px;background-color:#ccc;margin:auto;top:20px;left:0;right:0;box-shadow:rgba(0,0,0,.3) 1px 1px 50px}.win-box[data-v-65bb06e6] .win-win[data-v-65bb06e6] .win-head[data-v-65bb06e6]{width:100%;height:30px;line-height:30px;background-color:#87ceeb;position:relative}.win-box[data-v-65bb06e6] .win-win[data-v-65bb06e6] .win-head[data-v-65bb06e6] .win-close[data-v-65bb06e6]{position:absolute;right:10px;cursor:pointer}.win-box[data-v-65bb06e6] .win-win[data-v-65bb06e6] .win-head[data-v-65bb06e6] .win-title[data-v-65bb06e6]{position:absolute;left:10px;color:#fff}.win-box[data-v-65bb06e6] .win-win[data-v-65bb06e6] .win-content[data-v-65bb06e6]{width:100%;height:370px;padding:5px;box-sizing:border-box;display:flex}.win-box[data-v-65bb06e6] .win-win[data-v-65bb06e6] .win-content[data-v-65bb06e6] .win-infos[data-v-65bb06e6]{width:100%;height:100%;background-color:#fff;padding:5px;box-sizing:border-box}.win-box[data-v-65bb06e6] .win-win[data-v-65bb06e6] .win-content[data-v-65bb06e6] .win-infos[data-v-65bb06e6] .line[data-v-65bb06e6]{width:100%;line-height:2.5rem;display:flex;flex-wrap:nowrap}.win-box[data-v-65bb06e6] .win-win[data-v-65bb06e6] .win-content[data-v-65bb06e6] .win-infos[data-v-65bb06e6] .line[data-v-65bb06e6] .title[data-v-65bb06e6]{width:150px}.win-box[data-v-65bb06e6] .win-win[data-v-65bb06e6] .win-content[data-v-65bb06e6] .win-infos[data-v-65bb06e6] .line[data-v-65bb06e6] .checkbox[data-v-65bb06e6]{height:12.5rem}.win-box[data-v-65bb06e6] .win-win[data-v-65bb06e6] .win-content[data-v-65bb06e6] .win-infos[data-v-65bb06e6] .line[data-v-65bb06e6] .checkbox[data-v-65bb06e6] .uni-list-cell[data-v-65bb06e6]{display:flex;justify-content:flex-start;padding:0 .625rem}.win-box[data-v-65bb06e6] .win-win[data-v-65bb06e6] .win-content[data-v-65bb06e6] .value[data-v-65bb06e6]{display:inline-block;vertical-align:middle;width:100px;height:30px;line-height:30px;background-color:#efefef;border:1px solid #000;box-sizing:border-box;padding:0 10px;text-align:center;font-size:14px}.win-box[data-v-65bb06e6] .win-win[data-v-65bb06e6] .win-content[data-v-65bb06e6] .btn[data-v-65bb06e6]{background-color:#00f;color:#fff;cursor:pointer}.content[data-v-44b5ecab]{flex-wrap:nowrap}.box[data-v-44b5ecab]{width:100%}.roomitem[data-v-44b5ecab]{line-height:40px;text-align:left;background-color:rgba(0,0,0,.4);margin:5px 0;padding-left:5px;display:flex;flex-wrap:nowrap}.roomitem .name[data-v-44b5ecab]{width:220px;display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#7fff00}.roomitem uni-button[data-v-44b5ecab]{height:20px;line-height:20px;font-size:14px;display:inline;margin:10px 5px}.roomitem .red[data-v-44b5ecab]{background-color:red;color:#fff}.roomitem .blue[data-v-44b5ecab]{background-color:#00f;color:#fff!important}.list[data-v-44b5ecab]{width:100%;height:100%;padding-bottom:0!important;box-sizing:border-box}
|
||||
@ -0,0 +1 @@
|
||||
.win-add2[data-v-5d77a3e2]{position:fixed;left:0;top:0;right:0;bottom:0;background:rgba(0,0,0,.3);display:flex;align-items:center;justify-content:center;z-index:9999}.win-content[data-v-5d77a3e2]{background:#fff;padding:24px;border-radius:8px;min-width:300px}.title[data-v-5d77a3e2]{font-size:18px;margin-bottom:16px}.form uni-input[data-v-5d77a3e2]{display:block;width:100%;margin-bottom:12px;padding:8px;border:1px solid #ccc;border-radius:4px}.actions[data-v-5d77a3e2]{display:flex;justify-content:flex-end}.actions uni-button[data-v-5d77a3e2]{margin-left:12px}.content[data-v-d8015cc3]{flex-wrap:nowrap}.box[data-v-d8015cc3]{width:100%}.list[data-v-d8015cc3]{width:100%;height:100%;padding-bottom:0!important;box-sizing:border-box}
|
||||
1
app/assets/public/wechat_1.0.6/assets/log-B1g-HYy6.css
Normal file
1
app/assets/public/wechat_1.0.6/assets/log-B1g-HYy6.css
Normal file
@ -0,0 +1 @@
|
||||
.empty-tip[data-v-c01953dd]{color:#bbb;text-align:center;margin-top:40px;font-size:15px}.chat-box[data-v-c01953dd]{display:flex;flex-direction:column;height:100%;background:#fcfcfc}.chat-header[data-v-c01953dd]{padding:12px;background:#e6e6e6;font-weight:700;font-size:16px}.chat-content[data-v-c01953dd]{flex:1 1 0%;overflow-y:auto;padding:12px;min-height:0}.chat-list[data-v-c01953dd]{min-height:100%}.chat-message[data-v-c01953dd]{margin-bottom:10px;background:#fff;border-radius:6px;padding:8px 12px;box-shadow:0 1px 2px rgba(0,0,0,.03)}.msg-user[data-v-c01953dd]{color:#409eff;font-size:13px}.msg-content[data-v-c01953dd]{margin:2px 0;font-size:15px;word-break:break-all}.msg-reply[data-v-c01953dd]{background:#f0f4fa;color:#888;font-size:13px;border-left:3px solid #409eff;padding:2px 8px;margin-bottom:2px;border-radius:3px}.msg-time[data-v-c01953dd]{font-size:11px;color:#aaa;text-align:right}.chat-footer[data-v-c01953dd]{padding:8px 12px;display:flex;flex-direction:column;gap:6px;height:200px}.chat-footer .box[data-v-c01953dd]{width:100%;height:100%;border:1px solid #ccc;border-radius:4px;display:flex;flex-direction:column}.chat-footer .box .input-box[data-v-c01953dd]{flex:1;border:none;padding:8px 10px;font-size:15px;resize:none;width:100%;box-sizing:border-box}.footer-tools[data-v-c01953dd]{display:flex;gap:8px;margin-bottom:2px}.tool-btn[data-v-c01953dd]{background:none;border:none;font-size:20px;cursor:pointer}.footer-input[data-v-c01953dd]{display:flex;gap:8px}.input-box[data-v-c01953dd]{flex:1;border:1px solid #ccc;border-radius:4px;padding:6px 10px;font-size:15px;background:#fff}.send-btn[data-v-c01953dd]{background:#409eff;color:#fff;border:none;border-radius:4px;padding:0 18px;font-size:15px;cursor:pointer}.search-bar[data-v-bd7f5b03]{position:relative;display:flex;align-items:center}.search-bar .search-input[data-v-bd7f5b03]{flex:1}.search-bar .clear-btn[data-v-bd7f5b03]{position:absolute;right:20px;top:50%;transform:translateY(-50%);font-size:18px;color:#bbb;cursor:pointer;-webkit-user-select:none;user-select:none}.content[data-v-bd7f5b03]{flex-wrap:nowrap}.content .log-layout[data-v-bd7f5b03]{display:flex;height:100vh;flex-direction:row;width:100%}.content .log-layout .log-left[data-v-bd7f5b03]{width:300px;border-right:1px solid #ccc;display:flex;background-color:#eeeef0;flex-direction:column}.content .log-layout .log-left .log-title[data-v-bd7f5b03]{font-size:18px;font-weight:700;padding:10px}.content .log-layout .log-left .log-title .search-input[data-v-bd7f5b03]{background-color:#fff;border:none;padding:5px;border-radius:4px}.content .log-layout .log-left .group-list[data-v-bd7f5b03]{flex:1;overflow-y:auto}.content .log-layout .log-left .group-list .group-item[data-v-bd7f5b03]{padding:10px;cursor:pointer}.content .log-layout .log-left .group-list .group-item.active[data-v-bd7f5b03]{background-color:#fff}.content .log-layout .log-left .group-list .group-item .group-name[data-v-bd7f5b03]{font-size:16px}.content .log-layout .log-right[data-v-bd7f5b03]{flex:1 1 0%;min-width:0;display:flex;flex-direction:column;height:100vh;box-sizing:border-box;background-color:#fff}
|
||||
1
app/assets/public/wechat_1.0.6/assets/login-Bw0Vbjpk.css
Normal file
1
app/assets/public/wechat_1.0.6/assets/login-Bw0Vbjpk.css
Normal file
@ -0,0 +1 @@
|
||||
.form_box[data-v-06b9555e]{width:300px;height:280px;border-radius:5px;display:flex;flex-wrap:wrap;z-index:2;padding:40px 25px;box-sizing:border-box}.form_box .input[data-v-06b9555e]{width:250px;height:40px;line-height:40px;border:1px solid #ddd;border-radius:5px;padding:0 20px;box-sizing:border-box;background:#fff}.form_box .tipbox[data-v-06b9555e]{height:40px;width:100%}.form_box .inputTip[data-v-06b9555e]{color:red;height:40px;line-height:40px}.form_box .button[data-v-06b9555e]{width:250px;height:40px;line-height:40px;box-sizing:border-box;border:1px solid #ddd;border-radius:5px}.content[data-v-06b9555e]{justify-content:center;align-content:center;background-color:#fff8dc}.fackBar[data-v-06b9555e]{height:25px;line-height:25px;width:100%;position:fixed;top:0;left:0;background-color:#0078d7;color:#fff;padding-left:10px;font-size:14px;z-index:1;box-sizing:border-box}.rightbutton[data-v-06b9555e]{position:fixed;top:26px;right:0;background-color:#fff;height:40px;line-height:40px;padding:0 20px}.ercode[data-v-06b9555e]{width:250px;height:250px}
|
||||
1
app/assets/public/wechat_1.0.6/assets/m-nav-BN-ODETU.css
Normal file
1
app/assets/public/wechat_1.0.6/assets/m-nav-BN-ODETU.css
Normal file
File diff suppressed because one or more lines are too long
1
app/assets/public/wechat_1.0.6/assets/m-nav.CZV981Qo.js
Normal file
1
app/assets/public/wechat_1.0.6/assets/m-nav.CZV981Qo.js
Normal file
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
||||
.win-box[data-v-be5b4899]{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.8);z-index:999;padding-left:60px;padding-top:40px;box-sizing:border-box}.win-box[data-v-be5b4899] .win-win[data-v-be5b4899]{position:absolute;width:500px;height:500px;background-color:#ccc;margin:auto;top:20px;left:0;right:0;box-shadow:rgba(0,0,0,.3) 1px 1px 50px}.win-box[data-v-be5b4899] .win-win[data-v-be5b4899] .win-head[data-v-be5b4899]{width:100%;height:30px;line-height:30px;background-color:#87ceeb;position:relative}.win-box[data-v-be5b4899] .win-win[data-v-be5b4899] .win-head[data-v-be5b4899] .win-close[data-v-be5b4899]{position:absolute;right:10px;cursor:pointer}.win-box[data-v-be5b4899] .win-win[data-v-be5b4899] .win-head[data-v-be5b4899] .win-title[data-v-be5b4899]{position:absolute;left:10px;color:#fff}.win-box[data-v-be5b4899] .win-win[data-v-be5b4899] .win-content[data-v-be5b4899]{width:100%;height:470px;padding:5px;box-sizing:border-box;display:flex}.win-box[data-v-be5b4899] .win-win[data-v-be5b4899] .win-content[data-v-be5b4899] .win-infos[data-v-be5b4899]{width:100%;height:100%;background-color:#fff;padding:5px;box-sizing:border-box}.win-box[data-v-be5b4899] .win-win[data-v-be5b4899] .win-content[data-v-be5b4899] .win-infos[data-v-be5b4899] .line[data-v-be5b4899]{width:100%;min-height:2.5rem;line-height:2.5rem;display:flex;flex-wrap:nowrap}.win-box[data-v-be5b4899] .win-win[data-v-be5b4899] .win-content[data-v-be5b4899] .win-infos[data-v-be5b4899] .line[data-v-be5b4899] .title[data-v-be5b4899]{width:100px}.win-box[data-v-be5b4899] .win-win[data-v-be5b4899] .win-content[data-v-be5b4899] .value[data-v-be5b4899]{display:inline-block;vertical-align:middle;width:100px;height:30px;line-height:30px;background-color:#efefef;border:1px solid #000;box-sizing:border-box;padding:0 10px;text-align:center;font-size:14px}.win-box[data-v-be5b4899] .win-win[data-v-be5b4899] .win-content[data-v-be5b4899] .btn[data-v-be5b4899]{background-color:#00f;color:#fff;cursor:pointer}.win-box[data-v-be5b4899] .textarea[data-v-be5b4899]{cursor:pointer;flex:1;font-size:14px;border:1px solid #e5e5e5;box-sizing:border-box;border-radius:4px;padding:0 5px 0 10px;position:relative;display:flex;-webkit-user-select:none;user-select:none;flex-direction:row;align-items:center;border-bottom:solid 1px #e5e5e5;width:100%}
|
||||
1
app/assets/public/wechat_1.0.6/assets/order-BaHcfnrg.css
Normal file
1
app/assets/public/wechat_1.0.6/assets/order-BaHcfnrg.css
Normal file
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
||||
import{r as t,a as e,_ as a}from"./m-nav.CZV981Qo.js";import{f as s,c as n,w as i,i as l,o,b as c,x as d,h as r,j as f,F as u,S as h,t as g}from"./index-B8U-SFxP.js";import{_ as m}from"./_plugin-vue_export-helper.BCo6x5W8.js";const p=m({data:()=>({list:[]}),onLoad(){this.getList()},methods:{getList(t=!1){this.list=[{id:1,content:"群发内容A",time:"2026-03-20 10:00"},{id:2,content:"群发内容B",time:"2026-03-20 11:00"}]}}},[["render",function(m,p,_,b,x,w){const j=t(s("m-nav"),e),v=t(s("uni-icons"),a),y=l,L=h;return o(),n(y,{class:"content"},{default:i((()=>[c(j,{n:3}),c(y,{class:"box"},{default:i((()=>[c(y,{class:"contents"},{default:i((()=>[c(y,{class:"operator"},{default:i((()=>[c(y,{class:"item",onClick:p[0]||(p[0]=t=>w.getList(!0))},{default:i((()=>[c(v,{type:"refreshempty",size:"14"})])),_:1})])),_:1}),c(L,{class:"list"},{default:i((()=>[d("table",{cellpadding:"3",cellspacing:"1",border:"0",width:"100%",bgcolor:"#8ba0e2",class:"box"},[d("thead",null,[d("tr",null,[d("th",{align:"center",width:"1%"}),d("th",{align:"center",width:"20%"},"群发内容"),d("th",{align:"center",width:"20%"},"发送时间")])]),d("tbody",null,[(o(!0),r(u,null,f(x.list,((t,e)=>(o(),r("tr",{key:t.id,index:e,bgcolor:"#fff"},[d("td",{align:"center",width:"1%"}),d("td",{align:"center"},g(t.content),1),d("td",{align:"center"},g(t.time),1)],8,["index"])))),128))])])])),_:1})])),_:1})])),_:1})])),_:1})}],["__scopeId","data-v-a93c1656"]]);export{p as default};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
||||
import{r as s,a as t,c as e,w as a,i as o,o as r,b as c,d as i,e as n}from"./index-B8U-SFxP.js";import{u as d}from"./user.Bm-2eyfO.js";import{_ as u}from"./_plugin-vue_export-helper.BCo6x5W8.js";const h=u({data:()=>({focus:!1,scan:!0,focus2:!1,username:"",password:"",usernameTip:!1,passwordTip:!1,timer:null,token:""}),onLoad(){this.showscan()},onUnload(){},methods:{showscan(){this.getErcode()},closescan(){clearTimeout(this.timer),this.scan=!1},checkUsername(){return this.focus=!1,this.$forceUpdate(),this.usernameTip=!this.username,this.focus2=!1,this.focus=!0,this.$forceUpdate(),console.log("this.usernameTip: ",this.usernameTip),this.usernameTip},checkPassword(){return this.focus2=!1,this.$forceUpdate(),this.passwordTip=!this.password,this.focus=!1,this.focus2=!0,this.$forceUpdate(),this.passwordTip},getErcode(){const t=this;s({url:"http://wms.gztbyc.com/auth/getLoginercode",method:"GET",success(s){console.log(s.data.data),t.token=s.data.data,t.scan=!0,t.getLoginStatus()}})},getLoginStatus(){const e=this;s({url:"http://wms.gztbyc.com/auth/getLoginstatus",method:"POST",data:{token:e.token},success(s){if(console.log(s.data.data.uuid),s.data.data.token){d.setToken(s.data.data.token),t({url:"/pages/index/index"})}else e.timer=setTimeout((()=>{e.getLoginStatus()}),2e3)}})}}},[["render",function(s,t,d,u,h,l){const m=o,f=n;return r(),e(m,{class:"content"},{default:a((()=>[c(m,{class:"fackBar"},{default:a((()=>[i(" 机器人设置 ")])),_:1}),c(m,{class:"form_box"},{default:a((()=>[c(f,{src:`https://ye4s.wms.gztbyc.com/qrcode/build?text=${h.token}&label=&logo=0&labelalignment=center&foreground=%23000000&background=%23ffffff&size=300&padding=10&logosize=50&labelfontsize=14&errorcorrection=medium`,class:"ercode"},null,8,["src"])])),_:1})])),_:1})}],["__scopeId","data-v-06b9555e"]]);export{h as default};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
app/assets/public/wechat_1.0.6/assets/store-fjY_tD81.css
Normal file
1
app/assets/public/wechat_1.0.6/assets/store-fjY_tD81.css
Normal file
@ -0,0 +1 @@
|
||||
.win-box[data-v-f78a1d6f]{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.8);z-index:999;padding-left:60px;padding-top:40px;box-sizing:border-box}.win-box[data-v-f78a1d6f] .win-win[data-v-f78a1d6f]{position:absolute;width:700px;height:400px;background-color:#ccc;margin:auto;top:20px;left:0;right:0;box-shadow:rgba(0,0,0,.3) 1px 1px 50px}.win-box[data-v-f78a1d6f] .win-win[data-v-f78a1d6f] .win-head[data-v-f78a1d6f]{width:100%;height:30px;line-height:30px;background-color:#87ceeb;position:relative}.win-box[data-v-f78a1d6f] .win-win[data-v-f78a1d6f] .win-head[data-v-f78a1d6f] .win-close[data-v-f78a1d6f]{position:absolute;right:10px;cursor:pointer}.win-box[data-v-f78a1d6f] .win-win[data-v-f78a1d6f] .win-head[data-v-f78a1d6f] .win-title[data-v-f78a1d6f]{position:absolute;left:10px;color:#fff}.win-box[data-v-f78a1d6f] .win-win[data-v-f78a1d6f] .win-content[data-v-f78a1d6f]{width:100%;height:370px;padding:5px;box-sizing:border-box;display:flex}.win-box[data-v-f78a1d6f] .win-win[data-v-f78a1d6f] .win-content[data-v-f78a1d6f] .win-infos[data-v-f78a1d6f]{width:100%;height:100%;background-color:#fff;padding:5px;box-sizing:border-box}.win-box[data-v-f78a1d6f] .win-win[data-v-f78a1d6f] .win-content[data-v-f78a1d6f] .win-infos[data-v-f78a1d6f] .line[data-v-f78a1d6f]{width:100%;height:2.5rem;line-height:2.5rem;display:flex;flex-wrap:nowrap}.win-box[data-v-f78a1d6f] .win-win[data-v-f78a1d6f] .win-content[data-v-f78a1d6f] .win-infos[data-v-f78a1d6f] .line[data-v-f78a1d6f] .title[data-v-f78a1d6f]{width:150px}.win-box[data-v-f78a1d6f] .win-win[data-v-f78a1d6f] .win-content[data-v-f78a1d6f] .value[data-v-f78a1d6f]{display:inline-block;vertical-align:middle;width:100px;height:30px;line-height:30px;background-color:#efefef;border:1px solid #000;box-sizing:border-box;padding:0 10px;text-align:center;font-size:14px}.win-box[data-v-f78a1d6f] .win-win[data-v-f78a1d6f] .win-content[data-v-f78a1d6f] .btn[data-v-f78a1d6f]{background-color:#00f;color:#fff;cursor:pointer}.content[data-v-3ba456c7]{flex-wrap:nowrap}.box[data-v-3ba456c7]{width:100%}.roomitem[data-v-3ba456c7]{line-height:40px;text-align:left;background-color:rgba(0,0,0,.4);margin:5px 0;padding-left:5px;display:flex;flex-wrap:nowrap}.roomitem .name[data-v-3ba456c7]{width:220px;display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#7fff00}.roomitem uni-button[data-v-3ba456c7]{height:20px;line-height:20px;font-size:14px;display:inline;margin:10px 5px}.roomitem .red[data-v-3ba456c7]{background-color:red;color:#fff}.roomitem .blue[data-v-3ba456c7]{background-color:#00f;color:#fff!important}.list[data-v-3ba456c7]{width:100%;height:100%;padding-bottom:0!important;box-sizing:border-box}
|
||||
@ -0,0 +1 @@
|
||||
@media screen and (max-width: 500px){.hide-on-phone[data-v-fe4b6be6]{display:none}}.uni-stat__select[data-v-fe4b6be6]{display:flex;align-items:center;cursor:pointer;width:100%;flex:1;box-sizing:border-box}.uni-stat-box[data-v-fe4b6be6],.uni-stat__actived[data-v-fe4b6be6]{width:100%;flex:1}.uni-label-text[data-v-fe4b6be6]{font-size:14px;font-weight:700;color:#6a6a6a;margin:auto 5px auto 0}.uni-select[data-v-fe4b6be6]{font-size:14px;border:1px solid #e5e5e5;box-sizing:border-box;border-radius:4px;padding:0 5px 0 10px;position:relative;display:flex;-webkit-user-select:none;user-select:none;flex-direction:row;align-items:center;border-bottom:solid 1px #e5e5e5;width:100%;flex:1;height:35px}.uni-select--disabled[data-v-fe4b6be6]{background-color:#f5f7fa;cursor:not-allowed}.uni-select__label[data-v-fe4b6be6]{font-size:16px;height:35px;padding-right:10px;color:#909399}.uni-select__input-box[data-v-fe4b6be6]{height:35px;position:relative;display:flex;flex:1;flex-direction:row;align-items:center}.uni-select__input[data-v-fe4b6be6]{flex:1;font-size:14px;height:22px;line-height:22px}.uni-select__input-plac[data-v-fe4b6be6]{font-size:14px;color:#909399}.uni-select__selector[data-v-fe4b6be6]{box-sizing:border-box;position:absolute;left:0;width:100%;background-color:#fff;border:1px solid #EBEEF5;border-radius:6px;box-shadow:0 2px 12px rgba(0,0,0,.1);z-index:3;padding:4px 0}.uni-select__selector-scroll[data-v-fe4b6be6]{max-height:200px;box-sizing:border-box}@media (min-width: 768px){.uni-select__selector-scroll[data-v-fe4b6be6]{max-height:600px}}.uni-select__selector-empty[data-v-fe4b6be6],.uni-select__selector-item[data-v-fe4b6be6]{display:flex;cursor:pointer;line-height:35px;font-size:14px;text-align:center;padding:0 10px}.uni-select__selector-item[data-v-fe4b6be6]:hover{background-color:#f9f9f9}.uni-select__selector-empty[data-v-fe4b6be6]:last-child,.uni-select__selector-item[data-v-fe4b6be6]:last-child{border-bottom:none}.uni-select__selector__disabled[data-v-fe4b6be6]{opacity:.4;cursor:default}.uni-popper__arrow_bottom[data-v-fe4b6be6],.uni-popper__arrow_bottom[data-v-fe4b6be6]:after,.uni-popper__arrow_top[data-v-fe4b6be6],.uni-popper__arrow_top[data-v-fe4b6be6]:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid;border-width:6px}.uni-popper__arrow_bottom[data-v-fe4b6be6]{filter:drop-shadow(0 2px 12px rgba(0,0,0,.03));top:-6px;left:10%;margin-right:3px;border-top-width:0;border-bottom-color:#ebeef5}.uni-popper__arrow_bottom[data-v-fe4b6be6]:after{content:" ";top:1px;margin-left:-6px;border-top-width:0;border-bottom-color:#fff}.uni-popper__arrow_top[data-v-fe4b6be6]{filter:drop-shadow(0 2px 12px rgba(0,0,0,.03));bottom:-6px;left:10%;margin-right:3px;border-bottom-width:0;border-top-color:#ebeef5}.uni-popper__arrow_top[data-v-fe4b6be6]:after{content:" ";bottom:1px;margin-left:-6px;border-bottom-width:0;border-top-color:#fff}.uni-select__input-text[data-v-fe4b6be6]{width:100%;color:#333;white-space:nowrap;text-overflow:ellipsis;-o-text-overflow:ellipsis;overflow:hidden}.uni-select__input-placeholder[data-v-fe4b6be6]{color:#6a6a6a;font-size:12px}.uni-select--mask[data-v-fe4b6be6]{position:fixed;top:0;bottom:0;right:0;left:0;z-index:2}
|
||||
File diff suppressed because one or more lines are too long
1
app/assets/public/wechat_1.0.6/assets/uni.6c77786a.css
Normal file
1
app/assets/public/wechat_1.0.6/assets/uni.6c77786a.css
Normal file
File diff suppressed because one or more lines are too long
BIN
app/assets/public/wechat_1.0.6/assets/uniicons-DN59BOw4.ttf
Normal file
BIN
app/assets/public/wechat_1.0.6/assets/uniicons-DN59BOw4.ttf
Normal file
Binary file not shown.
1
app/assets/public/wechat_1.0.6/assets/user.Bm-2eyfO.js
Normal file
1
app/assets/public/wechat_1.0.6/assets/user.Bm-2eyfO.js
Normal file
@ -0,0 +1 @@
|
||||
import{g as e,W as s,q as a}from"./index-B8U-SFxP.js";const r={getUserdata:()=>e("user"),clearUserdata(){s("user")},setUserdata(e){a("user",e)},setToken(e){a("Token",e)},getToken:()=>e("Token")};export{r as u};
|
||||
23
app/assets/public/wechat_1.0.6/index.html
Normal file
23
app/assets/public/wechat_1.0.6/index.html
Normal file
@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<link rel="stylesheet" href="./assets/uni.6c77786a.css">
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<script>
|
||||
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
|
||||
CSS.supports('top: constant(a)'))
|
||||
document.write(
|
||||
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
|
||||
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
|
||||
</script>
|
||||
<title>wechatPlug</title>
|
||||
<!--preload-links-->
|
||||
<!--app-context-->
|
||||
<script type="module" crossorigin src="./assets/index-B8U-SFxP.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="./assets/index-CeBosqgw.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"><!--app-html--></div>
|
||||
</body>
|
||||
</html>
|
||||
539
app/assets/public/wechat_1.0.6/static/ifont/demo.css
Normal file
539
app/assets/public/wechat_1.0.6/static/ifont/demo.css
Normal file
@ -0,0 +1,539 @@
|
||||
/* Logo 字体 */
|
||||
@font-face {
|
||||
font-family: "iconfont logo";
|
||||
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
|
||||
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'),
|
||||
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
|
||||
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
|
||||
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg');
|
||||
}
|
||||
|
||||
.logo {
|
||||
font-family: "iconfont logo";
|
||||
font-size: 160px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
/* tabs */
|
||||
.nav-tabs {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.nav-tabs .nav-more {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: 42px;
|
||||
line-height: 42px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
#tabs {
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
#tabs li {
|
||||
cursor: pointer;
|
||||
width: 100px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
font-size: 16px;
|
||||
border-bottom: 2px solid transparent;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
margin-bottom: -1px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
|
||||
#tabs .active {
|
||||
border-bottom-color: #f00;
|
||||
color: #222;
|
||||
}
|
||||
|
||||
.tab-container .content {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* 页面布局 */
|
||||
.main {
|
||||
padding: 30px 100px;
|
||||
width: 960px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.main .logo {
|
||||
color: #333;
|
||||
text-align: left;
|
||||
margin-bottom: 30px;
|
||||
line-height: 1;
|
||||
height: 110px;
|
||||
margin-top: -50px;
|
||||
overflow: hidden;
|
||||
*zoom: 1;
|
||||
}
|
||||
|
||||
.main .logo a {
|
||||
font-size: 160px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.helps {
|
||||
margin-top: 40px;
|
||||
}
|
||||
|
||||
.helps pre {
|
||||
padding: 20px;
|
||||
margin: 10px 0;
|
||||
border: solid 1px #e7e1cd;
|
||||
background-color: #fffdef;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.icon_lists {
|
||||
width: 100% !important;
|
||||
overflow: hidden;
|
||||
*zoom: 1;
|
||||
}
|
||||
|
||||
.icon_lists li {
|
||||
width: 100px;
|
||||
margin-bottom: 10px;
|
||||
margin-right: 20px;
|
||||
text-align: center;
|
||||
list-style: none !important;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.icon_lists li .code-name {
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.icon_lists .icon {
|
||||
display: block;
|
||||
height: 100px;
|
||||
line-height: 100px;
|
||||
font-size: 42px;
|
||||
margin: 10px auto;
|
||||
color: #333;
|
||||
-webkit-transition: font-size 0.25s linear, width 0.25s linear;
|
||||
-moz-transition: font-size 0.25s linear, width 0.25s linear;
|
||||
transition: font-size 0.25s linear, width 0.25s linear;
|
||||
}
|
||||
|
||||
.icon_lists .icon:hover {
|
||||
font-size: 100px;
|
||||
}
|
||||
|
||||
.icon_lists .svg-icon {
|
||||
/* 通过设置 font-size 来改变图标大小 */
|
||||
width: 1em;
|
||||
/* 图标和文字相邻时,垂直对齐 */
|
||||
vertical-align: -0.15em;
|
||||
/* 通过设置 color 来改变 SVG 的颜色/fill */
|
||||
fill: currentColor;
|
||||
/* path 和 stroke 溢出 viewBox 部分在 IE 下会显示
|
||||
normalize.css 中也包含这行 */
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.icon_lists li .name,
|
||||
.icon_lists li .code-name {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
/* markdown 样式 */
|
||||
.markdown {
|
||||
color: #666;
|
||||
font-size: 14px;
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
.highlight {
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.markdown img {
|
||||
vertical-align: middle;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.markdown h1 {
|
||||
color: #404040;
|
||||
font-weight: 500;
|
||||
line-height: 40px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.markdown h2,
|
||||
.markdown h3,
|
||||
.markdown h4,
|
||||
.markdown h5,
|
||||
.markdown h6 {
|
||||
color: #404040;
|
||||
margin: 1.6em 0 0.6em 0;
|
||||
font-weight: 500;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.markdown h1 {
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.markdown h2 {
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
.markdown h3 {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.markdown h4 {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.markdown h5 {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.markdown h6 {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.markdown hr {
|
||||
height: 1px;
|
||||
border: 0;
|
||||
background: #e9e9e9;
|
||||
margin: 16px 0;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.markdown p {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
.markdown>p,
|
||||
.markdown>blockquote,
|
||||
.markdown>.highlight,
|
||||
.markdown>ol,
|
||||
.markdown>ul {
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.markdown ul>li {
|
||||
list-style: circle;
|
||||
}
|
||||
|
||||
.markdown>ul li,
|
||||
.markdown blockquote ul>li {
|
||||
margin-left: 20px;
|
||||
padding-left: 4px;
|
||||
}
|
||||
|
||||
.markdown>ul li p,
|
||||
.markdown>ol li p {
|
||||
margin: 0.6em 0;
|
||||
}
|
||||
|
||||
.markdown ol>li {
|
||||
list-style: decimal;
|
||||
}
|
||||
|
||||
.markdown>ol li,
|
||||
.markdown blockquote ol>li {
|
||||
margin-left: 20px;
|
||||
padding-left: 4px;
|
||||
}
|
||||
|
||||
.markdown code {
|
||||
margin: 0 3px;
|
||||
padding: 0 5px;
|
||||
background: #eee;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.markdown strong,
|
||||
.markdown b {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.markdown>table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0px;
|
||||
empty-cells: show;
|
||||
border: 1px solid #e9e9e9;
|
||||
width: 95%;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.markdown>table th {
|
||||
white-space: nowrap;
|
||||
color: #333;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.markdown>table th,
|
||||
.markdown>table td {
|
||||
border: 1px solid #e9e9e9;
|
||||
padding: 8px 16px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.markdown>table th {
|
||||
background: #F7F7F7;
|
||||
}
|
||||
|
||||
.markdown blockquote {
|
||||
font-size: 90%;
|
||||
color: #999;
|
||||
border-left: 4px solid #e9e9e9;
|
||||
padding-left: 0.8em;
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
.markdown blockquote p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.markdown .anchor {
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s ease;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.markdown .waiting {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.markdown h1:hover .anchor,
|
||||
.markdown h2:hover .anchor,
|
||||
.markdown h3:hover .anchor,
|
||||
.markdown h4:hover .anchor,
|
||||
.markdown h5:hover .anchor,
|
||||
.markdown h6:hover .anchor {
|
||||
opacity: 1;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.markdown>br,
|
||||
.markdown>p>br {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
|
||||
.hljs {
|
||||
display: block;
|
||||
background: white;
|
||||
padding: 0.5em;
|
||||
color: #333333;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.hljs-comment,
|
||||
.hljs-meta {
|
||||
color: #969896;
|
||||
}
|
||||
|
||||
.hljs-string,
|
||||
.hljs-variable,
|
||||
.hljs-template-variable,
|
||||
.hljs-strong,
|
||||
.hljs-emphasis,
|
||||
.hljs-quote {
|
||||
color: #df5000;
|
||||
}
|
||||
|
||||
.hljs-keyword,
|
||||
.hljs-selector-tag,
|
||||
.hljs-type {
|
||||
color: #a71d5d;
|
||||
}
|
||||
|
||||
.hljs-literal,
|
||||
.hljs-symbol,
|
||||
.hljs-bullet,
|
||||
.hljs-attribute {
|
||||
color: #0086b3;
|
||||
}
|
||||
|
||||
.hljs-section,
|
||||
.hljs-name {
|
||||
color: #63a35c;
|
||||
}
|
||||
|
||||
.hljs-tag {
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.hljs-title,
|
||||
.hljs-attr,
|
||||
.hljs-selector-id,
|
||||
.hljs-selector-class,
|
||||
.hljs-selector-attr,
|
||||
.hljs-selector-pseudo {
|
||||
color: #795da3;
|
||||
}
|
||||
|
||||
.hljs-addition {
|
||||
color: #55a532;
|
||||
background-color: #eaffea;
|
||||
}
|
||||
|
||||
.hljs-deletion {
|
||||
color: #bd2c00;
|
||||
background-color: #ffecec;
|
||||
}
|
||||
|
||||
.hljs-link {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* 代码高亮 */
|
||||
/* PrismJS 1.15.0
|
||||
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */
|
||||
/**
|
||||
* prism.js default theme for JavaScript, CSS and HTML
|
||||
* Based on dabblet (http://dabblet.com)
|
||||
* @author Lea Verou
|
||||
*/
|
||||
code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
color: black;
|
||||
background: none;
|
||||
text-shadow: 0 1px white;
|
||||
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
||||
text-align: left;
|
||||
white-space: pre;
|
||||
word-spacing: normal;
|
||||
word-break: normal;
|
||||
word-wrap: normal;
|
||||
line-height: 1.5;
|
||||
|
||||
-moz-tab-size: 4;
|
||||
-o-tab-size: 4;
|
||||
tab-size: 4;
|
||||
|
||||
-webkit-hyphens: none;
|
||||
-moz-hyphens: none;
|
||||
-ms-hyphens: none;
|
||||
hyphens: none;
|
||||
}
|
||||
|
||||
pre[class*="language-"]::-moz-selection,
|
||||
pre[class*="language-"] ::-moz-selection,
|
||||
code[class*="language-"]::-moz-selection,
|
||||
code[class*="language-"] ::-moz-selection {
|
||||
text-shadow: none;
|
||||
background: #b3d4fc;
|
||||
}
|
||||
|
||||
pre[class*="language-"]::selection,
|
||||
pre[class*="language-"] ::selection,
|
||||
code[class*="language-"]::selection,
|
||||
code[class*="language-"] ::selection {
|
||||
text-shadow: none;
|
||||
background: #b3d4fc;
|
||||
}
|
||||
|
||||
@media print {
|
||||
|
||||
code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
text-shadow: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Code blocks */
|
||||
pre[class*="language-"] {
|
||||
padding: 1em;
|
||||
margin: .5em 0;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
:not(pre)>code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
background: #f5f2f0;
|
||||
}
|
||||
|
||||
/* Inline code */
|
||||
:not(pre)>code[class*="language-"] {
|
||||
padding: .1em;
|
||||
border-radius: .3em;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.token.comment,
|
||||
.token.prolog,
|
||||
.token.doctype,
|
||||
.token.cdata {
|
||||
color: slategray;
|
||||
}
|
||||
|
||||
.token.punctuation {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.namespace {
|
||||
opacity: .7;
|
||||
}
|
||||
|
||||
.token.property,
|
||||
.token.tag,
|
||||
.token.boolean,
|
||||
.token.number,
|
||||
.token.constant,
|
||||
.token.symbol,
|
||||
.token.deleted {
|
||||
color: #905;
|
||||
}
|
||||
|
||||
.token.selector,
|
||||
.token.attr-name,
|
||||
.token.string,
|
||||
.token.char,
|
||||
.token.builtin,
|
||||
.token.inserted {
|
||||
color: #690;
|
||||
}
|
||||
|
||||
.token.operator,
|
||||
.token.entity,
|
||||
.token.url,
|
||||
.language-css .token.string,
|
||||
.style .token.string {
|
||||
color: #9a6e3a;
|
||||
background: hsla(0, 0%, 100%, .5);
|
||||
}
|
||||
|
||||
.token.atrule,
|
||||
.token.attr-value,
|
||||
.token.keyword {
|
||||
color: #07a;
|
||||
}
|
||||
|
||||
.token.function,
|
||||
.token.class-name {
|
||||
color: #DD4A68;
|
||||
}
|
||||
|
||||
.token.regex,
|
||||
.token.important,
|
||||
.token.variable {
|
||||
color: #e90;
|
||||
}
|
||||
|
||||
.token.important,
|
||||
.token.bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.token.italic {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.token.entity {
|
||||
cursor: help;
|
||||
}
|
||||
437
app/assets/public/wechat_1.0.6/static/ifont/demo_index.html
Normal file
437
app/assets/public/wechat_1.0.6/static/ifont/demo_index.html
Normal file
@ -0,0 +1,437 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>iconfont Demo</title>
|
||||
<link rel="shortcut icon" href="//img.alicdn.com/imgextra/i4/O1CN01Z5paLz1O0zuCC7osS_!!6000000001644-55-tps-83-82.svg" type="image/x-icon"/>
|
||||
<link rel="icon" type="image/svg+xml" href="//img.alicdn.com/imgextra/i4/O1CN01Z5paLz1O0zuCC7osS_!!6000000001644-55-tps-83-82.svg"/>
|
||||
<link rel="stylesheet" href="https://g.alicdn.com/thx/cube/1.3.2/cube.min.css">
|
||||
<link rel="stylesheet" href="demo.css">
|
||||
<link rel="stylesheet" href="iconfont.css">
|
||||
<script src="iconfont.js"></script>
|
||||
<!-- jQuery -->
|
||||
<script src="https://a1.alicdn.com/oss/uploads/2018/12/26/7bfddb60-08e8-11e9-9b04-53e73bb6408b.js"></script>
|
||||
<!-- 代码高亮 -->
|
||||
<script src="https://a1.alicdn.com/oss/uploads/2018/12/26/a3f714d0-08e6-11e9-8a15-ebf944d7534c.js"></script>
|
||||
<style>
|
||||
.main .logo {
|
||||
margin-top: 0;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.main .logo a {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.main .logo .sub-title {
|
||||
margin-left: 0.5em;
|
||||
font-size: 22px;
|
||||
color: #fff;
|
||||
background: linear-gradient(-45deg, #3967FF, #B500FE);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main">
|
||||
<h1 class="logo"><a href="https://www.iconfont.cn/" title="iconfont 首页" target="_blank">
|
||||
<img width="200" src="https://img.alicdn.com/imgextra/i3/O1CN01Mn65HV1FfSEzR6DKv_!!6000000000514-55-tps-228-59.svg">
|
||||
|
||||
</a></h1>
|
||||
<div class="nav-tabs">
|
||||
<ul id="tabs" class="dib-box">
|
||||
<li class="dib active"><span>Unicode</span></li>
|
||||
<li class="dib"><span>Font class</span></li>
|
||||
<li class="dib"><span>Symbol</span></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
<div class="tab-container">
|
||||
<div class="content unicode" style="display: block;">
|
||||
<ul class="icon_lists dib-box">
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont"></span>
|
||||
<div class="name">我的</div>
|
||||
<div class="code-name">&#xe601;</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont"></span>
|
||||
<div class="name">Minimize-2</div>
|
||||
<div class="code-name">&#xe65a;</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont"></span>
|
||||
<div class="name">设置</div>
|
||||
<div class="code-name">&#xe70f;</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont"></span>
|
||||
<div class="name">质检复核</div>
|
||||
<div class="code-name">&#xe63a;</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont"></span>
|
||||
<div class="name">置顶</div>
|
||||
<div class="code-name">&#xe890;</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont"></span>
|
||||
<div class="name">关闭</div>
|
||||
<div class="code-name">&#xe60a;</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont"></span>
|
||||
<div class="name">密码</div>
|
||||
<div class="code-name">&#xe8b2;</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont"></span>
|
||||
<div class="name">最大化</div>
|
||||
<div class="code-name">&#xe651;</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont"></span>
|
||||
<div class="name">称重</div>
|
||||
<div class="code-name">&#xe6ba;</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont"></span>
|
||||
<div class="name">账号中心 账号管理</div>
|
||||
<div class="code-name">&#xe6a0;</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont"></span>
|
||||
<div class="name">9A向下还原</div>
|
||||
<div class="code-name">&#xe674;</div>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<div class="article markdown">
|
||||
<h2 id="unicode-">Unicode 引用</h2>
|
||||
<hr>
|
||||
|
||||
<p>Unicode 是字体在网页端最原始的应用方式,特点是:</p>
|
||||
<ul>
|
||||
<li>支持按字体的方式去动态调整图标大小,颜色等等。</li>
|
||||
<li>默认情况下不支持多色,直接添加多色图标会自动去色。</li>
|
||||
</ul>
|
||||
<blockquote>
|
||||
<p>注意:新版 iconfont 支持两种方式引用多色图标:SVG symbol 引用方式和彩色字体图标模式。(使用彩色字体图标需要在「编辑项目」中开启「彩色」选项后并重新生成。)</p>
|
||||
</blockquote>
|
||||
<p>Unicode 使用步骤如下:</p>
|
||||
<h3 id="-font-face">第一步:拷贝项目下面生成的 <code>@font-face</code></h3>
|
||||
<pre><code class="language-css"
|
||||
>@font-face {
|
||||
font-family: 'iconfont';
|
||||
src: url('iconfont.ttf?t=1700497612485') format('truetype');
|
||||
}
|
||||
</code></pre>
|
||||
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
|
||||
<pre><code class="language-css"
|
||||
>.iconfont {
|
||||
font-family: "iconfont" !important;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
</code></pre>
|
||||
<h3 id="-">第三步:挑选相应图标并获取字体编码,应用于页面</h3>
|
||||
<pre>
|
||||
<code class="language-html"
|
||||
><span class="iconfont">&#x33;</span>
|
||||
</code></pre>
|
||||
<blockquote>
|
||||
<p>"iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。</p>
|
||||
</blockquote>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content font-class">
|
||||
<ul class="icon_lists dib-box">
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont icon-iconfuzhi"></span>
|
||||
<div class="name">
|
||||
我的
|
||||
</div>
|
||||
<div class="code-name">.icon-iconfuzhi
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont icon-2zuixiaohua-2"></span>
|
||||
<div class="name">
|
||||
Minimize-2
|
||||
</div>
|
||||
<div class="code-name">.icon-2zuixiaohua-2
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont icon-shezhi"></span>
|
||||
<div class="name">
|
||||
设置
|
||||
</div>
|
||||
<div class="code-name">.icon-shezhi
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont icon-zhijianfuhe"></span>
|
||||
<div class="name">
|
||||
质检复核
|
||||
</div>
|
||||
<div class="code-name">.icon-zhijianfuhe
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont icon-zhiding"></span>
|
||||
<div class="name">
|
||||
置顶
|
||||
</div>
|
||||
<div class="code-name">.icon-zhiding
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont icon-guanbi"></span>
|
||||
<div class="name">
|
||||
关闭
|
||||
</div>
|
||||
<div class="code-name">.icon-guanbi
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont icon-mima"></span>
|
||||
<div class="name">
|
||||
密码
|
||||
</div>
|
||||
<div class="code-name">.icon-mima
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont icon-zuidahua"></span>
|
||||
<div class="name">
|
||||
最大化
|
||||
</div>
|
||||
<div class="code-name">.icon-zuidahua
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont icon-chengzhong"></span>
|
||||
<div class="name">
|
||||
称重
|
||||
</div>
|
||||
<div class="code-name">.icon-chengzhong
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont icon-zhanghaozhongxinzhanghaoguanli"></span>
|
||||
<div class="name">
|
||||
账号中心 账号管理
|
||||
</div>
|
||||
<div class="code-name">.icon-zhanghaozhongxinzhanghaoguanli
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont icon-a-9Axiangxiahuanyuan"></span>
|
||||
<div class="name">
|
||||
9A向下还原
|
||||
</div>
|
||||
<div class="code-name">.icon-a-9Axiangxiahuanyuan
|
||||
</div>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<div class="article markdown">
|
||||
<h2 id="font-class-">font-class 引用</h2>
|
||||
<hr>
|
||||
|
||||
<p>font-class 是 Unicode 使用方式的一种变种,主要是解决 Unicode 书写不直观,语意不明确的问题。</p>
|
||||
<p>与 Unicode 使用方式相比,具有如下特点:</p>
|
||||
<ul>
|
||||
<li>相比于 Unicode 语意明确,书写更直观。可以很容易分辨这个 icon 是什么。</li>
|
||||
<li>因为使用 class 来定义图标,所以当要替换图标时,只需要修改 class 里面的 Unicode 引用。</li>
|
||||
</ul>
|
||||
<p>使用步骤如下:</p>
|
||||
<h3 id="-fontclass-">第一步:引入项目下面生成的 fontclass 代码:</h3>
|
||||
<pre><code class="language-html"><link rel="stylesheet" href="./iconfont.css">
|
||||
</code></pre>
|
||||
<h3 id="-">第二步:挑选相应图标并获取类名,应用于页面:</h3>
|
||||
<pre><code class="language-html"><span class="iconfont icon-xxx"></span>
|
||||
</code></pre>
|
||||
<blockquote>
|
||||
<p>"
|
||||
iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。</p>
|
||||
</blockquote>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content symbol">
|
||||
<ul class="icon_lists dib-box">
|
||||
|
||||
<li class="dib">
|
||||
<svg class="icon svg-icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-iconfuzhi"></use>
|
||||
</svg>
|
||||
<div class="name">我的</div>
|
||||
<div class="code-name">#icon-iconfuzhi</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<svg class="icon svg-icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-2zuixiaohua-2"></use>
|
||||
</svg>
|
||||
<div class="name">Minimize-2</div>
|
||||
<div class="code-name">#icon-2zuixiaohua-2</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<svg class="icon svg-icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-shezhi"></use>
|
||||
</svg>
|
||||
<div class="name">设置</div>
|
||||
<div class="code-name">#icon-shezhi</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<svg class="icon svg-icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-zhijianfuhe"></use>
|
||||
</svg>
|
||||
<div class="name">质检复核</div>
|
||||
<div class="code-name">#icon-zhijianfuhe</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<svg class="icon svg-icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-zhiding"></use>
|
||||
</svg>
|
||||
<div class="name">置顶</div>
|
||||
<div class="code-name">#icon-zhiding</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<svg class="icon svg-icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-guanbi"></use>
|
||||
</svg>
|
||||
<div class="name">关闭</div>
|
||||
<div class="code-name">#icon-guanbi</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<svg class="icon svg-icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-mima"></use>
|
||||
</svg>
|
||||
<div class="name">密码</div>
|
||||
<div class="code-name">#icon-mima</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<svg class="icon svg-icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-zuidahua"></use>
|
||||
</svg>
|
||||
<div class="name">最大化</div>
|
||||
<div class="code-name">#icon-zuidahua</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<svg class="icon svg-icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-chengzhong"></use>
|
||||
</svg>
|
||||
<div class="name">称重</div>
|
||||
<div class="code-name">#icon-chengzhong</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<svg class="icon svg-icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-zhanghaozhongxinzhanghaoguanli"></use>
|
||||
</svg>
|
||||
<div class="name">账号中心 账号管理</div>
|
||||
<div class="code-name">#icon-zhanghaozhongxinzhanghaoguanli</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<svg class="icon svg-icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-a-9Axiangxiahuanyuan"></use>
|
||||
</svg>
|
||||
<div class="name">9A向下还原</div>
|
||||
<div class="code-name">#icon-a-9Axiangxiahuanyuan</div>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<div class="article markdown">
|
||||
<h2 id="symbol-">Symbol 引用</h2>
|
||||
<hr>
|
||||
|
||||
<p>这是一种全新的使用方式,应该说这才是未来的主流,也是平台目前推荐的用法。相关介绍可以参考这篇<a href="">文章</a>
|
||||
这种用法其实是做了一个 SVG 的集合,与另外两种相比具有如下特点:</p>
|
||||
<ul>
|
||||
<li>支持多色图标了,不再受单色限制。</li>
|
||||
<li>通过一些技巧,支持像字体那样,通过 <code>font-size</code>, <code>color</code> 来调整样式。</li>
|
||||
<li>兼容性较差,支持 IE9+,及现代浏览器。</li>
|
||||
<li>浏览器渲染 SVG 的性能一般,还不如 png。</li>
|
||||
</ul>
|
||||
<p>使用步骤如下:</p>
|
||||
<h3 id="-symbol-">第一步:引入项目下面生成的 symbol 代码:</h3>
|
||||
<pre><code class="language-html"><script src="./iconfont.js"></script>
|
||||
</code></pre>
|
||||
<h3 id="-css-">第二步:加入通用 CSS 代码(引入一次就行):</h3>
|
||||
<pre><code class="language-html"><style>
|
||||
.icon {
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
vertical-align: -0.15em;
|
||||
fill: currentColor;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
</code></pre>
|
||||
<h3 id="-">第三步:挑选相应图标并获取类名,应用于页面:</h3>
|
||||
<pre><code class="language-html"><svg class="icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-xxx"></use>
|
||||
</svg>
|
||||
</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('.tab-container .content:first').show()
|
||||
|
||||
$('#tabs li').click(function (e) {
|
||||
var tabContent = $('.tab-container .content')
|
||||
var index = $(this).index()
|
||||
|
||||
if ($(this).hasClass('active')) {
|
||||
return
|
||||
} else {
|
||||
$('#tabs li').removeClass('active')
|
||||
$(this).addClass('active')
|
||||
|
||||
tabContent.hide().eq(index).fadeIn()
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
57
app/assets/public/wechat_1.0.6/static/ifont/iconfont.css
Normal file
57
app/assets/public/wechat_1.0.6/static/ifont/iconfont.css
Normal file
@ -0,0 +1,57 @@
|
||||
@font-face {
|
||||
font-family: "iconfont"; /* Project id */
|
||||
src: url('iconfont.ttf?t=1700497612485') format('truetype');
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-family: "iconfont" !important;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-iconfuzhi:before {
|
||||
content: "\e601";
|
||||
}
|
||||
|
||||
.icon-2zuixiaohua-2:before {
|
||||
content: "\e65a";
|
||||
}
|
||||
|
||||
.icon-shezhi:before {
|
||||
content: "\e70f";
|
||||
}
|
||||
|
||||
.icon-zhijianfuhe:before {
|
||||
content: "\e63a";
|
||||
}
|
||||
|
||||
.icon-zhiding:before {
|
||||
content: "\e890";
|
||||
}
|
||||
|
||||
.icon-guanbi:before {
|
||||
content: "\e60a";
|
||||
}
|
||||
|
||||
.icon-mima:before {
|
||||
content: "\e8b2";
|
||||
}
|
||||
|
||||
.icon-zuidahua:before {
|
||||
content: "\e651";
|
||||
}
|
||||
|
||||
.icon-chengzhong:before {
|
||||
content: "\e6ba";
|
||||
}
|
||||
|
||||
.icon-zhanghaozhongxinzhanghaoguanli:before {
|
||||
content: "\e6a0";
|
||||
}
|
||||
|
||||
.icon-a-9Axiangxiahuanyuan:before {
|
||||
content: "\e674";
|
||||
}
|
||||
|
||||
1
app/assets/public/wechat_1.0.6/static/ifont/iconfont.js
Normal file
1
app/assets/public/wechat_1.0.6/static/ifont/iconfont.js
Normal file
File diff suppressed because one or more lines are too long
86
app/assets/public/wechat_1.0.6/static/ifont/iconfont.json
Normal file
86
app/assets/public/wechat_1.0.6/static/ifont/iconfont.json
Normal file
@ -0,0 +1,86 @@
|
||||
{
|
||||
"id": "",
|
||||
"name": "",
|
||||
"font_family": "iconfont",
|
||||
"css_prefix_text": "icon-",
|
||||
"description": "",
|
||||
"glyphs": [
|
||||
{
|
||||
"icon_id": "396599",
|
||||
"name": "我的",
|
||||
"font_class": "iconfuzhi",
|
||||
"unicode": "e601",
|
||||
"unicode_decimal": 58881
|
||||
},
|
||||
{
|
||||
"icon_id": "1299763",
|
||||
"name": "Minimize-2",
|
||||
"font_class": "2zuixiaohua-2",
|
||||
"unicode": "e65a",
|
||||
"unicode_decimal": 58970
|
||||
},
|
||||
{
|
||||
"icon_id": "3456457",
|
||||
"name": "设置",
|
||||
"font_class": "shezhi",
|
||||
"unicode": "e70f",
|
||||
"unicode_decimal": 59151
|
||||
},
|
||||
{
|
||||
"icon_id": "5146949",
|
||||
"name": "质检复核",
|
||||
"font_class": "zhijianfuhe",
|
||||
"unicode": "e63a",
|
||||
"unicode_decimal": 58938
|
||||
},
|
||||
{
|
||||
"icon_id": "9627002",
|
||||
"name": "置顶",
|
||||
"font_class": "zhiding",
|
||||
"unicode": "e890",
|
||||
"unicode_decimal": 59536
|
||||
},
|
||||
{
|
||||
"icon_id": "10496865",
|
||||
"name": "关闭",
|
||||
"font_class": "guanbi",
|
||||
"unicode": "e60a",
|
||||
"unicode_decimal": 58890
|
||||
},
|
||||
{
|
||||
"icon_id": "11372676",
|
||||
"name": "密码",
|
||||
"font_class": "mima",
|
||||
"unicode": "e8b2",
|
||||
"unicode_decimal": 59570
|
||||
},
|
||||
{
|
||||
"icon_id": "11490920",
|
||||
"name": "最大化",
|
||||
"font_class": "zuidahua",
|
||||
"unicode": "e651",
|
||||
"unicode_decimal": 58961
|
||||
},
|
||||
{
|
||||
"icon_id": "15686488",
|
||||
"name": "称重",
|
||||
"font_class": "chengzhong",
|
||||
"unicode": "e6ba",
|
||||
"unicode_decimal": 59066
|
||||
},
|
||||
{
|
||||
"icon_id": "16365909",
|
||||
"name": "账号中心 账号管理",
|
||||
"font_class": "zhanghaozhongxinzhanghaoguanli",
|
||||
"unicode": "e6a0",
|
||||
"unicode_decimal": 59040
|
||||
},
|
||||
{
|
||||
"icon_id": "29522579",
|
||||
"name": "9A向下还原",
|
||||
"font_class": "a-9Axiangxiahuanyuan",
|
||||
"unicode": "e674",
|
||||
"unicode_decimal": 58996
|
||||
}
|
||||
]
|
||||
}
|
||||
BIN
app/assets/public/wechat_1.0.6/static/ifont/iconfont.ttf
Normal file
BIN
app/assets/public/wechat_1.0.6/static/ifont/iconfont.ttf
Normal file
Binary file not shown.
BIN
app/assets/public/wechat_1.0.6/static/logo.png
Normal file
BIN
app/assets/public/wechat_1.0.6/static/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.9 KiB |
5
app/assets/robots.txt
Normal file
5
app/assets/robots.txt
Normal file
@ -0,0 +1,5 @@
|
||||
User-agent: *
|
||||
Disallow: /api/
|
||||
Disallow: /admin/
|
||||
Disallow: /socket.io/
|
||||
Allow: /
|
||||
155
app/assets/static/css/common.css
Normal file
155
app/assets/static/css/common.css
Normal file
@ -0,0 +1,155 @@
|
||||
/* ========== Reset & Base ========== */
|
||||
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
|
||||
:root{
|
||||
--blue:#1a73e8;--blue-dark:#1557b0;--blue-light:#e8f0fe;
|
||||
--gray-50:#f8fafc;--gray-100:#f1f5f9;--gray-200:#e2e8f0;--gray-300:#cbd5e1;
|
||||
--gray-500:#64748b;--gray-700:#334155;--gray-800:#1e293b;--gray-900:#0f172a;
|
||||
--white:#ffffff;--radius:12px;--shadow:0 4px 24px rgba(0,0,0,.08);
|
||||
--shadow-lg:0 12px 48px rgba(0,0,0,.12);--transition:.3s cubic-bezier(.4,0,.2,1);
|
||||
--max-width:1200px;
|
||||
}
|
||||
html{scroll-behavior:smooth;font-size:16px}
|
||||
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei","Helvetica Neue",Arial,sans-serif;color:var(--gray-800);line-height:1.7;background:var(--white);overflow-x:hidden}
|
||||
a{text-decoration:none;color:inherit}
|
||||
ul{list-style:none}
|
||||
img{max-width:100%;display:block}
|
||||
|
||||
/* ========== Navbar ========== */
|
||||
.navbar{position:fixed;top:0;left:0;right:0;z-index:1000;background:rgba(255,255,255,.92);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border-bottom:1px solid var(--gray-200);transition:var(--transition)}
|
||||
.navbar.scrolled{box-shadow:var(--shadow)}
|
||||
.nav-inner{max-width:var(--max-width);margin:0 auto;display:flex;align-items:center;justify-content:space-between;padding:0 24px;height:64px}
|
||||
.nav-logo{display:flex;align-items:center;gap:10px;font-size:1.25rem;font-weight:700;color:var(--gray-900)}
|
||||
.nav-logo .logo-icon{width:36px;height:36px;background:var(--blue);border-radius:8px;display:flex;align-items:center;justify-content:center;color:var(--white);font-size:1.1rem;font-weight:700}
|
||||
.nav-links{display:flex;align-items:center;gap:32px}
|
||||
.nav-links a{font-size:.9rem;color:var(--gray-700);transition:color var(--transition);position:relative}
|
||||
.nav-links a:hover{color:var(--blue)}
|
||||
.nav-links a::after{content:'';position:absolute;bottom:-4px;left:0;width:0;height:2px;background:var(--blue);transition:width var(--transition)}
|
||||
.nav-links a:hover::after,.nav-links a.active::after{width:100%}
|
||||
.nav-links a.active{color:var(--blue);font-weight:600}
|
||||
.nav-cta{background:var(--blue);color:var(--white)!important;padding:8px 20px;border-radius:8px;font-weight:600;transition:background var(--transition)}
|
||||
.nav-cta:hover{background:var(--blue-dark)}
|
||||
.nav-cta::after{display:none!important}
|
||||
.menu-toggle{display:none;flex-direction:column;gap:5px;cursor:pointer;background:none;border:none;padding:4px}
|
||||
.menu-toggle span{display:block;width:24px;height:2px;background:var(--gray-800);border-radius:2px;transition:var(--transition)}
|
||||
|
||||
/* ========== Sections Common ========== */
|
||||
section{padding:100px 24px}
|
||||
.section-header{text-align:center;max-width:700px;margin:0 auto 64px}
|
||||
.section-tag{display:inline-block;background:var(--blue-light);color:var(--blue);font-size:.8rem;font-weight:600;padding:4px 14px;border-radius:20px;margin-bottom:16px;letter-spacing:.5px}
|
||||
.section-title{font-size:2.25rem;font-weight:800;color:var(--gray-900);margin-bottom:16px;line-height:1.3}
|
||||
.section-desc{font-size:1.05rem;color:var(--gray-500);line-height:1.8}
|
||||
.container{max-width:var(--max-width);margin:0 auto}
|
||||
|
||||
/* ========== Page Hero ========== */
|
||||
.page-hero{padding-top:120px;padding-bottom:80px;text-align:center;background:linear-gradient(135deg,#f0f7ff 0%,#e8f0fe 30%,#f8fafc 60%,#e8f0fe 100%)}
|
||||
.page-hero .section-title{font-size:2.5rem}
|
||||
.page-hero .section-desc{max-width:600px;margin:0 auto}
|
||||
|
||||
/* ========== Buttons ========== */
|
||||
.btn{padding:14px 32px;border-radius:10px;font-size:.95rem;font-weight:600;cursor:pointer;transition:all var(--transition);display:inline-flex;align-items:center;gap:8px;border:none}
|
||||
.btn-primary{background:var(--blue);color:var(--white);box-shadow:0 4px 16px rgba(26,115,232,.3)}
|
||||
.btn-primary:hover{background:var(--blue-dark);transform:translateY(-2px);box-shadow:0 8px 24px rgba(26,115,232,.4)}
|
||||
.btn-outline{background:var(--white);color:var(--blue);border:2px solid var(--blue)}
|
||||
.btn-outline:hover{background:var(--blue-light);transform:translateY(-2px)}
|
||||
.btn .arrow{transition:transform var(--transition)}
|
||||
.btn:hover .arrow{transform:translateX(4px)}
|
||||
|
||||
/* ========== Footer ========== */
|
||||
.footer{background:var(--gray-900);color:var(--gray-300);padding:48px 24px 32px}
|
||||
.footer-inner{max-width:var(--max-width);margin:0 auto;display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:24px}
|
||||
.footer-left{display:flex;align-items:center;gap:12px}
|
||||
.footer-logo-icon{width:32px;height:32px;background:var(--blue);border-radius:8px;display:flex;align-items:center;justify-content:center;color:var(--white);font-size:.85rem;font-weight:700}
|
||||
.footer-info{font-size:.85rem;line-height:1.6}
|
||||
.footer-info strong{color:var(--white)}
|
||||
.footer-right{display:flex;gap:20px;font-size:.85rem}
|
||||
.footer-right a{color:var(--gray-300);transition:color var(--transition)}
|
||||
.footer-right a:hover{color:var(--white)}
|
||||
.footer-bottom{max-width:var(--max-width);margin:32px auto 0;padding-top:24px;border-top:1px solid rgba(255,255,255,.08);text-align:center;font-size:.78rem;color:var(--gray-500)}
|
||||
|
||||
/* ========== Back to Top ========== */
|
||||
.back-to-top{position:fixed;bottom:32px;right:32px;width:44px;height:44px;background:var(--blue);color:var(--white);border:none;border-radius:50%;cursor:pointer;font-size:1.2rem;display:flex;align-items:center;justify-content:center;opacity:0;visibility:hidden;transition:all var(--transition);box-shadow:0 4px 16px rgba(26,115,232,.4);z-index:999}
|
||||
.back-to-top.visible{opacity:1;visibility:visible}
|
||||
.back-to-top:hover{background:var(--blue-dark);transform:translateY(-3px)}
|
||||
|
||||
/* ========== Features Page ========== */
|
||||
.feat-section{padding:60px 0;border-bottom:1px solid var(--gray-100)}
|
||||
.feat-section:last-child{border-bottom:none}
|
||||
.feat-grid{display:grid;grid-template-columns:1fr 1fr;gap:60px;align-items:center}
|
||||
.feat-grid.reverse{direction:rtl}
|
||||
.feat-grid.reverse .feat-text,.feat-grid.reverse .feat-visual{direction:ltr}
|
||||
.feat-num{font-size:5rem;font-weight:900;color:var(--blue);opacity:.1;line-height:1;display:block;margin-bottom:8px}
|
||||
.feat-text h2{font-size:1.6rem;font-weight:800;color:var(--gray-900);margin-bottom:12px}
|
||||
.feat-lead{font-size:.95rem;color:var(--gray-500);margin-bottom:20px;line-height:1.7}
|
||||
.feat-flow{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-bottom:20px;font-size:.8rem}
|
||||
.feat-flow span:first-child,.feat-flow span:nth-child(3),.feat-flow span:nth-child(5),.feat-flow span:nth-child(7),.feat-flow span:nth-child(9),.feat-flow span:nth-child(11){background:var(--blue-light);color:var(--blue);padding:4px 10px;border-radius:20px;font-weight:700}
|
||||
.feat-flow span:nth-child(even){color:var(--gray-300)}
|
||||
.check-list li{font-size:.88rem;color:var(--gray-500);padding:7px 0 7px 26px;position:relative;line-height:1.6}
|
||||
.check-list li::before{content:'✓';position:absolute;left:0;top:7px;color:var(--blue);font-weight:700;font-size:.75rem}
|
||||
.visual-box{width:100%;aspect-ratio:1;max-width:360px;margin:0 auto;border-radius:var(--radius);display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:3rem;border:2px dashed var(--gray-200);color:var(--gray-300)}
|
||||
.visual-box small{font-size:.8rem;margin-top:8px}
|
||||
.vb-blue{background:#e8f0fe;border-color:var(--blue);color:var(--blue)}
|
||||
.vb-green{background:#dcfce7;border-color:#16a34a;color:#16a34a}
|
||||
.vb-orange{background:#fff7ed;border-color:#ea580c;color:#ea580c}
|
||||
.vb-purple{background:#f3e8ff;border-color:#9333ea;color:#9333ea}
|
||||
.vb-cyan{background:#ecfeff;border-color:#0891b2;color:#0891b2}
|
||||
|
||||
/* ========== Pricing Page ========== */
|
||||
.pricing-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:24px;padding:40px 0}
|
||||
.pricing-card{background:var(--white);border:1px solid var(--gray-200);border-radius:var(--radius);padding:36px 28px;transition:all var(--transition);position:relative;display:flex;flex-direction:column}
|
||||
.pricing-card:hover{box-shadow:var(--shadow-lg);border-color:transparent;transform:translateY(-4px)}
|
||||
.pricing-card.featured{border-color:var(--blue);box-shadow:0 0 0 3px rgba(26,115,232,.1)}
|
||||
.pricing-badge{position:absolute;top:-14px;left:50%;transform:translateX(-50%);background:var(--blue);color:var(--white);padding:4px 18px;border-radius:20px;font-size:.78rem;font-weight:700}
|
||||
.pricing-header{text-align:center;margin-bottom:24px}
|
||||
.pricing-header h3{font-size:1.3rem;font-weight:800;color:var(--gray-900);margin-bottom:4px}
|
||||
.pricing-header p{font-size:.82rem;color:var(--gray-500)}
|
||||
.pricing-price{font-size:2.5rem;font-weight:900;color:var(--gray-900);margin-top:16px}
|
||||
.pricing-price .currency{font-size:1.2rem;vertical-align:top;margin-right:2px}
|
||||
.pricing-price .period{font-size:1rem;color:var(--gray-500);font-weight:400}
|
||||
.pricing-features{flex:1;margin-bottom:24px}
|
||||
.pricing-features li{font-size:.85rem;padding:8px 0;color:var(--gray-700);border-bottom:1px solid var(--gray-50)}
|
||||
.pricing-features li.disabled{color:var(--gray-300)}
|
||||
|
||||
/* ========== Help / FAQ ========== */
|
||||
.help-section{margin-bottom:48px}
|
||||
.help-cat{font-size:1.3rem;font-weight:800;color:var(--gray-900);margin-bottom:20px;padding-bottom:12px;border-bottom:2px solid var(--gray-100)}
|
||||
.faq-list{display:flex;flex-direction:column;gap:2px}
|
||||
.faq-item{background:var(--gray-50);border:1px solid var(--gray-100);border-radius:8px;padding:18px 22px;transition:all var(--transition)}
|
||||
.faq-item:hover{background:var(--white);box-shadow:var(--shadow)}
|
||||
.faq-item h4{font-size:.95rem;font-weight:700;color:var(--gray-800);margin-bottom:6px}
|
||||
.faq-item p{font-size:.85rem;color:var(--gray-500);line-height:1.7}
|
||||
|
||||
/* ========== About Page ========== */
|
||||
.about-block{margin-bottom:48px}
|
||||
.about-block h2{font-size:1.4rem;font-weight:800;color:var(--gray-900);margin-bottom:16px;padding-bottom:12px;border-bottom:2px solid var(--blue-light)}
|
||||
.about-block p{font-size:.95rem;color:var(--gray-500);line-height:1.9}
|
||||
.advantage-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:20px;margin-top:20px}
|
||||
.advantage-item{background:var(--gray-50);border-radius:var(--radius);padding:24px;text-align:center;transition:all var(--transition)}
|
||||
.advantage-item:hover{box-shadow:var(--shadow);transform:translateY(-2px)}
|
||||
.adv-icon{font-size:2rem;margin-bottom:12px}
|
||||
.advantage-item h4{font-size:1rem;font-weight:700;color:var(--gray-900);margin-bottom:8px}
|
||||
.advantage-item p{font-size:.82rem;color:var(--gray-500);line-height:1.6}
|
||||
.tech-tag{background:var(--blue-light);color:var(--blue);padding:8px 16px;border-radius:8px;font-size:.82rem;font-weight:600;text-align:center}
|
||||
|
||||
/* ========== Responsive ========== */
|
||||
@media(max-width:1024px){
|
||||
.feat-grid{grid-template-columns:1fr;gap:32px}
|
||||
.feat-grid.reverse{direction:ltr}
|
||||
.visual-box{max-width:240px;aspect-ratio:auto;padding:60px 20px}
|
||||
.pricing-grid{grid-template-columns:1fr;max-width:440px;margin:0 auto}
|
||||
}
|
||||
@media(max-width:768px){
|
||||
:root{--max-width:100%}
|
||||
.nav-links{display:none;position:absolute;top:64px;left:0;right:0;background:var(--white);flex-direction:column;padding:24px;gap:20px;border-bottom:1px solid var(--gray-200);box-shadow:var(--shadow)}
|
||||
.nav-links.open{display:flex}
|
||||
.menu-toggle{display:flex}
|
||||
section{padding:64px 20px}
|
||||
.section-title{font-size:1.7rem}
|
||||
.page-hero .section-title{font-size:1.8rem}
|
||||
.footer-inner{flex-direction:column;text-align:center}
|
||||
.pricing-grid{max-width:100%}
|
||||
.advantage-grid{grid-template-columns:1fr}
|
||||
.feat-flow{gap:4px;font-size:.72rem}
|
||||
}
|
||||
@media(max-width:480px){
|
||||
.btn{width:100%;justify-content:center}
|
||||
}
|
||||
57
app/assets/static/js/common.js
Normal file
57
app/assets/static/js/common.js
Normal file
@ -0,0 +1,57 @@
|
||||
// Navbar scroll effect
|
||||
const navbar = document.getElementById('navbar');
|
||||
const backToTop = document.getElementById('backToTop');
|
||||
window.addEventListener('scroll', () => {
|
||||
if (navbar) navbar.classList.toggle('scrolled', window.scrollY > 10);
|
||||
if (backToTop) backToTop.classList.toggle('visible', window.scrollY > 500);
|
||||
});
|
||||
|
||||
// Back to top
|
||||
if (backToTop) {
|
||||
backToTop.addEventListener('click', () => {
|
||||
window.scrollTo({ top: 0, behavior: 'smooth' });
|
||||
});
|
||||
}
|
||||
|
||||
// Mobile menu toggle
|
||||
const menuToggle = document.getElementById('menuToggle');
|
||||
const navLinks = document.getElementById('navLinks');
|
||||
if (menuToggle && navLinks) {
|
||||
menuToggle.addEventListener('click', () => {
|
||||
navLinks.classList.toggle('open');
|
||||
});
|
||||
navLinks.querySelectorAll('a').forEach(link => {
|
||||
link.addEventListener('click', () => {
|
||||
navLinks.classList.remove('open');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Scroll reveal animation
|
||||
const observerOptions = { threshold: 0.1, rootMargin: '0px 0px -50px 0px' };
|
||||
const observer = new IntersectionObserver((entries) => {
|
||||
entries.forEach(entry => {
|
||||
if (entry.isIntersecting) {
|
||||
entry.target.style.opacity = '1';
|
||||
entry.target.style.transform = 'translateY(0)';
|
||||
}
|
||||
});
|
||||
}, observerOptions);
|
||||
|
||||
const animateEls = document.querySelectorAll('.feat-section, .pricing-card, .faq-item, .advantage-item, .about-block, .help-section');
|
||||
animateEls.forEach(el => {
|
||||
el.style.opacity = '0';
|
||||
el.style.transform = 'translateY(20px)';
|
||||
el.style.transition = 'opacity .6s ease, transform .6s ease';
|
||||
observer.observe(el);
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
animateEls.forEach(el => {
|
||||
const rect = el.getBoundingClientRect();
|
||||
if (rect.top < window.innerHeight) {
|
||||
el.style.opacity = '1';
|
||||
el.style.transform = 'translateY(0)';
|
||||
}
|
||||
});
|
||||
}, 200);
|
||||
15
app/controller/Auth.js
Normal file
15
app/controller/Auth.js
Normal file
@ -0,0 +1,15 @@
|
||||
const { Controller } = require('egg');
|
||||
|
||||
class authController extends Controller {
|
||||
async getLoginercode() {
|
||||
const { ctx } = this;
|
||||
ctx.body = await ctx.service.auth.getLoginercode();
|
||||
}
|
||||
async getLoginstatus(){
|
||||
const { ctx } = this;
|
||||
const query = ctx.request.body;
|
||||
ctx.body = await ctx.service.auth.getLoginstatus(query);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = authController;
|
||||
10
app/controller/Dashboard.js
Normal file
10
app/controller/Dashboard.js
Normal file
@ -0,0 +1,10 @@
|
||||
const { Controller } = require('egg');
|
||||
|
||||
class dashboardController extends Controller {
|
||||
async index() {
|
||||
const { ctx } = this;
|
||||
ctx.body = 'hi, egg';
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = dashboardController;
|
||||
35
app/controller/Dgj.js
Normal file
35
app/controller/Dgj.js
Normal file
@ -0,0 +1,35 @@
|
||||
const { Controller } = require('egg');
|
||||
|
||||
class dgjController extends Controller {
|
||||
async Print(){
|
||||
const { ctx } = this;
|
||||
const parmas = ctx.request.body;
|
||||
if('orders' in parmas && 'expressName' in parmas){
|
||||
ctx.body = await ctx.service.dgj.Print(parmas.orders,parmas.expressName);
|
||||
}
|
||||
}
|
||||
async Print1(){
|
||||
const { ctx } = this;
|
||||
const parmas = ctx.request.body;
|
||||
if('orders' in parmas && 'expressName' in parmas){
|
||||
ctx.body = await ctx.service.dgj.Print1(parmas.orders,parmas.expressName);
|
||||
}
|
||||
}
|
||||
async Print2(){
|
||||
const { ctx } = this;
|
||||
const parmas = ctx.request.body;
|
||||
if('orders' in parmas && 'expressName' in parmas){
|
||||
ctx.body = await ctx.service.dgj.Print2(parmas.orders,parmas.expressName);
|
||||
}
|
||||
}
|
||||
async CreateOrder(){
|
||||
const {ctx} = this;
|
||||
const parmas = ctx.request.body;
|
||||
if('orders' in parmas){
|
||||
ctx.body = await ctx.service.dgj.CreateOrder(parmas.orders);
|
||||
}else{
|
||||
ctx.body = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
module.exports = dgjController;
|
||||
10
app/controller/Express.js
Normal file
10
app/controller/Express.js
Normal file
@ -0,0 +1,10 @@
|
||||
const { Controller } = require('egg');
|
||||
|
||||
class expressController extends Controller {
|
||||
async aotoCheckLanshou() {
|
||||
const { ctx } = this;
|
||||
ctx.body = await ctx.service.express.aotoCheckLanshou();
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = expressController;
|
||||
16
app/controller/Home.js
Normal file
16
app/controller/Home.js
Normal file
@ -0,0 +1,16 @@
|
||||
const { Controller } = require('egg');
|
||||
|
||||
class homeController extends Controller {
|
||||
async index() {
|
||||
const { ctx } = this;
|
||||
ctx.body = 1;
|
||||
ctx.page = true;
|
||||
}
|
||||
async exportWmsMonthOrderFile(){
|
||||
const { ctx } = this;
|
||||
const parmas = ctx.request.body;
|
||||
ctx.body = await ctx.service.home.exportWmsMonthOrderFile(parmas.month);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = homeController;
|
||||
10
app/controller/MiniProgram.js
Normal file
10
app/controller/MiniProgram.js
Normal file
@ -0,0 +1,10 @@
|
||||
const { Controller } = require('egg');
|
||||
|
||||
class miniProgramController extends Controller {
|
||||
async index() {
|
||||
const { ctx } = this;
|
||||
ctx.body = 'hi, egg';
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = miniProgramController;
|
||||
12
app/controller/Pda.js
Normal file
12
app/controller/Pda.js
Normal file
@ -0,0 +1,12 @@
|
||||
const { Controller } = require('egg');
|
||||
|
||||
class pdaController extends Controller {
|
||||
async index() {
|
||||
const { ctx } = this;
|
||||
const query = this.ctx.query;
|
||||
ctx.body = await ctx.service.tgdppda.push(query.sid);
|
||||
console.log(query);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = pdaController;
|
||||
10
app/controller/Robot.js
Normal file
10
app/controller/Robot.js
Normal file
@ -0,0 +1,10 @@
|
||||
const { Controller } = require('egg');
|
||||
|
||||
class robotController extends Controller {
|
||||
async index() {
|
||||
const { ctx } = this;
|
||||
ctx.body = 'hi, egg';
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = robotController;
|
||||
44
app/controller/Sandan.js
Normal file
44
app/controller/Sandan.js
Normal file
@ -0,0 +1,44 @@
|
||||
const { Controller } = require('egg');
|
||||
|
||||
class sandanController extends Controller {
|
||||
async scan(){
|
||||
const { ctx } = this;
|
||||
const query = await new Promise((resolve, reject) => {
|
||||
let data = '';
|
||||
ctx.req.setEncoding('utf8');
|
||||
ctx.req.on('data', chunk => {
|
||||
data += chunk;
|
||||
});
|
||||
ctx.req.on('end', () => {
|
||||
resolve(data);
|
||||
});
|
||||
ctx.req.on('error', reject);
|
||||
});
|
||||
ctx.body = await ctx.service.gzt.scan(query.replace(/[\r\n]/g, ""),ctx.request.header.gztcode);
|
||||
}
|
||||
|
||||
async scan2(){
|
||||
const { ctx } = this;
|
||||
const query = await new Promise((resolve, reject) => {
|
||||
let data = '';
|
||||
ctx.req.setEncoding('utf8');
|
||||
ctx.req.on('data', chunk => {
|
||||
data += chunk;
|
||||
});
|
||||
ctx.req.on('end', () => {
|
||||
resolve(data);
|
||||
});
|
||||
ctx.req.on('error', reject);
|
||||
});
|
||||
ctx.body = await ctx.service.gzt.scan2(query.replace(/[\r\n]/g, ""),ctx.request.header.gztcode);
|
||||
}
|
||||
async createCache(){
|
||||
const { ctx } = this;
|
||||
const parmas = ctx.request.body;
|
||||
console.log(parmas);
|
||||
ctx.service.gzt.getOrderInfo(parmas.POSTNUM,parmas.WAREHOUSEID);
|
||||
ctx.body = 1;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = sandanController;
|
||||
38
app/controller/System.js
Normal file
38
app/controller/System.js
Normal file
@ -0,0 +1,38 @@
|
||||
'use strict';
|
||||
|
||||
const { Controller } = require('egg');
|
||||
|
||||
class SystemController extends Controller {
|
||||
/**
|
||||
* 通用请求入口
|
||||
* POST /system
|
||||
* Body: { "name": "someAction", "data": { ... } }
|
||||
*/
|
||||
async index() {
|
||||
const { ctx } = this;
|
||||
const { name, data } = ctx.request.body;
|
||||
|
||||
if (!name) {
|
||||
ctx.body = {
|
||||
success: false,
|
||||
message: '缺少 name 参数',
|
||||
};
|
||||
ctx.status = 400;
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const result = await ctx.service.system.dispatch(name, data);
|
||||
ctx.body = result;
|
||||
} catch (err) {
|
||||
ctx.logger.error('[System] 调度失败:', err.message);
|
||||
ctx.body = {
|
||||
success: false,
|
||||
message: err.message || '内部错误',
|
||||
};
|
||||
ctx.status = err.status || 500;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = SystemController;
|
||||
30
app/controller/Tgdp.js
Normal file
30
app/controller/Tgdp.js
Normal file
@ -0,0 +1,30 @@
|
||||
const { Controller } = require('egg');
|
||||
|
||||
class tgdpController extends Controller {
|
||||
async ll() {
|
||||
const { ctx } = this;
|
||||
const WAREHOUSEID = ctx.request.body.WAREHOUSEID;
|
||||
ctx.service.tgdp.ll(WAREHOUSEID);
|
||||
ctx.body = 1;
|
||||
}
|
||||
async jh() {
|
||||
const { ctx } = this;
|
||||
const WAREHOUSEID = ctx.request.body.WAREHOUSEID;
|
||||
ctx.service.tgdp.jh(WAREHOUSEID);
|
||||
ctx.body = 1;
|
||||
}
|
||||
async fh() {
|
||||
const { ctx } = this;
|
||||
const WAREHOUSEID = ctx.request.body.WAREHOUSEID;
|
||||
ctx.service.tgdp.fh(WAREHOUSEID);
|
||||
ctx.body = 1;
|
||||
}
|
||||
async db() {
|
||||
const { ctx } = this;
|
||||
const WAREHOUSEID = ctx.request.body.WAREHOUSEID;
|
||||
ctx.service.tgdp.db(WAREHOUSEID);
|
||||
ctx.body = 1;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = tgdpController;
|
||||
17
app/controller/Tool.js
Normal file
17
app/controller/Tool.js
Normal file
@ -0,0 +1,17 @@
|
||||
const { Controller } = require('egg');
|
||||
|
||||
class toolController extends Controller {
|
||||
async index() {
|
||||
const { ctx } = this;
|
||||
ctx.body = await ctx.service.home.getUserinfo();
|
||||
}
|
||||
async backMsg(){
|
||||
const { ctx } = this;
|
||||
ctx.body = await ctx.service.tool.backMsg(ctx.request.body);
|
||||
}
|
||||
async createOrder(){
|
||||
const { ctx } = this;
|
||||
ctx.body = await ctx.service.tool.createOrder(ctx.request.body);
|
||||
}
|
||||
}
|
||||
module.exports = toolController;
|
||||
10
app/controller/Workspace.js
Normal file
10
app/controller/Workspace.js
Normal file
@ -0,0 +1,10 @@
|
||||
const { Controller } = require('egg');
|
||||
|
||||
class WorkspaceController extends Controller {
|
||||
async index() {
|
||||
const { ctx } = this;
|
||||
ctx.body = 'hi, egg';
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = WorkspaceController;
|
||||
22
app/extend/application.js
Normal file
22
app/extend/application.js
Normal file
@ -0,0 +1,22 @@
|
||||
const soap = require('soap');
|
||||
|
||||
module.exports = {
|
||||
async wsdl(methodName, args) {
|
||||
try {
|
||||
const wsdlUrl = "http://ye4s.com/webservice/ws?wsdl";
|
||||
const obj = {};
|
||||
args.forEach((value, index) => {
|
||||
obj['arg' + index] = value;
|
||||
});
|
||||
const client = await soap.createClientAsync(wsdlUrl);
|
||||
const result = await client[methodName + 'Async'](obj);
|
||||
return result[0];
|
||||
} catch (error) {
|
||||
console.error('Error calling SOAP service:', error);
|
||||
throw error;
|
||||
}
|
||||
},
|
||||
async checkRule(path,module){
|
||||
|
||||
}
|
||||
};
|
||||
48
app/io/controller/generic.js
Normal file
48
app/io/controller/generic.js
Normal file
@ -0,0 +1,48 @@
|
||||
const Controller = require('egg').Controller;
|
||||
|
||||
class GenericController extends Controller {
|
||||
async generic() {
|
||||
const { ctx, app } = this;
|
||||
const data = ctx.args;
|
||||
const { eventType, eventData } = data[0];
|
||||
const socket = ctx.socket;
|
||||
const query = ctx.socket.handshake.query;
|
||||
const { token,type } = query;
|
||||
const sid = ctx.socket.id;
|
||||
if(type=="tgdp"){
|
||||
const listValues = await this.app.redis.get('cache').lrange(`tgdp_user_${ctx.socket.userinfo.warehouseid}`, 0, -1);
|
||||
const containsSid = listValues.includes(sid);
|
||||
if(!containsSid && ctx.socket.istgdp){
|
||||
await this.app.redis.get('cache').lpush(`tgdp_user_${ctx.socket.userinfo.warehouseid}`,sid);
|
||||
}
|
||||
}
|
||||
let result = null;
|
||||
switch (type) {
|
||||
case 'tgdp':
|
||||
if (ctx.service.tgdp && ctx.service.tgdp[eventType]) {
|
||||
// 如果有对应的 Service 存在,则调用对应的 Service 处理
|
||||
result = await ctx.service.tgdp[eventType](eventData);
|
||||
} else {
|
||||
// 如果没有对应的 Service 存在,则返回默认值 0
|
||||
result = 0;
|
||||
}
|
||||
break;
|
||||
case 'gzt':
|
||||
// code
|
||||
if (ctx.service.gzt && ctx.service.gzt[eventType]) {
|
||||
// 如果有对应的 Service 存在,则调用对应的 Service 处理
|
||||
result = await ctx.service.gzt[eventType](eventData);
|
||||
} else {
|
||||
// 如果没有对应的 Service 存在,则返回默认值 0
|
||||
result = 0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
|
||||
// 将处理结果返回给客户端
|
||||
socket.emit('genericResponse', {method:eventType,data:result});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = GenericController;
|
||||
72
app/io/middleware/connection.js
Normal file
72
app/io/middleware/connection.js
Normal file
@ -0,0 +1,72 @@
|
||||
const axios = require('axios');
|
||||
module.exports = app => {
|
||||
return async (ctx, next) => {
|
||||
const sid = ctx.socket.id;
|
||||
const nsp = app.io.of('/');
|
||||
const query = ctx.socket.handshake.query;
|
||||
|
||||
const { token,type } = query;
|
||||
let islogin = false;
|
||||
if(!token){
|
||||
if(type=="tgdp"){
|
||||
ctx.socket.disconnect();
|
||||
}
|
||||
if(type=="gzt"){
|
||||
let datas = await ctx.service.gzt.getBindCode(sid);
|
||||
ctx.socket.emit('genericResponse', {method:"getBindCode",data:datas});
|
||||
}
|
||||
}else{
|
||||
//根据token获取用户信息
|
||||
switch (type) {
|
||||
case 'tgdp':
|
||||
// code
|
||||
const apiUrl = 'https://ye4s.wms.gztbyc.com/api/user/index';
|
||||
const headers = {
|
||||
'token': token
|
||||
};
|
||||
try {
|
||||
const response = await axios.get(apiUrl,{headers});
|
||||
ctx.socket.userinfo = response.data.data[0];
|
||||
ctx.socket.rules = response.data.data[1];
|
||||
ctx.socket.istgdp = false;
|
||||
islogin = true;
|
||||
if(type=="tgdp"){
|
||||
let istgdp = false;
|
||||
for(let i=0;i<ctx.socket.rules.length;i++){
|
||||
if(ctx.socket.rules[i].name=="tgdplogin"){
|
||||
istgdp = true;
|
||||
}
|
||||
}
|
||||
ctx.socket.istgdp = istgdp;
|
||||
if(istgdp){
|
||||
console.log("istgdp",istgdp);
|
||||
await app.redis.get('cache').lpush(`tgdp_user_${ctx.socket.userinfo.warehouseid}`,sid);
|
||||
const datas = await ctx.service.tgdp.getAllinfo(ctx.socket.userinfo.warehouseid);
|
||||
console.log("datas",datas);
|
||||
ctx.socket.emit('genericResponse', {method:"AllList",data:datas});
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
}
|
||||
|
||||
if(!islogin){
|
||||
ctx.socket.emit("logout",1);
|
||||
}
|
||||
break;
|
||||
case "gzt" :
|
||||
const datas = await ctx.service.gzt.getBindInfo(token);
|
||||
ctx.socket.emit('genericResponse', {method:"getBindInfo",data:datas});
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
// 断开连接时触发逻辑
|
||||
ctx.socket.on('disconnect', async(reason) => {
|
||||
if(ctx.socket.istgdp){
|
||||
const listKey = `tgdp_user_${ctx.socket.userinfo.warehouseid}`;
|
||||
await app.redis.get('cache').lrem(listKey, 0, sid);
|
||||
}
|
||||
});
|
||||
await next();
|
||||
};
|
||||
};
|
||||
18
app/middleware/auth.js
Normal file
18
app/middleware/auth.js
Normal file
@ -0,0 +1,18 @@
|
||||
const AuthHandler = require('../utils/auth');
|
||||
module.exports = async (ctx, next) => {
|
||||
// 在这里进行鉴权逻辑,这里只是示例,您可以根据实际情况进行修改
|
||||
const token = ctx.header.authorization;
|
||||
const authHandler = new AuthHandler(ctx);
|
||||
const auth = await authHandler.init(token);
|
||||
if(!auth){
|
||||
ctx.status = 401;
|
||||
let err_essage = await authHandler.getError();
|
||||
ctx.body = { message: err_essage };
|
||||
return;
|
||||
}else{
|
||||
ctx.state.user = await authHandler.getUser();
|
||||
ctx.state.wmsuser = await authHandler.getWmsUser();
|
||||
ctx.state.rules = await authHandler.getRuleList();
|
||||
await next();
|
||||
}
|
||||
};
|
||||
30
app/middleware/formatResponse.js
Normal file
30
app/middleware/formatResponse.js
Normal file
@ -0,0 +1,30 @@
|
||||
module.exports = () => {
|
||||
return async function formatResponse(ctx, next) {
|
||||
try {
|
||||
await next();
|
||||
// 统一输出数据格式
|
||||
if(ctx.page!=true){
|
||||
if (ctx.body) {
|
||||
ctx.body = {
|
||||
code: ctx.status || 200,
|
||||
data: ctx.body,
|
||||
message: ctx.message || 'Success',
|
||||
};
|
||||
} else {
|
||||
ctx.status = 404;
|
||||
ctx.body = {
|
||||
code: 404,
|
||||
message: 'Not Found',
|
||||
};
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
// 处理异常情况
|
||||
ctx.status = err.status || 500;
|
||||
ctx.body = {
|
||||
code: ctx.status,
|
||||
message: err.message || 'Internal Server Error',
|
||||
};
|
||||
}
|
||||
};
|
||||
};
|
||||
537
app/public/scan_logs.txt
Normal file
537
app/public/scan_logs.txt
Normal file
@ -0,0 +1,537 @@
|
||||
320691483887730,33
|
||||
320691495281866,33
|
||||
320691503196019,33
|
||||
320691482905982,33
|
||||
320691493554067,33
|
||||
320691476834625,33
|
||||
320691476809758,33
|
||||
320691492646440,33
|
||||
320691485597427,33
|
||||
320691482906381,33
|
||||
320691501135309,33
|
||||
320691501145796,33
|
||||
320691496383539,33
|
||||
320691503176675,33
|
||||
320691502164685,33
|
||||
320691503180323,33
|
||||
320691504126110,33
|
||||
320691483886337,33
|
||||
320691502161042,33
|
||||
320691490981591,33
|
||||
320691503179585,33
|
||||
320691476837058,33
|
||||
320691491891015,33
|
||||
320691476831262,33
|
||||
320691468958934,33
|
||||
320691501153701,33
|
||||
320691496387066,33
|
||||
320691491886453,33
|
||||
320691491886453,33
|
||||
320691491886453,33
|
||||
320691501155896,33
|
||||
320691502170822,33
|
||||
320691485654053,33
|
||||
320691503239584,33
|
||||
320691505130712,33
|
||||
320691503225583,33
|
||||
320691478766229,33
|
||||
320691489419274,33
|
||||
320691493621767,33
|
||||
320691498205574,33
|
||||
320691481840389,33
|
||||
320691501179804,33
|
||||
320691492675735,33
|
||||
320691505130136,33
|
||||
320691476847233,33
|
||||
320691505124787,33
|
||||
320691501189704,33
|
||||
320691506243285,33
|
||||
320691501185695,33
|
||||
320691501185211,33
|
||||
320691492676158,33
|
||||
320691501177896,33
|
||||
320691493630286,33
|
||||
320691496417646,33
|
||||
320691500248600,33
|
||||
320691483924958,33
|
||||
320691482965738,33
|
||||
320691492687073,33
|
||||
320691493630379,33
|
||||
320691476866416,33
|
||||
320691482950477,33
|
||||
320691476876138,33
|
||||
320691483906974,33
|
||||
320691494493167,33
|
||||
320691476876229,33
|
||||
320691491968090,33
|
||||
320691505125487,33
|
||||
320691482942365,33
|
||||
320691508270401,33
|
||||
320691484628635,33
|
||||
320691479962167,33
|
||||
320691479962351,33
|
||||
320691507002629,33
|
||||
320691496416170,33
|
||||
320691481849653,33
|
||||
320691476866137,33
|
||||
320691496416261,33
|
||||
320691489413462,33
|
||||
320691501192819,33
|
||||
320691481840484,33
|
||||
320691481842561,33
|
||||
320691503229399,33
|
||||
320691500248216,33
|
||||
320691496417171,33
|
||||
320691501192516,33
|
||||
320691488758237,33
|
||||
320691483928085,33
|
||||
320691484628536,33
|
||||
320691493621666,33
|
||||
320691504161498,33
|
||||
320691491980690,33
|
||||
320691482950774,33
|
||||
320691483935540,33
|
||||
320691493631368,33
|
||||
320691481848549,33
|
||||
320691483911679,33
|
||||
320691501177208,33
|
||||
320691486678420,33
|
||||
320691496433074,33
|
||||
320691483923270,33
|
||||
320691492684949,33
|
||||
320691500210178,33
|
||||
320691500248125,33
|
||||
320691496416354,33
|
||||
320691492695078,33
|
||||
320691483920106,33
|
||||
320691496417955,33
|
||||
320691476876613,33
|
||||
320691483913279,33
|
||||
320691476874421,33
|
||||
320691494493543,33
|
||||
320691505122214,33
|
||||
320691482966072,33
|
||||
320691488755327,33
|
||||
320691476857715,33
|
||||
320691483923963,33
|
||||
320691476858518,33
|
||||
320691485655614,33
|
||||
320691499672078,33
|
||||
320691483886064,33
|
||||
320691505130920,33
|
||||
320691493602677,33
|
||||
320691468997731,33
|
||||
320691500213242,33
|
||||
320691476866321,33
|
||||
320691501194312,33
|
||||
320691482946844,33
|
||||
320691481848852,33
|
||||
320691493602481,33
|
||||
320691491977856,33
|
||||
320691483907002,33
|
||||
320691485656049,33
|
||||
320691485658142,33
|
||||
320691482953262,33
|
||||
320691505114120,33
|
||||
320691476858233,33
|
||||
320691503251495,33
|
||||
320691490981399,33
|
||||
320691485658053,33
|
||||
320691483936842,33
|
||||
320691496412465,33
|
||||
320691504163779,33
|
||||
320691503239784,33
|
||||
320691481832374,33
|
||||
320691500231335,33
|
||||
320691476860452,33
|
||||
320691500212942,33
|
||||
320691500212942,33
|
||||
320691500212942,33
|
||||
320691500212942,33
|
||||
320691500212942,33
|
||||
320691500212942,33
|
||||
320691500212942,33
|
||||
320691500212942,33
|
||||
320691500212942,33
|
||||
320691488757719,33
|
||||
320691495317553,33
|
||||
320691501185304,33
|
||||
320691492687162,33
|
||||
320691503226017,33
|
||||
320691496433163,33
|
||||
320691493625846,33
|
||||
320691505121316,33
|
||||
320691493631463,33
|
||||
320691498213571,33
|
||||
320691505130611,33
|
||||
320691485648056,33
|
||||
320691505131216,33
|
||||
320691497174356,33
|
||||
320691493604566,33
|
||||
320691501192615,33
|
||||
320691485658718,33
|
||||
320691481845546,33
|
||||
320691481845449,33
|
||||
320691505124686,33
|
||||
320691500213151,33
|
||||
320691501177117,33
|
||||
320691493605098,33
|
||||
320691482942181,33
|
||||
320691486675229,33
|
||||
320691492687253,33
|
||||
320691476868717,33
|
||||
320691493631095,33
|
||||
320691496422456,33
|
||||
320691479962078,33
|
||||
320691482950877,33
|
||||
320691508258001,33
|
||||
320691492684640,33
|
||||
320691535520667,33
|
||||
320691531418980,33
|
||||
320691542400125,33
|
||||
320691537369248,33
|
||||
320691546143082,33
|
||||
320691553534244,33
|
||||
320691525754431,33
|
||||
320691567204370,33
|
||||
320691537369533,33
|
||||
320691530754859,33
|
||||
320691540917679,33
|
||||
320691563196451,33
|
||||
320691549215368,33
|
||||
320691525754152,33
|
||||
320691540278566,33
|
||||
320691540915988,33
|
||||
320691546145442,33
|
||||
320691540282389,33
|
||||
320691535514953,33
|
||||
320691561305984,33
|
||||
320691542399960,33
|
||||
320691543587524,33
|
||||
320691537373069,33
|
||||
320691562307666,33
|
||||
320691525759436,33
|
||||
320691531418671,33
|
||||
320691568211983,33
|
||||
320691540277763,33
|
||||
320691544239082,33
|
||||
320691545284633,33
|
||||
320691535519550,33
|
||||
320691533839848,33
|
||||
320691565199957,33
|
||||
320691568208565,33
|
||||
320691545285834,33
|
||||
320691546142962,33
|
||||
320691516941003,33
|
||||
320691516941003,33
|
||||
320691516941003,33
|
||||
320691525758336,33
|
||||
320691516941003,33
|
||||
320691563194752,33
|
||||
320691535520871,33
|
||||
320691540282781,33
|
||||
320691525758431,33
|
||||
320691535514848,33
|
||||
320691568210786,33
|
||||
320691533839953,33
|
||||
320691571011325,33
|
||||
320691525758152,33
|
||||
320691546145638,33
|
||||
320691563194855,33
|
||||
320691543587427,33
|
||||
320691525755428,33
|
||||
320691540282581,33
|
||||
320691546144445,33
|
||||
320691544237347,33
|
||||
320691532885638,33
|
||||
320691537373342,33
|
||||
320691535520471,33
|
||||
320691532881466,33
|
||||
320691531418007,33
|
||||
320691543587239,33
|
||||
320691525753733,33
|
||||
320691540282884,33
|
||||
320691538288257,33
|
||||
320691534504967,33
|
||||
320691568211575,33
|
||||
320691532883262,33
|
||||
320691540283198,33
|
||||
320691537373437,33
|
||||
320691532882857,33
|
||||
320691561306478,33
|
||||
320691532884845,33
|
||||
320691530754964,33
|
||||
320691547041478,33
|
||||
320691532885442,33
|
||||
320691525755525,33
|
||||
320691540278974,33
|
||||
320691565199749,33
|
||||
320691549215659,33
|
||||
320691533842547,33
|
||||
320691575045851,33
|
||||
320691531418287,33
|
||||
320691568213274,33
|
||||
320691542400036,33
|
||||
320691546143262,33
|
||||
320691550062497,33
|
||||
320691533840002,33
|
||||
320691540278869,33
|
||||
320691533842955,33
|
||||
320691563195648,33
|
||||
320691567204465,33
|
||||
320691562307767,33
|
||||
320691546146073,33
|
||||
320691525753941,33
|
||||
320691553534337,33
|
||||
320691542400309,33
|
||||
320691525753836,33
|
||||
320691563195957,33
|
||||
320691540278665,33
|
||||
320691546145539,33
|
||||
320691562307470,33
|
||||
320691571013036,33
|
||||
320691533840282,33
|
||||
320691525758528,33
|
||||
320691563195549,33
|
||||
320691545286065,33
|
||||
320691532880982,33
|
||||
320691532881563,33
|
||||
320691489419094,33
|
||||
320691496431090,33
|
||||
320691486678232,33
|
||||
320691508257763,33
|
||||
320691506232582,33
|
||||
320691482947077,33
|
||||
320691493630670,33
|
||||
320691497174748,33
|
||||
320691505129895,33
|
||||
320691489413274,33
|
||||
320691485655923,33
|
||||
320691483933851,33
|
||||
320691479969071,33
|
||||
320691499669438,33
|
||||
320691481832469,33
|
||||
320691483911580,33
|
||||
320691476866048,33
|
||||
320691498212778,33
|
||||
320691485666921,33
|
||||
320691476875515,33
|
||||
320691476868517,33
|
||||
320691505114304,33
|
||||
320691501192419,33
|
||||
320691505132300,33
|
||||
320691485665229,33
|
||||
320691503226297,33
|
||||
320691478766322,33
|
||||
320691483935639,33
|
||||
320691501169908,33
|
||||
320691482942557,33
|
||||
320691503252298,33
|
||||
320691482951371,33
|
||||
320691505122599,33
|
||||
320691490969379,33
|
||||
320691508257971,33
|
||||
320691489418857,33
|
||||
320691485667049,33
|
||||
320691503252583,33
|
||||
320691496432546,33
|
||||
320691496432546,33
|
||||
320691496432546,33
|
||||
320691496432546,33
|
||||
320691501187899,33
|
||||
320691501177692,33
|
||||
320691500210089,33
|
||||
320691482954950,33
|
||||
320691483935348,33
|
||||
320691495313096,33
|
||||
320691495313096,33
|
||||
320691503225391,33
|
||||
320691500215422,33
|
||||
320691505131804,33
|
||||
320691498213670,33
|
||||
320691505131804,33
|
||||
320691505131804,33
|
||||
320691505131804,33
|
||||
320691505131804,33
|
||||
320691505131804,33
|
||||
320691505131804,33
|
||||
320691505131804,33
|
||||
320691505131804,33
|
||||
6901028011778,33
|
||||
320691500231151,33
|
||||
320691493630571,33
|
||||
320691507002433,33
|
||||
320691476858053,33
|
||||
320691476858617,33
|
||||
320691506232390,33
|
||||
320691501192324,33
|
||||
320691493628954,33
|
||||
320691503252391,33
|
||||
320691501182319,33
|
||||
320691485665613,33
|
||||
320691478766049,33
|
||||
320691493623266,33
|
||||
320691482958166,33
|
||||
320691505132027,33
|
||||
320691485667514,33
|
||||
320691505132027,33
|
||||
320691505132027,33
|
||||
320691505131909,33
|
||||
320691482957947,33
|
||||
320691496422753,33
|
||||
320691498202688,33
|
||||
320691498202688,33
|
||||
320691498202688,33
|
||||
320691498202688,33
|
||||
320691505124890,33
|
||||
320691476866228,33
|
||||
320691496415955,33
|
||||
320691571008707,33
|
||||
320691561306199,33
|
||||
320691540912210,33
|
||||
320691575039369,33
|
||||
320691568213183,33
|
||||
320691557547816,33
|
||||
320691565197256,33
|
||||
320691566404357,33
|
||||
320691551814372,33
|
||||
320691540916678,33
|
||||
320691568204000,33
|
||||
320691560806581,33
|
||||
320691567204762,33
|
||||
320691553533942,33
|
||||
320691570061911,33
|
||||
320691553526067,33
|
||||
320691565194352,33
|
||||
320691571009415,33
|
||||
320691547654614,33
|
||||
320691547652727,33
|
||||
320691568208373,33
|
||||
320691562304473,33
|
||||
320691562309290,33
|
||||
320691568212566,33
|
||||
320691568203285,33
|
||||
320691562309010,33
|
||||
320691565200118,33
|
||||
320691571012811,33
|
||||
320691572018995,33
|
||||
320691547651635,33
|
||||
320691540911912,33
|
||||
320691540917883,33
|
||||
320691565199264,33
|
||||
320691572020045,33
|
||||
320691537921280,33
|
||||
320691553533837,33
|
||||
320691571010063,33
|
||||
320691568211199,33
|
||||
320691568203378,33
|
||||
320691550787083,33
|
||||
320691553526732,33
|
||||
320691565195444,33
|
||||
320691561306290,33
|
||||
320691568202292,33
|
||||
320691560806781,33
|
||||
320691572022689,33
|
||||
320691575039276,33
|
||||
320691568207762,33
|
||||
320691562312195,33
|
||||
320691572020134,33
|
||||
320691562304570,33
|
||||
320691562312195,33
|
||||
320691561305011,33
|
||||
320691537921373,33
|
||||
320691568208280,33
|
||||
320691568202985,33
|
||||
320691571012132,33
|
||||
320691572019895,33
|
||||
320691575038756,33
|
||||
320691540911807,33
|
||||
320691575040391,33
|
||||
320691547652430,33
|
||||
320691547654515,33
|
||||
320691557547921,33
|
||||
320691562308770,33
|
||||
320691551813668,33
|
||||
320691571008042,33
|
||||
320691540910139,33
|
||||
320691547652151,33
|
||||
320691562304285,33
|
||||
320691540911603,33
|
||||
320691540910230,33
|
||||
320691565199452,33
|
||||
320691571007312,33
|
||||
320691568202385,33
|
||||
320691551820202,33
|
||||
320691565197349,33
|
||||
320691563195084,33
|
||||
320691563193460,33
|
||||
320691575039464,33
|
||||
320691575039561,33
|
||||
320691571008222,33
|
||||
320691572019792,33
|
||||
320691571011820,33
|
||||
320691571009136,33
|
||||
320691568204280,33
|
||||
320691562308873,33
|
||||
320691553526532,33
|
||||
320691547652830,33
|
||||
320691540912498,33
|
||||
320691568203473,33
|
||||
320691572022493,33
|
||||
320691535520768,33
|
||||
320691535516444,33
|
||||
320691540917780,33
|
||||
320691540279474,33
|
||||
320691553526247,33
|
||||
320691567204661,33
|
||||
320691571009712,33
|
||||
320691568212374,33
|
||||
320691565194744,33
|
||||
320691540910418,33
|
||||
320691571008810,33
|
||||
320691540910050,33
|
||||
320691565200029,33
|
||||
320691571007128,33
|
||||
320691562308473,33
|
||||
320691571008507,33
|
||||
320691540910818,33
|
||||
320691571009815,33
|
||||
320691563196356,33
|
||||
320691571009611,33
|
||||
320691568208189,33
|
||||
320691562304378,33
|
||||
320691571007704,33
|
||||
320691571011232,33
|
||||
320691562311988,33
|
||||
320691558647050,33
|
||||
320691540916779,33
|
||||
320691562309383,33
|
||||
320691562311780,33
|
||||
320691571008131,33
|
||||
320691550786646,33
|
||||
320691572022205,33
|
||||
320691558641842,33
|
||||
320691550786747,33
|
||||
320691565194447,33
|
||||
320691540918298,33
|
||||
320691560804585,33
|
||||
320691575040583,33
|
||||
320691553529076,33
|
||||
320691560805106,33
|
||||
320691571011717,33
|
||||
320691560804888,33
|
||||
320691550786850,33
|
||||
320691562308570,33
|
||||
320691560804993,33
|
||||
320691568211674,33
|
||||
320691571007219,33
|
||||
320691575039660,33
|
||||
320691565199173,33
|
||||
320691565199357,33
|
||||
320691568212190,33
|
||||
320691565194259,33
|
||||
320691565194259,33
|
||||
320691571009920,33
|
||||
320691561305879,33
|
||||
5419,33
|
||||
219j5429,33
|
||||
84
app/router.js
Normal file
84
app/router.js
Normal file
@ -0,0 +1,84 @@
|
||||
/**
|
||||
* @param {Egg.Application} app - egg application
|
||||
*/
|
||||
const fs = require('fs').promises;
|
||||
const path = require('path');
|
||||
module.exports = app => {
|
||||
const { router, controller,io } = app;
|
||||
// 定义一个需要鉴权的路由组
|
||||
function mapRoutes(routes) {
|
||||
routes.forEach(route => {
|
||||
const [path, method, auth] = route.split('|');
|
||||
const [controllerName, methodName] = path.split('/');
|
||||
const handler = controller[controllerName][methodName];
|
||||
|
||||
let middleware = null;
|
||||
if (auth === '1') {
|
||||
middleware = app.middleware.auth;
|
||||
}
|
||||
|
||||
if (handler && typeof handler === 'function') {
|
||||
if (method === 'get') {
|
||||
if(middleware){
|
||||
router.get(`/${controllerName}/${methodName}`, middleware, handler);
|
||||
}else{
|
||||
router.get(`/${controllerName}/${methodName}`, handler);
|
||||
}
|
||||
} else if (method === 'post') {
|
||||
if(middleware){
|
||||
router.post(`/${controllerName}/${methodName}`, middleware, handler);
|
||||
}else{
|
||||
router.post(`/${controllerName}/${methodName}`, handler);
|
||||
}
|
||||
}
|
||||
// Add more methods as needed
|
||||
} else {
|
||||
console.error(`Handler function ${controllerName}.${methodName} is not defined or is not a function.`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const authRoutesList = [
|
||||
'auth/getLoginercode|get|0',
|
||||
'auth/getLoginstatus|post|0',
|
||||
'tgdp/ll|post|0',
|
||||
'tgdp/jh|post|0',
|
||||
'tgdp/fh|post|0',
|
||||
'tgdp/db|post|0',
|
||||
'workspace/index|post|1',
|
||||
'robot/index|post|1',
|
||||
'tool/index|post|1',
|
||||
'tool/backMsg|post|0',
|
||||
'tool/createOrder|post|0',
|
||||
'dashboard/index|post|1',
|
||||
'pda/index|get|0',
|
||||
'miniProgram/index|post|1',
|
||||
'dgj/Print|post|0',
|
||||
'dgj/Print1|post|0',
|
||||
'dgj/Print2|post|0',
|
||||
'dgj/CreateOrder|post|0',
|
||||
'express/aotoCheckLanshou|get|0',
|
||||
'sandan/scan|post|0',
|
||||
'sandan/scan2|post|0',
|
||||
'sandan/createCache|post|0'
|
||||
];
|
||||
mapRoutes(authRoutesList);
|
||||
|
||||
// 通用请求接口: POST /system { "name": "someAction", "data": { ... } }
|
||||
router.post('/system', controller.system.index);
|
||||
//home 首页
|
||||
//router.get('/', controller.home.index);
|
||||
router.get('/', async ctx => {
|
||||
try {
|
||||
ctx.page = true;
|
||||
const filePath = path.join(app.baseDir, 'app/assets/index.html');
|
||||
const content = await fs.readFile(filePath);
|
||||
ctx.type = 'html';
|
||||
ctx.body = content;
|
||||
} catch (err) {
|
||||
ctx.status = 404;
|
||||
ctx.body = 'File not found';
|
||||
}
|
||||
});
|
||||
io.of('/').route('genericEvent', io.controller.generic.generic);
|
||||
};
|
||||
17
app/schedule/checkOnline.js
Normal file
17
app/schedule/checkOnline.js
Normal file
@ -0,0 +1,17 @@
|
||||
const Subscription = require('egg').Subscription;
|
||||
|
||||
class checkOnline extends Subscription {
|
||||
static get schedule() {
|
||||
return {
|
||||
interval: '300s',
|
||||
type: 'worker',
|
||||
};
|
||||
}
|
||||
async subscribe() {
|
||||
const {
|
||||
ctx
|
||||
} = this;
|
||||
await this.ctx.service.tgdp.checkOnline();
|
||||
}
|
||||
}
|
||||
module.exports = checkOnline;
|
||||
46
app/service/auth.js
Normal file
46
app/service/auth.js
Normal file
@ -0,0 +1,46 @@
|
||||
const Service = require('egg').Service;
|
||||
const { v4: uuidv4 } = require('uuid');
|
||||
const axios = require('axios');
|
||||
|
||||
class Auth extends Service {
|
||||
async getLoginercode(){
|
||||
const uuid = uuidv4();
|
||||
let task = await this.app.mysql.get('dblocal').insert(`ye4s_logins`,{token:uuid});
|
||||
return uuid;
|
||||
}
|
||||
async getLoginstatus(params){
|
||||
let task = await this.app.mysql.get('dblocal').get(`ye4s_logins`,{token:params.token});
|
||||
if(task.uuid){
|
||||
console.log(task.uuid);
|
||||
const res = await this.loginByUuid(task.uuid);
|
||||
return {token:res};
|
||||
}else{
|
||||
return {token:null};
|
||||
}
|
||||
}
|
||||
async loginByUuid(uuid){
|
||||
const apiUrl = 'https://ye4s.wms.gztbyc.com/api/user/loginByUUid'; // FastAdmin API 的 URL
|
||||
const postData = {
|
||||
uuid: uuid
|
||||
};
|
||||
try {
|
||||
const response = await axios.post(apiUrl, postData);
|
||||
console.log(response);
|
||||
return response.data.data.userinfo.token;
|
||||
} catch (error) {
|
||||
console.log("error",error);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
async getUserinfo(){
|
||||
const {ctx} = this;
|
||||
let task = await ctx.app.wsdl('getPDAUser',['caige01', 'wu123456']);
|
||||
let data = JSON.parse(task.return);
|
||||
data.push(ctx.state.user);
|
||||
data.push(ctx.state.wmsuser);
|
||||
let rules = ctx.state.rules;
|
||||
console.log(rules);
|
||||
return data;
|
||||
}
|
||||
}
|
||||
module.exports = Auth;
|
||||
625
app/service/dgj.js
Normal file
625
app/service/dgj.js
Normal file
@ -0,0 +1,625 @@
|
||||
const Service = require('egg').Service;
|
||||
const axios = require('axios');
|
||||
|
||||
class Dgj extends Service {
|
||||
async Print1(order,expressName){
|
||||
console.log(order);
|
||||
const pingtais_default_PlatformType = {
|
||||
"1":"Taobao",
|
||||
"3":"JingdongPurchase",
|
||||
"4":"Pinduoduo",
|
||||
"5":"TouTiao",
|
||||
"6":"KuaiShou",
|
||||
"7":"WxVideo",
|
||||
"8":"XiaoHongShu"
|
||||
};
|
||||
const pingtais = {
|
||||
"1":"ali",
|
||||
"6":"ali",
|
||||
"8":"ali",
|
||||
"4":"pdd",
|
||||
"5":"dd",
|
||||
"7":"ali",
|
||||
"3":"jd"
|
||||
};
|
||||
let opingtai = null;
|
||||
let orders_arr = order.split("|").filter(value => value !== null && value !== undefined && value !== '' && value.indexOf('TB')==-1 && value.indexOf('jst')==-1);
|
||||
let pingtaiOrder = {};
|
||||
let hasError = null;
|
||||
let tmp_list = [];
|
||||
let fin_list = [];
|
||||
for(let i = 0;i<orders_arr.length;i++){
|
||||
let r = orders_arr[i];
|
||||
let order_item = r.split(",").filter(value => value !== null && value !== undefined && value !== '');
|
||||
fin_list.push(order_item[0]);
|
||||
if (!order_item.hasOwnProperty(1)) {
|
||||
hasError = `${r},orders入参错误,格式为外部订单编号,平台编号|外部订单编号,平台编号,传入的值为${order}`;
|
||||
break;
|
||||
}
|
||||
let pingtai = (order_item[1] in pingtais)?pingtais[order_item[1]]:null;
|
||||
if(order_item.hasOwnProperty(2) && order_item[2]=="1"){
|
||||
opingtai = pingtai;
|
||||
pingtai = "ali";
|
||||
}
|
||||
if(!pingtai){
|
||||
hasError = `${order_item[1]}在程序中pingtais无对应键值`;
|
||||
break;
|
||||
}
|
||||
if(pingtai in pingtaiOrder){
|
||||
pingtaiOrder[pingtai].push(order_item[0]);
|
||||
}else{
|
||||
pingtaiOrder[pingtai] = [order_item[0]];
|
||||
}
|
||||
}
|
||||
if(hasError){
|
||||
return {code:0,msg:hasError};
|
||||
}
|
||||
let pingtaiOrder2 = {};
|
||||
for(let key in pingtaiOrder){
|
||||
let filters = [
|
||||
{
|
||||
TableAlias:"o",
|
||||
FieldType:"string",
|
||||
TableName:"LogicOrder",
|
||||
Name:"PlatformOrderId",
|
||||
Value:pingtaiOrder[key].join(","),
|
||||
Contract:"in",
|
||||
CustomQuery:"PlatformOrderIdSearch"
|
||||
},
|
||||
];
|
||||
let MultiFilters = [];
|
||||
let pageSize =500;
|
||||
let pageIndex = 1;
|
||||
const orders_list = await this.NewOrderList1(key,filters,MultiFilters,pageSize,pageIndex);
|
||||
const rows = orders_list.rows;
|
||||
let TemplateList = await this.LoadTemplateListInOrderList(key);
|
||||
let TemplateLists = [];
|
||||
for(let i=0;i<TemplateList.Data.length;i++){
|
||||
if(TemplateList.Data[i].TemplateName.indexOf(expressName)>-1){
|
||||
TemplateLists.push(TemplateList.Data[i]);
|
||||
}
|
||||
}
|
||||
if(TemplateLists.length==0){
|
||||
hasError = `快递${expressName}在店管家中无对应的模板,如果有,可以更改店管家中自定义模板名称包含\"${expressName}\",再重试`;
|
||||
break;
|
||||
}
|
||||
let orderPls = {};
|
||||
for(let i = 0;i<rows.length;i++){
|
||||
let rr = rows[i];
|
||||
if(rr.PlatformType=="Alibaba"){
|
||||
if((rr.OrderTags.length>0 && rr.OrderTags[0].TagValue=="douyin") || rr.ExtField1=="douyin"){
|
||||
rr.PlatformType="TouTiao";
|
||||
}else if((rr.OrderTags.length>0 && rr.OrderTags[0].TagValue=="pinduoduo") || rr.ExtField1=="pinduoduo"){
|
||||
rr.PlatformType="Pinduoduo";
|
||||
}else if((rr.OrderTags.length>0 && rr.OrderTags[0].TagValue=="xiaohongshu") || rr.ExtField1=="xiaohongshu"){
|
||||
rr.PlatformType="XiaoHongShu";
|
||||
}else if((rr.OrderTags.length>0 && rr.OrderTags[0].TagValue=="kuaishou") || rr.ExtField1=="kuaishou"){
|
||||
rr.PlatformType="KuaiShou";
|
||||
}else if((rr.OrderTags.length>0 && rr.OrderTags[0].TagValue=="kuaishou") || rr.ExtField1=="kuaishou"){
|
||||
rr.PlatformType="KuaiShou";
|
||||
}else{
|
||||
rr.PlatformType="Taobao";
|
||||
}
|
||||
}else if(rr.PlatformType=="AlibabaC2M"){
|
||||
rr.PlatformType="Taobao";
|
||||
}
|
||||
if(rr.PlatformType=="Other_Heliang"){
|
||||
for(let ii = 0;ii<orders_arr.length;ii++){
|
||||
let r = orders_arr[ii];
|
||||
let order_item = r.split(",").filter(value => value !== null && value !== undefined && value !== '');
|
||||
console.log("order_item",order_item,pingtais_default_PlatformType,order_item[1]);
|
||||
if(order_item[0]==rr.PlatformOrderId){
|
||||
rr.PlatformType = pingtais_default_PlatformType[order_item[1]];
|
||||
}
|
||||
}
|
||||
}
|
||||
if(rr.PlatformType in orderPls){
|
||||
orderPls[rr.PlatformType].orders.push(rr);
|
||||
}else{
|
||||
orderPls[rr.PlatformType] = {orders:[rr],Template:[]}
|
||||
}
|
||||
}
|
||||
for(let PlatformType in orderPls){
|
||||
let rr = orderPls[PlatformType];
|
||||
let Template = null;
|
||||
for(let i=0;i<TemplateLists.length;i++){
|
||||
let TemplateList = TemplateLists[i];
|
||||
if(TemplateList.TemplateTypeShort==PlatformType){
|
||||
Template = TemplateList;
|
||||
orderPls[PlatformType].Template = TemplateList;
|
||||
}
|
||||
}
|
||||
if(!Template){
|
||||
hasError = `${PlatformType}在店管家中无对应的模板,请添加模板后再重试`;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(hasError){
|
||||
break;
|
||||
}
|
||||
pingtaiOrder2[key] = orderPls;
|
||||
}
|
||||
if(hasError){
|
||||
return {code:0,msg:hasError};
|
||||
}
|
||||
let list = [];
|
||||
for (let key in pingtaiOrder2) {
|
||||
let r = pingtaiOrder2[key];
|
||||
for (let key2 in r) {
|
||||
let orders_tmp = [];
|
||||
for(let index_order=0;index_order<r[key2].orders.length;index_order++){
|
||||
if(r[key2].orders[index_order].WaybillCodes.length>0){
|
||||
if(r[key2].orders[index_order].WaybillCodes[0].TemplateId!=r[key2].Template.Id){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
orders_tmp.push(r[key2].orders[index_order]);
|
||||
}
|
||||
let orders = await this.arrayChunk(orders_tmp, 10);
|
||||
await Promise.all(orders.map(async (order) => {
|
||||
let res = [];
|
||||
if (key2 === "Pinduoduo") {
|
||||
res = await this.ExpressPrint(key, order, r[key2].Template, true);
|
||||
} else {
|
||||
res = await this.ExpressPrint(key, order, r[key2].Template, false);
|
||||
}
|
||||
list.push({ Platform: key2, print_datas: res });
|
||||
}));
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
async Print2(order,expressName){
|
||||
console.log(order);
|
||||
const pingtais_default_PlatformType = {
|
||||
"1":"Taobao",
|
||||
"3":"JingdongPurchase",
|
||||
"4":"Pinduoduo",
|
||||
"5":"TouTiao",
|
||||
"6":"KuaiShou",
|
||||
"7":"WxVideo",
|
||||
"8":"XiaoHongShu"
|
||||
};
|
||||
const pingtais = {
|
||||
"1":"ali",
|
||||
"6":"ali",
|
||||
"8":"ali",
|
||||
"4":"pdd",
|
||||
"5":"dd",
|
||||
"7":"ali",
|
||||
"3":"jd"
|
||||
};
|
||||
let opingtai = null;
|
||||
let orders_arr = order.split("|").filter(value => value !== null && value !== undefined && value !== '');
|
||||
let pingtaiOrder = {};
|
||||
let hasError = null;
|
||||
let tmp_list = [];
|
||||
let fin_list = [];
|
||||
for(let i = 0;i<orders_arr.length;i++){
|
||||
let r = orders_arr[i];
|
||||
let order_item = r.split(",").filter(value => value !== null && value !== undefined && value !== '');
|
||||
let res = await this.app.redis.get("post_order_cache").get(order_item[0]);
|
||||
if(res){
|
||||
|
||||
console.log(res,"订单锁定,跳过");
|
||||
continue;
|
||||
}else{
|
||||
console.log("订单无锁");
|
||||
if(order_item){
|
||||
await this.app.redis.get("post_order_cache").set(order_item[0],1,'EX',600);
|
||||
fin_list.push(order_item[0]);
|
||||
}
|
||||
}
|
||||
if (!order_item.hasOwnProperty(1)) {
|
||||
hasError = `${r},orders入参错误,格式为外部订单编号,平台编号|外部订单编号,平台编号,传入的值为${order}`;
|
||||
break;
|
||||
}
|
||||
let pingtai = (order_item[1] in pingtais)?pingtais[order_item[1]]:null;
|
||||
if(order_item.hasOwnProperty(2) && order_item[2]=="1"){
|
||||
opingtai = pingtai;
|
||||
pingtai = "ali";
|
||||
}
|
||||
if(!pingtai){
|
||||
hasError = `${order_item[1]}在程序中pingtais无对应键值`;
|
||||
break;
|
||||
}
|
||||
if(pingtai in pingtaiOrder){
|
||||
pingtaiOrder[pingtai].push(order_item[0]);
|
||||
}else{
|
||||
pingtaiOrder[pingtai] = [order_item[0]];
|
||||
}
|
||||
}
|
||||
if(hasError){
|
||||
return {code:0,msg:hasError};
|
||||
}
|
||||
let pingtaiOrder2 = {};
|
||||
for(let key in pingtaiOrder){
|
||||
let filters = [
|
||||
{
|
||||
TableAlias:"o",
|
||||
FieldType:"string",
|
||||
TableName:"LogicOrder",
|
||||
Name:"PlatformOrderId",
|
||||
Value:pingtaiOrder[key].join(","),
|
||||
Contract:"in",
|
||||
CustomQuery:"PlatformOrderIdSearch"
|
||||
},
|
||||
];
|
||||
let MultiFilters = [];
|
||||
let pageSize =500;
|
||||
let pageIndex = 1;
|
||||
const orders_list = await this.NewOrderList1(key,filters,MultiFilters,pageSize,pageIndex);
|
||||
const rows = orders_list.rows;
|
||||
let TemplateList = await this.LoadTemplateListInOrderList(key);
|
||||
let TemplateLists = [];
|
||||
for(let i=0;i<TemplateList.Data.length;i++){
|
||||
if(TemplateList.Data[i].TemplateName.indexOf(expressName)>-1){
|
||||
TemplateLists.push(TemplateList.Data[i]);
|
||||
}
|
||||
}
|
||||
if(expressName=="京东快递"){
|
||||
console.log("TemplateLists",TemplateLists);
|
||||
}
|
||||
if(TemplateLists.length==0){
|
||||
hasError = `快递${expressName}在店管家中无对应的模板,如果有,可以更改店管家中自定义模板名称包含\"${expressName}\",再重试`;
|
||||
break;
|
||||
}
|
||||
let orderPls = {};
|
||||
for(let i = 0;i<rows.length;i++){
|
||||
let rr = rows[i];
|
||||
if(rr.PlatformType=="Alibaba"){
|
||||
if((rr.OrderTags.length>0 && rr.OrderTags[0].TagValue=="douyin") || rr.ExtField1=="douyin"){
|
||||
rr.PlatformType="TouTiao";
|
||||
}else if((rr.OrderTags.length>0 && rr.OrderTags[0].TagValue=="pinduoduo") || rr.ExtField1=="pinduoduo"){
|
||||
rr.PlatformType="Pinduoduo";
|
||||
}else if((rr.OrderTags.length>0 && rr.OrderTags[0].TagValue=="xiaohongshu") || rr.ExtField1=="xiaohongshu"){
|
||||
rr.PlatformType="XiaoHongShu";
|
||||
}else if((rr.OrderTags.length>0 && rr.OrderTags[0].TagValue=="kuaishou") || rr.ExtField1=="kuaishou"){
|
||||
rr.PlatformType="KuaiShou";
|
||||
}else if((rr.OrderTags.length>0 && rr.OrderTags[0].TagValue=="kuaishou") || rr.ExtField1=="kuaishou"){
|
||||
rr.PlatformType="KuaiShou";
|
||||
}else{
|
||||
rr.PlatformType="Taobao";
|
||||
}
|
||||
}else if(rr.PlatformType=="AlibabaC2M"){
|
||||
rr.PlatformType="Taobao";
|
||||
}
|
||||
if(rr.PlatformType=="Other_Heliang"){
|
||||
for(let ii = 0;ii<orders_arr.length;ii++){
|
||||
let r = orders_arr[ii];
|
||||
let order_item = r.split(",").filter(value => value !== null && value !== undefined && value !== '');
|
||||
console.log("order_item",order_item,pingtais_default_PlatformType,order_item[1]);
|
||||
if(order_item[0]==rr.PlatformOrderId){
|
||||
rr.PlatformType = pingtais_default_PlatformType[order_item[1]];
|
||||
}
|
||||
}
|
||||
}
|
||||
if(rr.PlatformType=="JingdongPurchase"){
|
||||
rr.PlatformType="Jingdong";
|
||||
}
|
||||
if(rr.PlatformType in orderPls){
|
||||
orderPls[rr.PlatformType].orders.push(rr);
|
||||
}else{
|
||||
orderPls[rr.PlatformType] = {orders:[rr],Template:[]}
|
||||
}
|
||||
}
|
||||
for(let PlatformType in orderPls){
|
||||
let rr = orderPls[PlatformType];
|
||||
let Template = null;
|
||||
for(let i=0;i<TemplateLists.length;i++){
|
||||
let TemplateList = TemplateLists[i];
|
||||
if(TemplateList.TemplateTypeShort==PlatformType){
|
||||
Template = TemplateList;
|
||||
orderPls[PlatformType].Template = TemplateList;
|
||||
}
|
||||
}
|
||||
if(!Template){
|
||||
hasError = `${PlatformType}在店管家中无对应的模板,请添加模板后再重试`;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(hasError){
|
||||
break;
|
||||
}
|
||||
pingtaiOrder2[key] = orderPls;
|
||||
}
|
||||
if(hasError){
|
||||
return {code:0,msg:hasError};
|
||||
}
|
||||
let list = [];
|
||||
for (let key in pingtaiOrder2) {
|
||||
let r = pingtaiOrder2[key];
|
||||
for (let key2 in r) {
|
||||
let orders_tmp = [];
|
||||
for(let index_order=0;index_order<r[key2].orders.length;index_order++){
|
||||
if(r[key2].orders[index_order].WaybillCodes.length>0){
|
||||
if(r[key2].orders[index_order].WaybillCodes[0].TemplateId!=r[key2].Template.Id){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
orders_tmp.push(r[key2].orders[index_order]);
|
||||
}
|
||||
let orders = await this.arrayChunk(orders_tmp, 10);
|
||||
await Promise.all(orders.map(async (order) => {
|
||||
let res = [];
|
||||
if (key2 === "Pinduoduo") {
|
||||
res = await this.ExpressPrint(key, order, r[key2].Template, true);
|
||||
} else {
|
||||
res = await this.ExpressPrint(key, order, r[key2].Template, false);
|
||||
}
|
||||
list.push({ Platform: key2, print_datas: res });
|
||||
}));
|
||||
}
|
||||
}
|
||||
for(let i=0;i<fin_list.length;i++){
|
||||
this.app.redis.get("post_order_cache").del(fin_list[i]);
|
||||
}
|
||||
this.app.redis.get("post_order_cache").set("output",JSON.stringify(list));
|
||||
return list;
|
||||
}
|
||||
async Print(order,expressName){
|
||||
console.log(order);
|
||||
const pingtais_default_PlatformType = {
|
||||
"1":"Taobao",
|
||||
"3":"JingdongPurchase",
|
||||
"4":"Pinduoduo",
|
||||
"5":"TouTiao",
|
||||
"6":"KuaiShou",
|
||||
"7":"WxVideo",
|
||||
"8":"XiaoHongShu"
|
||||
};
|
||||
const pingtais = {
|
||||
"1":"ali",
|
||||
"6":"ali",
|
||||
"8":"ali",
|
||||
"4":"pdd",
|
||||
"5":"dd",
|
||||
"7":"ali",
|
||||
"3":"jd"
|
||||
};
|
||||
let opingtai = null;
|
||||
let orders_arr = order.split("|").filter(value => value !== null && value !== undefined && value !== '');
|
||||
let pingtaiOrder = {};
|
||||
let hasError = null;
|
||||
let tmp_list = [];
|
||||
let fin_list = [];
|
||||
for(let i = 0;i<orders_arr.length;i++){
|
||||
let r = orders_arr[i];
|
||||
let order_item = r.split(",").filter(value => value !== null && value !== undefined && value !== '');
|
||||
let res = await this.app.redis.get("post_order_cache").get(order_item[0]);
|
||||
if(res){
|
||||
|
||||
console.log(res,"订单锁定,跳过");
|
||||
continue;
|
||||
}else{
|
||||
console.log("订单无锁");
|
||||
if(order_item){
|
||||
await this.app.redis.get("post_order_cache").set(order_item[0],1,'EX',600);
|
||||
fin_list.push(order_item[0]);
|
||||
}
|
||||
}
|
||||
if (!order_item.hasOwnProperty(1)) {
|
||||
hasError = `${r},orders入参错误,格式为外部订单编号,平台编号|外部订单编号,平台编号,传入的值为${order}`;
|
||||
break;
|
||||
}
|
||||
let pingtai = (order_item[1] in pingtais)?pingtais[order_item[1]]:null;
|
||||
if(order_item.hasOwnProperty(2) && order_item[2]=="1"){
|
||||
opingtai = pingtai;
|
||||
pingtai = "ali";
|
||||
}
|
||||
if(!pingtai){
|
||||
hasError = `${order_item[1]}在程序中pingtais无对应键值`;
|
||||
break;
|
||||
}
|
||||
if(pingtai in pingtaiOrder){
|
||||
pingtaiOrder[pingtai].push(order_item[0]);
|
||||
}else{
|
||||
pingtaiOrder[pingtai] = [order_item[0]];
|
||||
}
|
||||
}
|
||||
if(hasError){
|
||||
return {code:0,msg:hasError};
|
||||
}
|
||||
let pingtaiOrder2 = {};
|
||||
for(let key in pingtaiOrder){
|
||||
let filters = [
|
||||
{
|
||||
TableAlias:"o",
|
||||
FieldType:"string",
|
||||
TableName:"LogicOrder",
|
||||
Name:"PlatformOrderId",
|
||||
Value:pingtaiOrder[key].join(","),
|
||||
Contract:"in",
|
||||
CustomQuery:"PlatformOrderIdSearch"
|
||||
},
|
||||
];
|
||||
let MultiFilters = [];
|
||||
let pageSize =500;
|
||||
let pageIndex = 1;
|
||||
const orders_list = await this.NewOrderList1(key,filters,MultiFilters,pageSize,pageIndex);
|
||||
const rows = orders_list.rows;
|
||||
let TemplateList = await this.LoadTemplateListInOrderList(key);
|
||||
let TemplateLists = [];
|
||||
for(let i=0;i<TemplateList.Data.length;i++){
|
||||
if(TemplateList.Data[i].TemplateName.indexOf(expressName)>-1){
|
||||
TemplateLists.push(TemplateList.Data[i]);
|
||||
}
|
||||
}
|
||||
if(expressName=="京东快递"){
|
||||
console.log("TemplateLists",TemplateLists);
|
||||
}
|
||||
if(TemplateLists.length==0){
|
||||
hasError = `快递${expressName}在店管家中无对应的模板,如果有,可以更改店管家中自定义模板名称包含\"${expressName}\",再重试`;
|
||||
break;
|
||||
}
|
||||
let orderPls = {};
|
||||
for(let i = 0;i<rows.length;i++){
|
||||
let rr = rows[i];
|
||||
if(rr.PlatformType=="Alibaba"){
|
||||
if((rr.OrderTags.length>0 && rr.OrderTags[0].TagValue=="douyin") || rr.ExtField1=="douyin"){
|
||||
rr.PlatformType="TouTiao";
|
||||
}else if((rr.OrderTags.length>0 && rr.OrderTags[0].TagValue=="pinduoduo") || rr.ExtField1=="pinduoduo"){
|
||||
rr.PlatformType="Pinduoduo";
|
||||
}else if((rr.OrderTags.length>0 && rr.OrderTags[0].TagValue=="xiaohongshu") || rr.ExtField1=="xiaohongshu"){
|
||||
rr.PlatformType="XiaoHongShu";
|
||||
}else if((rr.OrderTags.length>0 && rr.OrderTags[0].TagValue=="kuaishou") || rr.ExtField1=="kuaishou"){
|
||||
rr.PlatformType="KuaiShou";
|
||||
}else if((rr.OrderTags.length>0 && rr.OrderTags[0].TagValue=="kuaishou") || rr.ExtField1=="kuaishou"){
|
||||
rr.PlatformType="KuaiShou";
|
||||
}else{
|
||||
rr.PlatformType="Taobao";
|
||||
}
|
||||
}else if(rr.PlatformType=="AlibabaC2M"){
|
||||
rr.PlatformType="Taobao";
|
||||
}
|
||||
if(rr.PlatformType=="Other_Heliang"){
|
||||
for(let ii = 0;ii<orders_arr.length;ii++){
|
||||
let r = orders_arr[ii];
|
||||
let order_item = r.split(",").filter(value => value !== null && value !== undefined && value !== '');
|
||||
console.log("order_item",order_item,pingtais_default_PlatformType,order_item[1]);
|
||||
if(order_item[0]==rr.PlatformOrderId){
|
||||
rr.PlatformType = pingtais_default_PlatformType[order_item[1]];
|
||||
}
|
||||
}
|
||||
}
|
||||
if(rr.PlatformType=="JingdongPurchase"){
|
||||
rr.PlatformType="Jingdong";
|
||||
}
|
||||
if(rr.PlatformType in orderPls){
|
||||
orderPls[rr.PlatformType].orders.push(rr);
|
||||
}else{
|
||||
orderPls[rr.PlatformType] = {orders:[rr],Template:[]}
|
||||
}
|
||||
}
|
||||
for(let PlatformType in orderPls){
|
||||
let rr = orderPls[PlatformType];
|
||||
let Template = null;
|
||||
for(let i=0;i<TemplateLists.length;i++){
|
||||
let TemplateList = TemplateLists[i];
|
||||
if(TemplateList.TemplateTypeShort==PlatformType){
|
||||
Template = TemplateList;
|
||||
orderPls[PlatformType].Template = TemplateList;
|
||||
}
|
||||
}
|
||||
if(!Template){
|
||||
hasError = `${PlatformType}在店管家中无对应的模板,请添加模板后再重试`;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(hasError){
|
||||
break;
|
||||
}
|
||||
pingtaiOrder2[key] = orderPls;
|
||||
}
|
||||
if(hasError){
|
||||
return {code:0,msg:hasError};
|
||||
}
|
||||
let list = [];
|
||||
for (let key in pingtaiOrder2) {
|
||||
let r = pingtaiOrder2[key];
|
||||
for (let key2 in r) {
|
||||
let orders_tmp = [];
|
||||
for(let index_order=0;index_order<r[key2].orders.length;index_order++){
|
||||
if(r[key2].orders[index_order].WaybillCodes.length>0){
|
||||
if(r[key2].orders[index_order].WaybillCodes[0].TemplateId!=r[key2].Template.Id){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
orders_tmp.push(r[key2].orders[index_order]);
|
||||
}
|
||||
let orders = await this.arrayChunk(orders_tmp, 10);
|
||||
await Promise.all(orders.map(async (order) => {
|
||||
let res = [];
|
||||
if (key2 === "Pinduoduo") {
|
||||
res = await this.ExpressPrint(key, order, r[key2].Template, true);
|
||||
} else {
|
||||
res = await this.ExpressPrint(key, order, r[key2].Template, false);
|
||||
}
|
||||
list.push({ Platform: key2, print_datas: res });
|
||||
}));
|
||||
}
|
||||
}
|
||||
for(let i=0;i<fin_list.length;i++){
|
||||
this.app.redis.get("post_order_cache").del(fin_list[i]);
|
||||
}
|
||||
this.app.redis.get("post_order_cache").set("output",JSON.stringify(list));
|
||||
return list;
|
||||
}
|
||||
async arrayChunk(array,size){
|
||||
return Array.from({ length: Math.ceil(array.length / size) }, (_, index) =>
|
||||
array.slice(index * size, index * size + size)
|
||||
);
|
||||
}
|
||||
async NewOrderList1(pingtai,filters,MultiFilters,pageSize,pageIndex){
|
||||
let parmas = {
|
||||
pingtai:pingtai,
|
||||
filters:filters,
|
||||
MultiFilters:MultiFilters,
|
||||
pageSize:pageSize,
|
||||
pageIndex:pageIndex
|
||||
};
|
||||
const apiUrl = 'https://ye4s.wms.gztbyc.com/index/wms/Dianguanjia/NewOrderListout';
|
||||
try {
|
||||
const response = await axios.post(apiUrl, parmas);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.log("error",error);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
async LoadTemplateListInOrderList(pingtai){
|
||||
let parmas = {
|
||||
pingtai:pingtai
|
||||
};
|
||||
const apiUrl = 'https://ye4s.wms.gztbyc.com/index/wms/Dianguanjia/LoadTemplateListInOrderListout';
|
||||
try {
|
||||
const response = await axios.post(apiUrl, parmas);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.log("error",error);
|
||||
return error;
|
||||
}
|
||||
}
|
||||
async ExpressPrint(pingtai,orders,Template,isPdd=false){
|
||||
let parmas = {
|
||||
pingtai:pingtai,
|
||||
orderList:orders,
|
||||
Template:Template,
|
||||
ispdd:isPdd
|
||||
};
|
||||
const apiUrl = 'https://ye4s.wms.gztbyc.com/index/wms/Dianguanjia/ExpressPrintout';
|
||||
try {
|
||||
const response = await axios.post(apiUrl, parmas);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.log("error",error);
|
||||
return error;
|
||||
}
|
||||
}
|
||||
async CreateOrder(orders){
|
||||
let faileCount = 0;
|
||||
await Promise.all(orders.map(async (order) => {
|
||||
let res = await this.query_createOrder(order);
|
||||
if(!res){
|
||||
faileCount++;
|
||||
}
|
||||
}));
|
||||
return faileCount;
|
||||
}
|
||||
async query_createOrder(order_data){
|
||||
const apiUrl = 'https://ye4s.wms.gztbyc.com/index/wms/Dianguanjia/order_create';
|
||||
if(order_data.length<26){
|
||||
return false;
|
||||
}
|
||||
let parmas = {order:order_data};
|
||||
console.log(parmas);
|
||||
try {
|
||||
const response = await axios.post(apiUrl, parmas);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.log("error",error);
|
||||
return error;
|
||||
}
|
||||
}
|
||||
}
|
||||
module.exports = Dgj;
|
||||
51
app/service/express.js
Normal file
51
app/service/express.js
Normal file
@ -0,0 +1,51 @@
|
||||
const Service = require('egg').Service;
|
||||
const { v4: uuidv4 } = require('uuid');
|
||||
const axios = require('axios');
|
||||
|
||||
class Express extends Service {
|
||||
async aotoCheckLanshou(){
|
||||
let orders = await this.app.mysql.get('dbwms').query(`
|
||||
select POSTNUM,POSTCODE from yj_wmsorder where DISPLAYFLAG=0 and OPERATERECORDS not like "%揽收%" and WAREHOUSEID=5400 and POSTFLAG=1 and POSTCODE in ('p01','p02','p03','p04','p32');
|
||||
`);
|
||||
let pageSize = 200;
|
||||
let responses = [];
|
||||
let page_count = parseInt(orders.length / pageSize);
|
||||
const apiUrl = 'http://express.gztbyc.com/query_tasks2';
|
||||
for (let i = 0; i < page_count+1; i++) {
|
||||
const promises = orders.slice(i*pageSize, (i+1)*pageSize).map(async order => {
|
||||
try {
|
||||
/* code */
|
||||
let parmas = [`${order.POSTNUM}|${order.POSTNUM}|${order.POSTCODE}`];
|
||||
const response = await axios.post(apiUrl, parmas);
|
||||
if(response.data.length>0){
|
||||
responses.push(response.data[0].waybillNo);
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
})
|
||||
await Promise.all(promises);
|
||||
}
|
||||
let postnums = responses.map(item=>{
|
||||
return `'${item}'`;
|
||||
})
|
||||
postnums = postnums.join(",")
|
||||
const currentTime =await this.getCurrentChinaTime();
|
||||
let sql = `UPDATE yj_wmsorder SET OPERATERECORDS = CONCAT(OPERATERECORDS, '检测到揽收;${currentTime};自动任务|') WHERE POSTNUM IN (${postnums})`;
|
||||
const result = await this.app.mysql.get('dbwms').query(sql);
|
||||
return [result,postnums];
|
||||
}
|
||||
async getCurrentChinaTime() {
|
||||
const now = new Date();
|
||||
|
||||
const year = now.getFullYear();
|
||||
const month = String(now.getMonth() + 1).padStart(2, '0'); // 补零
|
||||
const day = String(now.getDate()).padStart(2, '0'); // 补零
|
||||
const hours = String(now.getHours()).padStart(2, '0'); // 补零
|
||||
const minutes = String(now.getMinutes()).padStart(2, '0'); // 补零
|
||||
const seconds = String(now.getSeconds()).padStart(2, '0'); // 补零
|
||||
|
||||
return `${year}年${month}月${day}日 ${hours}:${minutes}:${seconds}`;
|
||||
}
|
||||
}
|
||||
module.exports = Express;
|
||||
507
app/service/gzt.js
Normal file
507
app/service/gzt.js
Normal file
@ -0,0 +1,507 @@
|
||||
const Service = require('egg').Service;
|
||||
const { v4: uuidv4 } = require('uuid');
|
||||
const axios = require('axios');
|
||||
const fs = require('fs');
|
||||
class Gzt extends Service {
|
||||
async index(){
|
||||
let task = await this.app.mysql.get('dblocal').query(`select * from ye4s_warehouse`);
|
||||
return task;
|
||||
}
|
||||
async getBindCode(sid){
|
||||
const {ctx} = this;
|
||||
let ssid = ctx.socket.id;
|
||||
if(sid){
|
||||
ssid = sid;
|
||||
}
|
||||
let code = uuidv4();
|
||||
this.app.redis.get("cache").set(`bindcode_${code}`,ssid,'EX',200);
|
||||
return `https://ye4s.wms.gztbyc.com/qrcode/build?text=${code}&label=&logo=0&labelalignment=center&foreground=%23000000&background=%23ffffff&size=300&padding=10&logosize=50&labelfontsize=14&errorcorrection=medium`;
|
||||
}
|
||||
async startRecording(gztid,grabnum){
|
||||
let apiUrl = "http://file2.gztbyc.com/startRecording";
|
||||
const params = new URLSearchParams();
|
||||
params.append('id', gztid);
|
||||
params.append('code', grabnum);
|
||||
try {
|
||||
const response = await axios.post(apiUrl, params, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
});
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
//console.log("error",error);
|
||||
return error;
|
||||
}
|
||||
}
|
||||
async getBindInfo(code){
|
||||
const {ctx} = this;
|
||||
const sid = ctx.socket.id;
|
||||
let results = {};
|
||||
let gzt = await this.getGztByCode(code);
|
||||
if(!gzt){
|
||||
return {};
|
||||
}
|
||||
await this.app.redis.get('cache').set(`gzt_${gzt.id}`,sid);
|
||||
gzt.user = await this.getUser(gzt.workers_ids);
|
||||
gzt.work = await this.getWork(gzt.work_id);
|
||||
if(gzt.user){
|
||||
this.todayCount(sid,gzt.user.id,gzt.wareHouseId);
|
||||
}
|
||||
this.scanLogger(sid,gzt.id,gzt.wareHouseId);
|
||||
return gzt;
|
||||
}
|
||||
async todayCount(sid,userid,WAREHOUSEID){
|
||||
if(!userid){
|
||||
return false;
|
||||
}
|
||||
let WAREHOUSE = await this.app.mysql.get('dblocal').get('ye4s_warehouse',{WAREHOUSEID:WAREHOUSEID});
|
||||
let workDate = WAREHOUSE.workDate;
|
||||
const counts = await this.app.mysql.get('dblocal').query(
|
||||
`select COALESCE(SUM(dabaos), 0) as orderCount,COALESCE(SUM(GOODSCOUNT), 0) as GOODSCOUNT from ye4s_workers_works where WAREHOUSEID=? and userId=? and workDate=?`,
|
||||
[WAREHOUSEID, userid, workDate]
|
||||
);
|
||||
const todayCountData = {
|
||||
orderCount:parseInt(counts[0].orderCount),
|
||||
GOODSCOUNT:parseInt(counts[0].GOODSCOUNT)
|
||||
}
|
||||
this._push(sid, 'todayCount', todayCountData);
|
||||
}
|
||||
async getMyWork(sid,userid,WAREHOUSEID){
|
||||
const lastOrder = await this.app.mysql.get('dblocal').get('ye4s_workers_works', {
|
||||
userId: userid,
|
||||
dabaos: 1,
|
||||
WAREHOUSEID:WAREHOUSEID
|
||||
}, {
|
||||
orders: [['createtime', 'desc']], // 按 createtime 降序排序
|
||||
limit: 1, // 限制只获取一行数据
|
||||
});
|
||||
let order = await this.app.mysql.get('dbwms').get(`yj_wmsorder`,{POSTNUM:lastOrder.POSTNUM});
|
||||
const pack = await this.app.mysql.get('dbwms').get(`yj_pack`,{ID:order.PACKID,WAREHOUSEID:WAREHOUSEID});
|
||||
order.PACKNAME = pack?pack.NAME:"";
|
||||
order.items = order.ITEMS.split("|").filter(item => item !== undefined && item !== null && item !== '').map(item=>{
|
||||
let tmp_item = item.split(",");
|
||||
return [tmp_item[2]+tmp_item[3],tmp_item[1]];
|
||||
});
|
||||
this._push(sid, 'order', order);
|
||||
}
|
||||
async scan2(barcode,gztid){
|
||||
await this.appendToFile(`${barcode},${gztid}`);
|
||||
return 1;
|
||||
}
|
||||
async appendToFile(contentToAppend) {
|
||||
const filePath = `app/public/scan_logs.txt`;
|
||||
|
||||
// 追加内容到文件
|
||||
fs.appendFile(filePath, contentToAppend+"\n", (err) => {
|
||||
if (err) {
|
||||
//console.error('Error appending to file:', err);
|
||||
return;
|
||||
}
|
||||
//console.log('Content was appended to file successfully.');
|
||||
});
|
||||
}
|
||||
async scan(barcode,gztid){
|
||||
const {ctx} = this;
|
||||
ctx.logger.info(`[scan] 开始处理 | barcode=${barcode} | gztid=${gztid}`);
|
||||
const sid = await this.app.redis.get('cache').get(`gzt_${gztid}`);
|
||||
const gzt = await this.getGztInfo(gztid);
|
||||
if(!gzt){
|
||||
ctx.logger.warn(`[scan] 工作台不存在 | gztid=${gztid}`);
|
||||
return 0;
|
||||
}
|
||||
ctx.logger.info(`[scan] 工作台信息 | gztid=${gztid} | WAREHOUSEID=${gzt.WAREHOUSEID} | userid=${gzt.userid} | wms_order_ids=${gzt.wms_order_ids}`);
|
||||
console.log("gzt",gzt);
|
||||
let logininfo = "";
|
||||
try {
|
||||
const tmp = JSON.parse(atob(barcode));
|
||||
if(tmp.uuid){
|
||||
ctx.logger.info(`[scan] 识别为工牌 | uuid=${tmp.uuid}`);
|
||||
const user = await this.getUserIdByUUid(barcode);
|
||||
//console.log(user);
|
||||
if(user){
|
||||
ctx.logger.info(`[scan] 工牌用户有效 | userId=${user.id} | 当前工作台用户=${gzt.userid}`);
|
||||
this.scanLogger(sid,gztid,5400,"工牌");
|
||||
if(gzt.userid==user.id){
|
||||
//登出
|
||||
this._push(sid, 'logout', user);
|
||||
//打包完成
|
||||
if(gzt.work_id){
|
||||
await this.app.mysql.get('dblocal').update("ye4s_workers_works",{updatetime:Math.round(new Date() / 1000)},{where:{id:gzt.work_id}});
|
||||
this.stopVideo(gzt);
|
||||
}
|
||||
// 登出时发送结束打包任务(通知外部WMS)
|
||||
await this._finishPack({
|
||||
workbench_id: gzt.other_id || gztid,
|
||||
warehouse_id: gzt.WAREHOUSEID,
|
||||
});
|
||||
await this.app.mysql.get('dblocal').update("ye4s_gzt",{workers_ids:null,work_id:null},{where:{id:gztid}});
|
||||
}else{
|
||||
//其他工作台登出
|
||||
const other_gzt = await this.app.mysql.get('dblocal').get("ye4s_gzt",{workers_ids:user.id.toString(),type:2});
|
||||
if(other_gzt){
|
||||
if(other_gzt.work_id){
|
||||
await this.app.mysql.get('dblocal').update("ye4s_workers_works",{updatetime:Math.round(new Date() / 1000)},{where:{id:other_gzt.work_id}});
|
||||
this.stopVideo(other_gzt);
|
||||
}
|
||||
await this.app.mysql.get('dblocal').update("ye4s_gzt",{workers_ids:null,work_id:null},{where:{id:other_gzt.id}});
|
||||
|
||||
const other_sid = await this.app.redis.get('cache').get(`gzt_${other_gzt.id}`);
|
||||
if(other_sid){
|
||||
this._push(other_sid, 'logout', user);
|
||||
}
|
||||
}
|
||||
//登入
|
||||
await this.app.mysql.get('dblocal').update("ye4s_gzt",{workers_ids:user.id},{where:{id:gztid}});
|
||||
//登入通知工作台
|
||||
if(sid){
|
||||
this._push(sid, 'login', user);
|
||||
}
|
||||
this.todayCount(sid,user.id,gzt.WAREHOUSEID);
|
||||
}
|
||||
}else{
|
||||
throw new Error("无用户");
|
||||
}
|
||||
}else{
|
||||
throw new Error("非工牌");
|
||||
}
|
||||
} catch (e) {
|
||||
ctx.logger.info(`[scan] 非工牌,进入订单/包材判断 | barcode=${barcode}`);
|
||||
// 非工牌,判断是包材还是订单
|
||||
const pack = await this.app.redis.get("cache").get(`pack_${barcode}`);
|
||||
if (pack) {
|
||||
ctx.logger.info(`[scan] 识别为包材 | barcode=${barcode} | wms_order_ids=${gzt.wms_order_ids}`);
|
||||
if (!gzt.wms_order_ids) {
|
||||
ctx.logger.info(`[scan] 包材-无打包订单,拒绝 | barcode=${barcode}`);
|
||||
this._push(sid, 'msg', '当前无打包订单,不需要扫描包材');
|
||||
} else {
|
||||
ctx.logger.info(`[scan] 包材-绑定打包 | barcode=${barcode}`);
|
||||
this.bindPack();
|
||||
}
|
||||
} else {
|
||||
ctx.logger.info(`[scan] 非包材,查询订单 | barcode=${barcode} | WAREHOUSEID=${gzt.WAREHOUSEID}`);
|
||||
// 尝试本地订单 → 外部WMS → 无记录
|
||||
let order = await this.getOrderInfo(barcode.replace(/-1-1-/g, ''), gzt.WAREHOUSEID);
|
||||
let isWmsOrder = false;
|
||||
if (!order) {
|
||||
ctx.logger.info(`[scan] 本地订单未找到,查询外部WMS | barcode=${barcode}`);
|
||||
const wmsResult = await this.ctx.service.newWms.queryOrder(barcode, gzt.WAREHOUSEID);
|
||||
if (wmsResult && wmsResult.success) {
|
||||
ctx.logger.info(`[scan] 外部WMS订单命中 | barcode=${barcode}`);
|
||||
order = wmsResult.data;
|
||||
isWmsOrder = true;
|
||||
} else {
|
||||
ctx.logger.info(`[scan] 外部WMS也未找到 | barcode=${barcode}`);
|
||||
}
|
||||
} else {
|
||||
ctx.logger.info(`[scan] 本地订单命中 | barcode=${barcode} | PLSENDFLAG=${order.PLSENDFLAG}`);
|
||||
}
|
||||
|
||||
if (order) {
|
||||
if (!gzt.userid) {
|
||||
ctx.logger.info(`[scan] 订单-未登录,拒绝打包 | barcode=${barcode}`);
|
||||
this._push(sid, 'msg', '请先扫描工号登陆');
|
||||
} else if (isWmsOrder) {
|
||||
ctx.logger.info(`[scan] 订单-外部WMS打包 | barcode=${barcode}`);
|
||||
// 外部WMS订单:回传打包状态到外部
|
||||
await this._packWmsOrder(gzt, order, sid);
|
||||
} else if (order.PLSENDFLAG === 0) {
|
||||
ctx.logger.info(`[scan] 订单-未复核,拒绝打包 | barcode=${barcode} | PLSENDFLAG=${order.PLSENDFLAG}`);
|
||||
this._push(sid, 'msg', '订单未复核');
|
||||
} else {
|
||||
ctx.logger.info(`[scan] 订单-本地打包 | barcode=${barcode} | grabnum=${order.grabnum}`);
|
||||
await this._packOrder(gzt, order, sid);
|
||||
}
|
||||
} else {
|
||||
ctx.logger.info(`[scan] 无记录 | barcode=${barcode}`);
|
||||
this._push(sid, 'msg', '无记录');
|
||||
}
|
||||
}
|
||||
this.scanLogger(sid, gztid, 5400, barcode);
|
||||
ctx.logger.info(`[scan] 处理完成 | barcode=${barcode}`);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
// 本地订单打包处理
|
||||
async _packOrder(gzt, order, sid) {
|
||||
const { ctx } = this;
|
||||
|
||||
// 当前订单非外部仓库时,检测上一个订单是否是外部WMS订单,如果是则发送结束任务
|
||||
if (order.types !== 4) {
|
||||
const lastTask = await this.app.mysql.get('dblocal').query(
|
||||
`select id from ye4s_workers_works
|
||||
where gztid=? and WAREHOUSEID=? and types=4 and dabaos>0
|
||||
order by id desc limit 1`,
|
||||
[gzt.gztid, gzt.WAREHOUSEID]
|
||||
);
|
||||
if (lastTask && lastTask.length > 0) {
|
||||
ctx.logger.info(`[_packOrder] 检测到上一个订单为外部WMS,发送结束任务 | gztid=${gzt.gztid} | other_id=${gzt.other_id}`);
|
||||
await this._finishPack({
|
||||
workbench_id: gzt.other_id || gzt.gztid,
|
||||
warehouse_id: gzt.WAREHOUSEID,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const lastTime = Math.round(new Date() / 1000) - 864000;
|
||||
const dupField = order.isSandan == 1 ? 'POSTNUM' : 'grabnum';
|
||||
const dupValue = order.isSandan == 1 ? order.POSTNUM : order.grabnum;
|
||||
const line = await this.app.mysql.get('dblocal').query(
|
||||
`select id from ye4s_workers_works where ${dupField}=? and dabaos>0 and createtime>?`,
|
||||
[dupValue, lastTime]
|
||||
);
|
||||
if (line.length > 0) {
|
||||
const Name = order.isSandan == 1 ? order.POSTNUM : order.grabnum;
|
||||
this._push(sid, 'msg', `${Name}已打包`);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
order.userId = gzt.userid;
|
||||
order.gztid = gzt.gztid;
|
||||
delete order.PLSENDFLAG;
|
||||
const row = await this.app.mysql.get('dblocal').insert("ye4s_workers_works", order);
|
||||
const packorder = await this.getWork(row.insertId);
|
||||
this._push(sid, 'order', packorder);
|
||||
if (sid) {
|
||||
this.todayCount(sid, gzt.userid, gzt.WAREHOUSEID);
|
||||
}
|
||||
const record_res = await this.startRecording(gzt.gztid, order.isSandan == 1 ? order.POSTNUM : order.grabnum);
|
||||
await this.app.mysql.get('dblocal').update("ye4s_workers_works", { updatetime: Math.round(new Date() / 1000) }, { where: { id: gzt.work_id } });
|
||||
await this.app.mysql.get('dblocal').update("ye4s_gzt", { work_id: row.insertId, info: JSON.stringify(record_res) }, { where: { id: gzt.gztid } });
|
||||
ctx.app.wsdl('addOperate', [gzt.WAREHOUSEID, order.isSandan == 1 ? order.POSTNUM : order.grabnum, gzt.wmsusername, `${gzt.user_real_name}/打包`]);
|
||||
} catch (e) {
|
||||
console.error("打包错误", e);
|
||||
}
|
||||
}
|
||||
|
||||
// 外部WMS订单打包处理(仅回传给外部WMS,不写入本地DB)
|
||||
async _packWmsOrder(gzt, order, sid) {
|
||||
const { ctx } = this;
|
||||
// 防重:Redis 标记 24h 内是否已回传
|
||||
const dupKey = `wms_pack_${order.POSTNUM}`;
|
||||
const dup = await this.app.redis.get('cache').get(dupKey);
|
||||
if (dup) {
|
||||
this._push(sid, 'msg', `${order.POSTNUM}已打包`);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
// 设置工作台ID,使用 gzt 表的 other_id
|
||||
order.gztid = gzt.other_id || '';
|
||||
// 回传给外部WMS
|
||||
const reportResult = await this.ctx.service.newWms.reportPackStatus(order);
|
||||
if (!reportResult || reportResult.flag !== 'success') {
|
||||
ctx.logger.warn(`[scan] 外部WMS回传失败 | POSTNUM=${order.POSTNUM} | result=`, reportResult);
|
||||
this._push(sid, 'msg', '外部WMS回传失败');
|
||||
return;
|
||||
}
|
||||
// Redis 标记防重(24h)
|
||||
await this.app.redis.get('cache').set(dupKey, '1', 'EX', 86400);
|
||||
// 推送前端
|
||||
this._push(sid, 'order', order);
|
||||
if (sid) {
|
||||
this.todayCount(sid, gzt.userid, gzt.WAREHOUSEID);
|
||||
}
|
||||
ctx.app.wsdl('addOperate', [gzt.WAREHOUSEID, order.grabnum, gzt.wmsusername, `${gzt.user_real_name}/打包`]);
|
||||
} catch (e) {
|
||||
ctx.logger.error('[scan] WMS打包错误:', e);
|
||||
console.error("WMS打包错误", e);
|
||||
}
|
||||
}
|
||||
|
||||
// 结束打包任务:直接关闭该工作台最后一个未结束任务(不限订单)
|
||||
// 与 _packOrder 的差异:_packOrder 是在新任务到来时关闭其他订单的旧任务;
|
||||
// _finishPack 是直接关闭该工作台最后一个未结束任务
|
||||
async _finishPack({ workbench_id, warehouse_id }) {
|
||||
const { ctx } = this;
|
||||
if (!workbench_id) {
|
||||
ctx.logger.warn('[_finishPack] workbench_id 不能为空');
|
||||
return { finished: false, message: 'workbench_id 不能为空' };
|
||||
}
|
||||
if (!warehouse_id) {
|
||||
ctx.logger.warn('[_finishPack] warehouse_id 不能为空');
|
||||
return { finished: false, message: 'warehouse_id 不能为空' };
|
||||
}
|
||||
|
||||
// 查询该工作台下最新的打包任务(不限订单类型,不限是否WMS)
|
||||
const lastTask = await this.app.mysql.get('dblocal').query(
|
||||
`select id, grabnum, wms_order_ids, POSTNUM, createtime, types, dabaos from ye4s_workers_works
|
||||
where gztid=? and WAREHOUSEID=? and dabaos>0
|
||||
order by id desc limit 1`,
|
||||
[workbench_id, warehouse_id]
|
||||
);
|
||||
|
||||
const end_time = Math.round(new Date() / 1000);
|
||||
|
||||
// 始终通知外部WMS结束打包任务(即使本地无记录,外部WMS可能有自己的任务追踪)
|
||||
try {
|
||||
const wmsResult = await ctx.service.newWms.finishPack({
|
||||
workbench_id,
|
||||
warehouse_id,
|
||||
});
|
||||
ctx.logger.info(`[_finishPack] 外部WMS结束任务返回:`, JSON.stringify(wmsResult));
|
||||
} catch (e) {
|
||||
ctx.logger.error('[_finishPack] 调用外部WMS结束任务异常:', e.message);
|
||||
}
|
||||
|
||||
if (!lastTask || lastTask.length === 0) {
|
||||
ctx.logger.info(`[_finishPack] 本地无未结束的打包任务 | workbench_id=${workbench_id}`);
|
||||
return { finished: false, message: '无未结束的打包任务' };
|
||||
}
|
||||
|
||||
const task = lastTask[0];
|
||||
ctx.logger.info(`[_finishPack] 结束本地打包任务 | task_id=${task.id} | POSTNUM=${task.POSTNUM} | types=${task.types} | workbench_id=${workbench_id}`);
|
||||
|
||||
return {
|
||||
finished: true,
|
||||
task_id: task.id,
|
||||
order_id: task.wms_order_ids || task.POSTNUM,
|
||||
end_time,
|
||||
};
|
||||
}
|
||||
|
||||
async bindPack(){
|
||||
|
||||
}
|
||||
async startOrder(sid,gzt,WAREHOUSEID,orders){
|
||||
//开始打包
|
||||
//记录数据库
|
||||
//开启打包视频
|
||||
//推送信息到前端
|
||||
}
|
||||
async stopVideo(gzt){
|
||||
//结束打包视频
|
||||
}
|
||||
async getUser(userId){
|
||||
if(!userId){
|
||||
return {};
|
||||
}
|
||||
let user_results = await this.app.mysql.get('dblocal').select(`ye4s_user`,{where:{id:userId},columns:['id','wms_userid','real_name']});
|
||||
return user_results?user_results[0]:{};
|
||||
}
|
||||
async getWork(work_id){
|
||||
if(!work_id){
|
||||
return {};
|
||||
}
|
||||
const work = await this.app.mysql.get("dblocal").select("ye4s_workers_works",{where:{id:work_id},columns:['grabnum','POSTNUM','items','dabaos','wms_order_ids','PACKNAME','GOODSCOUNT'],limit:1});
|
||||
let work_tmp = work.length>0?work[0]:{};
|
||||
if(work_tmp.items){
|
||||
work_tmp.items = work_tmp.items.split("|").filter(item1 => item1.trim()).map(item=>{
|
||||
return item.split(",");
|
||||
});
|
||||
}
|
||||
return work_tmp;
|
||||
}
|
||||
async getOrderInfo(postNumer,WAREHOUSEID){
|
||||
let datas = await this.app.redis.get("post_order_cache").get(`order:${WAREHOUSEID}:${postNumer}`);
|
||||
if(!datas){
|
||||
datas = await this.getOrderInfoBySql(postNumer,WAREHOUSEID);
|
||||
let datas_tmp = JSON.stringify(datas);
|
||||
await this.app.redis.get("post_order_cache").set(`order:${WAREHOUSEID}:${postNumer}`,datas_tmp,'EX',60*60*6);
|
||||
}else{
|
||||
datas = JSON.parse(datas);
|
||||
}
|
||||
return datas;
|
||||
}
|
||||
async getOrderInfoBySql(postNumer,WAREHOUSEID){
|
||||
const order_tmp = await this.app.mysql.get('dbwms').query(
|
||||
`select order1.ID as ID,GRABNUM,POSTNUM,pack.NAME as PACKNAME,PLSENDFLAG,ITEMS from yj_wmsorder order1 left join yj_pack pack on pack.ID=order1.PACKID where order1.POSTNUM=? and order1.WAREHOUSEID=?`,
|
||||
[postNumer, WAREHOUSEID]
|
||||
);
|
||||
const order = order_tmp?order_tmp[0]:null;
|
||||
if(!order){
|
||||
return null;
|
||||
}
|
||||
const WAREHOUSE = await this.app.mysql.get('dblocal').get('ye4s_warehouse',{WAREHOUSEID:WAREHOUSEID});
|
||||
const items_counts = order.ITEMS.split("|").map(item=>{
|
||||
let count = 0;
|
||||
try {
|
||||
count = parseInt(item.split(',')[1])?parseInt(item.split(',')[1]):0;
|
||||
} catch (e) {
|
||||
count = 0;
|
||||
}
|
||||
return count;
|
||||
})
|
||||
let item_count=0;
|
||||
items_counts.forEach(item=>{
|
||||
item_count+=item;
|
||||
})
|
||||
let datas = {
|
||||
dabaos:1,
|
||||
workDate:WAREHOUSE.workDate,
|
||||
userId:0,
|
||||
types:3,
|
||||
count:1,
|
||||
grabnum:order.GRABNUM,
|
||||
POSTNUM:postNumer,
|
||||
WAREHOUSEID:WAREHOUSEID,
|
||||
createtime:Math.round(new Date() / 1000),
|
||||
workers:'',
|
||||
GOODSCOUNT:item_count,
|
||||
items:order.ITEMS,
|
||||
orders:[order.POSTNUM].join(','),
|
||||
wms_order_ids:[order.ID].join(','),
|
||||
PACKNAME:order.PACKNAME,
|
||||
isSandan:1,
|
||||
PLSENDFLAG:order.PLSENDFLAG
|
||||
}
|
||||
if(order.GRABNUM.indexOf('B')>-1){
|
||||
//团购
|
||||
const orders = await this.app.mysql.get('dbwms').select("yj_wmsorder",{where:{GRABNUM:order.GRABNUM}});
|
||||
datas.dabaos = orders.length;
|
||||
datas.count = orders.length;
|
||||
datas.orders = orders.map(item=>{
|
||||
return item.POSTNUM;
|
||||
}).join(',');
|
||||
datas.wms_order_ids = orders.map(item=>{
|
||||
return item.ID;
|
||||
}).join(',');
|
||||
datas.GOODSCOUNT *= orders.length;
|
||||
datas.isSandan = 0;
|
||||
return datas;
|
||||
}else{
|
||||
//散单
|
||||
return datas;
|
||||
}
|
||||
}
|
||||
async getGztByCode(tmp_code){
|
||||
const results = await this.app.mysql.get('dblocal').select(`ye4s_gzt`,{where:{tmp_code:tmp_code},columns:['name','workers_ids','id','wareHouseId','work_id','sandanType','other_id'],limit:1});
|
||||
return results?results[0]:null;
|
||||
}
|
||||
async getGztInfo(gztid){
|
||||
const gzt = await this.app.mysql.get('dblocal').query(
|
||||
`select gzt.wareHouseId as WAREHOUSEID,gzt.name as name,gzt.username as wmsusername,gzt.sandanType as sandanType,gzt.id as gztid,gzt.other_id as other_id,works.grabnum as grabnum,works.POSTNUM,works.items,works.dabaos,works.wms_order_ids,user.id as userid,user.real_name as user_real_name,gzt.work_id as work_id from ye4s_gzt gzt left join ye4s_workers_works works on works.id=gzt.work_id left join ye4s_user user on user.id=gzt.workers_ids where gzt.id=?`,
|
||||
[gztid]
|
||||
);
|
||||
return gzt?gzt[0]:null;
|
||||
}
|
||||
async getUserIdByUUid(uuid){
|
||||
const user = await this.app.mysql.get('dblocal').get("ye4s_user",{tmp_code:uuid});
|
||||
return user?user:null;
|
||||
}
|
||||
async scanLogger(sid,gzt_id,WAREHOUSEID,code=null){
|
||||
if(code){
|
||||
await this.app.mysql.get('dblocal').insert('ye4s_scan_logger',{code:code,gztid:gzt_id,createTime:Math.round(new Date() / 1000),WAREHOUSEID:WAREHOUSEID});
|
||||
}
|
||||
const lastOrder = await this.app.mysql.get('dblocal').select('ye4s_scan_logger',{
|
||||
where:{
|
||||
gztid: gzt_id,
|
||||
WAREHOUSEID:WAREHOUSEID
|
||||
},
|
||||
columns:['code'],
|
||||
orders: [['createtime', 'desc']], // 按 createtime 降序排序
|
||||
limit: 10, // 限制只获取一行数据
|
||||
});
|
||||
this._push(sid, 'scanLogger', lastOrder);
|
||||
}
|
||||
async order(sid,userid,WAREHOUSEID){
|
||||
let msg = "扫描成功,开始打包";
|
||||
this._push(sid, 'order', { orders: order, msg: msg });
|
||||
}
|
||||
|
||||
// ========== IO 推送 ==========
|
||||
_push(sid, method, data) {
|
||||
if (!sid) return;
|
||||
this.app.io.to(sid).emit('genericResponse', { method, data });
|
||||
}
|
||||
}
|
||||
module.exports = Gzt;
|
||||
22
app/service/home.js
Normal file
22
app/service/home.js
Normal file
@ -0,0 +1,22 @@
|
||||
const Service = require('egg').Service;
|
||||
|
||||
class Home extends Service {
|
||||
async index(){
|
||||
let task = await this.app.mysql.get('dblocal').query(`select * from ye4s_warehouse`);
|
||||
return task;
|
||||
}
|
||||
async getUserinfo(){
|
||||
const {ctx} = this;
|
||||
let task = await ctx.app.wsdl('getPDAUser',['caige01', 'wu123456']);
|
||||
let data = JSON.parse(task.return);
|
||||
data.push(ctx.state.user);
|
||||
data.push(ctx.state.wmsuser);
|
||||
let rules = ctx.state.rules;
|
||||
console.log(rules);
|
||||
return data;
|
||||
}
|
||||
async exportWmsMonthOrderFile(){
|
||||
let task = await this.app.mysql.get('dbwms').query(`select * from ye4s_warehouse`);
|
||||
}
|
||||
}
|
||||
module.exports = Home;
|
||||
160
app/service/new_wms.js
Normal file
160
app/service/new_wms.js
Normal file
@ -0,0 +1,160 @@
|
||||
const Service = require('egg').Service;
|
||||
const axios = require('axios');
|
||||
|
||||
// ========== 配置常量 ==========
|
||||
const CONFIG = {
|
||||
// 外部 WMS API 地址
|
||||
API: {
|
||||
uri: 'http://127.0.0.1:6060/system', // WMS API
|
||||
method: 'workbench.business', // query 参数: 业务模块
|
||||
version: '1.0', // query 参数: 版本号
|
||||
warehouseId: '1000028', // 仓库ID 常量
|
||||
},
|
||||
// 请求配置
|
||||
REQUEST: {
|
||||
TIMEOUT: 5000,
|
||||
HEADERS: {
|
||||
'Content-Type': 'application/json',
|
||||
'platform': 'web',
|
||||
'project': 'all',
|
||||
},
|
||||
},
|
||||
// 订单类型标识
|
||||
ORDER_TYPE: 4, // 4 = 外部WMS订单
|
||||
// 打包状态值
|
||||
PACK_STATUS: 'packed',
|
||||
};
|
||||
|
||||
class NewWms extends Service {
|
||||
|
||||
// ========== 扫码查单 ==========
|
||||
async queryOrder(barcode, WAREHOUSEID) {
|
||||
try {
|
||||
// 外部WMS固定使用配置的仓库ID,忽略内部传入的WAREHOUSEID
|
||||
const warehouseId = CONFIG.API.warehouseId;
|
||||
const params = {
|
||||
method: CONFIG.API.method,
|
||||
v: CONFIG.API.version,
|
||||
timestamp: Math.round(Date.now() / 1000),
|
||||
};
|
||||
const response = await axios.post(CONFIG.API.uri, {
|
||||
name: 'queryOrder',
|
||||
data: { barcode, warehouseId },
|
||||
}, {
|
||||
params,
|
||||
headers: CONFIG.REQUEST.HEADERS,
|
||||
timeout: CONFIG.REQUEST.TIMEOUT,
|
||||
});
|
||||
const result = response.data;
|
||||
// WMS 返回 { flag, code, message, order, express, barcode, batch, ... }
|
||||
this.ctx.logger.info(`[new_wms] WMS查单原始返回 | barcode=${barcode} | result=`, JSON.stringify(result));
|
||||
if (result && result.flag === 'success' && result.order) {
|
||||
return { success: true, data: this._formatOrder(result, warehouseId, barcode) };
|
||||
}
|
||||
return { success: false, message: result?.message || 'WMS 返回异常', wmsResult: result };
|
||||
} catch (err) {
|
||||
this.ctx.logger.error('[new_wms] 查单失败:', err.message);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// ========== 回传打包状态 ==========
|
||||
async reportPackStatus(orderData) {
|
||||
try {
|
||||
const params = {
|
||||
method: CONFIG.API.method,
|
||||
v: CONFIG.API.version,
|
||||
timestamp: Math.round(Date.now() / 1000),
|
||||
};
|
||||
const postData = {
|
||||
name: 'packOrder',
|
||||
data: {
|
||||
delivery_order_code: orderData._wms_delivery_order_code || orderData.POSTNUM,
|
||||
wave_no: orderData.grabnum,
|
||||
warehouse_id: orderData.WAREHOUSEID,
|
||||
order_id: orderData.wms_order_ids || '',
|
||||
workbench_id: orderData.gztid || '',
|
||||
is_sandan: orderData.isSandan || 0,
|
||||
wave_total_orders: orderData.wave_total_orders || orderData.dabaos || 0,
|
||||
package_material_name: orderData.PACKNAME || '',
|
||||
status: CONFIG.PACK_STATUS,
|
||||
pack_time: Math.round(Date.now() / 1000),
|
||||
},
|
||||
};
|
||||
this.ctx.logger.info('[new_wms] reportPackStatus 传参:', JSON.stringify(postData));
|
||||
const response = await axios.post(CONFIG.API.uri, postData, {
|
||||
params,
|
||||
headers: CONFIG.REQUEST.HEADERS,
|
||||
timeout: CONFIG.REQUEST.TIMEOUT,
|
||||
});
|
||||
return response.data;
|
||||
} catch (err) {
|
||||
this.ctx.logger.error('[new_wms] 回传打包状态失败:', err.message);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// ========== 结束打包任务 ==========
|
||||
async finishPack({ workbench_id, warehouse_id }) {
|
||||
try {
|
||||
// 外部WMS固定使用配置的仓库ID,忽略内部传入的WAREHOUSEID
|
||||
const whId = CONFIG.API.warehouseId;
|
||||
const params = {
|
||||
method: CONFIG.API.method,
|
||||
v: CONFIG.API.version,
|
||||
timestamp: Math.round(Date.now() / 1000),
|
||||
};
|
||||
const postData = {
|
||||
name: 'finishPack',
|
||||
data: {
|
||||
workbench_id,
|
||||
warehouse_id: whId,
|
||||
finish_time: Math.round(Date.now() / 1000),
|
||||
},
|
||||
};
|
||||
this.ctx.logger.info('[new_wms] finishPack 传参:', JSON.stringify(postData));
|
||||
const response = await axios.post(CONFIG.API.uri, postData, {
|
||||
params,
|
||||
headers: CONFIG.REQUEST.HEADERS,
|
||||
timeout: CONFIG.REQUEST.TIMEOUT,
|
||||
});
|
||||
return response.data;
|
||||
} catch (err) {
|
||||
this.ctx.logger.error('[new_wms] 结束打包任务失败:', err.message);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// ========== 内部:订单数据格式化为系统统一格式 ==========
|
||||
_formatOrder(wmsResult, WAREHOUSEID, barcode) {
|
||||
const order = wmsResult.order || {};
|
||||
// items 在 WMS 返回的顶层,不在 order 内
|
||||
const wmsItems = wmsResult.items || [];
|
||||
const formattedItems = wmsItems.map(item => [
|
||||
item.item_code || '',
|
||||
item.item_name || '',
|
||||
String(item.plan_qty || 1)
|
||||
]);
|
||||
return {
|
||||
dabaos: 1,
|
||||
workDate: new Date().toISOString().slice(0, 10).replace(/-/g, ''),
|
||||
userId: 0,
|
||||
types: CONFIG.ORDER_TYPE,
|
||||
count: order.items_count || 1,
|
||||
grabnum: order.wave_no || '',
|
||||
POSTNUM: wmsResult.barcode || barcode,
|
||||
WAREHOUSEID: order.warehouse_id || WAREHOUSEID,
|
||||
createtime: Math.round(new Date() / 1000),
|
||||
workers: '',
|
||||
GOODSCOUNT: order.items_total || order.items_count || 1,
|
||||
items: formattedItems,
|
||||
orders: order.delivery_order_code || '',
|
||||
wms_order_ids: order.id || '',
|
||||
PACKNAME: wmsResult.express?.package_material_name || '',
|
||||
isSandan: wmsResult.isSandan || 0,
|
||||
_wms_delivery_order_code: order.delivery_order_code || '',
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = NewWms;
|
||||
246
app/service/query.js
Normal file
246
app/service/query.js
Normal file
@ -0,0 +1,246 @@
|
||||
const Service = require('egg').Service;
|
||||
class Query extends Service {
|
||||
async gettime(dateString){
|
||||
var regex = /(\d{4})年(\d{1,2})月(\d{1,2})日 (\d{1,2}):(\d{1,2}):(\d{1,2})/;
|
||||
var match = dateString.match(regex);
|
||||
var year = parseInt(match[1]);
|
||||
var month = parseInt(match[2]) - 1; // 月份从0开始计算,所以要减1
|
||||
var day = parseInt(match[3]);
|
||||
var hour = parseInt(match[4]);
|
||||
var minute = parseInt(match[5]);
|
||||
var second = parseInt(match[6]);
|
||||
|
||||
var timestamp = new Date(year, month, day, hour, minute, second).getTime();
|
||||
return timestamp;
|
||||
}
|
||||
async jhList(wareHouseId){
|
||||
let results = await this.app.mysql.get('dbwms').query(`select OPERATERECORDS,sum(GOODSCOUNT) as GOODSCOUNT,count(*) as ordercount,GRABNUM FROM yj_wmsorder where PICKINGFLAG = 3 and FLAG=0 and DISPLAYFLAG=0 and WAREHOUSEID=${wareHouseId} and GRABNUM like '%B%' group by GRABNUM` );
|
||||
let list = [];
|
||||
for(var ii=0;ii<results.length;ii++){
|
||||
const item = results[ii];
|
||||
let tmp = item.OPERATERECORDS.split("|");
|
||||
results[ii].time = -1;
|
||||
delete results[ii].OPERATERECORDS;
|
||||
tmp = tmp.filter(value => value !== null && value !== undefined && value !== '');
|
||||
for(var i=0;i<tmp.length;i++){
|
||||
const item2 = tmp[i].split(";");
|
||||
if(item2 && item2[0].indexOf('拣货')>-1){
|
||||
results[ii].username = item2[2];
|
||||
results[ii].time = await this.gettime(item2[1]);
|
||||
}
|
||||
}
|
||||
if(results[ii].username){
|
||||
list.push(results[ii]);
|
||||
}
|
||||
}
|
||||
const jhList = list.sort((a,b)=>{
|
||||
return b.time-a.time;
|
||||
})
|
||||
return jhList.slice(0,5);
|
||||
}
|
||||
async fhList(wareHouseId){
|
||||
let results = await this.app.mysql.get('dbwms').query(`select OPERATERECORDS,sum(GOODSCOUNT) as GOODSCOUNT,count(*) as ordercount,GRABNUM FROM yj_wmsorder where PLSENDFLAG = 1 and FLAG=0 and DISPLAYFLAG=0 and WAREHOUSEID=${wareHouseId} and GRABNUM like '%B%' group by GRABNUM` );
|
||||
let list = [];
|
||||
for(var ii=0;ii<results.length;ii++){
|
||||
const item = results[ii];
|
||||
const tmp = item.OPERATERECORDS.split("|");
|
||||
results[ii].time = -1;
|
||||
delete results[ii].OPERATERECORDS;
|
||||
for(var i=0;i<tmp.length;i++){
|
||||
const item2 = tmp[i].split(";");
|
||||
if(item2 && item2[0].indexOf('发货')>-1){
|
||||
results[ii].username = item2[2];
|
||||
results[ii].time = await this.gettime(item2[1]);
|
||||
}
|
||||
}
|
||||
if(results[ii].username){
|
||||
list.push(results[ii]);
|
||||
}
|
||||
}
|
||||
const jhList = list.sort((a,b)=>{
|
||||
return b.time-a.time;
|
||||
})
|
||||
return jhList.slice(0,5);
|
||||
}
|
||||
async getGzts(wareHouseId){
|
||||
const gzt = await this.app.mysql.get('dblocal').select('ye4s_gzt', {where:{wareHouseId:wareHouseId},orders: [['username','desc']]});
|
||||
const gztList = gzt.map(item2=>{
|
||||
let tmp = {
|
||||
userid:item2.userid,
|
||||
name:item2.name,
|
||||
ordercount:item2.ordercount,
|
||||
grabcount:item2.grabcount,
|
||||
workers:item2.workers.split("|").filter(item => item),
|
||||
grabnum:item2.grabnum,
|
||||
};
|
||||
return tmp;
|
||||
})
|
||||
let currentTime = Math.round(new Date() / 1000)-3600;
|
||||
const WAREHOUSE = await this.app.mysql.get('dblocal').get("ye4s_warehouse",{WAREHOUSEID:wareHouseId});
|
||||
const gztWorkers = await this.app.mysql.get('dblocal').query(`
|
||||
SELECT
|
||||
userId,
|
||||
SUM(dabaos) as ordercount,
|
||||
COUNT(*) as grabcount
|
||||
FROM
|
||||
ye4s_workers_works
|
||||
WHERE
|
||||
WAREHOUSEID = ${wareHouseId}
|
||||
AND workDate =${WAREHOUSE.workDate}
|
||||
GROUP BY
|
||||
userId;
|
||||
`);
|
||||
const gztWorkers2 = await this.app.mysql.get('dblocal').query(`
|
||||
SELECT
|
||||
userId,
|
||||
SUM(dabaos) as ordercount,
|
||||
COUNT(*) as grabcount
|
||||
FROM
|
||||
ye4s_workers_works
|
||||
WHERE
|
||||
WAREHOUSEID = ${wareHouseId}
|
||||
AND workDate =${WAREHOUSE.workDate}
|
||||
AND createtime >${currentTime}
|
||||
GROUP BY
|
||||
userId;
|
||||
`);
|
||||
let list = gztList.map(item => {
|
||||
for (let i = 0; i < gztWorkers.length; i++) {
|
||||
if (gztWorkers[i].userId.toString() === item.userid) { // 修改此处条件判断
|
||||
item.grabcount = gztWorkers[i].grabcount;
|
||||
item.ordercount = gztWorkers[i].ordercount;
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < gztWorkers2.length; i++) {
|
||||
if (gztWorkers2[i].userId.toString() === item.userid) { // 修改此处条件判断
|
||||
item.grabcount2 = gztWorkers2[i].grabcount; // 修改此处赋值
|
||||
item.ordercount2 = gztWorkers2[i].ordercount; // 修改此处赋值
|
||||
}
|
||||
}
|
||||
if (item.grabcount > 0 || item.grabnum !== '' || item.ordercount > 0 || item.workers.length > 0) {
|
||||
return item;
|
||||
}
|
||||
});
|
||||
list = list.filter(n => n);
|
||||
const gztLists = list.sort((a,b)=>{
|
||||
return b.ordercount-a.ordercount;
|
||||
})
|
||||
return gztLists;
|
||||
}
|
||||
async getwarehouseName(wareHouseId){
|
||||
let results = await this.app.mysql.get('dbwms').get("yj_warehouse",{id:wareHouseId});
|
||||
return results.NAME;
|
||||
}
|
||||
async dfhList(wareHouseId){
|
||||
let results = await this.app.mysql.get('dbwms').query(`select OPERATERECORDS,GRABNUM FROM yj_wmsorder where PLSENDFLAG = 0 and FLAG=0 and PICKINGFLAG = 3 and DISPLAYFLAG=0 and WAREHOUSEID=${wareHouseId} and GRABNUM like '%B%' group by GRABNUM` );
|
||||
let list = [];
|
||||
for(var ii=0;ii<results.length;ii++){
|
||||
const item = results[ii];
|
||||
const tmp = item.OPERATERECORDS.split("|");
|
||||
results[ii].time = -1;
|
||||
delete results[ii].OPERATERECORDS;
|
||||
for(var i=0;i<tmp.length;i++){
|
||||
const item2 = tmp[i].split(";");
|
||||
if(item2 && item2[0].indexOf('拣货')>-1){
|
||||
results[ii].username = item2[2];
|
||||
results[ii].time = await this.gettime(item2[1]);
|
||||
}
|
||||
}
|
||||
if(results[ii].username){
|
||||
list.push(results[ii]);
|
||||
}
|
||||
}
|
||||
const jhList = list.sort((a,b)=>{
|
||||
return a.time-b.time;
|
||||
})
|
||||
return jhList;
|
||||
}
|
||||
async ddbList(wareHouseId){
|
||||
let results = await this.app.mysql.get('dbwms').query(`select OPERATERECORDS,GRABNUM FROM yj_wmsorder where PLSENDFLAG = 1 and FLAG=0 and WAREHOUSEID=${wareHouseId} and DISPLAYFLAG=0 and GRABNUM like '%B%' and OPERATERECORDS not like '%打包%' group by GRABNUM` );
|
||||
let list = [];
|
||||
for(var ii=0;ii<results.length;ii++){
|
||||
const item = results[ii];
|
||||
const tmp = item.OPERATERECORDS.split("|");
|
||||
results[ii].time = -1;
|
||||
delete results[ii].OPERATERECORDS;
|
||||
for(var i=0;i<tmp.length;i++){
|
||||
const item2 = tmp[i].split(";");
|
||||
if(item2 && item2[0].indexOf('发货')>-1){
|
||||
results[ii].username = item2[2];
|
||||
results[ii].time = await this.gettime(item2[1]);
|
||||
}
|
||||
}
|
||||
if(results[ii].username){
|
||||
list.push(results[ii]);
|
||||
}
|
||||
}
|
||||
const GRABNUMs = list.map((item)=>{
|
||||
return `'${item.GRABNUM}'`;
|
||||
});
|
||||
const query_string = GRABNUMs.join(",");
|
||||
let has_results = [];
|
||||
if(query_string){
|
||||
has_results = await this.app.mysql.get('dblocal').query(`select GRABNUM from ye4s_workers_works where grabnum in (${query_string}) and dabaos>0`);
|
||||
}
|
||||
for (var ii = 0; ii < list.length; ii++) {
|
||||
for (var iii = 0; iii < has_results.length; iii++) {
|
||||
if (list[ii]&&list[ii].GRABNUM === has_results[iii].GRABNUM) {
|
||||
list.splice(ii, 1); // 从 list 中删除索引为 ii 的元素
|
||||
ii--; // 调整 ii 的值,因为数组长度减少了一个
|
||||
}
|
||||
}
|
||||
}
|
||||
const jhList = list.sort((a,b)=>{
|
||||
return a.time-b.time;
|
||||
})
|
||||
return jhList;
|
||||
}
|
||||
async djhList(wareHouseId){
|
||||
let results = await this.app.mysql.get('dbwms').query(`select OPERATERECORDS,GRABNUM FROM yj_wmsorder where PICKINGFLAG = 0 and FLAG=0 and WAREHOUSEID=${wareHouseId} and DISPLAYFLAG=0 and GRABNUM like '%B%' and OPERATERECORDS like '%领取快递面单%' group by GRABNUM` );
|
||||
let list = [];
|
||||
for(var ii=0;ii<results.length;ii++){
|
||||
const item = results[ii];
|
||||
const tmp = item.OPERATERECORDS.split("|");
|
||||
results[ii].time = -1;
|
||||
delete results[ii].OPERATERECORDS;
|
||||
for(var i=0;i<tmp.length;i++){
|
||||
const item2 = tmp[i].split(";");
|
||||
if(item2 && item2[0].indexOf('领取快递面单')>-1){
|
||||
results[ii].username = item2[2];
|
||||
results[ii].time = await this.gettime(item2[1]);
|
||||
}
|
||||
}
|
||||
if(results[ii].username){
|
||||
list.push(results[ii]);
|
||||
}
|
||||
}
|
||||
const jhList = list.sort((a,b)=>{
|
||||
return a.time-b.time;
|
||||
})
|
||||
return jhList;
|
||||
}
|
||||
async dllList(wareHouseId){
|
||||
let results = await this.app.mysql.get('dbwms').query(`select a.GRABNUM as GRABNUM,a.OPERATERECORDS as OPERATERECORDS,CAST(b.CREATIONDATE as SIGNED) as time FROM yj_wmsorder a left join yj_grabprint b on a.GRABNUM = b.GRABNUM and a.WAREHOUSEID=b.WAREHOUSEID and a.POSTCODE=b.POSTCODE where a.PRINTTIMES=1 and a.PICKINGFLAG=0 and a.WAREHOUSEID=${wareHouseId} and a.GRABNUM like '%B%' and a.DISPLAYFLAG=0 and a.OPERATERECORDS not like '%领取快递面单%' group by a.GRABNUM` );
|
||||
let list =[];
|
||||
for(var ii=0;ii<results.length;ii++){
|
||||
const item = results[ii];
|
||||
if(!results[ii].time){
|
||||
results[ii].time = 0;
|
||||
const tmp = item.OPERATERECORDS.split("|");
|
||||
for(var i=0;i<tmp.length;i++){
|
||||
const item2 = tmp[i].split(";");
|
||||
if(item2 && item2[0].indexOf('打印')>-1){
|
||||
results[ii].time = await this.gettime(item2[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
delete results[ii].OPERATERECORDS;
|
||||
list.push(results[ii]);
|
||||
}
|
||||
const jhList = list.sort((a,b)=>{
|
||||
return a.time-b.time;
|
||||
})
|
||||
return jhList;
|
||||
}
|
||||
}
|
||||
module.exports = Query;
|
||||
9
app/service/sandan.js
Normal file
9
app/service/sandan.js
Normal file
@ -0,0 +1,9 @@
|
||||
const Service = require('egg').Service;
|
||||
|
||||
class Sandan extends Service {
|
||||
async scan(data){
|
||||
console.log("扫描上传内容",data);
|
||||
return data;
|
||||
}
|
||||
}
|
||||
module.exports = Sandan;
|
||||
44
app/service/system.js
Normal file
44
app/service/system.js
Normal file
@ -0,0 +1,44 @@
|
||||
'use strict';
|
||||
|
||||
const Service = require('egg').Service;
|
||||
|
||||
/**
|
||||
* 通用方法调度服务
|
||||
* method 固定为 workbench.business,name 为变量入参
|
||||
*/
|
||||
class SystemService extends Service {
|
||||
|
||||
/**
|
||||
* 调度入口
|
||||
* @param {string} name - 操作名称
|
||||
* @param {object} data - 请求数据
|
||||
*/
|
||||
async dispatch(name, data) {
|
||||
const { ctx } = this;
|
||||
|
||||
// method 固定为 workbench.business,调用 workbench service
|
||||
if (ctx.service.workbench) {
|
||||
return await this._callService(ctx.service.workbench, name, data);
|
||||
}
|
||||
|
||||
return {
|
||||
success: false,
|
||||
message: `workbench 服务未实现`,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 调用 service 实例上的指定方法
|
||||
*/
|
||||
async _callService(serviceInstance, name, data) {
|
||||
if (!serviceInstance || typeof serviceInstance[name] !== 'function') {
|
||||
return {
|
||||
success: false,
|
||||
message: `方法 ${name} 不存在`,
|
||||
};
|
||||
}
|
||||
return await serviceInstance[name](data);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = SystemService;
|
||||
110
app/service/tgdp.js
Normal file
110
app/service/tgdp.js
Normal file
@ -0,0 +1,110 @@
|
||||
const Service = require('egg').Service;
|
||||
|
||||
class Tgdp extends Service {
|
||||
async index(){
|
||||
let task = await this.app.mysql.get('dblocal').query(`select * from ye4s_warehouse`);
|
||||
return task;
|
||||
}
|
||||
async getUserinfo(){
|
||||
const {ctx} = this;
|
||||
let task = await ctx.app.wsdl('getPDAUser',['caige01', 'wu123456']);
|
||||
let data = JSON.parse(task.return);
|
||||
data.push(ctx.state.user);
|
||||
data.push(ctx.state.wmsuser);
|
||||
let rules = ctx.state.rules;
|
||||
return data;
|
||||
}
|
||||
async getAllinfo(wareHouseId){
|
||||
const jhList = await this.ctx.service.query.jhList(wareHouseId);
|
||||
const fhList = await this.ctx.service.query.fhList(wareHouseId);
|
||||
const ddbList = await this.ctx.service.query.ddbList(wareHouseId);
|
||||
const dfhList = await this.ctx.service.query.dfhList(wareHouseId);
|
||||
const djhList = await this.ctx.service.query.djhList(wareHouseId);
|
||||
const dllList = await this.ctx.service.query.dllList(wareHouseId);
|
||||
const gztList = await this.ctx.service.query.getGzts(wareHouseId);
|
||||
const warehouseName = await this.ctx.service.query.getwarehouseName(wareHouseId);
|
||||
return {
|
||||
jhList: jhList,
|
||||
fhList:fhList,
|
||||
ddbList:ddbList,
|
||||
dfhList:dfhList,
|
||||
djhList:djhList,
|
||||
dllList:dllList,
|
||||
gztList:gztList,
|
||||
warehouseName:warehouseName
|
||||
}
|
||||
}
|
||||
async AllList(){
|
||||
const {ctx} = this;
|
||||
const data = await this.getAllinfo(ctx.socket.userinfo.warehouseid);
|
||||
return data;
|
||||
}
|
||||
async dll(){
|
||||
const {ctx} = this;
|
||||
const dllList = await this.ctx.service.query.dllList(ctx.socket.userinfo.warehouseid);
|
||||
return dllList;
|
||||
}
|
||||
async getUserInfo(){
|
||||
const {ctx} = this;
|
||||
return [ctx.socket.userinfo,ctx.socket.istgdp];
|
||||
}
|
||||
async init(token){
|
||||
return token;
|
||||
}
|
||||
async checkOnline(){
|
||||
|
||||
const {ctx,app} = this;
|
||||
let list = await this.app.redis.get('cache').lrange("tgdp_user_5400", 0, -1);
|
||||
let socketIds = this.app.io.of('/').sockets;
|
||||
let list2 = [];
|
||||
for(let socketId in socketIds){
|
||||
list2.push(socketId);
|
||||
}
|
||||
for(let i=0;i<list.length;i++){
|
||||
let socketId = list[i];
|
||||
if(list2.indexOf(socketId)==-1){
|
||||
await this.app.redis.get('cache').lrem("tgdp_user_5400", 0, socketId);
|
||||
}
|
||||
}
|
||||
}
|
||||
async ll(warehouseid){
|
||||
const dllList = await this.ctx.service.query.dllList(warehouseid);
|
||||
const djhList = await this.ctx.service.query.djhList(warehouseid);
|
||||
let list = await this.app.redis.get('cache').lrange("tgdp_user_"+warehouseid, 0, -1);
|
||||
for(let i=0;i<list.length;i++){
|
||||
let sid = list[i];
|
||||
this.app.io.to(sid).emit('genericResponse', { method:"ll",data: {dllList,djhList} });
|
||||
}
|
||||
}
|
||||
async jh(warehouseid){
|
||||
const jhList = await this.ctx.service.query.jhList(warehouseid);
|
||||
const djhList = await this.ctx.service.query.djhList(warehouseid);
|
||||
const dfhList = await this.ctx.service.query.dfhList(warehouseid);
|
||||
let list = await this.app.redis.get('cache').lrange("tgdp_user_"+warehouseid, 0, -1);
|
||||
for(let i=0;i<list.length;i++){
|
||||
let sid = list[i];
|
||||
this.app.io.to(sid).emit('genericResponse', { method:"jh",data: {jhList,djhList,dfhList} });
|
||||
}
|
||||
}
|
||||
async fh(warehouseid){
|
||||
const fhList = await this.ctx.service.query.fhList(warehouseid);
|
||||
const dfhList = await this.ctx.service.query.dfhList(warehouseid);
|
||||
const ddbList = await this.ctx.service.query.ddbList(warehouseid);
|
||||
let list = await this.app.redis.get('cache').lrange("tgdp_user_"+warehouseid, 0, -1);
|
||||
for(let i=0;i<list.length;i++){
|
||||
let sid = list[i];
|
||||
this.app.io.to(sid).emit('genericResponse', { method:"fh",data: {fhList,dfhList,ddbList} });
|
||||
}
|
||||
}
|
||||
async db(warehouseid){
|
||||
const dfhList = await this.ctx.service.query.dfhList(warehouseid);
|
||||
const ddbList = await this.ctx.service.query.ddbList(warehouseid);
|
||||
const gztList = await this.ctx.service.query.getGzts(warehouseid);
|
||||
let list = await this.app.redis.get('cache').lrange("tgdp_user_"+warehouseid, 0, -1);
|
||||
for(let i=0;i<list.length;i++){
|
||||
let sid = list[i];
|
||||
this.app.io.to(sid).emit('genericResponse', { method:"db",data: {dfhList,ddbList,gztList} });
|
||||
}
|
||||
}
|
||||
}
|
||||
module.exports = Tgdp;
|
||||
14
app/service/tgdppda.js
Normal file
14
app/service/tgdppda.js
Normal file
@ -0,0 +1,14 @@
|
||||
const Service = require('egg').Service;
|
||||
|
||||
class Tgdppda extends Service {
|
||||
async index(){
|
||||
let task = await this.app.mysql.get('dblocal').query(`select * from ye4s_warehouse`);
|
||||
return task;
|
||||
}
|
||||
async push(sid){
|
||||
const { ctx, app } = this;
|
||||
app.io.to(sid).emit('customEvent', { message: 'Hello from Egg.js' });
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
module.exports = Tgdppda;
|
||||
20
app/service/tool.js
Normal file
20
app/service/tool.js
Normal file
@ -0,0 +1,20 @@
|
||||
const Service = require('egg').Service;
|
||||
|
||||
class Tool extends Service {
|
||||
async backMsg(data){
|
||||
let datas = {};
|
||||
try {
|
||||
datas = JSON.parse(data.data);
|
||||
} catch (e) {
|
||||
datas =data.data;
|
||||
}
|
||||
this.app.io.to(data.sid).emit('genericResponse', { method:data.method,data: datas });
|
||||
return 1;
|
||||
}
|
||||
async createOrder(data){
|
||||
console.log(data);
|
||||
return 1;
|
||||
//let task = await ctx.app.wsdl('getPDAUser',['caige01', 'wu123456']);
|
||||
}
|
||||
}
|
||||
module.exports = Tool;
|
||||
88
app/service/workbench.js
Normal file
88
app/service/workbench.js
Normal file
@ -0,0 +1,88 @@
|
||||
'use strict';
|
||||
|
||||
const Service = require('egg').Service;
|
||||
|
||||
/**
|
||||
* workbench 业务服务
|
||||
* 由 /system 接口统一调度
|
||||
*/
|
||||
class WorkbenchService extends Service {
|
||||
|
||||
/**
|
||||
* 扫码查单 - 调用 new_wms.queryOrder
|
||||
*/
|
||||
async someAction(data) {
|
||||
const { barcode, warehouseId } = data;
|
||||
if (!barcode) {
|
||||
return { success: false, message: '缺少 barcode' };
|
||||
}
|
||||
const result = await this.service.newWms.queryOrder(barcode, warehouseId);
|
||||
return result || { success: false, message: '未查询到订单' };
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询 - 调用 newWms.queryOrder
|
||||
*/
|
||||
async query(data) {
|
||||
const { barcode, warehouseId } = data;
|
||||
if (!barcode) {
|
||||
return { success: false, message: '缺少 barcode' };
|
||||
}
|
||||
const result = await this.service.newWms.queryOrder(barcode, warehouseId);
|
||||
return result || { success: false, message: '未查询到订单' };
|
||||
}
|
||||
|
||||
/**
|
||||
* 回传打包状态 - 调用 newWms.reportPackStatus
|
||||
*/
|
||||
async reportPackStatus(data) {
|
||||
const result = await this.service.newWms.reportPackStatus(data);
|
||||
if (result) {
|
||||
return { success: true, data: result, message: 'ok' };
|
||||
}
|
||||
return { success: false, message: '回传失败' };
|
||||
}
|
||||
|
||||
/**
|
||||
* 打包回传 - 仅外部WMS订单(types=4)才发送到外部
|
||||
*/
|
||||
async packOrder(data) {
|
||||
const { types, POSTNUM, grabnum, WAREHOUSEID, gztid, _wms_delivery_order_code, wms_order_ids } = data;
|
||||
// 仅外部WMS订单才回传
|
||||
if (types !== 4) {
|
||||
return { success: false, message: '非外部WMS订单,无需回传' };
|
||||
}
|
||||
if (!POSTNUM || !grabnum) {
|
||||
return { success: false, message: '缺少 POSTNUM 或 grabnum' };
|
||||
}
|
||||
const result = await this.service.newWms.reportPackStatus({
|
||||
POSTNUM,
|
||||
grabnum,
|
||||
WAREHOUSEID: WAREHOUSEID || '1000028',
|
||||
gztid: gztid || '',
|
||||
_wms_delivery_order_code: _wms_delivery_order_code || '',
|
||||
wms_order_ids: wms_order_ids || '',
|
||||
});
|
||||
if (result && result.flag === 'success') {
|
||||
return { success: true, data: result, message: '回传成功' };
|
||||
}
|
||||
return { success: false, message: result?.message || '回传失败', wmsResult: result };
|
||||
}
|
||||
|
||||
/**
|
||||
* 结束打包任务 - 关闭工作台最后一个未结束任务
|
||||
*/
|
||||
async finishPack(data) {
|
||||
const { workbench_id, warehouse_id } = data;
|
||||
if (!workbench_id || !warehouse_id) {
|
||||
return { success: false, message: '缺少 workbench_id 或 warehouse_id' };
|
||||
}
|
||||
const result = await this.service.newWms.finishPack({ workbench_id, warehouse_id });
|
||||
if (result && result.flag === 'success') {
|
||||
return { success: true, data: result, message: '结束成功' };
|
||||
}
|
||||
return { success: false, message: result?.message || '结束失败', wmsResult: result };
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = WorkbenchService;
|
||||
76
app/utils/auth.js
Normal file
76
app/utils/auth.js
Normal file
@ -0,0 +1,76 @@
|
||||
const Token = require('./token');
|
||||
const User = require('./user');
|
||||
class AuthHandler{
|
||||
constructor(ctx) {
|
||||
this.ctx = ctx;
|
||||
this._logined = false;
|
||||
this._error = '';
|
||||
this._user = null;
|
||||
this.keeptime = 2592000; // 30 days in seconds
|
||||
this.rules = [];
|
||||
this.config = [];
|
||||
this.options = [];
|
||||
this.instance = null;
|
||||
this._wms_user = null;
|
||||
this.app = ctx.app;
|
||||
this.Token = new Token(this.app);
|
||||
this.UserHand = new User(this.app);
|
||||
}
|
||||
async init(token){
|
||||
if(!token){
|
||||
return false;
|
||||
}
|
||||
let data =await this.Token._get(token);
|
||||
if(!data){
|
||||
return false;
|
||||
}
|
||||
let user_id = parseInt(data.user_id);
|
||||
if(user_id>0){
|
||||
let user = await this.UserHand._get(user_id);
|
||||
if(!user){
|
||||
await this.setError('Account not exist');
|
||||
return false;
|
||||
}
|
||||
if(user.status !='normal'){
|
||||
await this.setError('Account is locked');
|
||||
return false;
|
||||
}
|
||||
let wms_user = await this.UserHand._getWmsUser(user.wms_userid);
|
||||
this._user = user;
|
||||
this._wms_user = wms_user;
|
||||
this._logined = true;
|
||||
this._token = token;
|
||||
return true;
|
||||
}else{
|
||||
await this.setError('You are not logged in');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
async getRuleList(){
|
||||
if(this._rules){
|
||||
return this._rules;
|
||||
}
|
||||
let group = this._user.group;
|
||||
if(!group){
|
||||
return [];
|
||||
}
|
||||
console.log(group.rules);
|
||||
this.rules = this.app.mysql.get("dblocal").query(`select id,pid,name,title,ismenu from ye4s_user_rule where status="normal" and id in (${group.rules})`);
|
||||
return this.rules;
|
||||
}
|
||||
async setError(_error){
|
||||
this._error = _error;
|
||||
}
|
||||
async getError(){
|
||||
return this._error;
|
||||
}
|
||||
async getUser(){
|
||||
return this._user;
|
||||
}
|
||||
async getWmsUser(){
|
||||
return this._wms_user;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = AuthHandler
|
||||
30
app/utils/token.js
Normal file
30
app/utils/token.js
Normal file
@ -0,0 +1,30 @@
|
||||
class Token{
|
||||
constructor(app) {
|
||||
this.app = app;
|
||||
this.handler = null;
|
||||
}
|
||||
async _get(_token,_default=false){
|
||||
return this.__get(_token)||_default;
|
||||
}
|
||||
async init(){
|
||||
|
||||
}
|
||||
async __get(token){
|
||||
let data = await this.app.mysql.get('dblocal').query(`select * from ye4s_user_token where token="${token}"`);
|
||||
data = data[0];
|
||||
if(data){
|
||||
if(data.expiretime || data.expiretime>Math.round(new Date() / 1000)){
|
||||
data.token =token;
|
||||
data.expires_in = await this.getExpiredIn(data.expires_in);
|
||||
return data;
|
||||
}else{
|
||||
this.delete(token);
|
||||
}
|
||||
}
|
||||
return {};
|
||||
}
|
||||
async getExpiredIn(expiretime){
|
||||
return expiretime ? Math.max(0, expiretime - Math.round(new Date() / 1000)) : 365 * 86400;
|
||||
}
|
||||
}
|
||||
module.exports = Token
|
||||
22
app/utils/user.js
Normal file
22
app/utils/user.js
Normal file
@ -0,0 +1,22 @@
|
||||
class User{
|
||||
constructor(app) {
|
||||
this.app = app;
|
||||
this.handler = null;
|
||||
}
|
||||
async _get(user_id){
|
||||
let data = await this.app.mysql.get('dblocal').query(`select * from ye4s_user where id=${user_id}`);
|
||||
if(data){
|
||||
let user = data[0];
|
||||
let group = await this.app.mysql.get('dblocal').query(`select * from ye4s_user_group where id=${user.group_id}`);
|
||||
user.group = group[0]||{};
|
||||
return user;
|
||||
}
|
||||
}
|
||||
async _getWmsUser(user_id){
|
||||
let data = await this.app.mysql.get('dbwms').query(`select * from yj_user where userID=${user_id}`);
|
||||
if(data){
|
||||
return data[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
module.exports = User
|
||||
120
config/config.default.js
Normal file
120
config/config.default.js
Normal file
@ -0,0 +1,120 @@
|
||||
/* eslint valid-jsdoc: "off" */
|
||||
const path = require('path');
|
||||
/**
|
||||
* @param {Egg.EggAppInfo} appInfo app info
|
||||
*/
|
||||
module.exports = appInfo => {
|
||||
/**
|
||||
* built-in config
|
||||
* @type {Egg.EggAppConfig}
|
||||
**/
|
||||
const config = exports = {};
|
||||
|
||||
// use for cookie sign key, should change to your own and keep security
|
||||
config.keys = appInfo.name + '_1738834822345_7260';
|
||||
|
||||
// add your user config here
|
||||
const userConfig = {
|
||||
// myAppName: 'egg',
|
||||
};
|
||||
config.static = { prefix: '/', dir: path.join(appInfo.baseDir, 'app/assets'),index: 'index.html',index: ['index.html'] };
|
||||
config.middleware = ['formatResponse'];
|
||||
config.cors = {
|
||||
origin: '*',
|
||||
allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH'
|
||||
};
|
||||
config.redis = {
|
||||
clients: {
|
||||
express:{
|
||||
port: 6379, // Redis 端口
|
||||
host: '47.100.78.112', // Redis 地址
|
||||
password: 'qwe2019', // Redis 密码
|
||||
db: 2, // Redis 数据库索引
|
||||
},
|
||||
cache:{
|
||||
port: 6379,
|
||||
host: '127.0.0.1',
|
||||
password: 'qwe2019',
|
||||
db: 2,
|
||||
},
|
||||
post_order_cache:{
|
||||
port: 6379,
|
||||
host: '127.0.0.1',
|
||||
password: 'qwe2019',
|
||||
db: 5,
|
||||
},
|
||||
wms_cache:{
|
||||
port: 6379,
|
||||
host: '127.0.0.1',
|
||||
password: 'qwe2019',
|
||||
db: 9,
|
||||
}
|
||||
}
|
||||
};
|
||||
config.io = {
|
||||
init:{
|
||||
wsEngine: 'ws',
|
||||
},
|
||||
namespace:{
|
||||
'/':{
|
||||
packetMiddleware: [],
|
||||
connectionMiddleware:["connection"]
|
||||
},
|
||||
},
|
||||
redis: {
|
||||
host: '127.0.0.1',
|
||||
password: 'qwe2019',
|
||||
port: 6379,
|
||||
db: 4,
|
||||
}
|
||||
}
|
||||
config.security = {
|
||||
csrf: {
|
||||
enable: false,
|
||||
},
|
||||
};
|
||||
config.mysql = {
|
||||
clients: {
|
||||
// clientId, 获取client实例,需要通过 app.mysql.get('clientId') 获取
|
||||
dblocal: {
|
||||
// host
|
||||
host: '127.0.0.1',
|
||||
// 端口号
|
||||
port: '3306',
|
||||
// 用户名
|
||||
user: 'ye4s',
|
||||
// 密码
|
||||
password: 'H@8h^QE4N$L.F_*',
|
||||
// 数据库名
|
||||
database: 'ye4s',
|
||||
// 兼容 MySQL 8.0+ caching_sha2_password
|
||||
ssl: { rejectUnauthorized: false }
|
||||
},
|
||||
dbwms: {
|
||||
// host
|
||||
host: 'ye4s.com',
|
||||
// 端口号
|
||||
port: '3306',
|
||||
// 用户名
|
||||
user: 'xiaowuge',
|
||||
// 密码
|
||||
password: 'Xiaowuge@123456',
|
||||
// 数据库名
|
||||
database: 'ye4s'
|
||||
},
|
||||
// ...
|
||||
},
|
||||
// 所有数据库配置的默认值
|
||||
default: {},
|
||||
|
||||
// 是否加载到 app 上,默认开启
|
||||
app: true,
|
||||
// 是否加载到 agent 上,默认关闭
|
||||
agent: false,
|
||||
};
|
||||
|
||||
return {
|
||||
...config,
|
||||
...userConfig,
|
||||
};
|
||||
};
|
||||
34
config/config.unittest.js
Normal file
34
config/config.unittest.js
Normal file
@ -0,0 +1,34 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* 单元测试环境配置
|
||||
* 覆盖默认配置,避免测试时连接真实的数据库/Redis
|
||||
*/
|
||||
module.exports = () => {
|
||||
const config = {};
|
||||
|
||||
// 禁用 MySQL(测试时不连数据库)
|
||||
config.mysql = {
|
||||
clients: {},
|
||||
app: false,
|
||||
agent: false,
|
||||
};
|
||||
|
||||
// 禁用 Redis
|
||||
config.redis = {
|
||||
clients: {},
|
||||
};
|
||||
|
||||
// 禁用 socket.io
|
||||
config.io = {
|
||||
enable: false,
|
||||
};
|
||||
|
||||
// 关闭日志
|
||||
config.logger = {
|
||||
level: 'NONE',
|
||||
consoleLevel: 'NONE',
|
||||
};
|
||||
|
||||
return config;
|
||||
};
|
||||
24
config/deploy.config.example.cjs
Normal file
24
config/deploy.config.example.cjs
Normal file
@ -0,0 +1,24 @@
|
||||
module.exports = {
|
||||
production: {
|
||||
host: '__FILL_SSH_HOST__',
|
||||
port: 22,
|
||||
username: '__FILL_SSH_USERNAME__',
|
||||
privateKeyPath: 'C:/Users/your-user/.ssh/id_rsa',
|
||||
deployRoot: '/www/wwwroot/ye4s',
|
||||
sharedDirs: [ 'logs', 'run', 'tmp' ],
|
||||
keepBackups: 5,
|
||||
preDeployCommands: [
|
||||
'node -v',
|
||||
'npm -v',
|
||||
],
|
||||
postDeployCommands: [
|
||||
'npm install --production',
|
||||
'npm run stop || true',
|
||||
'npm start',
|
||||
],
|
||||
healthCheckUrl: 'http://127.0.0.1:7071/',
|
||||
sshOptions: [
|
||||
'StrictHostKeyChecking=accept-new',
|
||||
],
|
||||
},
|
||||
};
|
||||
23
config/plugin.js
Normal file
23
config/plugin.js
Normal file
@ -0,0 +1,23 @@
|
||||
/** @type Egg.EggPlugin */
|
||||
module.exports = {
|
||||
// had enabled by egg
|
||||
// static: {
|
||||
// enable: true,
|
||||
// }
|
||||
mysql:{
|
||||
enable: true,
|
||||
package: 'egg-mysql',
|
||||
},
|
||||
redis:{
|
||||
enable: true,
|
||||
package: 'egg-redis',
|
||||
},
|
||||
io:{
|
||||
enable: true,
|
||||
package: 'egg-socket.io',
|
||||
}
|
||||
};
|
||||
exports.io = {
|
||||
enable: true,
|
||||
package: 'egg-socket.io',
|
||||
};
|
||||
5
jsconfig.json
Normal file
5
jsconfig.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"include": [
|
||||
"**/*"
|
||||
]
|
||||
}
|
||||
64
package.json
Normal file
64
package.json
Normal file
@ -0,0 +1,64 @@
|
||||
{
|
||||
"name": "ye4s",
|
||||
"version": "1.0.0",
|
||||
"description": "tbyc",
|
||||
"private": true,
|
||||
"egg": {
|
||||
"declarations": true
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^1.8.3",
|
||||
"egg": "^3.17.5",
|
||||
"egg-cors": "^3.0.1",
|
||||
"egg-mysql": "^4.0.0",
|
||||
"egg-redis": "^2.6.1",
|
||||
"egg-scripts": "2",
|
||||
"egg-socket.io": "^4.1.6",
|
||||
"mysql2": "^3.22.6",
|
||||
"soap": "^1.1.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"egg-bin": "6",
|
||||
"egg-mock": "5",
|
||||
"eslint": "8",
|
||||
"eslint-config-egg": "13"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "egg-scripts start --daemon --title=egg-server-ye4s --sticky",
|
||||
"stop": "egg-scripts stop --title=egg-server-ye4s",
|
||||
"stop:v1": "egg-scripts stop --title=egg-server-ye4s-v1",
|
||||
"stop:v2": "egg-scripts stop --title=egg-server-ye4s-v2",
|
||||
"dev": "egg-bin dev --sticky",
|
||||
"test": "npm run lint -- --fix && npm run test:local",
|
||||
"test:local": "egg-bin test",
|
||||
"cov": "egg-bin cov",
|
||||
"lint": "eslint .",
|
||||
"ci": "npm run lint && npm run cov",
|
||||
"deploy:precheck": "node ./script/deploy-precheck.cjs",
|
||||
"deploy:authcheck": "node ./script/deploy-auth-check.cjs",
|
||||
"deploy:version": "node ./script/deploy-version.cjs production",
|
||||
"deploy:version:history": "node ./script/deploy-version.cjs production --history=20",
|
||||
"deploy:inspect": "node ./script/deploy-ops.cjs production inspect",
|
||||
"deploy:smoke": "node ./script/deploy-ops.cjs production smoke",
|
||||
"deploy:verify": "node ./script/deploy-ops.cjs production verify",
|
||||
"deploy:cleanup-backups": "node ./script/deploy-ops.cjs production cleanup-backups",
|
||||
"deploy:gateway-probe": "node ./script/deploy-ops.cjs production gateway-probe",
|
||||
"version:record": "node ./script/version-record.cjs",
|
||||
"version:history": "node ./script/version-history.cjs --limit=50",
|
||||
"deploy": "npm run deploy:prod",
|
||||
"deploy:prod": "node ./script/deploy-remote.cjs production",
|
||||
"rollback": "npm run rollback:prod",
|
||||
"rollback:prod": "node ./script/rollback-remote.cjs production",
|
||||
"guard:git": "node ./script/git-safety-check.cjs",
|
||||
"setup:hooks": "node ./script/setup-git-hooks.cjs"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": ""
|
||||
},
|
||||
"author": "mingren",
|
||||
"license": "MIT"
|
||||
}
|
||||
42
script/deploy-auth-check.cjs
Normal file
42
script/deploy-auth-check.cjs
Normal file
@ -0,0 +1,42 @@
|
||||
'use strict';
|
||||
|
||||
const { spawnSync } = require('node:child_process');
|
||||
const { loadDeployConfig } = require('./deploy-lib.cjs');
|
||||
|
||||
function main() {
|
||||
const config = loadDeployConfig('production');
|
||||
|
||||
const args = [ '-vv' ];
|
||||
args.push('-p', String(config.port));
|
||||
args.push('-i', config.privateKeyPath);
|
||||
for (const option of config.sshOptions) {
|
||||
args.push('-o', option);
|
||||
}
|
||||
args.push(`${config.username}@${config.host}`);
|
||||
args.push('echo AUTH_CHECK_OK');
|
||||
|
||||
const result = spawnSync('ssh', args, {
|
||||
encoding: 'utf8',
|
||||
stdio: 'pipe',
|
||||
shell: false,
|
||||
});
|
||||
|
||||
const text = `${result.stdout || ''}\n${result.stderr || ''}`;
|
||||
const summary = {
|
||||
keyOffered: /Offering public key:/i.test(text) || /Will attempt key:/i.test(text),
|
||||
keyAccepted: /Authenticated to .* using "publickey"/i.test(text) || /AUTH_CHECK_OK/i.test(text),
|
||||
authFailed: /Permission denied|Authentication failed/i.test(text),
|
||||
hostKeyFailed: /Host key verification failed|REMOTE HOST IDENTIFICATION HAS CHANGED/i.test(text),
|
||||
networkFailed: /Connection timed out|No route to host|Connection refused|Could not resolve hostname|Operation timed out/i.test(text),
|
||||
};
|
||||
|
||||
console.log(JSON.stringify(summary, null, 2));
|
||||
|
||||
if (summary.keyAccepted) {
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
main();
|
||||
357
script/deploy-lib.cjs
Normal file
357
script/deploy-lib.cjs
Normal file
@ -0,0 +1,357 @@
|
||||
'use strict';
|
||||
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const { spawnSync } = require('node:child_process');
|
||||
|
||||
const ROOT = path.resolve(__dirname, '..');
|
||||
const LOCAL_CONFIG_PATH = path.join(ROOT, 'config', 'deploy.config.local.cjs');
|
||||
const EXAMPLE_CONFIG_PATH = path.join(ROOT, 'config', 'deploy.config.example.cjs');
|
||||
const DEFAULT_ENV = 'production';
|
||||
const DEFAULT_EGG_MINIMAL_INCLUDE_PATHS = [
|
||||
'app.js',
|
||||
'app/**',
|
||||
'package.json',
|
||||
'package-lock.json',
|
||||
];
|
||||
const DEFAULT_POST_DEPLOY_COMMANDS = [
|
||||
'npm install --production',
|
||||
'npm run stop || true',
|
||||
'npm start',
|
||||
];
|
||||
|
||||
function quoteForBash(value) {
|
||||
return `'${String(value).replace(/'/g, `'"'"'`)}'`;
|
||||
}
|
||||
|
||||
function isGitAvailable() {
|
||||
const result = spawnSync('git', [ 'rev-parse', '--git-dir' ], {
|
||||
cwd: ROOT,
|
||||
encoding: 'utf8',
|
||||
stdio: 'pipe',
|
||||
shell: false,
|
||||
});
|
||||
return result.status === 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否有未提交的更改
|
||||
*/
|
||||
function hasUncommittedChanges() {
|
||||
if (!isGitAvailable()) return false;
|
||||
const output = runCommandSafe('git', [ 'status', '--porcelain' ]);
|
||||
return output.trim().length > 0;
|
||||
}
|
||||
|
||||
function runCommand(command, args, options = {}) {
|
||||
const result = spawnSync(command, args, {
|
||||
cwd: options.cwd || ROOT,
|
||||
encoding: 'utf8',
|
||||
stdio: options.stdio || 'pipe',
|
||||
shell: false,
|
||||
});
|
||||
|
||||
if (result.error) {
|
||||
throw result.error;
|
||||
}
|
||||
|
||||
if (result.status !== 0) {
|
||||
const stderr = (result.stderr || '').trim();
|
||||
const stdout = (result.stdout || '').trim();
|
||||
throw new Error(stderr || stdout || `${command} exited with code ${result.status}`);
|
||||
}
|
||||
|
||||
return (result.stdout || '').trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* 安全执行命令,失败时返回空字符串而不是抛出异常
|
||||
*/
|
||||
function runCommandSafe(command, args, options = {}) {
|
||||
const result = spawnSync(command, args, {
|
||||
cwd: options.cwd || ROOT,
|
||||
encoding: 'utf8',
|
||||
stdio: 'pipe',
|
||||
shell: false,
|
||||
});
|
||||
|
||||
if (result.error || result.status !== 0) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return (result.stdout || '').trim();
|
||||
}
|
||||
|
||||
function ensureCommandAvailable(command, installHint) {
|
||||
const result = spawnSync(command, [], {
|
||||
cwd: ROOT,
|
||||
encoding: 'utf8',
|
||||
stdio: 'pipe',
|
||||
shell: false,
|
||||
});
|
||||
|
||||
if (result.error && result.error.code === 'ENOENT') {
|
||||
throw new Error(`${command} 不可用。${installHint}`);
|
||||
}
|
||||
}
|
||||
|
||||
function getNowStamp() {
|
||||
const now = new Date();
|
||||
const pad = value => String(value).padStart(2, '0');
|
||||
return `${now.getFullYear()}${pad(now.getMonth() + 1)}${pad(now.getDate())}${pad(now.getHours())}${pad(now.getMinutes())}${pad(now.getSeconds())}`;
|
||||
}
|
||||
|
||||
function ensureTempDeployDir() {
|
||||
const tempDir = path.join(ROOT, 'tmp', 'deploy');
|
||||
fs.mkdirSync(tempDir, { recursive: true });
|
||||
return tempDir;
|
||||
}
|
||||
|
||||
function isPlaceholder(value) {
|
||||
if (!value) {
|
||||
return true;
|
||||
}
|
||||
return String(value).includes('__FILL_');
|
||||
}
|
||||
|
||||
function normalizeDeployConfig(config, envName) {
|
||||
const deployRoot = config.deployRoot || '/www/wwwroot/ye4s';
|
||||
const privateKeyPath = config.privateKeyPath ? path.resolve(ROOT, config.privateKeyPath) : '';
|
||||
const sshOptions = Array.isArray(config.sshOptions) ? [ ...config.sshOptions ] : [];
|
||||
const preserveDirs = Array.isArray(config.preserveDirs) ? [ ...config.preserveDirs ] : [ 'config' ];
|
||||
|
||||
if (!preserveDirs.includes('config')) {
|
||||
preserveDirs.push('config');
|
||||
}
|
||||
|
||||
if (!sshOptions.some(option => /^IdentitiesOnly=/i.test(option))) {
|
||||
sshOptions.push('IdentitiesOnly=yes');
|
||||
}
|
||||
if (!sshOptions.some(option => /^PreferredAuthentications=/i.test(option))) {
|
||||
sshOptions.push('PreferredAuthentications=publickey');
|
||||
}
|
||||
if (!sshOptions.some(option => /^PubkeyAuthentication=/i.test(option))) {
|
||||
sshOptions.push('PubkeyAuthentication=yes');
|
||||
}
|
||||
if (!sshOptions.some(option => /^PasswordAuthentication=/i.test(option))) {
|
||||
sshOptions.push('PasswordAuthentication=no');
|
||||
}
|
||||
if (!sshOptions.some(option => /^KbdInteractiveAuthentication=/i.test(option))) {
|
||||
sshOptions.push('KbdInteractiveAuthentication=no');
|
||||
}
|
||||
if (!sshOptions.some(option => /^BatchMode=/i.test(option))) {
|
||||
sshOptions.push('BatchMode=yes');
|
||||
}
|
||||
if (!sshOptions.some(option => /^ConnectTimeout=/i.test(option))) {
|
||||
sshOptions.push('ConnectTimeout=10');
|
||||
}
|
||||
|
||||
const configuredPostDeployCommands = Array.isArray(config.postDeployCommands) && config.postDeployCommands.length > 0
|
||||
? [ ...config.postDeployCommands ]
|
||||
: [ ...DEFAULT_POST_DEPLOY_COMMANDS ];
|
||||
|
||||
if (!configuredPostDeployCommands.some(cmd => /^npm\s+install\s+--production(?:\s|$)/i.test(String(cmd).trim()))) {
|
||||
configuredPostDeployCommands.unshift('npm install --production');
|
||||
}
|
||||
|
||||
return {
|
||||
envName,
|
||||
host: config.host,
|
||||
port: Number(config.port || 22),
|
||||
username: config.username,
|
||||
privateKeyPath,
|
||||
deployRoot,
|
||||
controlDir: `${deployRoot}/.deploy`,
|
||||
incomingDir: `${deployRoot}/.deploy/incoming`,
|
||||
backupDir: `${deployRoot}/.deploy/backups`,
|
||||
stateDir: `${deployRoot}/.deploy/state`,
|
||||
sharedDirs: Array.isArray(config.sharedDirs) ? config.sharedDirs : [ 'logs', 'run', 'tmp' ],
|
||||
preserveDirs,
|
||||
keepBackups: Number(config.keepBackups || 5),
|
||||
preDeployCommands: Array.isArray(config.preDeployCommands) ? config.preDeployCommands : [],
|
||||
postDeployCommands: configuredPostDeployCommands,
|
||||
healthCheckUrl: config.healthCheckUrl || '',
|
||||
deployIncludePaths: Array.isArray(config.deployIncludePaths) && config.deployIncludePaths.length > 0
|
||||
? config.deployIncludePaths
|
||||
: DEFAULT_EGG_MINIMAL_INCLUDE_PATHS,
|
||||
deployExcludePaths: Array.isArray(config.deployExcludePaths) ? config.deployExcludePaths : [ 'config/**' ],
|
||||
sshOptions,
|
||||
};
|
||||
}
|
||||
|
||||
function validateDeployConfig(config, configPath, envName) {
|
||||
if (!config) {
|
||||
throw new Error(`${configPath} 中未找到 ${envName} 配置。`);
|
||||
}
|
||||
|
||||
const missing = [];
|
||||
if (isPlaceholder(config.host)) missing.push('host');
|
||||
if (isPlaceholder(config.username)) missing.push('username');
|
||||
if (isPlaceholder(config.privateKeyPath)) missing.push('privateKeyPath');
|
||||
|
||||
if (missing.length > 0) {
|
||||
throw new Error(`请先完善 SSH 配置字段: ${missing.join(', ')}。配置文件: ${configPath}`);
|
||||
}
|
||||
|
||||
const resolvedPrivateKeyPath = path.resolve(ROOT, config.privateKeyPath);
|
||||
if (!fs.existsSync(resolvedPrivateKeyPath)) {
|
||||
throw new Error(`SSH 私钥不存在: ${resolvedPrivateKeyPath}。请先修正 config/deploy.config.local.cjs 中的 privateKeyPath。`);
|
||||
}
|
||||
}
|
||||
|
||||
function loadDeployConfig(envName = DEFAULT_ENV) {
|
||||
if (!fs.existsSync(LOCAL_CONFIG_PATH)) {
|
||||
throw new Error(`缺少本地部署配置 ${LOCAL_CONFIG_PATH}。请复制 ${EXAMPLE_CONFIG_PATH} 并填入 SSH 信息。`);
|
||||
}
|
||||
|
||||
delete require.cache[LOCAL_CONFIG_PATH];
|
||||
const loaded = require(LOCAL_CONFIG_PATH);
|
||||
const config = loaded[envName];
|
||||
validateDeployConfig(config, LOCAL_CONFIG_PATH, envName);
|
||||
return normalizeDeployConfig(config, envName);
|
||||
}
|
||||
|
||||
function buildSshBaseArgs(config) {
|
||||
const args = [ '-p', String(config.port), '-i', config.privateKeyPath ];
|
||||
for (const option of config.sshOptions) {
|
||||
args.push('-o', option);
|
||||
}
|
||||
return args;
|
||||
}
|
||||
|
||||
function runSsh(config, remoteScript, options = {}) {
|
||||
const args = [
|
||||
...buildSshBaseArgs(config),
|
||||
`${config.username}@${config.host}`,
|
||||
`bash -lc ${quoteForBash(remoteScript)}`,
|
||||
];
|
||||
|
||||
return runCommand('ssh', args, {
|
||||
stdio: options.stdio || 'inherit',
|
||||
});
|
||||
}
|
||||
|
||||
function runScp(config, localPath, remotePath) {
|
||||
const args = [ '-P', String(config.port), '-i', config.privateKeyPath ];
|
||||
for (const option of config.sshOptions) {
|
||||
args.push('-o', option);
|
||||
}
|
||||
|
||||
args.push(
|
||||
localPath,
|
||||
`${config.username}@${config.host}:${remotePath}`,
|
||||
);
|
||||
|
||||
return runCommand('scp', args, { stdio: 'inherit' });
|
||||
}
|
||||
|
||||
function normalizeRule(rule) {
|
||||
return String(rule || '').replace(/\\/g, '/').trim();
|
||||
}
|
||||
|
||||
function pathMatchesRule(filePath, rule) {
|
||||
const normalizedPath = String(filePath || '').replace(/\\/g, '/');
|
||||
const normalizedRule = normalizeRule(rule);
|
||||
|
||||
if (!normalizedRule) {
|
||||
return false;
|
||||
}
|
||||
if (normalizedRule.endsWith('/**')) {
|
||||
const prefix = normalizedRule.slice(0, -3);
|
||||
return normalizedPath === prefix || normalizedPath.startsWith(`${prefix}/`);
|
||||
}
|
||||
if (normalizedRule.endsWith('/')) {
|
||||
return normalizedPath.startsWith(normalizedRule);
|
||||
}
|
||||
return normalizedPath === normalizedRule;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归遍历目录获取所有文件(非 git 模式回退方案)
|
||||
*/
|
||||
function walkDir(dir, basePath) {
|
||||
const results = [];
|
||||
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
||||
for (const entry of entries) {
|
||||
const fullPath = path.join(dir, entry.name);
|
||||
const relativePath = path.relative(basePath, fullPath).replace(/\\/g, '/');
|
||||
|
||||
// 跳过不需要的目录
|
||||
if (entry.isDirectory()) {
|
||||
const skipDirs = [ '.git', 'node_modules', 'logs', 'run', 'tmp', '.deploy', '.vscode', '.idea' ];
|
||||
if (skipDirs.includes(entry.name)) continue;
|
||||
results.push(...walkDir(fullPath, basePath));
|
||||
} else {
|
||||
results.push(relativePath);
|
||||
}
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
function listDeployableFiles(config) {
|
||||
const includeRules = Array.isArray(config && config.deployIncludePaths) ? config.deployIncludePaths : DEFAULT_EGG_MINIMAL_INCLUDE_PATHS;
|
||||
const excludeRules = Array.isArray(config && config.deployExcludePaths) ? config.deployExcludePaths : [ 'config/**' ];
|
||||
|
||||
let allFiles;
|
||||
|
||||
if (isGitAvailable()) {
|
||||
// Git 模式:使用 git ls-files
|
||||
const output = runCommandSafe('git', [ 'ls-files', '--cached', '--others', '--exclude-standard' ]);
|
||||
allFiles = output
|
||||
.split(/\r?\n/)
|
||||
.map(item => item.trim())
|
||||
.filter(Boolean)
|
||||
.filter(item => !item.startsWith('.git/'))
|
||||
.filter(item => fs.existsSync(path.join(ROOT, item)));
|
||||
} else {
|
||||
// 非 Git 模式:遍历目录
|
||||
console.warn('[WARN] 未检测到 Git 仓库,使用文件系统遍历模式。建议初始化 Git 仓库以获得更精确的发布文件列表。');
|
||||
allFiles = walkDir(ROOT, ROOT);
|
||||
}
|
||||
|
||||
return Array.from(new Set(
|
||||
allFiles
|
||||
.filter(item => includeRules.some(rule => pathMatchesRule(item, rule)))
|
||||
.filter(item => !excludeRules.some(rule => pathMatchesRule(item, rule)))
|
||||
));
|
||||
}
|
||||
|
||||
function buildArchive(stamp, config) {
|
||||
const tempDir = ensureTempDeployDir();
|
||||
const listPath = path.join(tempDir, `deploy-files-${stamp}.txt`);
|
||||
const archivePath = path.join(tempDir, `release-${stamp}.tar.gz`);
|
||||
const files = listDeployableFiles(config);
|
||||
|
||||
if (files.length === 0) {
|
||||
throw new Error('git ls-files 未返回可发布文件,无法生成发布包。');
|
||||
}
|
||||
|
||||
fs.writeFileSync(listPath, files.join('\n') + '\n', 'utf8');
|
||||
runCommand('tar', [ '-czf', archivePath, '-T', listPath ], { stdio: 'inherit' });
|
||||
|
||||
return {
|
||||
archivePath,
|
||||
listPath,
|
||||
};
|
||||
}
|
||||
|
||||
function buildRemoteCleanupGuard(sharedDirs, preserveDirs = []) {
|
||||
const preserved = [ '.deploy', ...sharedDirs, ...preserveDirs ];
|
||||
return preserved.map(item => `! -name ${quoteForBash(item)}`).join(' ');
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
ROOT,
|
||||
buildArchive,
|
||||
buildRemoteCleanupGuard,
|
||||
ensureCommandAvailable,
|
||||
getNowStamp,
|
||||
hasUncommittedChanges,
|
||||
isGitAvailable,
|
||||
loadDeployConfig,
|
||||
quoteForBash,
|
||||
runCommand,
|
||||
runCommandSafe,
|
||||
runScp,
|
||||
runSsh,
|
||||
};
|
||||
209
script/deploy-ops.cjs
Normal file
209
script/deploy-ops.cjs
Normal file
@ -0,0 +1,209 @@
|
||||
'use strict';
|
||||
|
||||
const { loadDeployConfig, quoteForBash, runSsh } = require('./deploy-lib.cjs');
|
||||
|
||||
const COMMANDS = new Set([ 'inspect', 'smoke', 'verify', 'cleanup-backups', 'gateway-probe' ]);
|
||||
|
||||
/**
|
||||
* 解析命令行参数,返回环境名、命令及额外参数
|
||||
*
|
||||
* @param {string[]} argv - 命令行参数数组
|
||||
* @return {{ envName: string, command: string, args: string[] }} 解析后的选项对象
|
||||
*/
|
||||
function parseArgs(argv) {
|
||||
const options = {
|
||||
envName: 'production',
|
||||
command: '',
|
||||
args: [],
|
||||
};
|
||||
|
||||
const tokens = [ ...argv ];
|
||||
if (tokens.length === 0) {
|
||||
throw new Error('缺少命令: inspect | smoke | verify | cleanup-backups | gateway-probe');
|
||||
}
|
||||
|
||||
const first = tokens[0];
|
||||
if (!COMMANDS.has(first)) {
|
||||
options.envName = first;
|
||||
tokens.shift();
|
||||
}
|
||||
|
||||
if (tokens.length === 0) {
|
||||
throw new Error('缺少命令: inspect | smoke | verify | cleanup-backups | gateway-probe');
|
||||
}
|
||||
|
||||
options.command = tokens[0];
|
||||
options.args = tokens.slice(1);
|
||||
|
||||
if (!COMMANDS.has(options.command)) {
|
||||
throw new Error(`不支持的命令: ${options.command}`);
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过 SSH 读取远端 current.md 文件,获取当前活跃端口
|
||||
* v1 → 7071,v2 → 7072
|
||||
*
|
||||
* @param {object} config - 部署配置对象
|
||||
* @return {{ port: number, version: string, rawContent: string }} 活跃端口、版本标识及 current.md 原始内容
|
||||
* @throws {Error} 如果读取失败或内容不是 v1/v2
|
||||
*/
|
||||
function getActivePortInfo(config) {
|
||||
const currentMdPath = `${config.deployRoot}/current.md`;
|
||||
const remoteScript = [
|
||||
'set -euo pipefail',
|
||||
`cat ${quoteForBash(currentMdPath)} 2>/dev/null || true`,
|
||||
].join('\n');
|
||||
|
||||
const output = runSsh(config, remoteScript, { stdio: 'pipe' });
|
||||
const rawContent = String(output || '').trim();
|
||||
|
||||
if (!rawContent) {
|
||||
throw new Error(
|
||||
`无法读取远端 ${currentMdPath},内容为空或文件不存在。`
|
||||
);
|
||||
}
|
||||
|
||||
const version = rawContent.replace(/\r/g, '').trim();
|
||||
if (version !== 'v1' && version !== 'v2') {
|
||||
throw new Error(
|
||||
`远端 current.md 内容无效: "${rawContent}",期望值为 v1 或 v2。文件路径: ${currentMdPath}`
|
||||
);
|
||||
}
|
||||
|
||||
const port = version === 'v1' ? 7071 : 7072;
|
||||
|
||||
return { port, version, rawContent };
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过 SSH 检查远端部署状态(state 目录、备份等)
|
||||
*
|
||||
* @param {object} config - 部署配置对象
|
||||
* @return {string} SSH 远程执行输出
|
||||
*/
|
||||
function inspectState(config) {
|
||||
const latestBackupFile = `${config.stateDir}/latest-backup.txt`;
|
||||
const remoteScript = [
|
||||
'set -euo pipefail',
|
||||
`STATE_DIR=${quoteForBash(config.stateDir)}`,
|
||||
`BACKUP_DIR=${quoteForBash(config.backupDir)}`,
|
||||
`LATEST_FILE=${quoteForBash(latestBackupFile)}`,
|
||||
'printf "[STATE]\\n"',
|
||||
'ls -la "$STATE_DIR" 2>/dev/null || echo EMPTY',
|
||||
'printf "\\n[LATEST_BACKUP]\\n"',
|
||||
'if [ -f "$LATEST_FILE" ]; then cat "$LATEST_FILE"; else echo MISSING; fi',
|
||||
'printf "\\n[BACKUPS]\\n"',
|
||||
'ls -1 "$BACKUP_DIR" 2>/dev/null || echo EMPTY',
|
||||
'printf "\\n[INSTANCES]\\n"',
|
||||
'ls -la "$DEPLOY_ROOT/v1" 2>/dev/null | head -3 || echo "v1 EMPTY"',
|
||||
'ls -la "$DEPLOY_ROOT/v2" 2>/dev/null | head -3 || echo "v2 EMPTY"',
|
||||
'printf "\\n[CURRENT_MD]\\n"',
|
||||
'cat "$DEPLOY_ROOT/current.md" 2>/dev/null || echo MISSING',
|
||||
].join('\n');
|
||||
|
||||
return runSsh(config, remoteScript, { stdio: 'pipe' }).trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* 对当前活跃端口的关键路由执行冒烟探测
|
||||
*
|
||||
* @param {object} config - 部署配置对象
|
||||
* @return {string} 各路由的 HTTP 状态码输出
|
||||
*/
|
||||
function smokeRoutes(config) {
|
||||
const { port } = getActivePortInfo(config);
|
||||
const remoteScript = [
|
||||
'set -euo pipefail',
|
||||
`PORT=${port}`,
|
||||
'for path in /; do',
|
||||
' code=$(curl -sS -o /dev/null -w "%{http_code}" "http://127.0.0.1:$PORT$path" || true)',
|
||||
' printf "%s %s\\n" "$path" "$code"',
|
||||
'done',
|
||||
].join('\n');
|
||||
|
||||
return runSsh(config, remoteScript, { stdio: 'pipe' }).trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* 清理远端备份目录中指定的备份文件
|
||||
*
|
||||
* @param {object} config - 部署配置对象
|
||||
* @param {string[]} names - 要清理的备份文件名列表
|
||||
* @return {string} 清理结果输出
|
||||
*/
|
||||
function cleanupBackups(config, names) {
|
||||
if (!names.length) {
|
||||
throw new Error('cleanup-backups 需要至少一个备份文件名');
|
||||
}
|
||||
|
||||
const remoteScript = [
|
||||
'set -euo pipefail',
|
||||
`BACKUP_DIR=${quoteForBash(config.backupDir)}`,
|
||||
...names.map((name, index) => `FILE_${index}=${quoteForBash(name)}`),
|
||||
...names.map((_, index) => `if [ -f "$BACKUP_DIR/$FILE_${index}" ]; then rm -f "$BACKUP_DIR/$FILE_${index}"; echo "REMOVED $FILE_${index}"; else echo "MISS $FILE_${index}"; fi`),
|
||||
].join('\n');
|
||||
|
||||
return runSsh(config, remoteScript, { stdio: 'pipe' }).trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* 对指定端口做基础连通性探测,用于故障排查
|
||||
*
|
||||
* @param {object} config - 部署配置对象
|
||||
* @param {string} probePort - 目标端口号(字符串),为空则探测当前活跃端口
|
||||
* @return {string} 探测结果输出
|
||||
*/
|
||||
function gatewayProbe(config, probePort) {
|
||||
let targetPort;
|
||||
if (probePort && /^\d+$/.test(probePort)) {
|
||||
targetPort = Number(probePort);
|
||||
} else {
|
||||
targetPort = getActivePortInfo(config).port;
|
||||
}
|
||||
|
||||
const remoteScript = [
|
||||
'set -euo pipefail',
|
||||
`PORT=${targetPort}`,
|
||||
'echo "[GATEWAY_PROBE] port=$PORT"',
|
||||
'if curl -fsS --connect-timeout 2 --max-time 4 "http://127.0.0.1:$PORT/" >/dev/null 2>&1; then',
|
||||
' echo "GATEWAY_OK"',
|
||||
'else',
|
||||
' echo "GATEWAY_FAIL"',
|
||||
'fi',
|
||||
].join('\n');
|
||||
|
||||
return runSsh(config, remoteScript, { stdio: 'pipe' }).trim();
|
||||
}
|
||||
|
||||
function main() {
|
||||
const options = parseArgs(process.argv.slice(2));
|
||||
const config = loadDeployConfig(options.envName);
|
||||
|
||||
switch (options.command) {
|
||||
case 'inspect':
|
||||
console.log(inspectState(config));
|
||||
break;
|
||||
case 'smoke':
|
||||
console.log(smokeRoutes(config));
|
||||
break;
|
||||
case 'verify': {
|
||||
const activeInfo = getActivePortInfo(config);
|
||||
console.log(`ACTIVE_VERSION=${activeInfo.version}`);
|
||||
console.log(`ACTIVE_PORT=${activeInfo.port}`);
|
||||
break;
|
||||
}
|
||||
case 'cleanup-backups':
|
||||
console.log(cleanupBackups(config, options.args));
|
||||
break;
|
||||
case 'gateway-probe':
|
||||
console.log(gatewayProbe(config, options.args[0] || ''));
|
||||
break;
|
||||
default:
|
||||
throw new Error(`不支持的命令: ${options.command}`);
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
77
script/deploy-precheck.cjs
Normal file
77
script/deploy-precheck.cjs
Normal file
@ -0,0 +1,77 @@
|
||||
'use strict';
|
||||
|
||||
const {
|
||||
loadDeployConfig,
|
||||
runSsh,
|
||||
ensureCommandAvailable,
|
||||
} = require('./deploy-lib.cjs');
|
||||
|
||||
function main() {
|
||||
try {
|
||||
[ 'ssh', 'scp', 'tar', 'git' ].forEach(cmd => ensureCommandAvailable(cmd, ''));
|
||||
console.log('LOCAL_TOOLS_OK');
|
||||
|
||||
const config = loadDeployConfig('production');
|
||||
const remoteScript = [
|
||||
'set -euo pipefail',
|
||||
`DEPLOY_ROOT=${JSON.stringify(config.deployRoot)}`,
|
||||
'PARENT_DIR=$(dirname "$DEPLOY_ROOT")',
|
||||
'if [ -d "$DEPLOY_ROOT" ]; then echo DEPLOY_ROOT_EXISTS; else echo DEPLOY_ROOT_MISSING; fi',
|
||||
'if [ -d "$DEPLOY_ROOT" ] && [ -w "$DEPLOY_ROOT" ]; then echo DEPLOY_ROOT_WRITABLE; else echo DEPLOY_ROOT_NOT_WRITABLE; fi',
|
||||
'if [ -d "$DEPLOY_ROOT/config" ]; then echo DEPLOY_CONFIG_EXISTS; else echo DEPLOY_CONFIG_MISSING; fi',
|
||||
'if [ -d "$PARENT_DIR" ] && [ -w "$PARENT_DIR" ]; then echo PARENT_WRITABLE; else echo PARENT_NOT_WRITABLE; fi',
|
||||
'if [ -d "$DEPLOY_ROOT/v1" ]; then echo V1_DIR_EXISTS; else echo V1_DIR_MISSING; fi',
|
||||
'if [ -d "$DEPLOY_ROOT/v2" ]; then echo V2_DIR_EXISTS; else echo V2_DIR_MISSING; fi',
|
||||
'if [ -f "$DEPLOY_ROOT/nginx-upstream.conf" ]; then echo NGINX_UPSTREAM_EXISTS; else echo NGINX_UPSTREAM_MISSING; fi',
|
||||
'if command -v node >/dev/null 2>&1; then echo REMOTE_NODE_OK; node -v; else echo REMOTE_NODE_MISSING; fi',
|
||||
'if command -v npm >/dev/null 2>&1; then echo REMOTE_NPM_OK; npm -v; else echo REMOTE_NPM_MISSING; fi',
|
||||
'if command -v tar >/dev/null 2>&1; then echo REMOTE_TAR_OK; tar --version | head -n 1; else echo REMOTE_TAR_MISSING; fi',
|
||||
'if command -v curl >/dev/null 2>&1; then',
|
||||
' CURRENT_FILE="$DEPLOY_ROOT/current.md"',
|
||||
' if [ -f "$CURRENT_FILE" ]; then',
|
||||
' ACTIVE_VERSION=$(cat "$CURRENT_FILE" | tr -d "[:space:]")',
|
||||
' if [ "$ACTIVE_VERSION" = "v1" ]; then',
|
||||
' if curl -fsS http://127.0.0.1:7071/ >/dev/null; then echo HEALTHCHECK_LOCAL_OK; else echo HEALTHCHECK_LOCAL_FAIL; fi',
|
||||
' elif [ "$ACTIVE_VERSION" = "v2" ]; then',
|
||||
' if curl -fsS http://127.0.0.1:7072/ >/dev/null; then echo HEALTHCHECK_LOCAL_OK; else echo HEALTHCHECK_LOCAL_FAIL; fi',
|
||||
' else',
|
||||
' echo HEALTHCHECK_LOCAL_SKIP_UNKNOWN_VERSION',
|
||||
' fi',
|
||||
' else',
|
||||
' V1_OK=false; V2_OK=false',
|
||||
' if curl -fsS http://127.0.0.1:7071/ >/dev/null; then V1_OK=true; fi',
|
||||
' if curl -fsS http://127.0.0.1:7072/ >/dev/null; then V2_OK=true; fi',
|
||||
' if [ "$V1_OK" = "true" ] || [ "$V2_OK" = "true" ]; then echo HEALTHCHECK_LOCAL_OK; else echo HEALTHCHECK_LOCAL_FAIL; fi',
|
||||
' fi',
|
||||
'else echo REMOTE_CURL_MISSING; fi',
|
||||
].join('\n');
|
||||
|
||||
const output = runSsh(config, remoteScript, { stdio: 'pipe' });
|
||||
for (const line of output.split(/\r?\n/)) {
|
||||
if (line.trim()) {
|
||||
console.log(line.trim());
|
||||
}
|
||||
}
|
||||
|
||||
console.log('PRECHECK_OK');
|
||||
} catch (error) {
|
||||
const message = String(error && error.message ? error.message : '');
|
||||
let reason = 'UNKNOWN';
|
||||
|
||||
if (/Permission denied|Authentication failed/i.test(message)) {
|
||||
reason = 'AUTH';
|
||||
} else if (/Connection timed out|No route to host|Connection refused|Could not resolve hostname/i.test(message)) {
|
||||
reason = 'NETWORK';
|
||||
} else if (/Host key verification failed|REMOTE HOST IDENTIFICATION HAS CHANGED/i.test(message)) {
|
||||
reason = 'HOST_KEY';
|
||||
} else if (/Operation timed out/i.test(message)) {
|
||||
reason = 'TIMEOUT';
|
||||
}
|
||||
|
||||
console.log('PRECHECK_FAIL');
|
||||
console.log(`PRECHECK_REASON_${reason}`);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
462
script/deploy-remote.cjs
Normal file
462
script/deploy-remote.cjs
Normal file
@ -0,0 +1,462 @@
|
||||
'use strict';
|
||||
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const {
|
||||
ROOT,
|
||||
buildArchive,
|
||||
buildRemoteCleanupGuard,
|
||||
ensureCommandAvailable,
|
||||
getNowStamp,
|
||||
isGitAvailable,
|
||||
loadDeployConfig,
|
||||
quoteForBash,
|
||||
runCommand,
|
||||
runCommandSafe,
|
||||
runScp,
|
||||
runSsh,
|
||||
} = require('./deploy-lib.cjs');
|
||||
|
||||
/**
|
||||
* 通过 SSH 读取远端 current.md 文件,获取当前活跃版本标识(v1 或 v2)
|
||||
*
|
||||
* @param {object} config - 部署配置对象
|
||||
* @param {string} deployRoot - 远端部署根目录,如 /www/wwwroot/ye4s
|
||||
* @return {string} 当前活跃版本标识,如 'v1' 或 'v2'
|
||||
* @throws {Error} 如果读取失败或内容无效
|
||||
*/
|
||||
function readRemoteCurrentVersion(config, deployRoot) {
|
||||
const currentMdPath = `${deployRoot}/current.md`;
|
||||
const script = `cat ${quoteForBash(currentMdPath)} 2>/dev/null || true`;
|
||||
|
||||
const output = runSsh(config, script, { stdio: 'pipe' });
|
||||
const rawVersion = String(output || '').trim();
|
||||
|
||||
if (!rawVersion) {
|
||||
throw new Error(
|
||||
`无法读取远端当前版本文件: ${currentMdPath}。请确保远端已存在 /www/wwwroot/ye4s/current.md 且内容为 v1 或 v2。`
|
||||
);
|
||||
}
|
||||
|
||||
const normalized = rawVersion.replace(/\r/g, '').trim();
|
||||
if (normalized !== 'v1' && normalized !== 'v2') {
|
||||
throw new Error(
|
||||
`远端 current.md 内容无效: "${rawVersion}",期望值为 v1 或 v2。文件路径: ${currentMdPath}`
|
||||
);
|
||||
}
|
||||
|
||||
return normalized;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据当前活跃版本确定目标部署目录(另一个实例目录)
|
||||
*
|
||||
* @param {string} currentVersion - 当前活跃版本,'v1' 或 'v2'
|
||||
* @param {string} deployRoot - 远端部署根目录,如 /www/wwwroot/ye4s
|
||||
* @return {string} 目标部署目录,如 /www/wwwroot/ye4s/v2
|
||||
*/
|
||||
function resolveTargetDir(currentVersion, deployRoot) {
|
||||
if (currentVersion === 'v1') {
|
||||
return `${deployRoot}/v2`;
|
||||
}
|
||||
return `${deployRoot}/v1`;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据当前活跃版本推导目标版本标识(v1 ↔ v2 互换)
|
||||
*
|
||||
* @param {string} currentVersion - 当前活跃版本,'v1' 或 'v2'
|
||||
* @return {string} 目标版本标识,'v1' 或 'v2'
|
||||
*/
|
||||
function resolveTargetVersion(currentVersion) {
|
||||
if (currentVersion === 'v1') {
|
||||
return 'v2';
|
||||
}
|
||||
return 'v1';
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据版本标识返回对应监听端口(v1 → 7071,v2 → 7072)
|
||||
*
|
||||
* @param {string} targetVersion - 目标版本标识,'v1' 或 'v2'
|
||||
* @return {number} 对应端口号
|
||||
*/
|
||||
function getTargetPort(targetVersion) {
|
||||
if (targetVersion === 'v1') {
|
||||
return 7071;
|
||||
}
|
||||
return 7072;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据版本标识返回进程 title(v1 → egg-server-ye4s-v1,v2 → egg-server-ye4s-v2)
|
||||
*
|
||||
* @param {string} version - 版本标识,'v1' 或 'v2'
|
||||
* @return {string} 进程 title
|
||||
*/
|
||||
function getProcessTitle(version) {
|
||||
return `egg-server-ye4s-${version}`;
|
||||
}
|
||||
|
||||
function main() {
|
||||
const envName = process.argv[2] || 'production';
|
||||
const config = loadDeployConfig(envName);
|
||||
|
||||
ensureCommandAvailable('git', '请先安装 Git 并确保 git 在 PATH 中。');
|
||||
ensureCommandAvailable('tar', '请先安装 tar,Windows 10/11 通常已内置 bsdtar。');
|
||||
ensureCommandAvailable('ssh', '请先安装 OpenSSH Client 并确保 ssh 在 PATH 中。');
|
||||
ensureCommandAvailable('scp', '请先安装 OpenSSH Client 并确保 scp 在 PATH 中。');
|
||||
|
||||
// 1. 部署前安全检查
|
||||
console.log('========================================');
|
||||
console.log('ye4s 蓝绿部署');
|
||||
console.log(`环境: ${envName}`);
|
||||
console.log(`目标: ${config.username}@${config.host}:${config.port}`);
|
||||
console.log(`远端根目录: ${config.deployRoot}`);
|
||||
console.log('========================================');
|
||||
|
||||
// 检查 Git 未提交更改
|
||||
if (isGitAvailable()) {
|
||||
const uncommitted = runCommandSafe('git', [ 'status', '--porcelain' ]);
|
||||
if (uncommitted) {
|
||||
console.warn('[WARN] 检测到未提交的更改:');
|
||||
const changes = uncommitted.split(/\r?\n/).filter(Boolean);
|
||||
for (const line of changes.slice(0, 10)) {
|
||||
console.warn(` ${line}`);
|
||||
}
|
||||
if (changes.length > 10) {
|
||||
console.warn(` ... 还有 ${changes.length - 10} 处更改`);
|
||||
}
|
||||
console.warn('[WARN] 未提交的更改不会被包含在发布包中!');
|
||||
console.warn('[WARN] 建议先 git add && git commit 后再部署。');
|
||||
}
|
||||
}
|
||||
|
||||
// 1. 读取远端 current.md,确定目标目录
|
||||
const currentVersion = readRemoteCurrentVersion(config, config.deployRoot);
|
||||
const targetDir = resolveTargetDir(currentVersion, config.deployRoot);
|
||||
console.log(`远端当前活跃版本: ${currentVersion},目标部署目录: ${targetDir}`);
|
||||
|
||||
// 2. 本地打包
|
||||
const stamp = getNowStamp();
|
||||
const packageJson = JSON.parse(fs.readFileSync(path.join(ROOT, 'package.json'), 'utf8'));
|
||||
const packageVersion = String(packageJson.version || '0.0.0');
|
||||
let gitCommitShort = 'nogit';
|
||||
if (isGitAvailable()) {
|
||||
gitCommitShort = runCommandSafe('git', [ 'rev-parse', '--short', 'HEAD' ]) || 'nogit';
|
||||
}
|
||||
const releaseVersion = `v${packageVersion}-${stamp}-${gitCommitShort}`;
|
||||
|
||||
const { archivePath } = buildArchive(stamp, config);
|
||||
const remoteArchive = `${config.incomingDir}/release-${stamp}.tar.gz`;
|
||||
|
||||
// 3. 远端创建目录结构(目标目录 + incoming/backups/state 目录)
|
||||
const setupScript = [
|
||||
'set -euo pipefail',
|
||||
`mkdir -p ${quoteForBash(targetDir)} ${quoteForBash(config.incomingDir)} ${quoteForBash(config.backupDir)} ${quoteForBash(config.stateDir)}`,
|
||||
].join('\n');
|
||||
runSsh(config, setupScript);
|
||||
console.log(`远端目录已就绪: ${targetDir}`);
|
||||
|
||||
// 3.5. 远端备份当前目标目录(如果已有内容)
|
||||
const backupScript = [
|
||||
'set -euo pipefail',
|
||||
`TARGET_DIR=${quoteForBash(targetDir)}`,
|
||||
`BACKUP_DIR=${quoteForBash(config.backupDir)}`,
|
||||
`STAMP=${quoteForBash(stamp)}`,
|
||||
'if [ -f "$TARGET_DIR/package.json" ]; then',
|
||||
' BACKUP_FILE="$BACKUP_DIR/backup-${STAMP}.tar.gz"',
|
||||
' cd "$TARGET_DIR"',
|
||||
' tar -czf "$BACKUP_FILE" . --exclude="./node_modules" --exclude="./.deploy" --exclude="./logs" --exclude="./run" --exclude="./tmp" 2>/dev/null || true',
|
||||
' echo "已备份目标目录到: $BACKUP_FILE"',
|
||||
'else',
|
||||
' echo "目标目录为空,跳过备份"',
|
||||
'fi',
|
||||
].join('\n');
|
||||
try {
|
||||
const backupOutput = runSsh(config, backupScript, { stdio: 'pipe' });
|
||||
console.log(String(backupOutput || '').trim());
|
||||
} catch (err) {
|
||||
console.warn(`[WARN] 备份失败(非致命): ${err.message}`);
|
||||
}
|
||||
|
||||
// 4. SCP 上传 tar.gz 到远端 incoming 目录
|
||||
runScp(config, archivePath, remoteArchive);
|
||||
console.log(`发布包已上传到远端: ${remoteArchive}`);
|
||||
|
||||
// 5. 在目标目录清理旧代码、解压、安装依赖
|
||||
const cleanupGuard = buildRemoteCleanupGuard(config.sharedDirs, config.preserveDirs);
|
||||
|
||||
const remoteScript = [
|
||||
'set -euo pipefail',
|
||||
`TARGET_DIR=${quoteForBash(targetDir)}`,
|
||||
`REMOTE_ARCHIVE=${quoteForBash(remoteArchive)}`,
|
||||
// 进入目标目录,清理旧代码文件(保留 node_modules、logs、run、tmp、.deploy 等运行时/状态目录)
|
||||
'cd "$TARGET_DIR"',
|
||||
`find . -mindepth 1 -maxdepth 1 ${cleanupGuard} -exec rm -rf {} +`,
|
||||
// 解压发布包
|
||||
'tar -xzf "$REMOTE_ARCHIVE" -C "$TARGET_DIR"',
|
||||
'rm -f "$REMOTE_ARCHIVE"',
|
||||
// 检查 config 目录是否存在,不存在则从活跃版本复制
|
||||
'if [ ! -d "$TARGET_DIR/config" ]; then',
|
||||
` ACTIVE_DIR=${quoteForBash(`${config.deployRoot}/${currentVersion}`)}`,
|
||||
' if [ -d "$ACTIVE_DIR/config" ]; then',
|
||||
' cp -a "$ACTIVE_DIR/config" "$TARGET_DIR/config"',
|
||||
' echo "已从活跃版本 ($ACTIVE_DIR) 复制 config 目录"',
|
||||
' else',
|
||||
` FALLBACK_DIR=${quoteForBash(config.deployRoot)}`,
|
||||
' if [ -d "$FALLBACK_DIR/config" ]; then',
|
||||
' cp -a "$FALLBACK_DIR/config" "$TARGET_DIR/config"',
|
||||
' echo "已从根目录 ($FALLBACK_DIR) 复制 config 目录"',
|
||||
' else',
|
||||
' echo "[WARN] 未找到 config 目录来源,目标目录将缺少 config 配置!"',
|
||||
' fi',
|
||||
' fi',
|
||||
'fi',
|
||||
// 在目标目录安装生产依赖
|
||||
'npm install --production',
|
||||
].join('\n');
|
||||
|
||||
runSsh(config, remoteScript);
|
||||
console.log(`远端目标目录已清理、解压并安装依赖: ${targetDir}`);
|
||||
|
||||
// 推导目标版本标识与启动日志路径
|
||||
const targetVersion = resolveTargetVersion(currentVersion);
|
||||
const targetPort = getTargetPort(targetVersion);
|
||||
const targetTitle = getProcessTitle(targetVersion);
|
||||
const currentTitle = getProcessTitle(currentVersion);
|
||||
const startLogPath = `/tmp/ye4s-${targetVersion}-start.log`;
|
||||
const currentMdPath = `${config.deployRoot}/current.md`;
|
||||
const oldDir = `${config.deployRoot}/${currentVersion}`;
|
||||
|
||||
// 6. 停止目标目录可能残留的旧进程(使用版本专用 title)
|
||||
const stopTargetScript = [
|
||||
'set -euo pipefail',
|
||||
`TARGET_DIR=${quoteForBash(targetDir)}`,
|
||||
`TARGET_VERSION=${quoteForBash(targetVersion)}`,
|
||||
`TARGET_TITLE=${quoteForBash(targetTitle)}`,
|
||||
// 先按目录路径查找进程
|
||||
'TARGET_PIDS=$(ps -eo pid=,args= | awk -v root="$TARGET_DIR" \'index($0, root) && $2 ~ /node$/ { print $1 }\')',
|
||||
// 再按 title 查找
|
||||
'TITLE_PIDS=$(ps -eo pid=,args= | awk -v t="$TARGET_TITLE" \'index($0, t) { print $1 }\')',
|
||||
'ALL_PIDS=$(echo "$TARGET_PIDS $TITLE_PIDS" | tr " " "\\n" | sort -u | grep -v "^$" | tr "\\n" " ")',
|
||||
'if [ -z "$ALL_PIDS" ]; then',
|
||||
' echo "未找到目标目录 ($TARGET_VERSION) 残留进程"',
|
||||
'else',
|
||||
' echo "正在停止目标目录 ($TARGET_VERSION) 残留进程: $ALL_PIDS"',
|
||||
' kill $ALL_PIDS || true',
|
||||
' sleep 2',
|
||||
' REMAIN=$(ps -eo pid=,args= | awk -v root="$TARGET_DIR" \'index($0, root) && $2 ~ /node$/ { print $1 }\')',
|
||||
' if [ -n "$REMAIN" ]; then',
|
||||
' kill -9 $REMAIN || true',
|
||||
' fi',
|
||||
' echo "目标目录 ($TARGET_VERSION) 残留进程已停止"',
|
||||
'fi',
|
||||
].join('\n');
|
||||
|
||||
try {
|
||||
const stopTargetOutput = runSsh(config, stopTargetScript, { stdio: 'pipe' });
|
||||
console.log(String(stopTargetOutput || '').trim());
|
||||
} catch (err) {
|
||||
console.warn(`[WARN] 停止目标目录残留进程失败: ${err.message}`);
|
||||
}
|
||||
|
||||
// 6.5. 检测并停止旧版根目录遗留进程(端口 7001 等,首次蓝绿迁移时需要)
|
||||
const legacyRootDir = config.deployRoot;
|
||||
const stopLegacyScript = [
|
||||
'set -euo pipefail',
|
||||
`ROOT_DIR=${quoteForBash(legacyRootDir)}`,
|
||||
// 查找 baseDir 指向根目录(而非 v1/v2)的 egg 进程
|
||||
'LEGACY_PIDS=$(ps -eo pid=,args= | awk -v root="$ROOT_DIR" \'index($0, "baseDir") && index($0, root) && !index($0, root"/v1") && !index($0, root"/v2") { print $1 }\')',
|
||||
'if [ -z "$LEGACY_PIDS" ]; then',
|
||||
' echo "未发现旧版根目录遗留进程"',
|
||||
'else',
|
||||
' echo "发现旧版根目录遗留进程: $LEGACY_PIDS,正在停止..."',
|
||||
' kill $LEGACY_PIDS || true',
|
||||
' sleep 3',
|
||||
' REMAIN=$(ps -eo pid=,args= | awk -v root="$ROOT_DIR" \'index($0, "baseDir") && index($0, root) && !index($0, root"/v1") && !index($0, root"/v2") { print $1 }\')',
|
||||
' if [ -n "$REMAIN" ]; then',
|
||||
' kill -9 $REMAIN || true',
|
||||
' fi',
|
||||
' echo "旧版根目录遗留进程已停止"',
|
||||
'fi',
|
||||
].join('\n');
|
||||
|
||||
try {
|
||||
const legacyOutput = runSsh(config, stopLegacyScript, { stdio: 'pipe' });
|
||||
console.log(String(legacyOutput || '').trim());
|
||||
} catch (err) {
|
||||
// 旧版进程清理失败不阻塞部署
|
||||
console.warn(`[WARN] 旧版进程清理: ${err.message}`);
|
||||
}
|
||||
|
||||
// 7. 启动新实例(先不切换 current.md)
|
||||
const startScript = [
|
||||
'set -euo pipefail',
|
||||
`cd ${quoteForBash(targetDir)}`,
|
||||
`nohup bash -lc 'npx egg-scripts start --daemon --title=${targetTitle} --sticky --port=${targetPort} --ignore-stderr' > ${quoteForBash(startLogPath)} 2>&1 &`,
|
||||
`echo "已在 ${targetDir} 启动新实例 ${targetVersion} (title=${targetTitle}, 端口 ${targetPort}),启动日志: ${startLogPath}"`,
|
||||
].join('\n');
|
||||
|
||||
const startOutput = runSsh(config, startScript, { stdio: 'pipe' });
|
||||
console.log(String(startOutput || '').trim());
|
||||
|
||||
// 8. 健康检查新实例(curl 循环等待,最多 60 秒)
|
||||
const healthCheckScript = [
|
||||
'set -euo pipefail',
|
||||
`TARGET_PORT=${targetPort}`,
|
||||
'HEALTH_OK=false',
|
||||
'for attempt in $(seq 1 30); do',
|
||||
' if curl -fsS --connect-timeout 2 --max-time 4 "http://127.0.0.1:$TARGET_PORT/" >/dev/null 2>&1; then',
|
||||
` echo "新实例 (${targetVersion}) 健康检查通过 (端口 $TARGET_PORT, 第 $attempt 次)"`,
|
||||
' HEALTH_OK=true',
|
||||
' break',
|
||||
' fi',
|
||||
' sleep 2',
|
||||
'done',
|
||||
'if [ "$HEALTH_OK" != "true" ]; then',
|
||||
` echo "FATAL: 新实例 (${targetVersion}) 健康检查超时 (端口 $TARGET_PORT)" >&2`,
|
||||
' exit 1',
|
||||
'fi',
|
||||
].join('\n');
|
||||
|
||||
let healthPassed = false;
|
||||
try {
|
||||
const healthOutput = runSsh(config, healthCheckScript, { stdio: 'pipe' });
|
||||
console.log(String(healthOutput || '').trim());
|
||||
healthPassed = true;
|
||||
} catch (err) {
|
||||
console.error(`[FATAL] 新实例健康检查失败: ${err.message}`);
|
||||
console.error(`[FATAL] 新实例 (${targetVersion}) 未能正常启动,保留当前活跃版本 (${currentVersion}) 不变。`);
|
||||
console.error(`[FATAL] 请检查启动日志: ssh ${config.username}@${config.host} "cat ${startLogPath}"`);
|
||||
console.error('[FATAL] 部署已中止,当前服务不受影响。');
|
||||
|
||||
// 尝试停止失败的新实例
|
||||
const cleanupFailedScript = [
|
||||
'set -euo pipefail',
|
||||
`TARGET_DIR=${quoteForBash(targetDir)}`,
|
||||
'FAILED_PIDS=$(ps -eo pid=,args= | awk -v root="$TARGET_DIR" \'index($0, root) && $2 ~ /node$/ { print $1 }\')',
|
||||
'if [ -n "$FAILED_PIDS" ]; then kill -9 $FAILED_PIDS || true; fi',
|
||||
'echo "已清理失败的新实例进程"',
|
||||
].join('\n');
|
||||
try {
|
||||
runSsh(config, cleanupFailedScript, { stdio: 'pipe' });
|
||||
} catch (_) { /* ignore */ }
|
||||
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// 9. 健康检查通过 → 切换 current.md
|
||||
const switchCurrentMdScript = [
|
||||
'set -euo pipefail',
|
||||
`printf '%s\\n' ${quoteForBash(targetVersion)} > ${quoteForBash(currentMdPath)}`,
|
||||
`echo "current.md 已切换 -> ${targetVersion}"`,
|
||||
].join('\n');
|
||||
const switchOutput2 = runSsh(config, switchCurrentMdScript, { stdio: 'pipe' });
|
||||
console.log(String(switchOutput2 || '').trim());
|
||||
|
||||
// 10. 切换 Nginx upstream 端口并 reload
|
||||
const nginxUpstreamPath = `${config.deployRoot}/nginx-upstream.conf`;
|
||||
const switchNginxScript = [
|
||||
'set -euo pipefail',
|
||||
`printf 'proxy_pass http://127.0.0.1:%s;\\n' ${targetPort} > ${quoteForBash(nginxUpstreamPath)}`,
|
||||
'nginx -t && nginx -s reload',
|
||||
`echo "Nginx upstream 已切换至 127.0.0.1:${targetPort}"`,
|
||||
].join('\n');
|
||||
|
||||
try {
|
||||
const nginxOutput = runSsh(config, switchNginxScript, { stdio: 'pipe' });
|
||||
console.log(String(nginxOutput || '').trim());
|
||||
} catch (err) {
|
||||
console.warn(`[WARN] Nginx upstream 切换失败: ${err.message}`);
|
||||
console.warn(`[WARN] 新实例已在端口 ${targetPort} 运行,但 Nginx 未自动切换。`);
|
||||
console.warn(`[WARN] 请手动更新 ${nginxUpstreamPath} 并执行 nginx -s reload`);
|
||||
}
|
||||
|
||||
// 11. 停止旧实例(kill + 兜底 kill -9)
|
||||
const stopOldScript = [
|
||||
'set -euo pipefail',
|
||||
`OLD_DIR=${quoteForBash(oldDir)}`,
|
||||
`OLD_VERSION=${quoteForBash(currentVersion)}`,
|
||||
`OLD_TITLE=${quoteForBash(currentTitle)}`,
|
||||
'OLD_PIDS=$(ps -eo pid=,args= | awk -v root="$OLD_DIR" \'index($0, root) && $2 ~ /node$/ { print $1 }\')',
|
||||
'if [ -z "$OLD_PIDS" ]; then',
|
||||
' echo "未找到旧实例 ($OLD_VERSION) 进程,跳过停止步骤"',
|
||||
'else',
|
||||
' echo "正在停止旧实例 ($OLD_VERSION): $OLD_PIDS"',
|
||||
' kill $OLD_PIDS || true',
|
||||
' sleep 3',
|
||||
' OLD_PIDS_REMAIN=$(ps -eo pid=,args= | awk -v root="$OLD_DIR" \'index($0, root) && $2 ~ /node$/ { print $1 }\')',
|
||||
' if [ -n "$OLD_PIDS_REMAIN" ]; then',
|
||||
' echo "旧实例 ($OLD_VERSION) 仍有残留进程,强制停止: $OLD_PIDS_REMAIN"',
|
||||
' kill -9 $OLD_PIDS_REMAIN || true',
|
||||
' fi',
|
||||
' echo "旧实例 ($OLD_VERSION) 已停止"',
|
||||
'fi',
|
||||
].join('\n');
|
||||
|
||||
try {
|
||||
const stopOutput = runSsh(config, stopOldScript, { stdio: 'pipe' });
|
||||
console.log(String(stopOutput || '').trim());
|
||||
} catch (err) {
|
||||
console.warn(`[WARN] 停止旧实例失败: ${err.message}`);
|
||||
console.warn(`[WARN] 旧实例 (${currentVersion}) 可能仍在运行,请人工确认并停止`);
|
||||
}
|
||||
|
||||
// 11. 记录远端 release 状态
|
||||
const remoteStateFile = `${config.stateDir}/current-release.json`;
|
||||
const remoteHistoryFile = `${config.stateDir}/release-history.jsonl`;
|
||||
const releaseEntry = {
|
||||
releaseVersion,
|
||||
packageVersion,
|
||||
gitCommitShort,
|
||||
deployRoot: config.deployRoot,
|
||||
targetVersion,
|
||||
targetPort,
|
||||
deployedAt: new Date().toISOString(),
|
||||
};
|
||||
const releaseJson = JSON.stringify(releaseEntry);
|
||||
|
||||
const recordReleaseScript = [
|
||||
'set -euo pipefail',
|
||||
`STATE_FILE=${quoteForBash(remoteStateFile)}`,
|
||||
`HISTORY_FILE=${quoteForBash(remoteHistoryFile)}`,
|
||||
`ENTRY=${quoteForBash(releaseJson)}`,
|
||||
'printf "%s\\n" "$ENTRY" > "$STATE_FILE"',
|
||||
'printf "%s\\n" "$ENTRY" >> "$HISTORY_FILE"',
|
||||
'echo "远端 release 状态已记录"',
|
||||
].join('\n');
|
||||
|
||||
try {
|
||||
const recordOutput = runSsh(config, recordReleaseScript, { stdio: 'pipe' });
|
||||
console.log(String(recordOutput || '').trim());
|
||||
} catch (err) {
|
||||
console.warn(`[WARN] 记录远端 release 状态失败: ${err.message}`);
|
||||
}
|
||||
|
||||
// 12. 清理旧备份(保留最近 N 个)
|
||||
const cleanupBackupsScript = [
|
||||
'set -euo pipefail',
|
||||
`BACKUP_DIR=${quoteForBash(config.backupDir)}`,
|
||||
`KEEP=${Number(config.keepBackups)}`,
|
||||
'cd "$BACKUP_DIR"',
|
||||
'ls -1t backup-*.tar.gz 2>/dev/null | tail -n +$((KEEP + 1)) | while read -r f; do rm -f "$f"; echo "已清理旧备份: $f"; done',
|
||||
'echo "备份清理完成(保留最近 ${KEEP} 个)"',
|
||||
].join('\n');
|
||||
|
||||
try {
|
||||
const cleanupOutput = runSsh(config, cleanupBackupsScript, { stdio: 'pipe' });
|
||||
console.log(String(cleanupOutput || '').trim());
|
||||
} catch (err) {
|
||||
console.warn(`[WARN] 清理旧备份失败: ${err.message}`);
|
||||
}
|
||||
|
||||
// 13. 打印完成信息
|
||||
console.log('========================================');
|
||||
console.log(`发布完成: ${envName} -> ${config.username}@${config.host}:${targetDir}`);
|
||||
console.log(`线上版本号: ${releaseVersion}`);
|
||||
console.log(`当前活跃版本已切换为: ${targetVersion} (端口 ${targetPort})`);
|
||||
console.log('========================================');
|
||||
}
|
||||
|
||||
main();
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user