综述: 重构商家端APP会员管理模块目录结构

- 删除商家端APP会员管理模块下的旧版本HTML演示页面,包括等级设置、会员列表、积分商城和积分订单等功能模块
- 新增"商家端APP/工作台/"目录,准备重新组织工作台相关功能
- 更新大妈集市.rp原型文件,同步最新的设计变更
This commit is contained in:
linbin 2025-10-16 02:23:11 +08:00
parent 89ec4e1156
commit c56b88d0ae
13 changed files with 1090 additions and 0 deletions

View File

@ -0,0 +1,543 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>店铺订单 - 牛牛蔬菜店</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
background-color: #f7f7f7;
-webkit-font-smoothing: antialiased;
}
.page-header {
background: linear-gradient(180deg, rgba(5, 60, 35, 0.8), rgba(5, 60, 35, 0));
padding: 20px 0 4px;
position: sticky;
top: 0;
z-index: 9;
}
.header-content {
display: flex;
align-items: center;
padding: 12px 8px;
color: white;
font-size: 16px;
}
.shop-name {
max-width: 180px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.flex-1 {
flex: 1;
}
.share-icon {
width: 20px;
height: 20px;
opacity: 0.9;
}
.tabs {
display: flex;
background-color: #f7f7f7;
border-bottom: 1px solid #eee;
}
.tab-item {
flex: 1;
text-align: center;
padding: 12px 0;
font-size: 15px;
color: #666;
position: relative;
cursor: pointer;
transition: all 0.3s;
}
.tab-item.active {
color: #09542B;
font-weight: 500;
}
.tab-item.active::after {
content: '';
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 30px;
height: 3px;
background-color: #09542B;
border-radius: 2px;
}
.tab-content {
padding: 10px;
min-height: calc(100vh - 200px);
}
.tab-pane {
display: none;
}
.tab-pane.active {
display: block;
}
.order-card {
background-color: #fff;
border-radius: 4px;
margin-bottom: 10px;
padding: 0 10px;
}
.order-card-header {
padding: 10px 0;
border-bottom: 1px dashed #ddd;
}
.order-header-row {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 6px;
}
.order-number {
font-size: 14px;
color: #333;
}
.order-number .number {
font-size: 16px;
font-weight: 700;
}
.order-time {
font-size: 14px;
color: #666;
margin-left: 8px;
}
.order-status {
font-size: 14px;
}
.status-preparing {
color: #666;
}
.status-waiting {
color: #fa4350;
}
.order-no-row {
display: flex;
align-items: center;
padding-top: 6px;
}
.order-no {
font-size: 12px;
color: #666;
}
.copy-btn {
margin-left: 4px;
font-size: 12px;
color: #09542B;
cursor: pointer;
padding: 2px 4px;
}
.order-card-body {
padding: 0;
}
.cell {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 0;
font-size: 15px;
color: #333;
cursor: pointer;
position: relative;
}
.cell:not(:last-child) {
border-bottom: 1px solid #f5f5f5;
}
.cell-title {
flex: 1;
}
.cell-arrow {
width: 0;
height: 0;
border-left: 5px solid #999;
border-top: 4px solid transparent;
border-bottom: 4px solid transparent;
margin-left: 8px;
}
.cell-value {
font-size: 14px;
color: #666;
}
.bottom-nav {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background-color: #fff;
border-top: 1px solid #eee;
display: flex;
justify-content: space-around;
padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
z-index: 10;
}
.nav-item {
flex: 1;
text-align: center;
cursor: pointer;
}
.nav-item .icon {
width: 24px;
height: 24px;
margin: 0 auto 4px;
}
.nav-item .label {
font-size: 12px;
color: #666;
}
.nav-item.active .label {
color: #09542B;
}
.empty-state {
text-align: center;
padding: 60px 20px;
color: #999;
}
/* 时间计时器样式 */
.timer {
font-variant-numeric: tabular-nums;
}
</style>
</head>
<body>
<div class="page-header">
<div class="header-content">
<div class="shop-name">牛牛蔬菜店</div>
<div class="flex-1"></div>
<div>
<svg class="share-icon" viewBox="0 0 1024 1024" fill="white">
<path d="M768 853.333333a128 128 0 1 1-90.453333-37.546666l-281.6-211.2a128 128 0 1 1 0-184.746667l281.6-211.2a128 128 0 1 1 38.826666 51.84l-281.6 211.2a128 128 0 0 1 0 81.066667l281.6 211.2A128 128 0 0 1 768 853.333333z"/>
</svg>
</div>
</div>
</div>
<div class="tabs">
<div class="tab-item active" data-tab="prepare">待备货 (9)</div>
<div class="tab-item" data-tab="pickup">待取货 (0)</div>
</div>
<div class="tab-content">
<!-- 待备货列表 -->
<div class="tab-pane active" id="prepare">
<!-- 订单 #4 -->
<div class="order-card">
<div class="order-card-header">
<div class="order-header-row">
<div>
<span class="order-number">
流水号 <span class="number">4</span>
</span>
<span class="order-time">2025-07-15 15:44:08</span>
</div>
<div class="order-status status-preparing">
正在备货 <span class="timer" data-start="2025-07-15 15:44:08">00:00:00</span>
</div>
</div>
</div>
<div class="order-card-body">
<div class="cell" data-order-no="SO20250715154408001" data-day-sn="4" data-start-time="2025-07-15 15:44:08">
<div class="cell-title">货品数量1件</div>
<div class="cell-arrow"></div>
</div>
</div>
</div>
<!-- 订单 #3 -->
<div class="order-card">
<div class="order-card-header">
<div class="order-header-row">
<div>
<span class="order-number">
流水号 <span class="number">3</span>
</span>
<span class="order-time">2025-07-15 13:33:03</span>
</div>
<div class="order-status status-preparing">
正在备货 <span class="timer" data-start="2025-07-15 13:33:03">00:00:00</span>
</div>
</div>
</div>
<div class="order-card-body">
<div class="cell" data-order-no="SO20250715133303001" data-day-sn="3" data-start-time="2025-07-15 13:33:03">
<div class="cell-title">货品数量1件</div>
<div class="cell-arrow"></div>
</div>
<div class="cell">
<div class="cell-title">预售订单状态</div>
<div class="cell-value">已付尾款</div>
</div>
</div>
</div>
<!-- 订单 #2 -->
<div class="order-card">
<div class="order-card-header">
<div class="order-header-row">
<div>
<span class="order-number">
流水号 <span class="number">2</span>
</span>
<span class="order-time">2025-07-10 14:22:20</span>
</div>
<div class="order-status status-preparing">
正在备货 <span class="timer" data-start="2025-07-10 14:22:20">00:00:00</span>
</div>
</div>
</div>
<div class="order-card-body">
<div class="cell" data-order-no="SO20250710142220001" data-day-sn="2" data-start-time="2025-07-10 14:22:20">
<div class="cell-title">货品数量1件</div>
<div class="cell-arrow"></div>
</div>
<div class="cell">
<div class="cell-title">预售订单状态</div>
<div class="cell-value">已付尾款</div>
</div>
</div>
</div>
<!-- 订单 #1 -->
<div class="order-card">
<div class="order-card-header">
<div class="order-header-row">
<div>
<span class="order-number">
流水号 <span class="number">1</span>
</span>
<span class="order-time">2025-07-03 18:39:01</span>
</div>
<div class="order-status status-preparing">
正在备货 <span class="timer" data-start="2025-07-03 18:39:01">00:00:00</span>
</div>
</div>
</div>
<div class="order-card-body">
<div class="cell" data-order-no="SO20250703183901001" data-day-sn="1" data-start-time="2025-07-03 18:39:01">
<div class="cell-title">货品数量1件</div>
<div class="cell-arrow"></div>
</div>
</div>
</div>
<!-- 订单 #3 (早期) -->
<div class="order-card">
<div class="order-card-header">
<div class="order-header-row">
<div>
<span class="order-number">
流水号 <span class="number">3</span>
</span>
<span class="order-time">2025-07-02 01:48:35</span>
</div>
<div class="order-status status-preparing">
正在备货 <span class="timer" data-start="2025-07-02 01:48:35">00:00:00</span>
</div>
</div>
</div>
<div class="order-card-body">
<div class="cell" data-order-no="SO20250702014835001" data-day-sn="3" data-start-time="2025-07-02 01:48:35">
<div class="cell-title">货品数量1件</div>
<div class="cell-arrow"></div>
</div>
</div>
</div>
<!-- 订单 #2 (早期) -->
<div class="order-card">
<div class="order-card-header">
<div class="order-header-row">
<div>
<span class="order-number">
流水号 <span class="number">2</span>
</span>
<span class="order-time">2025-07-02 01:24:16</span>
</div>
<div class="order-status status-preparing">
正在备货 <span class="timer" data-start="2025-07-02 01:24:16">00:00:00</span>
</div>
</div>
</div>
<div class="order-card-body">
<div class="cell" data-order-no="SO20250702012416001" data-day-sn="2" data-start-time="2025-07-02 01:24:16">
<div class="cell-title">货品数量1件</div>
<div class="cell-arrow"></div>
</div>
</div>
</div>
</div>
<!-- 待取货列表 -->
<div class="tab-pane" id="pickup">
<div class="empty-state">
暂无待取货订单
</div>
</div>
</div>
<div class="bottom-nav">
<div class="nav-item active">
<div class="icon">
<svg viewBox="0 0 1024 1024" fill="currentColor">
<path d="M928 928H96c-17.664 0-32-14.336-32-32V416c0-17.664 14.336-32 32-32s32 14.336 32 32v448h768V416c0-17.664 14.336-32 32-32s32 14.336 32 32v480c0 17.664-14.336 32-32 32z"/>
<path d="M512 672c-8.192 0-16.384-3.072-22.624-9.376l-320-320c-12.512-12.512-12.512-32.768 0-45.248s32.768-12.512 45.248 0L512 594.752l297.376-297.376c12.512-12.512 32.768-12.512 45.248 0s12.512 32.768 0 45.248l-320 320C528.384 668.928 520.192 672 512 672z"/>
</svg>
</div>
<div class="label" style="color: #09542B;">工作台</div>
</div>
<div class="nav-item">
<div class="icon">
<svg viewBox="0 0 1024 1024" fill="currentColor">
<path d="M853.333333 960H170.666667c-46.933333 0-85.333333-38.4-85.333334-85.333333V298.666667c0-46.933333 38.4-85.333333 85.333334-85.333334h682.666666c46.933333 0 85.333333 38.4 85.333334 85.333334v576c0 46.933333-38.4 85.333333-85.333334 85.333333zM170.666667 277.333333c-12.8 0-21.333333 8.533333-21.333334 21.333334v576c0 12.8 8.533333 21.333333 21.333334 21.333333h682.666666c12.8 0 21.333333-8.533333 21.333334-21.333333V298.666667c0-12.8-8.533333-21.333333-21.333334-21.333334H170.666667z"/>
<path d="M864 384H160c-17.066667 0-32-14.933333-32-32s14.933333-32 32-32h704c17.066667 0 32 14.933333 32 32s-14.933333 32-32 32z"/>
</svg>
</div>
<div class="label">消息</div>
</div>
<div class="nav-item">
<div class="icon">
<svg viewBox="0 0 1024 1024" fill="currentColor">
<path d="M512 512m-320 0a320 320 0 1 0 640 0 320 320 0 1 0-640 0Z"/>
<path d="M512 672c-88.224 0-160-71.776-160-160s71.776-160 160-160 160 71.776 160 160-71.776 160-160 160z m0-256c-52.928 0-96 43.072-96 96s43.072 96 96 96 96-43.072 96-96-43.072-96-96-96z"/>
</svg>
</div>
<div class="label">我的</div>
</div>
</div>
<script>
// Tab 切换功能
const tabs = document.querySelectorAll('.tab-item');
const panes = document.querySelectorAll('.tab-pane');
tabs.forEach(tab => {
tab.addEventListener('click', function() {
const targetTab = this.getAttribute('data-tab');
// 移除所有active类
tabs.forEach(t => t.classList.remove('active'));
panes.forEach(p => p.classList.remove('active'));
// 添加active类到当前tab和对应的pane
this.classList.add('active');
document.getElementById(targetTab).classList.add('active');
});
});
// 订单时间计时器功能
function updateTimers() {
const timers = document.querySelectorAll('.timer');
const now = new Date();
timers.forEach(timer => {
const startTime = new Date(timer.getAttribute('data-start'));
const diffInMilliseconds = now - startTime;
if (diffInMilliseconds < 0) return;
const totalSeconds = Math.floor(diffInMilliseconds / 1000);
const hours = Math.floor(totalSeconds / 3600);
const minutes = Math.floor((totalSeconds % 3600) / 60);
const seconds = totalSeconds % 60;
timer.textContent =
String(hours).padStart(2, '0') + ':' +
String(minutes).padStart(2, '0') + ':' +
String(seconds).padStart(2, '0');
});
}
// 每秒更新计时器
updateTimers();
setInterval(updateTimers, 1000);
// 复制订单号功能
function copyToClipboard(text) {
if (navigator.clipboard) {
navigator.clipboard.writeText(text).then(() => {
alert('复制成功');
});
} else {
// 降级方案
const textarea = document.createElement('textarea');
textarea.value = text;
document.body.appendChild(textarea);
textarea.select();
document.execCommand('copy');
document.body.removeChild(textarea);
alert('复制成功');
}
}
// 为复制按钮添加点击事件
document.querySelectorAll('.copy-btn').forEach(btn => {
btn.addEventListener('click', function(e) {
e.stopPropagation();
const orderNo = this.getAttribute('data-order-no');
copyToClipboard(orderNo);
});
});
// 订单卡片点击 - 跳转到备货清单页面
document.querySelectorAll('.cell').forEach(cell => {
cell.addEventListener('click', function() {
const orderNo = this.getAttribute('data-order-no');
const daySn = this.getAttribute('data-day-sn');
const startTime = this.getAttribute('data-start-time');
if (orderNo && daySn && startTime) {
// 跳转到备货清单页面,并传递参数
window.location.href = `shop-order-prepare.html?orderNo=${orderNo}&daySn=${daySn}&startTime=${encodeURIComponent(startTime)}`;
}
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,547 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>备货清单</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
background-color: #f7f7f7;
-webkit-font-smoothing: antialiased;
padding-bottom: 80px;
}
.navbar {
background-color: #053C23;
color: white;
padding: 12px 16px;
display: flex;
align-items: center;
position: sticky;
top: 0;
z-index: 100;
}
.navbar-back {
width: 24px;
height: 24px;
margin-right: 12px;
cursor: pointer;
}
.navbar-title {
font-size: 17px;
font-weight: 500;
}
.page-content {
padding-bottom: 20px;
}
.order-header {
padding: 16px;
margin-bottom: 4px;
background-color: white;
}
.order-header-row {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 8px;
}
.order-number {
font-size: 14px;
color: #333;
}
.order-number .number {
font-size: 20px;
font-weight: 700;
}
.order-status {
font-size: 14px;
}
.status-preparing {
color: #666;
}
.status-waiting {
color: #fa4350;
}
.order-no-row {
display: flex;
align-items: center;
padding-top: 4px;
}
.order-no {
font-size: 12px;
color: #666;
}
.copy-btn {
margin-left: 4px;
font-size: 12px;
color: #09542B;
cursor: pointer;
padding: 2px 4px;
display: inline-flex;
align-items: center;
gap: 2px;
}
.remark-section {
display: flex;
background-color: white;
padding: 12px 16px;
margin-bottom: 8px;
}
.remark-label {
color: #666;
padding-right: 8px;
white-space: nowrap;
}
.remark-content {
flex: 1;
}
.remark-text {
line-height: 1.5;
color: #333;
}
.remark-notice {
font-size: 12px;
color: #666;
padding-top: 2px;
display: flex;
align-items: center;
gap: 4px;
}
.products-section {
padding: 8px 12px;
background-color: white;
}
.product-card {
padding: 10px;
font-size: 14px;
line-height: 1.1;
background-color: #fff;
border: 1px solid #ebeef5;
border-radius: 8px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.02);
}
.product-card:not(:last-child) {
margin-bottom: 10px;
}
.product-content {
display: flex;
align-items: flex-start;
}
.product-image {
width: 80px;
height: 80px;
border-radius: 4px;
object-fit: cover;
background-color: #f5f5f5;
}
.product-info {
flex: 1;
padding-left: 8px;
}
.product-name {
font-size: 15px;
color: #333;
margin-bottom: 4px;
line-height: 1.3;
}
.product-spec-row {
display: flex;
align-items: center;
justify-content: space-between;
color: #666;
padding: 4px 0;
font-size: 12px;
}
.product-price {
text-align: right;
font-size: 14px;
color: #333;
padding: 4px 0;
}
.product-cost-row {
display: flex;
align-items: center;
justify-content: flex-end;
padding: 4px 0;
font-size: 12px;
color: #666;
}
.footer-buttons {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background-color: white;
padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
border-top: 1px solid #eee;
display: flex;
gap: 12px;
}
.btn {
flex: 1;
padding: 12px 24px;
border: none;
border-radius: 24px;
font-size: 16px;
cursor: pointer;
transition: all 0.3s;
}
.btn-primary {
background-color: #09542B;
color: white;
}
.btn-primary:active {
background-color: #053C23;
}
.btn-secondary {
background-color: #f0f0f0;
color: #333;
}
.timer {
font-variant-numeric: tabular-nums;
}
/* 弹窗样式 */
.modal {
display: none;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.5);
z-index: 1000;
align-items: center;
justify-content: center;
}
.modal.show {
display: flex;
}
.modal-content {
background-color: white;
border-radius: 12px;
padding: 20px;
margin: 0 20px;
max-width: 300px;
width: 100%;
}
.modal-title {
font-size: 16px;
font-weight: 500;
text-align: center;
margin-bottom: 20px;
}
.modal-buttons {
display: flex;
gap: 12px;
}
.modal-button {
flex: 1;
padding: 10px;
border: 1px solid #ddd;
background-color: white;
border-radius: 6px;
cursor: pointer;
font-size: 15px;
}
.modal-button:active {
background-color: #f5f5f5;
}
.toast {
display: none;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: rgba(0, 0, 0, 0.7);
color: white;
padding: 12px 24px;
border-radius: 6px;
z-index: 2000;
}
.toast.show {
display: block;
}
</style>
</head>
<body>
<div class="navbar">
<svg class="navbar-back" viewBox="0 0 1024 1024" fill="white" onclick="history.back()">
<path d="M671.968 912c-12.288 0-24.576-4.672-33.952-14.048L286.048 545.984c-18.752-18.72-18.752-49.12 0-67.872l351.968-352c18.752-18.752 49.12-18.752 67.872 0 18.752 18.72 18.752 49.12 0 67.872L387.872 512l318.016 318.016c18.752 18.752 18.752 49.12 0 67.872C696.544 907.328 684.256 912 671.968 912z"/>
</svg>
<div class="navbar-title">备货清单</div>
</div>
<div class="page-content">
<!-- 订单头部信息 -->
<div class="order-header">
<div class="order-header-row">
<div>
<span class="order-number">
#<span class="number" id="daySn">4</span>
</span>
</div>
<div class="order-status status-preparing">
正在备货 <span class="timer" id="prepareTimer">00:00:00</span>
</div>
</div>
<div class="order-no-row">
<span class="order-no">订单号:<span id="orderNo">SO20250715154408001</span></span>
<div class="copy-btn" onclick="copyOrderNo()">
<svg width="12" height="12" viewBox="0 0 1024 1024" fill="currentColor">
<path d="M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"/>
</svg>
复制
</div>
</div>
</div>
<!-- 订单备注 -->
<div class="remark-section">
<div class="remark-label">订单备注</div>
<div class="remark-content">
<div class="remark-text">请帮忙挑选新鲜的蔬菜,谢谢!</div>
<div class="remark-notice">
<svg width="12" height="12" viewBox="0 0 1024 1024" fill="currentColor">
<path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"/>
<path d="M464 336a48 48 0 1 0 96 0 48 48 0 1 0-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"/>
</svg>
若上述备注信息和您备货商品无关,请忽略
</div>
</div>
</div>
<!-- 商品列表 -->
<div class="products-section">
<!-- 商品1 -->
<div class="product-card">
<div class="product-content">
<img src="https://via.placeholder.com/80" alt="商品图片" class="product-image">
<div class="product-info">
<div class="product-name">新鲜有机西红柿</div>
<div class="product-spec-row">
<div>500g/份</div>
<div>x 1</div>
</div>
<div class="product-price">¥ 12.80</div>
<div class="product-cost-row">
<div>成本 ¥8.50</div>
</div>
</div>
</div>
</div>
<!-- 商品2 -->
<div class="product-card">
<div class="product-content">
<img src="https://via.placeholder.com/80" alt="商品图片" class="product-image">
<div class="product-info">
<div class="product-name">农家土鸡蛋</div>
<div class="product-spec-row">
<div>10个/盒</div>
<div>x 1</div>
</div>
<div class="product-price">¥ 28.00</div>
<div class="product-cost-row">
<div>成本 ¥18.00</div>
</div>
</div>
</div>
</div>
<!-- 商品3 -->
<div class="product-card">
<div class="product-content">
<img src="https://via.placeholder.com/80" alt="商品图片" class="product-image">
<div class="product-info">
<div class="product-name">精选五常大米</div>
<div class="product-spec-row">
<div>2.5kg/袋</div>
<div>x 1</div>
</div>
<div class="product-price">¥ 45.00</div>
<div class="product-cost-row">
<div>成本 ¥32.00</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- 底部按钮 -->
<div class="footer-buttons">
<button class="btn btn-primary" onclick="showCompleteModal()">备货完成</button>
<button class="btn btn-secondary" onclick="handlePrint()">打印订单</button>
</div>
<!-- 备货完成弹窗 -->
<div class="modal" id="completeModal">
<div class="modal-content">
<div class="modal-title">是否确认备货完成?</div>
<div class="modal-buttons">
<button class="modal-button" onclick="handleRefund()">补差价</button>
<button class="modal-button" onclick="handleConfirm()">确认</button>
<button class="modal-button" onclick="closeModal()">取消</button>
</div>
</div>
</div>
<!-- Toast提示 -->
<div class="toast" id="toast"></div>
<script>
// 获取URL参数
function getUrlParam(name) {
const urlParams = new URLSearchParams(window.location.search);
return urlParams.get(name);
}
// 初始化订单数据
const orderNo = getUrlParam('orderNo') || 'SO20250715154408001';
const daySn = getUrlParam('daySn') || '4';
const startTime = getUrlParam('startTime') || '2025-07-15 15:44:08';
document.getElementById('orderNo').textContent = orderNo;
document.getElementById('daySn').textContent = daySn;
// 时间计时器
function updateTimer() {
const timer = document.getElementById('prepareTimer');
const orderTime = new Date(startTime);
const currentTime = new Date();
const diffInMilliseconds = currentTime - orderTime;
if (diffInMilliseconds < 0) return;
const totalSeconds = Math.floor(diffInMilliseconds / 1000);
const hours = Math.floor(totalSeconds / 3600);
const minutes = Math.floor((totalSeconds % 3600) / 60);
const seconds = totalSeconds % 60;
timer.textContent =
String(hours).padStart(2, '0') + ':' +
String(minutes).padStart(2, '0') + ':' +
String(seconds).padStart(2, '0');
}
// 每秒更新计时器
updateTimer();
setInterval(updateTimer, 1000);
// 复制订单号
function copyOrderNo() {
const orderNoText = document.getElementById('orderNo').textContent;
if (navigator.clipboard) {
navigator.clipboard.writeText(orderNoText).then(() => {
showToast('复制成功');
});
} else {
const textarea = document.createElement('textarea');
textarea.value = orderNoText;
document.body.appendChild(textarea);
textarea.select();
document.execCommand('copy');
document.body.removeChild(textarea);
showToast('复制成功');
}
}
// 显示备货完成弹窗
function showCompleteModal() {
document.getElementById('completeModal').classList.add('show');
}
// 关闭弹窗
function closeModal() {
document.getElementById('completeModal').classList.remove('show');
}
// 补差价
function handleRefund() {
closeModal();
showToast('补差价功能开发中');
}
// 确认备货完成
function handleConfirm() {
closeModal();
showToast('备货完成');
setTimeout(() => {
history.back();
}, 1500);
}
// 打印订单
function handlePrint() {
window.print();
}
// 显示Toast
function showToast(message) {
const toast = document.getElementById('toast');
toast.textContent = message;
toast.classList.add('show');
setTimeout(() => {
toast.classList.remove('show');
}, 2000);
}
// 点击弹窗外部关闭
document.getElementById('completeModal').addEventListener('click', function(e) {
if (e.target === this) {
closeModal();
}
});
</script>
</body>
</html>

Binary file not shown.