packServer/extension/test/wms-mock.html

108 lines
6.6 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<title>WMS 取样页 · 云仓视频溯源注入自测</title>
<style>
body { font: 13px/1.6 "Microsoft YaHei", system-ui, sans-serif; margin: 24px; color: #1f2328; }
h1 { font-size: 16px; margin: 0 0 4px; }
p.note { color: #6b7280; font-size: 12.5px; margin: 0 0 16px; }
table { border-collapse: collapse; width: 900px; }
th, td { border: 1px solid #dcdfe6; padding: 6px 8px; text-align: center; }
th { background: #fafafa; color: #606266; font-weight: 500; }
.click-copy-list { display: flex; align-items: center; justify-content: center; gap: 4px; }
.click-copy-link {
color: #409eff;
cursor: pointer;
font-family: Consolas, monospace;
}
.click-copy-toggle {
border: 0; background: #f0f2f5; color: #606266;
border-radius: 3px; padding: 0 4px; font-size: 11px; cursor: pointer;
}
.ut-status-text--success { color: #67c23a; }
</style>
</head>
<body>
<h1>WMS 取样页(自测用)</h1>
<p class="note">
结构与 <code>https://wms.wms.gztbyc.com/order/orderManagement</code> 的一行一致:<b>只有「运单号」那个 span 带
<code>title="点击复制并查看快递单号二维码"</code></b>,同行的发货单号 / 波次号 / 平台交易单号都不该被插按钮。
运单号都是 <code>32</code> 开头,所以内置的通用前缀规则(<code>express</code>)就能命中(不再需要单独的 WMS 选择器规则)。<br>
加载扩展后打开本页(默认配置):每个运单号<b>旁边</b>会出现一个青色「▶ 查看打包视频」按钮,插在运单号和 <code>+1</code> 之间。<br>
运单号本身(即页面原本的“点击复制二维码”)<b>完全不受影响</b>:不加下划线、不改 title、点它还是页面自己的行为。<br>
文本正则模式也会在旁边插按钮 —— 见页面底部那行 <b>SF</b> 开头的示例(不是表格里的这些)。
</p>
<table>
<thead>
<tr>
<th>发货单号</th>
<th>运单号(快递单号)</th>
<th>波次号</th>
<th>平台交易单号</th>
<th>状态</th>
<th>下单时间</th>
</tr>
</thead>
<tbody>
<tr>
<td><div class="click-copy-list"><span class="click-copy-link" role="button" tabindex="0" title="点击复制发货单号">JY2026101619599</span></div></td>
<td><div class="click-copy-list"><span class="click-copy-link" role="button" tabindex="0" title="点击复制并查看快递单号二维码">321408064481776</span><button type="button" class="click-copy-toggle" title="展开查看全部">+1</button></div></td>
<td><div class="click-copy-list"><span class="click-copy-link" role="button" tabindex="0" title="点击复制波次号">E2026101600069</span></div></td>
<td><div class="click-copy-list"><span class="click-copy-link" role="button" tabindex="0" title="点击复制平台交易单号">6930529169563286869</span></div></td>
<td><span class="ut-status-text--success">已打包</span></td>
<td>2026-10-16 13:26:22</td>
</tr>
<tr>
<td><div class="click-copy-list"><span class="click-copy-link" role="button" tabindex="0" title="点击复制发货单号">JY2026101615872</span></div></td>
<td><div class="click-copy-list"><span class="click-copy-link" role="button" tabindex="0" title="点击复制并查看快递单号二维码">321408064481576</span><button type="button" class="click-copy-toggle" title="展开查看全部">+1</button></div></td>
<td><div class="click-copy-list"><span class="click-copy-link" role="button" tabindex="0" title="点击复制波次号">E2026101600069</span></div></td>
<td><div class="click-copy-list"><span class="click-copy-link" role="button" tabindex="0" title="点击复制平台交易单号">6930516355859054381</span></div></td>
<td><span class="ut-status-text--success">已打包</span></td>
<td>2026-10-16 13:46:54</td>
</tr>
<tr>
<td><div class="click-copy-list"><span class="click-copy-link" role="button" tabindex="0" title="点击复制发货单号">JY2026101416270</span></div></td>
<td><div class="click-copy-list"><span class="click-copy-link" role="button" tabindex="0" title="点击复制并查看快递单号二维码">321407672814174</span></div></td>
<td><div class="click-copy-list"><span class="click-copy-link" role="button" tabindex="0" title="点击复制波次号">B2026101600532</span></div></td>
<td><div class="click-copy-list"><span class="click-copy-link" role="button" tabindex="0" title="点击复制平台交易单号">6918483774881410405</span></div></td>
<td><span class="ut-status-text--success">已打包</span></td>
<td>2026-10-13 08:36:42</td>
</tr>
</tbody>
</table>
<p class="note" style="margin-top:16px">
预期:表格里 <b>3 个运单号</b> 旁边各多一个按钮,其余 9 个蓝色文本不受影响。
</p>
<p id="text-probe">SF1234567890123 已发出</p>
<p class="note" style="margin-top:4px">
↑ 这行用来验证「文本正则」模式(内置 <code>express</code> 规则),按钮会紧跟在命中文字后面。
</p>
<h2 style="font-size:14px;margin:24px 0 6px">另一种结构:旧版 JSP 轨迹链接</h2>
<p class="note">
编号既在链接文字里、也在 <code>href</code> 的 <code>postNum=</code> 参数里,
<code>href</code> 是 <code>javascript:</code> 调用。<br>
这类<b>必须用 CSS 选择器</b>模式(文本正则只扫文本节点,拿不到属性值):<br>
<code>a[href*="postNum="]</code> + 属性 <code>href</code> + 正则 <code>postNum=([0-9A-Za-z_-]+)</code><br>
内置规则里已经不再带这条示例(2026-10-17 移除):需要时在配置页自己加一条(照着这行写),
加完按 F5 刷新即可看到按钮。
</p>
<p id="legacy-probe"><a href="javascript:MM_openTrace('../system/view-trace!viewTrace.jspb?postNum=202610101621&amp;wareHouseId=5400')">202610101621
</a></p>
<p class="note" id="trace-calls">(等着看 MM_openTrace 会不会被调用 —— 点链接本身应该会,点我们的按钮不该会)</p>
<script>
// 模拟目标系统页面自己的 MM_openTrace:用来证明「旁边加按钮」不影响它原本的点击
function MM_openTrace(url) {
window.__traceCalls = (window.__traceCalls || []).concat(url);
document.getElementById('trace-calls').textContent =
'MM_openTrace 已被调用 ' + window.__traceCalls.length + ' 次:' + window.__traceCalls[0];
}
</script>
</body>
</html>