634 lines
20 KiB
HTML
634 lines
20 KiB
HTML
|
|
<!DOCTYPE html>
|
|||
|
|
<html lang="zh-CN">
|
|||
|
|
<head>
|
|||
|
|
<meta charset="UTF-8">
|
|||
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|||
|
|
<title>工作台 - 大妈集市专员端</title>
|
|||
|
|
<style>
|
|||
|
|
* {
|
|||
|
|
margin: 0;
|
|||
|
|
padding: 0;
|
|||
|
|
box-sizing: border-box;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
body {
|
|||
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|||
|
|
background-color: #f7f7f7;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.navbar {
|
|||
|
|
background: linear-gradient(135deg, #053C23 0%, #0a5a35 100%);
|
|||
|
|
color: white;
|
|||
|
|
padding: 12px 16px;
|
|||
|
|
text-align: center;
|
|||
|
|
font-size: 18px;
|
|||
|
|
font-weight: 500;
|
|||
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.category-tabs {
|
|||
|
|
display: flex;
|
|||
|
|
background: linear-gradient(135deg, #053C23 0%, #0a5a35 100%);
|
|||
|
|
padding: 0 16px 12px;
|
|||
|
|
gap: 12px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.category-tab {
|
|||
|
|
flex: 1;
|
|||
|
|
padding: 8px 16px;
|
|||
|
|
background: rgba(255, 255, 255, 0.2);
|
|||
|
|
color: white;
|
|||
|
|
border: none;
|
|||
|
|
border-radius: 20px;
|
|||
|
|
cursor: pointer;
|
|||
|
|
transition: all 0.3s;
|
|||
|
|
font-size: 14px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.category-tab.active {
|
|||
|
|
background: white;
|
|||
|
|
color: #053C23;
|
|||
|
|
font-weight: 500;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.tabs {
|
|||
|
|
display: flex;
|
|||
|
|
background: white;
|
|||
|
|
border-bottom: 1px solid #e5e5e5;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.tab {
|
|||
|
|
flex: 1;
|
|||
|
|
padding: 14px 0;
|
|||
|
|
text-align: center;
|
|||
|
|
cursor: pointer;
|
|||
|
|
position: relative;
|
|||
|
|
color: #666;
|
|||
|
|
font-size: 15px;
|
|||
|
|
transition: all 0.3s;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.tab.active {
|
|||
|
|
color: #053C23;
|
|||
|
|
font-weight: 500;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.tab.active::after {
|
|||
|
|
content: '';
|
|||
|
|
position: absolute;
|
|||
|
|
bottom: 0;
|
|||
|
|
left: 50%;
|
|||
|
|
transform: translateX(-50%);
|
|||
|
|
width: 30px;
|
|||
|
|
height: 3px;
|
|||
|
|
background: #053C23;
|
|||
|
|
border-radius: 2px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.order-list {
|
|||
|
|
padding: 10px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.order-card {
|
|||
|
|
background: white;
|
|||
|
|
border-radius: 8px;
|
|||
|
|
margin-bottom: 10px;
|
|||
|
|
padding: 12px;
|
|||
|
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|||
|
|
cursor: pointer;
|
|||
|
|
transition: all 0.3s;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.order-card:hover {
|
|||
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|||
|
|
transform: translateY(-2px);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.order-header {
|
|||
|
|
display: flex;
|
|||
|
|
justify-content: space-between;
|
|||
|
|
align-items: center;
|
|||
|
|
padding-bottom: 10px;
|
|||
|
|
border-bottom: 1px solid #f0f0f0;
|
|||
|
|
margin-bottom: 10px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.order-number {
|
|||
|
|
font-size: 14px;
|
|||
|
|
color: #333;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.order-time {
|
|||
|
|
font-size: 12px;
|
|||
|
|
color: #999;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.order-info {
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
justify-content: space-between;
|
|||
|
|
padding: 8px 0;
|
|||
|
|
color: #808080;
|
|||
|
|
font-size: 13px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.progress-wrapper {
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
flex: 1;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.progress-bar {
|
|||
|
|
width: 140px;
|
|||
|
|
height: 6px;
|
|||
|
|
background: #e5e5e5;
|
|||
|
|
border-radius: 3px;
|
|||
|
|
margin: 0 8px;
|
|||
|
|
overflow: hidden;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.progress-fill {
|
|||
|
|
height: 100%;
|
|||
|
|
background: linear-gradient(90deg, #4CAF50 0%, #8BC34A 100%);
|
|||
|
|
border-radius: 3px;
|
|||
|
|
transition: width 0.3s;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.arrow-icon {
|
|||
|
|
color: #ccc;
|
|||
|
|
font-size: 18px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.btn-print {
|
|||
|
|
background: white;
|
|||
|
|
border: 1px solid #053C23;
|
|||
|
|
color: #053C23;
|
|||
|
|
padding: 6px 16px;
|
|||
|
|
border-radius: 16px;
|
|||
|
|
font-size: 13px;
|
|||
|
|
cursor: pointer;
|
|||
|
|
transition: all 0.3s;
|
|||
|
|
margin-left: auto;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.btn-print:hover {
|
|||
|
|
background: #053C23;
|
|||
|
|
color: white;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.btn-group {
|
|||
|
|
display: flex;
|
|||
|
|
gap: 10px;
|
|||
|
|
margin-top: 10px;
|
|||
|
|
padding-top: 10px;
|
|||
|
|
border-top: 1px solid #f0f0f0;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.btn-secondary {
|
|||
|
|
flex: 1;
|
|||
|
|
background: white;
|
|||
|
|
border: 1px solid #053C23;
|
|||
|
|
color: #053C23;
|
|||
|
|
padding: 8px 16px;
|
|||
|
|
border-radius: 16px;
|
|||
|
|
font-size: 14px;
|
|||
|
|
cursor: pointer;
|
|||
|
|
transition: all 0.3s;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.btn-secondary:hover {
|
|||
|
|
background: #f5f5f5;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.btn-primary {
|
|||
|
|
flex: 1;
|
|||
|
|
background: #053C23;
|
|||
|
|
border: 1px solid #053C23;
|
|||
|
|
color: white;
|
|||
|
|
padding: 8px 16px;
|
|||
|
|
border-radius: 16px;
|
|||
|
|
font-size: 14px;
|
|||
|
|
cursor: pointer;
|
|||
|
|
transition: all 0.3s;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.btn-primary:hover {
|
|||
|
|
background: #0a5a35;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.contact-buttons {
|
|||
|
|
display: flex;
|
|||
|
|
gap: 8px;
|
|||
|
|
margin-top: 8px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.btn-icon {
|
|||
|
|
flex: 1;
|
|||
|
|
background: white;
|
|||
|
|
border: 1px solid #053C23;
|
|||
|
|
color: #053C23;
|
|||
|
|
padding: 6px 12px;
|
|||
|
|
border-radius: 16px;
|
|||
|
|
font-size: 13px;
|
|||
|
|
cursor: pointer;
|
|||
|
|
transition: all 0.3s;
|
|||
|
|
display: flex;
|
|||
|
|
align-items: center;
|
|||
|
|
justify-content: center;
|
|||
|
|
gap: 4px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.btn-icon:hover {
|
|||
|
|
background: #f5f5f5;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.btn-confirm {
|
|||
|
|
width: 100%;
|
|||
|
|
background: #053C23;
|
|||
|
|
border: 1px solid #053C23;
|
|||
|
|
color: white;
|
|||
|
|
padding: 8px 16px;
|
|||
|
|
border-radius: 16px;
|
|||
|
|
font-size: 14px;
|
|||
|
|
cursor: pointer;
|
|||
|
|
transition: all 0.3s;
|
|||
|
|
margin-top: 8px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.btn-confirm:hover {
|
|||
|
|
background: #0a5a35;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.delivery-info-section {
|
|||
|
|
background: #f9f9f9;
|
|||
|
|
padding: 8px;
|
|||
|
|
border-radius: 6px;
|
|||
|
|
margin: 8px 0;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.receiver-info {
|
|||
|
|
display: flex;
|
|||
|
|
justify-content: space-between;
|
|||
|
|
padding: 4px 0;
|
|||
|
|
color: #333;
|
|||
|
|
font-size: 14px;
|
|||
|
|
font-weight: 500;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.empty-state {
|
|||
|
|
text-align: center;
|
|||
|
|
padding: 60px 20px;
|
|||
|
|
color: #999;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.empty-icon {
|
|||
|
|
font-size: 60px;
|
|||
|
|
margin-bottom: 16px;
|
|||
|
|
opacity: 0.3;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.badge {
|
|||
|
|
background: #ff4444;
|
|||
|
|
color: white;
|
|||
|
|
border-radius: 10px;
|
|||
|
|
padding: 2px 6px;
|
|||
|
|
font-size: 11px;
|
|||
|
|
margin-left: 4px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
@keyframes fadeIn {
|
|||
|
|
from {
|
|||
|
|
opacity: 0;
|
|||
|
|
transform: translateY(10px);
|
|||
|
|
}
|
|||
|
|
to {
|
|||
|
|
opacity: 1;
|
|||
|
|
transform: translateY(0);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.order-card {
|
|||
|
|
animation: fadeIn 0.3s ease;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.toast {
|
|||
|
|
position: fixed;
|
|||
|
|
top: 50%;
|
|||
|
|
left: 50%;
|
|||
|
|
transform: translate(-50%, -50%);
|
|||
|
|
background: rgba(0, 0, 0, 0.8);
|
|||
|
|
color: white;
|
|||
|
|
padding: 12px 24px;
|
|||
|
|
border-radius: 8px;
|
|||
|
|
z-index: 2000;
|
|||
|
|
display: none;
|
|||
|
|
animation: fadeIn 0.3s;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.toast.show {
|
|||
|
|
display: block;
|
|||
|
|
}
|
|||
|
|
</style>
|
|||
|
|
</head>
|
|||
|
|
<body>
|
|||
|
|
<div class="navbar">华侨城农贸市场</div>
|
|||
|
|
|
|||
|
|
<div class="category-tabs">
|
|||
|
|
<button class="category-tab active" data-category="1">普通订单</button>
|
|||
|
|
<button class="category-tab" data-category="3">预售订单</button>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="tabs">
|
|||
|
|
<div class="tab active" data-tab="2">待取货 <span class="badge">3</span></div>
|
|||
|
|
<div class="tab" data-tab="3">待配送 <span class="badge">1</span></div>
|
|||
|
|
<div class="tab" data-tab="4">待送达 <span class="badge">2</span></div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="order-list" id="orderList">
|
|||
|
|
<!-- 订单列表将通过JavaScript动态生成 -->
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- Toast提示 -->
|
|||
|
|
<div id="toast" class="toast"></div>
|
|||
|
|
|
|||
|
|
<script>
|
|||
|
|
// 模拟订单数据
|
|||
|
|
const mockOrders = {
|
|||
|
|
2: [ // 待取货
|
|||
|
|
{
|
|||
|
|
settlementOrderNo: 'S2024101201', // 结算订单号
|
|||
|
|
daySn: '1', // 结算订单流水号
|
|||
|
|
payTime: '2024-10-12 09:30:15',
|
|||
|
|
preparedCount: 3,
|
|||
|
|
totalCount: 4,
|
|||
|
|
distance: 2.5,
|
|||
|
|
expectDeliveryTime: 15,
|
|||
|
|
deliveryType: 3, // 1-全国配送, 2-专员配送, 3-自提
|
|||
|
|
orderCategory: 1 // 普通订单
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
settlementOrderNo: 'S2024101202',
|
|||
|
|
daySn: '2',
|
|||
|
|
payTime: '2024-10-12 10:15:30',
|
|||
|
|
preparedCount: 4,
|
|||
|
|
totalCount: 4,
|
|||
|
|
distance: 1.8,
|
|||
|
|
expectDeliveryTime: 12,
|
|||
|
|
deliveryType: 4, // 4-同城配送
|
|||
|
|
orderCategory: 1
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
settlementOrderNo: 'S2024101203',
|
|||
|
|
daySn: '3',
|
|||
|
|
payTime: '2024-10-12 11:00:45',
|
|||
|
|
preparedCount: 2,
|
|||
|
|
totalCount: 5,
|
|||
|
|
distance: 3.2,
|
|||
|
|
expectDeliveryTime: 20,
|
|||
|
|
deliveryType: 1,
|
|||
|
|
orderCategory: 1
|
|||
|
|
}
|
|||
|
|
],
|
|||
|
|
3: [ // 待配送
|
|||
|
|
{
|
|||
|
|
settlementOrderNo: 'S2024101204',
|
|||
|
|
daySn: '4',
|
|||
|
|
orderNo: 'O2024101204001',
|
|||
|
|
unitOrderNo: 'U2024101204',
|
|||
|
|
payTime: '2024-10-12 08:20:10',
|
|||
|
|
preparedCount: 3,
|
|||
|
|
totalCount: 3,
|
|||
|
|
distance: 4.5,
|
|||
|
|
expectDeliveryTime: 25,
|
|||
|
|
deliveryType: 1,
|
|||
|
|
orderCategory: 1,
|
|||
|
|
orderStatus: 3 // 待配送状态
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
settlementOrderNo: 'S2024101207',
|
|||
|
|
daySn: '7',
|
|||
|
|
orderNo: 'O2024101207001',
|
|||
|
|
unitOrderNo: 'U2024101207',
|
|||
|
|
payTime: '2024-10-12 09:00:00',
|
|||
|
|
preparedCount: 3,
|
|||
|
|
totalCount: 3,
|
|||
|
|
distance: 3.5,
|
|||
|
|
expectDeliveryTime: 20,
|
|||
|
|
deliveryType: 4, // 同城配送
|
|||
|
|
deliveryAddress: '深圳市南山区科技园南区深圳湾科技生态园10栋A座2601',
|
|||
|
|
orderCategory: 1,
|
|||
|
|
orderStatus: 3 // 待配送状态
|
|||
|
|
}
|
|||
|
|
],
|
|||
|
|
4: [ // 待送达
|
|||
|
|
{
|
|||
|
|
settlementOrderNo: 'S2024101205',
|
|||
|
|
daySn: '5',
|
|||
|
|
payTime: '2024-10-12 07:45:20',
|
|||
|
|
preparedCount: 2,
|
|||
|
|
totalCount: 2,
|
|||
|
|
distance: 1.2,
|
|||
|
|
expectDeliveryTime: 8,
|
|||
|
|
deliveryType: 4, // 修改为同城配送
|
|||
|
|
deliveryAddress: '深圳市福田区华强北街道振兴路101号华强广场3栋1808室',
|
|||
|
|
receiverName: '张先生',
|
|||
|
|
receiverPhone: '13800138000',
|
|||
|
|
orderCategory: 1
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
settlementOrderNo: 'S2024101206',
|
|||
|
|
daySn: '6',
|
|||
|
|
payTime: '2024-10-12 08:10:35',
|
|||
|
|
preparedCount: 5,
|
|||
|
|
totalCount: 5,
|
|||
|
|
distance: 2.8,
|
|||
|
|
expectDeliveryTime: 18,
|
|||
|
|
deliveryType: 1,
|
|||
|
|
orderCategory: 1
|
|||
|
|
}
|
|||
|
|
]
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
let currentTab = '2';
|
|||
|
|
let currentCategory = '1';
|
|||
|
|
|
|||
|
|
// 渲染订单列表
|
|||
|
|
function renderOrders() {
|
|||
|
|
const orderList = document.getElementById('orderList');
|
|||
|
|
const orders = mockOrders[currentTab] || [];
|
|||
|
|
|
|||
|
|
if (orders.length === 0) {
|
|||
|
|
orderList.innerHTML = `
|
|||
|
|
<div class="empty-state">
|
|||
|
|
<div class="empty-icon">📦</div>
|
|||
|
|
<div>暂无订单</div>
|
|||
|
|
</div>
|
|||
|
|
`;
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
orderList.innerHTML = orders.map(order => {
|
|||
|
|
const percent = (order.preparedCount / order.totalCount * 100).toFixed(0);
|
|||
|
|
const deliveryTypeMap = {
|
|||
|
|
1: '全国配送',
|
|||
|
|
2: '专员配送',
|
|||
|
|
3: '自提',
|
|||
|
|
4: '同城配送'
|
|||
|
|
};
|
|||
|
|
const deliveryTypeText = deliveryTypeMap[order.deliveryType] || '未知';
|
|||
|
|
return `
|
|||
|
|
<div class="order-card" onclick="goToDetail('${order.settlementOrderNo}')">
|
|||
|
|
<div class="order-header">
|
|||
|
|
<div>
|
|||
|
|
<div class="order-number">结算订单流水号 ${order.daySn}</div>
|
|||
|
|
<div class="order-time">${order.payTime}</div>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="order-info">
|
|||
|
|
<div>结算订单号:${order.settlementOrderNo}</div>
|
|||
|
|
</div>
|
|||
|
|
${order.orderNo ? `
|
|||
|
|
<div class="order-info">
|
|||
|
|
<div>订单编号:${order.orderNo}</div>
|
|||
|
|
</div>
|
|||
|
|
` : ''}
|
|||
|
|
<div class="order-info">
|
|||
|
|
<div>配送方式:${deliveryTypeText}</div>
|
|||
|
|
</div>
|
|||
|
|
${order.deliveryAddress ? `
|
|||
|
|
<div class="order-info">
|
|||
|
|
<div>配送地址:${order.deliveryAddress}</div>
|
|||
|
|
</div>
|
|||
|
|
` : ''}
|
|||
|
|
<div class="order-info">
|
|||
|
|
<div>配送距离 ${order.distance.toFixed(2)}km</div>
|
|||
|
|
<div>约${order.expectDeliveryTime}分钟</div>
|
|||
|
|
</div>
|
|||
|
|
${currentTab === '2' ? `
|
|||
|
|
<div class="order-info">
|
|||
|
|
<div class="progress-wrapper">
|
|||
|
|
<span>备货情况</span>
|
|||
|
|
<div class="progress-bar">
|
|||
|
|
<div class="progress-fill" style="width: ${percent}%"></div>
|
|||
|
|
</div>
|
|||
|
|
<span>${order.preparedCount}/${order.totalCount}</span>
|
|||
|
|
</div>
|
|||
|
|
<span class="arrow-icon">›</span>
|
|||
|
|
</div>
|
|||
|
|
<div class="order-info">
|
|||
|
|
<button class="btn-print" onclick="handlePrint(event, '${order.settlementOrderNo}')">打印订单</button>
|
|||
|
|
</div>
|
|||
|
|
` : ''}
|
|||
|
|
${currentTab === '3' ? `
|
|||
|
|
<div class="btn-group">
|
|||
|
|
<button class="btn-secondary" onclick="handlePrint(event, '${order.settlementOrderNo}')">打印订单</button>
|
|||
|
|
<button class="btn-primary" onclick="handleStartDelivery(event, '${order.settlementOrderNo}')">开始配送</button>
|
|||
|
|
</div>
|
|||
|
|
` : ''}
|
|||
|
|
${currentTab === '4' && order.receiverName ? `
|
|||
|
|
<div class="delivery-info-section">
|
|||
|
|
<div class="receiver-info">
|
|||
|
|
<span>收货人:${order.receiverName}</span>
|
|||
|
|
<span>${order.receiverPhone}</span>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="contact-buttons">
|
|||
|
|
<button class="btn-icon" onclick="handleSendMessage(event, '${order.receiverPhone}')">
|
|||
|
|
<span>💬</span>
|
|||
|
|
<span>发送信息</span>
|
|||
|
|
</button>
|
|||
|
|
<button class="btn-icon" onclick="handleCall(event, '${order.receiverPhone}')">
|
|||
|
|
<span>📞</span>
|
|||
|
|
<span>电话联系</span>
|
|||
|
|
</button>
|
|||
|
|
</div>
|
|||
|
|
<button class="btn-confirm" onclick="handleConfirmDelivery(event, '${order.settlementOrderNo}')">确认送达</button>
|
|||
|
|
` : ''}
|
|||
|
|
</div>
|
|||
|
|
`;
|
|||
|
|
}).join('');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 标签切换
|
|||
|
|
document.querySelectorAll('.tab').forEach(tab => {
|
|||
|
|
tab.addEventListener('click', () => {
|
|||
|
|
document.querySelectorAll('.tab').forEach(t => t.classList.remove('active'));
|
|||
|
|
tab.classList.add('active');
|
|||
|
|
currentTab = tab.dataset.tab;
|
|||
|
|
renderOrders();
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
// 订单类型切换
|
|||
|
|
document.querySelectorAll('.category-tab').forEach(tab => {
|
|||
|
|
tab.addEventListener('click', () => {
|
|||
|
|
document.querySelectorAll('.category-tab').forEach(t => t.classList.remove('active'));
|
|||
|
|
tab.classList.add('active');
|
|||
|
|
currentCategory = tab.dataset.category;
|
|||
|
|
renderOrders();
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
// 跳转到订单详情
|
|||
|
|
function goToDetail(settlementOrderNo) {
|
|||
|
|
const order = Object.values(mockOrders).flat().find(o => o.settlementOrderNo === settlementOrderNo);
|
|||
|
|
if (order) {
|
|||
|
|
// 将订单信息存储到sessionStorage,模拟页面跳转传参
|
|||
|
|
sessionStorage.setItem('currentOrder', JSON.stringify(order));
|
|||
|
|
window.location.href = '专员端-订单详情演示.html';
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 打印订单
|
|||
|
|
function handlePrint(event, settlementOrderNo) {
|
|||
|
|
event.stopPropagation();
|
|||
|
|
showToast('正在打印订单 ' + settlementOrderNo);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 开始配送
|
|||
|
|
function handleStartDelivery(event, settlementOrderNo) {
|
|||
|
|
event.stopPropagation();
|
|||
|
|
showToast('开始配送订单 ' + settlementOrderNo);
|
|||
|
|
// 这里可以添加实际的配送逻辑
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 发送信息
|
|||
|
|
function handleSendMessage(event, phone) {
|
|||
|
|
event.stopPropagation();
|
|||
|
|
showToast('正在发送信息给 ' + phone);
|
|||
|
|
// 这里可以跳转到短信应用或站内消息
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 电话联系
|
|||
|
|
function handleCall(event, phone) {
|
|||
|
|
event.stopPropagation();
|
|||
|
|
showToast('正在拨打电话 ' + phone);
|
|||
|
|
// 这里可以触发拨打电话
|
|||
|
|
// window.location.href = 'tel:' + phone;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 确认送达
|
|||
|
|
function handleConfirmDelivery(event, settlementOrderNo) {
|
|||
|
|
event.stopPropagation();
|
|||
|
|
if (confirm('确认订单已送达?')) {
|
|||
|
|
showToast('订单 ' + settlementOrderNo + ' 已确认送达');
|
|||
|
|
// 这里可以添加确认送达的逻辑
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 显示Toast
|
|||
|
|
function showToast(message) {
|
|||
|
|
const toast = document.getElementById('toast');
|
|||
|
|
toast.textContent = message;
|
|||
|
|
toast.classList.add('show');
|
|||
|
|
setTimeout(() => {
|
|||
|
|
toast.classList.remove('show');
|
|||
|
|
}, 2000);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// 初始化
|
|||
|
|
renderOrders();
|
|||
|
|
</script>
|
|||
|
|
</body>
|
|||
|
|
</html>
|