瀏覽代碼

初版

master
dong 6 月之前
父節點
當前提交
4466bd93f5
共有 48 個檔案被更改,包括 5913 行新增953 行删除
  1. 2
    2
      api/index.js
  2. 369
    19
      app.js
  3. 14
    8
      app.json
  4. 1001
    408
      package-map/pages/map/index.js
  5. 1
    1
      package-map/pages/map/index.json
  6. 343
    91
      package-map/pages/map/index.wxml
  7. 458
    8
      package-map/pages/map/index.wxss
  8. 917
    0
      package-map/pages/map/indexcopy.js
  9. 309
    0
      package-map/pages/map/indexcopy.wxml
  10. 41
    4
      package-order/pages/address/index.js
  11. 2
    1
      package-order/pages/address/index.json
  12. 13
    5
      package-order/pages/address/index.wxml
  13. 54
    0
      package-order/pages/address/index.wxss
  14. 129
    39
      package-order/pages/createorder/index.js
  15. 64
    29
      package-order/pages/createorder/index.wxml
  16. 13
    0
      package-order/pages/createorder/index.wxss
  17. 209
    0
      package-order/pages/mapSelect/index.js
  18. 6
    0
      package-order/pages/mapSelect/index.json
  19. 49
    0
      package-order/pages/mapSelect/index.wxml
  20. 84
    0
      package-order/pages/mapSelect/index.wxss
  21. 265
    0
      package-order/pages/newaddress/index.js
  22. 8
    0
      package-order/pages/newaddress/index.json
  23. 120
    0
      package-order/pages/newaddress/index.wxml
  24. 194
    0
      package-order/pages/newaddress/index.wxss
  25. 0
    0
      package-order/utils/areaData.json
  26. 317
    0
      package-order/utils/parseFullAddress.js
  27. 9
    1
      package-user/components/captcha/index.js
  28. 1
    0
      package-user/components/slide-confirm/index.wxss
  29. 9
    39
      package-user/pages/login/index.js
  30. 11
    2
      package-user/pages/login/index.wxml
  31. 26
    1
      package-user/pages/login/index.wxss
  32. 99
    12
      package-user/pages/userlist/index.js
  33. 3
    1
      package-user/pages/userlist/index.json
  34. 32
    5
      package-user/pages/userlist/index.wxml
  35. 36
    1
      package-user/pages/userlist/index.wxss
  36. 83
    153
      pages/index/index.js
  37. 70
    59
      pages/index/index.wxml
  38. 31
    10
      pages/index/index.wxss
  39. 9
    18
      pages/setup/index.js
  40. 1
    1
      pages/setup/index.json
  41. 13
    12
      pages/setup/index.wxml
  42. 42
    6
      pages/tool/index.js
  43. 21
    15
      pages/tool/index.wxml
  44. 1
    0
      pages/tool/index.wxss
  45. 1
    1
      project.config.json
  46. 8
    1
      project.private.config.json
  47. 二進制
      static/9efa1691f71a48b6ae20648c0a2dae56.png
  48. 425
    0
      utils/latitude.json

+ 2
- 2
api/index.js 查看文件

@@ -1,7 +1,7 @@
1 1
 // api.jshttp://zlink.bjdexn.cn
2
-const baseUrl = 'http://192.168.8.187:8080';  // 替换为您的接口基础 URL
2
+// const baseUrl = 'http://192.168.8.102:8088';  // 替换为您的接口基础 URL
3 3
 const esosUrl = 'https://esos-iot.bjdexn.cn';  // 线上
4
-// const baseUrl = 'https://esos-iot.bjdexn.cn:8443';  // 线上
4
+const baseUrl = 'https://esos-iot.bjdexn.cn:9443';  // 线上
5 5
 
6 6
 // const baseUrl = 'http://192.168.8.105:8888';  // 替换为您的接口基础 URL
7 7
 //  

+ 369
- 19
app.js 查看文件

@@ -1,35 +1,385 @@
1 1
 // app.js
2
-const QQMapWX = require('./libs/qqmap-wx-jssdk.min.js');
3
-
2
+const api = require('./api/index.js'); // 注意路径
4 3
 App({
4
+  globalData: {
5
+    socketTask: null,
6
+    isConnected: false,
7
+    reconnectTimer: null,
8
+    heartbeatTimer: null,
9
+    currentWorkorderId: '',
10
+    userInfo: wx.getStorageSync('user') || {}
11
+  },
12
+
5 13
   onLaunch() {
6
-    // 初始化腾讯地图SDK
7
-    this.qqmapsdk = new QQMapWX({
8
-      key: 'VRGBZ-ZFRHB-SKIUP-NHHJ3-TXGJT-ZIFG3' // 请替换为你自己的腾讯地图KEY
9
-    });
14
+    // wx.setStorageSync('user', { userId: 'driver_1001', operationRole: 4 }); 
15
+    this.initWebSocketService();
16
+    wx.onAppShow(() => this.handleAppShow());
17
+    wx.onAppHide(() => this.handleAppHide());
18
+    this.locationService = {
19
+      isTracking: false,
20
+      currentWorkorderId: '', // 存储当前跟踪的工单ID
21
+      isLocationUpdateStarted: false // 标记是否已启动定位服务
22
+    };
23
+  },
24
+
25
+  initWebSocketService() {
26
+    if (!this.wsService) {
27
+      this.wsService = {
28
+        connect: (url) => {
29
+          const that = this;
30
+          if (that.globalData.socketTask) {
31
+            that.wsService.close();
32
+          }
33
+
34
+          console.log('正在连接WebSocket:', url);
35
+          const socketTask = wx.connectSocket({ url, header: { 'content-type': 'application/json' } });
36
+
37
+          socketTask.onOpen(() => {
38
+            console.log('WebSocket 连接成功');
39
+            that.globalData.isConnected = true;
40
+            that.globalData.socketTask = socketTask;
41
+            that.clearReconnectTimer();
42
+            // that.startHeartbeat();
43
+            if (that.globalData.currentWorkorderId) {
44
+              that.wsService.send({ type: 'subscribe', workorderId: that.globalData.currentWorkorderId });
45
+            }
46
+            wx.$emit('socketOpen');
47
+          });
48
+
49
+          socketTask.onMessage((res) => {
50
+            try {
51
+              console.log(res);
52
+              const message = JSON.parse(res.data);
53
+              console.log('收到消息:', message);
54
+              wx.$emit('wsMessage', message);
55
+            } catch (err) { console.error('消息解析失败', err); }
56
+          });
57
+
58
+          socketTask.onClose((res) => {
59
+            console.log('WebSocket 连接关闭, 状态码:', res.code);
60
+            that.globalData.isConnected = false;
61
+            that.globalData.socketTask = null;
62
+            that.stopHeartbeat();
63
+            wx.$emit('socketClose');
64
+            if (res.code !== 1000) { that.startReconnect(); }
65
+          });
66
+
67
+          socketTask.onError((err) => {
68
+            console.error('WebSocket 连接错误:', err);
69
+            that.globalData.isConnected = false;
70
+            that.globalData.socketTask = null;
71
+            that.stopHeartbeat();
72
+            wx.$emit('socketError', err);
73
+          });
74
+        },
75
+
76
+        send: (data) => {
77
+          const that = this;
78
+          if (that.globalData.isConnected && that.globalData.socketTask) {
79
+            try {
80
+              that.globalData.socketTask.send({
81
+                data: JSON.stringify(data),
82
+                fail: (err) => {
83
+                  console.error('消息发送失败:', err);
84
+                  wx.showToast({ title: '消息发送失败', icon: 'none' });
85
+                }
86
+              });
87
+            } catch (e) { console.error('消息序列化失败:', e); }
88
+          } else {
89
+            console.warn('WebSocket 未连接');
90
+            wx.showToast({ title: '网络连接中...', icon: 'none' });
91
+          }
92
+        },
93
+
94
+        close: (code = 1000, reason = 'normal close') => {
95
+          const that = this;
96
+          if (that.globalData.socketTask) {
97
+            console.log(`关闭WebSocket连接: ${code} - ${reason}`);
98
+            that.globalData.socketTask.close({ code, reason });
99
+          }
100
+        }
101
+      };
102
+    }
103
+  },
104
+
105
+  handleAppShow() {
106
+    const that = this;
107
+    console.log(!that.globalData.isConnected);
108
+    console.log(!that.globalData.reconnectTimer);
109
+    if (!that.globalData.isConnected && !that.globalData.reconnectTimer) {
110
+      const { operationId, operationRole } = that.globalData.userInfo;
111
+      console.log(operationRole);
112
+      // 修复:startReconnect 中用了 operationId,这里统一字段
113
+      if (!operationId) {
114
+        console.error('用户operationId不存在,无法连接WebSocket');
115
+        return;
116
+      }
117
+      const wsUrl = `wss://esos-iot.bjdexn.cn:9443/communication/update/${operationId}`;
118
+      that.wsService.connect(wsUrl);
119
+    }
120
+  },
121
+
122
+  handleAppHide() {
123
+    // 可以选择在后台关闭连接
124
+    // this.wsService.close(1001, 'app enter background');
125
+  },
126
+
127
+  startHeartbeat() {
128
+    const that = this;
129
+    that.stopHeartbeat();
130
+    that.heartbeatTimer = setInterval(() => {
131
+      if (that.globalData.isConnected) {
132
+        that.wsService.send({ type: 'heartbeat', timestamp: Date.now() });
133
+      }
134
+    }, 5000);
135
+  },
136
+
137
+  stopHeartbeat() {
138
+    if (this.heartbeatTimer) {
139
+      clearInterval(this.heartbeatTimer);
140
+      this.heartbeatTimer = null;
141
+    }
142
+  },
143
+
144
+  startReconnect() {
145
+    const that = this;
146
+    that.clearReconnectTimer();
147
+    let delay = 1000;
148
+    that.globalData.reconnectTimer = setInterval(() => {
149
+      if (!that.globalData.isConnected) {
150
+        console.log(`尝试重连 in ${delay}ms...`);
151
+        const { operationId, operationRole } = that.globalData.userInfo; // 修复:用 operationId 而非 userId
152
+        if (operationId) {
153
+          const wsUrl = `wss://esos-iot.bjdexn.cn:9443/communication/update/${operationId}`;
154
+          that.wsService.connect(wsUrl);
155
+        }
156
+        delay = Math.min(delay * 2, 8000);
157
+      } else {
158
+        that.clearReconnectTimer();
159
+      }
160
+    }, delay);
161
+  },
162
+
163
+  clearReconnectTimer() {
164
+    if (this.globalData.reconnectTimer) {
165
+      clearInterval(this.globalData.reconnectTimer);
166
+      this.globalData.reconnectTimer = null;
167
+    }
168
+  },
10 169
 
11
-    // 检查是否授权获取位置信息
170
+  /**
171
+   * 司机端开始后台定位并上传(单工单)
172
+   * @param {string} workorderId - 当前工单ID
173
+   */
174
+  startDriverLocationUpload(workorderId) {
175
+    const service = this.locationService;
176
+
177
+    // 入参校验
178
+    if (!workorderId) {
179
+      console.error('工单ID不能为空');
180
+      wx.showToast({ title: '工单ID异常', icon: 'none' });
181
+      return;
182
+    }
183
+
184
+    // 如果已经在为当前订单上传,则忽略
185
+    if (service.isTracking && service.currentWorkorderId === workorderId) {
186
+      console.log(`已经在为订单 ${workorderId} 上传位置`);
187
+      return;
188
+    }
189
+
190
+    // 如果已经在为其他订单上传,先停止
191
+    if (service.isTracking && service.currentWorkorderId !== workorderId) {
192
+      console.log(`当前正在为订单 ${service.currentWorkorderId} 上传,切换到 ${workorderId},先停止旧定位`);
193
+      this.stopDriverLocationUpload();
194
+    }
195
+
196
+    // 权限校验
12 197
     wx.getSetting({
13
-      success: res => {
14
-        if (!res.authSetting['scope.userLocation']) {
198
+      success: (res) => {
199
+        if (!res.authSetting['scope.userLocationBackground']) {
15 200
           wx.authorize({
16
-            scope: 'scope.userLocation',
201
+            scope: 'scope.userLocationBackground',
17 202
             success: () => {
18
-              console.log('位置授权成功');
203
+              this._doStartLocationUpload(workorderId, service);
19 204
             },
20 205
             fail: () => {
21
-              console.log('位置授权失败');
22
-              wx.showToast({
23
-                title: '请开启位置权限',
24
-                icon: 'none'
206
+              wx.showModal({
207
+                title: '权限不足',
208
+                content: '需要开启后台定位权限才能实时上传位置,请前往设置页开启',
209
+                confirmText: '去设置',
210
+                success: (modalRes) => {
211
+                  if (modalRes.confirm) {
212
+                    wx.openSetting({
213
+                      success: (settingRes) => {
214
+                        if (settingRes.authSetting['scope.userLocationBackground']) {
215
+                          this._doStartLocationUpload(workorderId, service);
216
+                        }
217
+                      }
218
+                    });
219
+                  }
220
+                }
25 221
               });
26
-            }
222
+            } 
27 223
           });
224
+        } else {
225
+          this._doStartLocationUpload(workorderId, service);
28 226
         }
29 227
       }
30 228
     });
31 229
   },
32
-  globalData: {
33
-    userInfo: null
34
-  }
230
+
231
+  /**
232
+   * 私有方法:执行真正的定位启动逻辑(核心修复:兼容低版本,改用 wx.onLocationChange)
233
+   */
234
+  _doStartLocationUpload(workorderId, service) {
235
+    console.log(`开始为订单 ${workorderId} 启动后台定位上传...`);
236
+    service.currentWorkorderId = workorderId;
237
+
238
+    // 修复1:先移除旧的定位监听(防止重复监听)
239
+    this._removeLocationListener();
240
+
241
+    // 修复2:启动后台定位(兼容低版本,用 startLocationUpdate 兜底)
242
+    const startLocationApi = wx.startLocationUpdateBackground || wx.startLocationUpdate;
243
+    startLocationApi({
244
+      type: 'gcj02',
245
+      success: (res) => {
246
+        console.log('定位服务已启动', res);
247
+        service.isLocationUpdateStarted = true;
248
+
249
+        // 修复3:改用低版本支持的 wx.onLocationChange(替代 wx.watchPosition)
250
+        wx.onLocationChange((location) => {
251
+          console.log('位置变化,准备上传:', location);
252
+          this._uploadLocation(location, workorderId);
253
+        });
254
+
255
+        // 标记定位中状态
256
+        service.isTracking = true;
257
+        console.log('位置监听已注册,开始实时上传');
258
+      },
259
+      fail: (err) => {
260
+        let errMsg = '启动定位失败';
261
+        if (err.errMsg.includes('auth deny')) errMsg = '定位权限被拒绝';
262
+        else if (err.errMsg.includes('system')) errMsg = '系统不支持定位';
263
+        
264
+        console.error(errMsg, err);
265
+        wx.showToast({ title: errMsg, icon: 'none', duration: 2000 });
266
+      }
267
+    });
268
+  },
269
+
270
+  /**
271
+   * 司机端停止定位上传(核心修复:对应移除 wx.onLocationChange 监听)
272
+   */
273
+  stopDriverLocationUpload() {
274
+    const service = this.locationService;
275
+
276
+    if (!service.isTracking) {
277
+      return;
278
+    }
279
+
280
+    console.log(`停止为订单 ${service.currentWorkorderId} 上传位置`);
281
+
282
+    // 1. 移除位置监听(wx.onLocationChange 对应 wx.offLocationChange)
283
+    this._removeLocationListener();
284
+
285
+    // 2. 停止定位服务(兼容低版本,用 stopLocationUpdate 兜底)
286
+    this._stopLocationService();
287
+
288
+    // 3. 重置状态
289
+    service.isTracking = false;
290
+    service.currentWorkorderId = '';
291
+    service.isLocationUpdateStarted = false;
292
+  },
293
+
294
+  /**
295
+   * 私有方法:移除位置监听(兼容低版本)
296
+   */
297
+  _removeLocationListener() {
298
+    if (wx.offLocationChange) {
299
+      wx.offLocationChange();
300
+      console.log('位置监听已移除');
301
+    } else {
302
+      console.warn('当前基础库不支持 wx.offLocationChange,可能存在重复监听风险');
303
+    }
304
+  },
305
+
306
+  /**
307
+   * 私有方法:统一停止定位服务(兼容低版本)
308
+   */
309
+  _stopLocationService() {
310
+    const stopLocationApi = wx.stopLocationUpdateBackground || wx.stopLocationUpdate;
311
+    if (stopLocationApi && this.locationService.isLocationUpdateStarted) {
312
+      stopLocationApi({
313
+        success: (res) => {
314
+          console.log('定位服务已停止', res);
315
+        },
316
+        fail: (err) => {
317
+          console.error('停止定位服务失败:', err);
318
+        }
319
+      });
320
+    }
321
+  },
322
+
323
+  /**
324
+   * 私有方法:上传位置到服务器(无改动)
325
+   */
326
+  _uploadLocation(location, workorderId, retryCount = 0) {
327
+    const maxRetry = 2;
328
+    const isLatValid = location.latitude >= 3.86 && location.latitude <= 53.55;
329
+    const isLngValid = location.longitude >= 73.66 && location.longitude <= 135.05;
330
+
331
+    if (!isLatValid || !isLngValid) {
332
+      console.warn(`无效位置信息(订单: ${workorderId}),跳过上传`, location);
333
+      return;
334
+    }
335
+
336
+    const data = {
337
+      workorderId: workorderId,
338
+      latitude: location.latitude,
339
+      longitude: location.longitude,
340
+      createTime: Date.now(),
341
+      accuracy: location.accuracy
342
+    };
343
+
344
+    api.request(`/sysworkorder/insercoordinateredis`, 'post', data, { isPublic: false })
345
+      .then((response) => {
346
+        if (response.code !== 200) {
347
+          throw new Error(`响应码异常: ${response.code}`);
348
+        }
349
+        console.log(`位置上传成功 (订单: ${workorderId})`, data);
350
+      })
351
+      .catch((err) => {
352
+        console.error(`位置上传失败(第${retryCount+1}次)(订单: ${workorderId})`, err);
353
+        if (retryCount < maxRetry) {
354
+          setTimeout(() => {
355
+            this._uploadLocation(location, workorderId, retryCount + 1);
356
+          }, 10000 * (retryCount + 1));
357
+        } else {
358
+          wx.showToast({ title: '位置上传失败,请检查网络', icon: 'none' });
359
+        }
360
+      });
361
+  },
35 362
 });
363
+
364
+// 全局事件总线
365
+wx.$on = function (eventName, callback) {
366
+  if (!this.$events) this.$events = {};
367
+  if (!this.$events[eventName]) this.$events[eventName] = [];
368
+  this.$events[eventName].push(callback);
369
+};
370
+
371
+wx.$emit = function (eventName, data) {
372
+  if (!this.$events || !this.$events[eventName]) return;
373
+  this.$events[eventName].forEach(callback => callback(data));
374
+};
375
+
376
+wx.$off = function (eventName, callback) {
377
+  if (!this.$events || !this.$events[eventName]) return;
378
+  if (callback) {
379
+    this.$events[eventName] = this.$events[eventName].filter(cb => cb !== callback);
380
+  } else {
381
+    this.$events[eventName] = [];
382
+  }
383
+};
384
+// 司机端增加人脸识别与指纹识别,
385
+// 云平台12月份电价整理

+ 14
- 8
app.json 查看文件

@@ -5,11 +5,15 @@
5 5
     "pages/tool/index",
6 6
     "pages/equipment/index"
7 7
   ],
8
+  "requiredBackgroundModes": ["location"],
9
+ 
8 10
   "requiredPrivateInfos": [
9 11
     "getLocation",
12
+    "onLocationChange",
10 13
     "startLocationUpdate",
11 14
     "startLocationUpdateBackground"
12 15
   ],
16
+
13 17
   "permission": {
14 18
     "scope.userLocation": {
15 19
       "desc": "你的位置信息将用于展示轨迹和计算距离"
@@ -17,15 +21,19 @@
17 21
     "scope.setClipboardData": {
18 22
       "desc": "用于复制内容到剪贴板,方便用户分享或使用"
19 23
     },
24
+    "scope.userLocationBackground": {
25
+      "desc": "你的位置信息将用于小程序后台定位功能"
26
+    },
20 27
     "scope.phoneNumber": {
21 28
       "desc": "为了快速完成账号注册与登录,验证您的身份信息,保障账号安全,我们需要获取您的手机号。我们将严格按照隐私政策保护您的信息,不会用于其他用途。"
22 29
     }
23 30
   },
24 31
   "window": {
25 32
     "navigationBarTextStyle": "black",
26
-    "navigationBarTitleText": "晟运能源",
33
+    "navigationBarTitleText": "电速宝",
27 34
     "navigationBarBackgroundColor": "#ffffff"
28 35
   },
36
+  
29 37
   "plugins": {
30 38
     "route-plan": {
31 39
       "version": "2.0.1",
@@ -51,12 +59,7 @@
51 59
         "iconPath": "static/55.png",
52 60
         "selectedIconPath": "static/66.png"
53 61
       },
54
-      {
55
-        "pagePath": "pages/equipment/index",
56
-        "text": "设备",
57
-        "iconPath": "static/3.png",
58
-        "selectedIconPath": "static/4.png"
59
-      },
62
+   
60 63
       {
61 64
         "pagePath": "pages/setup/index",
62 65
         "text": "我的",
@@ -83,7 +86,10 @@
83 86
       "pages": [
84 87
         "pages/createorder/index",
85 88
         "pages/driver/index",
86
-        "pages/address/index"
89
+        "pages/address/index",
90
+        "pages/newaddress/index",
91
+        "pages/mapSelect/index"
92
+        
87 93
       ]
88 94
     },
89 95
     {

+ 1001
- 408
package-map/pages/map/index.js
文件差異過大導致無法顯示
查看文件


+ 1
- 1
package-map/pages/map/index.json 查看文件

@@ -1,5 +1,5 @@
1 1
 {
2
-  "navigationBarTitleText": "晟能能源",
2
+  "navigationBarTitleText": "电速宝",
3 3
   "permission": {
4 4
     "scope.userLocation": {
5 5
       "desc": "你的位置信息将用于展示行驶轨迹"

+ 343
- 91
package-map/pages/map/index.wxml 查看文件

@@ -1,15 +1,5 @@
1 1
 <view class="container">
2
-   <!-- 地图组件 -->
3
-   <!-- <map 
4
-    id="map"
5
-    class="map"
6
-    longitude="{{longitude}}"
7
-    latitude="{{latitude}}"
8
-    scale="16"
9
-    markers="{{markers}}"
10
-    polyline="{{polyline}}"
11
-    show-location
12
-  ></map> -->
2
+  <!-- 地图组件 -->
13 3
   <map 
14 4
     id="map"
15 5
     class="map"
@@ -17,19 +7,20 @@
17 7
     latitude="{{latitude}}"
18 8
     markers="{{markers}}"
19 9
     polyline="{{plannedRoute}}"
10
+    include-points="{{trackPoints}}"
20 11
     bindcontroltap="controltap"
21 12
     show-location
22 13
     scale="16"
14
+    enable-zoom="{{true}}"
15
+    enable-scroll="{{true}}"
16
+    enable-rotate="{{false}}"
23 17
   ></map>
24
-   <!-- 规划路线叠加显示 -->
25
-   <!-- controls="{{controls}}" -->
26
- 
27
- 
28 18
   
29 19
   <!-- 信息提示 -->
30
-  <view class="info" wx:if="{{infoText}}">
20
+  <view class="info toast" wx:if="{{infoText}}">
31 21
     {{infoText}}
32 22
   </view>
23
+  
33 24
   <!-- 加载提示 -->
34 25
   <view wx:if="{{loading}}" class="loading-mask">
35 26
     <view class="loading-view">
@@ -38,84 +29,14 @@
38 29
   </view>
39 30
 
40 31
   <!-- 错误提示 -->
41
-  <view wx:if="{{error && !loading}}" class="error-message">
32
+  <view wx:if="{{error && !loading}}" class="error-message toast">
42 33
     {{error}}
43 34
   </view>
44
-<view class="storagecartext">
45
-<view>
46
-  <view class="destination-title">
47
-      目的地:{{orderdata.addressName}}
48
-    </view>
49
-    <view class="destination-font">需求:光伏/放电/100kW</view>
50
-
51
-    <view class="destination-font" wx:if="{{userdata.operationRole==5}}">{{orderdata.driverName}}·{{orderdata.carName}} <t-icon name="call-1-filled" size="28rpx" data-name="call-1-filled" data-phone="{{orderdata.driverphone}}" bind:tap="ontelephone" style="margin-left:20rpx"/> </view>
52
-    <view class="destination-font" wx:if="{{userdata.operationRole==4}}">客户:{{orderdata.customerName}} <t-icon name="call-1-filled" size="28rpx" data-name="call-1-filled" data-phone="{{orderdata.customerphone}}" bind:tap="ontelephone" style="margin-left:20rpx"/> </view>
53
-    <!-- <view class="destination-font">·</view> -->
54
-    <view class="destination-font">
55
-      <text wx:if="{{orderdata.workorderType==1}}">待处理</text>
56
-      <text wx:if="{{orderdata.workorderType==2}}">行驶中</text>
57
-      <text wx:if="{{orderdata.workorderType==3}}">到达指定地点</text>
58
-     <text wx:if="{{orderdata.workorderType==4}}">工作中</text>
59
-     <text wx:if="{{orderdata.workorderType==5}}">完成工作</text>
60
-    </view>
61
-
62
-</view>
63
-  <image class="storagecar" src="https://esos-iot.bjdexn.cn/myminio/project/c152026b9bc2485f83b39a6132df3ce7.png" mode="heightFix"/>
64
-</view>
65
-<!-- <view class="viewmore" bind:tap="navigation">查看更多</view> -->
66
-<!-- <view bind:tap="navigation">导航</view> -->
67
-  <!-- 路线列表 -->
68
-
69
- <!-- 控制按钮区域 -->
70
- <view class="control-panel">
71
-    <slide-confirm 
72
-    wx:if="{{orderdata.workorderType==1&&userdata.operationRole==1}}"
73
-    id="mySlideConfirm"
74
-data-type="{{orderdata.workorderType}}"
75
-
76
-  bind:success="onSlideSuccess" 
77
-  width="300" 
78
-  height="50"
79
-  defaultText="开始出发"
80
-  successText="验证通过"
81
-/>
82
-
83
-<slide-confirm 
84
-wx:if="{{orderdata.workorderType==2&&userdata.operationRole==1}}"
85
-id="mySlideConfirm"
86
-data-type="{{orderdata.workorderType}}"
87
-
88
-  bind:success="onSlideSuccess" 
89
-  width="300" 
90
-  height="50"
91
-  defaultText="到达目的地"
92
-  successText="验证通过"
93
-/>
94
-<slide-confirm 
95
-wx:if="{{orderdata.workorderType==3&&userdata.operationRole==1}}"
96
-id="mySlideConfirm"
97
-data-type="{{orderdata.workorderType}}"
98
-  bind:success="showVerificationPopup" 
99
-  width="300" 
100
-  height="50"
101
-  defaultText="开始工作"
102
-  successText="验证通过"
103
-/>
104
-<slide-confirm 
105
-wx:if="{{orderdata.workorderType==4&&userdata.operationRole==1}}"
106
-id="mySlideConfirm"
107
-data-type="{{orderdata.workorderType}}"
108
-
109
-  bind:success="onSlideSuccess" 
110
-  width="300" 
111
-  height="50"
112
-  defaultText="完成工作"
113
-  successText="验证通过"
114
-/>
115
-     
116 35
   
117
-  </view>
36
+  <view class="detailsbox"></view>
118 37
 </view>
38
+
39
+<!-- 验证码弹窗组件 -->
119 40
 <verification-popup 
120 41
   isShow="{{showVerification}}"
121 42
   phoneNumber="{{phoneNumber}}"
@@ -124,4 +45,335 @@ data-type="{{orderdata.workorderType}}"
124 45
   bind:confirm="onCodeConfirm"
125 46
   bind:resend="onResendCode"
126 47
   bind:complete="onCodeComplete"
127
-/>
48
+/>
49
+
50
+<!-- 底部可拖动卡片 -->
51
+<view class="taxi-card-container">
52
+  <!-- 背景遮罩 -->
53
+  <view 
54
+    class="mask" 
55
+    wx:if="{{cardHeight !== 'min'}}"
56
+    style="opacity: {{maskOpacity}};"
57
+    bindtap="closeCard"
58
+  ></view>
59
+
60
+  <!-- 可拖动卡片 -->
61
+  <view 
62
+    class="taxi-card"
63
+    style="height: {{currentHeight}}px;bottom: 0;transition: height 0.3s ease;border-radius: {{cardHeight === 'max' ? '0' : '16px 16px 0 0'}};" bindtouchstart="handleTouchStart" bindtouchmove="handleTouchMove" bindtouchend="handleTouchEnd"
64
+  >
65
+    <!-- 拖动指示器 -->
66
+    <view class="drag-handler" wx:if="{{cardHeight !== 'max'}}">
67
+      <view class="drag-bar"></view>
68
+    </view>
69
+    
70
+    <!-- 卡片内容 -->
71
+    <view class="card-content" style="padding-top: {{cardHeight === 'max' ? '40rpx' : '20rpx'}};">
72
+      <!-- 订单状态和基本信息 -->
73
+      <view class="storagecartext_box">
74
+      <view class="storagecartext">
75
+
76
+        <view class="destination-title1" style="margin-top: 10rpx;">
77
+          目的地:{{orderdata.poiName}}
78
+          <!-- 显示预计到达时间 -->
79
+        
80
+        </view>
81
+        
82
+        <!-- 客户/司机信息 -->
83
+        <view class="contact-info" wx:if="{{userdata.operationRole==5}}">
84
+          <view class="driver-info" wx:if="{{orderdata.driverphone==''}}">
85
+            司机:<text class="text-warning">分配中</text>
86
+          </view>
87
+          <view class="driver-info" wx:else>
88
+            司机:{{orderdata.driverName}}·{{orderdata.carName}}
89
+            <!-- 乘客视角显示预计到达时间 -->
90
+            <!-- <text wx:if="{{estimatedArrivalTime}}" class="estimated-time">
91
+              预计{{estimatedArrivalTime}}到达
92
+            </text> -->
93
+          </view>
94
+        </view>
95
+        
96
+        <view class="contact-info" wx:if="{{userdata.operationRole==4}}">
97
+          客户:{{orderdata.receiver}}  
98
+          <t-icon 
99
+            name="call-1-filled" 
100
+            size="28rpx" 
101
+            data-phone="{{orderdata.phone}}" 
102
+            bind:tap="ontelephone" 
103
+            class="icon-call"
104
+          />
105
+      
106
+        </view>
107
+        <view class="order-status">
108
+          <text wx:if="{{orderdata.workorderType==0}}" class="section-title">分配中</text>
109
+          <text wx:if="{{orderdata.workorderType==1}}" class="section-title">待出发</text>
110
+          <text wx:if="{{orderdata.workorderType==2}}" class="section-title">行驶中</text>
111
+          <text wx:if="{{orderdata.workorderType==3}}" class="section-title">到达地点</text>
112
+          <text wx:if="{{orderdata.workorderType==4}}" class="section-title">工作中</text>
113
+          <text wx:if="{{orderdata.workorderType==5}}" class="section-title">订单完成</text>
114
+          <text wx:if="{{estimatedArrivalTime && orderdata.workorderType==2}}" class="estimated-time">预计{{estimatedArrivalTime}}到达</text>
115
+        </view>
116
+        
117
+      </view>
118
+      
119
+      <!-- 操作图片 -->
120
+      <view class="action-images">
121
+        <image 
122
+          wx:if="{{userdata.operationRole==5}}" 
123
+          class="storagecar" 
124
+          src="https://esos-iot.bjdexn.cn/myminio/project/c152026b9bc2485f83b39a6132df3ce7.png" 
125
+          mode="heightFix"
126
+        />
127
+        <image 
128
+          wx:if="{{userdata.operationRole==4}}" 
129
+          class="storagecar1" 
130
+          src="https://esos-iot.bjdexn.cn/myminio/project/d98e4fde125f40819f8bd8fe872e409c.png" 
131
+          bind:tap="navigation" 
132
+          mode="heightFix"
133
+        />
134
+      </view>
135
+    </view>
136
+      
137
+      <!-- 更多操作按钮 -->
138
+      <view class="card_more" wx:if="{{userdata.operationRole==5&&orderdata.workorderType!=0}}">
139
+        <view class="card_morebox">联系客服</view>
140
+        <view class="card_morebox" data-phone="{{orderdata.driverphone}}" bind:tap="ontelephone">联系司机</view>
141
+        <view class="card_morebox" bind:tap="cancel">取消订单</view>
142
+        <view wx:if="{{orderdata.workorderType==5}}" class="card_morebox">开发票</view>
143
+        <view wx:if="{{orderdata.workorderType!=5}}" class="card_morebox" bind:tap="editorder">编辑订单</view>
144
+
145
+      </view>
146
+      
147
+      <!-- 客户视角内容 -->
148
+      <view class="card_box" wx:if="{{userdata.operationRole==5}}">
149
+        <!-- 订单详情 -->
150
+        <view class="detail-section" style="border-bottom: 1rpx solid #f5f5f5;">
151
+          <view class="section-header" bind:tap="onmore">
152
+            <view class="section-title">订单详情</view>
153
+            <view class="section-action">
154
+              <text>{{moretype ? '收起' : '展开详情'}}</text>
155
+              <t-icon name="{{moretype ? 'chevron-up' : 'chevron-down'}}" size="22px"/>
156
+            </view>
157
+          </view>
158
+          
159
+          <view class="detail-list" wx:if="{{moretype}}">
160
+            <view class="detail-item">
161
+              <view class="item-label">订单号</view>
162
+              <view class="item-value">{{orderdata.workorderId}}</view>
163
+            </view>
164
+            <view class="detail-item">
165
+              <view class="item-label">创建时间</view>
166
+              <view class="item-value">{{orderdata.workorderCreatetime}}</view>
167
+            </view>
168
+            <view class="detail-item">
169
+              <view class="item-label">订单类型</view>
170
+              <view class="item-value">{{orderdata.chargedischargeType==1 ? '充电' : '放电'}}</view>
171
+            </view>
172
+            <view class="detail-item">
173
+              <view class="item-label">需求电量</view>
174
+              <view class="item-value">{{orderdata.workorderElectricity}}</view>
175
+            </view>
176
+            <view class="detail-item">
177
+              <view class="item-label">SOC</view>
178
+              <view class="item-value">{{orderdata.soc}}</view>
179
+            </view>
180
+            <view class="detail-item">
181
+              <view class="item-label">车型</view>
182
+              <view class="item-value">{{orderdata.carMondel}}</view>
183
+            </view>
184
+            <view class="detail-item">
185
+              <view class="item-label">里程</view>
186
+              <view class="item-value">12.5km</view>
187
+            </view>
188
+            <view class="detail-item" wx:if="{{orderdata.workorderType<3}}">
189
+              <view class="item-label">预计时长</view>
190
+              <view class="item-value">{{estimatedDuration || '50分钟'}}</view>
191
+            </view>
192
+            <view class="detail-item" wx:if="{{orderdata.workorderType>=3}}">
193
+              <view class="item-label">时长</view>
194
+              <view class="item-value">{{estimatedDuration || '50分钟'}}</view>
195
+            </view>
196
+            <view class="detail-item" wx:if="{{orderdata.workorderType<3}}">
197
+              <view class="item-label">预计到达时间</view>
198
+              <view class="item-value">{{estimatedArrivalTime || '--'}}</view>
199
+            </view>
200
+            <view class="detail-item" wx:if="{{orderdata.workorderType==3}}">
201
+              <view class="item-label">到达时间</view>
202
+              <view class="item-value">{{orderdata.arrivaltime || '--'}}</view>
203
+            </view>
204
+            <view class="detail-item" wx:if="{{orderdata.workorderType==4}}">
205
+              <view class="item-label">开始工作时间</view>
206
+              <view class="item-value">{{orderdata.startworktime || '--'}}</view>
207
+            </view>
208
+            <view class="detail-item" wx:if="{{orderdata.workorderType==5}}">
209
+              <view class="item-label">工作结束时间</view>
210
+              <view class="item-value">{{orderdata.endworktime || '--'}}</view>
211
+            </view>
212
+          </view>
213
+          
214
+          <view style="height: 20rpx;" wx:if="{{moretype}}"></view>
215
+        </view>
216
+        
217
+        <!-- 费用明细 -->
218
+        <view class="detail-section">
219
+          <view class="section-header" bind:tap="oncostdetails">
220
+            <view class="section-title">预估金额</view>
221
+            <view class="section-action">
222
+              <view class="section-title1">100.1 <text class="section_yuan">元</text>
223
+              </view>
224
+              <t-icon name="{{costdetails ? 'chevron-up' : 'chevron-down'}}" size="22px"/>
225
+            </view>
226
+          </view>
227
+          
228
+          <view class="fee-list" wx:if="{{costdetails}}">
229
+            <view class="fee-item">
230
+              <view class="fee-label">电费</view>
231
+              <view class="fee-value">¥5.00</view>
232
+            </view>
233
+            <view class="fee-item">
234
+              <view class="fee-label">服务费</view>
235
+              <view class="fee-value">¥5.00</view>
236
+            </view>
237
+            <!-- <view class="fee-item">
238
+              <view class="fee-label">起步价</view>
239
+              <view class="fee-value">¥13.00</view>
240
+            </view> -->
241
+            <!-- <view class="fee-item">
242
+              <view class="fee-label">里程费</view>
243
+              <view class="fee-value">¥32.00</view>
244
+            </view> -->
245
+            <!-- <view class="fee-item">
246
+              <view class="fee-label">时长费</view>
247
+              <view class="fee-value">¥8.50</view>
248
+            </view> --> 
249
+           
250
+         
251
+          </view>
252
+          
253
+          <view style="height: 1rpx;"></view>
254
+        </view>
255
+      </view>
256
+      <!---->
257
+      <!-- 司机视角内容 -->
258
+      <view class="card_box" wx:if="{{userdata.operationRole==4}}">
259
+        <!-- 订单详情 -->
260
+        <view class="detail-section" style="border-bottom: 1rpx solid #f5f5f5;">
261
+          <view class="section-header" bind:tap="onmore">
262
+            <view class="section-title">订单详情</view>
263
+            <view class="section-action">
264
+              <text>{{moretype ? '收起' : '展开详情'}}</text>
265
+              <t-icon name="{{moretype ? 'chevron-up' : 'chevron-down'}}" size="22px"/>
266
+            </view>
267
+          </view>
268
+          
269
+          <view class="detail-list" wx:if="{{moretype}}">
270
+            <view class="detail-item">
271
+              <view class="item-label">订单号</view>
272
+              <view class="item-value">{{orderdata.workorderId}}</view>
273
+            </view>
274
+            <view class="detail-item">
275
+              <view class="item-label">创建时间</view>
276
+              <view class="item-value">{{orderdata.workorderCreatetime}}</view>
277
+            </view>
278
+            <view class="detail-item">
279
+              <view class="item-label">订单类型</view>
280
+              <view class="item-value">{{orderdata.chargedischargeType==1 ? '充电' : '放电'}}</view>
281
+            </view>
282
+            <view class="detail-item">
283
+              <view class="item-label">需求电量</view>
284
+              <view class="item-value">{{orderdata.workorderElectricity}}</view>
285
+            </view>
286
+            <view class="detail-item">
287
+              <view class="item-label">SOC</view>
288
+              <view class="item-value">{{orderdata.soc}}</view>
289
+            </view>
290
+            <view class="detail-item">
291
+              <view class="item-label">车型</view>
292
+              <view class="item-value">{{orderdata.carMondel}}</view>
293
+            </view>
294
+            <view class="detail-item">
295
+              <view class="item-label">里程</view>
296
+              <view class="item-value">{{distance}} km</view>
297
+            </view>
298
+            <view class="detail-item" wx:if="{{orderdata.workorderType<3}}">
299
+              <view class="item-label">预计时长</view>
300
+              <view class="item-value">{{estimatedDuration || '50分钟'}}</view>
301
+            </view>
302
+            <view class="detail-item" wx:if="{{orderdata.workorderType>=3}}">
303
+              <view class="item-label">时长</view>
304
+              <view class="item-value">{{estimatedDuration || '50分钟'}}</view>
305
+            </view>
306
+            <view class="detail-item" wx:if="{{orderdata.workorderType<3}}">
307
+              <view class="item-label">预计到达时间</view>
308
+              <view class="item-value">{{estimatedArrivalTime || '--'}}</view>
309
+            </view>
310
+            <view class="detail-item" wx:if="{{orderdata.workorderType==3}}">
311
+              <view class="item-label">到达时间</view>
312
+              <view class="item-value">{{orderdata.arrivaltime || '--'}}</view>
313
+            </view>
314
+            <view class="detail-item" wx:if="{{orderdata.workorderType==4}}">
315
+              <view class="item-label">开始工作时间</view>
316
+              <view class="item-value">{{orderdata.startworktime || '--'}}</view>
317
+            </view>
318
+            <view class="detail-item" wx:if="{{orderdata.workorderType==5}}">
319
+              <view class="item-label">工作结束时间</view>
320
+              <view class="item-value">{{orderdata.endworktime || '--'}}</view>
321
+            </view>
322
+          </view>
323
+          
324
+          <view style="height: 20rpx;" wx:if="{{moretype}}"></view>
325
+        </view>
326
+      </view>
327
+      
328
+      <view style="height: 140rpx;" wx:if="{{moretype}}"></view>
329
+      
330
+      <!-- 控制按钮区域 -->
331
+      <view class="control-panel" wx:if="{{userdata.operationRole==4}}">
332
+        <slide-confirm 
333
+          wx:if="{{orderdata.workorderType==1}}"
334
+          id="mySlideConfirm"
335
+          data-type="{{orderdata.workorderType}}"
336
+          bind:success="onrecognize" 
337
+          width="300" 
338
+          height="50"
339
+          defaultText="开始出发"
340
+          successText="验证中"
341
+        />
342
+        
343
+        <slide-confirm 
344
+          wx:if="{{orderdata.workorderType==2}}"
345
+          id="mySlideConfirm"
346
+          data-type="{{orderdata.workorderType}}"
347
+          bind:success="onarrivalposition" 
348
+          width="300" 
349
+          height="50"
350
+          defaultText="到达目的地"
351
+          successText="验证中"
352
+        />
353
+        
354
+        <slide-confirm 
355
+          wx:if="{{orderdata.workorderType==3}}"
356
+          id="mySlideConfirm"
357
+          data-type="{{orderdata.workorderType}}"
358
+          bind:success="showVerificationPopup" 
359
+          width="300" 
360
+          height="50"
361
+          defaultText="开始工作"
362
+          successText="验证中"
363
+        />
364
+        
365
+        <slide-confirm 
366
+          wx:if="{{orderdata.workorderType==4}}"
367
+          id="mySlideConfirm"
368
+          data-type="{{orderdata.workorderType}}"
369
+          bind:success="onSlideSuccess" 
370
+          width="300" 
371
+          height="50"
372
+          defaultText="完成工作"
373
+          successText="验证中"
374
+        />
375
+        
376
+      </view>
377
+    </view>
378
+  </view>
379
+</view>

+ 458
- 8
package-map/pages/map/index.wxss 查看文件

@@ -10,9 +10,8 @@
10 10
 }
11 11
 
12 12
 .map {
13
-  
14 13
   width: 100%;
15
-  height: 70%;
14
+  height: 60%;
16 15
 }
17 16
 
18 17
 .control-panel {
@@ -98,6 +97,10 @@
98 97
   padding-bottom: 10rpx;
99 98
   /* border-bottom: 1px solid #f0f0f0; */
100 99
 }
100
+/* 目的地标题 */
101
+.destination-title1 {
102
+  color: #333;
103
+}
101 104
 .destination-font {
102 105
   font-size: 28rpx;
103 106
   width: 100%;
@@ -105,7 +108,7 @@
105 108
   align-items: center;
106 109
   justify-content: space-between;
107 110
   color: #333;
108
-  margin-top: 20rpx;
111
+  margin-top: 10rpx;
109 112
   /* border-bottom: 1px solid #f0f0f0; */
110 113
 }
111 114
 .route{
@@ -188,18 +191,465 @@
188 191
 }
189 192
 .storagecartext{
190 193
   width:100%;
194
+  margin-bottom: 10rpx;
191 195
 display: flex;
196
+flex-direction: column;
192 197
 justify-content: space-between;
193
-/* justify-content:space-around; */
194
-align-items: center;
195
-padding-left:20rpx;
198
+/* align-items: center; */
196 199
 box-sizing: border-box;
197
-margin-top: 20rpx;
198
-    }
200
+}
201
+.storagecartext_box{
202
+  display: flex;
203
+}
204
+.contact-info{
205
+  display: flex;
206
+  align-items: center;
207
+  margin-top: 20rpx;
208
+}
209
+.icon-call{
210
+  margin-left: 10rpx;
211
+}
212
+.action-images{
213
+  
214
+}
199 215
 .storagecar{
200 216
   width: 260rpx;
201 217
   height: 180rpx;
202 218
 }
219
+.storagecar1{
220
+  width: 200rpx;
221
+  height: 100rpx;
222
+  margin-right: 30rpx;
223
+}
224
+.driver{
225
+  display: flex;
226
+}
227
+.detailsbox{
228
+ width: 100%;
229
+ background-color: #ffffff;
230
+border-radius: 40rpx;
231
+padding: 0rpx 20rpx;
232
+box-sizing: border-box;
233
+}
203 234
 .viewmore{
235
+  width: 100%;
204 236
   margin-top: 20rpx;
237
+  background-color: #ffffff;
238
+  box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1);
239
+  border-radius: 20rpx;
240
+  padding: 0rpx 20rpx;
241
+
242
+box-sizing: border-box;
243
+
244
+}
245
+.viewmore_box{
246
+  width: 100%;
247
+  height: 100rpx;
248
+  display: flex;
249
+  align-items: center;
250
+  justify-content: space-between;
251
+  
252
+}
253
+.viewmore_left{
254
+font-size: 32rpx;
255
+}
256
+.viewmore_right{
257
+  font-size: 26rpx;
258
+display: flex;
259
+}
260
+
261
+.viewmore_content{
262
+
263
+}
264
+.viewmore_details{
265
+width: 100%;
266
+height: 100rpx;
267
+}
268
+/* 1111111111111111111111111 */
269
+/* pages/taxi-detail/taxi-detail.wxss */
270
+.taxi-card-container {
271
+  position: fixed;
272
+  left: 0;
273
+  right: 0;
274
+  bottom: 0;
275
+  z-index: 999;
276
+  display: flex;
277
+  flex-direction: column;
278
+  align-items: center;
279
+}
280
+
281
+.mask {
282
+  position: fixed;
283
+  top: 0;
284
+  left: 0;
285
+  right: 0;
286
+  bottom: 0;
287
+  background: rgba(0, 0, 0, 0.5);
288
+  z-index: -1;
289
+  transition: opacity 0.3s ease;
290
+}
291
+
292
+.taxi-card {
293
+  width: 100%;
294
+  background: #fff;
295
+  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
296
+  overflow: hidden;
297
+  position: relative;
298
+}
299
+
300
+/* 拖动指示器 */
301
+.drag-handler {
302
+  display: flex;
303
+  justify-content: center;
304
+  padding: 12rpx 0;
305
+  background: #f8f9fa;
306
+}
307
+
308
+.drag-bar {
309
+  width: 60rpx;
310
+  height: 8rpx;
311
+  background: #ddd;
312
+  border-radius: 4rpx;
313
+}
314
+
315
+/* 卡片内容样式 */
316
+.card-content {
317
+  /* padding: 0 20rpx 20rpx; */
318
+  padding: 0rpx 20rpx 20rpx;
319
+  height: calc(100% - 52rpx);
320
+  overflow-y: auto;
321
+  box-sizing: border-box;
322
+}
323
+
324
+/* 全屏模式样式 */
325
+.fullscreen-header {
326
+  display: flex;
327
+  justify-content: space-between;
328
+  align-items: center;
329
+  margin-bottom: 30rpx;
330
+  padding-bottom: 16rpx;
331
+  border-bottom: 1px solid #f5f5f5;
332
+}
333
+
334
+.header-title {
335
+  font-size: 36rpx;
336
+  font-weight: 600;
337
+  color: #333;
338
+}
339
+
340
+.close-fullscreen {
341
+  width: 60rpx;
342
+  height: 60rpx;
343
+  line-height: 60rpx;
344
+  padding: 0;
345
+  font-size: 40rpx;
346
+  color: #666;
347
+  background: transparent;
348
+}
349
+
350
+.close-fullscreen::after {
351
+  border: none;
352
+}
353
+
354
+.fee-list {
355
+  margin-bottom: 30rpx;
356
+}
357
+
358
+/* 基础内容样式保持不变 */
359
+.card-section .section-title {
360
+  font-size: 32rpx;
361
+  font-weight: 600;
362
+  margin-bottom: 20rpx;
363
+  color: #333;
364
+}
365
+
366
+.price-tag {
367
+  font-size: 36rpx;
368
+  font-weight: 700;
369
+  color: #ff4d4f;
370
+  margin-bottom: 12rpx;
371
+}
372
+
373
+.route-brief {
374
+  font-size: 28rpx;
375
+  color: #666;
376
+}
377
+
378
+.route-detail {
379
+  margin-bottom: 20rpx;
380
+}
381
+
382
+.route-point {
383
+  font-size: 28rpx;
384
+  color: #333;
385
+  margin-bottom: 12rpx;
386
+  display: flex;
387
+  align-items: center;
388
+}
389
+
390
+.route-point:before {
391
+  content: '';
392
+  width: 16rpx;
393
+  height: 16rpx;
394
+  border-radius: 50%;
395
+  background: #ff4d4f;
396
+  margin-right: 12rpx;
397
+  display: inline-block;
398
+}
399
+
400
+.route-point:last-child:before {
401
+  background: #00b42a;
402
+}
403
+
404
+.route-line {
405
+  width: 4rpx;
406
+  height: 40rpx;
407
+  background: #eee;
408
+  margin-left: 8rpx;
409
+  margin-bottom: 12rpx;
205 410
 }
411
+
412
+.trip-meta {
413
+  display: flex;
414
+  justify-content: space-between;
415
+  font-size: 26rpx;
416
+  color: #666;
417
+  background: #f8f9fa;
418
+  padding: 16rpx;
419
+  border-radius: 12rpx;
420
+}
421
+
422
+.fee-item {
423
+  display: flex;
424
+  justify-content: space-between;
425
+  font-size: 28rpx;
426
+  padding: 16rpx 0;
427
+  border-bottom: 1px solid #f5f5f5;
428
+}
429
+
430
+.fee-item:last-child {
431
+  border-bottom: none;
432
+}
433
+
434
+.fee-label {
435
+  color: #666;
436
+}
437
+
438
+.fee-value {
439
+  color: #333;
440
+  font-weight: 500;
441
+}
442
+
443
+.fee-total .fee-label {
444
+  font-weight: 600;
445
+  color: #333;
446
+}
447
+
448
+.fee-total .fee-value {
449
+  font-size: 32rpx;
450
+  font-weight: 700;
451
+  color: #ff4d4f;
452
+}
453
+
454
+.confirm-btn {
455
+  width: 100%;
456
+  height: 96rpx;
457
+  line-height: 96rpx;
458
+  background: #ff4d4f;
459
+  color: #fff;
460
+  font-size: 32rpx;
461
+  border-radius: 48rpx;
462
+  margin-top: 30rpx;
463
+}
464
+
465
+.confirm-btn::after {
466
+  border: none;
467
+}
468
+/* 详情区块通用样式 */
469
+.detail-section {
470
+  /* margin-bottom: 30rpx; */
471
+}
472
+.card_more{
473
+  display: flex;
474
+  justify-content: space-between;
475
+  border-top: 1rpx solid #f5f5f5;
476
+  padding-top: 20rpx;
477
+}
478
+.card_morebox{
479
+  width: 140rpx;
480
+  height: 60rpx;
481
+  display: flex;
482
+  align-items: center;
483
+  justify-content: center;
484
+  border-radius: 50rpx;
485
+  background-color: #fff;
486
+  box-shadow: 0 -2rpx 12px rgba(0, 0, 0, 0.1);
487
+
488
+}
489
+.card_box{
490
+  width: 100%;
491
+border-radius: 10rpx;
492
+margin-top:16rpx;
493
+padding: 0rpx 20rpx;
494
+  box-shadow: 0 -2rpx 12px rgba(0, 0, 0, 0.1);
495
+  box-sizing: border-box;
496
+}
497
+.section-title {
498
+  font-size: 28rpx;
499
+  font-weight: 600;
500
+  color: #333;
501
+  margin-bottom: 20rpx;
502
+  padding-top: 10rpx;
503
+  
504
+}
505
+.section-action{
506
+  display: flex;
507
+  align-items: center;
508
+}
509
+.section-title1 {
510
+  font-size: 38rpx;
511
+  font-weight: 600;
512
+  color: #333;
513
+  margin-bottom: 20rpx;
514
+  padding-top: 10rpx;
515
+  
516
+}
517
+.section_yuan{
518
+  font-size: 28rpx;
519
+
520
+}
521
+/* 司机信息样式 */
522
+.driver-section {
523
+  display: flex;
524
+  align-items: center;
525
+  background-color: #fafafa;
526
+  border-radius: 20rpx;
527
+  padding: 20rpx;
528
+}
529
+
530
+.driver-avatar {
531
+  width: 100rpx;
532
+  height: 100rpx;
533
+  border-radius: 50%;
534
+  margin-right: 20rpx;
535
+}
536
+.order-status{
537
+  display: flex;
538
+  align-items: center;
539
+}
540
+.driver-info {
541
+  flex: 1;
542
+}
543
+
544
+.driver-name {
545
+  font-size: 26rpx;
546
+  font-weight: 500;
547
+  color: #333;
548
+  margin-bottom: 10rpx;
549
+}
550
+
551
+.driver-grade {
552
+  font-size: 22rpx;
553
+  color: #ffc53d;
554
+  margin-left: 10rpx;
555
+}
556
+
557
+.car-info {
558
+  font-size: 22rpx;
559
+  color: #666;
560
+  margin-bottom: 10rpx;
561
+}
562
+
563
+.contact-btn {
564
+  background-color: #40a9ff;
565
+  color: #fff;
566
+  font-size: 22rpx;
567
+  padding: 5rpx 15rpx;
568
+  border-radius: 15rpx;
569
+  border: none;
570
+}
571
+
572
+/* 详情列表样式 */
573
+.detail-list {
574
+  background-color: #fafafa;
575
+  border-radius: 20rpx;
576
+  padding: 20rpx;
577
+}
578
+
579
+.detail-item {
580
+  display: flex;
581
+  justify-content: space-between;
582
+  padding: 15rpx 0;
583
+  border-bottom: 1rpx solid #eee;
584
+}
585
+
586
+.detail-item:last-child {
587
+  border-bottom: none;
588
+}
589
+
590
+.item-label {
591
+  font-size: 24rpx;
592
+  color: #666;
593
+}
594
+
595
+.item-value {
596
+  font-size: 24rpx;
597
+  color: #333;
598
+  text-align: right;
599
+}
600
+
601
+/* 费用明细样式 */
602
+.fee-list {
603
+  background-color: #fafafa;
604
+  border-radius: 20rpx;
605
+  padding: 20rpx;
606
+}
607
+
608
+.fee-item {
609
+  display: flex;
610
+  justify-content: space-between;
611
+  padding: 15rpx 0;
612
+  border-bottom: 1rpx solid #eee;
613
+}
614
+
615
+.fee-item:last-child {
616
+  border-bottom: none;
617
+}
618
+
619
+.fee-label {
620
+  font-size: 24rpx;
621
+  color: #666;
622
+}
623
+
624
+.fee-value {
625
+  font-size: 24rpx;
626
+  color: #333;
627
+}
628
+
629
+.total-fee .fee-label {
630
+  font-weight: 600;
631
+  color: #333;
632
+  font-size: 26rpx;
633
+}
634
+
635
+.total-fee .fee-value {
636
+  font-weight: 600;
637
+  color: #ff4d4f;
638
+  font-size: 28rpx;
639
+}
640
+.estimated-time {
641
+  font-size: 24rpx;
642
+  color: #ff6b00;
643
+margin-left: 20rpx;
644
+}
645
+
646
+.destination-title1 .estimated-time {
647
+  /* display: block; */
648
+  margin-left: 0;
649
+}
650
+.section-header{
651
+ height: 80rpx;
652
+  display: flex;
653
+  align-items: center;
654
+  justify-content: space-between;
655
+}

+ 917
- 0
package-map/pages/map/indexcopy.js 查看文件

@@ -0,0 +1,917 @@
1
+const api = require('../../../api/index.js');
2
+
3
+Page({
4
+  data: {
5
+    // 地图中心坐标
6
+    longitude: 0,
7
+    latitude: 0,
8
+    
9
+    // 标记点(包含起点、终点)
10
+    markers: [],
11
+    
12
+    // 轨迹线(实际轨迹)- 核心修改:将颜色改为红色(#ff0000)
13
+    // polyline: [{
14
+    //   points: [],
15
+    //   color: "#999999", // 已走过的路线颜色:灰色
16
+    //   width: 6,
17
+    //   dottedLine: false
18
+    // }],
19
+    
20
+    // 规划路线 - 优化:改为灰色(#999999),与已走路线形成对比
21
+    plannedRoute: [{
22
+      points: [],
23
+      color: "#2f693c", // 未走的规划路线颜色:绿色
24
+      width: 4,
25
+      dottedLine: false,
26
+      arrowLine: true
27
+    }],
28
+    
29
+    // 追踪状态
30
+    isTracking: false,
31
+    
32
+    // 信息提示文本
33
+    infoText: "",
34
+    
35
+    // 位置更新计时器
36
+    locationTimer: null,
37
+    
38
+    // 终点位置
39
+    destination: null,
40
+    
41
+    // 路线规划状态
42
+    routePlanned: false,
43
+    
44
+    // 腾讯位置服务Key
45
+    qqMapKey: 'VRGBZ-ZFRHB-SKIUP-NHHJ3-TXGJT-ZIFG3',
46
+    
47
+    // 偏离阈值(米)和偏离状态
48
+    deviationThreshold: 50,  // 超过50米视为偏离
49
+    isDeviated: false,
50
+    
51
+    // 重新规划相关
52
+    isReplanning: false,     // 是否正在重新规划
53
+    deviationCount: 0,       // 连续偏离计数
54
+    replanThreshold: 3,       // 连续偏离多少次后重新规划
55
+    orderdata:{},
56
+    optionsid:'',
57
+    showVerification: false,
58
+    phoneNumber: "138****6789",
59
+    userdata:[],
60
+    moretype:false,
61
+    // 拖动
62
+    cardHeight: 'min', // 初始高度档位:min/mid/max
63
+    currentHeight: 0, // 当前实际高度(px)
64
+    startY: 0, // 触摸起始Y坐标
65
+    maskOpacity: 0.3, // 遮罩透明度
66
+    windowHeight: 0, // 屏幕可用高度(px)
67
+    // 三个固定高度(max改为屏幕高度)
68
+    heightConfig: {
69
+      min: 320,    // 最低高度(仅显示价格和路线简要)
70
+      mid: 520,    // 中间高度(显示行程详情)
71
+      max: 0       // 占位,将在onLoad中设置为屏幕高度
72
+    },
73
+    costdetails:false,
74
+    trackPoints: [],
75
+    distance:'',
76
+    obtainindex:0,
77
+    driverLocation:[]
78
+  },
79
+  onReady() {
80
+    // 创建地图上下文
81
+    // 提取轨迹线的所有节点作为include-points的目标点
82
+
83
+  },
84
+   onLoad(options) {
85
+     // 获取屏幕可用高度(不含导航栏)
86
+     const systemInfo = wx.getSystemInfoSync();
87
+     const windowHeight = systemInfo.windowHeight;
88
+     
89
+     // 更新heightConfig,max设为屏幕高度
90
+     this.setData({
91
+       windowHeight,
92
+       heightConfig: {
93
+         ...this.data.heightConfig,
94
+         max: windowHeight
95
+       },
96
+       currentHeight: this.data.heightConfig.min // 初始高度为min档
97
+     });
98
+    this.setData({
99
+      userdata:wx.getStorageSync('user')
100
+    })
101
+   
102
+    console.log(options);
103
+    this.setData({
104
+      optionsid:options.id
105
+    })
106
+    // 初始化地图,获取当前位置
107
+    this.getoneworkorder()
108
+
109
+
110
+    // 引入SDK核心类
111
+    this.qqmapsdk = require('../../../libs/qqmap-wx-jssdk.min.js');
112
+    // 初始化SDK
113
+    this.mapSdk = new this.qqmapsdk({
114
+      key: this.data.qqMapKey
115
+    });
116
+
117
+    
118
+  },
119
+   getoneworkorder(){
120
+    let data = {
121
+      workorderId:this.data.optionsid
122
+    }
123
+    api.request(`/sysworkorder/selectworkorderId`, 'post',data,{ isPublic: false })       
124
+    .then((data) => {
125
+      console.log(data.data);
126
+      if (data.code==200) {
127
+        this.setData({
128
+          orderdata:data.data
129
+        })
130
+        this.initMap();
131
+     
132
+
133
+      }
134
+    })
135
+    .catch((err) => {
136
+      console.error('请求失败:', err);
137
+    });
138
+  },
139
+  getworkorder(){
140
+    let data = {
141
+      workorderId:this.data.optionsid
142
+    }
143
+    api.request(`/sysworkorder/selectworkorderId`, 'post',data,{ isPublic: false })       
144
+    .then((data) => {
145
+      console.log(data.data);
146
+      if (data.code==200) {
147
+        this.setData({
148
+          orderdata:data.data
149
+        })
150
+      }
151
+    })
152
+    .catch((err) => {
153
+      console.error('请求失败:', err);
154
+    });
155
+  },
156
+ 
157
+  
158
+  // 初始化地图
159
+  initMap() {
160
+    const that = this;
161
+    
162
+    // 获取用户当前位置
163
+    wx.getLocation({
164
+      type: 'gcj02', // 腾讯地图坐标体系
165
+      success(res) {
166
+     
167
+        const longitude = res.longitude;
168
+        const latitude = res.latitude;
169
+        //     // 设置地图中心为当前位置
170
+            that.setData({
171
+              longitude,
172
+              latitude,
173
+     
174
+             
175
+            });
176
+            if (that.data.userdata.operationRole==4) {
177
+              that.uploadLocation(res);
178
+              }
179
+        //     that.showInfo("已获取当前位置");
180
+      
181
+        that.setDestination();
182
+      },
183
+      fail(err) {
184
+        console.error("获取位置失败:", err);
185
+        that.showInfo("请授权位置权限以使用地图功能");
186
+        
187
+        // 引导用户开启权限
188
+        wx.openSetting({
189
+          success(res) {
190
+            if (res.authSetting['scope.userLocation']) {
191
+              that.initMap();
192
+            }
193
+          }
194
+        });
195
+      }
196
+    });
197
+  },
198
+
199
+  // 设置终点位置
200
+  setDestination() {
201
+    // 1. 定义常量,提高可维护性
202
+    const ICON_PATH = {
203
+      start: "https://esos-iot.bjdexn.cn/myminio/project/0b0593293af54ea097b168cea479c25c.png",
204
+      end: "https://esos-iot.bjdexn.cn/myminio/project/6dc37b15321b462f9ab59c47263dd224.png",
205
+      driver: "https://esos-iot.bjdexn.cn/myminio/project/driver_marker.png" // 司机图标路径
206
+    };
207
+    const MARKER_SIZE = { width: 30, height: 30 };
208
+    const MAP_PADDING = [100, 100, 100, 100];
209
+    const ROUTE_COLOR = "#ff0000";
210
+    const ROUTE_WIDTH = 6;
211
+  
212
+    // 2. 准备请求数据
213
+    const requestData = {
214
+      workorderId: this.data.optionsid
215
+    };
216
+  
217
+    // 3. 发起请求并处理响应
218
+    api.request(`/sysworkorder/selectworkorderredis`, 'post', requestData, { isPublic: false })
219
+      .then((response) => {
220
+        console.log(response.data);
221
+        
222
+        // 4. 数据校验
223
+        if (response.code !== 200) {
224
+          this.showInfo("获取数据失败,请重试");
225
+          return;
226
+        }
227
+        
228
+        if (!response.data || !response.data[0] || !this.data.orderdata) {
229
+          this.showInfo("数据格式异常");
230
+          return;
231
+        }
232
+  
233
+        const startPoint = response.data[0];
234
+        const endPoint = this.data.orderdata;
235
+        // 假设司机位置数据存储在 this.data.driverLocation 中
236
+        const driverPoint = this.data.driverLocation || {
237
+          longitude: startPoint.longitude, // 默认位置(可以根据实际情况调整)
238
+          latitude: startPoint.latitude + 0.001 // 稍微偏移,避免与起点重叠
239
+        };
240
+  
241
+        // 5. 构建地图标记
242
+        const markers = [
243
+          {
244
+            id: 0,
245
+            longitude: startPoint.longitude,
246
+            latitude: startPoint.latitude,
247
+            iconPath: ICON_PATH.start,
248
+            ...MARKER_SIZE,
249
+            title: "起点"
250
+          },
251
+          {
252
+            id: 1,
253
+            longitude: endPoint.longitude,
254
+            latitude: endPoint.latitude,
255
+            iconPath: ICON_PATH.end,
256
+            ...MARKER_SIZE,
257
+            title: "终点",
258
+            name: endPoint.poiName
259
+          },
260
+          {
261
+            id: 2, // 司机标记ID
262
+            longitude: driverPoint.longitude,
263
+            latitude: driverPoint.latitude,
264
+            iconPath: ICON_PATH.driver,
265
+            ...MARKER_SIZE,
266
+            width: 35, // 司机图标可以稍大一些
267
+            height: 35,
268
+            title: "司机位置",
269
+            callout: { // 可选:添加气泡提示
270
+              content: "司机正在赶来",
271
+              display: "BYCLICK" // 点击显示
272
+            }
273
+          }
274
+        ];
275
+  
276
+        // 6. 构建路线数据
277
+        const polyline = [{
278
+          points: [
279
+            { longitude: startPoint.longitude, latitude: startPoint.latitude },
280
+            { longitude: endPoint.longitude, latitude: endPoint.latitude }
281
+          ],
282
+          color: ROUTE_COLOR,
283
+          width: ROUTE_WIDTH,
284
+          dottedLine: false
285
+        }];
286
+  
287
+        // 7. 更新页面数据
288
+        this.setData({
289
+          markers,
290
+          destination: { longitude: endPoint.longitude, latitude: endPoint.latitude },
291
+          polyline
292
+        });
293
+  
294
+        this.showInfo("已设置终点位置");
295
+  
296
+        // 8. 调整地图视野(包含所有标记点)
297
+        const mapCtx = wx.createMapContext('map');
298
+        mapCtx.includePoints({
299
+          points: [
300
+            { longitude: startPoint.longitude, latitude: startPoint.latitude },
301
+            { longitude: endPoint.longitude, latitude: endPoint.latitude },
302
+            { longitude: driverPoint.longitude, latitude: driverPoint.latitude } // 包含司机位置
303
+          ],
304
+          padding: MAP_PADDING
305
+        });
306
+  
307
+        // 9. 规划路线
308
+        this.planRoute();
309
+      })
310
+      .catch((err) => {
311
+        console.error('请求失败:', err);
312
+        this.showInfo("网络请求失败,请检查网络"); // 添加错误提示
313
+      });
314
+  },
315
+
316
+  // 规划路线 - 通用方法,可被初始规划和重新规划调用
317
+  planRoute(isReplan = false) {
318
+    const that = this;
319
+    const { longitude, latitude, destination } = this.data;
320
+    
321
+    if (!destination) {
322
+      this.showInfo("请先设置终点");
323
+      return;
324
+    }
325
+    
326
+    // 如果是重新规划,更新状态
327
+    if (isReplan) {
328
+      this.setData({ isReplanning: true });
329
+      this.showInfo("正在重新规划路线...");
330
+    } else {
331
+      this.showInfo("正在规划路线...");
332
+    }
333
+    
334
+    // 调用腾讯地图路线规划API
335
+    this.mapSdk.direction({
336
+      mode: 'driving', // 驾车模式,可选值:'driving', 'walking', 'transit'
337
+      policy:'REAL_TRAFFIC',
338
+      from: {
339
+        latitude: this.data.markers[0].longitude,
340
+        longitude: this.data.markers[0].latitude
341
+      },
342
+      to: {
343
+        latitude: destination.latitude,
344
+        longitude: destination.longitude
345
+      },
346
+      success(res) {
347
+        console.log("路线规划结果:", res);
348
+   
349
+        if (res.status === 0 && res.result.routes.length > 0) {
350
+       
351
+          var result = res.result
352
+          var route = result.routes[0]
353
+          // 提取路线点
354
+          var coors = route.polyline, pl = [];
355
+          //坐标解压(返回的点串坐标,通过前向差分进行压缩)
356
+          var kr = 1000000;
357
+          for (var i = 2; i < coors.length; i++) {
358
+            coors[i] = Number(coors[i - 2]) + Number(coors[i]) / kr;
359
+          }
360
+          //将解压后的坐标放入点串数组pl中
361
+          for (var i = 0; i < coors.length; i += 2) {
362
+            pl.push({ latitude: coors[i], longitude: coors[i + 1] })
363
+          }
364
+  
365
+          // 更新路线数据(规划路线颜色已设为灰色)
366
+          let distance = (result.routes[0].distance/1000).toFixed(1)
367
+          that.setData({
368
+            plannedRoute: [{
369
+              name: that.data.orderdata.poiName,
370
+              points: pl,
371
+              color: '#2f693c', // 与data中保持一致,确保规划路线颜色正确
372
+              width: 6,
373
+              borderColor: '#2f693c',
374
+              borderWidth: 1
375
+            }],
376
+            // trackPoints:[],
377
+            routePlanned: true,
378
+            isReplanning: false,
379
+            deviationCount: 0,  // 重置偏离计数
380
+            distance:[distance]
381
+          });
382
+          console.log(that.data.plannedRoute);
383
+        
384
+          // 显示规划结果
385
+          const message = isReplan 
386
+            ? `已重新规划路线,距离${(result.routes[0].distance/1000).toFixed(1)}公里,约${Math.ceil(result.routes[0].duration)}分钟`
387
+            : `路线规划完成,距离${(result.routes[0].distance/1000).toFixed(1)}公里,约${Math.ceil(result.routes[0].duration)}分钟`;
388
+            
389
+          that.showInfo(message);
390
+
391
+        } else {
392
+          that.setData({ isReplanning: false });
393
+          that.showInfo("路线规划失败,请重试");
394
+        }
395
+      },
396
+      fail(err) {
397
+        console.error("路线规划失败:", err);
398
+        that.setData({ isReplanning: false });
399
+        that.showInfo("路线规划失败,请检查网络");
400
+      }
401
+    });
402
+  },
403
+  // 获取历史轨迹线
404
+  historytrajectory(){
405
+    let data = {
406
+      workorderId:this.data.optionsid
407
+    }
408
+    api.request(`/sysworkorder/selectworkorderredis`, 'post',data,{ isPublic: false })       
409
+    .then((data) => {
410
+      console.log(data.data);
411
+      if (data.code==200) {
412
+          // 设置地图中心为当前位置
413
+          this.updateDriverLocation(data.data[data.data.length-1])
414
+    
415
+      }
416
+    })
417
+    .catch((err) => {
418
+      console.error('请求失败:', err);
419
+    });
420
+  },
421
+  updateDriverLocation(newDriverLocation) {
422
+    // 更新司机位置数据
423
+    this.setData({
424
+      driverLocation: newDriverLocation
425
+    });
426
+    
427
+    // 获取当前标记数组
428
+    const markers = [...this.data.markers];
429
+    // 找到司机标记(id:2)并更新位置
430
+    const driverMarkerIndex = markers.findIndex(marker => marker.id === 2);
431
+    
432
+    if (driverMarkerIndex !== -1) {
433
+      markers[driverMarkerIndex] = {
434
+        ...markers[driverMarkerIndex],
435
+        longitude: newDriverLocation.longitude,
436
+        latitude: newDriverLocation.latitude
437
+      };
438
+      // 更新标记
439
+      this.setData({ markers });
440
+
441
+    }
442
+  },
443
+  // 显示信息提示
444
+  showInfo(text) {
445
+    this.setData({ infoText: text });
446
+    
447
+    // 3秒后自动隐藏非状态类信息
448
+    if (!text.includes("正在") && !text.includes("距离") && !text.includes("偏离")) {
449
+      setTimeout(() => {
450
+        this.setData({ infoText: "" });
451
+      }, 3000);
452
+    }
453
+  },
454
+  
455
+  // 导航功能
456
+  navigation(){
457
+    // 使用在腾讯位置服务申请的key
458
+    const key = this.data.qqMapKey;
459
+    // 调用插件的app的名称
460
+    const referer = '电速宝';
461
+    // 是否启用智能规划
462
+    const enableAI = true;
463
+    // 是否开启导航功能
464
+    const navigation = 1;
465
+    // 终点(建议替换为orderdata中的实际终点,当前为示例值)
466
+    const endPoint = JSON.stringify({
467
+      name: this.data.orderdata.poiName || '目的地',
468
+      latitude: this.data.orderdata.latitude,
469
+      longitude: this.data.orderdata.longitude,
470
+    });
471
+    // 个性化图层
472
+    const layerStyle = 1;
473
+    wx.navigateTo({
474
+      url: `plugin://route-plan/index?key=${key}&referer=${referer}&endPoint=${endPoint}&enableAI=${enableAI}&navigation=${navigation}&layerStyle=${layerStyle}`,
475
+    });
476
+  },
477
+
478
+
479
+ 
480
+    // 显示验证码弹窗
481
+    showVerificationPopup() {
482
+      let data = {
483
+        workorderId:this.data.optionsid
484
+      }
485
+      api.request(`/sysworkorder/createverify`, 'post',data,{ isPublic: false })       
486
+      .then((data) => {
487
+        console.log(data);
488
+        if (data.code==200) {
489
+          wx.showToast({
490
+            title: data.msg,
491
+            icon: 'none',
492
+          });
493
+      this.setData({ showVerification: true });
494
+            
495
+        }
496
+      })
497
+      .catch((err) => {
498
+        console.error('请求失败:', err);
499
+      });
500
+    },
501
+    
502
+    // 关闭弹窗
503
+    onPopupClose() {
504
+      this.setData({ showVerification: false });
505
+      setTimeout(() => {
506
+        const slideComponent = this.selectComponent("#mySlideConfirm");
507
+        // 2. 调用组件的reset方法
508
+        slideComponent.reset();
509
+      }, 1000);
510
+    },
511
+    
512
+    // 确认验证码
513
+    onCodeConfirm(e) {
514
+      console.log("确认验证码:", e.detail.code);
515
+      // 验证逻辑...
516
+      this.setData({ showVerification: false });
517
+    },
518
+    
519
+    // 重新发送验证码
520
+    onResendCode() {
521
+      console.log("重新发送验证码");
522
+      // 重新发送逻辑...
523
+    },
524
+    
525
+    // 验证码输入完成
526
+    onCodeComplete(e) {
527
+      console.log("验证码输入完成:", e.detail.code);
528
+      // 自动验证逻辑...
529
+      let data = {
530
+        carId:this.data.optionsid,
531
+        verifyCode: e.detail.code,
532
+        workorderId:this.data.orderdata.workorderId
533
+      }
534
+      api.request(`/sysworkorder/submitworkorder`, 'post',data,{ isPublic: false })
535
+      .then((data) => {
536
+        console.log(data.data);
537
+        if (data.code==200) {
538
+          wx.showToast({
539
+            title: data.msg,
540
+            icon: 'none',
541
+          });
542
+          this.getworkorder();
543
+        
544
+          this.setData({ showVerification: false });
545
+      
546
+        }
547
+      })
548
+      .catch((err) => {
549
+        setTimeout(() => {
550
+          const slideComponent = this.selectComponent("#mySlideConfirm");
551
+          // 2. 调用组件的reset方法
552
+          slideComponent.reset();
553
+        }, 5000);
554
+        console.error('请求失败:', err);
555
+      });
556
+    },
557
+    onSlideSuccess(e){
558
+      console.log(e.currentTarget.dataset.type);
559
+     
560
+      // 3. 更新页面状态,隐藏按钮和提示
561
+      let data = {
562
+        carId:this.data.orderdata.carId,
563
+        verifyCode:'',
564
+        workorderId:this.data.orderdata.workorderId
565
+      }
566
+      api.request(`/sysworkorder/submitworkorder`, 'post',data,{ isPublic: false })
567
+      .then((data) => {
568
+        console.log(data.data);
569
+        if (data.code==200) {
570
+          if(e.currentTarget.dataset.type==1){
571
+this.startBackgroundLocation();
572
+
573
+      }else if(e.currentTarget.dataset.type==4){
574
+        wx.stopLocationUpdateBackground({
575
+          success: (res) => {
576
+            console.log('后台定位已停止', res);
577
+          },
578
+          fail: (err) => {
579
+            console.error('停止后台定位失败', err);
580
+          },
581
+        });
582
+        // 移除位置监听
583
+        wx.offLocationChange();
584
+      }
585
+          this.getworkorder();
586
+          setTimeout(() => {
587
+            const slideComponent = this.selectComponent("#mySlideConfirm");
588
+            // 2. 调用组件的reset方法
589
+            slideComponent.reset();
590
+          }, 5000);
591
+      
592
+        }
593
+      })
594
+      .catch((err) => {
595
+        setTimeout(() => {
596
+          const slideComponent = this.selectComponent("#mySlideConfirm");
597
+          // 2. 调用组件的reset方法
598
+          slideComponent.reset();
599
+        }, 5000);
600
+        console.error('请求失败:', err);
601
+      });
602
+    },
603
+    ontelephone(e){
604
+      console.log(e.currentTarget.dataset.phone);
605
+        const phoneNumber = e.currentTarget.dataset.phone;
606
+        wx.showModal({
607
+          title: '确认拨打电话',
608
+          content: '是否拨打' + phoneNumber + '?',
609
+          success: (res) => {
610
+            if (res.confirm) {
611
+              wx.makePhoneCall({
612
+                phoneNumber: phoneNumber
613
+              });
614
+            }
615
+          }
616
+        });
617
+    },
618
+    onmore(){
619
+      this.setData({
620
+        moretype:!this.data.moretype
621
+      })
622
+    },
623
+    oncostdetails(){
624
+      this.setData({
625
+        costdetails:!this.data.costdetails
626
+      })
627
+    },
628
+// 拖动功能
629
+     // 触摸开始
630
+  handleTouchStart(e) {
631
+    this.setData({
632
+      startY: e.changedTouches[0].clientY
633
+    });
634
+  },
635
+
636
+  // 触摸移动(优化全屏拖动体验)
637
+  handleTouchMove(e) {
638
+    const currentY = e.changedTouches[0].clientY;
639
+    const deltaY = currentY - this.data.startY; // 向下为正
640
+    const { min, max } = this.data.heightConfig;
641
+    
642
+    // 计算新高度(向下拖动增加高度,向上拖动减少高度)
643
+    let newHeight = this.data.currentHeight - deltaY;
644
+    
645
+    // 限制高度范围(min~max)
646
+    newHeight = Math.max(min, Math.min(max, newHeight));
647
+    
648
+    // 优化遮罩逻辑:仅mid档显示遮罩,max档不显示
649
+    let maskOpacity = this.data.maskOpacity;
650
+    if (newHeight < max && newHeight > min) {
651
+      // mid档范围:透明度随高度变化(0.3~0.5)
652
+      maskOpacity = 0.3 + (newHeight - min) / (this.data.heightConfig.mid - min) * 0.2;
653
+    } else {
654
+      maskOpacity = 0; // min或max档隐藏遮罩
655
+    }
656
+    
657
+    this.setData({
658
+      currentHeight: newHeight,
659
+      maskOpacity
660
+    });
661
+    
662
+    // 更新起始Y坐标
663
+    this.setData({
664
+      startY: currentY
665
+    });
666
+  },
667
+
668
+  // 触摸结束:优化全屏吸附逻辑
669
+  handleTouchEnd() {
670
+    const { currentHeight } = this.data;
671
+    const { min, mid, max } = this.data.heightConfig;
672
+    
673
+    // 定义吸附阈值(全屏档阈值更大,避免误触)
674
+    const minThreshold = 50; // 距离min档小于50px吸附到min
675
+    const maxThreshold = 80; // 距离max档小于80px吸附到max
676
+    const midThreshold = 60; // 距离mid档小于60px吸附到mid
677
+    
678
+    // 计算距离
679
+    const distToMin = Math.abs(currentHeight - min);
680
+    const distToMid = Math.abs(currentHeight - mid);
681
+    const distToMax = Math.abs(currentHeight - max);
682
+    
683
+    // 吸附逻辑(优先判断全屏和最小档)
684
+    let targetHeight, targetMode;
685
+    if (distToMax <= maxThreshold) {
686
+      // 接近全屏,吸附到max
687
+      targetHeight = max;
688
+      targetMode = 'max';
689
+    } else if (distToMin <= minThreshold) {
690
+      // 接近最小档,吸附到min
691
+      targetHeight = min;
692
+      targetMode = 'min';
693
+    } else if (distToMid <= midThreshold) {
694
+      // 接近中间档,吸附到mid
695
+      targetHeight = mid;
696
+      targetMode = 'mid';
697
+    } else {
698
+      // 其他情况:吸附到最近的档位
699
+      const minDist = Math.min(distToMin, distToMid, distToMax);
700
+      if (minDist === distToMin) {
701
+        targetHeight = min;
702
+        targetMode = 'min';
703
+      } else if (minDist === distToMid) {
704
+        targetHeight = mid;
705
+        targetMode = 'mid';
706
+      } else {
707
+        targetHeight = max;
708
+        targetMode = 'max';
709
+      }
710
+    }
711
+    
712
+    // 平滑过渡到目标高度
713
+    this.setData({
714
+      currentHeight: targetHeight,
715
+      cardHeight: targetMode,
716
+      maskOpacity: targetMode === 'mid' ? 0.5 : 0 // 仅mid档显示遮罩
717
+    });
718
+  },
719
+
720
+  // 点击遮罩关闭卡片(回到min档)
721
+  closeCard() {
722
+    this.setData({
723
+      currentHeight: this.data.heightConfig.min,
724
+      cardHeight: 'min',
725
+      maskOpacity: 0
726
+    });
727
+  },
728
+
729
+  // 全屏模式关闭按钮(回到min档)
730
+  closeFullscreen() {
731
+    this.setData({
732
+      currentHeight: this.data.heightConfig.min,
733
+      cardHeight: 'min',
734
+      maskOpacity: 0
735
+    });
736
+  },
737
+   // 开启后台定位
738
+   async startBackgroundLocation() {
739
+    try {
740
+      // 1. 检查并申请后台定位权限
741
+      await this.checkBackgroundLocationPermission();
742
+
743
+      // 2. 开启后台定位
744
+      wx.startLocationUpdateBackground({
745
+        success: (res) => {
746
+          console.log('后台定位已开启', res);
747
+          // 3. 监听位置变化
748
+          this.onLocationChange();
749
+        },
750
+        fail: (err) => {
751
+          console.error('开启后台定位失败', err);
752
+          wx.showToast({
753
+            title: '开启定位失败',
754
+            icon: 'none',
755
+          });
756
+        },
757
+      });
758
+    } catch (err) {
759
+      console.error('权限申请失败', err);
760
+      wx.showToast({
761
+        title: err.message,
762
+        icon: 'none',
763
+      });
764
+    }
765
+  },
766
+
767
+  // 监听位置变化
768
+  onLocationChange() {
769
+    wx.onLocationChange((res) => {
770
+      console.log('位置变化', res);
771
+      this.setData({
772
+        location: res, // 更新位置信息
773
+      });
774
+      // 在这里可以处理位置数据,如上传到服务器
775
+      this.uploadLocation(res);
776
+    });
777
+  },
778
+
779
+  // 上传位置信息到服务器
780
+  uploadLocation(location) {
781
+    // 示例:调用接口上传经纬度
782
+ 
783
+    let data = {
784
+      workorderId:this.data.optionsid,
785
+      latitude:location.latitude,
786
+      longitude:location.longitude,
787
+      createTime:new Date().getTime(),
788
+    }
789
+    api.request(`/sysworkorder/insercoordinateredis`, 'post',data,{ isPublic: false })       
790
+    .then((data) => {
791
+      console.log(data);
792
+      if (data.code==200) {
793
+        that.historytrajectory();
794
+      
795
+      }
796
+    })
797
+    .catch((err) => {
798
+      console.error('请求失败:', err);
799
+    });
800
+  },
801
+
802
+  // 停止后台定位(页面卸载时调用)
803
+  onUnload() {
804
+ 
805
+  },
806
+  // 检查并申请后台定位权限
807
+checkBackgroundLocationPermission() {
808
+  return new Promise((resolve, reject) => {
809
+    // 1. 检查后台定位权限
810
+    wx.getSetting({
811
+      success: (res) => {
812
+        if (res.authSetting['scope.userLocationBackground']) {
813
+          // 已授权后台定位权限
814
+          resolve(true);
815
+        } else {
816
+          // 2. 检查是否已授权前台定位权限(后台定位权限需要前台权限为前提)
817
+          if (res.authSetting['scope.userLocation']) {
818
+            // 已授权前台定位,直接申请后台定位权限
819
+            wx.authorize({
820
+              scope: 'scope.userLocationBackground',
821
+              success: () => {
822
+                resolve(true);
823
+              },
824
+              fail: (err) => {
825
+                // 用户拒绝了后台定位权限,引导用户去设置页开启
826
+                wx.showModal({
827
+                  title: '提示',
828
+                  content: '需要开启后台定位权限才能使用该功能,请前往设置页开启',
829
+                  confirmText: '前往设置',
830
+                  success: (modalRes) => {
831
+                    if (modalRes.confirm) {
832
+                      wx.openSetting({
833
+                        success: (settingRes) => {
834
+                          if (settingRes.authSetting['scope.userLocationBackground']) {
835
+                            resolve(true);
836
+                          } else {
837
+                            reject(new Error('用户未开启后台定位权限'));
838
+                          }
839
+                        }
840
+                      });
841
+                    } else {
842
+                      reject(new Error('用户拒绝开启后台定位权限'));
843
+                    }
844
+                  }
845
+                });
846
+              }
847
+            });
848
+          } else {
849
+            // 未授权前台定位,先申请前台定位权限
850
+            wx.authorize({
851
+              scope: 'scope.userLocation',
852
+              success: () => {
853
+                // 前台定位授权成功后,再申请后台定位权限
854
+                wx.authorize({
855
+                  scope: 'scope.userLocationBackground',
856
+                  success: () => {
857
+                    resolve(true);
858
+                  },
859
+                  fail: (err) => {
860
+                    // 用户拒绝后台定位权限
861
+                    wx.showModal({
862
+                      title: '提示',
863
+                      content: '需要开启后台定位权限才能使用该功能,请前往设置页开启',
864
+                      confirmText: '前往设置',
865
+                      success: (modalRes) => {
866
+                        if (modalRes.confirm) {
867
+                          wx.openSetting({
868
+                            success: (settingRes) => {
869
+                              if (settingRes.authSetting['scope.userLocationBackground']) {
870
+                                resolve(true);
871
+                              } else {
872
+                                reject(new Error('用户未开启后台定位权限'));
873
+                              }
874
+                            }
875
+                          });
876
+                        } else {
877
+                          reject(new Error('用户拒绝开启后台定位权限'));
878
+                        }
879
+                      }
880
+                    });
881
+                  }
882
+                });
883
+              },
884
+              fail: (err) => {
885
+                // 用户拒绝前台定位权限,引导用户去设置页开启
886
+                wx.showModal({
887
+                  title: '提示',
888
+                  content: '需要开启定位权限才能使用该功能,请前往设置页开启',
889
+                  confirmText: '前往设置',
890
+                  success: (modalRes) => {
891
+                    if (modalRes.confirm) {
892
+                      wx.openSetting({
893
+                        success: (settingRes) => {
894
+                          if (settingRes.authSetting['scope.userLocation'] && settingRes.authSetting['scope.userLocationBackground']) {
895
+                            resolve(true);
896
+                          } else {
897
+                            reject(new Error('用户未开启定位权限'));
898
+                          }
899
+                        }
900
+                      });
901
+                    } else {
902
+                      reject(new Error('用户拒绝开启定位权限'));
903
+                    }
904
+                  }
905
+                });
906
+              }
907
+            });
908
+          }
909
+        }
910
+      },
911
+      fail: (err) => {
912
+        reject(err);
913
+      }
914
+    });
915
+  });
916
+}
917
+});

+ 309
- 0
package-map/pages/map/indexcopy.wxml 查看文件

@@ -0,0 +1,309 @@
1
+<view class="container">
2
+   <!-- 地图组件 -->
3
+   <!-- <map 
4
+    id="map"
5
+    class="map"
6
+    longitude="{{longitude}}"
7
+    latitude="{{latitude}}"
8
+    scale="16"
9
+    markers="{{markers}}"
10
+    polyline="{{polyline}}"
11
+    show-location
12
+  ></map> -->
13
+  <map 
14
+    id="map"
15
+    class="map"
16
+    longitude="{{longitude}}"
17
+    latitude="{{latitude}}"
18
+    markers="{{markers}}"
19
+    polyline="{{plannedRoute}}"
20
+    include-points="{{trackPoints}}"
21
+    bindcontroltap="controltap"
22
+    show-location
23
+  ></map>
24
+   <!-- 规划路线叠加显示 -->
25
+   <!-- controls="{{controls}}" -->
26
+ 
27
+ 
28
+  
29
+  <!-- 信息提示 -->
30
+  <view class="info" wx:if="{{infoText}}">
31
+    {{infoText}}
32
+  </view>
33
+  <!-- 加载提示 -->
34
+  <view wx:if="{{loading}}" class="loading-mask">
35
+    <view class="loading-view">
36
+      <loading size="large" color="#007aff">获取路线中...</loading>
37
+    </view>
38
+  </view>
39
+
40
+  <!-- 错误提示 -->
41
+  <view wx:if="{{error && !loading}}" class="error-message">
42
+    {{error}}
43
+  </view>
44
+  <view class="detailsbox">
45
+
46
+ 
47
+</view>
48
+ 
49
+</view>
50
+<verification-popup 
51
+  isShow="{{showVerification}}"
52
+  phoneNumber="{{phoneNumber}}"
53
+  countdownSeconds="60"
54
+  bind:close="onPopupClose"
55
+  bind:confirm="onCodeConfirm"
56
+  bind:resend="onResendCode"
57
+  bind:complete="onCodeComplete"
58
+/>
59
+
60
+<!-- pages/taxi-detail/taxi-detail.wxml -->
61
+<view class="taxi-card-container">
62
+  <!-- 背景遮罩(仅非全屏/非最小档显示) -->
63
+  <view 
64
+    class="mask" 
65
+    wx:if="{{cardHeight !== 'min' && cardHeight !== 'mid' && cardHeight !== 'max'}}"
66
+    style="opacity: {{maskOpacity}};"
67
+    bindtap="closeCard"
68
+  ></view>
69
+
70
+  <!-- 可拖动卡片(全屏时取消底部圆角) -->
71
+  <view 
72
+    class="taxi-card"
73
+    style="height: {{currentHeight}}px;bottom: 0;transition: height 0.3s ease;border-top-left-radius: {{cardHeight === 'max' ? '0' : '16px'}};border-top-right-radius: {{cardHeight === 'max' ? '0' : '16px'}};" bindtouchstart="handleTouchStart" bindtouchmove="handleTouchMove" bindtouchend="handleTouchEnd">
74
+    <!-- 拖动指示器(全屏时隐藏) -->
75
+    <view class="drag-handler">
76
+      <view class="drag-bar"></view>
77
+    </view>
78
+    <!-- 卡片内容(全屏时增加内边距适配导航栏) -->
79
+    <view class="card-content" style="padding-top: {{cardHeight === 'max' ? '40rpx' : '20rpx'}};">
80
+      <view class="storagecartext">
81
+<view>
82
+  <view class="destination-title">
83
+     <text wx:if="{{orderdata.workorderType==0}}" style="font-weight: 600;">待处理</text>
84
+      <text wx:if="{{orderdata.workorderType==1}}" style="font-weight: 600;">待处理</text>
85
+      <text wx:if="{{orderdata.workorderType==2}}">行驶中</text>
86
+      <text wx:if="{{orderdata.workorderType==3}}">到达指定地点</text>
87
+     <text wx:if="{{orderdata.workorderType==4}}">工作中</text>
88
+     <text wx:if="{{orderdata.workorderType==5}}">完成工作</text>
89
+    </view>
90
+  <view class="destination-title1" style="margin-top: 20rpx;">
91
+      目的地:{{orderdata.poiName}}
92
+    </view>
93
+    <view class="destination-font" wx:if="{{userdata.operationRole==5}}">
94
+    <view class="driver" wx:if="{{orderdata.driverphone==''}}">司机:<text style="color: #ff6b00;">待接单</text> </view>
95
+    <view class="driver" wx:else>司机:{{orderdata.driverName}}·{{orderdata.carName}} 
96
+    
97
+    </view> 
98
+    </view>
99
+    <view class="destination-font" wx:if="{{userdata.operationRole==4}}">客户:{{orderdata.receiver}} <t-icon name="call-1-filled" size="28rpx" data-name="call-1-filled" data-phone="{{orderdata.phone}}" bind:tap="ontelephone" style="margin-left:20rpx"/> </view>
100
+
101
+</view>
102
+  <image wx:if="{{userdata.operationRole==5}}" class="storagecar" src="https://esos-iot.bjdexn.cn/myminio/project/c152026b9bc2485f83b39a6132df3ce7.png" mode="heightFix"/>
103
+ 
104
+<image wx:if="{{userdata.operationRole==4}}" class="storagecar1" src="https://esos-iot.bjdexn.cn/myminio/project/d98e4fde125f40819f8bd8fe872e409c.png" bind:tap="navigation" mode="heightFix"/>
105
+</view> 
106
+<view class="card_more" wx:if="{{userdata.operationRole==5&&orderdata.workorderType!=0}}">
107
+<view class="card_morebox">开发票</view>
108
+<view class="card_morebox">联系客服</view>
109
+<view class="card_morebox" data-phone="{{orderdata.driverphone}}" bind:tap="ontelephone">打电话</view>
110
+<view class="card_morebox">再来一单</view>
111
+</view>
112
+<view class="card_box" wx:if="{{userdata.operationRole==5}}">
113
+ 
114
+   <!-- 行程详情 -->
115
+   <view class="detail-section" style="border-bottom: 1rpx solid #f5f5f5;">
116
+    <view class="viewmore_box" bind:tap="onmore">
117
+  <view class="section-title">订单详情</view>
118
+<view class="viewmore_right">
119
+ <text wx:if="{{!moretype}}">展开详情</text> 
120
+ <text wx:if="{{moretype}}">收起</text> 
121
+<t-icon name="chevron-up" wx:if="{{moretype}}" size="22px" data-name="chevron-up"/>
122
+<t-icon name="chevron-down" wx:if="{{!moretype}}" size="22px" data-name="chevron-down"/>
123
+</view>
124
+</view>
125
+      <view class="detail-list" wx:if="{{moretype}}">
126
+        <view class="detail-item">
127
+          <view class="item-label">订单号</view>
128
+          <view class="item-value">{{orderdata.workorderId}}</view>
129
+        </view>
130
+        <view class="detail-item">
131
+          <view class="item-label">创建时间</view>
132
+          <view class="item-value">{{orderdata.workorderCreatetime}}</view>
133
+        </view>
134
+        <view class="detail-item">
135
+          <view class="item-label">订单类型</view>
136
+          <view class="item-value" wx:if="{{orderdata.chargedischargeType==1}}">充电</view>
137
+          <view class="item-value" wx:if="{{orderdata.chargedischargeType==2}}">放电</view>
138
+        </view>
139
+        <view class="detail-item">
140
+          <view class="item-label">需求电量</view>
141
+          <view class="item-value">{{orderdata.workorderElectricity}}</view>
142
+        </view>
143
+        <view class="detail-item">
144
+          <view class="item-label">SOC</view>
145
+          <view class="item-value">{{orderdata.soc}}</view>
146
+        </view>
147
+        <view class="detail-item">
148
+          <view class="item-label">车型</view>
149
+          <view class="item-value">{{orderdata.carMondel}}</view>
150
+        </view>
151
+        <view class="detail-item">
152
+          <view class="item-label">里程</view>
153
+          <view class="item-value">12.5km</view>
154
+        </view>
155
+        <view class="detail-item">
156
+          <view class="item-label">预计时长</view>
157
+          <view class="item-value">50分钟</view>
158
+        </view>
159
+      </view>
160
+      <view style="height: 20rpx;" wx:if="{{moretype}}"></view>
161
+
162
+    </view>
163
+
164
+   <!-- 费用明细 -->
165
+ <view class="detail-section">
166
+      <view class="viewmore_box" bind:tap="oncostdetails">
167
+  <view class="section-title1">100.1 <text class="section_yuan">元</text> </view>
168
+<view class="viewmore_right">
169
+ <text wx:if="{{!costdetails}}">费用明细</text> 
170
+ <text wx:if="{{costdetails}}">费用明细</text> 
171
+<t-icon name="chevron-up" wx:if="{{costdetails}}" size="22px" data-name="chevron-up"/>
172
+<t-icon name="chevron-down" wx:if="{{!costdetails}}" size="22px" data-name="chevron-down"/>
173
+</view>
174
+</view>
175
+      <view class="fee-list" wx:if="{{costdetails}}">
176
+        <view class="fee-item">
177
+          <view class="fee-label">起步价</view>
178
+          <view class="fee-value">¥13.00</view>
179
+        </view>
180
+        <view class="fee-item">
181
+          <view class="fee-label">里程费</view>
182
+          <view class="fee-value">¥32.00</view>
183
+        </view>
184
+        <view class="fee-item">
185
+          <view class="fee-label">时长费</view>
186
+          <view class="fee-value">¥8.50</view>
187
+        </view>
188
+        <view class="fee-item">
189
+          <view class="fee-label">服务费</view>
190
+          <view class="fee-value">¥5.00</view>
191
+        </view>
192
+        <view class="fee-item">
193
+          <view class="fee-label">电费</view>
194
+          <view class="fee-value">¥5.00</view>
195
+        </view>
196
+     
197
+        <!-- <view class="fee-item total-fee">
198
+          <view class="fee-label">实付款</view>
199
+          <view class="fee-value">¥58.50</view>
200
+        </view> -->
201
+      </view>
202
+      <view style="height: 1rpx;"></view>
203
+    </view>
204
+  </view> 
205
+  <view class="card_box" wx:if="{{userdata.operationRole==4}}">
206
+ 
207
+ <!-- 行程详情 -->
208
+ <view class="detail-section" style="border-bottom: 1rpx solid #f5f5f5;">
209
+  <view class="viewmore_box" bind:tap="onmore">
210
+<view class="section-title">订单详情</view>
211
+<view class="viewmore_right">
212
+<text wx:if="{{!moretype}}">展开详情</text> 
213
+<text wx:if="{{moretype}}">收起</text> 
214
+<t-icon name="chevron-up" wx:if="{{moretype}}" size="22px" data-name="chevron-up"/>
215
+<t-icon name="chevron-down" wx:if="{{!moretype}}" size="22px" data-name="chevron-down"/>
216
+</view>
217
+</view>
218
+    <view class="detail-list" wx:if="{{moretype}}">
219
+      <view class="detail-item">
220
+        <view class="item-label">订单号</view>
221
+        <view class="item-value">{{orderdata.workorderId}}</view>
222
+      </view>
223
+      <view class="detail-item">
224
+        <view class="item-label">创建时间</view>
225
+        <view class="item-value">{{orderdata.workorderCreatetime}}</view>
226
+      </view>
227
+      <view class="detail-item">
228
+        <view class="item-label">订单类型</view>
229
+        <view class="item-value" wx:if="{{orderdata.chargedischargeType==1}}">充电</view>
230
+        <view class="item-value" wx:if="{{orderdata.chargedischargeType==2}}">放电</view>
231
+      </view>
232
+      <view class="detail-item">
233
+        <view class="item-label">需求电量</view>
234
+        <view class="item-value">{{orderdata.workorderElectricity}}</view>
235
+      </view>
236
+      <view class="detail-item">
237
+        <view class="item-label">SOC</view>
238
+        <view class="item-value">{{orderdata.soc}}</view>
239
+      </view>
240
+      <view class="detail-item">
241
+        <view class="item-label">车型</view>
242
+        <view class="item-value">{{orderdata.carMondel}}</view>
243
+      </view>
244
+      <view class="detail-item">
245
+        <view class="item-label">里程</view>
246
+        <view class="item-value">{{distance}} km</view>
247
+      </view>
248
+      <view class="detail-item">
249
+        <view class="item-label">约定时间</view>
250
+        <view class="item-value">{{orderdata.workorderStarttime}}</view>
251
+      </view>
252
+    </view>
253
+    <view style="height: 20rpx;" wx:if="{{moretype}}"></view>
254
+
255
+  </view>
256
+
257
+</view> 
258
+  <view style="height: 140rpx;" wx:if="{{moretype}}"></view>
259
+  <!-- 控制按钮区域 -->
260
+  <view class="control-panel">
261
+    <slide-confirm 
262
+    wx:if="{{orderdata.workorderType==1&&userdata.operationRole==4}}"
263
+    id="mySlideConfirm"
264
+data-type="{{orderdata.workorderType}}"
265
+  bind:success="onSlideSuccess" 
266
+  width="300" 
267
+  height="50"
268
+  defaultText="开始出发"
269
+  successText="验证通过"
270
+/>
271
+
272
+<slide-confirm 
273
+wx:if="{{orderdata.workorderType==2&&userdata.operationRole==4}}"
274
+id="mySlideConfirm"
275
+data-type="{{orderdata.workorderType}}"
276
+
277
+  bind:success="onSlideSuccess" 
278
+  width="300" 
279
+  height="50"
280
+  defaultText="到达目的地"
281
+  successText="验证通过"
282
+/>
283
+<slide-confirm 
284
+wx:if="{{orderdata.workorderType==3&&userdata.operationRole==4}}"
285
+id="mySlideConfirm"
286
+data-type="{{orderdata.workorderType}}"
287
+  bind:success="showVerificationPopup" 
288
+  width="300" 
289
+  height="50"
290
+  defaultText="开始工作"
291
+  successText="验证通过"
292
+/>
293
+<slide-confirm 
294
+wx:if="{{orderdata.workorderType==4&&userdata.operationRole==4}}"
295
+id="mySlideConfirm"
296
+data-type="{{orderdata.workorderType}}"
297
+
298
+  bind:success="onSlideSuccess" 
299
+  width="300" 
300
+  height="50"
301
+  defaultText="完成工作"
302
+  successText="验证通过"
303
+/>
304
+     
305
+  
306
+  </view>
307
+    </view>
308
+  </view>
309
+</view>

+ 41
- 4
package-order/pages/address/index.js 查看文件

@@ -28,16 +28,53 @@ Page({
28 28
       address:data.data
29 29
     })
30 30
   }
31
-  //  wx.navigateTo({
32
-  //   url: '/pages/map/index',
33
-  // })
31
+ 
34 32
     })
35 33
     .catch((err) => {
36 34
    
37 35
       console.error('请求失败:', err);
38 36
     });
39 37
   },
40
-  /**
38
+  onIconTap(item){
39
+    console.log(item.currentTarget.dataset.item);
40
+
41
+    if (item.currentTarget.dataset.item=='add') {
42
+      wx.navigateTo({
43
+        url: `/package-order/pages/newaddress/index`,
44
+      })
45
+    }else{
46
+      console.log(item.currentTarget.dataset.item);
47
+      let obj = item.currentTarget.dataset.item
48
+      wx.setStorageSync("editAddress", obj);
49
+    wx.navigateTo({
50
+      url: `/package-order/pages/newaddress/index`,
51
+    })
52
+    }
53
+  
54
+  },
55
+  onDelete(id){
56
+    console.log(id.currentTarget.dataset.id);
57
+    let data ={
58
+      addressId:id.currentTarget.dataset.id
59
+    }
60
+    api.request(`/sysaddress/deleteaddress`, 'post',data,{ isPublic: false })
61
+    .then((data) => {
62
+  console.log(data.data);
63
+  if (data.code==200) {
64
+ this.getaddress()
65
+  }
66
+ 
67
+    })
68
+    .catch((err) => {
69
+   
70
+      console.error('请求失败:', err);
71
+    });
72
+  },
73
+  radioChange(e){
74
+   console.log(e.detail.value);
75
+
76
+  },
77
+    /**
41 78
    * 生命周期函数--监听页面初次渲染完成
42 79
    */
43 80
   onReady() {

+ 2
- 1
package-order/pages/address/index.json 查看文件

@@ -1,5 +1,6 @@
1 1
 {
2 2
   "usingComponents": {
3
-    "t-icon": "tdesign-miniprogram/icon/icon"
3
+    "t-icon": "tdesign-miniprogram/icon/icon",
4
+    "t-swipe-cell": "tdesign-miniprogram/swipe-cell/swipe-cell"
4 5
   }
5 6
 }

+ 13
- 5
package-order/pages/address/index.wxml 查看文件

@@ -1,12 +1,20 @@
1 1
 <!--pages/userlist/index.wxml-->
2 2
 <view class="setup">
3
-  <view class="driver-info" wx:for="{{address}}" wx:key="addressId">
3
+  <radio-group bindchange="radioChange">
4
+    <t-swipe-cell wx:for="{{address}}" wx:key="addressId">
5
+  <view class="driver-info">
4 6
       <view class="driver-details">
5
-        <view class="driver-car">{{item.addressName}}</view>
6
-        <view class="driver-name">晟运能源</view>
7
-        <view class="driver-arrive">经纬度 {{item.addressLatitudelongitude}}</view>
7
+        <view class="driver-car">{{item.addressDetails}}</view>
8
+        <view class="driver-name">{{item.poiName||item.addressDetails}}</view>
9
+        <view class="driver-arrive"><radio value="{{item.addressId}}" checked="true"/>{{item.receiver}} {{item.phone}}</view>
8 10
       </view>
9 11
       <!-- <button class="cancel-btn" bindtap="cancelOrder">去查看</button> -->
10
-      <t-icon name="edit-2" size="40rpx" data-name="edit-2" bind:tap="onIconTap" />
12
+      <t-icon name="edit-2" size="40rpx" data-name="edit-2" data-item="{{item}}" bind:tap="onIconTap" />
11 13
     </view>
14
+      <view slot="right" class="btn delete-btn" data-id="{{item.addressId}}" bind:tap="onDelete">删除</view>
15
+    </t-swipe-cell>
16
+  </radio-group>
17
+</view>
18
+<view class="address">
19
+<view class="addressbox" data-item="add" bind:tap="onIconTap">新增地址</view>
12 20
 </view>

+ 54
- 0
package-order/pages/address/index.wxss 查看文件

@@ -7,6 +7,11 @@ page{
7 7
   box-sizing: border-box;
8 8
 
9 9
 }
10
+.setup{
11
+  width: 100%;
12
+  padding-bottom: 180rpx;
13
+  box-sizing: border-box;
14
+}
10 15
 .driver-info {
11 16
   background-color: white;
12 17
   border-radius: 16rpx;
@@ -58,4 +63,53 @@ page{
58 63
   border: 1rpx solid #FF5252;
59 64
   background-color: white;
60 65
   border-radius: 32rpx;
66
+}
67
+.address{
68
+  width: 100%;
69
+  height: 140rpx;
70
+  display: flex;
71
+  /* align-items: center; */
72
+  padding-top:10rpx;
73
+  justify-content: center;
74
+  background-color: #ffffff;
75
+position: fixed;
76
+bottom: 0rpx;
77
+left: 0rpx;
78
+box-sizing: border-box;
79
+}
80
+.addressbox{
81
+  width: 400rpx;
82
+  height: 80rpx;
83
+  display: flex;
84
+align-items: center;
85
+justify-content: center;
86
+color: #ffffff;
87
+  border-radius: 10rpx;
88
+  background-color: #2C85FF;
89
+
90
+  box-sizing: border-box;
91
+}
92
+.btn-wrapper {
93
+  height: 100%;
94
+}
95
+
96
+.btn {
97
+  display: inline-flex;
98
+  justify-content: center;
99
+  align-items: center;
100
+  width: 120rpx;
101
+  height: 100%;
102
+  color: white;
103
+}
104
+
105
+.delete-btn {
106
+  background-color: #e34d59;
107
+}
108
+
109
+.edit-btn {
110
+  background-color: #ed7b2f;
111
+}
112
+
113
+.favor-btn {
114
+  background-color: var(--td-brand-color, #0052d9);
61 115
 }

+ 129
- 39
package-order/pages/createorder/index.js 查看文件

@@ -7,30 +7,77 @@ Page({
7 7
    * 页面的初始数据
8 8
    */
9 9
   data: {
10
-    cartype:0,
10
+    cartype:1,
11 11
     index:0,
12 12
     objectArray: [],
13 13
     objdriver: [],
14 14
     driverindex:0,
15
-    date: '2016-09-01',
15
+    date: '',
16
+    time: '',       // 初始时间
16 17
     userdata:[],
17 18
     userindex:0,
18
-    addressindex:0,
19
+    addressindex:'',
19 20
     address: [],
20 21
     items: [
21 22
       {value: 1, name: '光伏'},
22 23
       {value: 2, name: '风电'},
23 24
       {value: 3, name: '网电'},
24
-    ]
25
+    ],
26
+    greenelectricity:0,
27
+    workorderpower:'',
28
+    orderdata:[],
29
+    orderid:'',
25 30
   },
26 31
 
27 32
   /**
28 33
    * 生命周期函数--监听页面加载
29 34
    */
30 35
   onLoad(options) {
31
- this.getdriver()
32
-this.getvehicle()
33
- this.getselectcompany()
36
+    console.log(options);
37
+this.getaddress()
38
+
39
+    if (options.order!='') {
40
+      this.setData({
41
+        orderid:options.order
42
+      })
43
+     this.getoneworkorder()
44
+    }
45
+   
46
+//  this.getdriver()
47
+// this.getvehicle()
48
+  },
49
+  // 订单详情
50
+  getoneworkorder() {
51
+    const data = {
52
+      workorderId: this.data.orderid
53
+    };
54
+    
55
+    api.request(`/sysworkorder/selectworkorderId`, 'post', data, { isPublic: false })       
56
+      .then((data) => {
57
+        if (data.code == 200) {
58
+       
59
+          this.setData({
60
+            cartype:data.data.chargedischargeType,
61
+            workorderElectricity:data.data.workorderElectricity,
62
+            workorderpower:data.data.workorderPower,
63
+            greenelectricity:data.data.greenelectricity,
64
+            date:data.data.workorderStarttime.slice(0,10),
65
+            time:data.data.workorderStarttime.slice(11,16),
66
+          })
67
+          for (let index = 0; index < this.data.address.length; index++) {
68
+            if (data.data.addressId==this.data.address[index].addressId) {
69
+              this.setData({
70
+               addressindex:index
71
+              })
72
+            }
73
+       }
74
+  
75
+        }
76
+      })
77
+      .catch((err) => {
78
+        console.error('获取工单信息失败:', err);
79
+        this.showInfo('获取工单信息失败');
80
+      });
34 81
   },
35 82
   // 司机
36 83
   getdriver(){
@@ -98,27 +145,11 @@ this.getvehicle()
98 145
       console.error('请求失败:', err);
99 146
     });
100 147
   },
101
-    // 用户
102
-    getselectcompany(){
103
-     
104
-      api.request(`/SysCompany/selectcompany`, 'post',{ isPublic: false })
105
-      .then((data) => {
106
-       console.log(data.data);
107
-       this.setData({
108
-        userdata:data.data
109
-       })
110
- this.getaddress()
111 148
 
112
-      })
113
-      .catch((err) => {
114
-     
115
-        console.error('请求失败:', err);
116
-      });
117
-    },
118 149
   // 地址
119 150
   getaddress(){
120 151
     let data ={
121
-      operationId:this.data.userdata[this.data.userindex].companyId
152
+      operationId:''
122 153
     }
123 154
     api.request(`/sysaddress/selectaddress`, 'post',data,{ isPublic: false })
124 155
     .then((data) => {
@@ -138,23 +169,42 @@ this.setData({
138 169
   cartype:e.currentTarget.dataset.index
139 170
 })
140 171
   },
141
-  bindDateChange: function(e) {
172
+  bindDateChange(e) {
142 173
     console.log('picker发送选择改变,携带值为', e.detail.value)
143 174
     this.setData({
144 175
       date: e.detail.value
145 176
     })
146 177
   },
178
+    // 时间选择变化
179
+    bindTimeChange(e) {
180
+      this.setData({ time: e.detail.value });
181
+    },
182
+  // 需求电量
183
+  bindKeyInput (e) {
184
+    this.setData({
185
+      workorderElectricity: e.detail.value
186
+    })
187
+  },
188
+  bindintentionInput (e) {
189
+    this.setData({
190
+      workorderpower: e.detail.value
191
+    })
192
+  },
147 193
   details(){
148
- 
194
+   if (this.data.workorderElectricity==''||this.data.date==''||this.data.time==''||this.data.workorderpower=='') {
195
+    wx.showToast({
196
+      title: '请填写完整消息',
197
+      icon: 'none'
198
+    });
199
+    return
200
+   }
149 201
     let data ={
150
-      workorderName:this.data.cartype,
151 202
       addressId:this.data.address[this.data.addressindex].addressId,
152
-      driverId:this.data.objdriver[this.data.driverindex].id,
153
-      carId:this.data.objectArray[this.data.index].id,
154
-      customerId:this.data.userdata[this.data.userindex].companyId,
155
-      workorderContent:'',
156
-      workorderElectricity:'230',
157
-      chargedischargeType:this.data.cartype
203
+      workorderElectricity:this.data.workorderElectricity,
204
+      chargedischargeType:this.data.cartype,
205
+      greenelectricity:this.data.greenelectricity,
206
+      workorderStarttime:this.data.date+' '+this.data.time,
207
+      workorderpower:this.data.workorderpower
158 208
     }
159 209
     api.request(`/sysworkorder/addworkorder`, 'post',data,{ isPublic: false })
160 210
     .then((data) => {
@@ -170,6 +220,38 @@ this.setData({
170 220
     });
171 221
  
172 222
   },
223
+  // 编辑
224
+  editdetails(){
225
+    if (this.data.workorderElectricity==''||this.data.date==''||this.data.time==''||this.data.workorderpower=='') {
226
+     wx.showToast({
227
+       title: '请填写完整消息',
228
+       icon: 'none'
229
+     });
230
+     return
231
+    }
232
+     let data ={
233
+      workorderId:this.data.orderid,
234
+       addressId:this.data.address[this.data.addressindex].addressId,
235
+       workorderElectricity:this.data.workorderElectricity,
236
+       chargedischargeType:this.data.cartype,
237
+       greenelectricity:this.data.greenelectricity,
238
+       workorderStarttime:this.data.date+' '+this.data.time,
239
+       workorderpower:this.data.workorderpower
240
+     }
241
+     api.request(`/sysworkorder/updateworkorder`, 'post',data,{ isPublic: false })
242
+     .then((data) => {
243
+  console.log(data);
244
+  wx.switchTab({
245
+   url: '/pages/tool/index',
246
+ })
247
+ 
248
+     })
249
+     .catch((err) => {
250
+    
251
+       console.error('请求失败:', err);
252
+     });
253
+  
254
+   },
173 255
    //  司机
174 256
    bindectArrayChange(e){
175 257
     console.log(e.detail.value);
@@ -192,7 +274,7 @@ this.setData({
192 274
 })
193 275
     },
194 276
       // 地址
195
-      binduserChange(e){
277
+      bindPickerChange(e){
196 278
         console.log(e);
197 279
         this.setData({
198 280
           addressindex:e.detail.value
@@ -201,15 +283,22 @@ this.setData({
201 283
            radioChange(e) {
202 284
             console.log('radio发生change事件,携带value值为:', e.detail.value)
203 285
         
204
-            const items = this.data.items
205
-            for (let i = 0, len = items.length; i < len; ++i) {
206
-              items[i].checked = items[i].value === e.detail.value
207
-            }
286
+            // const items = this.data.items
287
+            // for (let i = 0, len = items.length; i < len; ++i) {
288
+            //   items[i].checked = items[i].value === e.detail.value
289
+            // }
208 290
         
209 291
             this.setData({
210
-              items
292
+              greenelectricity:e.detail.value
211 293
             })
294
+            console.log(this.data.greenelectricity);
295
+          },
296
+          toconfigure(){
297
+    wx.navigateTo({
298
+            url: '/package-order/pages/address/index',
299
+          });
212 300
           },
301
+      
213 302
   /**
214 303
    * 生命周期函数--监听页面初次渲染完成
215 304
    */
@@ -221,6 +310,7 @@ this.setData({
221 310
    * 生命周期函数--监听页面显示
222 311
    */
223 312
   onShow() {
313
+    this.getaddress()
224 314
 
225 315
   },
226 316
 

+ 64
- 29
package-order/pages/createorder/index.wxml 查看文件

@@ -5,24 +5,34 @@
5 5
 <text style="color: red;">*</text> 用车类型
6 6
 </view>
7 7
 <view class="car_right">
8
-  <view class="{{cartype== 1 ?'cartbuy':'carsell'}}" data-index="0" bind:tap="oncar">买电</view>
9
-  <view class="{{cartype== 0 ?'cartbuy':'carsell'}}" data-index="1" bind:tap="oncar">卖电</view>
8
+  <view class="{{cartype== 2 ?'cartbuy':'carsell'}}" data-index="1" bind:tap="oncar">买电</view>
9
+  <view class="{{cartype== 1 ?'cartbuy':'carsell'}}" data-index="2" bind:tap="oncar">卖电</view>
10 10
 </view>
11 11
 </view>
12 12
 <view class="car">
13 13
 <view>
14
-<text style="color: red;">*</text> <text wx:if="{{cartype==1}}"> 出售电量</text> <text wx:if="{{cartype==0}}"> 需求电量</text> 
14
+<text style="color: red;">*</text> <text wx:if="{{cartype==2}}"> 出售电量</text> <text wx:if="{{cartype==1}}"> 需求电量</text> 
15 15
 </view>
16 16
 <view class="model_right">
17
-<input class="powerlevel" type="text" placeholder="请输入电量"/>
17
+<input class="powerlevel" type="text" value="{{workorderElectricity}}" bindinput="bindKeyInput" placeholder="请输入电量"/>kWh
18 18
 </view>
19 19
 </view>
20
-<view class="car" wx:if="{{cartype==1}}">
20
+<!-- <view class="car" wx:if="{{cartype==1}}">
21 21
 <view>
22 22
 <text style="color: red;">*</text> 意向电价
23 23
 </view>
24 24
 <view class="model_right">
25
-<input class="powerlevel" type="text" placeholder="请输入需求用电"/>
25
+<input class="powerlevel" type="text" bindinput="binddemandInput" placeholder="请输入需求用电"/>
26
+</view>
27
+</view> -->
28
+
29
+<!-- 网电 -->
30
+<view class="car">
31
+<view style="margin-left: 18rpx;">
32
+ 变压器容量
33
+</view>
34
+<view class="model_right">
35
+<input class="powerlevel" value="{{workorderpower}}" bindinput="bindintentionInput" type="text" placeholder="请输入需求用电"/>kVA
26 36
 </view>
27 37
 </view>
28 38
 <view class="car">
@@ -34,22 +44,13 @@
34 44
         <label class="weui-cell weui-check__label" wx:for="{{items}}" wx:key="value">
35 45
 
36 46
           <view class="weui-cell__hd">
37
-            <radio value="{{item.value}}" checked="true"/>
47
+            <radio value="{{item.value}}" checked="{{item.value == greenelectricity}}"/>
38 48
           </view>
39 49
           <view class="weui-cell__bd">{{item.name}}</view>
40 50
         </label>
41 51
       </radio-group>
42 52
 </view>
43 53
 </view>
44
-<!-- 网电 -->
45
-<view class="car">
46
-<view style="margin-left: 18rpx;">
47
- 变压器容量
48
-</view>
49
-<view class="model_right">
50
-<input class="powerlevel" type="text" placeholder="请输入需求用电"/>
51
-</view>
52
-</view>
53 54
 <!-- <view class="car">
54 55
 <view>
55 56
 <text style="color: red;">*</text> 司机
@@ -63,7 +64,7 @@
63 64
   </picker>
64 65
 </view>
65 66
 </view> -->
66
-<view class="car">
67
+<!-- <view class="car">
67 68
 <view style="margin-left: 18rpx;">
68 69
 车长车型
69 70
 </view>
@@ -75,7 +76,7 @@
75 76
     </view>
76 77
   </picker>
77 78
 </view>
78
-</view>
79
+</view> -->
79 80
 <!-- <view class="car">
80 81
 <view>
81 82
 <text style="color: red;">*</text> 用户
@@ -89,39 +90,73 @@
89 90
   </picker>
90 91
 </view>
91 92
 </view> -->
92
- 
93
-<view class="car">
93
+
94
+<view class="car1">
94 95
 <view>
95 96
 <text style="color: red;">*</text> 地址
96 97
 </view>
97 98
 <view class="model_right">
98
-  <picker bindchange="bindPickerChange" value="{{addressindex}}" range="{{address}}" range-key="addressDetails">
99
+  <picker bindchange="bindPickerChange" value="{{addressindex}}" range="{{address}}" range-key="poiName" wx:if="{{address.length>0}}">
99 100
     <view class="picker">
100
-    {{address[addressindex].addressDetails}}
101
+    <view>
102
+    </view>
103
+    <view style="display: flex;">
104
+      <text  wx:if="{{addressindex===''}}" style="color: #cccccc;">请选择完整</text>
105
+    <text wx:else> {{address[addressindex].poiName}}</text>
106
+
101 107
 <t-icon name="chevron-right-s" size="40rpx" data-name="chevron-right-s" color="#cccccc" bind:tap="onIconTap" />
102 108
     </view>
109
+   
110
+    </view>
103 111
   </picker>
112
+  <view class="picker" wx:else bind:tap="toconfigure">
113
+    新增地址
114
+<t-icon name="chevron-right-s" size="40rpx" data-name="chevron-right-s" color="#cccccc" bind:tap="onIconTap" />
115
+    </view>
104 116
 </view>
105 117
 </view>
106
-<view class="car">
118
+<view class="car1">
107 119
 <view>
108
-<text style="color: red;">*</text> 预计到达时间
120
+<text style="color: red;">*</text> 期望到达日期
109 121
 </view>
110 122
 <view class="model_right">
111
-  <picker mode="date" value="{{date}}" start="2015-09-01" end="2017-09-01" bindchange="bindDateChange">
123
+  <picker mode="date" value="{{date}}" start="2020-09-01" end="2030-09-01" bindchange="bindDateChange">
112 124
     <view class="picker">
113
-     {{date}}
125
+    <view></view>
126
+    <view style="display:flex;">
127
+    <text wx:if="{{date!=''}}">{{date}}</text> 
128
+    <text wx:else style="color: #cccccc;">请选择日期</text> 
114 129
 <t-icon name="chevron-right-s" size="40rpx" data-name="chevron-right-s" color="#cccccc" bind:tap="onIconTap" />
115 130
     </view>
131
+    </view>
116 132
   </picker>
117 133
 </view>
118 134
 </view>
119
-
135
+<view class="car1">
136
+<view>
137
+<text style="color: red;">*</text> 期望到达时间
138
+</view>
139
+<view class="model_right">
140
+  <!-- 时间选择器 -->
141
+<picker mode="time" value="{{time}}" start="00:00" end="23:59" bindchange="bindTimeChange">
142
+  <view class="picker">
143
+  <view></view>
144
+  <view style="display: flex;">
145
+   <text wx:if="{{time}}">{{time}}</text> 
146
+   <text wx:else style="color: #cccccc;">请选择时间</text> 
147
+    <t-icon name="chevron-right-s" size="40rpx" color="#cccccc" />
148
+  </view>
149
+  </view>
150
+</picker>
151
+</view>
152
+</view>
120 153
 </view>
121 154
 <!-- 
122 155
 
123 156
 --->
124
-<button class="call-btn" bindtap="details">
157
+<button class="call-btn" bindtap="details" wx:if="{{orderid==''}}"> 
125 158
       <text class="call-btn_left_electricity">预约</text>
126 159
 </button> 
127
-        
160
+<button class="call-btn" bindtap="editdetails" wx:else>
161
+      <text class="call-btn_left_electricity">保存</text>
162
+</button> 

+ 13
- 0
package-order/pages/createorder/index.wxss 查看文件

@@ -18,6 +18,15 @@ box-sizing: border-box;
18 18
   display: flex;
19 19
   justify-content: space-between;
20 20
 }
21
+.car1{
22
+  margin-top: 20rpx;
23
+  padding: 0rpx 30rpx;
24
+  box-sizing: border-box;
25
+  display: flex;
26
+  align-items: center;
27
+  justify-content: space-between;
28
+}
29
+ 
21 30
 .car_right{
22 31
   width: 240rpx;
23 32
   display: flex;
@@ -38,7 +47,11 @@ box-sizing: border-box;
38 47
   justify-content: space-between;
39 48
 }
40 49
 .picker{
50
+  width: 400rpx;
51
+  height: 80rpx;
41 52
   display: flex;
53
+align-items: center;
54
+ justify-content: space-between;
42 55
 }
43 56
 .call-btn {
44 57
   position: absolute;

+ 209
- 0
package-order/pages/mapSelect/index.js 查看文件

@@ -0,0 +1,209 @@
1
+// const app = getApp();
2
+// const api = require('../../../api/index.js');
3
+
4
+const QQMapWX = require('../../../libs/qqmap-wx-jssdk.min.js'); // 引入QQ地图SDK(需自行下载)
5
+// this.qqmapsdk = require('../../../libs/qqmap-wx-jssdk.min.js');
6
+
7
+// 初始化QQ地图API(需在腾讯地图开放平台申请key)
8
+const qqmapsdk = new QQMapWX({
9
+  key: 'VRGBZ-ZFRHB-SKIUP-NHHJ3-TXGJT-ZIFG3' // 替换为自己的API密钥(https://lbs.qq.com/dev/console/application/mine)
10
+});
11
+
12
+Page({
13
+  data: {
14
+    latitude: 0,        // 纬度
15
+    longitude: 0,       // 经度
16
+    searchKey: '',      // 搜索关键词
17
+    poiList: [],        // 附近地点列表
18
+    markers: [],        // 地图标记点
19
+    loading: false      // 加载状态
20
+  },
21
+
22
+  // 保持原有逻辑不变,仅需确保接收省市区参数正常
23
+onLoad(options) {
24
+  if (options.params) {
25
+    try {
26
+      this.setData({
27
+        prevParams: JSON.parse(decodeURIComponent(options.params))
28
+      });
29
+    } catch (err) {
30
+      console.error('参数解析失败:', err);
31
+    }
32
+  }
33
+  this.getLocation();
34
+  },
35
+
36
+  // 获取用户当前定位
37
+  getLocation() {
38
+    wx.showLoading({
39
+      title: '获取位置中...'
40
+    });
41
+
42
+    wx.getLocation({
43
+      type: 'gcj02', // 国测局坐标系(微信地图默认)
44
+      success: (res) => {
45
+        const { latitude, longitude } = res;
46
+        this.setData({
47
+          latitude,
48
+          longitude,
49
+          // 添加当前位置标记点
50
+          markers: [{
51
+            id: 0,
52
+            latitude,
53
+            longitude,
54
+            iconPath: 'https://esos-iot.bjdexn.cn/myminio/project/0b0593293af54ea097b168cea479c25c.png', // 可自行添加定位图标
55
+            width: 30,
56
+            height: 30,
57
+            anchor: { x: 0.5, y: 0.5 }
58
+          }]
59
+        });
60
+        // 获取附近地点
61
+        this.getNearbyPoi(latitude, longitude);
62
+      },
63
+      fail: (err) => {
64
+        wx.hideLoading();
65
+        wx.showToast({
66
+          title: '获取定位失败,请开启定位权限',
67
+          icon: 'none',
68
+          duration: 2000
69
+        });
70
+        // 若定位失败,使用上一页已选地址的经纬度(如果有)
71
+        const { province, city, district } = this.data.prevFormData;
72
+        if (province && city && district) {
73
+          this.geocoder(`${province}${city}${district}`);
74
+        }
75
+      }
76
+    });
77
+  },
78
+
79
+  // 地址转经纬度(地理编码)
80
+  geocoder(address) {
81
+    qqmapsdk.geocoder({
82
+      address: address,
83
+      success: (res) => {
84
+        if (res.result && res.result.location) {
85
+          const { lat, lng } = res.result.location;
86
+          this.setData({
87
+            latitude: lat,
88
+            longitude: lng,
89
+            markers: [{
90
+              id: 0,
91
+              latitude: lat,
92
+              longitude: lng,
93
+              iconPath: 'https://esos-iot.bjdexn.cn/myminio/project/0b0593293af54ea097b168cea479c25c.png',
94
+              width: 30,
95
+              height: 30,
96
+              anchor: { x: 0.5, y: 0.5 }
97
+            }]
98
+          });
99
+          this.getNearbyPoi(lat, lng);
100
+        }
101
+      },
102
+      fail: () => {
103
+        wx.showToast({
104
+          title: '地址解析失败',
105
+          icon: 'none'
106
+        });
107
+      }
108
+    });
109
+  },
110
+
111
+  // 获取附近地点(POI搜索)
112
+  getNearbyPoi(latitude, longitude) {
113
+    this.setData({ loading: true });
114
+
115
+    qqmapsdk.search({
116
+      keyword: this.data.searchKey || '小区,商铺,写字楼,学校,医院', // 默认搜索关键词
117
+      location: `${latitude},${longitude}`,
118
+      radius: 2000, // 搜索半径(2000米)
119
+      page_size: 20, // 每页结果数
120
+      success: (res) => {
121
+        wx.hideLoading();
122
+        this.setData({
123
+          poiList: res.data,
124
+          loading: false
125
+        });
126
+      },
127
+      fail: (err) => {
128
+        wx.hideLoading();
129
+        this.setData({ loading: false });
130
+        wx.showToast({
131
+          title: '获取附近地点失败',
132
+          icon: 'none'
133
+        });
134
+      }
135
+    });
136
+  },
137
+
138
+  // 搜索输入事件
139
+  handleSearchInput(e) {
140
+    this.setData({ searchKey: e.detail.value });
141
+  },
142
+
143
+  // 搜索确认
144
+  handleSearchConfirm() {
145
+    const { searchKey, latitude, longitude } = this.data;
146
+    if (searchKey.trim()) {
147
+      // 关键词搜索
148
+      this.getNearbyPoi(latitude, longitude);
149
+    }
150
+  },
151
+
152
+  // 地图视野变化事件(拖动地图后刷新附近地点)
153
+  handleRegionChange(e) {
154
+    if (e.type === 'end' && e.causedBy === 'drag') {
155
+      const { latitude, longitude } = this.data.mapCtx.getCenterLocation();
156
+      this.setData({ latitude, longitude });
157
+      this.getNearbyPoi(latitude, longitude);
158
+    }
159
+  },
160
+
161
+  // 点击地图标记点
162
+  handleMarkerTap(e) {
163
+    const { id } = e.markerId;
164
+    const { poiList } = this.data;
165
+    if (id > 0 && poiList[id - 1]) {
166
+      this.selectPoi({ currentTarget: { dataset: { poi: poiList[id - 1] } } });
167
+    }
168
+  },
169
+
170
+  // 选择地点
171
+  selectPoi(e) {
172
+    console.log(e);
173
+    const selectedPoi = e.currentTarget.dataset.poi;
174
+    if (!selectedPoi) return;
175
+
176
+    // 解析地址信息(省市区+详细地址)
177
+    const {ad_info,address, title, location } = selectedPoi;
178
+    const detailAddress = address + title;
179
+
180
+    // 组装地址数据addressDetails
181
+    const addressData = {
182
+      province:ad_info.province,
183
+      city:ad_info.city,
184
+      district:ad_info.district,
185
+      addressDetails: detailAddress,
186
+      latitude: location.lat,
187
+      longitude: location.lng,
188
+      poiName: title // 标记点名称(如小区名、商铺名)
189
+    };
190
+    console.log(addressData);
191
+
192
+    // 返回上一页并传递选择的地址数据
193
+    const pages = getCurrentPages();
194
+    const prevPage = pages[pages.length - 2];
195
+    if (prevPage) {
196
+      prevPage.setData({
197
+        'formData.province': ad_info.province,
198
+        'formData.city': ad_info.city,
199
+        'formData.district': ad_info.district,
200
+        'formData.addressDetails': detailAddress,
201
+        'formData.poiName': title,
202
+        'formData.latitude': location.lat,
203
+        'formData.longitude': location.lng
204
+      });
205
+    }
206
+
207
+    wx.navigateBack({ delta: 1 });
208
+  }
209
+});

+ 6
- 0
package-order/pages/mapSelect/index.json 查看文件

@@ -0,0 +1,6 @@
1
+{
2
+  "navigationBarTitleText": "选择地址",
3
+  "navigationBarBackgroundColor": "#ffffff",
4
+  "navigationBarTextStyle": "black",
5
+  "usingComponents": {}
6
+}

+ 49
- 0
package-order/pages/mapSelect/index.wxml 查看文件

@@ -0,0 +1,49 @@
1
+<view class="map-container">
2
+  <!-- 搜索框 -->
3
+  <view class="search-bar">
4
+    <input 
5
+      class="search-input" 
6
+      placeholder="搜索附近地点、小区、商铺等"
7
+      value="{{searchKey}}"
8
+      bindinput="handleSearchInput"
9
+      bindconfirm="handleSearchConfirm"
10
+    />
11
+    <button 
12
+      class="search-btn" 
13
+      bindtap="handleSearchConfirm"
14
+    >
15
+      搜索
16
+    </button>
17
+  </view>
18
+  
19
+  <!-- 地图组件 -->
20
+  <map 
21
+    class="map"
22
+    longitude="{{longitude}}"
23
+    latitude="{{latitude}}"
24
+    markers="{{markers}}"
25
+    show-location
26
+    bindmarkertap="handleMarkerTap"
27
+    bindregionchange="handleRegionChange"
28
+  ></map>
29
+  
30
+  <!-- 附近地点列表 -->
31
+  <view class="poi-list">
32
+    <view 
33
+      class="poi-item"
34
+      wx:for="{{poiList}}"
35
+      wx:key="id"
36
+      bindtap="selectPoi"
37
+      data-poi="{{item}}"
38
+    >
39
+      <view class="poi-name">{{item.title}}</view>
40
+      <view class="poi-address">{{item.address}}</view>
41
+    </view>
42
+  </view>
43
+  
44
+  <!-- 加载提示 -->
45
+  <view class="loading" wx:if="{{loading}}">加载中...</view>
46
+  <view class="no-result" wx:if="{{!loading && poiList.length === 0 && searchKey.trim()}}">
47
+    未找到相关地点,请更换关键词
48
+  </view>
49
+</view>

+ 84
- 0
package-order/pages/mapSelect/index.wxss 查看文件

@@ -0,0 +1,84 @@
1
+page {
2
+  height: 100%;
3
+  background-color: #fff;
4
+}
5
+
6
+.map-container {
7
+  height: 100%;
8
+  display: flex;
9
+  flex-direction: column;
10
+}
11
+
12
+/* 搜索框 */
13
+.search-bar {
14
+  width: 100%;
15
+  padding: 15rpx 30rpx;
16
+  border-bottom: 1rpx solid #f1f1f1;
17
+  display: flex;
18
+  align-items: center;
19
+  box-sizing: border-box;
20
+}
21
+
22
+.search-input {
23
+  flex: 1;
24
+  height: 60rpx;
25
+  background-color: #f5f5f5;
26
+  border-radius: 30rpx;
27
+  padding: 0 20rpx;
28
+  font-size: 26rpx;
29
+}
30
+
31
+.search-btn {
32
+  margin-left: 15rpx;
33
+  padding: 0 20rpx;
34
+  height: 60rpx;
35
+  line-height: 60rpx;
36
+  background-color: #2C85FF;
37
+  color: #ffffff;
38
+  font-size: 26rpx;
39
+  border-radius: 30rpx;
40
+}
41
+
42
+.search-btn::after {
43
+  border: none;
44
+}
45
+
46
+/* 地图 */
47
+.map {
48
+  flex: 1;
49
+  width: 100%;
50
+}
51
+
52
+/* 附近地点列表 */
53
+.poi-list {
54
+  max-height: 600rpx;
55
+  min-height: 300rpx;
56
+  overflow-y: auto;
57
+  border-top: 1rpx solid #f1f1f1;
58
+  padding-bottom:80rpx;
59
+}
60
+
61
+.poi-item {
62
+  padding: 20rpx 30rpx;
63
+  border-bottom: 1rpx solid #f1f1f1;
64
+}
65
+
66
+.poi-name {
67
+  font-size: 28rpx;
68
+  color: #333;
69
+  margin-bottom: 8rpx;
70
+}
71
+
72
+.poi-address {
73
+  font-size: 24rpx;
74
+  color: #666;
75
+  line-height: 1.4;
76
+}
77
+
78
+/* 加载提示 */
79
+.loading, .no-result {
80
+  padding: 20rpx;
81
+  text-align: center;
82
+  font-size: 26rpx;
83
+  color: #999;
84
+}

+ 265
- 0
package-order/pages/newaddress/index.js 查看文件

@@ -0,0 +1,265 @@
1
+const app = getApp();
2
+const api = require('../../../api/index.js');
3
+ 
4
+// 全局常量定义
5
+const PHONE_REG = /^1[3-9]\d{9}$/; // 手机号正则
6
+const EMPTY_REGION_TIP = '请选择省/市/区'; // 地区空提示
7
+
8
+Page({
9
+  data: {
10
+    formData: {
11
+      receiver: '',
12
+      phone: '',
13
+      province: '',       // 省份名称(原生组件返回)
14
+      city: '',           // 城市名称(原生组件返回)
15
+      district: '',       // 区县名称(原生组件返回)
16
+      provincecode: '',   // 省份编码(原生组件返回)
17
+      citycode: '',       // 城市编码(原生组件返回)
18
+      districtcode: '',   // 区县编码(原生组件返回)
19
+      addressDetails: '',
20
+      isDefault: false,
21
+      poiName: '',
22
+      latitude: '',
23
+      longitude: '',
24
+      addressId:''
25
+    },
26
+    regionValue: [],     // 原生选择器绑定值(['省', '市', '区'])
27
+    customItem: EMPTY_REGION_TIP, // 选择器默认提示
28
+    isSubmitting: false  // 防止重复提交
29
+  },
30
+
31
+  onLoad(options) {
32
+    console.log(options);
33
+    if (wx.getStorageSync("editAddress")) {
34
+      const parsedAddress = wx.getStorageSync("editAddress") || {};
35
+      console.log(parsedAddress);
36
+      this.setData({
37
+        formData:parsedAddress
38
+      })
39
+    }
40
+  
41
+    wx.removeStorageSync("editAddress"); // 用完立即删除
42
+    // 初始化:优先使用定位获取当前地区(可选)
43
+    this.getLocationRegion();
44
+    // 支持编辑模式
45
+    this.initEditMode(options);
46
+  },
47
+  onShow(){
48
+ 
49
+  },
50
+ 
51
+  /**
52
+   * 初始化编辑模式(从地址列表传递数据)
53
+   */
54
+  initEditMode(options) {
55
+    console.log(options);
56
+    if (options.address) {
57
+      try {
58
+        const address = JSON.parse(decodeURIComponent(options.address));
59
+        this.setData({
60
+          formData: { ...this.data.formData, ...address },
61
+          regionValue: [address.province, address.city, address.district]
62
+        });
63
+      } catch (err) {
64
+        console.error('编辑地址数据解析失败:', err);
65
+        wx.showToast({ title: '地址数据异常', icon: 'none' });
66
+      }
67
+    }
68
+  },
69
+
70
+  /**
71
+   * 获取当前定位地区(优化初始体验)
72
+   */
73
+  getLocationRegion() {
74
+    wx.getLocation({
75
+      type: 'gcj02',
76
+      success: (res) => {
77
+        // 逆地理编码:通过经纬度获取省市区信息
78
+        wx.request({
79
+          url: `https://apis.map.qq.com/ws/geocoder/v1/?location=${res.latitude},${res.longitude}&key=VRGBZ-ZFRHB-SKIUP-NHHJ3-TXGJT-ZIFG3`,
80
+          success: (geoRes) => {
81
+            if (geoRes.data.status === 0) {
82
+              const { province, city, district, adcode } = geoRes.data.result.ad_info;
83
+              const regionValue = [province, city, district];
84
+              this.setData({
85
+                regionValue,
86
+                'formData.province': province,
87
+                'formData.city': city,
88
+                'formData.district': district,
89
+                'formData.provincecode': adcode.slice(0, 2) + '0000', // 省份编码(前2位+0000)
90
+                'formData.citycode': adcode.slice(0, 4) + '00',     // 城市编码(前4位+00)
91
+                'formData.districtcode': adcode,                   // 区县编码
92
+                'formData.latitude': res.latitude,
93
+                'formData.longitude': res.longitude
94
+              });
95
+            }
96
+          }
97
+        });
98
+      },
99
+      fail: () => {
100
+        console.warn('获取定位失败,使用默认选择器');
101
+        // 定位失败不影响,用户可手动选择
102
+      }
103
+    });
104
+  },
105
+
106
+  /**
107
+   * 省市区选择器变更事件(完全原生实现)
108
+   */
109
+  handlePickerChange(e) {
110
+    const { value, code } = e.detail; // 原生组件返回:value=名称数组,code=编码数组
111
+    const [province, city, district] = value;
112
+    const [provincecode, citycode, districtcode] = code;
113
+
114
+    // 直接使用原生返回的名称和编码,无需自定义映射
115
+    this.setData({
116
+      regionValue: value,
117
+      'formData.province': province,
118
+      'formData.provincecode': provincecode,
119
+      'formData.city': city,
120
+      'formData.citycode': citycode,
121
+      'formData.district': district,
122
+      'formData.districtcode': districtcode
123
+    });
124
+
125
+    console.log('选中省市区:', {
126
+      name: `${province}-${city}-${district}`,
127
+      code: `${provincecode}-${citycode}-${districtcode}`
128
+    });
129
+  },
130
+
131
+  /**
132
+   * 输入框事件(保持原有限制)
133
+   */
134
+  handleInput(e) {
135
+    const { key } = e.currentTarget.dataset;
136
+    let { value } = e.detail;
137
+
138
+    // 针对性输入限制
139
+    switch (key) {
140
+      case 'receiver':
141
+        value = value.trim().slice(0, 10); // 收货人最多10个字
142
+        break;
143
+      case 'phone':
144
+        value = value.replace(/\D/g, ''); // 只保留数字
145
+        break;
146
+      
147
+      case 'addressDetails':
148
+        value = value.trim().slice(0, 50); // 详细地址最多50个字
149
+        break;
150
+    }
151
+
152
+    this.setData({
153
+      [`formData.${key}`]: value
154
+    });
155
+  },
156
+  /**
157
+   * 开关切换事件
158
+   */
159
+  handleSwitchChange(e) {
160
+    const isDefault = e.detail.value;
161
+    this.setData({
162
+      'formData.isDefault': isDefault
163
+    });
164
+
165
+    if (isDefault) {
166
+      wx.showToast({
167
+        title: '将设为默认收货地址',
168
+        icon: 'none',
169
+        duration: 1500
170
+      });
171
+    }
172
+  },
173
+
174
+  /**
175
+   * 跳转地图选址
176
+   */
177
+  navigateToMapSelect() {
178
+    const { formData } = this.data;
179
+    console.log(formData);
180
+    const params = {
181
+      province: formData.province,
182
+      city: formData.city,
183
+      district: formData.district
184
+    };
185
+
186
+    wx.navigateTo({
187
+      url: `/package-order/pages/mapSelect/index?params=${encodeURIComponent(JSON.stringify(params))}`
188
+    });
189
+  },
190
+
191
+  /**
192
+   * 表单提交(保持原有校验)
193
+   */
194
+  formSubmit(e) {
195
+    const { formData, isSubmitting } = this.data;
196
+
197
+    // 防止重复提交
198
+    if (isSubmitting) return;
199
+    console.log(formData);
200
+
201
+    // 完整表单校验
202
+    if (!formData.receiver.trim()) {
203
+      wx.showToast({ title: '请输入收货人姓名', icon: 'none' });
204
+      return;
205
+    }
206
+
207
+    if (!PHONE_REG.test(formData.phone)) {
208
+      wx.showToast({ title: '请输入正确的手机号码', icon: 'none' });
209
+      return;
210
+    }
211
+
212
+    if (!formData.province || !formData.city || !formData.district) {
213
+      wx.showToast({ title: '请选择所在地区', icon: 'none' });
214
+      return;
215
+    }
216
+
217
+    if (!formData.addressDetails.trim()) {
218
+      wx.showToast({ title: '请输入详细地址', icon: 'none' });
219
+      return;
220
+    }
221
+      if (formData.poiName=='') {
222
+        formData.poiName = formData.addressDetails
223
+        formData.addressDetails = formData.province+formData.city+formData.district+formData.addressDetails
224
+      }
225
+    // 开始提交
226
+    this.setData({ isSubmitting: true });
227
+    // 模拟接口请求(实际项目替换为真实接口)
228
+    if (formData.addressId=='') {
229
+      api.request(`/sysaddress/addaddress`, 'post',formData,{ isPublic: false })
230
+      .then((data) => {
231
+    console.log(data.data);
232
+    if (data.code==200) {
233
+    wx.navigateTo({
234
+      url: '/package-order/pages/address/index',
235
+    })
236
+    this.setData({ isSubmitting: false });
237
+  
238
+    }
239
+      })
240
+      .catch((err) => {
241
+        this.setData({ isSubmitting: false });
242
+     
243
+        console.error('请求失败:', err);
244
+      });
245
+    }else{
246
+      api.request(`/sysaddress/updateaddress`, 'post',formData,{ isPublic: false })
247
+      .then((data) => {
248
+    console.log(data.data);
249
+    if (data.code==200) {
250
+    wx.navigateTo({
251
+      url: '/package-order/pages/address/index',
252
+    })
253
+    this.setData({ isSubmitting: false });
254
+  
255
+    }
256
+      })
257
+      .catch((err) => {
258
+        this.setData({ isSubmitting: false });
259
+     
260
+        console.error('请求失败:', err);
261
+      });
262
+    }
263
+  
264
+  }
265
+});

+ 8
- 0
package-order/pages/newaddress/index.json 查看文件

@@ -0,0 +1,8 @@
1
+{
2
+  "navigationBarTitleText": "选择地址",
3
+  "navigationBarBackgroundColor": "#ffffff",
4
+  "navigationBarTextStyle": "black",
5
+  "usingComponents": {
6
+    "t-icon": "tdesign-miniprogram/icon/icon"
7
+  }
8
+}

+ 120
- 0
package-order/pages/newaddress/index.wxml 查看文件

@@ -0,0 +1,120 @@
1
+<view class="address-container">
2
+  <!-- 表单区域 -->
3
+  <form bindsubmit="formSubmit">
4
+    <!-- 收货人 -->
5
+    <view class="form-item">
6
+      <label class="form-label required">联系人</label>
7
+      <input 
8
+        class="form-input" 
9
+        name="receiver" 
10
+        placeholder="请输入收货人姓名" 
11
+        value="{{formData.receiver}}"
12
+        bindinput="handleInput"
13
+        data-key="receiver"
14
+      />
15
+    </view>
16
+    
17
+    <!-- 手机号码 -->
18
+    <view class="form-item">
19
+      <label class="form-label required">手机号码</label>
20
+      <input 
21
+        class="form-input" 
22
+        name="phone" 
23
+        placeholder="请输入手机号码" 
24
+        type="number"
25
+        value="{{formData.phone}}"
26
+        bindinput="handleInput"
27
+        data-key="phone"
28
+        maxlength="11"
29
+      />
30
+    </view>
31
+    
32
+    <!-- 省市区选择 -->
33
+    <!-- <view class="form-item">
34
+  <label class="form-label required">所在地区</label>
35
+  <picker 
36
+    mode="region" 
37
+    bindchange="handlePickerChange" 
38
+    value="{{regionValue}}"
39
+    custom-item="{{customItem}}"
40
+  >
41
+    <view class="area-picker">
42
+    
43
+      <text class="area-text">{{regionValue[0]}},{{regionValue[1]}},{{regionValue[2]}}</text>
44
+      <icon class="right-icon" type="right" size="16" color="#999" />
45
+    </view>
46
+  </picker>
47
+</view> -->
48
+
49
+    
50
+    <!-- 详细地址 -->
51
+   <!-- 详细地址(新增地图入口) -->
52
+<view class="form-item">
53
+  <label class="form-label required">详细地址</label>
54
+  <view class="detail-address-wrapper" bindtap="navigateToMapSelect">
55
+    <input 
56
+      class="form-input" 
57
+      name="addressDetails" 
58
+      placeholder="街道、门牌号等(可点击地图选择)" 
59
+      value="{{formData.addressDetails}}"
60
+      bindinput="handleInput"
61
+      data-key="addressDetails"
62
+      disabled="false"
63
+    />
64
+    <!-- <button 
65
+      class="map-btn" 
66
+      size="mini"
67
+    > -->
68
+      <!-- <image src="/images/map-icon.png" class="map-icon" /> -->
69
+      <t-icon name="location" size="40rpx" data-name="location"/>
70
+
71
+    <!-- </button> -->
72
+  </view>
73
+  <!-- 选中的POI名称提示 -->
74
+  <!-- <view class="poi-tip" wx:if="{{formData.poiName}}">
75
+    已选择:{{formData.poiName}}
76
+  </view> -->
77
+</view>
78
+    
79
+    <!-- 邮政编码 -->
80
+    <!-- <view class="form-item">
81
+      <label class="form-label">邮政编码</label>
82
+      <input 
83
+        class="form-input" 
84
+        name="zipCode" 
85
+        placeholder="选填" 
86
+        type="number"
87
+        value="{{formData.zipCode}}"
88
+        bindinput="handleInput1"
89
+        data-key="zipCode"
90
+        maxlength="100"
91
+      />
92
+    </view> -->
93
+    
94
+    <!-- 默认地址开关 -->
95
+    <view class="form-item switch-item">
96
+      <label class="form-label">默认地址</label>
97
+      <switch 
98
+        checked="{{formData.isDefault}}"
99
+        bindchange="handleSwitchChange"
100
+      />
101
+    </view>
102
+    
103
+    <!-- 提交按钮 -->
104
+    <button 
105
+    type="primary"
106
+      form-type="submit" 
107
+      class="submit-btn"
108
+      disabled="{{!formData.receiver || !formData.phone || !formData.province || !formData.city || !formData.district || !formData.addressDetails}}"
109
+    >
110
+      保存地址
111
+    </button>
112
+  </form>
113
+
114
+  <!-- 遮罩层 -->
115
+  <view 
116
+    wx:if="{{showAreaPicker}}"
117
+    class="mask"
118
+    bindtap="closeAreaPicker"
119
+  ></view>
120
+</view>

+ 194
- 0
package-order/pages/newaddress/index.wxss 查看文件

@@ -0,0 +1,194 @@
1
+/* 全局样式 */
2
+page {
3
+  background-color: #f5f5f5;
4
+}
5
+
6
+.address-container {
7
+  padding-bottom: 20rpx;
8
+}
9
+
10
+/* 表单项目 */
11
+.form-item {
12
+  display: flex;
13
+  align-items: center;
14
+  background-color: #fff;
15
+  padding: 0 30rpx;
16
+  height: 100rpx;
17
+  border-bottom: 1rpx solid #f1f1f1;
18
+}
19
+
20
+.form-label {
21
+  font-size: 28rpx;
22
+  color: #333;
23
+  width: 160rpx;
24
+}
25
+
26
+.required::after {
27
+  content: '*';
28
+  color: #ff4d4f;
29
+  margin-left: 4rpx;
30
+}
31
+
32
+.form-input {
33
+  flex: 1;
34
+  height: 100%;
35
+  font-size: 28rpx;
36
+  color: #333;
37
+  padding: 0 10rpx;
38
+}
39
+
40
+.form-input::placeholder {
41
+  color: #999;
42
+  font-size: 26rpx;
43
+}
44
+
45
+/* 地区选择器 */
46
+.area-picker {
47
+  flex: 1;
48
+  display: flex;
49
+  align-items: center;
50
+  justify-content: space-between;
51
+}
52
+
53
+.area-text {
54
+  font-size: 28rpx;
55
+  color: #333;
56
+  margin-right: 10rpx;
57
+}
58
+
59
+.right-icon {
60
+  margin-left: auto;
61
+}
62
+
63
+/* 开关项 */
64
+.switch-item {
65
+  justify-content: space-between;
66
+}
67
+
68
+/* 提交按钮 */
69
+.submit-btn {
70
+  margin: 40rpx 30rpx;
71
+  height: 90rpx;
72
+  line-height: 90rpx;
73
+  background-color: #2C85FF;
74
+  color: #fff;
75
+  font-size: 32rpx;
76
+  border-radius: 45rpx;
77
+  margin-top: 100rpx;
78
+}
79
+
80
+.submit-btn::after {
81
+  border: none;
82
+  /* background-color: #cccccc; */
83
+
84
+}
85
+
86
+.submit-btn:disabled {
87
+  color: #ffffff;
88
+
89
+}
90
+
91
+/* 省市区选择器 */
92
+.area-picker-view {
93
+  position: fixed;
94
+  bottom: 0;
95
+  left: 0;
96
+  right: 0;
97
+  height: 400rpx;
98
+  background-color: #fff;
99
+  z-index: 100;
100
+}
101
+
102
+.picker-item {
103
+  display: flex;
104
+  align-items: center;
105
+  justify-content: center;
106
+  font-size: 28rpx;
107
+  color: #333;
108
+}
109
+
110
+/* 遮罩层 */
111
+.mask {
112
+  position: fixed;
113
+  top: 0;
114
+  left: 0;
115
+  right: 0;
116
+  bottom: 0;
117
+  background-color: rgba(0, 0, 0, 0.5);
118
+  z-index: 99;
119
+}
120
+/* 详细地址容器 */
121
+.detail-address-wrapper {
122
+  flex: 1;
123
+  display: flex;
124
+  align-items: center;
125
+}
126
+
127
+/* 地图按钮 */
128
+.map-btn {
129
+  width: 50rpx;
130
+  height: 50rpx;
131
+  padding: 0;
132
+  margin-left: 10rpx;
133
+  background: transparent;
134
+}
135
+
136
+.map-icon {
137
+  width: 30rpx;
138
+  height: 30rpx;
139
+}
140
+
141
+/* POI提示文字 */
142
+.poi-tip {
143
+  position: absolute;
144
+  left: 190rpx;
145
+  top: 70rpx;
146
+  font-size: 22rpx;
147
+  color: #666;
148
+}
149
+/* 优化选择器容器样式,与原生组件适配 */
150
+.area-picker {
151
+  flex: 1;
152
+  display: flex;
153
+  align-items: center;
154
+  justify-content: space-between;
155
+  padding-right: 10rpx;
156
+}
157
+
158
+.area-text {
159
+  font-size: 28rpx;
160
+  color: #333;
161
+  /* 处理文字溢出 */
162
+  overflow: hidden;
163
+  text-overflow: ellipsis;
164
+  white-space: nowrap;
165
+}
166
+
167
+/* 空状态文字颜色区分 */
168
+.area-text:empty::before {
169
+  content: '请选择省/市/区';
170
+  color: #999;
171
+}
172
+
173
+.right-icon {
174
+  margin-left: 10rpx;
175
+}
176
+/* 保持原有样式不变 */
177
+.form-item {
178
+  display: flex;
179
+  align-items: center;
180
+  background-color: #fff;
181
+  padding: 0 30rpx;
182
+  height: 100rpx;
183
+  border-bottom: 1rpx solid #f1f1f1;
184
+}
185
+
186
+.area-picker {
187
+  flex: 1;
188
+  display: flex;
189
+  align-items: center;
190
+  justify-content: space-between;
191
+  padding-right: 10rpx;
192
+}
193
+
194
+/* 其他样式保持不变 */

+ 0
- 0
package-order/utils/areaData.json 查看文件


+ 317
- 0
package-order/utils/parseFullAddress.js 查看文件

@@ -0,0 +1,317 @@
1
+// utils/parseFullAddress.js
2
+// 完整的独立地址解析函数(支持返回完整格式:含代码、经纬度、POI等)
3
+
4
+// ===================== 基础配置 - 可根据实际需求扩展 =====================
5
+// 1. 省市区名称+代码映射表(简化版,如需完整数据可从areaData导入)
6
+const AREA_CODE_MAP = {
7
+  // 省份映射(名称 -> { code, 下属城市 })
8
+  province: {
9
+    "北京市": { code: "110000", cities: ["北京市"] },
10
+    "天津市": { code: "120000", cities: ["天津市"] },
11
+    "河北省": { code: "130000", cities: ["石家庄市", "唐山市", "秦皇岛市"] },
12
+    "山西省": { code: "140000", cities: ["太原市", "大同市"] },
13
+    "内蒙古自治区": { code: "150000", cities: ["呼和浩特市", "包头市"] },
14
+    "辽宁省": { code: "210000", cities: ["沈阳市", "大连市"] },
15
+    "吉林省": { code: "220000", cities: ["长春市", "吉林市"] },
16
+    "黑龙江省": { code: "230000", cities: ["哈尔滨市", "齐齐哈尔市"] },
17
+    "上海市": { code: "310000", cities: ["上海市"] },
18
+    "江苏省": { code: "320000", cities: ["南京市", "无锡市", "苏州市"] },
19
+    "浙江省": { code: "330000", cities: ["杭州市", "宁波市", "温州市"] },
20
+    "安徽省": { code: "340000", cities: ["合肥市", "芜湖市"] },
21
+    "福建省": { code: "350000", cities: ["福州市", "厦门市"] },
22
+    "江西省": { code: "360000", cities: ["南昌市", "九江市"] },
23
+    "山东省": { code: "370000", cities: ["济南市", "青岛市"] },
24
+    "河南省": { code: "410000", cities: ["郑州市", "洛阳市"] },
25
+    "湖北省": { code: "420000", cities: ["武汉市", "宜昌市"] },
26
+    "湖南省": { code: "430000", cities: ["长沙市", "株洲市"] },
27
+    "广东省": { code: "440000", cities: ["广州市", "深圳市", "佛山市"] },
28
+    "广西壮族自治区": { code: "450000", cities: ["南宁市", "柳州市"] },
29
+    "海南省": { code: "460000", cities: ["海口市", "三亚市"] },
30
+    "重庆市": { code: "500000", cities: ["重庆市"] },
31
+    "四川省": { code: "510000", cities: ["成都市", "绵阳市"] },
32
+    "贵州省": { code: "520000", cities: ["贵阳市", "遵义市"] },
33
+    "云南省": { code: "530000", cities: ["昆明市", "大理市"] },
34
+    "西藏自治区": { code: "540000", cities: ["拉萨市"] },
35
+    "陕西省": { code: "610000", cities: ["西安市", "宝鸡市"] },
36
+    "甘肃省": { code: "620000", cities: ["兰州市", "天水市"] },
37
+    "青海省": { code: "630000", cities: ["西宁市"] },
38
+    "宁夏回族自治区": { code: "640000", cities: ["银川市"] },
39
+    "新疆维吾尔自治区": { code: "650000", cities: ["乌鲁木齐市"] },
40
+    "台湾省": { code: "710000", cities: ["台北市", "高雄市"] },
41
+    "香港特别行政区": { code: "810000", cities: ["香港特别行政区"] },
42
+    "澳门特别行政区": { code: "820000", cities: ["澳门特别行政区"] }
43
+  },
44
+  // 城市映射(名称 -> { code, 下属区县 })
45
+  city: {
46
+    "北京市": { code: "110100", districts: ["东城区", "西城区", "朝阳区", "海淀区", "顺义区"] },
47
+    "天津市": { code: "120100", districts: ["和平区", "河东区", "西青区", "北辰区"] },
48
+    "深圳市": { code: "440300", districts: ["罗湖区", "福田区", "南山区", "宝安区", "龙岗区"] },
49
+    "广州市": { code: "440100", districts: ["越秀区", "海珠区", "天河区"] },
50
+    "上海市": { code: "310100", districts: ["黄浦区", "徐汇区", "长宁区"] },
51
+    "杭州市": { code: "330100", districts: ["上城区", "拱墅区", "西湖区"] }
52
+  },
53
+  // 区县映射(名称 -> { code, 经纬度 })
54
+  district: {
55
+    "东城区": { code: "110101", lat: 39.938874, lng: 116.407413 },
56
+    "西城区": { code: "110102", lat: 39.914745, lng: 116.366761 },
57
+    "朝阳区": { code: "110105", lat: 39.948859, lng: 116.487501 },
58
+    "海淀区": { code: "110108", lat: 39.992947, lng: 116.316486 },
59
+    "顺义区": { code: "110113", lat: 40.111562, lng: 116.658249 }, // 修正你示例中的错误代码(120101是天津和平区)
60
+    "南山区": { code: "440305", lat: 22.542895, lng: 113.941649 },
61
+    "福田区": { code: "440304", lat: 22.543096, lng: 114.057865 },
62
+    "罗湖区": { code: "440303", lat: 22.552726, lng: 114.104663 }
63
+  }
64
+};
65
+
66
+// 2. 标准省市区名称集合(从映射表中提取,用于匹配)
67
+const PROVINCES = Object.keys(AREA_CODE_MAP.province);
68
+const CITIES = Object.keys(AREA_CODE_MAP.city);
69
+const DISTRICTS = Object.keys(AREA_CODE_MAP.district);
70
+
71
+// 3. POI关键词(用于提取建筑物名称)
72
+const POI_KEYWORDS = ["大厦", "小区", "花园", "公寓", "写字楼", "酒店", "广场", "中心", "别墅", "商铺"];
73
+
74
+// ===================== 工具函数 =====================
75
+/**
76
+ * 提取手机号(纯函数)
77
+ * @param {string} text - 输入文本
78
+ * @returns {string} 提取的手机号
79
+ */
80
+function extractPhone(text) {
81
+  if (!text) return '';
82
+  const phoneReg = /1[3-9]\d{9}|1[3-9]\d{2}[- ]?\d{4}[- ]?\d{4}/g;
83
+  const match = text.match(phoneReg);
84
+  return match ? match[0].replace(/\D/g, '') : '';
85
+}
86
+
87
+/**
88
+ * 提取姓名(纯函数)
89
+ * @param {string} text - 输入文本
90
+ * @returns {string} 提取的姓名
91
+ */
92
+function extractName(text) {
93
+  if (!text) return '';
94
+  const nameReg = /[\u4e00-\u9fa5]{2,4}/;
95
+  const match = text.match(nameReg);
96
+  return match ? match[0] : '';
97
+}
98
+
99
+/**
100
+ * 提取POI名称(从详细地址中提取建筑物名称)
101
+ * @param {string} detail - 详细地址
102
+ * @returns {string} POI名称
103
+ */
104
+function extractPOIName(detail) {
105
+  if (!detail) return '';
106
+  // 匹配包含POI关键词的连续字符(2-10字)
107
+  const poiReg = new RegExp(`[\\u4e00-\\u9fa5a-zA-Z0-9]{2,10}(${POI_KEYWORDS.join('|')})`, 'g');
108
+  const matches = detail.match(poiReg);
109
+  return matches && matches.length > 0 ? matches[0] : '';
110
+}
111
+
112
+/**
113
+ * 获取行政区划代码
114
+ * @param {string} province - 省份名称
115
+ * @param {string} city - 城市名称
116
+ * @param {string} district - 区县名称
117
+ * @returns {object} { provinceCode, cityCode, districtCode }
118
+ */
119
+function getAreaCodes(province, city, district) {
120
+  return {
121
+    provinceCode: AREA_CODE_MAP.province[province]?.code || '',
122
+    cityCode: AREA_CODE_MAP.city[city]?.code || '',
123
+    districtCode: AREA_CODE_MAP.district[district]?.code || ''
124
+  };
125
+}
126
+
127
+/**
128
+ * 获取经纬度(优先区县,无则城市,无则省份)
129
+ * @param {string} province - 省份名称
130
+ * @param {string} city - 城市名称
131
+ * @param {string} district - 区县名称
132
+ * @returns {object} { latitude, longitude }
133
+ */
134
+function getLatLng(province, city, district) {
135
+  // 区县经纬度
136
+  if (district && AREA_CODE_MAP.district[district]) {
137
+    return {
138
+      latitude: AREA_CODE_MAP.district[district].lat,
139
+      longitude: AREA_CODE_MAP.district[district].lng
140
+    };
141
+  }
142
+  // 城市默认经纬度(可扩展城市经纬度映射)
143
+  const cityLatLngMap = {
144
+    "北京市": { lat: 39.9042, lng: 116.4074 },
145
+    "上海市": { lat: 31.2304, lng: 121.4737 },
146
+    "深圳市": { lat: 22.5431, lng: 114.0579 },
147
+    "广州市": { lat: 23.1289, lng: 113.2655 }
148
+  };
149
+  if (city && cityLatLngMap[city]) {
150
+    return {
151
+      latitude: cityLatLngMap[city].lat,
152
+      longitude: cityLatLngMap[city].lng
153
+    };
154
+  }
155
+  // 省份默认经纬度
156
+  const provinceLatLngMap = {
157
+    "广东省": { lat: 23.1289, lng: 113.2655 },
158
+    "江苏省": { lat: 32.0473, lng: 118.7624 },
159
+    "浙江省": { lat: 30.2795, lng: 120.1576 }
160
+  };
161
+  if (province && provinceLatLngMap[province]) {
162
+    return {
163
+      latitude: provinceLatLngMap[province].lat,
164
+      longitude: provinceLatLngMap[province].lng
165
+    };
166
+  }
167
+  // 默认经纬度(北京)
168
+  return { latitude: 39.9042, longitude: 116.4074 };
169
+}
170
+
171
+/**
172
+ * 识别省市区(纯函数,基于映射表优化匹配准确性)
173
+ * @param {string} text - 输入文本
174
+ * @returns {object} { province, city, district, remainingText }
175
+ */
176
+function recognizeArea(text) {
177
+  if (!text) return { province: '', city: '', district: '', remainingText: '' };
178
+
179
+  let province = '';
180
+  let city = '';
181
+  let district = '';
182
+  let remainingText = text.trim();
183
+
184
+  // 1. 匹配省份(优先长名称,避免短名称误匹配)
185
+  const sortedProvinces = [...PROVINCES].sort((a, b) => b.length - a.length);
186
+  for (const p of sortedProvinces) {
187
+    if (remainingText.includes(p)) {
188
+      province = p;
189
+      remainingText = remainingText.replace(p, '').trim();
190
+      break;
191
+    }
192
+  }
193
+
194
+  // 2. 匹配城市(基于已选省份过滤,提升准确性)
195
+  let candidateCities = [...CITIES].sort((a, b) => b.length - a.length);
196
+  if (province && AREA_CODE_MAP.province[province].cities) {
197
+    candidateCities = candidateCities.filter(c => AREA_CODE_MAP.province[province].cities.includes(c));
198
+  }
199
+  for (const c of candidateCities) {
200
+    if (remainingText.includes(c)) {
201
+      city = c;
202
+      remainingText = remainingText.replace(c, '').trim();
203
+      break;
204
+    }
205
+  }
206
+
207
+  // 3. 匹配区县(基于已选城市过滤)
208
+  let candidateDistricts = [...DISTRICTS].sort((a, b) => b.length - a.length);
209
+  if (city && AREA_CODE_MAP.city[city].districts) {
210
+    candidateDistricts = candidateDistricts.filter(d => AREA_CODE_MAP.city[city].districts.includes(d));
211
+  }
212
+  for (const d of candidateDistricts) {
213
+    if (remainingText.includes(d)) {
214
+      district = d;
215
+      remainingText = remainingText.replace(d, '').trim();
216
+      break;
217
+    }
218
+  }
219
+
220
+  return { province, city, district, remainingText };
221
+}
222
+
223
+/**
224
+ * 完整地址解析(返回完整格式:含代码、经纬度、POI等)
225
+ * @param {string} text - 输入文本
226
+ * @param {object} [options] - 可选配置
227
+ * @param {boolean} [options.isDefault=false] - 是否默认地址
228
+ * @returns {object} 完整解析结果
229
+ */
230
+const parseFullAddress = (text, options = {}) => {
231
+  const { isDefault = false } = options;
232
+  if (!text) return {
233
+    receiver: '',
234
+    phone: '',
235
+    province: '',
236
+    provinceCode: '',
237
+    city: '',
238
+    cityCode: '',
239
+    district: '',
240
+    districtCode: '',
241
+    detail: '',
242
+    poiName: '',
243
+    latitude: 0,
244
+    longitude: 0,
245
+    isDefault
246
+  };
247
+
248
+  let remainingText = text.trim();
249
+
250
+  // 1. 提取手机号
251
+  const phone = extractPhone(remainingText);
252
+  if (phone) {
253
+    const phoneReg = new RegExp(
254
+      phone.replace(/(\d)/g, '\\d') + '|' + 
255
+      phone.replace(/(\d{3})(\d{4})(\d{4})/, '$1[- ]?$2[- ]?$3'), 
256
+      'g'
257
+    );
258
+    remainingText = remainingText.replace(phoneReg, '').replace(/\s+/g, ' ').trim();
259
+  }
260
+
261
+  // 2. 识别省市区
262
+  const { province, city, district, remainingText: textAfterArea } = recognizeArea(remainingText);
263
+  remainingText = textAfterArea;
264
+
265
+  // 3. 提取姓名
266
+  let receiver = extractName(remainingText);
267
+  if (receiver) {
268
+    remainingText = remainingText.replace(receiver, '').trim();
269
+  } else {
270
+    const reverseText = remainingText.split('').reverse().join('');
271
+    const reverseName = extractName(reverseText);
272
+    if (reverseName) {
273
+      receiver = reverseName.split('').reverse().join('');
274
+      remainingText = remainingText.replace(new RegExp(receiver + '$'), '').trim();
275
+    }
276
+  }
277
+
278
+  // 4. 处理详细地址(过滤重复省市区)
279
+  let detail = remainingText;
280
+  const areaPrefix = [
281
+    `${province}${city}${district}`,
282
+    `${province}${city}`,
283
+    `${city}${district}`
284
+  ];
285
+  for (const prefix of areaPrefix) {
286
+    if (detail.includes(prefix)) {
287
+      detail = detail.replace(prefix, '').trim();
288
+      break;
289
+    }
290
+  }
291
+
292
+  // 5. 补充扩展字段
293
+  const { provinceCode, cityCode, districtCode } = getAreaCodes(province, city, district);
294
+  const { latitude, longitude } = getLatLng(province, city, district);
295
+  const poiName = extractPOIName(detail);
296
+
297
+  return {
298
+    receiver,          // 收件人姓名
299
+    phone,             // 手机号
300
+    province,          // 省份名称
301
+    provinceCode,      // 省份代码(如:440000)
302
+    city,              // 城市名称
303
+    cityCode,          // 城市代码(如:440300)
304
+    district,          // 区县名称
305
+    districtCode,      // 区县代码(如:440305)
306
+    detail,            // 详细地址
307
+    poiName,           // POI名称(建筑物/小区名称)
308
+    latitude,          // 纬度
309
+    longitude,         // 经度
310
+    isDefault          // 是否默认地址(默认false)
311
+  };
312
+};
313
+
314
+// 导出函数
315
+module.exports = { parseFullAddress };
316
+
317
+

+ 9
- 1
package-user/components/captcha/index.js 查看文件

@@ -106,7 +106,13 @@ Component({
106 106
     
107 107
     // 关闭弹窗
108 108
     onClose() {
109
-      this.triggerEvent('close');
109
+         // 1. 强制让输入框失焦,关闭手机键盘
110
+         this.setData({ isFocus: false });
111
+         // 2. 触发关闭事件(可加微延时确保失焦生效,可选)
112
+         setTimeout(() => {
113
+           this.triggerEvent('close');
114
+         }, 100);
115
+      // this.triggerEvent('close');
110 116
     },
111 117
     
112 118
     // 确认
@@ -154,6 +160,8 @@ Component({
154 160
     
155 161
     // 清除倒计时
156 162
     clearCountdown() {
163
+      this.setData({ isFocus: false });
164
+
157 165
       if (this.data.timer) {
158 166
         clearInterval(this.data.timer);
159 167
         this.setData({ timer: null });

+ 1
- 0
package-user/components/slide-confirm/index.wxss 查看文件

@@ -50,6 +50,7 @@
50 50
   position: absolute;
51 51
   top: 0;
52 52
   background-color: #fff;
53
+  margin-top: 3rpx;
53 54
   border-radius: 40px;
54 55
   display: flex;
55 56
   align-items: center;

+ 9
- 39
package-user/pages/login/index.js 查看文件

@@ -48,12 +48,12 @@ Loginswitch:true
48 48
   checkboxChange(e) {
49 49
     let _this = this
50 50
     console.log('checkbox发生change事件,携带value值为:', e.currentTarget.dataset.value)
51
-  
51
+ 
52 52
    wx.requestSubscribeMessage({
53
-    tmplIds: ['G_37RkJ_mwZeTdPv5A0fjBlYW6_lRQIW9_SywmUAX7Q','AhToqLaCeOvSvSSQ7RvZYd2WgGA11Da13j1PMvqcGqQ'],
53
+    tmplIds: ['t46217wOQ7HBvw0MfP78Zo8FuwYTKBESaGYIpaXccFw','lLN0xmyLgBSnvveLAOhHiEHvHUi286idSuv-kO61TMI'],
54 54
     success(res) {
55 55
       console.log(res);
56
-    if(res['G_37RkJ_mwZeTdPv5A0fjBlYW6_lRQIW9_SywmUAX7Q'] === 'accept') {
56
+    if(res['t46217wOQ7HBvw0MfP78Zo8FuwYTKBESaGYIpaXccFw'] === 'accept') {
57 57
     // 用户同意订阅
58 58
     console.log(2222222);
59 59
     console.log(!e.currentTarget.dataset.value);
@@ -91,20 +91,6 @@ Loginswitch:true
91 91
       }
92 92
   });
93 93
   },
94
-  authorizationbtn(){
95
-       
96
-    wx.requestSubscribeMessage({
97
-      tmplIds: ['G_37RkJ_mwZeTdPv5A0fjBlYW6_lRQIW9_SywmUAX7Q','AhToqLaCeOvSvSSQ7RvZYd2WgGA11Da13j1PMvqcGqQ'],
98
-      success(res) {
99
-        console.log(res);
100
-      if(res['G_37RkJ_mwZeTdPv5A0fjBlYW6_lRQIW9_SywmUAX7Q','AhToqLaCeOvSvSSQ7RvZYd2WgGA11Da13j1PMvqcGqQ'] === 'accept') {
101
-      // 用户同意订阅
102
-      }
103
-      }
104
-      })
105
-    
106
-  },
107
-
108 94
     bindKeyInput1: function (e) {
109 95
       this.setData({
110 96
         account: e.detail.value
@@ -133,14 +119,7 @@ onGetPhoneNumber(e) {
133 119
   
134 120
     });
135 121
   }
136
-  // wx.requestSubscribeMessage({
137
-  //   tmplIds: ['G_37RkJ_mwZeTdPv5A0fjBlYW6_lRQIW9_SywmUAX7Q','AhToqLaCeOvSvSSQ7RvZYd2WgGA11Da13j1PMvqcGqQ'],
138
-  //   success(res) {
139
-  //     console.log(res);
140
-  //   if(res['G_37RkJ_mwZeTdPv5A0fjBlYW6_lRQIW9_SywmUAX7Q'] === 'accept') {
141
-  //   // 用户同意订阅
142
-  //   console.log(2222222);
143
-
122
+ 
144 123
     wx.login({
145 124
       success: ress => {
146 125
         console.log(ress);
@@ -149,7 +128,8 @@ onGetPhoneNumber(e) {
149 128
       // 这里的 your_server_url 需要替换成你自己的服务器地址
150 129
       
151 130
       let obj = {
152
-        phonecode:e.detail.code,
131
+        // phonecode:e.detail.code,
132
+        phonecode:this.data.account,
153 133
         code:code
154 134
       }
155 135
       api.request(`/sysoperation/login`, 'post',obj,{ isPublic: true })
@@ -157,7 +137,7 @@ onGetPhoneNumber(e) {
157 137
    console.log(data);
158 138
    if (data.code == 200) {
159 139
 
160
-           // 设置数据到本地存储
140
+                // 设置数据到本地存储
161 141
 wx.setStorage({
162 142
   key: 'token',  // 存储的key值
163 143
   data:data.data.token,
@@ -174,6 +154,8 @@ wx.setStorage({
174 154
 
175 155
   }
176 156
 });
157
+ 
158
+
177 159
    }else{
178 160
     wx.showToast({
179 161
       title: data.msg,
@@ -191,19 +173,7 @@ wx.setStorage({
191 173
       });
192 174
       }
193 175
       })
194
-    // }else{
195
-    //   wx.showToast({
196
-    //     title: '您将收不到新工单通知',
197
-    //     icon: 'success',
198
-    //   });
199
-    // }
200
-    // },fail: (err) => {
201
-    //   // console.error('请求失败:', err);
202
-    //   console.log(err);
203
-    //   wx.showToast({ title: '请开启订阅消息通知', icon: 'none' });
204
-    // }
205 176
     
206
-    // })
207 177
 
208 178
 
209 179
 

+ 11
- 2
package-user/pages/login/index.wxml 查看文件

@@ -3,15 +3,24 @@
3 3
   <view class="navigation-container" style="{{'height: ' + navStatusBarHeight +'px'}}">
4 4
   <view style="{{'height: ' + statusBarHeight +'px'}}"></view>
5 5
   <view class="navigation-bar" style="{{'height:' + navBarHeight +'px'}}">
6
-    <view class="title">晟运能源</view>
6
+    <view class="title">电速宝</view>
7 7
   </view>
8 8
 </view>
9 9
 <!-- <view style="width: 100%; {{'height: ' + navStatusBarHeight +'px'}}"></view> -->
10 10
 
11 11
  <view><image class="log_image" src="https://esos-iot.bjdexn.cn/myminio/project/fd2b0ab2aadb44bbafd940156bf0cdd7.png" mode="widthFix"/></view>
12
+ <view class="account_number">
13
+ <view>
14
+  <view class="account">手机号</view>
15
+  <view class="password">
16
+  <image class="login_imgae1" src="https://esos-iot.bjdexn.cn/myminio/project/0458af22ef764cc386d77a76ee665917.png" mode=""/>
17
+  <input class="weui-input"	value="{{account}}" placeholder="请输入手机号"  bindinput="bindKeyInput1"/></view>
18
+ </view>
19
+
20
+ </view>
12 21
  <view class="loginbotton">
13 22
   <!-- <button wx:if="{{!Loginswitch}}" class="button_button" open-type="getPhoneNumber" bindgetphonenumber="onGetPhoneNumber">手机号一键登录</button> -->
14
-
23
+ 
15 24
  <!-- <button wx:if="{{!Loginswitch}}" bindphoneoneclicklogin="onHandleLogin" open-type="phoneOneClickLogin">一键登录按钮</button> -->
16 25
  <button wx:if="{{checked}}" class="button_button" color="#00BA6E" open-type="getPhoneNumber" bindgetphonenumber="onGetPhoneNumber">手机号一键登录</button>
17 26
  <button wx:if="{{!checked}}" class="button_button" color="#00BA6E" bind:tap="promptcheck">手机号一键登录</button>

+ 26
- 1
package-user/pages/login/index.wxss 查看文件

@@ -142,7 +142,9 @@ background-color: #00C775;
142 142
   color:#00C775;
143 143
   margin:0rpx 6rpx;
144 144
 }
145
- 
145
+ .t-radio{
146
+  background: rgba(255, 255, 255, 0) !important;
147
+ }
146 148
 .t-radio__icon-dot::after{
147 149
   background: var(--td-radio-icon-checked-color, var(--td-brand-color, var(--td-primary-color-7, #00C775))) !important;
148 150
 }
@@ -203,3 +205,26 @@ background-color: #00C775;
203 205
 .shake {
204 206
   animation: shake 0.5s;
205 207
 }
208
+.account_number{
209
+  width: 100%;
210
+  padding: 20rpx;
211
+  box-sizing: border-box;
212
+}
213
+.number{
214
+  margin-top: 40rpx;
215
+}
216
+.account{
217
+font-size: 32rpx;
218
+}
219
+.weui-input{
220
+  flex: 1;
221
+  height: 100rpx;
222
+}
223
+.password{
224
+  display: flex;
225
+  align-items: center;
226
+font-size: 28rpx;
227
+margin-top: 10rpx;
228
+padding-bottom: 0rpx;
229
+border-bottom:1rpx #cccccc solid;
230
+}

+ 99
- 12
package-user/pages/userlist/index.js 查看文件

@@ -7,7 +7,13 @@ Page({
7 7
    * 页面的初始数据
8 8
    */
9 9
   data: {
10
-  userdata:[]
10
+  userdata:[],
11
+  visible:false,
12
+  selectdriveralldata:[],
13
+  selectcaralldata:[],
14
+  workorderId:'',
15
+  driverindex:0,
16
+  carindex:0
11 17
   },
12 18
 
13 19
   /**
@@ -15,15 +21,14 @@ Page({
15 21
    */
16 22
   onLoad(options) {
17 23
  this.getuser()
24
+ this.onselectdriverall()
25
+ this.onselectcarall()
18 26
   },  
19 27
 getuser(){
20 28
   let data ={
21
-    operationId:'',
22
-    operationname:'',
23
-    operationphone:'',
24
-    addressId:''
29
+    workorderType:0
25 30
   }
26
-  api.request(`/syscustomer/selectcustomer`, 'post',data,{ isPublic: false })
31
+  api.request(`/sysworkorder/selectworkorderlist`, 'post',data,{ isPublic: false })
27 32
   .then((data) => {
28 33
 console.log(data.data);
29 34
 if (data.code==200) {
@@ -31,17 +36,99 @@ if (data.code==200) {
31 36
     userdata:data.data
32 37
   })
33 38
 }
34
-//  wx.navigateTo({
35
-//   url: '/pages/map/index',
36
-// })
37 39
   })
38 40
   .catch((err) => {
39
- 
41
+    console.error('请求失败:', err);
42
+  });
43
+},
44
+cancelOrder(e){
45
+  console.log(e.currentTarget.dataset.id);
46
+ this.setData({
47
+  workorderId:e.currentTarget.dataset.id,
48
+  visible:true
49
+ })
50
+},
51
+// 查询全部司机
52
+onselectdriverall(){
53
+  let data = {
54
+    operationId:'',
55
+    driverType:'',
56
+    driverName:''
57
+  }
58
+  api.request(`/sysdriver/selectdriverall`, 'post',data,{ isPublic: false })
59
+  .then((data) => {
60
+console.log(data.data);
61
+if (data.code==200) {
62
+  this.setData({
63
+    selectdriveralldata:data.data
64
+  })
65
+}
66
+  })
67
+  .catch((err) => {
68
+    console.error('请求失败:', err);
69
+  });
70
+},
71
+// 查询全部车辆
72
+onselectcarall(){
73
+  let data = {
74
+    
75
+  }
76
+  api.request(`/syscar/selectcarall`, 'post',data,{ isPublic: false })
77
+  .then((data) => {
78
+if (data.code==200) {
79
+  this.setData({
80
+    selectcaralldata:data.data
81
+  })
82
+}
83
+  })
84
+  .catch((err) => {
85
+    console.error('请求失败:', err);
86
+  });
87
+},
88
+ondriverChange(){
89
+ this.setData({
90
+  visible:false
91
+ })
92
+},
93
+onVisibleChange1() {
94
+  this.setData({
95
+    visible:false
96
+  })
97
+},
98
+onVisibleChange(e) {
99
+  this.setData({
100
+    driverindex: e.detail.value,
101
+  });
102
+},
103
+oncarChange(e) {
104
+  console.log(e);
105
+  this.setData({
106
+    carindex: e.detail.value,
107
+  });
108
+},
109
+submit(){
110
+  let data = {
111
+    driverId:this.data.selectdriveralldata[this.data.driverindex].operationId,
112
+    carId:this.data.selectcaralldata[this.data.carindex].carId,
113
+    workorderId:this.data.workorderId
114
+  }
115
+  api.request(`/sysoperationsstaff/allocatedriver`, 'post',data,{ isPublic: false })
116
+  .then((data) => {
117
+if (data.code==200) {
118
+ console.log(data);
119
+ this.setData({
120
+  visible:false
121
+ })
122
+ this.getuser()
123
+
124
+}
125
+  })
126
+  .catch((err) => {
40 127
     console.error('请求失败:', err);
41 128
   });
42 129
 },
43 130
   /**
44
-   * 生命周期函数--监听页面初次渲染完成
131
+   *
45 132
    */
46 133
   onReady() {
47 134
 
@@ -59,7 +146,7 @@ if (data.code==200) {
59 146
    */
60 147
   onHide() {
61 148
 
62
-  },
149
+  }, 
63 150
 
64 151
   /**
65 152
    * 生命周期函数--监听页面卸载

+ 3
- 1
package-user/pages/userlist/index.json 查看文件

@@ -1,4 +1,6 @@
1 1
 {
2 2
   "navigationBarTitleText": "用户列表",
3
-  "usingComponents": {}
3
+  "usingComponents": {
4
+    "t-popup": "tdesign-miniprogram/popup/popup"
5
+  }
4 6
 }

+ 32
- 5
package-user/pages/userlist/index.wxml 查看文件

@@ -3,10 +3,37 @@
3 3
   <view class="driver-info" wx:for="{{userdata}}" wx:key="operationId">
4 4
       <image src="https://esos-iot.bjdexn.cn/myminio/project/2a1b32553c3d4ef992bc797d26cf1614.png" class="driver-avatar"></image>
5 5
       <view class="driver-details">
6
-        <view class="driver-name">公司: 晟运能源有限公司</view>
7
-        <view class="driver-car">昵称: {{item.operationName}}</view>
8
-        <view class="driver-arrive">电话:{{item.operationPhone}}</view>
6
+        <view class="driver-name">目的地: {{item.poiName}}</view>
7
+        <view class="driver-arrive">电话:{{item.phone}}</view>
8
+        <view class="driver-car">预约时间: {{item.workorderStarttime}}</view>
9 9
       </view>
10
-      <!-- <button class="cancel-btn" bindtap="cancelOrder">去查看</button> -->
10
+      <button class="cancel-btn" data-id="{{item.workorderId}}" bindtap="cancelOrder">分配订单</button>
11 11
     </view>
12
-</view>
12
+</view>
13
+<t-popup
14
+  visible="{{visible}}"
15
+  bind:visible-change="onVisibleChange1"
16
+  placement="bottom"
17
+>
18
+<view class="driverpopup">
19
+
20
+<view class="driverpopup_box">
21
+  <picker bindchange="onVisibleChange" value="{{driverindex}}" range="{{selectdriveralldata}}" range-key="operationName">
22
+    <view class="picker">
23
+      分配司机:{{selectdriveralldata[driverindex].operationName}}
24
+    </view>
25
+  </picker>
26
+</view>
27
+<view class="driverpopup_box">
28
+  <picker bindchange="oncarChange" value="{{carindex}}" range="{{selectcaralldata}}" range-key="carName">
29
+    <view class="picker">
30
+      分配车辆:{{selectcaralldata[carindex].carName}}
31
+    </view>
32
+  </picker>
33
+</view>
34
+<view class="botton">
35
+<view class="botton_box" bind:tap="submit">确定</view>
36
+
37
+</view>
38
+</view>
39
+</t-popup>

+ 36
- 1
package-user/pages/userlist/index.wxss 查看文件

@@ -48,7 +48,7 @@ page{
48 48
 }
49 49
 
50 50
 .cancel-btn {
51
-  width: 160rpx;
51
+  width: 180rpx;
52 52
   height: 64rpx;
53 53
   line-height: 64rpx;
54 54
   font-size: 28rpx;
@@ -56,4 +56,39 @@ page{
56 56
   border: 1rpx solid #FF5252;
57 57
   background-color: white;
58 58
   border-radius: 32rpx;
59
+}
60
+.driverpopup{
61
+  width: 100%;
62
+  height: 600rpx;
63
+  padding: 20rpx;
64
+  padding-top:100rpx;
65
+  box-sizing: border-box;
66
+}
67
+.driverpopup_box{
68
+  width: 100%;
69
+  height: 100rpx;
70
+  align-items: center;
71
+}
72
+.picker{
73
+  width: 100%;
74
+  height: 100rpx;
75
+  align-items: center;
76
+}
77
+.botton{
78
+width: 100%;
79
+display: flex;
80
+align-items: center;
81
+justify-content: center;
82
+}
83
+.botton_box{
84
+  width: 400rpx;
85
+  height: 70rpx;
86
+  margin-top: 100rpx;
87
+  font-size: 28rpx;
88
+  border-radius: 10rpx;
89
+  display: flex;
90
+  align-items: center;
91
+  justify-content: center;
92
+  color: #ffffff;
93
+  background-color: #2C85FF;
59 94
 }

+ 83
- 153
pages/index/index.js 查看文件

@@ -1,5 +1,5 @@
1 1
 const api = require('../../api/index.js');
2
-
2
+const app = getApp();
3 3
 Page({
4 4
   data: {
5 5
     // 地图初始中心坐标(北京市中心)
@@ -21,14 +21,76 @@ Page({
21 21
     estimatedArrival: 5,
22 22
     locationTimer: null,
23 23
     isTracking: false,
24
-    userdata:[]
24
+    userdata:[],
25
+    workorderdata:[]
25 26
   },  
26 27
 // 收益统计
27 28
   onLoad() {
28 29
     // 初始化地图
29 30
 this.getuser()
30 31
 this.initMap()
32
+wx.$on('wsMessage', this.handleWsMessage);
33
+  },
34
+  onHide(){
35
+    // 页面卸载时,取消订阅,这是至关重要的一步!
36
+    wx.$off('wsMessage', this.handleWsMessage);
37
+  },
38
+   /**
39
+   * 处理接收到的 WebSocket 消息
40
+   * @param {Object} message 从 app.js 广播过来的消息对象
41
+   */
42
+  handleWsMessage(message) {
43
+    console.log('Other Page 收到 WebSocket 消息:', message);
44
+ 
45
+    // 根据消息类型进行不同的处理
46
+    switch (message.api) {
47
+      case '/sysworkorder/selectworkorderlist':
48
+    
49
+        // 在这里可以更新地图、刷新UI等
50
+        if (message.type==1) {
51
+           this.getworkordertype()
52
+        }
53
+
54
+        break;
55
+      
56
+      case 'trajectoryInit':
57
+        // 处理初始轨迹数据
58
+        break;
31 59
 
60
+      case 'heartbeatReply':
61
+        // 心跳回复,通常不需要UI处理
62
+        break;
63
+    
64
+      default:
65
+        // 处理其他类型的消息
66
+        break;
67
+    }
68
+  },
69
+  // 获取待执行工单
70
+  getworkordertype(){
71
+    let data ={
72
+      workorderId:'',
73
+      workorderName:'',
74
+      addressId:'',
75
+      driverId:'',
76
+      carId:'',
77
+      customerId:'',
78
+      workorderType:4,
79
+      chargedischargeType:'',
80
+    }
81
+    api.request(`/sysworkorder/selectworkorderlist`, 'post',data ,{ isPublic: false })
82
+    .then((data) => {
83
+      console.log(data.data);
84
+      if (data.code==200) {
85
+       this.setData({
86
+        workorderdata:data.data
87
+       })
88
+     
89
+      }
90
+    })
91
+    .catch((err) => {
92
+      console.error('请求失败:', err);
93
+    });
32 94
   },
33 95
 getuser(){
34 96
  
@@ -36,6 +98,9 @@ getuser(){
36 98
   .then((data) => {
37 99
     console.log(data.data);
38 100
     if (data.code==200) {
101
+      this.setData({
102
+        userdata:data.data
103
+      })
39 104
                // 设置数据到本地存储
40 105
 wx.setStorage({
41 106
   key: 'user',  // 存储的key值
@@ -79,9 +144,6 @@ wx.setStorage({
79 144
             anchor: {x: 0.5, y: 1}
80 145
           }]
81 146
         });
82
-        
83
-        // 逆地址解析,获取位置名称
84
-        that.reverseGeocoder(longitude, latitude, 'start');
85 147
          // 加载附近车辆数据
86 148
          that.getloadNearbyCars();
87 149
 
@@ -95,149 +157,15 @@ wx.setStorage({
95 157
     });
96 158
   },
97 159
 
98
-  // 逆地址解析,将经纬度转换为地址名称
99
-  reverseGeocoder(longitude, latitude, type) {
100
-   let _this = this 
101
-    wx.request({
102
-      url: `https://apis.map.qq.com/ws/geocoder/v1/?location=${latitude},${longitude}&key=VRGBZ-ZFRHB-SKIUP-NHHJ3-TXGJT-ZIFG3`,
103
-      success(res) {
104
-        if (res.data.status === 0) {
105
-          const address = res.data.result.address;
106
-          if (type === 'start') {
107
-            _this.setData({
108
-              'startLocation.name': address
109
-            });
110
-          } else if (type === 'end') {
111
-            _this.setData({
112
-              'endLocation.name': address
113
-            });
114
-          }
115
-        }
116
-      },
117
-      fail() {
118
-        wx.showToast({
119
-          title: '地址解析失败',
120
-          icon: 'none'
121
-        });
122
-      }
123
-    });
124
-  },
160
+
125 161
   // 预约叫车
126 162
   onelectricity(){
163
+
127 164
 wx.navigateTo({
128
-  url: '/package-order/pages/createorder/index',
165
+  url: `/package-order/pages/createorder/index?order=`,
129 166
 })
130 167
   },
131
-  // 更新地图标记和路线
132
-  updateMarkersAndRoute() {
133
-    const { startLocation, endLocation } = this.data;
134
-    
135
-    // 如果起点和终点都存在
136
-    if (startLocation.longitude && endLocation.longitude) {
137
-      // 更新标记
138
-      const markers = [
139
-        {
140
-          id: 0,
141
-          longitude: startLocation.longitude,
142
-          latitude: startLocation.latitude,
143
-          iconPath: 'https://esos-iot.bjdexn.cn/myminio/project/a0d245bf00c6493d949c3be82a6d2b98.png',
144
-          width: 40,
145
-          height: 40,
146
-          anchor: {x: 0.5, y: 1}
147
-        },
148
-        {
149
-          id: 1,
150
-          longitude: endLocation.longitude,
151
-          latitude: endLocation.latitude,
152
-          iconPath: 'https://esos-iot.bjdexn.cn/myminio/project/9efa1691f71a48b6ae20648c0a2dae56.png',
153
-          width: 40,
154
-          height: 40,
155
-          anchor: {x: 0.5, y: 1}
156
-        }
157
-      ];
158
-      
159
-      // 绘制路线AI云盘
160
-      const polyline = [{
161
-        points: [
162
-          {
163
-            longitude: startLocation.longitude,
164
-            latitude: startLocation.latitude
165
-          },
166
-          {
167
-            longitude: endLocation.longitude,
168
-            latitude: endLocation.latitude
169
-          }
170
-        ],
171
-        color: "#2C85FF",
172
-        width: 6,
173
-        dottedLine: false
174
-      }];
175
-      
176
-      // 计算距离和费用
177
-      const distance = this.calculateDistance(
178
-        startLocation.latitude, startLocation.longitude,
179
-        endLocation.latitude, endLocation.longitude
180
-      );
181
-      
182
-      // 简单的费用计算模型:起步价13元,超过3公里后每公里2.3元
183
-      let price = 13;
184
-      if (distance > 3) {
185
-        price += (distance - 3) * 2.3;
186
-      }
187
-      
188
-      this.setData({
189
-        markers,
190
-        polyline,
191
-        distance: distance.toFixed(1),
192
-        estimatedPrice: Math.round(price),
193
-        showTripInfo: true,
194
-        showCallButton: true
195
-      });
196
-    } else if (startLocation.longitude) {
197
-      // 只有起点
198
-      this.setData({
199
-        markers: [{
200
-          id: 0,
201
-          longitude: startLocation.longitude,
202
-          latitude: startLocation.latitude,
203
-          iconPath: 'https://esos-iot.bjdexn.cn/myminio/project/a0d245bf00c6493d949c3be82a6d2b98.png',
204
-          width: 40,
205
-          height: 40,
206
-          anchor: {x: 0.5, y: 1}
207
-        }],
208
-        polyline: [],
209
-        showTripInfo: false,
210
-        showCallButton: false
211
-      });
212
-    }
213
-  },
214 168
 
215
-  // 计算两点之间的距离(公里)
216
-  calculateDistance(lat1, lon1, lat2, lon2) {
217
-    const R = 6371; // 地球半径(公里)
218
-    const dLat = this.deg2rad(lat2 - lat1);
219
-    const dLon = this.deg2rad(lon2 - lon1);
220
-    const a = 
221
-      Math.sin(dLat/2) * Math.sin(dLat/2) +
222
-      Math.cos(this.deg2rad(lat1)) * Math.cos(this.deg2rad(lat2)) * 
223
-      Math.sin(dLon/2) * Math.sin(dLon/2); 
224
-    const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); 
225
-    const distance = R * c;
226
-    return distance;
227
-  },
228
-
229
-  // 角度转弧度
230
-  deg2rad(deg) {
231
-    return deg * (Math.PI/180);
232
-  },
233
-
234
-  // 地图区域变化时触发
235
-  onRegionChange(e) {
236
-    // 可以在这里处理地图移动后的逻辑,如重新加载附近车辆
237
-    if (e.type === 'end' && e.causedBy === 'drag') {
238
-      // this.loadNearbyCars();
239
-    }
240
-  },
241 169
   onHide() {
242 170
     // 页面卸载时停止追踪
243 171
     this.stopTracking();
@@ -361,17 +289,19 @@ wx.navigateTo({
361 289
     this.initMap()
362 290
 
363 291
   },
364
-  cancelOrder() {
365
-    // 移除司机标记
366
-    // const updatedMarkers = this.data.markers.filter(marker => marker.id !== 999);
367
-    
368
-    // this.setData({
369
-    //   showDriverInfo: false,
370
-    //   showCallButton: true,
371
-    //   markers: updatedMarkers
372
-    // });
292
+  
293
+  details(e){
294
+
295
+    wx.navigateTo({
296
+    url: `/package-map/pages/map/index?id=${e.currentTarget.dataset.id}`,
297
+  })
373 298
   },
299
+  
300
+ 
374 301
   onShow() {
375
-     this.loadNearbyCars()
302
+    //  this.loadNearbyCars()
303
+this.getworkordertype()
304
+
376 305
   },
377
-});
306
+}); 
307
+//

+ 70
- 59
pages/index/index.wxml 查看文件

@@ -1,8 +1,9 @@
1 1
 <view class="container">
2
-  <!-- 地图组件 -->
2
+  <!-- 地图组件 wx:if="{{workorderdata.length<1}}" -->
3 3
   <map 
4 4
     id="map"
5 5
     class="map"
6
+    style="{{workorderdata.length < 1 ? 'height: 100%':'height: 70%'}}"
6 7
     longitude="{{longitude}}"
7 8
     latitude="{{latitude}}"
8 9
     scale="{{scale}}"
@@ -11,74 +12,81 @@
11 12
     show-location
12 13
     bindregionchange="onRegionChange"
13 14
   ></map>
14
-  
15
-  <!-- 底部操作面板 -->
16
-  <view class="bottom-panel">
17
-    <!-- 行程信息卡片 -->
18
-    <!-- <view class="trip-card">
19
-      <view class="location-item">
20
-        <view class="location-icon start-icon">
21
-          <view class="icon-circle"></view>
22
-        </view>
23
-        <view class="location-input">
24
-          <input placeholder="您的位置" value="{{startLocation.name}}" bindtap="chooseStartLocation" />
25
-        </view>
26
-      </view>
27
-      
28
-      <view class="location-item">
29
-        <view class="location-icon end-icon">
30
-          <view class="icon-marker"></view>
31
-        </view>
32
-        <view class="location-input">
33
-          <input placeholder="输入目的地" value="{{endLocation.name}}" bindtap="chooseEndLocation" />
34
-        </view>
35
-      </view>
36
-      
37
-      <view class="trip-info" wx:if="{{showTripInfo}}">
38
-        <view class="distance">距离: {{distance}} 公里</view>
39
-        <view class="estimated-price">预估费用: ¥{{estimatedPrice}}</view>
40
-      </view>
41
-    </view> -->
42
-    
43
- 
15
+   
16
+  <!-- 底部操--作面板 -->
17
+  <view class="bottom-panel" wx:if="{{workorderdata.length > 0 }}">
44 18
     
45
-    <!-- 司机信息 (叫车后显示) -->
46
-    <view class="driver-info" wx:if="{{showDriverInfo}}">
19
+  <!-- 客户信息--(叫车后显示) -->
20
+    <view  wx:if="{{userdata.operationRole==5}}">
21
+    <view class="driver-info" wx:for="{{workorderdata}}" wx:key="index" data-id="{{item.workorderId}}" bindtap="details">
47 22
       <image src="{{driverAvatar}}" class="driver-avatar"></image>
23
+   <view style="width: 100%;">
24
+      <view style="width: 100%;display: flex;justify-content: space-between;">
48 25
       <view class="driver-details">
49
-        <view class="driver-name">司机 {{driverName}}</view>
50
-        <view class="driver-car">车牌号: {{carNumber}}</view>
51
-        <view class="driver-arrive">预计{{estimatedArrival}}分钟后到达</view>
26
+        <!-- <view class="driver-name"><text style="color: #222;">司机:</text>  {{item.driverName||'匹配中'}}</view> -->
27
+        <view class="driver-name">车牌号:{{item.carName||'匹配中'}}</view>
28
+        <view class="driver-car" wx:if="{{item.chargedischargeType==1}}">订单类型:充电</view>
29
+        <view class="driver-car" wx:if="{{item.chargedischargeType==2}}">订单类型:放电</view>
30
+        <view class="driver-car">目的地:{{item.poiName}}</view>
52 31
       </view>
53
-      <button class="cancel-btn" bindtap="cancelOrder">去查看</button>
32
+      <view class="cancel-btn">
33
+        <view wx:if="{{item.workorderType==0}}">待处理</view>
34
+<view wx:if="{{item.workorderType==1}}">待出发</view>
35
+<view wx:if="{{item.workorderType==2}}">行驶中</view>
36
+<view wx:if="{{item.workorderType==3}}">到达地点</view>
37
+<view wx:if="{{item.workorderType==4}}">工作中</view>
38
+<!-- <view wx:if="{{item.workorderType==5}}">完成工作</view> -->
39
+<view wx:if="{{item.workorderType==5&&item.workorderExaminetye==0}}">待审核</view>
40
+<view wx:if="{{item.workorderType==5&&item.workorderExaminetye==1}}">审核成功</view>
41
+<view wx:if="{{item.workorderType==5&&item.workorderExaminetye==2}}">审核失败</view>
42
+      
43
+      </view>
44
+      </view>
45
+      <view class="driver-arrive1">预约时间:{{item.workorderStarttime}}</view>
54 46
     </view>
55
-    <!-- <view class="driver-info" wx:if="{{showDriverInfo}}">
56
-      <image src="{{driverAvatar}}" class="driver-avatar"></image>
47
+    </view>
48
+    </view>
49
+    <!-- 司机信息--(叫车后显示) --> 
50
+    <view  wx:if="{{userdata.operationRole==4}}">
51
+    <view class="driver-info" wx:for="{{workorderdata}}" wx:key="index" data-id="{{item.workorderId}}" bind:tap="details">
52
+      <image src="{{driverAvatar}}" class="driver-avatar" mode="widthFix"></image>
53
+   <view style="width: 100%;">
54
+      <view style="width: 100%;display: flex;justify-content: space-between;">
57 55
       <view class="driver-details">
58
-        <view class="driver-name">车牌号: {{carNumber}}</view>
59
-        <view class="driver-car">工作方向: 放电</view>
60
-        <view class="driver-arrive">预计{{estimatedArrival}}分钟后完成工作</view>
56
+        <view class="driver-name">{{item.poiName}}</view>
57
+        <view class="driver-car">客户: {{item.receiver}}</view>
58
+        <view class="driver-car" wx:if="{{item.chargedischargeType==1}}">订单类型:充电</view>
59
+        <view class="driver-car" wx:if="{{item.chargedischargeType==2}}">订单类型:放电</view>
61 60
       </view>
62
-      <button class="cancel-btn" bindtap="cancelOrder">去查看</button>
63
-    </view> -->
64
-    <!-- <view class="driver-info" wx:if="{{showDriverInfo}}">
65
-      <image src="{{driverAvatar}}" class="driver-avatar"></image>
66
-      <view class="driver-details">
67
-        <view class="driver-name">车牌号: {{carNumber}}</view>
68
-        <view class="driver-car">工作方向: 放电</view>
69
-        <view class="driver-arrive">预计{{estimatedArrival}}分钟后完成工作</view>
61
+      <!-- <button class="cancel-btn" data-id="{{item.workorderId}}" bind:tap="details">去查看</button> -->
62
+      <view class="cancel-btn">
63
+        <view wx:if="{{item.workorderType==0}}">待处理</view>
64
+<view wx:if="{{item.workorderType==1}}">待出发</view>
65
+<view wx:if="{{item.workorderType==2}}">行驶中</view>
66
+<view wx:if="{{item.workorderType==3}}">到达地点</view>
67
+<view wx:if="{{item.workorderType==4}}">工作中</view>
68
+<view wx:if="{{item.workorderType==5}}">完成工作</view>
69
+<view wx:if="{{item.workorderType==6}}">待审核</view>
70
+<view wx:if="{{item.workorderType==7}}">审核失败</view>
71
+      
70 72
       </view>
71
-      <button class="cancel-btn" bindtap="cancelOrder">去查看</button>
72
-    </view> --> 
73
-    <!-- <view class="available" wx:if="{{true}}">
73
+      </view>
74
+      <view class="driver-arrive1">约定到达时间:{{item.workorderCreatetime}}</view>
75
+    </view>
76
+
77
+    </view>
78
+    
79
+    </view>
80
+    <!-- <view class="available" wx:if="{{workorderdata.length<1}}">
74 81
 <image src="https://esos-iot.bjdexn.cn/myminio/project/9efa1691f71a48b6ae20648c0a2dae56.png" mode="aspectFit"/>
75
-</view> -->
76
-       <!--  -->
77
-       <button class="call-btn" bindtap="onelectricity" wx:if="{{showCallButton}}">
82
+</view>  -->
83
+   
84
+    <view style="height: 140rpx;" wx:if="{{userdata.operationRole==5}}"></view>
85
+     <!-- <button class="call-btn" bindtap="onelectricity">
78 86
       <text class="call-btn_left_electricity">预约</text>
79
-    </button>
87
+    </button> -->
80 88
   </view>
81
-  
89
+   
82 90
   <!-- 附近车辆--数量提示 -->
83 91
   <view class="cars-nearby" wx:if="{{carsNearby > 0}}">
84 92
     <view class="cars-icon">
@@ -87,7 +95,10 @@
87 95
     <view class="cars-count">附近有 {{carsNearby}} 辆车</view>
88 96
   </view>
89 97
 </view>
90
-<view class="positioning" bind:tap="positioning">
98
+<button class="call-btn" bindtap="onelectricity" wx:if="{{userdata.operationRole==5}}">
99
+      <text class="call-btn_left_electricity">预约</text>
100
+    </button>
101
+<view class="positioning" bind:tap="positioning" style="{{workorderdata.length < 1 ? 'top: 85%':'top: 55%'}}">
91 102
   <t-icon name="focus" size="40rpx" data-name="focus" bind:tap="onIconTap" />
92 103
 
93 104
 </view>

+ 31
- 10
pages/index/index.wxss 查看文件

@@ -10,7 +10,7 @@
10 10
 
11 11
 .map {
12 12
   width: 100%;
13
-  height: 1100rpx;
13
+  
14 14
 }
15 15
 
16 16
 .bottom-panel {
@@ -19,8 +19,12 @@
19 19
   left: 0;
20 20
   right: 0; */
21 21
   width: 100%;
22
+  height: 660rpx;
23
+  overflow: hidden;
24
+  overflow: auto;
22 25
   padding: 16rpx;
23 26
   box-sizing: border-box;
27
+  
24 28
 }
25 29
 
26 30
 .trip-card {
@@ -116,6 +120,12 @@ width: 50%;
116 120
 .driver-details {
117 121
   margin-left: 24rpx;
118 122
   flex: 1;
123
+  display: flex;
124
+  flex-direction: column;
125
+  justify-content: center;
126
+  /* justify-content:space-around; */
127
+  /* justify-content: space-between; */
128
+  /* align-items: center; */
119 129
 }
120 130
 
121 131
 .driver-name {
@@ -134,16 +144,20 @@ width: 50%;
134 144
   color: #2C85FF;
135 145
   margin-top: 8rpx;
136 146
 }
137
-
147
+.driver-arrive1 {
148
+  font-size: 28rpx;
149
+  margin-top: 8rpx;
150
+  margin-left: 20rpx;
151
+}
138 152
 .cancel-btn {
139
-  width: 160rpx;
140
-  height: 64rpx;
141
-  line-height: 64rpx;
153
+  padding: 0rpx 20rpx;
154
+  height: 48rpx;
155
+  line-height: 48rpx;
142 156
   font-size: 28rpx;
143
-  color: #FF5252;
144
-  border: 1rpx solid #FF5252;
145
-  background-color: white;
157
+  color: #2c85ff;
146 158
   border-radius: 32rpx;
159
+  /* background-color: #2C85FF; */
160
+  border: 1rpx solid #2c85ff;
147 161
 }
148 162
 
149 163
 .cars-nearby {
@@ -180,6 +194,13 @@ width: 50%;
180 194
 }
181 195
 .positioning{
182 196
   position: fixed;
197
+  /* top: 740rpx; */
183 198
   right: 40rpx;
184
-  bottom: 400rpx;
185
-}
199
+  
200
+}
201
+.available{
202
+  display: flex;
203
+   justify-content: center;
204
+   align-items: center;
205
+   margin-top: 100rpx;
206
+  }

+ 9
- 18
pages/setup/index.js 查看文件

@@ -60,16 +60,18 @@ inputValue: '' // 初始值
60 60
   toconfigure(e){
61 61
     console.log(e.currentTarget.dataset.name);
62 62
     if (e.currentTarget.dataset.name=="userlist") {
63
+      // 历史订单
63 64
       wx.navigateTo({
64
-        url: '/pages/userlist/index',
65
+        url: '/package-user/pages/userlist/index',
65 66
       });
66 67
     }else if (e.currentTarget.dataset.name=="driver"){
68
+      // 订单发票
67 69
       wx.navigateTo({
68
-        url: '/pages/driver/index',
70
+        url: '/package-user/pages/driver/index',
69 71
       });
70 72
     }else if (e.currentTarget.dataset.name=="address"){
71 73
       wx.navigateTo({
72
-        url: '/pages/address/index',
74
+        url: '/package-order/pages/address/index',
73 75
       });
74 76
     }else{
75 77
       wx.showToast({
@@ -92,22 +94,10 @@ inputValue: '' // 初始值
92 94
   } catch (e) {
93 95
     console.error("获取小程序版本号失败:", e);
94 96
   }
95
-    // this.getuser()
97
+     
96 98
   },
97 99
 
98
-  getuser(){
99
-    api.request(`/partner/selectinformation`, 'POST',{})
100
-    .then((res) => {
101
-      console.log(res);
102
-      this.setData({
103
-        user:res.data
104
-      })
105
-    })
106
-    .catch((err) => {
107
-      console.error('请求失败:', err);
108
-      // 在这里处理请求失败的情况 
109
-    });
110
-  },
100
+ 
111 101
    onuser(){
112 102
     wx.showToast({
113 103
       title: '暂未开放',
@@ -132,7 +122,8 @@ inputValue: '' // 初始值
132 122
 //  this.getuser()
133 123
 
134 124
     this.setData({
135
-      station:wx.getStorageSync('station')
125
+      station:wx.getStorageSync('station'),
126
+      user:wx.getStorageSync('user')
136 127
     })
137 128
   },
138 129
 

+ 1
- 1
pages/setup/index.json 查看文件

@@ -1,5 +1,5 @@
1 1
 { 
2
-  "navigationBarTitleText": "晟运能源",
2
+  "navigationBarTitleText": "电速宝",
3 3
   "usingComponents": {
4 4
     "t-icon": "tdesign-miniprogram/icon/icon",
5 5
     "t-button": "tdesign-miniprogram/button/button",

+ 13
- 12
pages/setup/index.wxml 查看文件

@@ -2,35 +2,36 @@
2 2
  
3 3
 <view style="width: 100%;height:60rpx"></view>
4 4
 <view class="user">
5
-<image bind:tap="onuser" class="user_to" src="{{user.partnerAvite||'https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132'}}" mode=""/>
5
+<image bind:tap="onuser" class="user_to" src="{{user.operationPicture||'https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132'}}" mode=""/>
6 6
 <view class="user_name">
7
-<view class="user_name1">{{user.partnerName||'微信用户'}}
8
-<view class="user_role" wx:if="{{user.partnerPosition==4}}">董事长</view>
9
-<view class="user_role" wx:if="{{user.partnerPosition==3}}">站长</view>
10
-<view class="user_role" wx:if="{{user.partnerPosition==2}}">值长</view>
11
-<view class="user_role" wx:if="{{user.partnerPosition==1}}">值班员</view>
7
+<view class="user_name1">{{user.operationName||'微信用户'}}
8
+<view class="user_role" wx:if="{{user.operationRole==4}}">司机</view>
9
+<view class="user_role" wx:if="{{user.operationRole==5}}">客户</view>
12 10
 </view>
13
-<view class="user_name2">{{user.partnerPhone}}</view>
11
+<view class="user_name2">{{user.operationPhone}}</view>
14 12
 </view>
15 13
 </view>
16 14
 <view style="width: 100%;height:40rpx"></view>
17
-<!-- -->
15
+<!--  
16
+  
17
+ -->
18 18
 <view class="allocation_box">
19
+
19 20
 <view class="allocation" data-name="userlist" bind:tap="toconfigure">
20
-<view class="allocation_3">用户</view>
21
+<view class="allocation_3">分配订单</view>
21 22
 <view class="allocation_1">
22 23
 <view class="allocation_2"></view>
23 24
 <t-icon name="chevron-right-s" size="40rpx" data-name="chevron-right-s"/>
24 25
 </view>
25 26
 </view>
26 27
 <view class="allocation" data-name="driver" bind:tap="toconfigure">
27
-<view class="allocation_3">司机</view>
28
+<view class="allocation_3">订单发票</view>
28 29
 <view class="allocation_1">
29 30
 <view class="allocation_2"></view>
30 31
 <t-icon name="chevron-right-s" size="40rpx" data-name="chevron-right-s"/>
31 32
 </view>
32 33
 </view>
33
-<view class="allocation" data-name="address" bind:tap="toconfigure">
34
+<view wx:if="{{user.operationRole==5}}" class="allocation" data-name="address" bind:tap="toconfigure">
34 35
 <view class="allocation_3">地址</view>
35 36
 <view class="allocation_1">
36 37
 <view class="allocation_2"></view>
@@ -53,7 +54,7 @@
53 54
 </view>
54 55
 <view class="allocation">
55 56
 <view class="allocation_31">
56
-<button class="contact-button" open-type="contact" plain >
57
+<button class="contact-button" open-type="contact" plain>
57 58
 <view>联系客服</view>
58 59
 </button>
59 60
 </view>

+ 42
- 6
pages/tool/index.js 查看文件

@@ -2,7 +2,7 @@ const api = require('../../api/index.js');
2 2
 Page({
3 3
 
4 4
   data: {
5
-    tabsindex:"1",
5
+    tabsindex:"",
6 6
     driverlist:[],
7 7
     selected:1,
8 8
     userdata:[]
@@ -12,6 +12,43 @@ Page({
12 12
     this.setData({
13 13
       userdata:wx.getStorageSync('user')
14 14
     })
15
+wx.$on('wsMessage', this.toolWsMessage);
16
+
17
+  },
18
+  onUnload() {
19
+    // 页面卸载时,取消订阅!
20
+    wx.$off('wsMessage', this.toolWsMessage);
21
+  },
22
+   /**
23
+   * 处理接收到的 WebSocket 消息
24
+   * @param {Object} message 从 app.js 广播过来的消息对象
25
+   */
26
+  
27
+  toolWsMessage(message) {
28
+    console.log('Other Page 收到 WebSocket 消息:', message);
29
+ 
30
+    // 根据消息类型进行不同的处
31
+    switch (message.api) {
32
+      case '/sysworkorder/selectworkorderlist':
33
+        // 在这里可以更新地图、刷新UI等
34
+        if (message.type==1) {
35
+           this.getdriver()
36
+        }
37
+
38
+        break;
39
+      
40
+      case 'trajectoryInit':
41
+        // 处理初始轨迹数据
42
+        break;
43
+
44
+      case 'heartbeatReply':
45
+        // 心跳回复,通常不需要UI处理
46
+        break;
47
+    
48
+      default:
49
+        // 处理其他类型的消息
50
+        break;
51
+    }
15 52
   },
16 53
   onselected(e){
17 54
     console.log(e.currentTarget.dataset.index);
@@ -28,7 +65,7 @@ this.getdriver()
28 65
       driverId:'',
29 66
       carId:'',
30 67
       customerId:'',
31
-      workorderType:'',
68
+      workorderType:this.data.tabsindex,
32 69
       chargedischargeType:this.data.selected,
33 70
     }
34 71
 
@@ -53,8 +90,10 @@ this.getdriver()
53 90
   onTabsChange(e){
54 91
   console.log(e.detail.value);
55 92
   this.setData({
56
-    tabsindex:e.detail.value
93
+    tabsindex:e.detail.value,
57 94
   })
95
+  this.getdriver()
96
+
58 97
   // this.gitreview()
59 98
   },
60 99
   details(e){
@@ -66,13 +105,10 @@ this.getdriver()
66 105
 
67 106
   onShow() {
68 107
     this.getdriver()
69
-
70 108
   },
71 109
    /**
72 110
    * 页面相关事件处理函数--监听用户下拉动作
73 111
    */
74 112
    onPullDownRefresh() {
75
-
76
-
77 113
   }
78 114
 });

+ 21
- 15
pages/tool/index.wxml 查看文件

@@ -10,17 +10,20 @@
10 10
 </view>
11 11
 <view class="discharge_tabs" wx:if="{{userdata.operationRole==4}}">
12 12
   <t-tabs value="{{tabsindex}}" bind:change="onTabsChange" bind:click="onTabsClick" t-class="custom-tabs" split="{{false}}">
13
-    <t-tab-panel label="全部" value="1" />
14
-    <t-tab-panel label="待接单" value="2" />
15
-  <t-tab-panel label="服务中" value="3" />
16
-  <t-tab-panel label="已完成" value="4" />
13
+    <t-tab-panel label="全部" value="" />
14
+  <t-tab-panel label="服务中" value="2" />
15
+  <t-tab-panel label="已完成" value="3" />
16
+  <t-tab-panel label="取消" value="4" />
17
+    <!-- <t-tab-panel label="审核" value="1" /> -->
17 18
 </t-tabs>
18 19
 </view>
19 20
 <view class="discharge_tabs" wx:if="{{userdata.operationRole==5}}">
20 21
   <t-tabs value="{{tabsindex}}" bind:change="onTabsChange" bind:click="onTabsClick" t-class="custom-tabs" split="{{false}}">
21
-    <t-tab-panel label="全部" value="1" />
22
+    <t-tab-panel label="全部" value="" />
22 23
     <t-tab-panel label="工作中" value="2" />
23
-  <t-tab-panel label="已完成" value="4" />
24
+  <t-tab-panel label="已完成" value="3" />
25
+  <t-tab-panel label="取消" value="4" />
26
+<!--  -->
24 27
 </t-tabs>
25 28
 </view>
26 29
 <!-- <view bind:tap="onfilter">
@@ -33,9 +36,9 @@
33 36
 <view class="order_title">
34 37
 <view class="order_title1"> <image class="order_image" src="https://esos-iot.bjdexn.cn/myminio/project/458bb7eea14f42cc958eebf0a8b89da3.png" mode="aspectFit"/>
35 38
 <!-- <text>{{item.carName}}</text> -->
36
-<text>光伏</text>
37
-<!-- <text>风电</text> -->
38
-<!-- <text>网电</text> -->
39
+<text wx:if="{{item.chargedischargeType==1}}">光伏</text>
40
+<text wx:if="{{item.chargedischargeType==2}}">风电</text>
41
+<text wx:if="{{item.chargedischargeType==3}}">网电</text>
39 42
 </view> 
40 43
 <!-- <view class="order_title1"> <image class="order_image" src="https://esos-iot.bjdexn.cn/myminio/proje  ct/94f976d5afce444a8861b59681069218.png" mode="aspectFit"/> 浙C.78Z71</view> -->
41 44
 <view wx:if="{{item.workorderType==0}}">待处理</view>
@@ -43,19 +46,20 @@
43 46
 <view wx:if="{{item.workorderType==2}}">行驶中</view>
44 47
 <view wx:if="{{item.workorderType==3}}">到达地点</view>
45 48
 <view wx:if="{{item.workorderType==4}}">工作中</view>
46
-<view wx:if="{{item.workorderType==5}}">完成工作</view>
47
-<view wx:if="{{item.workorderType==6}}">待审核</view>
48
-<view wx:if="{{item.workorderType==7}}">审核失败</view>
49
+<!-- <view wx:if="{{item.workorderType==5}}">完成工作</view> -->
50
+<view wx:if="{{item.workorderType==5&&item.workorderExaminetye==0}}">待审核</view>
51
+<view wx:if="{{item.workorderType==5&&item.workorderExaminetye==1}}">审核成功</view>
52
+<view wx:if="{{item.workorderType==5&&item.workorderExaminetye==2}}">审核失败</view>
49 53
 </view>
50 54
 <view class="order_direction"><text class="order_text">方向:</text>
51 55
 <text style="color: #FDBA67;" wx:if="{{item.chargedischargeType==2}}">放电</text>
52 56
 <text style="color: #00C775;" wx:if="{{item.chargedischargeType==1}}">充电</text>
53 57
 </view>
54 58
 <view class="order_time"><text class="order_text">需求电量:</text> {{item.workorderElectricity}}</view>
55
-<view class="order_address"><text class="order_text"> 地址:</text>{{item.addressName}}</view>
59
+<view class="order_address"><text class="order_text">地址:</text>{{item.poiName}}</view>
56 60
 
57 61
 <view class="order_bottom">
58
-  <view class="order_time"><text class="order_text">时间:</text> {{item.workorderCreatetime}}</view>
62
+  <view class="order_time"><text class="order_text">预约时间:</text> {{item.workorderCreatetime}}</view>
59 63
 <!-- <view class="order_view" data-id="{{item.workorderId}}" bind:tap="details">查看详情</view> -->
60 64
 </view>
61 65
 </view>
@@ -64,4 +68,6 @@
64 68
 <image src="https://esos-iot.bjdexn.cn/myminio/project/9efa1691f71a48b6ae20648c0a2dae56.png" mode="aspectFit"/>
65 69
 </view> 
66 70
 <view style="height: 30rpx;"></view>
67
-<!---->
71
+<!--
72
+    
73
+--> 

+ 1
- 0
pages/tool/index.wxss 查看文件

@@ -157,6 +157,7 @@ background-color: #00C775;
157 157
 display: flex;
158 158
  justify-content: center;
159 159
  align-items: center;
160
+ margin-top: 200rpx;
160 161
 }
161 162
 .discharge{
162 163
   width: 100%;

+ 1
- 1
project.config.json 查看文件

@@ -40,6 +40,6 @@
40 40
     "ignore": [],
41 41
     "include": []
42 42
   },
43
-  "appid": "wx4278accb70dc3fcd",
43
+  "appid": "wx70e63bda5b2a7285",
44 44
   "simulatorPluginLibVersion": {}
45 45
 }

+ 8
- 1
project.private.config.json 查看文件

@@ -23,6 +23,13 @@
23 23
     "miniprogram": {
24 24
       "list": [
25 25
         {
26
+          "name": "package-map/pages/map/index",
27
+          "pathName": "package-map/pages/map/index",
28
+          "query": "",
29
+          "scene": null,
30
+          "launchMode": "default"
31
+        },
32
+        {
26 33
           "name": "pages/index/index",
27 34
           "pathName": "pages/index/index",
28 35
           "query": "",
@@ -32,5 +39,5 @@
32 39
       ]
33 40
     }
34 41
   },
35
-  "libVersion": "3.8.9"
42
+  "libVersion": "3.11.2"
36 43
 }

二進制
static/9efa1691f71a48b6ae20648c0a2dae56.png 查看文件


+ 425
- 0
utils/latitude.json 查看文件

@@ -0,0 +1,425 @@
1
+ [
2
+  {latitude: 40.130047, longitude: 116.65477},
3
+  {latitude: 40.130041, longitude: 116.653246},
4
+  {latitude: 40.130047, longitude: 116.651625},
5
+  {latitude: 40.130067, longitude: 116.65003},
6
+  {latitude: 40.130064999999995, longitude: 116.649604},
7
+  {latitude: 40.13005199999999, longitude: 116.649002},
8
+  {latitude: 40.13005199999999, longitude: 116.649002},
9
+  {latitude: 40.13004699999999, longitude: 116.64461299999999},
10
+  {latitude: 40.13002999999999, longitude: 116.643941},
11
+  {latitude: 40.12998199999999, longitude: 116.642753},
12
+  {latitude: 40.12996199999999, longitude: 116.642395},
13
+  {latitude: 40.12987799999999, longitude: 116.641505},
14
+  {latitude: 40.12982499999999, longitude: 116.640976},
15
+  {latitude: 40.12951899999999, longitude: 116.63756199999999},
16
+  {latitude: 40.12930499999999, longitude: 116.63527799999999},
17
+  {latitude: 40.12923099999999, longitude: 116.63437899999998},
18
+  {latitude: 40.12917299999999, longitude: 116.63358099999998},
19
+  {latitude: 40.12911899999999, longitude: 116.63255799999997},
20
+  {latitude: 40.12910199999999, longitude: 116.63211599999997},
21
+  {latitude: 40.129029999999986, longitude: 116.62858699999997},
22
+  {latitude: 40.12902899999999, longitude: 116.62826499999997},
23
+  {latitude: 40.12902899999999, longitude: 116.62826499999997},
24
+  {latitude: 40.128891999999986, longitude: 116.62806799999997},
25
+  {latitude: 40.12858999999999, longitude: 116.62811999999997},
26
+  {latitude: 40.128041999999986, longitude: 116.62824099999996},
27
+  {latitude: 40.127856999999985, longitude: 116.62828499999996},
28
+  {latitude: 40.127253999999986, longitude: 116.62845999999996},
29
+  {latitude: 40.12706999999999, longitude: 116.62850599999996},
30
+  {latitude: 40.12492799999999, longitude: 116.62899199999995},
31
+  {latitude: 40.12421499999999, longitude: 116.62913999999995},
32
+  {latitude: 40.12421499999999, longitude: 116.62913999999995},
33
+  {latitude: 40.12403599999999, longitude: 116.62887999999995},
34
+  {latitude: 40.123783999999986, longitude: 116.62848599999995},
35
+  {latitude: 40.123542999999984, longitude: 116.62808699999995},
36
+  {latitude: 40.12313599999998, longitude: 116.62732899999995},
37
+  {latitude: 40.121527999999984, longitude: 116.62413099999995},
38
+  {latitude: 40.121163999999986, longitude: 116.62337799999995},
39
+  {latitude: 40.12099199999999, longitude: 116.62306999999994},
40
+  {latitude: 40.120708999999984, longitude: 116.62263499999995},
41
+  {latitude: 40.11791499999998, longitude: 116.61863199999995},
42
+  {latitude: 40.11762799999998, longitude: 116.61823399999994},
43
+  {latitude: 40.11762799999998, longitude: 116.61823399999994},
44
+  {latitude: 40.117643999999984, longitude: 116.61759199999995},
45
+  {latitude: 40.117645999999986, longitude: 116.61616099999995},
46
+  {latitude: 40.117682999999985, longitude: 116.61469899999994},
47
+  {latitude: 40.11771599999999, longitude: 116.61284899999994},
48
+  {latitude: 40.11772099999999, longitude: 116.61204699999995},
49
+  {latitude: 40.11779099999999, longitude: 116.60943299999995},
50
+  {latitude: 40.11782199999999, longitude: 116.60768599999996},
51
+  {latitude: 40.117828999999986, longitude: 116.60670499999996},
52
+  {latitude: 40.117820999999985, longitude: 116.60587499999997},
53
+  {latitude: 40.117848999999985, longitude: 116.60463599999997},
54
+  {latitude: 40.11788799999999, longitude: 116.60239499999997},
55
+  {latitude: 40.11788699999999, longitude: 116.60165699999997},
56
+  {latitude: 40.11794299999999, longitude: 116.60068399999997},
57
+  {latitude: 40.11793699999999, longitude: 116.59982299999997},
58
+  {latitude: 40.117946999999994, longitude: 116.59868999999998},
59
+  {latitude: 40.11795099999999, longitude: 116.59810799999998},
60
+  {latitude: 40.11796999999999, longitude: 116.59748199999999},
61
+  {latitude: 40.118007999999996, longitude: 116.59686299999998},
62
+  {latitude: 40.118027999999995, longitude: 116.59637199999999},
63
+  {latitude: 40.118033, longitude: 116.59591199999998},
64
+  {latitude: 40.118018, longitude: 116.59533599999999},
65
+  {latitude: 40.118066, longitude: 116.59272099999998},
66
+  {latitude: 40.118089, longitude: 116.59053499999999},
67
+  {latitude: 40.118123999999995, longitude: 116.58934699999999},
68
+  {latitude: 40.118112999999994, longitude: 116.58845},
69
+  {latitude: 40.118106999999995, longitude: 116.58823299999999},
70
+  {latitude: 40.118086, longitude: 116.58785799999998},
71
+  {latitude: 40.118086, longitude: 116.58785799999998},
72
+  {latitude: 40.118078, longitude: 116.58773899999998},
73
+  {latitude: 40.118122, longitude: 116.58753499999999},
74
+  {latitude: 40.118214, longitude: 116.58681099999998},
75
+  {latitude: 40.118263, longitude: 116.58654499999999},
76
+  {latitude: 40.118344, longitude: 116.58624299999998},
77
+  {latitude: 40.118458000000004, longitude: 116.58590399999999},
78
+  {latitude: 40.118641000000004, longitude: 116.58547899999998},
79
+  {latitude: 40.11874100000001, longitude: 116.58527499999998},
80
+  {latitude: 40.11883900000001, longitude: 116.58509999999998},
81
+  {latitude: 40.119124000000006, longitude: 116.58464799999999},
82
+  {latitude: 40.11997100000001, longitude: 116.58351499999999},
83
+  {latitude: 40.120059000000005, longitude: 116.58336399999999},
84
+  {latitude: 40.12016500000001, longitude: 116.58313499999998},
85
+  {latitude: 40.120717000000006, longitude: 116.58234499999999},
86
+  {latitude: 40.12120000000001, longitude: 116.58158499999999},
87
+  {latitude: 40.12154000000001, longitude: 116.58099299999999},
88
+  {latitude: 40.12182000000001, longitude: 116.58048},
89
+  {latitude: 40.12193700000001, longitude: 116.580248},
90
+  {latitude: 40.12222100000001, longitude: 116.579641},
91
+  {latitude: 40.12249500000001, longitude: 116.578999},
92
+  {latitude: 40.122586000000005, longitude: 116.578767},
93
+  {latitude: 40.122817000000005, longitude: 116.578149},
94
+  {latitude: 40.122874, longitude: 116.577984},
95
+  {latitude: 40.123139, longitude: 116.577169},
96
+  {latitude: 40.123254, longitude: 116.576754},
97
+  {latitude: 40.123425000000005, longitude: 116.576039},
98
+  {latitude: 40.123464000000006, longitude: 116.575853},
99
+  {latitude: 40.123566000000004, longitude: 116.57529699999999},
100
+  {latitude: 40.123653000000004, longitude: 116.57470099999999},
101
+  {latitude: 40.123706000000006, longitude: 116.574199},
102
+  {latitude: 40.08226499999997, longitude: 116.63058799999999},
103
+  {latitude: 40.081866999999974, longitude: 116.63102099999999},
104
+  {latitude: 40.081080999999976, longitude: 116.63185499999999},
105
+  {latitude: 40.081080999999976, longitude: 116.63185499999999},
106
+  {latitude: 40.080335999999974, longitude: 116.63260499999998},
107
+  {latitude: 40.07926799999998, longitude: 116.63372299999999},
108
+  {latitude: 40.078742999999974, longitude: 116.634289},
109
+  {latitude: 40.07798199999998, longitude: 116.635087},
110
+  {latitude: 40.077076999999974, longitude: 116.636011},
111
+  {latitude: 40.07551599999997, longitude: 116.637649},
112
+  {latitude: 40.074276999999974, longitude: 116.63891799999999},
113
+  {latitude: 40.07357399999997, longitude: 116.639608},
114
+  {latitude: 40.07298899999997, longitude: 116.640165},
115
+  {latitude: 40.072576999999974, longitude: 116.640551},
116
+  {latitude: 40.071447999999975, longitude: 116.64156200000001},
117
+  {latitude: 40.070783999999975, longitude: 116.642132},
118
+  {latitude: 40.07005599999997, longitude: 116.642736},
119
+  {latitude: 40.06917499999997, longitude: 116.643439},
120
+  {latitude: 40.06849399999997, longitude: 116.643962},
121
+  {latitude: 40.06766499999997, longitude: 116.644576},
122
+  {latitude: 40.06685799999997, longitude: 116.645149},
123
+  {latitude: 40.05724599999997, longitude: 116.65173},
124
+  {latitude: 40.05684599999997, longitude: 116.652022},
125
+  {latitude: 40.05608099999997, longitude: 116.652551},
126
+  {latitude: 40.05494399999997, longitude: 116.65330300000001},
127
+  {latitude: 40.05406599999997, longitude: 116.65390400000001},
128
+  {latitude: 40.05348099999997, longitude: 116.65431800000002},
129
+  {latitude: 40.05250999999997, longitude: 116.65497500000002},
130
+  {latitude: 40.05179799999997, longitude: 116.65543800000002},
131
+  {latitude: 40.05024199999997, longitude: 116.65639100000001},
132
+  {latitude: 40.049187999999965, longitude: 116.65701400000002},
133
+  {latitude: 40.048002999999966, longitude: 116.65768400000002},
134
+  {latitude: 40.046939999999964, longitude: 116.65825500000001},
135
+  {latitude: 40.046043999999966, longitude: 116.658719},
136
+  {latitude: 40.04462999999997, longitude: 116.659411},
137
+  {latitude: 40.04156899999997, longitude: 116.66083900000001},
138
+  {latitude: 40.040446999999965, longitude: 116.661381},
139
+  {latitude: 40.040446999999965, longitude: 116.661381},
140
+  {latitude: 40.040347999999966, longitude: 116.66133900000001},
141
+  {latitude: 40.040178999999966, longitude: 116.66139100000001},
142
+  {latitude: 40.03865499999996, longitude: 116.661979},
143
+  {latitude: 40.03829299999996, longitude: 116.66211},
144
+  {latitude: 40.03816399999996, longitude: 116.662142},
145
+  {latitude: 40.03788499999996, longitude: 116.66218500000001},
146
+  {latitude: 40.03788499999996, longitude: 116.66218500000001},
147
+  {latitude: 40.03751899999996, longitude: 116.662006},
148
+  {latitude: 40.03732699999996, longitude: 116.661895},
149
+  {latitude: 40.03721399999996, longitude: 116.661816},
150
+  {latitude: 40.03641299999996, longitude: 116.661132},
151
+  {latitude: 40.03610599999996, longitude: 116.660844},
152
+  {latitude: 40.03587199999996, longitude: 116.6606},
153
+  {latitude: 40.03568999999996, longitude: 116.660377},
154
+  {latitude: 40.03529299999996, longitude: 116.65982},
155
+  {latitude: 40.03466999999996, longitude: 116.658394},
156
+  {latitude: 40.03454599999996, longitude: 116.658055},
157
+  {latitude: 40.034513999999966, longitude: 116.658021},
158
+  {latitude: 40.034356999999964, longitude: 116.657937},
159
+  {latitude: 40.034133999999966, longitude: 116.657405},
160
+  {latitude: 40.03395499999996, longitude: 116.657003},
161
+  {latitude: 40.03348599999996, longitude: 116.65602700000001},
162
+  {latitude: 40.033402999999964, longitude: 116.65586400000001},
163
+  {latitude: 40.03297999999997, longitude: 116.65509800000001},
164
+  {latitude: 40.032856999999964, longitude: 116.65487900000001},
165
+  {latitude: 40.032634999999964, longitude: 116.65451},
166
+  {latitude: 40.032276999999965, longitude: 116.65394},
167
+  {latitude: 40.031769999999966, longitude: 116.653194},
168
+  {latitude: 40.03160299999997, longitude: 116.652957},
169
+  {latitude: 40.03114099999997, longitude: 116.652327},
170
+  {latitude: 40.02894799999997, longitude: 116.649438},
171
+  {latitude: 40.02793599999997, longitude: 116.64806300000001},
172
+  {latitude: 40.02720199999997, longitude: 116.64701900000001},
173
+  {latitude: 40.026819999999965, longitude: 116.64645500000002},
174
+  {latitude: 40.02625599999997, longitude: 116.64558300000002},
175
+  {latitude: 40.02591599999997, longitude: 116.64503700000002},
176
+  {latitude: 40.02556099999997, longitude: 116.64444200000001},
177
+  {latitude: 40.02527399999997, longitude: 116.64394000000001},
178
+  {latitude: 40.02495799999997, longitude: 116.64336100000001},
179
+  {latitude: 40.024691999999966, longitude: 116.64285000000001},
180
+  {latitude: 40.024450999999964, longitude: 116.642363},
181
+  {latitude: 40.023920999999966, longitude: 116.64123000000001},
182
+  {latitude: 40.02353799999997, longitude: 116.640281},
183
+  {latitude: 40.02328599999996, longitude: 116.639611},
184
+  {latitude: 40.02303699999997, longitude: 116.63885400000001},
185
+  {latitude: 40.022735999999966, longitude: 116.637832},
186
+  {latitude: 40.02243899999996, longitude: 116.636692},
187
+  {latitude: 40.02225599999996, longitude: 116.635869},
188
+  {latitude: 40.02210199999996, longitude: 116.635067},
189
+  {latitude: 40.02199699999996, longitude: 116.634432},
190
+  {latitude: 40.021933999999966, longitude: 116.634007},
191
+  {latitude: 40.02181499999997, longitude: 116.633046},
192
+  {latitude: 40.021750999999966, longitude: 116.63238899999999},
193
+  {latitude: 40.021697999999965, longitude: 116.63166199999999},
194
+  {latitude: 40.02167099999996, longitude: 116.63114999999999},
195
+  {latitude: 40.02163999999996, longitude: 116.630033},
196
+  {latitude: 40.02164099999996, longitude: 116.62939399999999},
197
+  {latitude: 40.02165299999996, longitude: 116.628834},
198
+  {latitude: 40.021681999999956, longitude: 116.62816099999999},
199
+  {latitude: 40.02174499999995, longitude: 116.627253},
200
+  {latitude: 40.02179599999995, longitude: 116.626699},
201
+  {latitude: 40.021887999999954, longitude: 116.625884},
202
+ ,  {latitude: 40.021907999999954, longitude: 116.625747},
203
+ {latitude: 40.02204099999995, longitude: 116.625136},
204
+ {latitude: 40.02251599999995, longitude: 116.623211},
205
+ {latitude: 40.02251599999995, longitude: 116.623211},
206
+ {latitude: 40.02273399999995, longitude: 116.622064},
207
+ {latitude: 40.02282799999995, longitude: 116.62163799999999},
208
+ {latitude: 40.02311799999995, longitude: 116.62051699999999},
209
+ {latitude: 40.023174999999945, longitude: 116.620346},
210
+ {latitude: 40.023354999999945, longitude: 116.619822},
211
+ {latitude: 40.023655999999946, longitude: 116.61901},
212
+ {latitude: 40.02403199999995, longitude: 116.618072},
213
+ {latitude: 40.02444799999995, longitude: 116.617111},
214
+ {latitude: 40.02481299999995, longitude: 116.616316},
215
+ {latitude: 40.02558999999995, longitude: 116.614705},
216
+ {latitude: 40.026089999999954, longitude: 116.613745},
217
+ {latitude: 40.028599999999955, longitude: 116.60922799999999},
218
+ {latitude: 40.02896399999995, longitude: 116.60856299999999},
219
+ {latitude: 40.02974199999995, longitude: 116.60719699999999},
220
+ {latitude: 40.03077199999995, longitude: 116.60536199999999},
221
+ {latitude: 40.03146199999995, longitude: 116.60410199999998},
222
+ {latitude: 40.03180699999995, longitude: 116.60352199999998},
223
+ {latitude: 40.03241299999995, longitude: 116.60243199999998},
224
+ {latitude: 40.03294999999995, longitude: 116.60151099999997},
225
+ {latitude: 40.03391099999995, longitude: 116.59977399999997},
226
+ {latitude: 40.034099999999945, longitude: 116.59941799999997},
227
+ {latitude: 40.03446499999995, longitude: 116.59867799999998},
228
+ {latitude: 40.034856999999946, longitude: 116.59778499999997},
229
+ {latitude: 40.03499299999994, longitude: 116.59743499999998},
230
+ {latitude: 40.03522799999995, longitude: 116.59675699999998},
231
+ {latitude: 40.035385999999946, longitude: 116.59620799999998},
232
+ {latitude: 40.03548299999994, longitude: 116.59582999999998},
233
+ {latitude: 40.035588999999945, longitude: 116.59535399999997},
234
+ {latitude: 40.03569799999995, longitude: 116.59477999999997},
235
+ {latitude: 40.03577099999995, longitude: 116.59429399999998},
236
+ {latitude: 40.03582699999995, longitude: 116.59378499999998},
237
+ {latitude: 40.035847999999945, longitude: 116.59356699999998},
238
+ {latitude: 40.035897999999946, longitude: 116.59271099999998},
239
+ {latitude: 40.03590199999994, longitude: 116.59215299999998},
240
+ {latitude: 40.035886999999946, longitude: 116.59157799999998},
241
+ {latitude: 40.03584299999994, longitude: 116.59088499999999},
242
+ {latitude: 40.035791999999944, longitude: 116.59033599999998},
243
+ {latitude: 40.03568899999994, longitude: 116.58949799999998},
244
+ {latitude: 40.03561699999994, longitude: 116.58898399999998},
245
+ {latitude: 40.03478899999994, longitude: 116.58380399999999},
246
+ {latitude: 40.03462099999994, longitude: 116.58264199999999},
247
+ {latitude: 40.034477999999936, longitude: 116.58139399999999},
248
+ {latitude: 40.03438199999994, longitude: 116.58007099999999},
249
+ {latitude: 40.034373999999936, longitude: 116.57990999999998},
250
+ {latitude: 40.03436499999994, longitude: 116.57950899999999},
251
+ {latitude: 40.03436499999994, longitude: 116.57950899999999},
252
+ {latitude: 40.034359999999936, longitude: 116.57881199999999},
253
+ {latitude: 40.034393999999935, longitude: 116.57799899999999},
254
+ {latitude: 40.034460999999936, longitude: 116.57713},
255
+ {latitude: 40.034534999999934, longitude: 116.576466},
256
+ {latitude: 40.03463499999994, longitude: 116.575767},
257
+ {latitude: 40.034762999999934, longitude: 116.575051},
258
+ {latitude: 40.03482099999994, longitude: 116.574755},
259
+ {latitude: 40.03501799999994, longitude: 116.573893},
260
+ {latitude: 40.035246999999934, longitude: 116.573014},
261
+ {latitude: 40.03549599999993, longitude: 116.572139},
262
+ {latitude: 40.03899499999993, longitude: 116.56052000000001},
263
+ {latitude: 40.03923699999993, longitude: 116.55965100000002},
264
+ {latitude: 40.03944399999993, longitude: 116.55881800000002},
265
+ {latitude: 40.03956899999993, longitude: 116.55823800000002},
266
+ {latitude: 40.039724999999926, longitude: 116.55742000000002},
267
+ {latitude: 40.03982499999993, longitude: 116.55677400000002},
268
+ {latitude: 40.03987099999993, longitude: 116.55640800000002},
269
+ {latitude: 40.03995999999993, longitude: 116.55550300000002},
270
+ {latitude: 40.03999799999993, longitude: 116.55492500000001},
271
+ {latitude: 40.04002999999993, longitude: 116.55397200000002},
272
+ {latitude: 40.04003499999993, longitude: 116.55289900000001},
273
+ {latitude: 40.03996499999993, longitude: 116.54465},
274
+ {latitude: 40.03996499999993, longitude: 116.54465},
275
+ {latitude: 40.04000499999993, longitude: 116.544556},
276
+ {latitude: 40.040025999999926, longitude: 116.544433},
277
+ {latitude: 40.04009799999993, longitude: 116.542512},
278
+ {latitude: 40.04016099999993, longitude: 116.541757},
279
+ {latitude: 40.040254999999924, longitude: 116.540913},
280
+ {latitude: 40.04034599999992, longitude: 116.540214},
281
+ {latitude: 40.04043999999992, longitude: 116.53963800000001},
282
+ {latitude: 40.040612999999915, longitude: 116.538802},
283
+ {latitude: 40.040688999999915, longitude: 116.53849000000001},
284
+ {latitude: 40.040688999999915, longitude: 116.53849000000001},
285
+ {latitude: 40.04079999999991, longitude: 116.538148},
286
+ {latitude: 40.04090499999991, longitude: 116.537896},
287
+ {latitude: 40.04105399999991, longitude: 116.537605},
288
+ {latitude: 40.04124999999991, longitude: 116.537244},
289
+ {latitude: 40.04134099999991, longitude: 116.537115},
290
+ {latitude: 40.04162499999991, longitude: 116.536767},
291
+ {latitude: 40.04173399999991, longitude: 116.536645},
292
+ {latitude: 40.04191799999991, longitude: 116.536458},
293
+ {latitude: 40.04220299999991, longitude: 116.53621},
294
+ {latitude: 40.04275999999991, longitude: 116.535752},
295
+ {latitude: 40.04288699999991, longitude: 116.53563},
296
+ {latitude: 40.042994999999905, longitude: 116.535491},
297
+ {latitude: 40.0430829999999, longitude: 116.53533599999999},
298
+ {latitude: 40.043118999999905, longitude: 116.53525499999999},
299
+ {latitude: 40.04314899999991, longitude: 116.53517099999999},
300
+ {latitude: 40.04319099999991, longitude: 116.53499599999999},
301
+ {latitude: 40.04320799999991, longitude: 116.53481599999999},
302
+ {latitude: 40.043205999999905, longitude: 116.53472099999999},
303
+{latitude: 40.04319699999991, longitude: 116.53463199999999},
304
+{latitude: 40.043180999999905, longitude: 116.53453999999999},
305
+{latitude: 40.043157999999906, longitude: 116.534448},
306
+{latitude: 40.043126999999906, longitude: 116.534357},
307
+{latitude: 40.043087999999905, longitude: 116.534267},
308
+{latitude: 40.0430409999999, longitude: 116.534179},
309
+{latitude: 40.0429859999999, longitude: 116.534092},
310
+{latitude: 40.0429219999999, longitude: 116.534007},
311
+{latitude: 40.042849999999895, longitude: 116.533925},
312
+{latitude: 40.04273599999989, longitude: 116.533821},
313
+{latitude: 40.04261999999989, longitude: 116.533731},
314
+{latitude: 40.04244299999989, longitude: 116.533621},
315
+{latitude: 40.041467999999895, longitude: 116.53313},
316
+{latitude: 40.040935999999896, longitude: 116.532853},
317
+{latitude: 40.040659999999896, longitude: 116.53272700000001},
318
+{latitude: 40.039956999999895, longitude: 116.53237100000001},
319
+{latitude: 40.038965999999895, longitude: 116.53198300000001},
320
+{latitude: 40.038383999999894, longitude: 116.531766},
321
+{latitude: 40.03811199999989, longitude: 116.531615},
322
+{latitude: 40.03773599999989, longitude: 116.531394},
323
+{latitude: 40.037545999999885, longitude: 116.53127},
324
+{latitude: 40.037444999999884, longitude: 116.53130100000001},
325
+{latitude: 40.03645799999988, longitude: 116.53063100000001},
326
+{latitude: 40.03533899999988, longitude: 116.52989000000001},
327
+{latitude: 40.03422499999988, longitude: 116.52913400000001},
328
+{latitude: 40.03199399999988, longitude: 116.52764600000002},
329
+{latitude: 40.030958999999875, longitude: 116.52692600000002},
330
+{latitude: 40.03063899999987, longitude: 116.52668300000002},
331
+{latitude: 40.03011399999987, longitude: 116.52635500000002},
332
+{latitude: 40.02433899999987, longitude: 116.52245300000003},
333
+{latitude: 40.02418799999987, longitude: 116.52234300000002},
334
+{latitude: 40.02399599999987, longitude: 116.52218400000002},
335
+{latitude: 40.02379799999987, longitude: 116.52204200000003},
336
+{latitude: 40.02237499999987, longitude: 116.52113000000003},
337
+{latitude: 40.02040799999987, longitude: 116.51984900000002},
338
+{latitude: 40.01837199999987, longitude: 116.51845900000002},
339
+{latitude: 40.01647899999987, longitude: 116.51719100000003},
340
+{latitude: 40.01606999999987, longitude: 116.51690900000003},
341
+{latitude: 40.01564599999987, longitude: 116.51659500000002},
342
+{latitude: 40.01517599999987, longitude: 116.51621900000002},
343
+{latitude: 40.01478099999987, longitude: 116.51586900000002},
344
+{latitude: 40.01426899999987, longitude: 116.51535400000003},
345
+{latitude: 40.01340999999987, longitude: 116.51440600000004},
346
+{latitude: 40.01154399999987, longitude: 116.51230400000004},
347
+{latitude: 40.01034299999987, longitude: 116.51096700000004},
348
+{latitude: 40.01034299999987, longitude: 116.51096700000004},
349
+{latitude: 40.00995499999987, longitude: 116.51022100000003},
350
+{latitude: 40.00905499999987, longitude: 116.50924700000003},
351
+{latitude: 40.00905499999987, longitude: 116.50924700000003},
352
+{latitude: 40.00794499999987, longitude: 116.50797900000003},
353
+{latitude: 40.00766999999987, longitude: 116.50765500000003},
354
+{latitude: 40.00690199999987, longitude: 116.50668700000003},
355
+{latitude: 40.00555999999987, longitude: 116.50504000000002},
356
+{latitude: 40.00446999999987, longitude: 116.50365100000002},
357
+{latitude: 40.00331599999987, longitude: 116.50222500000002},
358
+{latitude: 40.00331599999987, longitude: 116.50222500000002},
359
+{latitude: 40.00265999999987, longitude: 116.50156400000003},
360
+{latitude: 40.00177199999987, longitude: 116.50073000000003},
361
+{latitude: 40.00152399999987, longitude: 116.50048500000003},
362
+{latitude: 40.00048899999987, longitude: 116.49933000000003},
363
+{latitude: 40.000128999999866, longitude: 116.49894400000002},
364
+{latitude: 39.99952899999987, longitude: 116.49839300000002},
365
+{latitude: 39.99842599999987, longitude: 116.49736500000002},
366
+{latitude: 39.99822799999987, longitude: 116.49716300000001},
367
+{latitude: 39.99746999999987, longitude: 116.49634000000002},
368
+{latitude: 39.997068999999875, longitude: 116.49596600000002},
369
+{latitude: 39.996646999999875, longitude: 116.49558800000003},
370
+{latitude: 39.99526999999988, longitude: 116.49428100000003},
371
+{latitude: 39.994735999999875, longitude: 116.49376000000002},
372
+{latitude: 39.99401099999987, longitude: 116.49311100000003},
373
+{latitude: 39.99401099999987, longitude: 116.49311100000003},
374
+{latitude: 39.99441699999987, longitude: 116.49270900000003},
375
+{latitude: 39.99450399999987, longitude: 116.49260200000003},
376
+{latitude: 39.994603999999875, longitude: 116.49246300000003},
377
+{latitude: 39.994896999999874, longitude: 116.49204300000002},
378
+{latitude: 39.994896999999874, longitude: 116.49204300000002},
379
+{latitude: 39.99499599999987, longitude: 116.49215300000003},
380
+{latitude: 39.99541599999987, longitude: 116.49258900000002},
381
+{latitude: 39.99560099999987, longitude: 116.49275400000002},
382
+{latitude: 39.99594699999987, longitude: 116.49302700000003},
383
+{latitude: 39.996198999999876, longitude: 116.49319000000003},
384
+{latitude: 39.996502999999876, longitude: 116.49335500000002},
385
+{latitude: 39.99674199999988, longitude: 116.49346200000002},
386
+{latitude: 39.996871999999875, longitude: 116.49351100000003},
387
+{latitude: 39.99726199999988, longitude: 116.49363600000002},
388
+{latitude: 39.99737399999988, longitude: 116.49366200000003},
389
+{latitude: 39.99774699999988, longitude: 116.49372100000002},
390
+{latitude: 39.997962999999885, longitude: 116.49373700000002},
391
+{latitude: 39.99817199999988, longitude: 116.49374100000003},
392
+{latitude: 39.99850799999988, longitude: 116.49372000000002},
393
+{latitude: 39.99871199999988, longitude: 116.49368900000002},
394
+{latitude: 39.99899199999987, longitude: 116.49362800000002},
395
+{latitude: 39.999291999999876, longitude: 116.49353500000001},
396
+{latitude: 39.99954999999988, longitude: 116.493441},
397
+{latitude: 39.99988499999988, longitude: 116.493296},
398
+{latitude: 40.00007899999988, longitude: 116.493198},
399
+{latitude: 40.00021999999988, longitude: 116.49310700000001},
400
+{latitude: 40.00064699999988, longitude: 116.49278400000001},
401
+{latitude: 40.00156599999988, longitude: 116.49188900000001}
402
+{latitude: 40.00156599999988, longitude: 116.49188900000001},
403
+{latitude: 40.001409999999886, longitude: 116.49162500000001},
404
+{latitude: 40.00064999999989, longitude: 116.49034800000001},
405
+{latitude: 40.00064999999989, longitude: 116.49034800000001},
406
+{latitude: 40.00096999999989, longitude: 116.49002300000001},
407
+{latitude: 40.001060999999886, longitude: 116.489917},
408
+{latitude: 40.001345999999884, longitude: 116.48955600000001},
409
+{latitude: 40.00197999999988, longitude: 116.48841},
410
+{latitude: 40.00197999999988, longitude: 116.48841},
411
+{latitude: 40.00204199999988, longitude: 116.488478},
412
+{latitude: 40.00212699999988, longitude: 116.488569},
413
+{latitude: 40.00222399999988, longitude: 116.488658},
414
+{latitude: 40.00222399999988, longitude: 116.488658},
415
+{latitude: 40.00232999999988, longitude: 116.488587},
416
+{latitude: 40.00243299999988, longitude: 116.48830699999999},
417
+{latitude: 40.00243299999988, longitude: 116.48830699999999},
418
+{latitude: 40.002656999999886, longitude: 116.48824099999999},
419
+{latitude: 40.002656999999886, longitude: 116.48824099999999},
420
+{latitude: 40.00278199999988, longitude: 116.48834199999999},
421
+{latitude: 40.00282799999988, longitude: 116.48838899999998},
422
+{latitude: 40.00291299999988, longitude: 116.48863999999999},
423
+{latitude: 40.00293499999988, longitude: 116.488677},
424
+{latitude: 40.00296499999988, longitude: 116.488703}
425
+]

Loading…
取消
儲存