修改位置交互,修改代码逻辑
This commit is contained in:
@@ -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'
|
||||
});
|
||||
},
|
||||
|
||||
// 地图点击事件
|
||||
|
@@ -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>
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user