dm-design/商家端APP/工作台/订单列表/shop-order-list.html

544 lines
19 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">
<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>