修改位置交互,修改代码逻辑

This commit is contained in:
2025-10-18 22:21:04 +08:00
parent c446df73b5
commit 39fa0b2d04
36 changed files with 2743 additions and 1995 deletions

View File

@@ -42,7 +42,7 @@ Page({
userInfo: {
id: 1,
name: '管理员',
role: 'ADMIN',
role: 'ADMIN' as any,
phone: '13800138000'
}
});
@@ -150,10 +150,11 @@ Page({
// 添加员工位置标记
deliveryPersons.forEach(person => {
// 使用默认坐标实际位置由locationTrackingService统一管理
markers.push({
id: 20000 + person.id, // 避免ID冲突
longitude: person.currentLocation.longitude,
latitude: person.currentLocation.latitude,
longitude: 102.833722, // 默认经度
latitude: 24.880095, // 默认纬度
title: person.name,
iconPath: this.getStaffStatusIcon(person.status),
width: 32,
@@ -259,7 +260,7 @@ Page({
if (assignedPerson) {
this.setData({
mapCenter: assignedPerson.currentLocation
mapCenter: { longitude: 102.833722, latitude: 24.880095 } // 默认坐标
});
// 绘制从起点到终点的路线
@@ -526,25 +527,19 @@ Page({
this.hideAddModal();
},
// 切换底部页签
// 底部页签切换
switchMainTab(e: any) {
const tab = e.currentTarget.dataset.tab;
this.setData({
currentTab: tab
});
// 根据不同的页签执行不同的逻辑
switch (tab) {
case 'main':
// 管理中心,显示所有内容
break;
case 'orders':
// 订单详情,可能需要调整布局
break;
case 'staff':
// 员工管理,可能需要调整布局
break;
}
},
// 跳转到员工管理页面
goToEmployeeManagement() {
wx.navigateTo({
url: '/pages/employee/employee'
});
},
// 地图点击事件

View File

@@ -52,6 +52,7 @@
<view class="staff-section">
<view class="section-header">
<text class="section-title">员工管理</text>
<button class="manage-btn" bindtap="goToEmployeeManagement">管理员工</button>
</view>
<scroll-view class="staff-list" scroll-y>

View File

@@ -112,6 +112,20 @@
min-width: 160rpx;
}
.manage-btn {
background-color: #1890ff;
color: white;
font-size: 28rpx;
padding: 10rpx 20rpx;
border-radius: 40rpx;
border: none;
min-width: 160rpx;
}
.manage-btn:active {
background-color: #096dd9;
}
/* 订单标签页 */
.order-tabs {
display: flex;