ソースを参照

电速宝

master
dong 7ヶ月前
コミット
ec2931e27b
100個のファイルの変更5411行の追加4691行の削除
  1. 4
    4
      api/index.js
  2. 25
    10
      app.js
  3. 62
    22
      app.json
  4. 1122
    0
      libs/qqmap-wx-jssdk.js
  5. 1
    0
      libs/qqmap-wx-jssdk.min.js
  6. 597
    0
      package-map/pages/map/index.js
  7. 17
    0
      package-map/pages/map/index.json
  8. 127
    0
      package-map/pages/map/index.wxml
  9. 205
    0
      package-map/pages/map/index.wxss
  10. 25
    13
      package-order/pages/address/index.js
  11. 0
    0
      package-order/pages/address/index.json
  12. 12
    0
      package-order/pages/address/index.wxml
  13. 61
    0
      package-order/pages/address/index.wxss
  14. 262
    0
      package-order/pages/createorder/index.js
  15. 2
    2
      package-order/pages/createorder/index.json
  16. 127
    0
      package-order/pages/createorder/index.wxml
  17. 86
    0
      package-order/pages/createorder/index.wxss
  18. 90
    0
      package-order/pages/driver/index.js
  19. 0
    0
      package-order/pages/driver/index.json
  20. 12
    0
      package-order/pages/driver/index.wxml
  21. 59
    0
      package-order/pages/driver/index.wxss
  22. 3
    3
      package-setup/pages/setuplevel/index.js
  23. 0
    0
      package-setup/pages/setuplevel/index.json
  24. 0
    0
      package-setup/pages/setuplevel/index.wxml
  25. 5
    4
      package-setup/pages/setuplevel/index.wxss
  26. 178
    0
      package-user/components/captcha/index.js
  27. 4
    0
      package-user/components/captcha/index.json
  28. 63
    0
      package-user/components/captcha/index.wxml
  29. 185
    0
      package-user/components/captcha/index.wxss
  30. 101
    0
      package-user/components/slide-confirm/index.js
  31. 2
    1
      package-user/components/slide-confirm/index.json
  32. 26
    0
      package-user/components/slide-confirm/index.wxml
  33. 64
    0
      package-user/components/slide-confirm/index.wxss
  34. 178
    0
      package-user/pages/captcha/index.js
  35. 4
    0
      package-user/pages/captcha/index.json
  36. 63
    0
      package-user/pages/captcha/index.wxml
  37. 185
    0
      package-user/pages/captcha/index.wxss
  38. 10
    12
      package-user/pages/login/index.js
  39. 0
    0
      package-user/pages/login/index.json
  40. 24
    0
      package-user/pages/login/index.wxml
  41. 18
    13
      package-user/pages/login/index.wxss
  42. 0
    0
      package-user/pages/privacy/index.js
  43. 0
    0
      package-user/pages/privacy/index.json
  44. 0
    0
      package-user/pages/privacy/index.wxml
  45. 0
    0
      package-user/pages/privacy/index.wxss
  46. 105
    0
      package-user/pages/slide-confirm/index.js
  47. 4
    0
      package-user/pages/slide-confirm/index.json
  48. 27
    0
      package-user/pages/slide-confirm/index.wxml
  49. 64
    0
      package-user/pages/slide-confirm/index.wxss
  50. 30
    11
      package-user/pages/userlist/index.js
  51. 4
    0
      package-user/pages/userlist/index.json
  52. 12
    0
      package-user/pages/userlist/index.wxml
  53. 59
    0
      package-user/pages/userlist/index.wxss
  54. 0
    147
      pages/device/index.js
  55. 0
    39
      pages/device/index.wxml
  56. 0
    48
      pages/device/index.wxss
  57. 52
    0
      pages/equipment/index.js
  58. 16
    0
      pages/equipment/index.json
  59. 66
    0
      pages/equipment/index.wxml
  60. 157
    0
      pages/equipment/index.wxss
  61. 348
    212
      pages/index/index.js
  62. 6
    8
      pages/index/index.json
  63. 89
    103
      pages/index/index.wxml
  64. 152
    313
      pages/index/index.wxss
  65. 0
    66
      pages/login/index.wxml
  66. 0
    30
      pages/malfunction/index.wxml
  67. 0
    53
      pages/malfunction/index.wxss
  68. 0
    180
      pages/personalInfo/index.js
  69. 0
    45
      pages/personalInfo/index.wxml
  70. 0
    64
      pages/personalInfo/index.wxss
  71. 0
    288
      pages/scheduling/index.js
  72. 0
    9
      pages/scheduling/index.json
  73. 0
    50
      pages/scheduling/index.wxml
  74. 0
    187
      pages/scheduling/index.wxss
  75. 10
    6
      pages/setup/index.js
  76. 1
    1
      pages/setup/index.json
  77. 21
    13
      pages/setup/index.wxml
  78. 4
    4
      pages/setup/index.wxss
  79. 0
    164
      pages/statistics/index.js
  80. 0
    109
      pages/statistics/index.wxml
  81. 0
    93
      pages/statistics/index.wxss
  82. 48
    123
      pages/tool/index.js
  83. 2
    0
      pages/tool/index.json
  84. 49
    129
      pages/tool/index.wxml
  85. 75
    288
      pages/tool/index.wxss
  86. 0
    336
      pages/workorder/index.js
  87. 0
    9
      pages/workorder/index.json
  88. 0
    182
      pages/workorder/index.wxml
  89. 0
    160
      pages/workorder/index.wxss
  90. 0
    503
      pages/workorderdetails/index.js
  91. 0
    13
      pages/workorderdetails/index.json
  92. 0
    174
      pages/workorderdetails/index.wxml
  93. 0
    285
      pages/workorderdetails/index.wxss
  94. 0
    8
      pages/workorderstep/index.json
  95. 0
    51
      pages/workorderstep/index.wxml
  96. 0
    95
      pages/workorderstep/index.wxss
  97. 1
    8
      project.private.config.json
  98. バイナリ
      static/1.png
  99. バイナリ
      static/11.png
  100. 0
    0
      static/111.png

+ 4
- 4
api/index.js ファイルの表示

@@ -1,7 +1,7 @@
1 1
 // api.jshttp://zlink.bjdexn.cn
2
-// const baseUrl = 'http://192.168.8.187:9999';  // 替换为您的接口基础 URL
2
+const baseUrl = 'http://192.168.8.187:8080';  // 替换为您的接口基础 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:8443';  // 线上
5 5
 
6 6
 // const baseUrl = 'http://192.168.8.105:8888';  // 替换为您的接口基础 URL
7 7
 //  
@@ -67,9 +67,9 @@ function redirectToLogin(message = '') {
67 67
   const currentRoute = pages[pages.length - 1]?.route || '';
68 68
 
69 69
   // 避免重复跳转
70
-  if (!currentRoute.includes('pages/login/index')) {
70
+  if (!currentRoute.includes('/package-user/pages/login/index')) {
71 71
     wx.showToast({ title: message, icon: 'none' });
72
-    wx.reLaunch({ url: '/pages/login/index' });
72
+    wx.reLaunch({ url: '/package-user/pages/login/index' });
73 73
   }
74 74
 }
75 75
 

+ 25
- 10
app.js ファイルの表示

@@ -1,20 +1,35 @@
1 1
 // app.js
2
+const QQMapWX = require('./libs/qqmap-wx-jssdk.min.js');
3
+
2 4
 App({
3 5
   onLaunch() {
4
-    // 展示本地存储能力
5
-    const logs = wx.getStorageSync('logs') || []
6
-    logs.unshift(Date.now())
7
-    wx.setStorageSync('logs', logs)
6
+    // 初始化腾讯地图SDK
7
+    this.qqmapsdk = new QQMapWX({
8
+      key: 'VRGBZ-ZFRHB-SKIUP-NHHJ3-TXGJT-ZIFG3' // 请替换为你自己的腾讯地图KEY
9
+    });
8 10
 
9
-    // 登录
10
-    wx.login({
11
+    // 检查是否授权获取位置信息
12
+    wx.getSetting({
11 13
       success: res => {
12
-        // 发送 res.code 到后台换取 openId, sessionKey, unionId
14
+        if (!res.authSetting['scope.userLocation']) {
15
+          wx.authorize({
16
+            scope: 'scope.userLocation',
17
+            success: () => {
18
+              console.log('位置授权成功');
19
+            },
20
+            fail: () => {
21
+              console.log('位置授权失败');
22
+              wx.showToast({
23
+                title: '请开启位置权限',
24
+                icon: 'none'
25
+              });
26
+            }
27
+          });
28
+        }
13 29
       }
14
-    })
15
- 
30
+    });
16 31
   },
17 32
   globalData: {
18 33
     userInfo: null
19 34
   }
20
-})
35
+});

+ 62
- 22
app.json ファイルの表示

@@ -3,24 +3,16 @@
3 3
     "pages/index/index",
4 4
     "pages/setup/index",
5 5
     "pages/tool/index",
6
-    "pages/login/index",
7
-    "pages/malfunction/index",
8
-    "pages/workorder/index",
9
-    "pages/workorderdetails/index",
10
-    "pages/workorderstep/index",
11
-    "pages/statistics/index",
12
-    "pages/device/index",
13
-    "pages/personalInfo/index",
14
-    "pages/setuplevel/index",
15
-    "pages/scheduling/index",
16
-    "pages/privacy/index"
6
+    "pages/equipment/index"
17 7
   ],
18 8
   "requiredPrivateInfos": [
19
-    "getLocation"
9
+    "getLocation",
10
+    "startLocationUpdate",
11
+    "startLocationUpdateBackground"
20 12
   ],
21 13
   "permission": {
22 14
     "scope.userLocation": {
23
-      "desc": "请允许获取位置信息,以便计算距离"
15
+      "desc": "你的位置信息将用于展示轨迹和计算距离"
24 16
     },
25 17
     "scope.setClipboardData": {
26 18
       "desc": "用于复制内容到剪贴板,方便用户分享或使用"
@@ -34,31 +26,79 @@
34 26
     "navigationBarTitleText": "晟运能源",
35 27
     "navigationBarBackgroundColor": "#ffffff"
36 28
   },
29
+  "plugins": {
30
+    "route-plan": {
31
+      "version": "2.0.1",
32
+      "provider": "wx50b5593e81dd937a"
33
+    }
34
+  },
37 35
   "componentFramework": "glass-easel",
38 36
   "sitemapLocation": "sitemap.json",
39 37
   "lazyCodeLoading": "requiredComponents",
40 38
   "__usePrivacyCheck__": true,
41 39
   "tabBar": {
42
-    "selectedColor": "#0F80DC",
40
+    "selectedColor": "#00C775",
43 41
     "list": [
44 42
       {
45 43
         "pagePath": "pages/index/index",
46 44
         "text": "首页",
47
-        "iconPath": "static/sz3.png",
48
-        "selectedIconPath": "static/sz4.png"
45
+        "iconPath": "static/111.png",
46
+        "selectedIconPath": "static/222.png"
49 47
       },
50 48
       {
51 49
         "pagePath": "pages/tool/index",
52
-        "text": "工单",
53
-        "iconPath": "static/tool.png",
54
-        "selectedIconPath": "static/tool1.png"
50
+        "text": "订单",
51
+        "iconPath": "static/55.png",
52
+        "selectedIconPath": "static/66.png"
53
+      },
54
+      {
55
+        "pagePath": "pages/equipment/index",
56
+        "text": "设备",
57
+        "iconPath": "static/3.png",
58
+        "selectedIconPath": "static/4.png"
55 59
       },
56 60
       {
57 61
         "pagePath": "pages/setup/index",
58 62
         "text": "我的",
59
-        "iconPath": "static/user1.png",
60
-        "selectedIconPath": "static/user2.png"
63
+        "iconPath": "static/7.png",
64
+        "selectedIconPath": "static/8.png"
61 65
       }
62 66
     ]
63
-  }
67
+  },
68
+  "subpackages": [
69
+    {
70
+      "root": "package-user",
71
+      "name": "user",
72
+      "pages": [
73
+        "pages/login/index",
74
+        "pages/privacy/index",
75
+        "pages/userlist/index",
76
+        "pages/captcha/index",
77
+        "pages/slide-confirm/index"
78
+      ]
79
+    },
80
+    {
81
+      "root": "package-order",
82
+      "name": "order",
83
+      "pages": [
84
+        "pages/createorder/index",
85
+        "pages/driver/index",
86
+        "pages/address/index"
87
+      ]
88
+    },
89
+    {
90
+      "root": "package-setup",
91
+      "name": "setup",
92
+      "pages": [
93
+        "pages/setuplevel/index"
94
+      ]
95
+    },
96
+    {
97
+      "root": "package-map",
98
+      "name": "map",
99
+      "pages": [
100
+        "pages/map/index"
101
+      ]
102
+    }
103
+  ]
64 104
 }

+ 1122
- 0
libs/qqmap-wx-jssdk.js
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 1
- 0
libs/qqmap-wx-jssdk.min.js
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 597
- 0
package-map/pages/map/index.js ファイルの表示

@@ -0,0 +1,597 @@
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
+  },
61
+  
62
+  onLoad(options) {
63
+    this.setData({
64
+      userdata:wx.getStorageSync('user')
65
+    })
66
+   
67
+    console.log(options);
68
+    this.setData({
69
+      optionsid:options.id
70
+    })
71
+    // 初始化地图,获取当前位置
72
+    this.getworkorder()
73
+    // 引入SDK核心类
74
+    this.qqmapsdk = require('../../../libs/qqmap-wx-jssdk.min.js');
75
+    // 初始化SDK
76
+    this.mapSdk = new this.qqmapsdk({
77
+      key: this.data.qqMapKey
78
+    });
79
+  },
80
+  
81
+  getworkorder(){
82
+    let data = {
83
+      workorderId:this.data.optionsid
84
+    }
85
+    api.request(`/sysworkorder/selectworkorderId`, 'post',data,{ isPublic: false })
86
+    .then((data) => {
87
+      console.log(data.data);
88
+      if (data.code==200) {
89
+        this.setData({
90
+          orderdata:data.data
91
+        })
92
+        this.initMap();
93
+      }
94
+    })
95
+    .catch((err) => {
96
+      console.error('请求失败:', err);
97
+    });
98
+  },
99
+  
100
+  onUnload() {
101
+    // 页面卸载时停止追踪
102
+    this.stopTracking();
103
+  },
104
+  
105
+  // 初始化地图
106
+  initMap() {
107
+    const that = this;
108
+    
109
+    // 获取用户当前位置
110
+    wx.getLocation({
111
+      type: 'gcj02', // 腾讯地图坐标体系
112
+      success(res) {
113
+        const longitude = res.longitude;
114
+        const latitude = res.latitude;
115
+        
116
+        // 设置地图中心为当前位置
117
+        that.setData({
118
+          longitude,
119
+          latitude,
120
+          // 初始化起点标记
121
+          markers: [{
122
+            id: 0,
123
+            longitude,
124
+            latitude,
125
+            iconPath: "https://esos-iot.bjdexn.cn/myminio/project/0b0593293af54ea097b168cea479c25c.png",
126
+            width: 30,
127
+            height: 30,
128
+            title: "起点"
129
+          }],
130
+          // 初始化轨迹线起点(颜色已在data中设置为红色)
131
+          polyline: [{
132
+            points: [{longitude, latitude}],
133
+            color: "#ff0000", // 与data中保持一致,确保初始颜色正确
134
+            width: 6,
135
+            dottedLine: false
136
+          }]
137
+        });
138
+        
139
+        that.showInfo("已获取当前位置");
140
+        that.setDestination();
141
+      },
142
+      fail(err) {
143
+        console.error("获取位置失败:", err);
144
+        that.showInfo("请授权位置权限以使用地图功能");
145
+        
146
+        // 引导用户开启权限
147
+        wx.openSetting({
148
+          success(res) {
149
+            if (res.authSetting['scope.userLocation']) {
150
+              that.initMap();
151
+            }
152
+          }
153
+        });
154
+      }
155
+    });
156
+  },
157
+  
158
+  // 规划路线 - 通用方法,可被初始规划和重新规划调用
159
+  planRoute(isReplan = false) {
160
+    const that = this;
161
+    const { longitude, latitude, destination } = this.data;
162
+    
163
+    if (!destination) {
164
+      this.showInfo("请先设置终点");
165
+      return;
166
+    }
167
+    
168
+    // 如果是重新规划,更新状态
169
+    if (isReplan) {
170
+      this.setData({ isReplanning: true });
171
+      this.showInfo("正在重新规划路线...");
172
+    } else {
173
+      this.showInfo("正在规划路线...");
174
+    }
175
+    
176
+    // 调用腾讯地图路线规划API
177
+    this.mapSdk.direction({
178
+      mode: 'driving', // 驾车模式,可选值:'driving', 'walking', 'transit'
179
+      policy:'REAL_TRAFFIC',
180
+      from: {
181
+        latitude: latitude,
182
+        longitude: longitude
183
+      },
184
+      to: {
185
+        latitude: destination.latitude,
186
+        longitude: destination.longitude
187
+      },
188
+      success(res) {
189
+        console.log("路线规划结果:", res);
190
+        
191
+        if (res.status === 0 && res.result.routes.length > 0) {
192
+          var result = res.result
193
+          var route = result.routes[0]
194
+          // 提取路线点
195
+          var coors = route.polyline, pl = [];
196
+          //坐标解压(返回的点串坐标,通过前向差分进行压缩)
197
+          var kr = 1000000;
198
+          for (var i = 2; i < coors.length; i++) {
199
+            coors[i] = Number(coors[i - 2]) + Number(coors[i]) / kr;
200
+          }
201
+          //将解压后的坐标放入点串数组pl中
202
+          for (var i = 0; i < coors.length; i += 2) {
203
+            pl.push({ latitude: coors[i], longitude: coors[i + 1] })
204
+          }
205
+          
206
+          // 更新路线数据(规划路线颜色已设为灰色)
207
+          that.setData({
208
+            plannedRoute: [{
209
+              name: that.data.orderdata.addressName,
210
+              points: pl,
211
+              color: '#2f693c', // 与data中保持一致,确保规划路线颜色正确
212
+              width: 6,
213
+              borderColor: '#2f693c',
214
+              borderWidth: 1
215
+            }],
216
+            routePlanned: true,
217
+            isReplanning: false,
218
+            deviationCount: 0  // 重置偏离计数
219
+          });
220
+          
221
+          // 显示规划结果
222
+          const message = isReplan 
223
+            ? `已重新规划路线,距离${(result.routes[0].distance/1000).toFixed(1)}公里,约${Math.ceil(result.routes[0].duration)}分钟`
224
+            : `路线规划完成,距离${(result.routes[0].distance/1000).toFixed(1)}公里,约${Math.ceil(result.routes[0].duration)}分钟`;
225
+            
226
+          that.showInfo(message);
227
+
228
+        } else {
229
+          that.setData({ isReplanning: false });
230
+          that.showInfo("路线规划失败,请重试");
231
+        }
232
+      },
233
+      fail(err) {
234
+        console.error("路线规划失败:", err);
235
+        that.setData({ isReplanning: false });
236
+        that.showInfo("路线规划失败,请检查网络");
237
+      }
238
+    });
239
+  },
240
+  
241
+  // 设置终点位置
242
+  setDestination() {
243
+    // 更新终点标记
244
+    const newMarkers = [...this.data.markers.filter(marker => marker.id !== 1)];
245
+    newMarkers.push({
246
+      name: this.data.orderdata.addressName,
247
+      id: 1,
248
+      latitude: this.data.orderdata.latitude,  // 终点纬度
249
+      longitude: this.data.orderdata.longitude,  // 终点经度
250
+      iconPath: "https://esos-iot.bjdexn.cn/myminio/project/6dc37b15321b462f9ab59c47263dd224.png",
251
+      width: 30,
252
+      height: 30,
253
+      title: "终点"
254
+    });
255
+    
256
+    this.setData({
257
+      markers: newMarkers,
258
+      destination: { longitude: this.data.orderdata.longitude, latitude: this.data.orderdata.latitude }
259
+    });
260
+    
261
+    this.showInfo("已设置终点位置");
262
+    this.planRoute();  // 初始规划路线
263
+    // this.startTracking();  // 实时监控位置
264
+  },
265
+ 
266
+  // 显示信息提示
267
+  showInfo(text) {
268
+    this.setData({ infoText: text });
269
+    
270
+    // 3秒后自动隐藏非状态类信息
271
+    if (!text.includes("正在") && !text.includes("距离") && !text.includes("偏离")) {
272
+      setTimeout(() => {
273
+        this.setData({ infoText: "" });
274
+      }, 3000);
275
+    }
276
+  },
277
+  
278
+  // 导航功能
279
+  navigation(){
280
+    // 使用在腾讯位置服务申请的key
281
+    const key = this.data.qqMapKey;
282
+    // 调用插件的app的名称
283
+    const referer = '晟运智慧运维';
284
+    // 是否启用智能规划
285
+    const enableAI = true;
286
+    // 是否开启导航功能
287
+    const navigation = 1;
288
+    // 终点(建议替换为orderdata中的实际终点,当前为示例值)
289
+    const endPoint = JSON.stringify({
290
+      name: this.data.orderdata.addressName || '目的地',
291
+      latitude: this.data.orderdata.latitude,
292
+      longitude: this.data.orderdata.longitude,
293
+    });
294
+    // 个性化图层
295
+    const layerStyle = 1;
296
+    wx.navigateTo({
297
+      url: `plugin://route-plan/index?key=${key}&referer=${referer}&endPoint=${endPoint}&enableAI=${enableAI}&navigation=${navigation}&layerStyle=${layerStyle}`,
298
+    });
299
+  },
300
+  
301
+  // 开始追踪位置
302
+  startTracking() {
303
+    if (this.data.isTracking) return;
304
+    
305
+    const that = this;
306
+    this.setData({ isTracking: true });
307
+    
308
+    // 定期获取位置并检查是否偏离路线
309
+    this.setData({
310
+      locationTimer: setInterval(() => {
311
+        wx.getLocation({
312
+          type: 'gcj02',
313
+          success(res) {
314
+            const newPoint = {
315
+              longitude: res.longitude,
316
+              latitude: res.latitude
317
+            };
318
+            
319
+            // 更新当前位置和轨迹(颜色保持红色)
320
+            const updatedPolyline = [...that.data.polyline];
321
+            updatedPolyline[0].points.push(newPoint);
322
+            
323
+            // 更新起点标记位置
324
+            const updatedMarkers = [...that.data.markers];
325
+            updatedMarkers[0] = {
326
+              ...updatedMarkers[0],
327
+              longitude: res.longitude,
328
+              latitude: res.latitude
329
+            };
330
+            
331
+            that.setData({
332
+              longitude: res.longitude,
333
+              latitude: res.latitude,
334
+              polyline: updatedPolyline,
335
+              markers: updatedMarkers
336
+            });
337
+            
338
+            // 检查是否偏离规划路线
339
+            if (that.data.routePlanned && !that.data.isReplanning) {
340
+              that.checkDeviation(newPoint);
341
+            }
342
+          },
343
+          fail(err) {
344
+            console.error("获取位置失败:", err);
345
+            that.showInfo("位置获取失败,请检查权限");
346
+          }
347
+        });
348
+      }, 3000)  // 每3秒更新一次位置
349
+    });
350
+    
351
+    this.showInfo("开始追踪位置");
352
+  },
353
+  
354
+  // 停止追踪
355
+  stopTracking() {
356
+    if (this.data.locationTimer) {
357
+      clearInterval(this.data.locationTimer);
358
+      this.setData({ 
359
+        locationTimer: null,
360
+        isTracking: false 
361
+      });
362
+      this.showInfo("已停止追踪");
363
+    }
364
+  },
365
+  
366
+  // 检查是否偏离路线
367
+  checkDeviation(currentPoint) {
368
+    const { plannedRoute, deviationThreshold, deviationCount, replanThreshold } = this.data;
369
+    const routePoints = plannedRoute[0].points;
370
+    
371
+    if (!routePoints || routePoints.length < 2) return;
372
+    
373
+    // 计算当前位置到路线的最短距离
374
+    let minDistance = Infinity;
375
+    
376
+    // 检查当前点到路线上每一段线段的距离
377
+    for (let i = 0; i < routePoints.length - 1; i++) {
378
+      const distance = this.calculateDistanceToLine(
379
+        currentPoint,
380
+        routePoints[i],
381
+        routePoints[i + 1]
382
+      );
383
+      
384
+      if (distance < minDistance) {
385
+        minDistance = distance;
386
+      }
387
+    }
388
+    
389
+    // 判断是否偏离
390
+    const isDeviated = minDistance > deviationThreshold;
391
+    
392
+    if (isDeviated) {
393
+      // 增加连续偏离计数
394
+      const newDeviationCount = deviationCount + 1;
395
+      this.setData({ 
396
+        isDeviated,
397
+        deviationCount: newDeviationCount
398
+      });
399
+      
400
+      // 显示偏离信息
401
+      this.showInfo(`已偏离路线 ${minDistance.toFixed(1)} 米,连续偏离 ${newDeviationCount}/${replanThreshold} 次`);
402
+      
403
+      // 播放提示音
404
+      wx.playBackgroundAudio({
405
+        dataUrl: 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb.mp3?guid=ffffffff82def4af4b12b3cd9337d38&uin=346897220&vkey=6292F51C65348166B851686B2C059D76205E4241C44E5823713D649EF6471BA681DC27D5269A1E&fromtag=46',
406
+        title: '偏离提醒',
407
+        coverImgUrl: ''
408
+      });
409
+      
410
+      // 达到重新规划阈值,且不在重新规划中
411
+      if (newDeviationCount >= replanThreshold && !this.data.isReplanning) {
412
+        this.planRoute(true);  // 重新规划路线,传入true标识
413
+      }
414
+    } else {
415
+      // 回到路线上,重置偏离计数
416
+      this.setData({ 
417
+        isDeviated,
418
+        deviationCount: 0
419
+      });
420
+      
421
+      if (this.data.isDeviated) {
422
+        this.showInfo("已回到规划路线");
423
+      }
424
+    }
425
+  },
426
+  
427
+  // 计算点到线段的距离(米)
428
+  calculateDistanceToLine(point, lineStart, lineEnd) {
429
+    // 经纬度转弧度
430
+    const toRadians = (degree) => degree * Math.PI / 180;
431
+    
432
+    // 地球半径(米)
433
+    const R = 6371000;
434
+    
435
+    // 转换为弧度
436
+    const lat1 = toRadians(point.latitude);
437
+    const lon1 = toRadians(point.longitude);
438
+    const lat2 = toRadians(lineStart.latitude);
439
+    const lon2 = toRadians(lineStart.longitude);
440
+    const lat3 = toRadians(lineEnd.latitude);
441
+    const lon3 = toRadians(lineEnd.longitude);
442
+    
443
+    // 计算线段长度
444
+    const a = this.haversineDistance(lat1, lon1, lat2, lon2);
445
+    const b = this.haversineDistance(lat1, lon1, lat3, lon3);
446
+    const c = this.haversineDistance(lat2, lon2, lat3, lon3);
447
+    
448
+    // 如果点在线段延长线上,返回最近端点的距离
449
+    if (b * b >= a * a + c * c) {
450
+      return a;
451
+    }
452
+    if (a * a >= b * b + c * c) {
453
+      return b;
454
+    }
455
+    
456
+    // 计算点到线段的垂直距离
457
+    const s = (a + b + c) / 2;
458
+    const area = Math.sqrt(Math.abs(s * (s - a) * (s - b) * (s - c)));
459
+    return (2 * area) / c;
460
+  },
461
+  
462
+  // 使用haversine公式计算两点间距离(米)
463
+  haversineDistance(lat1, lon1, lat2, lon2) {
464
+    const R = 6371000; // 地球半径(米)
465
+    const dLat = lat2 - lat1;
466
+    const dLon = lon2 - lon1;
467
+    
468
+    const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +
469
+              Math.cos(lat1) * Math.cos(lat2) *
470
+              Math.sin(dLon / 2) * Math.sin(dLon / 2);
471
+    const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
472
+    
473
+    return R * c;
474
+  },
475
+  
476
+    // 显示验证码弹窗
477
+    showVerificationPopup() {
478
+      this.setData({ showVerification: true });
479
+    },
480
+    
481
+    // 关闭弹窗
482
+    onPopupClose() {
483
+      this.setData({ showVerification: false });
484
+      setTimeout(() => {
485
+        const slideComponent = this.selectComponent("#mySlideConfirm");
486
+        // 2. 调用组件的reset方法
487
+        slideComponent.reset();
488
+      }, 1000);
489
+    },
490
+    
491
+    // 确认验证码
492
+    onCodeConfirm(e) {
493
+      console.log("确认验证码:", e.detail.code);
494
+      // 验证逻辑...
495
+      this.setData({ showVerification: false });
496
+    },
497
+    
498
+    // 重新发送验证码
499
+    onResendCode() {
500
+      console.log("重新发送验证码");
501
+      // 重新发送逻辑...
502
+    },
503
+    
504
+    // 验证码输入完成
505
+    onCodeComplete(e) {
506
+      console.log("验证码输入完成:", e.detail.code);
507
+      // 自动验证逻辑...
508
+      let data = {
509
+        carId:this.data.optionsid,
510
+        verifyCode: e.detail.code,
511
+        workorderId:this.data.orderdata.workorderId
512
+      }
513
+      api.request(`/sysworkorder/submitworkorder`, 'post',data,{ isPublic: false })
514
+      .then((data) => {
515
+        console.log(data.data);
516
+        if (data.code==200) {
517
+          this.getworkorder();
518
+          setTimeout(() => {
519
+            const slideComponent = this.selectComponent("#mySlideConfirm");
520
+            // 2. 调用组件的reset方法
521
+            slideComponent.reset();
522
+          }, 5000);
523
+      
524
+        }
525
+      })
526
+      .catch((err) => {
527
+        setTimeout(() => {
528
+          const slideComponent = this.selectComponent("#mySlideConfirm");
529
+          // 2. 调用组件的reset方法
530
+          slideComponent.reset();
531
+        }, 5000);
532
+        console.error('请求失败:', err);
533
+      });
534
+    },
535
+    onSlideSuccess(e){
536
+      console.log(e.currentTarget.dataset.type);
537
+     
538
+      // 3. 更新页面状态,隐藏按钮和提示
539
+      let data = {
540
+        carId:this.data.optionsid,
541
+        verifyCode:'MNBJ4H',
542
+        workorderId:this.data.orderdata.workorderId
543
+      }
544
+      api.request(`/sysworkorder/submitworkorder`, 'post',data,{ isPublic: false })
545
+      .then((data) => {
546
+        console.log(data.data);
547
+        if (data.code==200) {
548
+           if (e.currentTarget.dataset.type==2) {
549
+        let objdata ={
550
+          workorderId:this.data.orderdata.workorderId
551
+        }
552
+         api.request(`/sysworkorder/createverify`, 'post',objdata,{ isPublic: false })
553
+      .then((data) => {
554
+        console.log(data.data);
555
+        if (data.code==200) {
556
+        
557
+        }
558
+      })
559
+      .catch((err) => {
560
+      
561
+        console.error('请求失败:', err);
562
+      });
563
+      }
564
+          this.getworkorder();
565
+          setTimeout(() => {
566
+            const slideComponent = this.selectComponent("#mySlideConfirm");
567
+            // 2. 调用组件的reset方法
568
+            slideComponent.reset();
569
+          }, 5000);
570
+      
571
+        }
572
+      })
573
+      .catch((err) => {
574
+        setTimeout(() => {
575
+          const slideComponent = this.selectComponent("#mySlideConfirm");
576
+          // 2. 调用组件的reset方法
577
+          slideComponent.reset();
578
+        }, 5000);
579
+        console.error('请求失败:', err);
580
+      });
581
+    },
582
+    ontelephone(e){
583
+      console.log(e.currentTarget.dataset.phone);
584
+        const phoneNumber = e.currentTarget.dataset.phone;
585
+        wx.showModal({
586
+          title: '确认拨打电话',
587
+          content: '是否拨打' + phoneNumber + '?',
588
+          success: (res) => {
589
+            if (res.confirm) {
590
+              wx.makePhoneCall({
591
+                phoneNumber: phoneNumber
592
+              });
593
+            }
594
+          }
595
+        });
596
+    }
597
+});

+ 17
- 0
package-map/pages/map/index.json ファイルの表示

@@ -0,0 +1,17 @@
1
+{
2
+  "navigationBarTitleText": "晟能能源",
3
+  "permission": {
4
+    "scope.userLocation": {
5
+      "desc": "你的位置信息将用于展示行驶轨迹"
6
+    }
7
+  },
8
+  "usingComponents": {
9
+    "t-icon": "tdesign-miniprogram/icon/icon",
10
+    "verification-popup": "/package-user/components/captcha",
11
+    "slide-confirm": "/package-user/components/slide-confirm"
12
+  },
13
+  "componentPlaceholder": {
14
+    "verification-popup": "view",  
15
+    "slide-confirm": "view"  
16
+  }
17
+}

+ 127
- 0
package-map/pages/map/index.wxml ファイルの表示

@@ -0,0 +1,127 @@
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
+    bindcontroltap="controltap"
21
+    show-location
22
+    scale="16"
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="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
+  
117
+  </view>
118
+</view>
119
+<verification-popup 
120
+  isShow="{{showVerification}}"
121
+  phoneNumber="{{phoneNumber}}"
122
+  countdownSeconds="60"
123
+  bind:close="onPopupClose"
124
+  bind:confirm="onCodeConfirm"
125
+  bind:resend="onResendCode"
126
+  bind:complete="onCodeComplete"
127
+/>

+ 205
- 0
package-map/pages/map/index.wxss ファイルの表示

@@ -0,0 +1,205 @@
1
+.container {
2
+  position: absolute;
3
+  top: 0;
4
+  left: 0;
5
+  right: 0;
6
+  bottom: 0;
7
+  display: flex;
8
+  flex-direction: column;
9
+  background-color: #f9f9f9;
10
+}
11
+
12
+.map {
13
+  
14
+  width: 100%;
15
+  height: 70%;
16
+}
17
+
18
+.control-panel {
19
+  position: fixed;
20
+  bottom: 60rpx;
21
+  left: 0;
22
+  right: 0;
23
+  display: flex;
24
+  justify-content: center;
25
+  padding: 0 20rpx;
26
+}
27
+
28
+.btn {
29
+  width: 80%;
30
+  height: 80rpx;
31
+  line-height: 80rpx;
32
+  text-align: center;
33
+  color: white;
34
+  border-radius: 40rpx;
35
+  font-size: 30rpx;
36
+}
37
+
38
+.info {
39
+  position: fixed;
40
+  top: 30rpx;
41
+  left: 50%;
42
+  transform: translateX(-50%);
43
+  background-color: rgba(0, 0, 0, 0.7);
44
+  color: white;
45
+  padding: 15rpx 30rpx;
46
+  border-radius: 10rpx;
47
+  font-size: 28rpx;
48
+  z-index: 100;
49
+}
50
+
51
+/* 加载提示 */
52
+.loading-mask {
53
+  position: fixed;
54
+  top: 0;
55
+  left: 0;
56
+  right: 0;
57
+  bottom: 0;
58
+  background-color: rgba(0, 0, 0, 0.3);
59
+  display: flex;
60
+  justify-content: center;
61
+  align-items: center;
62
+  z-index: 100;
63
+}
64
+
65
+.loading-view {
66
+  background-color: white;
67
+  padding: 30rpx 60rpx;
68
+  border-radius: 10rpx;
69
+}
70
+
71
+/* 错误提示 */
72
+.error-message {
73
+  position: fixed;
74
+  top: 50%;
75
+  left: 50%;
76
+  transform: translate(-50%, -50%);
77
+  background-color: rgba(0, 0, 0, 0.7);
78
+  color: white;
79
+  padding: 20rpx 40rpx;
80
+  border-radius: 8rpx;
81
+  font-size: 28rpx;
82
+  z-index: 99;
83
+}
84
+
85
+/* 路线列表容器 */
86
+.routes-container {
87
+  /* background-color: white; */
88
+  padding: 20rpx;
89
+  /* border-top: 1px solid #eee; */
90
+  max-height: 50vh;
91
+  overflow-y: auto;
92
+}
93
+
94
+/* 目的地标题 */
95
+.destination-title {
96
+  font-size: 32rpx;
97
+  color: #333;
98
+  padding-bottom: 10rpx;
99
+  /* border-bottom: 1px solid #f0f0f0; */
100
+}
101
+.destination-font {
102
+  font-size: 28rpx;
103
+  width: 100%;
104
+  display: flex;
105
+  align-items: center;
106
+  justify-content: space-between;
107
+  color: #333;
108
+  margin-top: 20rpx;
109
+  /* border-bottom: 1px solid #f0f0f0; */
110
+}
111
+.route{
112
+  width: 100%;
113
+  display: flex;
114
+}
115
+/* 路线列表 */
116
+.routes-list {
117
+  display: flex;
118
+  flex-direction: column;
119
+  gap: 15rpx;
120
+}
121
+
122
+/* 路线项 */
123
+.route-item {
124
+  padding: 15rpx;
125
+  border-radius: 8rpx;
126
+  background-color: #f9f9f9;
127
+  border: 1px solid #eee;
128
+}
129
+
130
+.route-item.active {
131
+  background-color: #e8f4ff;
132
+  border-color: #007aff;
133
+}
134
+
135
+/* 路线头部 */
136
+.route-header {
137
+  display: flex;
138
+  justify-content: space-between;
139
+  margin-bottom: 10rpx;
140
+}
141
+
142
+.route-number {
143
+  font-size: 28rpx;
144
+  font-weight: 500;
145
+  color: #333;
146
+}
147
+
148
+.route-policy {
149
+  font-size: 24rpx;
150
+  color: #666;
151
+  background-color: #f0f0f0;
152
+  padding: 2rpx 10rpx;
153
+  border-radius: 12rpx;
154
+}
155
+
156
+.route-item.active .route-policy {
157
+  background-color: #007aff;
158
+  color: white;
159
+}
160
+
161
+/* 路线详情 */
162
+.route-details {
163
+  display: flex;
164
+  justify-content: space-between;
165
+  align-items: center;
166
+}
167
+
168
+.detail-item {
169
+  display: flex;
170
+  align-items: center;
171
+  margin-right: 20rpx;
172
+}
173
+
174
+.detail-text {
175
+  font-size: 26rpx;
176
+  color: #333;
177
+  margin-left: 8rpx;
178
+}
179
+
180
+/* 路况信息 */
181
+.traffic-info {
182
+  margin-top: 10rpx;
183
+}
184
+
185
+.traffic-text {
186
+  font-size: 24rpx;
187
+  color: #ff6b00;
188
+}
189
+.storagecartext{
190
+  width:100%;
191
+display: flex;
192
+justify-content: space-between;
193
+/* justify-content:space-around; */
194
+align-items: center;
195
+padding-left:20rpx;
196
+box-sizing: border-box;
197
+margin-top: 20rpx;
198
+    }
199
+.storagecar{
200
+  width: 260rpx;
201
+  height: 180rpx;
202
+}
203
+.viewmore{
204
+  margin-top: 20rpx;
205
+}

pages/workorderstep/index.js → package-order/pages/address/index.js ファイルの表示

@@ -1,29 +1,41 @@
1
-// pages/workorderstep/index.js
1
+// pages/address/index.js
2
+const api = require('../../../api/index.js');
3
+
2 4
 Page({
3 5
 
4 6
   /**
5 7
    * 页面的初始数据
6 8
    */
7 9
   data: {
8
-    first: 1,
9
-    second: 1,
10
-    third: 1,
10
+    address:[]
11 11
   },
12 12
 
13 13
   /**
14 14
    * 生命周期函数--监听页面加载
15 15
    */
16 16
   onLoad(options) {
17
-   
18
-  },
19
-  onFirstChange(e) {
20
-    this.setData({ first: e.detail.current });
17
+ this.getaddress()
21 18
   },
22
-  onSecondChange(e) {
23
-    this.setData({ second: e.detail.current });
24
-  },
25
-  onThirdChange(e) {
26
-    this.setData({ third: e.detail.current });
19
+  getaddress(){
20
+    let data ={
21
+      operationId:''
22
+    }
23
+    api.request(`/sysaddress/selectaddress`, 'post',data,{ isPublic: false })
24
+    .then((data) => {
25
+  console.log(data.data);
26
+  if (data.code==200) {
27
+    this.setData({
28
+      address:data.data
29
+    })
30
+  }
31
+  //  wx.navigateTo({
32
+  //   url: '/pages/map/index',
33
+  // })
34
+    })
35
+    .catch((err) => {
36
+   
37
+      console.error('请求失败:', err);
38
+    });
27 39
   },
28 40
   /**
29 41
    * 生命周期函数--监听页面初次渲染完成

pages/device/index.json → package-order/pages/address/index.json ファイルの表示


+ 12
- 0
package-order/pages/address/index.wxml ファイルの表示

@@ -0,0 +1,12 @@
1
+<!--pages/userlist/index.wxml-->
2
+<view class="setup">
3
+  <view class="driver-info" wx:for="{{address}}" wx:key="addressId">
4
+      <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>
8
+      </view>
9
+      <!-- <button class="cancel-btn" bindtap="cancelOrder">去查看</button> -->
10
+      <t-icon name="edit-2" size="40rpx" data-name="edit-2" bind:tap="onIconTap" />
11
+    </view>
12
+</view>

+ 61
- 0
package-order/pages/address/index.wxss ファイルの表示

@@ -0,0 +1,61 @@
1
+/* pages/userlist/index.wxss */
2
+page{
3
+  width: 100%;
4
+  height: 100vh;
5
+  background: linear-gradient(to bottom, #F0F5F5 -40%, #F0F5F5 40%,#F0F5F5 100%);
6
+  padding: 0rpx 22rpx;
7
+  box-sizing: border-box;
8
+
9
+}
10
+.driver-info {
11
+  background-color: white;
12
+  border-radius: 16rpx;
13
+  padding:20rpx 30rpx 20rpx 0rpx;
14
+  box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1);
15
+  display: flex;
16
+  align-items: center;
17
+  margin-top: 26rpx;
18
+  box-sizing: border-box;
19
+}
20
+
21
+.driver-avatar {
22
+  width: 100rpx;
23
+  height: 100rpx;
24
+  border-radius: 50%;
25
+}
26
+
27
+.driver-details {
28
+  margin-left: 24rpx;
29
+  flex: 1;
30
+}
31
+
32
+.driver-name {
33
+  font-size: 32rpx;
34
+  font-weight: bold;
35
+  padding: 20rpx 0rpx;
36
+}
37
+.driver-car {
38
+  font-size: 28rpx;
39
+  color: #999999;
40
+  margin-top: 8rpx;
41
+}
42
+
43
+.driver-arrive {
44
+  font-size: 28rpx;
45
+  /* color: #2C85FF; */
46
+  /* color: #666; */
47
+  color: #999999;
48
+
49
+  margin-top: 8rpx;
50
+}
51
+
52
+.cancel-btn {
53
+  width: 160rpx;
54
+  height: 64rpx;
55
+  line-height: 64rpx;
56
+  font-size: 28rpx;
57
+  color: #FF5252;
58
+  border: 1rpx solid #FF5252;
59
+  background-color: white;
60
+  border-radius: 32rpx;
61
+}

+ 262
- 0
package-order/pages/createorder/index.js ファイルの表示

@@ -0,0 +1,262 @@
1
+// pages/createorder/index.js
2
+const api = require('../../../api/index.js');
3
+
4
+Page({
5
+
6
+  /**
7
+   * 页面的初始数据
8
+   */
9
+  data: {
10
+    cartype:0,
11
+    index:0,
12
+    objectArray: [],
13
+    objdriver: [],
14
+    driverindex:0,
15
+    date: '2016-09-01',
16
+    userdata:[],
17
+    userindex:0,
18
+    addressindex:0,
19
+    address: [],
20
+    items: [
21
+      {value: 1, name: '光伏'},
22
+      {value: 2, name: '风电'},
23
+      {value: 3, name: '网电'},
24
+    ]
25
+  },
26
+
27
+  /**
28
+   * 生命周期函数--监听页面加载
29
+   */
30
+  onLoad(options) {
31
+ this.getdriver()
32
+this.getvehicle()
33
+ this.getselectcompany()
34
+  },
35
+  // 司机
36
+  getdriver(){
37
+    let data ={
38
+
39
+    }
40
+    api.request(`/sysdriver/selectdriverall`, 'post',data,{ isPublic: false })
41
+    .then((data) => {
42
+     console.log(data.data);
43
+     let obj = []
44
+
45
+     for (let index = 0; index < data.data.length; index++) {
46
+      let carType = ''
47
+      if (data.data[index].operationType==1) {
48
+        carType = '空闲'
49
+      }else if(data.data[index].operationType==2){
50
+        carType = '工作中'
51
+      }else if(data.data[index].operationType==3){
52
+        carType = '维护中'
53
+      }
54
+      obj.push({
55
+        id:data.data[index].operationId,
56
+        name:data.data[index].operationName,
57
+        subtitle:data.data[index].operationName + ' / ' + carType
58
+      })    
59
+     }
60
+     this.setData({
61
+      objdriver:obj
62
+     })
63
+    })
64
+    .catch((err) => {
65
+   
66
+      console.error('请求失败:', err);
67
+    });
68
+  },
69
+  // 车型
70
+  getvehicle(){
71
+    let data ={}
72
+    api.request(`/syscar/selectcarall`, 'post',data,{ isPublic: false })
73
+    .then((data) => {
74
+      let obj = []
75
+      for (let index = 0; index < data.data.length; index++) {
76
+        let carType = ''
77
+          if (data.data[index].carType==1) {
78
+            carType = '空闲'
79
+          }else if(data.data[index].carType==2){
80
+            carType = '工作中'
81
+          }else if(data.data[index].carType==3){
82
+            carType = '维护中'
83
+          }
84
+          obj.push({
85
+            id:data.data[index].carId,
86
+            name:data.data[index].carId + ' / ' + data.data[index].carMondel,
87
+            subtitle:data.data[index].carId + ' / ' + data.data[index].carMondel + ' / ' + carType
88
+
89
+          })
90
+      }
91
+      this.setData({
92
+        objectArray:obj
93
+       })
94
+ console.log(this.data.objectArray);
95
+    })
96
+    .catch((err) => {
97
+   
98
+      console.error('请求失败:', err);
99
+    });
100
+  },
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
+
112
+      })
113
+      .catch((err) => {
114
+     
115
+        console.error('请求失败:', err);
116
+      });
117
+    },
118
+  // 地址
119
+  getaddress(){
120
+    let data ={
121
+      operationId:this.data.userdata[this.data.userindex].companyId
122
+    }
123
+    api.request(`/sysaddress/selectaddress`, 'post',data,{ isPublic: false })
124
+    .then((data) => {
125
+     console.log(data.data);
126
+     this.setData({
127
+      address:data.data
128
+     })
129
+    })
130
+    .catch((err) => {
131
+   
132
+      console.error('请求失败:', err);
133
+    });
134
+  },
135
+  oncar(e){
136
+   console.log(e.currentTarget.dataset.index);
137
+this.setData({
138
+  cartype:e.currentTarget.dataset.index
139
+})
140
+  },
141
+  bindDateChange: function(e) {
142
+    console.log('picker发送选择改变,携带值为', e.detail.value)
143
+    this.setData({
144
+      date: e.detail.value
145
+    })
146
+  },
147
+  details(){
148
+ 
149
+    let data ={
150
+      workorderName:this.data.cartype,
151
+      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
158
+    }
159
+    api.request(`/sysworkorder/addworkorder`, 'post',data,{ isPublic: false })
160
+    .then((data) => {
161
+ console.log(data);
162
+ wx.switchTab({
163
+  url: '/pages/tool/index',
164
+})
165
+
166
+    })
167
+    .catch((err) => {
168
+   
169
+      console.error('请求失败:', err);
170
+    });
171
+ 
172
+  },
173
+   //  司机
174
+   bindectArrayChange(e){
175
+    console.log(e.detail.value);
176
+    this.setData({
177
+      index:e.detail.value
178
+    })
179
+    },
180
+    // 车型
181
+  binddriverChange(e){
182
+  console.log(e.detail.value);
183
+  this.setData({
184
+    driverindex:e.detail.value
185
+  })
186
+  },  
187
+    // 用户
188
+    binduserChange(e){
189
+ console.log(e);
190
+ this.setData({
191
+  userindex:e.detail.value
192
+})
193
+    },
194
+      // 地址
195
+      binduserChange(e){
196
+        console.log(e);
197
+        this.setData({
198
+          addressindex:e.detail.value
199
+       })
200
+           },
201
+           radioChange(e) {
202
+            console.log('radio发生change事件,携带value值为:', e.detail.value)
203
+        
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
+            }
208
+        
209
+            this.setData({
210
+              items
211
+            })
212
+          },
213
+  /**
214
+   * 生命周期函数--监听页面初次渲染完成
215
+   */
216
+  onReady() {
217
+
218
+  },
219
+
220
+  /**
221
+   * 生命周期函数--监听页面显示
222
+   */
223
+  onShow() {
224
+
225
+  },
226
+
227
+  /**
228
+   * 生命周期函数--监听页面隐藏
229
+   */
230
+  onHide() {
231
+
232
+  },
233
+
234
+  /**
235
+   * 生命周期函数--监听页面卸载
236
+   */
237
+  onUnload() {
238
+
239
+  },
240
+
241
+  /**
242
+   * 页面相关事件处理函数--监听用户下拉动作
243
+   */
244
+  onPullDownRefresh() {
245
+
246
+  },
247
+
248
+  /**
249
+   * 页面上拉触底事件的处理函数
250
+   */
251
+  onReachBottom() {
252
+
253
+  },
254
+
255
+  /**                  
256
+   * 用户点击右上角分享  
257
+   */                  
258
+  onShareAppMessage() {
259
+                       
260
+  }                    
261
+})                     
262
+// 

pages/statistics/index.json → package-order/pages/createorder/index.json ファイルの表示

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

+ 127
- 0
package-order/pages/createorder/index.wxml ファイルの表示

@@ -0,0 +1,127 @@
1
+<!--pages/createorder/index.wxml-->
2
+<view class="body">
3
+<view class="car">
4
+<view>
5
+<text style="color: red;">*</text> 用车类型
6
+</view>
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>
10
+</view>
11
+</view>
12
+<view class="car">
13
+<view>
14
+<text style="color: red;">*</text> <text wx:if="{{cartype==1}}"> 出售电量</text> <text wx:if="{{cartype==0}}"> 需求电量</text> 
15
+</view>
16
+<view class="model_right">
17
+<input class="powerlevel" type="text" placeholder="请输入电量"/>
18
+</view>
19
+</view>
20
+<view class="car" wx:if="{{cartype==1}}">
21
+<view>
22
+<text style="color: red;">*</text> 意向电价
23
+</view>
24
+<view class="model_right">
25
+<input class="powerlevel" type="text" placeholder="请输入需求用电"/>
26
+</view>
27
+</view>
28
+<view class="car">
29
+<view style="margin-left: 18rpx;">
30
+ 绿电
31
+</view>
32
+<view class="model_right">
33
+  <radio-group bindchange="radioChange">
34
+        <label class="weui-cell weui-check__label" wx:for="{{items}}" wx:key="value">
35
+
36
+          <view class="weui-cell__hd">
37
+            <radio value="{{item.value}}" checked="true"/>
38
+          </view>
39
+          <view class="weui-cell__bd">{{item.name}}</view>
40
+        </label>
41
+      </radio-group>
42
+</view>
43
+</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
+<!-- <view class="car">
54
+<view>
55
+<text style="color: red;">*</text> 司机
56
+</view>
57
+<view class="model_right">
58
+  <picker bindchange="binddriverChange" value="{{driverindex}}" range="{{objdriver}}" range-key="subtitle">
59
+    <view class="picker">
60
+    {{objdriver[driverindex].name}}
61
+<t-icon name="chevron-right-s" size="40rpx" data-name="chevron-right-s" color="#cccccc" bind:tap="onIconTap" />
62
+    </view>
63
+  </picker>
64
+</view>
65
+</view> -->
66
+<view class="car">
67
+<view style="margin-left: 18rpx;">
68
+车长车型
69
+</view>
70
+<view class="model_right">
71
+  <picker bindchange="bindectArrayChange" value="{{index}}" range="{{objectArray}}" range-key="subtitle">
72
+    <view class="picker">
73
+    {{objectArray[index].name}}
74
+<t-icon name="chevron-right-s" size="40rpx" data-name="chevron-right-s" color="#cccccc" bind:tap="onIconTap" />
75
+    </view>
76
+  </picker>
77
+</view>
78
+</view>
79
+<!-- <view class="car">
80
+<view>
81
+<text style="color: red;">*</text> 用户
82
+</view>
83
+<view class="model_right">
84
+  <picker bindchange="binduserChange" value="{{userindex}}" range="{{userdata}}" range-key="companyName">
85
+    <view class="picker">
86
+    {{userdata[userindex].companyName}}
87
+<t-icon name="chevron-right-s" size="40rpx" data-name="chevron-right-s" color="#cccccc" bind:tap="onIconTap" />
88
+    </view>
89
+  </picker>
90
+</view>
91
+</view> -->
92
+ 
93
+<view class="car">
94
+<view>
95
+<text style="color: red;">*</text> 地址
96
+</view>
97
+<view class="model_right">
98
+  <picker bindchange="bindPickerChange" value="{{addressindex}}" range="{{address}}" range-key="addressDetails">
99
+    <view class="picker">
100
+    {{address[addressindex].addressDetails}}
101
+<t-icon name="chevron-right-s" size="40rpx" data-name="chevron-right-s" color="#cccccc" bind:tap="onIconTap" />
102
+    </view>
103
+  </picker>
104
+</view>
105
+</view>
106
+<view class="car">
107
+<view>
108
+<text style="color: red;">*</text> 预计到达时间
109
+</view>
110
+<view class="model_right">
111
+  <picker mode="date" value="{{date}}" start="2015-09-01" end="2017-09-01" bindchange="bindDateChange">
112
+    <view class="picker">
113
+     {{date}}
114
+<t-icon name="chevron-right-s" size="40rpx" data-name="chevron-right-s" color="#cccccc" bind:tap="onIconTap" />
115
+    </view>
116
+  </picker>
117
+</view>
118
+</view>
119
+
120
+</view>
121
+<!-- 
122
+
123
+--->
124
+<button class="call-btn" bindtap="details">
125
+      <text class="call-btn_left_electricity">预约</text>
126
+</button> 
127
+        

+ 86
- 0
package-order/pages/createorder/index.wxss ファイルの表示

@@ -0,0 +1,86 @@
1
+page {
2
+  background-color: var(--td-bg-color-container);
3
+  /* background-color: #f9f9f9; */
4
+  background: linear-gradient(to bottom, #F0F5F5 -40%, #F0F5F5 40%,#F0F5F5 100%);
5
+  padding: 10rpx 20rpx 20rpx 20rpx;
6
+box-sizing: border-box;
7
+}
8
+.body{
9
+background-color: #ffffff;
10
+border-radius: 10rpx;
11
+padding: 0rpx 0rpx;
12
+box-sizing: border-box;
13
+}
14
+.car{
15
+  margin-top: 20rpx;
16
+  padding: 20rpx 30rpx;
17
+  box-sizing: border-box;
18
+  display: flex;
19
+  justify-content: space-between;
20
+}
21
+.car_right{
22
+  width: 240rpx;
23
+  display: flex;
24
+  justify-content: space-between;
25
+}
26
+.cartbuy{
27
+  padding: 8rpx 26rpx;
28
+  border-radius: 10rpx;
29
+  border: 1rpx solid #cccccc;
30
+}
31
+.carsell{
32
+  padding: 8rpx 26rpx;
33
+  border-radius: 10rpx;
34
+  border: 1rpx solid red;
35
+}
36
+.model_right{
37
+  display: flex;
38
+  justify-content: space-between;
39
+}
40
+.picker{
41
+  display: flex;
42
+}
43
+.call-btn {
44
+  position: absolute;
45
+bottom: 0;
46
+left: 0;
47
+right: 0;
48
+margin-bottom: 64rpx;
49
+background-color: #00C775;
50
+color: white;
51
+width: 90%;
52
+height: 96rpx;
53
+line-height: 96rpx;
54
+font-size: 34rpx;
55
+border-radius: 48rpx;
56
+box-sizing: border-box;
57
+display: flex;
58
+justify-content:space-around;
59
+}
60
+.call-btn_left_electricity{
61
+width: 50%;
62
+height: 100%;
63
+}
64
+.call-btn_right_electricity{
65
+width: 50%;
66
+height: 100%;
67
+border-left: 4rpx solid #ffffff; 
68
+}
69
+.powerlevel{
70
+ border-radius: 6rpx;
71
+ text-align: right;
72
+padding-right: 40rpx;
73
+}
74
+/*  */
75
+radio-group{
76
+  display: flex;
77
+  align-items: center;
78
+}
79
+.weui-cell{
80
+  display: flex;
81
+  align-items: center;
82
+
83
+}
84
+.weui-cell__hd{
85
+  margin-left: 20rpx;
86
+}

+ 90
- 0
package-order/pages/driver/index.js ファイルの表示

@@ -0,0 +1,90 @@
1
+// pages/driver/index.js
2
+const api = require('../../../api/index.js');
3
+
4
+Page({
5
+
6
+  /**
7
+   * 页面的初始数据
8
+   */
9
+  data: {
10
+    driver:[]
11
+  },
12
+
13
+  /**
14
+   * 生命周期函数--监听页面加载
15
+   */
16
+  onLoad(options) {
17
+ this.getdriver()
18
+  },
19
+  getdriver(){
20
+    let data ={
21
+      operationId:'',
22
+      driverType:'',
23
+      driverName:'',
24
+    }
25
+    api.request(`/sysdriver/selectdriverall`, 'post',data,{ isPublic: false })
26
+    .then((data) => {
27
+  console.log(data.data);
28
+  if (data.code==200) {
29
+    this.setData({
30
+      driver:data.data
31
+    })
32
+  }
33
+  //  wx.navigateTo({
34
+  //   url: '/pages/map/index',
35
+  // })
36
+    })
37
+    .catch((err) => {
38
+   
39
+      console.error('请求失败:', err);
40
+    });
41
+  },
42
+  /**
43
+   * 生命周期函数--监听页面初次渲染完成
44
+   */
45
+  onReady() {
46
+
47
+  },
48
+
49
+  /**
50
+   * 生命周期函数--监听页面显示
51
+   */
52
+  onShow() {
53
+
54
+  },
55
+
56
+  /**
57
+   * 生命周期函数--监听页面隐藏
58
+   */
59
+  onHide() {
60
+
61
+  },
62
+
63
+  /**
64
+   * 生命周期函数--监听页面卸载
65
+   */
66
+  onUnload() {
67
+
68
+  },
69
+
70
+  /**
71
+   * 页面相关事件处理函数--监听用户下拉动作
72
+   */
73
+  onPullDownRefresh() {
74
+
75
+  },
76
+
77
+  /**
78
+   * 页面上拉触底事件的处理函数
79
+   */
80
+  onReachBottom() {
81
+
82
+  },
83
+
84
+  /**
85
+   * 用户点击右上角分享
86
+   */
87
+  onShareAppMessage() {
88
+
89
+  }
90
+})

pages/personalInfo/index.json → package-order/pages/driver/index.json ファイルの表示


+ 12
- 0
package-order/pages/driver/index.wxml ファイルの表示

@@ -0,0 +1,12 @@
1
+<!--pages/userlist/index.wxml-->
2
+<view class="setup">
3
+  <view class="driver-info" wx:for="{{driver}}" wx:key="operationId">
4
+      <image src="https://esos-iot.bjdexn.cn/myminio/project/2a1b32553c3d4ef992bc797d26cf1614.png" class="driver-avatar"></image>
5
+      <view class="driver-details">
6
+        <view class="driver-name">司机:{{item.operationName}}</view>
7
+        <view class="driver-arrive">状态:{{item.operationType}}</view>
8
+        <view class="driver-car">电话:{{item.operationPhone}}</view>
9
+      </view>
10
+      <!-- <button class="cancel-btn" bindtap="cancelOrder">去查看</button> -->
11
+    </view>
12
+</view>

+ 59
- 0
package-order/pages/driver/index.wxss ファイルの表示

@@ -0,0 +1,59 @@
1
+/* pages/userlist/index.wxss */
2
+page{
3
+  width: 100%;
4
+  height: 100vh;
5
+  background: linear-gradient(to bottom, #F0F5F5 -40%, #F0F5F5 40%,#F0F5F5 100%);
6
+  padding: 0rpx 22rpx;
7
+  box-sizing: border-box;
8
+
9
+}
10
+.driver-info {
11
+  background-color: white;
12
+  border-radius: 16rpx;
13
+  padding: 20rpx;
14
+  box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1);
15
+  display: flex;
16
+  align-items: center;
17
+  margin-top: 26rpx;
18
+}
19
+
20
+.driver-avatar {
21
+  width: 100rpx;
22
+  height: 100rpx;
23
+  border-radius: 50%;
24
+}
25
+
26
+.driver-details {
27
+  margin-left: 24rpx;
28
+  flex: 1;
29
+}
30
+
31
+.driver-name {
32
+  font-size: 32rpx;
33
+  font-weight: bold;
34
+}
35
+.driver-car {
36
+  font-size: 28rpx;
37
+  color: #999999;
38
+  margin-top: 8rpx;
39
+}
40
+
41
+.driver-arrive {
42
+  font-size: 28rpx;
43
+  /* color: #2C85FF; */
44
+  /* color: #666; */
45
+  color: #999999;
46
+
47
+  margin-top: 8rpx;
48
+}
49
+
50
+.cancel-btn {
51
+  width: 160rpx;
52
+  height: 64rpx;
53
+  line-height: 64rpx;
54
+  font-size: 28rpx;
55
+  color: #FF5252;
56
+  border: 1rpx solid #FF5252;
57
+  background-color: white;
58
+  border-radius: 32rpx;
59
+}

pages/setuplevel/index.js → package-setup/pages/setuplevel/index.js ファイルの表示

@@ -1,5 +1,5 @@
1 1
 // pages/setuplevel/index.js
2
-const api = require('../../api/index.js');
2
+const api = require('../../../api/index.js');
3 3
 
4 4
 Page({
5 5
 
@@ -24,7 +24,7 @@ Page({
24 24
             }
25 25
           });
26 26
           wx.navigateTo({
27
-            url: '/pages/login/index', // 登录页面的路径,注意路径前面加上 '/' 表示从根目录开始
27
+            url: '/package-user/pages/login/index', // 登录页面的路径,注意路径前面加上 '/' 表示从根目录开始
28 28
           });
29 29
         } else if (res.cancel) {
30 30
           console.log('用户点击取消')
@@ -46,7 +46,7 @@ Page({
46 46
                 icon: 'success'
47 47
               });
48 48
               wx.navigateTo({
49
-                url: '/pages/login/index', // 登录页面的路径,注意路径前面加上 '/' 表示从根目录开始
49
+                url: '/package-user/pages/login/index', // 登录页面的路径,注意路径前面加上 '/' 表示从根目录开始
50 50
               });
51 51
             }
52 52
           });

pages/setuplevel/index.json → package-setup/pages/setuplevel/index.json ファイルの表示


pages/setuplevel/index.wxml → package-setup/pages/setuplevel/index.wxml ファイルの表示


pages/setuplevel/index.wxss → package-setup/pages/setuplevel/index.wxss ファイルの表示

@@ -1,6 +1,6 @@
1 1
 /* pages/setuplevel/index.wxss */
2 2
 page{
3
- background: linear-gradient(to bottom, #0F80DC -40%, #F0F5F5 40%,#F0F5F5 100%);
3
+ background: linear-gradient(to bottom, #00C775 -40%, #F0F5F5 40%,#F0F5F5 100%);
4 4
 }
5 5
 .buttom_{
6 6
   width: 100%;
@@ -13,8 +13,8 @@ page{
13 13
 .buttom{
14 14
   width: 80%;
15 15
   height: 80rpx;
16
-  color: #0F80DC;
17
- border: 1rpx solid #0F80DC;
16
+  color: #00C775;
17
+ border: 1rpx solid #00C775;
18 18
  display: flex;
19 19
  align-items: center;
20 20
  justify-content: center;
@@ -45,7 +45,8 @@ box-sizing: border-box;
45 45
   padding: 10rpx 0rpx;
46 46
   box-sizing: border-box;
47 47
   margin-top: 30rpx;
48
-box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1);
48
+  box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1);
49
+
49 50
 }
50 51
 .allocation_2{
51 52
   color: #999999;

+ 178
- 0
package-user/components/captcha/index.js ファイルの表示

@@ -0,0 +1,178 @@
1
+Component({
2
+  properties: {
3
+    // 是否显示弹窗
4
+    isShow: {
5
+      type: Boolean,
6
+      value: false
7
+    },
8
+    // 手机号(用于显示)
9
+    phoneNumber: {
10
+      type: String,
11
+      value: ''
12
+    },
13
+    // 倒计时秒数
14
+    countdownSeconds: {
15
+      type: Number,
16
+      value: 120
17
+    }
18
+  },
19
+
20
+  data: {
21
+    // 验证码数组(6位)
22
+    codes: ['', '', '', ''],
23
+    // 实际输入的验证码值
24
+    codeValue: '',
25
+    // 当前激活的输入框索引
26
+    currentIndex: 0,
27
+    // 是否聚焦
28
+    isFocus: false,
29
+    // 倒计时
30
+    countdown: 120,
31
+    // 是否可以重新发送
32
+    canResend: false,
33
+    // 验证码是否输入完成
34
+    isComplete: false,
35
+    // 倒计时计时器
36
+    timer: null
37
+  },
38
+
39
+  observers: {
40
+    // 监听isShow变化,控制弹窗显示隐藏
41
+    isShow: function (isShow) {
42
+      if (isShow) {
43
+        this.startCountdown();
44
+        this.focusInput();
45
+      } else {
46
+        this.clearCountdown();
47
+        this.resetCodeInput();
48
+      }
49
+    },
50
+    
51
+    // 监听countdownSeconds变化
52
+    countdownSeconds: function (seconds) {
53
+      this.setData({
54
+        countdown: seconds
55
+      });
56
+    },
57
+    
58
+    // 监听验证码变化,更新输入状态
59
+    codeValue: function (value) {
60
+      const codes = [];
61
+      for (let i = 0; i < 4; i++) {
62
+        codes[i] = value[i] || '';
63
+      }
64
+      
65
+      // 更新当前激活的输入框索引
66
+      let currentIndex = value.length < 4 ? value.length : 3;
67
+      
68
+      // 判断是否输入完成
69
+      const isComplete = value.length === 4;
70
+      
71
+      this.setData({
72
+        codes,
73
+        currentIndex,
74
+        isComplete
75
+      });
76
+      
77
+      // 如果输入完成,自动触发确认事件
78
+      if (isComplete) {
79
+        this.triggerEvent('complete', { code: value });
80
+      }
81
+    }
82
+  },
83
+
84
+  methods: {
85
+    // 聚焦输入框
86
+    focusInput() {
87
+      this.setData({
88
+        isFocus: true
89
+      });
90
+    },
91
+    
92
+    // 输入框失焦
93
+    onInputBlur() {
94
+      this.setData({
95
+        isFocus: false
96
+      });
97
+    },
98
+    
99
+    // 验证码输入
100
+    onCodeInput(e) {
101
+      const value = e.detail.value.replace(/\D/g, ''); // 只保留数字
102
+      this.setData({
103
+        codeValue: value
104
+      });
105
+    },
106
+    
107
+    // 关闭弹窗
108
+    onClose() {
109
+      this.triggerEvent('close');
110
+    },
111
+    
112
+    // 确认
113
+    onConfirm() {
114
+      if (this.data.isComplete) {
115
+        this.triggerEvent('confirm', { code: this.data.codeValue });
116
+      }
117
+    },
118
+    
119
+    // 重新发送验证码
120
+    onResend() {
121
+      this.triggerEvent('resend');
122
+      this.startCountdown();
123
+    },
124
+    
125
+    // 开始倒计时
126
+    startCountdown() {
127
+      // 清除之前的计时器
128
+      this.clearCountdown();
129
+      
130
+      const countdownSeconds = this.data.countdownSeconds;
131
+      this.setData({
132
+        countdown: countdownSeconds,
133
+        canResend: false
134
+      });
135
+      
136
+      // 设置新的计时器
137
+      const timer = setInterval(() => {
138
+        let countdown = this.data.countdown - 1;
139
+        if (countdown <= 0) {
140
+          this.setData({
141
+            countdown: 0,
142
+            canResend: true
143
+          });
144
+          this.clearCountdown();
145
+        } else {
146
+          this.setData({
147
+            countdown
148
+          });
149
+        }
150
+      }, 1000);
151
+      
152
+      this.setData({ timer });
153
+    },
154
+    
155
+    // 清除倒计时
156
+    clearCountdown() {
157
+      if (this.data.timer) {
158
+        clearInterval(this.data.timer);
159
+        this.setData({ timer: null });
160
+      }
161
+    },
162
+    
163
+    // 重置验证码输入
164
+    resetCodeInput() {
165
+      this.setData({
166
+        codes: ['', '', '', '', '', ''],
167
+        codeValue: '',
168
+        currentIndex: 0,
169
+        isComplete: false
170
+      });
171
+    }
172
+  },
173
+  
174
+  // 组件销毁时清除计时器
175
+  detached() {
176
+    this.clearCountdown();
177
+  }
178
+});

+ 4
- 0
package-user/components/captcha/index.json ファイルの表示

@@ -0,0 +1,4 @@
1
+{
2
+  "component": true,
3
+  "usingComponents": {}
4
+}

+ 63
- 0
package-user/components/captcha/index.wxml ファイルの表示

@@ -0,0 +1,63 @@
1
+<view class="verification-popup {{isShow ? 'show' : ''}}">
2
+  <!-- 遮罩层 -->
3
+  <view class="overlay" bindtap="onClose"></view>
4
+  
5
+  <!-- 弹窗内容 -->
6
+  <view class="popup-content">
7
+    <!-- 标题区域 -->
8
+    <view class="popup-header">
9
+      <text class="title">输入验证码</text>
10
+      <view class="close-btn" bindtap="onClose">
11
+        <icon type="clear" size="20" color="#999" />
12
+      </view>
13
+    </view>
14
+    
15
+    <!-- 提示信息 -->
16
+    <!-- <view class="message">
17
+      验证码已发送至手机 {{phoneNumber}}
18
+    </view> -->
19
+    
20
+    <!-- 验证码输入框 -->
21
+    <view class="code-input-container">
22
+      <view 
23
+        wx:for="{{4}}" 
24
+        wx:key="index" 
25
+        class="code-input {{currentIndex === index ? 'active' : ''}} {{codes[index] ? 'filled' : ''}}"
26
+        bindtap="focusInput"
27
+      >
28
+        <text>{{codes[index] || ''}}</text>
29
+      </view>
30
+      <!-- 实际输入框(隐藏) -->
31
+      <input 
32
+        class="real-input" 
33
+        type="number" 
34
+        maxlength="4" 
35
+        focus="{{isFocus}}" 
36
+        value="{{codeValue}}"
37
+        bindinput="onCodeInput"
38
+        bindblur="onInputBlur"
39
+      />
40
+    </view>
41
+    
42
+    <!-- 操作区域 -->
43
+    <view class="operation-area">
44
+      <!-- <button 
45
+        class="confirm-btn" 
46
+        bindtap="onConfirm"
47
+        disabled="{{!isComplete}}"
48
+      >
49
+        确认
50
+      </button> -->
51
+      
52
+      <view class="resend-container">
53
+        <!-- <text>未收到验证码?</text> -->
54
+        <text 
55
+          class="resend-btn {{canResend ? 'active' : ''}}" 
56
+          bindtap="{{canResend ? 'onResend' : ''}}"
57
+        >
58
+          {{canResend ? '重新发送' : '重新发送(' + countdown + ')'}}
59
+        </text>
60
+      </view>
61
+    </view>
62
+  </view>
63
+</view>

+ 185
- 0
package-user/components/captcha/index.wxss ファイルの表示

@@ -0,0 +1,185 @@
1
+.verification-popup {
2
+  display: none;
3
+  position: fixed;
4
+  top: 0;
5
+  left: 0;
6
+  right: 0;
7
+  bottom: 0;
8
+  z-index: 9999;
9
+}
10
+
11
+/* 显示弹窗 */
12
+.verification-popup.show {
13
+  display: block;
14
+}
15
+
16
+/* 遮罩层 */
17
+.overlay {
18
+  position: absolute;
19
+  top: 0;
20
+  left: 0;
21
+  right: 0;
22
+  bottom: 0;
23
+  background-color: rgba(0, 0, 0, 0.5);
24
+  backdrop-filter: blur(2px);
25
+  animation: fadeIn 0.3s ease;
26
+}
27
+
28
+/* 弹窗内容 */
29
+.popup-content {
30
+  position: absolute;
31
+  top: 40%;
32
+  left: 50%;
33
+  transform: translate(-50%, -50%);
34
+  width: 90%;
35
+  max-width: 400px;
36
+  background-color: #fff;
37
+  border-radius: 16px;
38
+  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
39
+  overflow: hidden;
40
+  animation: scaleIn 0.3s ease;
41
+}
42
+
43
+/* 标题区域 */
44
+.popup-header {
45
+  display: flex;
46
+  justify-content: center;
47
+  align-items: center;
48
+  padding: 20px 24px 16px;
49
+  position: relative;
50
+}
51
+
52
+.title {
53
+  font-size: 18px;
54
+  font-weight: 600;
55
+  color: #1a1a1a;
56
+}
57
+
58
+.close-btn {
59
+  position: absolute;
60
+  right: 24px;
61
+  top: 50%;
62
+  transform: translateY(-50%);
63
+  width: 32px;
64
+  height: 32px;
65
+  display: flex;
66
+  align-items: center;
67
+  justify-content: center;
68
+  border-radius: 50%;
69
+  background-color: #f5f5f5;
70
+}
71
+
72
+/* 提示信息 */
73
+.message {
74
+  text-align: center;
75
+  font-size: 14px;
76
+  color: #666;
77
+  padding: 0 24px 20px;
78
+}
79
+
80
+/* 验证码输入框容器 */
81
+.code-input-container {
82
+  display: flex;
83
+  justify-content: center;
84
+  gap: 10px;
85
+  padding: 0 24px 24px;
86
+  position: relative;
87
+}
88
+
89
+/* 单个验证码输入框 */
90
+.code-input {
91
+  width: 50px;
92
+  height: 50px;
93
+  border-radius: 8px;
94
+  border: 1px solid #ddd;
95
+  display: flex;
96
+  align-items: center;
97
+  justify-content: center;
98
+  font-size: 24px;
99
+  font-weight: 600;
100
+  color: #1a1a1a;
101
+  transition: all 0.2s ease;
102
+}
103
+
104
+/* 激活状态 */
105
+.code-input.active {
106
+  border-color: #07c160;
107
+  box-shadow: 0 0 0 2px rgba(7, 193, 96, 0.2);
108
+}
109
+
110
+/* 已填充状态 */
111
+.code-input.filled {
112
+  border-color: #eee;
113
+  background-color: #fafafa;
114
+}
115
+
116
+/* 实际输入框(隐藏) */
117
+.real-input {
118
+  position: absolute;
119
+  width: 1px;
120
+  height: 1px;
121
+  opacity: 0;
122
+  pointer-events: none;
123
+}
124
+
125
+/* 操作区域 */
126
+.operation-area {
127
+  padding: 0 24px 24px;
128
+}
129
+
130
+/* 确认按钮 */
131
+.confirm-btn {
132
+  width: 100%;
133
+  height: 48px;
134
+  line-height: 48px;
135
+  background-color: #07c160;
136
+  color: #fff;
137
+  font-size: 16px;
138
+  font-weight: 500;
139
+  border-radius: 24px;
140
+  margin-bottom: 16px;
141
+  display: flex;
142
+  align-items: center;
143
+  justify-content: center;
144
+}
145
+
146
+.confirm-btn::after {
147
+  border: none;
148
+}
149
+
150
+.confirm-btn:disabled {
151
+  background-color: #e5e5e5;
152
+  color: #999;
153
+}
154
+
155
+/* 重新发送区域 */
156
+.resend-container {
157
+  display: flex;
158
+  justify-content: center;
159
+  align-items: center;
160
+  gap: 6px;
161
+  font-size: 14px;
162
+  color: #666;
163
+}
164
+
165
+/* 重新发送按钮 */
166
+.resend-btn {
167
+  color: #07c160;
168
+  font-weight: 500;
169
+}
170
+
171
+.resend-btn:not(.active) {
172
+  color: #999;
173
+  pointer-events: none;
174
+}
175
+
176
+/* 动画效果 */
177
+@keyframes fadeIn {
178
+  from { opacity: 0; }
179
+  to { opacity: 1; }
180
+}
181
+
182
+@keyframes scaleIn {
183
+  from { transform: translate(-50%, -50%) scale(0.9); opacity: 0; }
184
+  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
185
+}

+ 101
- 0
package-user/components/slide-confirm/index.js ファイルの表示

@@ -0,0 +1,101 @@
1
+Component({
2
+  properties: {
3
+    width: {
4
+      type: Number,
5
+      value: 300
6
+    },
7
+    height: {
8
+      type: Number,
9
+      value: 50
10
+    },
11
+    blockSize: {
12
+      type: Number,
13
+      value: 48
14
+    },
15
+    defaultText: {
16
+      type: String,
17
+      value: "向右滑动完成验证"
18
+    },
19
+    successText: {
20
+      type: String,
21
+      value: "验证通过"
22
+    },
23
+    iconSize: {
24
+      type: Number,
25
+      value: 24
26
+    }
27
+  },
28
+
29
+  data: {
30
+    position: 0,          // 滑块位置
31
+    progressWidth: 0,     // 已滑动宽度
32
+    startX: 0,            // 触摸起始X坐标
33
+    isMoving: false,      // 是否正在滑动
34
+    isSuccess: false      // 是否验证成功
35
+  },
36
+
37
+  methods: {
38
+    // 触摸开始
39
+    onTouchStart(e) {
40
+      if (this.data.isSuccess) return;
41
+      
42
+      this.setData({
43
+        startX: e.touches[0].clientX,
44
+        isMoving: true
45
+      });
46
+    },
47
+
48
+    // 触摸移动
49
+    onTouchMove(e) {
50
+      if (!this.data.isMoving || this.data.isSuccess) return;
51
+      
52
+      const moveX = e.touches[0].clientX;
53
+      let position = moveX - this.data.startX;
54
+      
55
+      // 限制滑块范围
56
+      if (position < 0) position = 0;
57
+      const maxPosition = this.data.width - this.data.blockSize;
58
+      if (position > maxPosition) position = maxPosition;
59
+      
60
+      this.setData({
61
+        position,
62
+        progressWidth: position + this.data.blockSize  // 进度宽度 = 滑块位置 + 滑块宽度
63
+      });
64
+    },
65
+
66
+    // 触摸结束
67
+    onTouchEnd() {
68
+      if (!this.data.isMoving || this.data.isSuccess) return;
69
+      
70
+      this.setData({ isMoving: false });
71
+      
72
+      // 判断是否滑动到终点
73
+      const maxPosition = this.data.width - this.data.blockSize;
74
+      if (this.data.position >= maxPosition * 0.95) {
75
+        // 验证成功
76
+        this.setData({
77
+          position: maxPosition,
78
+          progressWidth: this.data.width,
79
+          isSuccess: true
80
+        });
81
+        // 触发成功事件
82
+        this.triggerEvent('success');
83
+      } else {
84
+        // 滑动不足,重置
85
+        this.setData({
86
+          position: 0,
87
+          progressWidth: 0
88
+        });
89
+      }
90
+    },
91
+
92
+    // 重置滑块
93
+    reset() {
94
+      this.setData({
95
+        position: 0,
96
+        progressWidth: 0,
97
+        isSuccess: false
98
+      });
99
+    }
100
+  }
101
+});

pages/malfunction/index.json → package-user/components/slide-confirm/index.json ファイルの表示

@@ -1,6 +1,7 @@
1 1
 {
2
-  "navigationBarTitleText": "工单报障",
2
+  "component": true,
3 3
   "usingComponents": {
4 4
     "t-icon": "tdesign-miniprogram/icon/icon"
5
+
5 6
   }
6 7
 }

+ 26
- 0
package-user/components/slide-confirm/index.wxml ファイルの表示

@@ -0,0 +1,26 @@
1
+<view class="slide-container {{isSuccess ? 'success' : ''}}" style="width: {{width}}px; height: {{height}}px;">
2
+  <!-- 背景轨道 -->
3
+    <view 
4
+    class="slide-progress" 
5
+    style="width: {{progressWidth}}px; height: {{height}}px;"
6
+  ></view>
7
+  <view class="slide-track">
8
+    <text class="track-text">{{isSuccess ? successText : defaultText}}</text>
9
+  </view>
10
+  
11
+  <!-- 滑块 -->
12
+  <view 
13
+    class="slide-block"
14
+    style="left: {{position}}px; width: {{blockSize}}px; height: {{blockSize}}px;"
15
+    bindtouchstart="onTouchStart"
16
+    bindtouchmove="onTouchMove"
17
+    bindtouchend="onTouchEnd"
18
+  >
19
+    <t-icon 
20
+      class="block-icon" 
21
+      name="arrow-right"
22
+      type="{{isSuccess ? 'success' : 'arrowright'}}" 
23
+      size="{{iconSize}}"
24
+    ></t-icon>
25
+  </view>
26
+</view>

+ 64
- 0
package-user/components/slide-confirm/index.wxss ファイルの表示

@@ -0,0 +1,64 @@
1
+.slide-container {
2
+  position: relative;
3
+  overflow: hidden;
4
+  border-radius: 40px;
5
+  background-color: #f5f5f5;
6
+   box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1) inset;
7
+
8
+  transition: background-color 0.3s; 
9
+  
10
+}
11
+
12
+/* 已滑动区域样式 */
13
+.slide-progress {
14
+  position: absolute;
15
+  top: 0;
16
+  left: 0;
17
+  background-color: #eaffea; /* 滑动过的区域颜色 */
18
+  z-index: 1;
19
+  border-top-right-radius:100rpx;
20
+  border-bottom-right-radius:100rpx;
21
+  transition: background-color 0.3s ease;
22
+}
23
+
24
+
25
+/* 成功状态下的滑动区域颜色 */
26
+.slide-container.success .slide-progress {
27
+  background-color: #00c775; /* 验证成功后的颜色 */
28
+}
29
+
30
+.slide-track {
31
+  position: absolute;
32
+  width: 100%;
33
+  height: 100%;
34
+  display: flex;
35
+  align-items: center;
36
+  justify-content: center;
37
+  z-index: 2;
38
+}
39
+
40
+.track-text {
41
+  font-size: 14px;
42
+  color: #666;
43
+}
44
+
45
+.slide-container.success .track-text {
46
+  color: #fff;
47
+}
48
+
49
+.slide-block {
50
+  position: absolute;
51
+  top: 0;
52
+  background-color: #fff;
53
+  border-radius: 40px;
54
+  display: flex;
55
+  align-items: center;
56
+  justify-content: center;
57
+  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
58
+  z-index: 3;
59
+  touch-action: none;
60
+}
61
+
62
+.block-icon {
63
+  color: #00c775;
64
+}

+ 178
- 0
package-user/pages/captcha/index.js ファイルの表示

@@ -0,0 +1,178 @@
1
+Component({
2
+  properties: {
3
+    // 是否显示弹窗
4
+    isShow: {
5
+      type: Boolean,
6
+      value: false
7
+    },
8
+    // 手机号(用于显示)
9
+    phoneNumber: {
10
+      type: String,
11
+      value: ''
12
+    },
13
+    // 倒计时秒数
14
+    countdownSeconds: {
15
+      type: Number,
16
+      value: 60
17
+    }
18
+  },
19
+
20
+  data: {
21
+    // 验证码数组(6位)
22
+    codes: ['', '', '', '', '', ''],
23
+    // 实际输入的验证码值
24
+    codeValue: '',
25
+    // 当前激活的输入框索引
26
+    currentIndex: 0,
27
+    // 是否聚焦
28
+    isFocus: false,
29
+    // 倒计时
30
+    countdown: 60,
31
+    // 是否可以重新发送
32
+    canResend: false,
33
+    // 验证码是否输入完成
34
+    isComplete: false,
35
+    // 倒计时计时器
36
+    timer: null
37
+  },
38
+
39
+  observers: {
40
+    // 监听isShow变化,控制弹窗显示隐藏
41
+    isShow: function (isShow) {
42
+      if (isShow) {
43
+        this.startCountdown();
44
+        this.focusInput();
45
+      } else {
46
+        this.clearCountdown();
47
+        this.resetCodeInput();
48
+      }
49
+    },
50
+    
51
+    // 监听countdownSeconds变化
52
+    countdownSeconds: function (seconds) {
53
+      this.setData({
54
+        countdown: seconds
55
+      });
56
+    },
57
+    
58
+    // 监听验证码变化,更新输入状态
59
+    codeValue: function (value) {
60
+      const codes = [];
61
+      for (let i = 0; i < 6; i++) {
62
+        codes[i] = value[i] || '';
63
+      }
64
+      
65
+      // 更新当前激活的输入框索引
66
+      let currentIndex = value.length < 6 ? value.length : 5;
67
+      
68
+      // 判断是否输入完成
69
+      const isComplete = value.length === 6;
70
+      
71
+      this.setData({
72
+        codes,
73
+        currentIndex,
74
+        isComplete
75
+      });
76
+      
77
+      // 如果输入完成,自动触发确认事件
78
+      if (isComplete) {
79
+        this.triggerEvent('complete', { code: value });
80
+      }
81
+    }
82
+  },
83
+
84
+  methods: {
85
+    // 聚焦输入框
86
+    focusInput() {
87
+      this.setData({
88
+        isFocus: true
89
+      });
90
+    },
91
+    
92
+    // 输入框失焦
93
+    onInputBlur() {
94
+      this.setData({
95
+        isFocus: false
96
+      });
97
+    },
98
+    
99
+    // 验证码输入
100
+    onCodeInput(e) {
101
+      const value = e.detail.value.replace(/\D/g, ''); // 只保留数字
102
+      this.setData({
103
+        codeValue: value
104
+      });
105
+    },
106
+    
107
+    // 关闭弹窗
108
+    onClose() {
109
+      this.triggerEvent('close');
110
+    },
111
+    
112
+    // 确认
113
+    onConfirm() {
114
+      if (this.data.isComplete) {
115
+        this.triggerEvent('confirm', { code: this.data.codeValue });
116
+      }
117
+    },
118
+    
119
+    // 重新发送验证码
120
+    onResend() {
121
+      this.triggerEvent('resend');
122
+      this.startCountdown();
123
+    },
124
+    
125
+    // 开始倒计时
126
+    startCountdown() {
127
+      // 清除之前的计时器
128
+      this.clearCountdown();
129
+      
130
+      const countdownSeconds = this.data.countdownSeconds;
131
+      this.setData({
132
+        countdown: countdownSeconds,
133
+        canResend: false
134
+      });
135
+      
136
+      // 设置新的计时器
137
+      const timer = setInterval(() => {
138
+        let countdown = this.data.countdown - 1;
139
+        if (countdown <= 0) {
140
+          this.setData({
141
+            countdown: 0,
142
+            canResend: true
143
+          });
144
+          this.clearCountdown();
145
+        } else {
146
+          this.setData({
147
+            countdown
148
+          });
149
+        }
150
+      }, 1000);
151
+      
152
+      this.setData({ timer });
153
+    },
154
+    
155
+    // 清除倒计时
156
+    clearCountdown() {
157
+      if (this.data.timer) {
158
+        clearInterval(this.data.timer);
159
+        this.setData({ timer: null });
160
+      }
161
+    },
162
+    
163
+    // 重置验证码输入
164
+    resetCodeInput() {
165
+      this.setData({
166
+        codes: ['', '', '', '', '', ''],
167
+        codeValue: '',
168
+        currentIndex: 0,
169
+        isComplete: false
170
+      });
171
+    }
172
+  },
173
+  
174
+  // 组件销毁时清除计时器
175
+  detached() {
176
+    this.clearCountdown();
177
+  }
178
+});

+ 4
- 0
package-user/pages/captcha/index.json ファイルの表示

@@ -0,0 +1,4 @@
1
+{
2
+  "component": true,
3
+  "usingComponents": {}
4
+}

+ 63
- 0
package-user/pages/captcha/index.wxml ファイルの表示

@@ -0,0 +1,63 @@
1
+<view class="verification-popup {{isShow ? 'show' : ''}}">
2
+  <!-- 遮罩层 -->
3
+  <view class="overlay" bindtap="onClose"></view>
4
+  
5
+  <!-- 弹窗内容 -->
6
+  <view class="popup-content">
7
+    <!-- 标题区域 -->
8
+    <view class="popup-header">
9
+      <text class="title">输入验证码</text>
10
+      <view class="close-btn" bindtap="onClose">
11
+        <icon type="clear" size="20" color="#999" />
12
+      </view>
13
+    </view>
14
+    
15
+    <!-- 提示信息 -->
16
+    <!-- <view class="message">
17
+      验证码已发送至手机 {{phoneNumber}}
18
+    </view> -->
19
+    
20
+    <!-- 验证码输入框 -->
21
+    <view class="code-input-container">
22
+      <view 
23
+        wx:for="{{6}}" 
24
+        wx:key="index" 
25
+        class="code-input {{currentIndex === index ? 'active' : ''}} {{codes[index] ? 'filled' : ''}}"
26
+        bindtap="focusInput"
27
+      >
28
+        <text>{{codes[index] || ''}}</text>
29
+      </view>
30
+      <!-- 实际输入框(隐藏) -->
31
+      <input 
32
+        class="real-input" 
33
+        type="number" 
34
+        maxlength="6" 
35
+        focus="{{isFocus}}" 
36
+        value="{{codeValue}}"
37
+        bindinput="onCodeInput"
38
+        bindblur="onInputBlur"
39
+      />
40
+    </view>
41
+    
42
+    <!-- 操作区域 -->
43
+    <view class="operation-area">
44
+      <!-- <button 
45
+        class="confirm-btn" 
46
+        bindtap="onConfirm"
47
+        disabled="{{!isComplete}}"
48
+      >
49
+        确认
50
+      </button> -->
51
+      
52
+      <!-- <view class="resend-container">
53
+        <text>未收到验证码?</text>
54
+        <text 
55
+          class="resend-btn {{canResend ? 'active' : ''}}" 
56
+          bindtap="{{canResend ? 'onResend' : ''}}"
57
+        >
58
+          {{canResend ? '重新发送' : '重新发送(' + countdown + ')'}}
59
+        </text>
60
+      </view> -->
61
+    </view>
62
+  </view>
63
+</view>

+ 185
- 0
package-user/pages/captcha/index.wxss ファイルの表示

@@ -0,0 +1,185 @@
1
+.verification-popup {
2
+  display: none;
3
+  position: fixed;
4
+  top: 0;
5
+  left: 0;
6
+  right: 0;
7
+  bottom: 0;
8
+  z-index: 9999;
9
+}
10
+
11
+/* 显示弹窗 */
12
+.verification-popup.show {
13
+  display: block;
14
+}
15
+
16
+/* 遮罩层 */
17
+.overlay {
18
+  position: absolute;
19
+  top: 0;
20
+  left: 0;
21
+  right: 0;
22
+  bottom: 0;
23
+  background-color: rgba(0, 0, 0, 0.5);
24
+  backdrop-filter: blur(2px);
25
+  animation: fadeIn 0.3s ease;
26
+}
27
+
28
+/* 弹窗内容 */
29
+.popup-content {
30
+  position: absolute;
31
+  top: 40%;
32
+  left: 50%;
33
+  transform: translate(-50%, -50%);
34
+  width: 90%;
35
+  max-width: 400px;
36
+  background-color: #fff;
37
+  border-radius: 16px;
38
+  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
39
+  overflow: hidden;
40
+  animation: scaleIn 0.3s ease;
41
+}
42
+
43
+/* 标题区域 */
44
+.popup-header {
45
+  display: flex;
46
+  justify-content: center;
47
+  align-items: center;
48
+  padding: 20px 24px 16px;
49
+  position: relative;
50
+}
51
+
52
+.title {
53
+  font-size: 18px;
54
+  font-weight: 600;
55
+  color: #1a1a1a;
56
+}
57
+
58
+.close-btn {
59
+  position: absolute;
60
+  right: 24px;
61
+  top: 50%;
62
+  transform: translateY(-50%);
63
+  width: 32px;
64
+  height: 32px;
65
+  display: flex;
66
+  align-items: center;
67
+  justify-content: center;
68
+  border-radius: 50%;
69
+  background-color: #f5f5f5;
70
+}
71
+
72
+/* 提示信息 */
73
+.message {
74
+  text-align: center;
75
+  font-size: 14px;
76
+  color: #666;
77
+  padding: 0 24px 20px;
78
+}
79
+
80
+/* 验证码输入框容器 */
81
+.code-input-container {
82
+  display: flex;
83
+  justify-content: center;
84
+  gap: 10px;
85
+  padding: 0 24px 24px;
86
+  position: relative;
87
+}
88
+
89
+/* 单个验证码输入框 */
90
+.code-input {
91
+  width: 50px;
92
+  height: 50px;
93
+  border-radius: 8px;
94
+  border: 1px solid #ddd;
95
+  display: flex;
96
+  align-items: center;
97
+  justify-content: center;
98
+  font-size: 24px;
99
+  font-weight: 600;
100
+  color: #1a1a1a;
101
+  transition: all 0.2s ease;
102
+}
103
+
104
+/* 激活状态 */
105
+.code-input.active {
106
+  border-color: #07c160;
107
+  box-shadow: 0 0 0 2px rgba(7, 193, 96, 0.2);
108
+}
109
+
110
+/* 已填充状态 */
111
+.code-input.filled {
112
+  border-color: #eee;
113
+  background-color: #fafafa;
114
+}
115
+
116
+/* 实际输入框(隐藏) */
117
+.real-input {
118
+  position: absolute;
119
+  width: 1px;
120
+  height: 1px;
121
+  opacity: 0;
122
+  pointer-events: none;
123
+}
124
+
125
+/* 操作区域 */
126
+.operation-area {
127
+  padding: 0 24px 24px;
128
+}
129
+
130
+/* 确认按钮 */
131
+.confirm-btn {
132
+  width: 100%;
133
+  height: 48px;
134
+  line-height: 48px;
135
+  background-color: #07c160;
136
+  color: #fff;
137
+  font-size: 16px;
138
+  font-weight: 500;
139
+  border-radius: 24px;
140
+  margin-bottom: 16px;
141
+  display: flex;
142
+  align-items: center;
143
+  justify-content: center;
144
+}
145
+
146
+.confirm-btn::after {
147
+  border: none;
148
+}
149
+
150
+.confirm-btn:disabled {
151
+  background-color: #e5e5e5;
152
+  color: #999;
153
+}
154
+
155
+/* 重新发送区域 */
156
+.resend-container {
157
+  display: flex;
158
+  justify-content: center;
159
+  align-items: center;
160
+  gap: 6px;
161
+  font-size: 14px;
162
+  color: #666;
163
+}
164
+
165
+/* 重新发送按钮 */
166
+.resend-btn {
167
+  color: #07c160;
168
+  font-weight: 500;
169
+}
170
+
171
+.resend-btn:not(.active) {
172
+  color: #999;
173
+  pointer-events: none;
174
+}
175
+
176
+/* 动画效果 */
177
+@keyframes fadeIn {
178
+  from { opacity: 0; }
179
+  to { opacity: 1; }
180
+}
181
+
182
+@keyframes scaleIn {
183
+  from { transform: translate(-50%, -50%) scale(0.9); opacity: 0; }
184
+  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
185
+}

pages/login/index.js → package-user/pages/login/index.js ファイルの表示

@@ -1,5 +1,5 @@
1 1
 // pages/login/index.js 
2
-const api = require('../../api/index.js');
2
+const api = require('../../../api/index.js');
3 3
 
4 4
 Page({
5 5
 
@@ -122,15 +122,6 @@ handleAgreePrivacy() {
122 122
   })
123 123
   // 用户同意后,再执行登录流程
124 124
 },
125
-onstatus(){
126
-  if (!this.data.checked) {
127
-    return wx.showToast({
128
-      title: '请勾选同意',
129
-    icon: 'none',
130
-  
131
-    });
132
-  }
133
-},
134 125
 // 获取手机号回调
135 126
 onGetPhoneNumber(e) {
136 127
   console.log(e);
@@ -161,7 +152,7 @@ onGetPhoneNumber(e) {
161 152
         phonecode:e.detail.code,
162 153
         code:code
163 154
       }
164
-      api.request(`/SysPartnerLogController/login`, 'post',obj,{ isPublic: true })
155
+      api.request(`/sysoperation/login`, 'post',obj,{ isPublic: true })
165 156
       .then((data) => {
166 157
    console.log(data);
167 158
    if (data.code == 200) {
@@ -217,7 +208,14 @@ wx.setStorage({
217 208
 
218 209
 
219 210
 },
220
- 
211
+promptcheck(){
212
+  return wx.showToast({
213
+    title: '请勾选同意',
214
+  icon: 'none',
215
+
216
+  });
217
+  
218
+},
221 219
     // 处理登录按钮点击
222 220
     onLogin() {
223 221
            // 获取本地存储的数据

pages/login/index.json → package-user/pages/login/index.json ファイルの表示


+ 24
- 0
package-user/pages/login/index.wxml ファイルの表示

@@ -0,0 +1,24 @@
1
+<!-- pages/user/index.wxml -->
2
+<view class="setup">
3
+  <view class="navigation-container" style="{{'height: ' + navStatusBarHeight +'px'}}">
4
+  <view style="{{'height: ' + statusBarHeight +'px'}}"></view>
5
+  <view class="navigation-bar" style="{{'height:' + navBarHeight +'px'}}">
6
+    <view class="title">晟运能源</view>
7
+  </view>
8
+</view>
9
+<!-- <view style="width: 100%; {{'height: ' + navStatusBarHeight +'px'}}"></view> -->
10
+
11
+ <view><image class="log_image" src="https://esos-iot.bjdexn.cn/myminio/project/fd2b0ab2aadb44bbafd940156bf0cdd7.png" mode="widthFix"/></view>
12
+ <view class="loginbotton">
13
+  <!-- <button wx:if="{{!Loginswitch}}" class="button_button" open-type="getPhoneNumber" bindgetphonenumber="onGetPhoneNumber">手机号一键登录</button> -->
14
+
15
+ <!-- <button wx:if="{{!Loginswitch}}" bindphoneoneclicklogin="onHandleLogin" open-type="phoneOneClickLogin">一键登录按钮</button> -->
16
+ <button wx:if="{{checked}}" class="button_button" color="#00BA6E" open-type="getPhoneNumber" bindgetphonenumber="onGetPhoneNumber">手机号一键登录</button>
17
+ <button wx:if="{{!checked}}" class="button_button" color="#00BA6E" bind:tap="promptcheck">手机号一键登录</button>
18
+ <view class="agreement">
19
+  <t-radio t-class="t_box" value="{{checked}}" icon="dot" data-value="{{checked}}" bind:tap="checkboxChange"/>
20
+ 我已阅读并同意晟运<text class="agreement_color" data-name="服务协议" bind:tap="onprivacy">《服务协议》</text>和<text class="agreement_color" data-name="隐私政策" bind:tap="onprivacy">《隐私政策》</text> 
21
+ </view>
22
+ </view>
23
+
24
+</view>

pages/login/index.wxss → package-user/pages/login/index.wxss ファイルの表示

@@ -1,10 +1,12 @@
1 1
 .setup{
2 2
   width: 100%;
3 3
   height: 100vh;
4
-  background: linear-gradient(to bottom, #0F80DC -40%, #F0F5F5 40%,#F0F5F5 100%);
4
+  /* background: linear-gradient(to bottom, #00C775 -40%, #F0F5F5 40%,#F0F5F5 100%); */
5
+/* background: linear-gradient(to bottom, #EAFFFA -40%, #EAFFFA 100%,#F0F5F5 100%); */
6
+background-color: #f9f9f9;
5 7
   box-sizing: border-box;
6 8
 overflow: hidden;
7
-padding: 0rpx 20rpx;
9
+/* padding: 0rpx 20rpx; */
8 10
 }
9 11
  .title{
10 12
    font-size: 36rpx;
@@ -27,8 +29,8 @@ box-sizing: border-box;
27 29
     margin-top: 40rpx;
28 30
   }
29 31
   .log_image{
30
-    width: 194rpx;
31
-    height: 262rpx;
32
+    width: 100%;
33
+    height: 462rpx;
32 34
   }
33 35
  .log_bottom{
34 36
 width: 100%;
@@ -108,44 +110,47 @@ margin-left: 20rpx;
108 110
  }
109 111
  .loginbotton{
110 112
    width: 100%;
111
-   position: fixed;
113
+   /* position: fixed;
112 114
    bottom: 200rpx;
113
-   left: 0rpx;
115
+   left: 0rpx; */
114 116
    display: flex;
115 117
    flex-direction: column;
116 118
    justify-content: center;
117 119
    align-items: center;
118 120
    box-sizing: border-box;
121
+   margin-top: 40rpx;
119 122
  }
120 123
  button{
121 124
   width: 90%;
122 125
   color: #fff;
123
-background-color: #0F80DC;
126
+background-color: #00C775;
124 127
  }
125 128
  .button_button{
126 129
    width: 90%;
127 130
    color: #fff;
128
- background-color: #0F80DC;
131
+ background-color: #00C775;
129 132
  /* background-color: rgba(15,128,220, 0.3);  */
130 133
   }
131 134
 .agreement{
132 135
   margin-top: 20rpx;
133 136
   display: flex;
134
-  align-items: center;
137
+  flex-wrap: wrap;
135 138
   font-size: 28rpx;
139
+  box-sizing: border-box;
136 140
 }
137 141
 .agreement_color{
138
-  color:#0F80DC;
142
+  color:#00C775;
139 143
   margin:0rpx 6rpx;
140 144
 }
145
+ 
141 146
 .t-radio__icon-dot::after{
142
-  background: var(--td-radio-icon-checked-color, var(--td-brand-color, var(--td-primary-color-7, #0F80DC))) !important;
147
+  background: var(--td-radio-icon-checked-color, var(--td-brand-color, var(--td-primary-color-7, #00C775))) !important;
143 148
 }
144 149
 .t-radio__icon--checked {
145
-  color: var(--td-radio-icon-checked-color, var(--td-brand-color, var(--td-primary-color-7, #0F80DC))) !important;
150
+  color: var(--td-radio-icon-checked-color, var(--td-brand-color, var(--td-primary-color-7, #00C775))) !important;
146 151
 }
147 152
 .t-radio__icon-dot{
148
-  border: 3px solid var(--td-radio-icon-checked-color, var(--td-brand-color, var(--td-primary-color-7, #0F80DC))) !important;
153
+  border: 3px solid var(--td-radio-icon-checked-color, var(--td-brand-color, var(--td-primary-color-7, #00C775))) !important;
149 154
 }
150 155
 .t-radio--block{
151 156
   padding: var(--td-radio-vertical-padding, 0rpx) !important;

pages/privacy/index.js → package-user/pages/privacy/index.js ファイルの表示


pages/privacy/index.json → package-user/pages/privacy/index.json ファイルの表示


pages/privacy/index.wxml → package-user/pages/privacy/index.wxml ファイルの表示


pages/privacy/index.wxss → package-user/pages/privacy/index.wxss ファイルの表示


+ 105
- 0
package-user/pages/slide-confirm/index.js ファイルの表示

@@ -0,0 +1,105 @@
1
+Component({
2
+  properties: {
3
+    width: {
4
+      type: Number,
5
+      value: 300
6
+    },
7
+    height: {
8
+      type: Number,
9
+      value: 80
10
+    },
11
+    blockSize: {
12
+      type: Number,
13
+      value: 76
14
+    },
15
+    defaultText: {
16
+      type: String,
17
+      value: "向右滑动完成验证"
18
+    },
19
+    successText: {
20
+      type: String,
21
+      value: "验证通过"
22
+    },
23
+    iconSize: {
24
+      type: Number,
25
+      value: 24
26
+    }
27
+  },
28
+
29
+  data: {
30
+    position: 0,          // 滑块位置
31
+    progressWidth: 0,     // 已滑动宽度
32
+    startX: 0,            // 触摸起始X坐标
33
+    isMoving: false,      // 是否正在滑动
34
+    isSuccess: false      // 是否验证成功
35
+  },
36
+
37
+  methods: {
38
+    // 触摸开始
39
+    onTouchStart(e) {
40
+      if (this.data.isSuccess) return;
41
+      
42
+      this.setData({
43
+        startX: e.touches[0].clientX,
44
+        isMoving: true
45
+      });
46
+    },
47
+
48
+    // 触摸移动
49
+    onTouchMove(e) {
50
+      if (!this.data.isMoving || this.data.isSuccess) return;
51
+      
52
+      const moveX = e.touches[0].clientX;
53
+      let position = moveX - this.data.startX;
54
+      
55
+      // 限制滑块范围
56
+      if (position < 0) position = 0;
57
+      const maxPosition = this.data.width - this.data.blockSize;
58
+      if (position > maxPosition) position = maxPosition;
59
+      
60
+      this.setData({
61
+        position,
62
+        progressWidth: position + this.data.blockSize  // 进度宽度 = 滑块位置 + 滑块宽度
63
+      });
64
+    },
65
+
66
+    // 触摸结束
67
+    onTouchEnd() {
68
+      if (!this.data.isMoving || this.data.isSuccess) return;
69
+      
70
+      this.setData({ isMoving: false });
71
+      
72
+      // 判断是否滑动到终点
73
+      const maxPosition = this.data.width - this.data.blockSize;
74
+      if (this.data.position >= maxPosition * 0.95) {
75
+        // 验证成功
76
+        this.setData({
77
+          position: maxPosition,
78
+          progressWidth: this.data.width,
79
+          isSuccess: true
80
+        });
81
+        // 触发成功事件
82
+        this.triggerEvent('success');
83
+      } else {
84
+        // 滑动不足,重置
85
+        this.setData({
86
+          position: 0,
87
+          progressWidth: 0
88
+        });
89
+      }
90
+    },
91
+
92
+    // 重置滑块
93
+    reset() {
94
+      this.setData({
95
+        position: 0,
96
+        progressWidth: 0,
97
+        isSuccess: false
98
+      });
99
+    }
100
+  }
101
+});
102
+
103
+// box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1) inset;
104
+
105
+// transition: background-color 0.3s;

+ 4
- 0
package-user/pages/slide-confirm/index.json ファイルの表示

@@ -0,0 +1,4 @@
1
+{
2
+  "component": true,
3
+  "usingComponents": {}
4
+}

+ 27
- 0
package-user/pages/slide-confirm/index.wxml ファイルの表示

@@ -0,0 +1,27 @@
1
+<view class="slide-container {{isSuccess ? 'success' : ''}}" style="width: {{width}}px; height: {{height}}px;">
2
+  <!-- 已滑动区域(用于显示颜色变化) -->
3
+  <view 
4
+    class="slide-progress" 
5
+    style="width: {{progressWidth}}px; height: {{height}}px;"
6
+  ></view>
7
+  
8
+  <!-- 背景轨道 -->
9
+  <view class="slide-track">
10
+    <text class="track-text">{{isSuccess ? successText : defaultText}}</text>
11
+  </view>
12
+  
13
+  <!-- 滑块 -->
14
+  <view 
15
+    class="slide-block"
16
+    style="left: {{position}}px; width: {{blockSize}}px; height: {{blockSize}}px;"
17
+    bindtouchstart="onTouchStart"
18
+    bindtouchmove="onTouchMove"
19
+    bindtouchend="onTouchEnd"
20
+  >
21
+    <icon 
22
+      class="block-icon" 
23
+      type="{{isSuccess ? 'success' : 'arrowright'}}" 
24
+      size="{{iconSize}}"
25
+    ></icon>
26
+  </view>
27
+</view>

+ 64
- 0
package-user/pages/slide-confirm/index.wxss ファイルの表示

@@ -0,0 +1,64 @@
1
+.slide-container {
2
+  position: relative;
3
+  overflow: hidden;
4
+  border-radius: 40px;
5
+  background-color: #f5f5f5;
6
+  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
7
+}
8
+
9
+/* 已滑动区域样式 */
10
+.slide-progress {
11
+  position: absolute;
12
+  top: 0;
13
+  left: 0;
14
+  background-color: #29e77c; /* 滑动过的区域颜色 */
15
+  z-index: 1;
16
+  transition: background-color 0.3s ease;
17
+}
18
+
19
+/* 成功状态下的滑动区域颜色 */
20
+.slide-container.success .slide-progress {
21
+  background-color: #00c775; /* 验证成功后的颜色 */
22
+}
23
+
24
+.slide-track {
25
+  position: absolute;
26
+  width: 100%;
27
+  height: 100%;
28
+  display: flex;
29
+  align-items: center;
30
+  justify-content: center;
31
+  z-index: 2;
32
+}
33
+
34
+.track-text {
35
+  font-size: 14px;
36
+  color: #666;
37
+}
38
+
39
+.slide-container.success .track-text {
40
+  color: #fff;
41
+}
42
+
43
+.slide-block {
44
+  position: absolute;
45
+  top: 0;
46
+  background-color: #fff;
47
+  border-radius: 40px;
48
+  display: flex;
49
+  align-items: center;
50
+  justify-content: center;
51
+  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
52
+  z-index: 3;
53
+  touch-action: none;
54
+}
55
+
56
+.block-icon {
57
+  color: #00c775;
58
+}
59
+
60
+
61
+
62
+/* eaffea */
63
+
64
+/* 52c41a */

pages/malfunction/index.js → package-user/pages/userlist/index.js ファイルの表示

@@ -1,26 +1,45 @@
1
-// pages/malfunction/index.js
1
+// pages/userlist/index.js
2
+const api = require('../../../api/index.js');
3
+
2 4
 Page({
3 5
 
4 6
   /**
5 7
    * 页面的初始数据
6 8
    */
7 9
   data: {
8
-
10
+  userdata:[]
9 11
   },
10 12
 
11 13
   /**
12 14
    * 生命周期函数--监听页面加载
13 15
    */
14 16
   onLoad(options) {
15
-
16
-  },
17
-  toconfigure(e){
18
-    console.log(e.currentTarget.dataset.name);
19
- wx.navigateTo({
20
-   url: `/pages/workorder/index?name=${e.currentTarget.dataset.name}`,
21
- })
22
-  },
23
-  
17
+ this.getuser()
18
+  },  
19
+getuser(){
20
+  let data ={
21
+    operationId:'',
22
+    operationname:'',
23
+    operationphone:'',
24
+    addressId:''
25
+  }
26
+  api.request(`/syscustomer/selectcustomer`, 'post',data,{ isPublic: false })
27
+  .then((data) => {
28
+console.log(data.data);
29
+if (data.code==200) {
30
+  this.setData({
31
+    userdata:data.data
32
+  })
33
+}
34
+//  wx.navigateTo({
35
+//   url: '/pages/map/index',
36
+// })
37
+  })
38
+  .catch((err) => {
39
+ 
40
+    console.error('请求失败:', err);
41
+  });
42
+},
24 43
   /**
25 44
    * 生命周期函数--监听页面初次渲染完成
26 45
    */

+ 4
- 0
package-user/pages/userlist/index.json ファイルの表示

@@ -0,0 +1,4 @@
1
+{
2
+  "navigationBarTitleText": "用户列表",
3
+  "usingComponents": {}
4
+}

+ 12
- 0
package-user/pages/userlist/index.wxml ファイルの表示

@@ -0,0 +1,12 @@
1
+<!--pages/userlist/index.wxml-->
2
+<view class="setup">
3
+  <view class="driver-info" wx:for="{{userdata}}" wx:key="operationId">
4
+      <image src="https://esos-iot.bjdexn.cn/myminio/project/2a1b32553c3d4ef992bc797d26cf1614.png" class="driver-avatar"></image>
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>
9
+      </view>
10
+      <!-- <button class="cancel-btn" bindtap="cancelOrder">去查看</button> -->
11
+    </view>
12
+</view>

+ 59
- 0
package-user/pages/userlist/index.wxss ファイルの表示

@@ -0,0 +1,59 @@
1
+/* pages/userlist/index.wxss */
2
+page{
3
+  width: 100%;
4
+  height: 100vh;
5
+  background: linear-gradient(to bottom, #F0F5F5 -40%, #F0F5F5 40%,#F0F5F5 100%);
6
+  padding: 0rpx 22rpx;
7
+  box-sizing: border-box;
8
+
9
+}
10
+.driver-info {
11
+  background-color: white;
12
+  border-radius: 16rpx;
13
+  padding: 20rpx;
14
+  box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1);
15
+  display: flex;
16
+  align-items: center;
17
+  margin-top: 26rpx;
18
+}
19
+
20
+.driver-avatar {
21
+  width: 100rpx;
22
+  height: 100rpx;
23
+  border-radius: 50%;
24
+}
25
+
26
+.driver-details {
27
+  margin-left: 24rpx;
28
+  flex: 1;
29
+}
30
+
31
+.driver-name {
32
+  font-size: 32rpx;
33
+  font-weight: bold;
34
+}
35
+.driver-car {
36
+  font-size: 28rpx;
37
+  color: #999999;
38
+  margin-top: 8rpx;
39
+}
40
+
41
+.driver-arrive {
42
+  font-size: 28rpx;
43
+  /* color: #2C85FF; */
44
+  /* color: #666; */
45
+  color: #999999;
46
+
47
+  margin-top: 8rpx;
48
+}
49
+
50
+.cancel-btn {
51
+  width: 160rpx;
52
+  height: 64rpx;
53
+  line-height: 64rpx;
54
+  font-size: 28rpx;
55
+  color: #FF5252;
56
+  border: 1rpx solid #FF5252;
57
+  background-color: white;
58
+  border-radius: 32rpx;
59
+}

+ 0
- 147
pages/device/index.js ファイルの表示

@@ -1,147 +0,0 @@
1
-// pages/device/index.js
2
-const api = require('../../api/index.js');
3
-
4
-Page({
5
-
6
-  /**
7
-   * 页面的初始数据
8
-   */
9
-  data: {
10
-    devicedata:[],
11
-    latitude:'',
12
-    longitude:'',
13
-    accuracy:'',
14
-    array:['南山','临平','其他'],
15
-    index:0
16
-  },
17
-
18
-  /**
19
-   * 生命周期函数--监听页面加载
20
-   */
21
-  onLoad(options) {
22
-
23
-  },
24
-
25
-  /**
26
-   * 生命周期函数--监听页面初次渲染完成
27
-   */
28
-  onReady() {
29
-this.getdevice()
30
-  },
31
-  getdevice(){
32
-    let data = {
33
-    }
34
-    api.request(`/device/selectdevice`, 'POST',data)
35
-    .then((res) => {
36
-      console.log(res);
37
-      if (res.code==200) {
38
-       
39
-                      for (let index = 0; index < res.data.length; index++) {
40
-                        if (res.data[index].devicesLatitudelongitude) {
41
-          
42
-                          res.data[index].devicesLatitudelongitude=res.data[index].devicesLatitudelongitude.split(",")
43
-                        }
44
-                      }
45
-        this.setData({
46
-          devicedata : res.data
47
-        })
48
-      }
49
-  
50
-    })
51
-    .catch((err) => {
52
-      console.error('请求失败:', err);
53
-      // 在这里处理请求失败的情况
54
-    });
55
-  },
56
-  // 设置当前经纬度
57
-    // 提取获取位置的具体逻辑
58
-    getLocation(e) {
59
-      console.log(e.target.dataset.id);
60
-      const that = this;
61
-      wx.getLocation({
62
-        type: 'wgs84',
63
-        isHighAccuracy:true,
64
-        success: (res) => {
65
-          console.log('位置获取成功:', res);
66
-          that.setData({
67
-            latitude: res.latitude,
68
-            longitude: res.longitude,
69
-            accuracy:res.accuracy
70
-          });
71
-          console.log(this.data.latitude);
72
-          console.log(this.data.longitude);
73
-          that.getpositioning(res.longitude,res.latitude,e.target.dataset.id);
74
-        },
75
-        fail: (err) => {
76
-          console.error('获取位置失败:', err);
77
-          wx.showToast({
78
-            title: '获取位置失败,请重试',
79
-            icon: 'none'
80
-          });
81
-        }
82
-      })},
83
-      getpositioning(latitude,longitude,id){
84
-        let data = {
85
-          deviceId:id,
86
-          latitudelongitude:latitude+','+longitude
87
-        }
88
-        api.request(`/device/updatelatit`, 'POST',data)
89
-        .then((res) => {
90
-          console.log(res);
91
-          if (res.code==200) {
92
-            wx.showToast({
93
-              title: '位置获取成功',
94
-              icon: 'none'
95
-            });
96
-this.getdevice()
97
-          
98
-          }
99
-      
100
-        })
101
-        .catch((err) => {
102
-          console.error('请求失败:', err);
103
-          // 在这里处理请求失败的情况
104
-        });
105
-      },
106
-  /**
107
-   * 生命周期函数--监听页面显示
108
-   */
109
-  onShow() {
110
-
111
-  },
112
-
113
-  /**
114
-   * 生命周期函数--监听页面隐藏
115
-   */
116
-  onHide() {
117
-
118
-  },
119
-
120
-  /**
121
-   * 生命周期函数--监听页面卸载
122
-   */
123
-  onUnload() {
124
-
125
-  },
126
-
127
-  /**
128
-   * 页面相关事件处理函数--监听用户下拉动作
129
-   */
130
-  onPullDownRefresh() {
131
-
132
-  },
133
-
134
-  /**
135
-   * 页面上拉触底事件的处理函数
136
-   */
137
-  onReachBottom() {
138
-
139
-  },
140
-
141
-  /**
142
-   * 用户点击右上角分享
143
-   */
144
-  onShareAppMessage() {
145
-
146
-  }
147
-})

+ 0
- 39
pages/device/index.wxml ファイルの表示

@@ -1,39 +0,0 @@
1
-<!--pages/device/index.wxml-->
2
-<view class="device">
3
-<!-- <view class="equipment">
4
-  <picker bindcolumnchange="bindcolumn" bindchange="bindeventChange" value="{{index}}" range="{{array}}">
5
-					<view class="calculation_top">
6
-						<view class="calculation_left">
7
-             选择电站:
8
-						</view>
9
-            <view class="event">
10
-						<view class="uni-input">{{array[index]}}</view>
11
-							<t-icon name="chevron-right" size="40rpx" data-name="chevron-right"/>
12
-            </view>
13
-					</view>
14
-				</picker>
15
-</view> -->
16
-<view class="device_box" wx:for="{{devicedata}}" wx:key="index">
17
-<view class="device_and">
18
-<view>
19
-<text class="device_color">资产编码:</text> {{item.deviceId}}
20
-</view>
21
-
22
-<!-- <view class="device_latitude" data-id="{{item.deviceId}}" bind:tap="getLocation" wx:if="{{item.devicesLatitudelongitude.length==0||item.devicesLatitudelongitude==null}}">获取当前经纬度</view> -->
23
-<!-- <view>{{accuracy}}</view>
24
-<view class="device_latitude" data-id="{{item.deviceId}}" bind:tap="getLocation">获取当前经纬度</view> -->
25
-</view>
26
-<view class="device_content">
27
-<text class="device_color">资产名称:</text> {{item.devicesName}}</view>
28
-<view class="device_content">
29
-<text class="device_color">设备所属:</text> {{item.powerstationName}} > {{item.regionName}}
30
-</view>
31
-<view class="device_content"><text class="device_color">经度:</text> {{item.devicesLatitudelongitude[0]||'--'}}</view>
32
-<view class="device_content"><text class="device_color">纬度:</text> {{item.devicesLatitudelongitude[1]||'--'}}</view>
33
-<view class="device_content">
34
-<text class="device_color">设备地址:</text> {{item.devicesAddress}}
35
-</view>
36
-</view>
37
-
38
-
39
-</view>

+ 0
- 48
pages/device/index.wxss ファイルの表示

@@ -1,48 +0,0 @@
1
-/* pages/device/index.wxss */
2
-page{
3
-  background-color: #f7f7f7;
4
-  box-sizing: border-box;
5
-}
6
-.device{
7
-  width: 100%;
8
-  height: 100%;
9
-padding: 10rpx 20rpx 20rpx 20rpx;
10
-box-sizing: border-box;
11
-}
12
-.device_box{
13
-  width: 100%;
14
-  background-color: #ffffff;
15
-  border-radius: 10rpx;
16
-  padding: 20rpx;
17
-  box-sizing: border-box;
18
-  margin-top: 20rpx;
19
-}
20
-.device_content{
21
-margin-top: 20rpx;
22
-}
23
-.device_color{
24
-  color: #cccccc;
25
-}
26
-.device_and{
27
-  display: flex;
28
-  align-items: center;
29
-  justify-content: space-between;
30
-}
31
-.device_latitude{
32
- padding: 10rpx 20rpx;
33
-display: flex;
34
-align-items: center;
35
-justify-content: center;
36
-box-sizing: border-box;
37
-color: #ffffff;
38
-background-color: #0F80DC;
39
-border-radius: 10rpx;
40
-}
41
-.equipment{
42
-  padding: 20rpx;
43
-background-color: #ffffff;
44
-border-radius: 10rpx;
45
-}
46
-.calculation_top{
47
-  display: flex;
48
-}

+ 52
- 0
pages/equipment/index.js ファイルの表示

@@ -0,0 +1,52 @@
1
+const api = require('../../api/index.js');
2
+Page({
3
+
4
+  data: {
5
+    tabsindex:"1",
6
+  },
7
+  onLoad() {
8
+  },
9
+  // 选项卡
10
+  onTabsChange(e){
11
+  console.log(e.detail.value);
12
+  this.setData({
13
+    tabsindex:e.detail.value
14
+  })
15
+  this.getvehicle()
16
+  },
17
+  getvehicle(){
18
+    let data ={
19
+      carId:'',
20
+      carType:'',
21
+      carMondel:'',
22
+    }
23
+    api.request(`/syscar/selectcarall`, 'post',data,{ isPublic: false })
24
+    .then((data) => {
25
+  console.log(data.data);
26
+  if (data.code==200) {
27
+    this.setData({
28
+      driver:data.data
29
+    })
30
+  }
31
+  //  wx.navigateTo({
32
+  //   url: '/pages/map/index',
33
+  // })
34
+    })
35
+    .catch((err) => {
36
+   
37
+      console.error('请求失败:', err);
38
+    });
39
+  },
40
+   
41
+  onShow() {
42
+    this.getvehicle()
43
+ 
44
+  },
45
+   /**
46
+   * 页面相关事件处理函数--监听用户下拉动作
47
+   */
48
+   onPullDownRefresh() {
49
+
50
+
51
+  }
52
+});

+ 16
- 0
pages/equipment/index.json ファイルの表示

@@ -0,0 +1,16 @@
1
+{
2
+  "navigationBarTitleText": "设备监控",
3
+  "usingComponents": {
4
+      "t-side-bar": "tdesign-miniprogram/side-bar/side-bar",
5
+      "t-side-bar-item": "tdesign-miniprogram/side-bar-item/side-bar-item",
6
+      "t-cell-group": "tdesign-miniprogram/cell-group/cell-group",
7
+      "t-cell": "tdesign-miniprogram/cell/cell",
8
+      "t-image": "tdesign-miniprogram/image/image",
9
+      "t-tabs": "tdesign-miniprogram/tabs/tabs",
10
+      "t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel",
11
+      "t-icon": "tdesign-miniprogram/icon/icon",
12
+      "t-popup": "tdesign-miniprogram/popup/popup",
13
+      "t-radio-group": "tdesign-miniprogram/radio-group/radio-group",
14
+      "t-radio": "tdesign-miniprogram/radio/radio"
15
+  }
16
+}

+ 66
- 0
pages/equipment/index.wxml ファイルの表示

@@ -0,0 +1,66 @@
1
+  <view class="workorder">
2
+  <t-tabs value="{{tabsindex}}" bind:change="onTabsChange" bind:click="onTabsClick" t-class="custom-tabs" split="{{false}}">
3
+    <t-tab-panel label="全部" value="1" />
4
+    <t-tab-panel label="在线" value="2" />
5
+  <t-tab-panel label="离线" value="3" />
6
+</t-tabs>
7
+<!-- <view bind:tap="onfilter">
8
+  <t-icon name="filter" size="50rpx" color="#585CE5" data-name="filter" />
9
+</view> -->
10
+</view>
11
+<view style="height: 100rpx;"></view>
12
+
13
+<view class="order">
14
+<view class="order_box">
15
+<view class="order_title">
16
+<view class="order_title1"> <image class="order_image" src="https://esos-iot.bjdexn.cn/myminio/project/cf5ff29715de46b88803cf802e81e1a9.png" mode="aspectFit"/> 浙C.78Z71</view>
17
+<!-- <view class="order_title1"> <image class="order_image" src="https://esos-iot.bjdexn.cn/myminio/proje  ct/94f976d5afce444a8861b59681069218.png" mode="aspectFit"/> 浙C.78Z71</view> -->
18
+<view>在线</view>
19
+</view>
20
+<!-- <view class="order_direction"><text class="order_text">方向:</text>
21
+<text style="color: #FDBA67;">放电</text>
22
+<text style="color: #00C775;">充电</text>
23
+</view> -->
24
+<view class="order_time">
25
+<view>
26
+<text class="order_text"> 方向:</text>
27
+<text style="color: #FDBA67;">放电</text>
28
+<text style="color: #00C775;">充电</text>
29
+</view>
30
+<view>
31
+  <view>
32
+<text class="order_text"> SOC:</text><text>--</text>
33
+</view>
34
+</view>
35
+
36
+</view>
37
+<view class="order_time">
38
+<view>
39
+<text class="order_text"> 电压:</text><text>--</text>
40
+</view>
41
+<view>
42
+  <view>
43
+<text class="order_text"> 液冷:</text><text>--</text>
44
+</view>
45
+</view>
46
+
47
+</view>
48
+<view class="order_time">
49
+<view>
50
+<text class="order_text">充电:</text> <text>--</text>
51
+</view>
52
+<view>
53
+<text class="order_text">放电:</text> <text>--</text>
54
+</view>
55
+</view>
56
+<view class="order_bottom">
57
+<view></view>
58
+<!-- <view class="order_view">查看详情</view> -->
59
+</view>
60
+</view>
61
+<view class="available" wx:if="{{true}}">
62
+<image src="https://esos-iot.bjdexn.cn/myminio/project/9efa1691f71a48b6ae20648c0a2dae56.png" mode="aspectFit"/>
63
+</view> 
64
+</view>
65
+<view style="height: 30rpx;"></view>
66
+<!---->

+ 157
- 0
pages/equipment/index.wxss ファイルの表示

@@ -0,0 +1,157 @@
1
+page {
2
+  background-color: var(--td-bg-color-container);
3
+  /* background-color: #f9f9f9; */
4
+  background: linear-gradient(to bottom, #F0F5F5 -40%, #F0F5F5 40%,#F0F5F5 100%);
5
+
6
+}
7
+
8
+page .round-image {
9
+  border-radius: 12rpx;
10
+}
11
+
12
+.side-bar-wrapper {
13
+  display: flex;
14
+  height: 100vh;
15
+  overflow: hidden;
16
+
17
+  --td-grid-item-text-font-size: 24rpx;
18
+}
19
+
20
+.side-bar-wrapper .content {
21
+  flex: 1;
22
+  transition: transform 0.3s ease;
23
+}
24
+
25
+.side-bar-wrapper .section {
26
+  padding: 32rpx 0;
27
+  box-sizing: border-box;
28
+  height: 100%;
29
+}
30
+
31
+.side-bar-wrapper .title {
32
+  padding-left: 40rpx;
33
+  margin-bottom: 8rpx;
34
+  font-size: 28rpx;
35
+  line-height: 44rpx;
36
+  color: var(--td-text-color-primary);
37
+}
38
+
39
+.side-bar-wrapper .image {
40
+  width: 96rpx;
41
+  height: 96rpx;
42
+
43
+  position: relative;
44
+}
45
+
46
+.side-bar-wrapper .cell {
47
+  margin-right: 32rpx !important;
48
+}
49
+
50
+.side-bar-wrapper .image::before {
51
+  content: ' ';
52
+  position: absolute;
53
+  top: 0;
54
+  left: 0;
55
+  width: 200%;
56
+  height: 200%;
57
+  border-radius: 24rpx;
58
+  border: 2rpx solid var(--td-gray-color-4);
59
+  transform-origin: 0 0;
60
+  transform: scale(0.5);
61
+}
62
+.t-cell__title-text{
63
+  font-size: 22rpx;
64
+}
65
+.t-class-title{
66
+  font-size: 22rpx;
67
+}
68
+.t-cell__description-text{
69
+  font-size: 24rpx;
70
+}
71
+.t-image{
72
+  padding: 20rpx;
73
+  background-color: #f5f5f5;
74
+box-sizing: border-box;
75
+}
76
+.calculation{
77
+  width: 100%;
78
+  height: 100rpx;
79
+}
80
+/*  */
81
+.workorder{
82
+  width: 100%;
83
+  padding: 0rpx 40rpx 0rpx 20rpx;
84
+  position: fixed;
85
+  top: 0rpx;
86
+  left: 0rpx;
87
+  display: flex;
88
+  align-items: center;
89
+  justify-content: space-between;
90
+  background-color: #ffffff;
91
+  box-sizing: border-box;
92
+}
93
+.order{
94
+
95
+padding: 0rpx 20rpx;
96
+
97
+}
98
+.order_box{
99
+  width: 100%;
100
+  background-color: #ffffff;
101
+padding: 20rpx 20rpx;
102
+box-sizing: border-box;
103
+  margin-top: 20rpx;
104
+  border-radius: 10rpx;
105
+  /* box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1); */
106
+  box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1);
107
+
108
+}
109
+.order_title{
110
+  padding-bottom:12rpx;
111
+  display: flex;
112
+  align-items: center;
113
+  justify-content: space-between;
114
+  border-bottom: 1rpx solid #cccccc;
115
+}
116
+.order_title1{
117
+display: flex;
118
+align-items: center;
119
+}
120
+.order_image {
121
+  width: 60rpx;
122
+  height: 60rpx;
123
+  margin-right: 20rpx;
124
+}
125
+.order_direction{
126
+  margin-top: 40rpx;
127
+
128
+}
129
+.order_text{
130
+  color: #cccccc;
131
+}
132
+.order_address{
133
+margin-top: 20rpx;
134
+}
135
+.order_time{
136
+margin-top: 20rpx;
137
+padding: 0rpx 20rpx;
138
+display: flex;
139
+justify-content: space-between;
140
+}
141
+.order_bottom{
142
+  display: flex;
143
+  align-items: center;
144
+  justify-content:space-between;
145
+}
146
+.order_view{
147
+margin-top: 20rpx;
148
+padding: 10rpx 20rpx;
149
+color: #ffffff;
150
+font-weight: 500;
151
+display: flex;
152
+align-items: center;
153
+justify-content: center;
154
+text-align: right;
155
+border-radius:50rpx;
156
+background-color: #00C775;
157
+}

+ 348
- 212
pages/index/index.js ファイルの表示

@@ -1,241 +1,377 @@
1
-// pages/privacy/index.js
2 1
 const api = require('../../api/index.js');
3 2
 
4 3
 Page({
5
-
6
-  /**
7
-   * 页面的初始数据
8
-   */
9 4
   data: {
10
-    // 状态栏高度
11
- statusBarHeight:'',
12
- // 导航栏高度
13
- navBarHeight:'',
14
- // 导航栏和状态栏高度
15
- navStatusBarHeight: '',
16
- // 胶囊
17
- menu:'',
18
- workorder:[],
19
- reviewdata:[]
20
-  },
5
+    // 地图初始中心坐标(北京市中心)
6
+    longitude: 116.404,
7
+    latitude: 39.915,
8
+    scale:10,
9
+    markers: [],
10
+    polyline: [],
11
+    startLocation: {},
12
+    endLocation: {},
13
+    showTripInfo: true,
14
+    showCallButton: true,
15
+    showDriverInfo: true,
16
+    carsNearby: 0,
17
+    // 司机信息
18
+    driverAvatar: 'https://esos-iot.bjdexn.cn/myminio/project/2a1b32553c3d4ef992bc797d26cf1614.png',
19
+    driverName: '王师傅',
20
+    carNumber: '京A88888',
21
+    estimatedArrival: 5,
22
+    locationTimer: null,
23
+    isTracking: false,
24
+    userdata:[]
25
+  },  
26
+// 收益统计
27
+  onLoad() {
28
+    // 初始化地图
29
+this.getuser()
30
+this.initMap()
21 31
 
22
-  /**
23
-   * 生命周期函数--监听页面加载
24
-   */
25
-  onLoad(options) {
26
- this.getuser()
27
- this.getShowScreenHeight()
28
-this.setData({
29
-  statusBarHeight:wx.getStorageSync('statusBarHeight'),
30
-  navBarHeight: wx.getStorageSync('navBarHeight'),
31
-  navStatusBarHeight:wx.getStorageSync('navStatusBarHeight'),
32
-  menu:wx.getStorageSync('menu')
33
-})
34 32
   },
35
-  getShowScreenHeight(){
36
-    //系统信息
37
-    const systemInfo = wx.getWindowInfo()
38
-    //胶囊位置
39
-    const capsuleInfo = wx.getMenuButtonBoundingClientRect()
40
-    //计算导航栏高度
41
-    let navHeight = systemInfo.statusBarHeight + capsuleInfo.height + (capsuleInfo.top - systemInfo.statusBarHeight) * 2
42
-    //计算tabbar高度    
43
-    let tabHeight = systemInfo.safeArea.bottom - systemInfo.safeArea.height
44
-    //计算可现实内容高度(中间区域)
45
-    // let screenHeight = systemInfo.screenHeight-navHeight-tabHeight-30
46
-
47
-
48
-  const menu =  wx.getMenuButtonBoundingClientRect()
49
-  wx.setStorageSync('menu', menu)
50
-    // 手机系统状态栏高度
51
-    wx.setStorageSync('statusBarHeight', tabHeight)
52
-   // 导航栏高度
53
-   wx.setStorageSync('navBarHeight', menu.height+(menu.top-systemInfo.statusBarHeight) *2 )
54
-  
55
-   // 状态栏加导航栏
56
-
57
-   wx.setStorageSync('navStatusBarHeight',navHeight)
33
+getuser(){
58 34
  
59
-  },
60
-  getuser(){
61
-    api.request(`/partner/selectinformation`, 'POST',{})
62
-    .then((res) => {
63
-                 // 设置数据到本地存储
64
-                 wx.setStorage({
65
-                  key: 'partnerPosition',  // 存储的key值
66
-                  data:res.data,
67
-                  success: function(ress) {
68
-                
69
-                    // wx.getStorageSync('token');
70
-                  }
71
-                });
72
-    })
73
-    .catch((err) => {
74
-      console.error('请求失败:', err);
75
-      // 在这里处理请求失败的情况
76
-    });
77
-  },
78
-  getworkoder(){
79
-    let data = {
80
-      workorderType:''
35
+  api.request(`/sysoperation/selectoperationid`, 'post',{ isPublic: false })
36
+  .then((data) => {
37
+    console.log(data.data);
38
+    if (data.code==200) {
39
+               // 设置数据到本地存储
40
+wx.setStorage({
41
+  key: 'user',  // 存储的key值
42
+  data:data.data
43
+});
44
+   
81 45
     }
82
-    api.request(`/workoder/statistics`, 'POST',data)
83
-    .then((res) => {
84
-      console.log(res);
85
-      this.setData({
86
-        workorder:res.data
87
-      })
88
-    })
89
-    .catch((err) => {
90
-      console.error('请求失败:', err);
91
-      // 在这里处理请求失败的情况
46
+  })
47
+  .catch((err) => {
48
+    console.error('请求失败:', err);
49
+  });
50
+},
51
+  // 初始化地图,获取用户位置
52
+  initMap() {
53
+    const that = this;
54
+    
55
+    // 获取用户当前位置
56
+    wx.getLocation({
57
+      type: 'gcj02', // 国测局坐标系,微信地图使用该坐标系
58
+      success(res) {
59
+        const longitude = res.longitude;
60
+        const latitude = res.latitude;
61
+        
62
+        // 更新地图中心位置
63
+        that.setData({
64
+          longitude,
65
+          latitude,
66
+          startLocation: {
67
+            longitude,
68
+            latitude,
69
+            name: '我的位置'
70
+          },
71
+          // 添加起点标记
72
+          markers: [{
73
+            id: 0,
74
+            longitude,
75
+            latitude,
76
+            iconPath: 'https://esos-iot.bjdexn.cn/myminio/project/a0d245bf00c6493d949c3be82a6d2b98.png',
77
+            width: 40,
78
+            height: 40,
79
+            anchor: {x: 0.5, y: 1}
80
+          }]
81
+        });
82
+        
83
+        // 逆地址解析,获取位置名称
84
+        that.reverseGeocoder(longitude, latitude, 'start');
85
+         // 加载附近车辆数据
86
+         that.getloadNearbyCars();
87
+
88
+      },
89
+      fail() {
90
+        wx.showToast({
91
+          title: '无法获取位置,请检查权限',
92
+          icon: 'none'
93
+        });
94
+      }
92 95
     });
93 96
   },
94
-  getreview(){
95
-    let data = {
96
-      workorderName:'',
97
-      workorderType:'',
98
-      workorderAddress:'',
99
-      starttime:'',
100
-      type:'',
101
-      examineType:5
102
-    }
103
-    api.request(`/workoder/selectworkoder`, 'POST',data)
104
-    .then((res) => {
105
-      console.log(res);
106
-      this.setData({
107
-        reviewdata:res.data
108
-      })
109
-    })
110
-    .catch((err) => {
111
-      console.error('请求失败:', err);
112
-      // 在这里处理请求失败的情况
97
+
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
+      }
113 123
     });
114 124
   },
115
-  rolelocate(e){
116
-    console.log(e.currentTarget.dataset.index);
117
-    if (e.currentTarget.dataset.index==1) {
118
- if (wx.getStorageSync('partnerPosition').partnerPosition==1) {
119
-  wx.showToast({
120
-    title: '暂无权限',
121
-    icon: 'none'
122
-  });
123
-    return
124
- }
125
-      wx.navigateTo({
126
-        url: '/pages/malfunction/index',
127
-      })   
128
-    }else if(e.currentTarget.dataset.index==2){
129
-      wx.navigateTo({
130
-        url: '/pages/statistics/index',
131
-      })   
132
-    }else if(e.currentTarget.dataset.index==3){
133
-      wx.navigateTo({
134
-        url: '/pages/device/index',
135
-      })   
136
-    }else if(e.currentTarget.dataset.index==4){
137
-      wx.navigateTo({
138
-        url: '/pages/scheduling/index',
139
-      })  
140
-    }
141
-  
142
-  },
143
-  ondetails(e){
144
-    console.log(e.currentTarget.dataset.id);
125
+  // 预约叫车
126
+  onelectricity(){
145 127
 wx.navigateTo({
146
-  url: `/pages/workorderdetails/index?id=${e.currentTarget.dataset.id}&workorderId=${e.currentTarget.dataset.workorderid}`,
128
+  url: '/package-order/pages/createorder/index',
147 129
 })
148 130
   },
149
-  /**
150
-   * 生命周期函数--监听页面初次渲染完成
151
-   */
152
-  onReady() {
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
+  },
153 214
 
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;
154 227
   },
155 228
 
156
-  /**
157
-   * 生命周期函数--监听页面显示 
158
-   */
159
-  onShow() {
160
-    let _this = this
161
-          _this.authorizationbtn()
162
-          _this.getworkoder()
163
-          _this.getreview()
164
-    // wx.getSetting({
165
-    //   withSubscriptions: true,
166
-    //   success (res) {
167
-    //     console.log(res.authSetting)
168
-    //     if (res.authSetting['scope.subscribeMessage']) {
169
-    //     }else{
170
-    //       wx.showModal({
171
-    //         title: '',
172
-    //         content: '检测到您没有开启工单服务通知的权限,是否开启',
173
-    //         success (res) {
174
-    //           if (res.confirm) {
175
-    //             console.log('用户点击确定')
176
-    //       _this.authorizationbtn()
229
+  // 角度转弧度
230
+  deg2rad(deg) {
231
+    return deg * (Math.PI/180);
232
+  },
177 233
 
178
-    //           } else if (res.cancel) {
179
-    //             console.log('用户点击取消')
180
-    //           }
181
-    //         }
182
-    //       })
183
-    //     }
184
-    //   }
185
-    // })
186
-// 
234
+  // 地图区域变化时触发
235
+  onRegionChange(e) {
236
+    // 可以在这里处理地图移动后的逻辑,如重新加载附近车辆
237
+    if (e.type === 'end' && e.causedBy === 'drag') {
238
+      // this.loadNearbyCars();
239
+    }
240
+  },
241
+  onHide() {
242
+    // 页面卸载时停止追踪
243
+    this.stopTracking();
244
+  },
245
+  
246
+ // 停止追踪
247
+ stopTracking() {
248
+  if (this.data.locationTimer) {
249
+    clearInterval(this.data.locationTimer);
250
+    this.setData({ 
251
+      locationTimer: null,
252
+      isTracking: false 
253
+    });
254
+  }
187 255
 
256
+},
257
+  // 加载附近车辆
258
+  getloadNearbyCars() {
259
+    const that = this;
188 260
    
189
-  },
190
-  authorizationbtn(){
191
-   wx.requestSubscribeMessage({
192
-      tmplIds: ['G_37RkJ_mwZeTdPv5A0fjBlYW6_lRQIW9_SywmUAX7Q','AhToqLaCeOvSvSSQ7RvZYd2WgGA11Da13j1PMvqcGqQ'],
193
-      success(res) {
194
-        console.log(res);
195
-      if(res['AhToqLaCeOvSvSSQ7RvZYd2WgGA11Da13j1PMvqcGqQ'] === 'accept' && res['G_37RkJ_mwZeTdPv5A0fjBlYW6_lRQIW9_SywmUAX7Q'] === 'accept') {
196
-      // 用户同意订阅
197
-      }
261
+        let data ={
262
+          carId:'',
263
+          carType:'',
264
+          carMondel:'',
265
+        }
266
+        api.request(`/syscar/selectcarall`, 'post',data,{ isPublic: false })
267
+        .then((data) => {
268
+      if (data.code==200) {
269
+        const cars = [];
270
+         for (let index = 0; index < data.data.length; index++) {
271
+         let carPosition = data.data[index].carPosition.split(",");
272
+                   cars.push({
273
+            id: 100+index,
274
+            longitude: carPosition[1],
275
+            latitude: carPosition[0],
276
+            iconPath: 'https://esos-iot.bjdexn.cn/myminio/project/f6fba6c83b2d4864a73f5f1d83cda416.png',
277
+            width: 30,
278
+            height: 40,
279
+            anchor: {x: 0.5, y: 0.5}
280
+          });   
281
+         }
282
+         // 将车辆标记添加到现有标记中
283
+         const updatedMarkers = [...that.data.markers];
284
+         // 先移除之前的车辆标记
285
+         const filteredMarkers = updatedMarkers.filter(marker => marker.id);
286
+         // 添加新的车辆标记
287
+         filteredMarkers.push(...cars);
288
+         
289
+         that.setData({
290
+           markers: filteredMarkers,
291
+           carsNearby: data.data.length
292
+         });
293
+        //  this.loadNearbyCars()
198 294
       }
199
-      })
295
+      
296
+        })
297
+        .catch((err) => {
298
+       
299
+          console.error('请求失败:', err);
300
+        });
301
+    
302
+ 
200 303
   },
201
-  /**
202
-   * 生命周期函数--监听页面隐藏
203
-   */
204
-  onHide() {
205
-
304
+  // 加载附近车辆
305
+  loadNearbyCars() {
306
+    const { longitude, latitude } = this.data;
307
+ 
308
+    if (this.data.isTracking) return;
309
+    
310
+    const that = this;
311
+    this.setData({ isTracking: true });
312
+    this.setData({
313
+      locationTimer:setInterval(() => {
314
+        let data ={
315
+          carId:'',
316
+          carType:'',
317
+          carMondel:'',
318
+        }
319
+        api.request(`/syscar/selectcarall`, 'post',data,{ isPublic: false })
320
+        .then((data) => {
321
+      if (data.code==200) {
322
+        const cars = [];
323
+         for (let index = 0; index < data.data.length; index++) {
324
+         let carPosition = data.data[index].carPosition.split(",");
325
+                   cars.push({
326
+            id: 100+index,
327
+            longitude: carPosition[1],
328
+            latitude: carPosition[0],
329
+            iconPath: 'https://esos-iot.bjdexn.cn/myminio/project/f6fba6c83b2d4864a73f5f1d83cda416.png',
330
+            width: 30,
331
+            height: 40,
332
+            anchor: {x: 0.5, y: 0.5}
333
+          });   
334
+         }
335
+         // 将车辆标记添加到现有标记中
336
+         const updatedMarkers = [...that.data.markers];
337
+         // 先移除之前的车辆标记
338
+         const filteredMarkers = updatedMarkers.filter(marker => marker.id);
339
+         // 添加新的车辆标记
340
+         filteredMarkers.push(...cars);
341
+         
342
+         that.setData({
343
+           markers: filteredMarkers,
344
+           carsNearby: data.data.length
345
+         });
346
+      }
347
+      
348
+        })
349
+        .catch((err) => {
350
+       
351
+          console.error('请求失败:', err);
352
+        });
353
+      }, 10000)  // 每10秒更新一次位置
354
+    })
355
+    
356
+ 
206 357
   },
207 358
 
208
-  /**
209
-   * 生命周期函数--监听页面卸载
210
-   */
211
-  onUnload() {
359
+  // 取消订单
360
+  positioning(){
361
+    this.initMap()
212 362
 
213 363
   },
214
-
215
-  /**
216
-   * 页面相关事件处理函数--监听用户下拉动作
217
-   */
218
-  async onPullDownRefresh() {
219
-    console.log(11111111);
220
-    let _this = this
221
-    // _this.authorizationbtn()
222
-    await _this.getworkoder()
223
-    await _this.getreview()
224
-    wx.stopPullDownRefresh();
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
+    // });
225 373
   },
226
-
227
-  /**
228
-   * 页面上拉触底事件的处理函数
229
-   */
230
-  onReachBottom() {
231
-    console.log(11111111);
232
-
374
+  onShow() {
375
+     this.loadNearbyCars()
233 376
   },
234
-
235
-  /**
236
-   * 用户点击右上角分享
237
-   */
238
-  onShareAppMessage() {
239
-
240
-  }
241
-})
377
+});

+ 6
- 8
pages/index/index.json ファイルの表示

@@ -1,11 +1,9 @@
1 1
 {
2
-  "navigationBarTitleText": "首页",
2
+  "navigationBarTitleText": "晟能能源",
3
+  "navigationBarBackgroundColor": "#2C85FF",
4
+  "enablePullDownRefresh": false,
3 5
   "navigationStyle": "custom",
4
-  "enablePullDownRefresh": true,
5
-  "backgroundColor": "#B7D7CB",
6
-
7 6
   "usingComponents": {
8
-    "t-icon": "tdesign-miniprogram/icon/icon",
9
-    "t-popup": "tdesign-miniprogram/popup/popup"
10
-  } 
11
-}
7
+    "t-icon": "tdesign-miniprogram/icon/icon"
8
+    }
9
+}

+ 89
- 103
pages/index/index.wxml ファイルの表示

@@ -1,107 +1,93 @@
1
-<!-- echarts -->
2 1
 <view class="container">
3
-  <view class="navigation-container" style="{{'height: ' + navStatusBarHeight +'px'}}">
4
-  <!--空白来占位状态栏-->
5
-  <view style="{{'height: ' + statusBarHeight +'px'}}"></view>
6
-  <!--自定义导航栏 -->
7
-  <view class="navigation-bar" style="{{'height:' + navBarHeight +'px'}}">
8
-    晟运储能
9
-  </view>
10
-</view>
11
-<view class="home">
12
-<view style="height: 20rpx;"></view>
13
-<view style="{{'height: ' + navStatusBarHeight +'px'}}"></view>
14
-<view class="statistics" data-index="2" bind:tap="rolelocate">
15
-<view class="statistics_top">
16
-<view class="statistics_1">
17
-<view class="statistics_digit">{{workorder.allcount}}</view>
18
-<view class="statistics_title">全部工单</view>
19
-</view>
20
-<view class="statistics_1">
21
-<view class="statistics_digit">{{workorder.incompletecount}}</view>
22
-<view class="statistics_title">全部待办</view>
23
-</view>
24
-<view class="statistics_1">
25
-  <view class="statistics_digit">{{workorder.completecount}}</view>
26
-<view class="statistics_title">全部办结</view>
27
-</view>
28
-</view>
29
-<view style="height: 20rpx;"></view>
30
-<view class="statistics_top">
31
-<view class="statistics_1">
32
-<view class="statistics_digit">{{workorder.myworkodercount}}</view>
33
-<view class="statistics_title">我的工单</view>
34
-</view>
35
-<view class="statistics_1">
36
-<view class="statistics_digit">{{workorder.myworkodertodo}}</view>
37
-<view class="statistics_title">我的待办</view>
38
-</view>
39
-<view class="statistics_1">
40
-  <view class="statistics_digit">{{workorder.myworkoderend}}</view>
41
-<view class="statistics_title">我的已办</view>
42
-</view>
43
-</view>
44
-</view>
45
-<view class="vajra">
46
-<view class="vajra_role" data-index="1" bind:tap="rolelocate">
47
-<image class="role" src="https://esos-iot.bjdexn.cn/myminio/project/e83bca83352e4da68afff3238258a49a.png" mode=""/>
48
-<view>
49
-创建工单
50
-</view> 
51
-</view>
52
-
53
-<view class="vajra_apply" data-index="2" bind:tap="rolelocate">
54
-  <image class="role" src="https://esos-iot.bjdexn.cn/myminio/project/f0de02ce78b14463b1824b35882d3ecf.png" mode=""/>
55
-<view>
56
-  工单统计 
57
-</view>
58
-</view>
59
-<view class="vajra_apply" data-index="3" bind:tap="rolelocate">
60
-  <image class="role" src="https://esos-iot.bjdexn.cn/myminio/project/31fc6a71019744e0bdcd3523afa8dc35.png" mode=""/>
61
-<view>
62
-  资产台账 
63
-</view>
64
-</view>
65
-<view class="vajra_rights" data-index="4" bind:tap="rolelocate">
66
-  <image class="role" src="https://esos-iot.bjdexn.cn/myminio/project/a76948bfa5094d4c90e2a4c5514481e1.png" mode=""/>
67
- <view>
68
-值工排班
69
- </view>
70
-</view>
71
-</view>
72
-<view class="examine">
73
-待审核
74
-</view>
75
-<view class="examine_box" wx:for="{{reviewdata}}" wx:key="index" data-id="{{item.id}}" data-workorderId="{{item.workorderId}}" bind:tap="ondetails">
76
-<view class="examine_title">
77
-<view class="examine_title0" wx:if="{{item.type==1}}">日常<text wx:if="{{item.workorderGrade==1}}"> 低</text><text wx:if="{{item.workorderGrade==2}}"> 中</text><text wx:if="{{item.workorderGrade==3}}"> 高</text></view>
78
-<view class="examine_title01" wx:if="{{item.type==2}}">故障 / <text wx:if="{{item.workorderGrade==1}}"> 低</text><text wx:if="{{item.workorderGrade==2}}"> 中</text><text wx:if="{{item.workorderGrade==3}}"> 高</text>
79
-</view>
80
-<view class="examine_title02" wx:if="{{item.type==3}}">其他<text wx:if="{{item.workorderGrade==1}}"> 低</text><text wx:if="{{item.workorderGrade==2}}"> 中</text><text wx:if="{{item.workorderGrade==3}}"> 高</text></view>
81
-<view class="examine_title1">{{item.workorderName}}</view>
82
-<!-- <view class="examine_title2" wx:if="{{item.examineType==4}}">待审核</view> -->
83
-<view class="examine_title2" wx:if="{{item.examineType==5}}">待审核</view>
84
-<view class="examine_title2" wx:if="{{item.examineType==6}}">审核完成</view>
85
-<view class="examine_title2" wx:if="{{item.examineType==7}}">审核失败</view>
86
-</view>
87
-<view class="examine_content">
88
-<view>描述:{{item.workorderContent}}</view>
89
-<view class="feedback examine_name" wx:if="{{item.examineType==7}}">退回原因:{{item.workoderReason}}</view>
90
-<view class="feedback examine_name" wx:if="{{item.examineCount!=0&&item.examineType!=7}}">退回原因:{{item.lastfail||'无'}}</view>
91
-</view>
92
-<view class="examine_bottom">
93
- <view> <text>发起人:</text>{{item.workorderPromoter}}</view>
94
- <view>发起时间:{{item.workorderStarttime}}</view>
95
-</view>
96
-<!-- <view class="examine_button">
97
-<view class="examine_buttonleft">通过</view>
98
-<view class="examine_buttonright">不通过</view>
99
-</view> -->
100
-</view>
101
-<view class="available" wx:if="{{reviewdata.length==0}}">
2
+  <!-- 地图组件 -->
3
+  <map 
4
+    id="map"
5
+    class="map"
6
+    longitude="{{longitude}}"
7
+    latitude="{{latitude}}"
8
+    scale="{{scale}}"
9
+    markers="{{markers}}"
10
+    polyline="{{polyline}}"
11
+    show-location
12
+    bindregionchange="onRegionChange"
13
+  ></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
+ 
44
+    
45
+    <!-- 司机信息 (叫车后显示) -->
46
+    <view class="driver-info" wx:if="{{showDriverInfo}}">
47
+      <image src="{{driverAvatar}}" class="driver-avatar"></image>
48
+      <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>
52
+      </view>
53
+      <button class="cancel-btn" bindtap="cancelOrder">去查看</button>
54
+    </view>
55
+    <!-- <view class="driver-info" wx:if="{{showDriverInfo}}">
56
+      <image src="{{driverAvatar}}" class="driver-avatar"></image>
57
+      <view class="driver-details">
58
+        <view class="driver-name">车牌号: {{carNumber}}</view>
59
+        <view class="driver-car">工作方向: 放电</view>
60
+        <view class="driver-arrive">预计{{estimatedArrival}}分钟后完成工作</view>
61
+      </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>
70
+      </view>
71
+      <button class="cancel-btn" bindtap="cancelOrder">去查看</button>
72
+    </view> --> 
73
+    <!-- <view class="available" wx:if="{{true}}">
102 74
 <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}}">
78
+      <text class="call-btn_left_electricity">预约</text>
79
+    </button>
80
+  </view>
81
+  
82
+  <!-- 附近车辆--数量提示 -->
83
+  <view class="cars-nearby" wx:if="{{carsNearby > 0}}">
84
+    <view class="cars-icon">
85
+      <text class="iconfont icon-car"></text>
86
+    </view>
87
+    <view class="cars-count">附近有 {{carsNearby}} 辆车</view>
88
+  </view>
103 89
 </view>
104
-<view style="height: 20rpx;"> </view>
105
-</view>
90
+<view class="positioning" bind:tap="positioning">
91
+  <t-icon name="focus" size="40rpx" data-name="focus" bind:tap="onIconTap" />
106 92
 
107
-</view> 
93
+</view>

+ 152
- 313
pages/index/index.wxss ファイルの表示

@@ -1,346 +1,185 @@
1
-/*  */
2
-.navigation-container {
3
-  position: fixed;
1
+.container {
2
+  position: absolute;
3
+  top: 0;
4
+  left: 0;
5
+  right: 0;
6
+  bottom: 0;
7
+  display: flex;
8
+  flex-direction: column;
9
+}
10
+
11
+.map {
4 12
   width: 100%;
5
-  z-index: 99;
6
-  background-color: #89bfea;
13
+  height: 1100rpx;
7 14
 }
8
-.navigation-bar {
9
-  position: relative;
15
+
16
+.bottom-panel {
17
+  /* position: absolute;
18
+  bottom: 0;
19
+  left: 0;
20
+  right: 0; */
10 21
   width: 100%;
11
-  display: flex;
12
-  align-items: center;
13
-  /* justify-content: center; */
14
-  font-size: 36rpx;
15
-  padding-left: 40rpx;
16
-  flex-direction: row;
17
-  color: #fff;
22
+  padding: 16rpx;
23
+  box-sizing: border-box;
18 24
 }
19
-.title_1{
20
-  font-weight: 500;
21
-  font-size: 28rpx;
25
+
26
+.trip-card {
27
+  background-color: white;
28
+  border-radius: 16rpx;
29
+  padding: 24rpx;
30
+  box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1);
31
+}
32
+
33
+.location-item {
22 34
   display: flex;
23
-  align-items: center;
35
+  align-items: flex-start;
36
+  margin-bottom: 24rpx;
24 37
 }
25
-.title_image{
38
+
39
+.location-icon {
40
+  margin-right: 16rpx;
41
+  margin-top: 8rpx;
42
+}
43
+
44
+.start-icon .icon-circle {
26 45
   width: 24rpx;
27 46
   height: 24rpx;
28
-  margin-left: 10rpx;
29
-  transition: transform 3s ease; /* 添加过渡效果 */
47
+  border-radius: 50%;
48
+  background-color: #666;
30 49
 }
31 50
 
32
-.title_2{
33
-  font-size: 28rpx;
34
-  margin-top: 30rpx;
51
+.end-icon .icon-marker {
52
+  width: 24rpx;
53
+  height: 24rpx;
54
+  background-color: #2C85FF;
55
+  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
35 56
 }
36
-.nav-title {
37
-  height: 100%;
57
+
58
+.location-input input {
59
+  font-size: 32rpx;
60
+  color: #333;
61
+  width: 560rpx;
62
+}
63
+
64
+.trip-info {
65
+  margin-top: 16rpx;
66
+  padding-top: 16rpx;
67
+  border-top: 1rpx solid #eee;
38 68
   display: flex;
39
- align-items: center;
40
-  margin-left: 20rpx;
41
-  box-sizing: border-box;
69
+  justify-content: space-between;
70
+  font-size: 28rpx;
71
+  color: #666;
42 72
 }
43
- 
44
-.nav-search {
45
-  position: absolute;
73
+/*  */
74
+.call-btn {
75
+    position: absolute;
76
+  bottom: 0;
77
+  left: 0;
78
+  right: 0;
79
+  margin-bottom: 24rpx;
80
+  background-color: #00C775;
81
+  color: white;
82
+  width: 90%;
83
+  height: 96rpx;
84
+  line-height: 96rpx;
85
+  font-size: 34rpx;
86
+  border-radius: 48rpx;
87
+  box-sizing: border-box;
46 88
   display: flex;
47
-  justify-content: flex-end;
48
-  align-items: center;
89
+  justify-content:space-around;
49 90
 }
50
-/* // */
51
-.container {
52
-  width: 100%;
53
-  min-height: 100%;
91
+.call-btn_left_electricity{
92
+width: 50%;
93
+ height: 100%;
94
+}
95
+.call-btn_right_electricity{
96
+  width: 50%;
97
+  height: 100%;
98
+  border-left: 4rpx solid #ffffff; 
99
+}
100
+.driver-info {
101
+  background-color: white;
102
+  border-radius: 16rpx;
103
+  padding: 24rpx;
104
+  box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1);
54 105
   display: flex;
55 106
   align-items: center;
56
-  /* 007544 */
57
- background: linear-gradient(to bottom, #0F80DC -40%, #F0F5F5 40%, #F0F5F5 100%);
58
- /* background: linear-gradient(to bottom, #007544 -40%, #F0F5F5 40%,#F0F5F5 100%); */
107
+  margin-top: 26rpx;
59 108
 }
60
-.home{
61
-  width: 100%;
62
-  padding: 20rpx 20rpx;
63
-  box-sizing: border-box;
109
+
110
+.driver-avatar {
111
+  width: 100rpx;
112
+  height: 100rpx;
113
+  border-radius: 50%;
64 114
 }
65
-.statistics{
66
-  width: 100%;
67
-  padding: 0rpx 40rpx;
68
-  box-sizing: border-box;
115
+
116
+.driver-details {
117
+  margin-left: 24rpx;
118
+  flex: 1;
69 119
 }
70
-.statistics_top{
71
-  display: flex;
72
-  justify-content: space-between;
120
+
121
+.driver-name {
122
+  font-size: 32rpx;
123
+  font-weight: bold;
73 124
 }
74
-.statistics_1{
75
-  display: flex;
76
-  flex-direction: column;
77
-  justify-content: center;
78
-  align-items: center;
125
+
126
+.driver-car {
127
+  font-size: 28rpx;
128
+  color: #666;
129
+  margin-top: 8rpx;
79 130
 }
80
-.statistics_digit{
81
-  font-size: 48rpx;
131
+
132
+.driver-arrive {
133
+  font-size: 28rpx;
134
+  color: #2C85FF;
135
+  margin-top: 8rpx;
82 136
 }
83
-.statistics_title{
84
-  margin-top: 10rpx;
137
+
138
+.cancel-btn {
139
+  width: 160rpx;
140
+  height: 64rpx;
141
+  line-height: 64rpx;
142
+  font-size: 28rpx;
143
+  color: #FF5252;
144
+  border: 1rpx solid #FF5252;
145
+  background-color: white;
146
+  border-radius: 32rpx;
85 147
 }
86
-.vajra{
87
-  width: 100%;
88
-  padding: 16rpx;
89
-  display: flex;
90
-  align-items: center;
91
-  justify-content: space-between;
92
-  background-color: #fff;
93
-  box-sizing: border-box;
94
-  border-radius: 20rpx;
95
-  margin-top: 60rpx;
96
-  }
97
-  .vajra_role{
98
-    width: 22%;
99
-    padding: 20rpx 0rpx;
100
-    display: flex;
101
-    flex-direction: column;
102
-    justify-content: center;
103
-    align-items: center;
104
-    border-radius: 10rpx;
105
-    /* background-color: #ffffff; */
106
-  }
107
-  .vajra_rights{
108
-    width: 22%;
109
-    padding: 20rpx 0rpx;
110
-    display: flex;
111
-    flex-direction: column;
112
-    justify-content: center;
113
-    align-items: center;
114
-    border-radius: 10rpx;
115
-    /* background-color: #ffffff; */
116
-  }
117
-  .vajra_apply{
118
-    width: 22%;
119
-    padding: 20rpx 0rpx;
120
-    display: flex;
121
-    flex-direction: column;
122
-    justify-content: center;
123
-    align-items: center;
124
-    border-radius: 10rpx;
125
-    /* background-color: #ffffff; */
126
-  }
127
-  .role{
128
-    width: 120rpx;
129
-    height: 120rpx;
130
-    margin-bottom: 20rpx;
131
-    border-radius: 16rpx;
132
-    box-sizing: border-box;
133
-  }
134
-  .role_botton{
135
-    width: 60rpx;
136
-    height: 60rpx;
137
-    box-sizing: border-box;
138
-  }
139
-  .vajra_share{
140
-    width: 22%;
141
-    /* padding: 20rpx 0rpx; */
142
-    display: flex;
143
-    flex-direction: column;
144
-    justify-content: center;
145
-    align-items: center;
146
-    border-radius: 10rpx;
147
-    background-color: #ffffff;
148
-  }
149
-  .role_botton{
150
-    width: 60rpx;
151
-    height: 60rpx;
152
-    box-sizing: border-box;
153
-  }
154
-  button{
155
-    padding: 0rpx;
156
-    margin: 0rpx;
157
-    width: 100%;
158
-    height: 148rpx;
159
-  padding-top: 20rpx;
160
-  display: flex;
161
-  flex-direction: column;
162
-  align-items: center;
163
-    font-size: 28rpx;
164
-    /* line-height: 130rpx; */
165
-    border:0rpx #f5f5f5  solid;
166
-  background-color: rgba(0, 0, 0, 0);
167
-  
168
-  }
169
-  wx-button:after {
170
-    display: flex;
171
-  flex-direction: column;
172
-    width: 100%;
173
-    height: 148rpx;
174
-  padding: 20rpx 0rpx;
175
-    font-size: 28rpx;
176
-    /* line-height: 130rpx; */
177
-    border:0rpx #f5f5f5  solid;
178
-  background-color: rgba(0, 0, 0, 0);
179
-  }  
180
- .examine{
181
-margin-top: 40rpx;
182
-font-size: 32rpx;
183
- }
184
- .examine_box{
185
-   width: 100%;
186
-   background-color: #fff;
187
-   padding: 30rpx 0rpx;
188
-margin-top: 20rpx;
189
-border-radius: 10rpx;
190
-box-sizing: border-box;
191
- }
192
- .examine_title{
193
-   width: 100%;
194
-   display: flex;
195
-   align-items: center;
196
-   padding: 0rpx 0rpx 0rpx 20rpx;
197
-   box-sizing: border-box;
198
- }
199
- .examine_title0{
200
-  width: 120rpx;
201
-  height: 40rpx;
202
-  font-size: 22rpx; 
203
-  display: flex;
204
-  align-items: center;
205
-  justify-content: center;
206
-  border-radius: 30rpx;
207
-  /* background-color: #0F80DC; */
208
-  background-color: rgba(15, 128, 220, 0.2);
209
-  color: #0F80DC;
210
-  border: 1rpx solid #0F80DC;
211
-box-sizing: border-box;
212 148
 
213
- }
214
- .examine_title01{
215
-  width: 120rpx;
216
-  height: 40rpx;
217
-  font-size: 22rpx; 
149
+.cars-nearby {
150
+  position: absolute;
151
+  top: 104rpx;
152
+  left: 24rpx;
153
+  background-color: rgba(255, 255, 255, 0.9);
154
+  border-radius: 32rpx;
155
+  padding: 12rpx 20rpx;
218 156
   display: flex;
219 157
   align-items: center;
220
-  justify-content: center;
221
-  border-radius: 30rpx;
222
-  /* background-color: #0F80DC; */
223
-  color:#ee8d60;
224
-  background-color: rgba(241, 120, 20, 0.2);
158
+  box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
159
+}
225 160
 
226
-  border: 1rpx solid #f39b72;
227
- box-sizing: border-box;
228
- }
229
- .examine_title02{
230
-  width: 120rpx;
231
-  height: 40rpx;
232
-  font-size: 22rpx; 
233
-  display: flex;
234
-  align-items: center;
235
-  justify-content: center;
236
-  border-radius: 30rpx;
237
-  /* background-color: #0F80DC; */
238
-  color:#0F80DC;
239
-  background-color: rgba(15, 128, 220, 0.2);
240
-  /* color: #007544; */
241
-  border: 1rpx solid #0F80DC;
242
- box-sizing: border-box;
243
- }
244
- .examine_title1{
245
-   flex: 1;
246
-   font-weight: 600;
247
-   font-size: 32rpx;
248
-   display: flex;
249
-   align-items: center;
250
-   padding: 0rpx 10rpx;
251
-   overflow: hidden;
252
-  display: -webkit-box;
253
-  text-overflow: ellipsis;
254
-  box-orient: vertical;
255
-  -webkit-box-orient: vertical;
256
-  -moz-box-orient: vertical;
257
-  -o-box-orient: vertical;
258
-  -ms-box-orient: vertical;
259
-  line-clamp: 1; /* 超出2行显示省略号 */
260
-  -webkit-line-clamp: 1; /* 超出2行显示省略号 */
261
-   box-sizing: border-box;
262
- }
263
- .examine_title2{
264
-   width: 100rpx;
265
-   height: 40rpx;
266
-  font-size: 22rpx; 
267
-   display: flex;
268
-   align-items: center;
269
-   justify-content: center;
270
-border-top-left-radius:100rpx;
271
-border-bottom-left-radius:100rpx;
272
-   background-color: rgb(255, 0, 0,0.2);
273
-   color: red;
274
-   border: 1rpx solid red;
275
-   border-right: 0rpx solid red;
276
-box-sizing: border-box;
277
- }
278
- .examine_content{
279
-   flex: 1;
280
-   font-size: 24rpx;
281
-   padding: 20rpx 20rpx;
282
-   margin: 20rpx 20rpx;
283
-   color: #cccccc;
284
-   background-color: #f9f9f9;
285
-   border-radius: 8rpx;
286
-   box-sizing: border-box;
287
- }
288
- .feedback{
289
-  margin-top: 8rpx;
290
- }
291
- .examine_bottom{
292
-   display: flex;
293
- }
294
- .examine_bottom{
295
-   display: flex;
296
-   align-items: center;
297
-   justify-content: space-between;
298
-   padding: 0rpx 20rpx;
299
-box-sizing: border-box;
161
+.cars-icon {
162
+  color: #2C85FF;
163
+  margin-right: 12rpx;
164
+}
300 165
 
301
- }
302
- .examine_button{
303
-   width: 100%;
304
-   padding: 0rpx 20rpx;
305
-   margin-top: 30rpx;
306
-   display: flex;
307
-   align-items: center;
308
-   justify-content: space-between;
309
-   box-sizing: border-box;
166
+.cars-count {
167
+  font-size: 28rpx;
168
+  color: #333;
169
+}
310 170
 
311
- }
312
- .examine_buttonleft{
313
-   width: 160rpx;
314
-   height:60rpx;
315
-  border-radius: 12rpx;
171
+.icon-car {
172
+  font-size: 32rpx;
173
+}
174
+.available{
175
+  width: 100%;
176
+  height: 380rpx;
316 177
   display: flex;
317 178
   align-items: center;
318 179
   justify-content: center;
319
-   background-color: #0F80DC;
320
-color: #fff;
321
-box-sizing: border-box;
322
-
323
- }
324
- .examine_buttonright{
325
-   width:160rpx;
326
-   height:60rpx;
327
-   display: flex;
328
-   align-items: center;
329
-   justify-content: center;
330
-   margin-left: 10rpx;
331
-   border-radius: 12rpx;
332
-   background-color: #0F80DC;
333
-   color: #fff;
334
-box-sizing: border-box;
335
-
336
- }
337
- .examine_name{
338
-   color: #cccccc;
339
- }
340
- .available{
341
-   width: 100%;
342
-   display: flex;
343
-   align-items: center;
344
-   justify-content: center;
345
-   margin-top: 60rpx;
346
- }
180
+}
181
+.positioning{
182
+  position: fixed;
183
+  right: 40rpx;
184
+  bottom: 400rpx;
185
+}

+ 0
- 66
pages/login/index.wxml ファイルの表示

@@ -1,66 +0,0 @@
1
-<!-- pages/user/index.wxml -->
2
-<view class="setup">
3
-  <view class="navigation-container" style="{{'height: ' + navStatusBarHeight +'px'}}">
4
-  <!-- 空白来占位状态栏 -->
5
-  <view style="{{'height: ' + statusBarHeight +'px'}}"></view>
6
-  <!-- 自定义导航栏 -->
7
-  <view class="navigation-bar" style="{{'height:' + navBarHeight +'px'}}">
8
-    <view class="title">晟运能源</view>
9
-  </view>
10
-</view>
11
-<!-- <view style="width: 100%; {{'height: ' + navStatusBarHeight +'px'}}"></view> -->
12
-<!--<view></view>-->
13
- <view class="log">
14
- <view class="log_title">
15
- <view>你好,</view>
16
- <view>欢迎使用晟运智慧运维</view>
17
- </view>
18
- <view><image class="log_image" src="https://esos-iot.bjdexn.cn/myminio/project/72505c1e81bf445dbeb773a18e47da7b.png" mode="aspectFill"/></view>
19
- </view>
20
- <view class="login_box">
21
- <view class="{{Loginswitch?'login_left':'login_right1'}}" data-value="{{true}}" bind:tap="onswitch">一键登录</view>
22
- <!-- <view class="{{!Loginswitch?'login_left':'login_right'}}" data-value="{{false}}">手机号登录</view> -->
23
- <view class="{{!Loginswitch?'login_left':'login_right'}}" data-value="{{false}}" bind:tap="onswitch">手机号登录</view>
24
-
25
- </view>
26
- <!-- <view class="login_box">
27
-  <view class="login_right1">快捷登录</view>
28
- <view class="login_left">账户登录</view>
29
- </view> -->
30
- <view class="log_bottom">
31
-
32
- <view class="account_number" wx:if="{{!Loginswitch}}">
33
- <view wx:if="{{!Loginswitch}}">
34
-  <view class="account">手机号</view>
35
-  <view class="password">
36
-  <image class="login_imgae1" src="https://esos-iot.bjdexn.cn/myminio/project/0458af22ef764cc386d77a76ee665917.png" mode=""/>
37
-  <input class="weui-input"	value="{{account}}" placeholder="请输入手机号"  bindinput="bindKeyInput1"/></view>
38
- </view>
39
-
40
- </view>
41
- <view class="number" wx:if="{{!Loginswitch}}">
42
-  <!-- <view class="account">邀请码</view>
43
-  <view class="password"> 
44
-    <image class="login_imgae1" src="https://esos-iot.bjdexn.cn/myminio/project/b38d8000822b44108beff300cb0c9f69.png" mode="aspectFit"/>
45
-  <input class="weui-input"	value="{{password}}" placeholder="请输入邀请码" bindinput="bindKeyInput2"/>
46
-  </view> -->
47
-  <!-- <view class="password"> 
48
-    <image class="login_imgae1" src="https://esos-iot.bjdexn.cn/myminio/project/b38d8000822b44108beff300cb0c9f69.png" mode="aspectFit"/>
49
-  <input class="weui-input"	value="{{password}}" password="{{passwordtype}}" placeholder="请输入密码" bindinput="bindKeyInput2"/>
50
-    <image class="login_imgae" src="https://esos-iot.bjdexn.cn/wx_images/password_1.png" wx:if="{{passwordtype}}" bind:tap="onpassword" mode=""/>
51
-    <image class="login_imgae" src="https://esos-iot.bjdexn.cn/wx_images/password_2.png" wx:else bind:tap="onpassword" mode=""/>
52
-  </view> -->
53
- </view>
54
- <view class="loginbotton">
55
-  <!-- <button wx:if="{{!Loginswitch}}" class="button_button" open-type="getPhoneNumber" bindgetphonenumber="onGetPhoneNumber">手机号一键登录</button> -->
56
- <button wx:if="{{Loginswitch&&checked}}" class="button_button" color="#0F80DC" open-type="getPhoneNumber" bindgetphonenumber="onGetPhoneNumber">手机号一键登录</button>
57
- <button wx:if="{{!checked}}" class="button_button" color="#0F80DC" bind:tap="onstatus">手机号一键登录</button>
58
- <button wx:if="{{!Loginswitch}}" class="button_button" color="#0F80DC" bind:tap="onLogin">登录</button>
59
- <!-- <button wx:if="{{!Loginswitch}}" bindphoneoneclicklogin="onHandleLogin" open-type="phoneOneClickLogin">一键登录按钮</button> -->
60
- <view class="agreement">
61
-  <t-radio t-class="t_box" value="{{checked}}" icon="dot" data-value="{{checked}}" bind:tap="checkboxChange"/>
62
- 我已阅读并同意<text class="agreement_color" data-name="服务协议" bind:tap="onprivacy">《服务协议》</text>和<text class="agreement_color" data-name="隐私政策" bind:tap="onprivacy">《隐私政策》</text> </view>
63
- </view>
64
- 
65
- </view>
66
-</view>

+ 0
- 30
pages/malfunction/index.wxml ファイルの表示

@@ -1,30 +0,0 @@
1
-<!--pages/malfunction/index.wxml-->
2
-<view class="setup">
3
-<view class="setup_list">
4
-  <view class="allocation" data-name="0" bind:tap="toconfigure">
5
-<view class="allocation_3">日常任务</view>
6
-<view class="allocation_1">
7
-<view class="allocation_2"></view>
8
-<t-icon name="chevron-right-s" size="40rpx" data-name="chevron-right-s"/>
9
-</view>
10
-</view>
11
-<view class="allocation" data-name="1" bind:tap="toconfigure">
12
-<view class="allocation_3">设备报修</view>
13
-<view class="allocation_1">
14
-<view class="allocation_2"></view>
15
-<t-icon name="chevron-right-s" size="40rpx" data-name="chevron-right-s"/>
16
-</view>
17
-</view>
18
-<view class="allocation" data-name="2" bind:tap="toconfigure">
19
-<view class="allocation_3">其他</view>
20
-<view class="allocation_1">
21
-<view class="allocation_2"></view>
22
-<t-icon name="chevron-right-s" size="40rpx" data-name="chevron-right-s"/>
23
-</view>
24
-</view>
25
- </view>
26
-
27
-
28
-
29
-
30
-</view>

+ 0
- 53
pages/malfunction/index.wxss ファイルの表示

@@ -1,53 +0,0 @@
1
-/* pages/malfunction/index.wxss */
2
-.setup{
3
-  width: 100%;
4
-  height: 100vh;
5
-  background: linear-gradient(to bottom, #0F80DC -40%, #F0F5F5 40%,#F0F5F5 100%);
6
-  padding: 20rpx 20rpx;
7
-  box-sizing: border-box;
8
-
9
-}
10
-.setup_list{
11
-  width: 100%;
12
-  background-color: #ffffff;
13
-  border-radius: 10rpx;
14
-}
15
-.allocation{
16
-  width: 100%;
17
-  height: 80rpx;
18
-display: flex;
19
-align-items: center;
20
-justify-content:space-between;
21
-padding: 0rpx 20rpx;
22
-overflow: hidden;
23
-box-sizing: border-box;
24
-
25
-}
26
-.allocation_1{
27
-  display: flex;
28
-  font-size:13px;
29
-  align-items: center;
30
-}
31
-.allocation_box{
32
- border-radius: 16rpx;
33
- background-color: #ffffff;
34
-  padding: 10rpx 0rpx;
35
-  box-sizing: border-box;
36
-  margin-top: 30rpx;
37
-box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1);
38
-
39
-}
40
-.allocation_2{
41
-  color: #999999;
42
-  
43
-}
44
-.allocation_3{
45
-  font-size: 14px;
46
-}
47
-.content-container{
48
-margin-top: 40rpx;
49
-display: flex;
50
-flex-direction: column;
51
-justify-content: center;
52
-align-items: center;
53
-}

+ 0
- 180
pages/personalInfo/index.js ファイルの表示

@@ -1,180 +0,0 @@
1
-// pages/personalInfo/index.js
2
-const api = require('../../api/index.js');
3
-
4
-Page({
5
-
6
-  /**
7
-   * 页面的初始数据
8
-   */
9
-  data: {
10
-    user:'',
11
-    identitycard:"",
12
-    fileurl:'',
13
-    back:"",
14
-    Peakprice:""
15
-  },
16
-
17
-  /**
18
-   * 生命周期函数--监听页面加载 
19
-   */
20
-  onLoad(options) {
21
-//  this.gituser()
22
-  },
23
-gituser(){
24
-  api.request(`/toolprogram/selectuser`, 'POST',{})
25
-  .then((res) => {
26
-    console.log(res);
27
-    this.setData({
28
-      user:res.data,
29
-      fileurl:res.data.userfrontofidcard,
30
-      back:res.data.userreverseofidcard
31
-    })
32
-  })
33
-  .catch((err) => {
34
-    console.error('请求失败:', err);
35
-    // 在这里处理请求失败的情况
36
-  });
37
-},
38
-// 上传头像
39
-bindtoImage(){
40
-  let _this = this
41
-  // 先检查隐私授权状态
42
-  wx.getPrivacySetting({
43
-    success: (res) => {
44
-      if (res.needAuthorization) {
45
-        // 弹出隐私协议弹窗
46
-        wx.requirePrivacyAuthorize({
47
-          success: () => {
48
-            console.log('用户已同意隐私协议');
49
-            _this.choosetoImage(); // 继续执行上传
50
-          },
51
-          fail: () => {
52
-            console.log('用户拒绝了隐私协议');
53
-            wx.showToast({
54
-              title: '需同意隐私协议才能使用',
55
-              icon: 'none'
56
-            });
57
-          }
58
-        });
59
-      } else {
60
-          _this.choosetoImage(); // 已授权,直接上传
61
-      }
62
-    }
63
-  });
64
-},
65
-// 上传头像图片
66
-choosetoImage() {
67
-  let _this = this
68
-  wx.chooseMedia({    
69
-    count: 1,
70
-    mediaType: ['image','video'],
71
-    sourceType: ['album', 'camera'],
72
-    success(res) {
73
-      console.log(res);
74
-      const tempFiles = res.tempFiles;
75
-      _this.setData({
76
-        imageList: tempFiles.map(file => file.tempFilePath),
77
-      });
78
-      _this.uploadtoImages(tempFiles);
79
-    },
80
-    fail(err) {
81
-      console.error("选择失败:", err);
82
-    }
83
-  })
84
-  },
85
-  // 上传到服务器
86
-  uploadtoImages(files) {
87
-  let _this =this
88
-  const token = wx.getStorageSync('token');
89
-  files.forEach((file) => {
90
-  wx.uploadFile({
91
-  url: 'https://esos-iot.bjdexn.cn:8443/toolprogram/upload/webPost',
92
-  filePath: file.tempFilePath,
93
-  name: 'file',
94
-  formData: {
95
-    file:file.tempFilePath
96
-  },
97
-  header: {
98
-    'Authorization': 'Bearer ' + token // Also add to header if needed
99
-  },
100
-  success: (res) => {
101
-  console.log(res);
102
-  const obj = JSON.parse(res.data);
103
- 
104
-  let data ={
105
-    userprofile:obj.data.userprofile,
106
-  }
107
-api.request(`/toolprogram/insertpartner`, 'POST',data)
108
-.then((res) => {
109
-  console.log(res);
110
-  this.setData({
111
-    user:res.data,
112
-    fileurl:res.data.userfrontofidcard,
113
-    back:res.data.userreverseofidcard
114
-  })
115
-  wx.showToast({
116
-    title: res.msg,
117
-    icon: 'none'
118
-  });
119
-})
120
-.catch((err) => {
121
-  console.error('请求失败:', err);
122
-  // 在这里处理请求失败的情况
123
-});
124
-  },
125
-  fail: (err) => {
126
-    console.error('上传失败', err);
127
-  },
128
-  });
129
-  });
130
-  },
131
- 
132
-  /**
133
-   * 生命周期函数--监听页面初次渲染完成
134
-   */
135
-  onReady() {
136
-
137
-  },
138
-
139
-  /**
140
-   * 生命周期函数--监听页面显示
141
-   */
142
-  onShow() {
143
-
144
-  },
145
-
146
-  /**
147
-   * 生命周期函数--监听页面隐藏
148
-   */
149
-  onHide() {
150
-
151
-  },
152
-
153
-  /**
154
-   * 生命周期函数--监听页面卸载
155
-   */
156
-  onUnload() {
157
-
158
-  },
159
-
160
-  /**
161
-   * 页面相关事件处理函数--监听用户下拉动作
162
-   */
163
-  onPullDownRefresh() {
164
-
165
-  },
166
-
167
-  /**
168
-   * 页面上拉触底事件的处理函数
169
-   */
170
-  onReachBottom() {
171
-
172
-  },
173
-
174
-  /**
175
-   * 用户点击右上角分享
176
-   */
177
-  onShareAppMessage() {
178
-
179
-  }
180
-})

+ 0
- 45
pages/personalInfo/index.wxml ファイルの表示

@@ -1,45 +0,0 @@
1
-<view class="container">
2
-		<view class="account_number">
3
-	     	<image bind:tap="bindtoImage" class="account_to1" src="{{user.userprofile||''}}" mode=""></image>
4
-		</view>
5
-		<view class="toptabbar">
6
-			<view class="toptabbar_">
7
-				<view class="toptabbar_box">
8
-								<view class="toptabbar_left">
9
-									名称
10
-								</view>
11
-									<view class="toptabbar_right">
12
-                    <input class="uni-mt-5" trim="all" value="{{Peakprice}}" clearSize="0"
13
-										placeholder="请输入报修地点" 	bindinput="onPeakprice"></input>
14
-									</view>
15
-							</view>
16
-				<view class="toptabbar_box">
17
-					<view class="toptabbar_left">
18
-						电话
19
-					</view>
20
-						<view class="toptabbar_right">
21
-							{{user.userphone||'--'}}
22
-						</view>
23
-				</view>
24
-				<view class="toptabbar_box">
25
-					<view class="toptabbar_left">
26
-						投资类型
27
-					</view>
28
-						<view class="toptabbar_right">
29
-							{{user.copartnertype||'--'}}
30
-						</view>
31
-				</view>
32
-        <view class="toptabbar_box">
33
-					<view class="toptabbar_left">
34
-						所属电站
35
-					</view>
36
-						<view class="toptabbar_right">
37
-							{{user.copartnertype||'--'}}
38
-						</view>
39
-				</view>
40
-			</view>
41
-	</view>
42
-  </view>
43
-  <!--
44
-    
45
-  -->

+ 0
- 64
pages/personalInfo/index.wxss ファイルの表示

@@ -1,64 +0,0 @@
1
-/* pages/personalInfo/index.wxss */  .uni-page{
2
-	  		width: 100%;
3
-	  		height: 100%;
4
-	  	}
5
-	  .container {
6
-	  	height: 100%;
7
-	    background: linear-gradient(to bottom, #0F80DC -40%, #f0f5f5 40%, #f0f5f5 100%);
8
-	    box-sizing: border-box;
9
-	  }     
10
-	  .account_number{
11
-	    width: 100%;
12
-		padding: 20rpx;
13
-		display: flex;
14
-		justify-content: center;
15
-		box-sizing: border-box;
16
-	  }
17
-	 .account_to1{
18
-		 width: 200rpx;
19
-		 height: 200rpx;
20
-     border-radius: 100rpx;
21
-     border: 1rpx solid #ffffff;
22
-	 }
23
- 
24
-	   .toptabbar {
25
-	     width: 100%;
26
-	     padding: 10rpx 20rpx;
27
-	     box-sizing: border-box;
28
-	   }
29
-	   .toptabbar_{
30
-		   border-radius: 10rpx;
31
-		   overflow: hidden;
32
-		   padding:0rpx 20rpx 20rpx 20rpx;
33
-		   background-color: #ffffff;
34
-	   }
35
-		.toptabbar_box{
36
-			width: 100%;
37
-			height: 120rpx;
38
-			display: flex;
39
-			align-items: center;
40
-			justify-content: space-between;
41
-			border-bottom: 1rpx #f5f5f5 solid;
42
-		}
43
-        .toptabbar_left{
44
-		 font-size: 28rpx;
45
-		}
46
-    .account_to{
47
-      width: 100%;
48
-      height: 300rpx;
49
-      border-radius: 10rpx;
50
-      display: flex;
51
-      align-items: center;
52
-      justify-content: center;
53
-      border-radius: 10rpx;
54
-      border: #f5f5f5 1rpx solid;
55
-      box-sizing: border-box;
56
-      }
57
-      .user_to{
58
-        width: 100%;
59
-      height: 360rpx;
60
-      border-radius: 10rpx;
61
-      }
62
-      .uni-mt-5{
63
-        text-align: right;
64
-      }

+ 0
- 288
pages/scheduling/index.js ファイルの表示

@@ -1,288 +0,0 @@
1
-// pages/scheduling/index.js
2
-const api = require('../../api/index.js');
3
-const timestamp = require("../../utils/util.js")
4
-Page({
5
-
6
-  /**
7
-   * 页面的初始数据
8
-   */
9
-  data: {
10
-    visible:false,
11
-    current: [],
12
-    options: [],
13
-    userdata:[],
14
-    value:'',
15
-    minDate: new Date(2022, 0, 10).getTime(),
16
-    maxDate: new Date(2027, 10, 27).getTime(),
17
-    format(day) {
18
-      const { date } = day;
19
-      const year = date.getFullYear();
20
-      const month = date.getMonth() + 1;
21
-      const curDate = date.getDate();
22
-      
23
-      // 农历月份名称
24
-      const lunarMonths = ['正月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '冬月', '腊月'];
25
-      
26
-      // 农历日期名称
27
-      const lunarDays = [
28
-        '初一', '初二', '初三', '初四', '初五', '初六', '初七', '初八', '初九', '初十',
29
-        '十一', '十二', '十三', '十四', '十五', '十六', '十七', '十八', '十九', '二十',
30
-        '廿一', '廿二', '廿三', '廿四', '廿五', '廿六', '廿七', '廿八', '廿九', '三十'
31
-      ];
32
-    
33
-      // 阳历节日映射
34
-      const solarFestivals = {
35
-        '1-1': '元旦',
36
-        '2-14': '情人节',
37
-        '3-8': '妇女节',
38
-        '4-1': '愚人节',
39
-        '5-1': '劳动节',
40
-        '6-1': '儿童节',
41
-        '9-10': '教师节',
42
-        '10-1': '国庆节',
43
-        '12-24': '平安夜',
44
-        '12-25': '圣诞节'
45
-      };
46
-    
47
-      // 农历节日映射(需要根据具体年份计算,这里简化处理)
48
-      const lunarFestivals = {
49
-        '正月-初一': '春节',
50
-        '正月-十五': '元宵',
51
-        '五月-初五': '端午',
52
-        '七月-初七': '七夕',
53
-        '八月-十五': '中秋',
54
-        '九月-初九': '重阳',
55
-        '腊月-三十': '除夕'
56
-      };
57
-    
58
-      // 节气映射(简化版)
59
-      const solarTerms = {
60
-        '2-4': '立春', '2-19': '雨水',
61
-        '3-5': '惊蛰', '3-20': '春分',
62
-        '4-5': '清明', '4-20': '谷雨',
63
-        '5-5': '立夏', '5-21': '小满',
64
-        '6-6': '芒种', '6-21': '夏至',
65
-        '7-7': '小暑', '7-23': '大暑',
66
-        '8-8': '立秋', '8-23': '处暑',
67
-        '9-8': '白露', '9-23': '秋分',
68
-        '10-8': '寒露', '10-23': '霜降',
69
-        '11-7': '立冬', '11-22': '小雪',
70
-        '12-7': '大雪', '12-22': '冬至'
71
-      };
72
-    
73
-      // 计算农历日期(简化算法)
74
-      const lunarMonthIndex = (month - 1 + Math.floor(curDate / 15)) % 12;
75
-      const lunarDayIndex = (curDate - 1) % 30;
76
-      
77
-      let lunarDate = lunarDays[lunarDayIndex];
78
-      const lunarMonth = lunarMonths[lunarMonthIndex];
79
-      
80
-      // 如果是初一,显示月份
81
-      if (lunarDayIndex === 0) {
82
-        lunarDate = lunarMonth;
83
-      }
84
-    
85
-      // 设置农历显示
86
-      day.prefix = lunarDate;
87
-    
88
-      // 检查阳历节日
89
-      const solarFestivalKey = `${month}-${curDate}`;
90
-      if (solarFestivalKey in solarFestivals) {
91
-        day.suffix = solarFestivals[solarFestivalKey];
92
-        day.className = 'is-solar-festival';
93
-      }
94
-    
95
-      // 检查农历节日
96
-      const lunarFestivalKey = `${lunarMonth}-${lunarDays[lunarDayIndex]}`;
97
-      if (lunarFestivalKey in lunarFestivals) {
98
-        day.suffix = lunarFestivals[lunarFestivalKey];
99
-        day.className = 'is-lunar-festival';
100
-      }
101
-    
102
-      // 检查节气
103
-      if (solarFestivalKey in solarTerms) {
104
-        day.suffix = solarTerms[solarFestivalKey];
105
-        day.className = 'is-solar-term';
106
-      }
107
-    
108
-      // 周末样式
109
-      if (date.getDay() === 0 || date.getDay() === 6) {
110
-        day.className = (day.className || '') + ' is-weekend';
111
-      }
112
-    
113
-      // 今天日期样式
114
-      const today = new Date();
115
-      if (year === today.getFullYear() && 
116
-          month === today.getMonth() + 1 && 
117
-          curDate === today.getDate()) {
118
-        day.className = (day.className || '') + ' is-today';
119
-      }
120
-    
121
-      return day;
122
-    },
123
-    selectschedudata:[],
124
-    partnerPosition:wx.getStorageSync('partnerPosition').partnerPosition
125
-  },
126
-
127
-            // day.suffix = '¥100';
128
-  /**
129
-   * 生命周期函数--监听页面加载
130
-   */
131
-  onLoad(options) {
132
-  this.getuser()
133
-  const currentTimestamp = Date.now();
134
-  this.setData({
135
-    value:currentTimestamp,
136
-    valuename:timestamp.timestamp(currentTimestamp)
137
-  })
138
-  this.getdatetime()
139
-
140
-  },
141
-  // 查询人员
142
-  getuser(){
143
-    let data = {
144
-      partnerName:'',
145
-      partnerPhone:'',
146
-      partnerType:''
147
-    }
148
-    api.request(`/partner/selectinformationall`, 'POST',data)
149
-    .then((res) => {
150
-      console.log(res);
151
-      const positionMap = { 1: '值班员', 2: '值长', 3: '站长', 4: '董事长' };
152
-      const transformedData = res.data.map(item => ({
153
-        label: item.partnerName,
154
-        value: item.partnerId,
155
-        content: positionMap[item.partnerPosition] || item.partnerPosition,
156
-        ...item
157
-      }));
158
-      console.log(transformedData);
159
-      this.setData({
160
-        options:transformedData
161
-      })
162
-    })
163
-    .catch((err) => {
164
-      console.error('请求失败:', err);
165
-      // 在这里处理请求失败的情况
166
-    });
167
-  },
168
-  
169
-  handleSelect(e) {
170
-    const { value } = e.detail;
171
-    
172
-this.setData({
173
-  value:value,
174
-  valuename:timestamp.timestamp(value)
175
-})
176
-    console.log(value);
177
-    this.getdatetime()
178
-  },
179
-  handleConfirm(e) {
180
-    this.setData({ value: e.detail.value });
181
-    console.log(e.detail.value);
182
-  },
183
-
184
-  handlePanelChange(e) {
185
-    const { year, month } = e.detail;
186
-    console.log('year: ', year, 'month: ', month);
187
-  },
188
-  ondutyadd(){
189
-    this.setData({
190
-      visible:true
191
-    })
192
-  },
193
-  onVisibleChange(){
194
-    this.setData({
195
-      visible:false
196
-    })
197
-  },
198
-  handleGroupChange(event) {
199
-    console.log('group', event.detail.value);
200
-    this.setData({
201
-      current: event.detail.value,
202
-    });
203
-  },
204
-    // 查询日期
205
-    getdatetime(){
206
-      let data = {
207
-        startdate:this.data.valuename,
208
-        enddate:this.data.valuename,
209
-      }
210
-      api.request(`/scheduling/selectscheduling`, 'POST',data)
211
-      .then((res) => {
212
-        console.log(res);
213
-        this.setData({
214
-          selectschedudata:res.data
215
-        })
216
-      })
217
-      .catch((err) => {
218
-        console.error('请求失败:', err);
219
-        // 在这里处理请求失败的情况
220
-      });
221
-    },
222
-    onworkorder(){
223
-      let data ={
224
-        schedulingId:this.data.selectschedudata[0].id,
225
-        partnerId:this.data.current.toString()
226
-      }
227
-      api.request(`/scheduling`, 'POST',data)
228
-      .then((res) => {
229
-        console.log(res);
230
-       this.setData({
231
-        visible:false
232
-       })
233
-       this.getdatetime()
234
-      })
235
-      .catch((err) => {
236
-        console.error('请求失败:', err);
237
-        // 在这里处理请求失败的情况
238
-      });
239
-    },
240
-  /**
241
-   * 生命周期函数--监听页面初次渲染完成
242
-   */
243
-  onReady() {
244
-
245
-  },
246
-
247
-  /**
248
-   * 生命周期函数--监听页面显示
249
-   */
250
-  onShow() {
251
-
252
-  },
253
-
254
-  /**
255
-   * 生命周期函数--监听页面隐藏
256
-   */
257
-  onHide() {
258
-
259
-  },
260
-
261
-  /**
262
-   * 生命周期函数--监听页面卸载
263
-   */
264
-  onUnload() {
265
-
266
-  },
267
-
268
-  /**
269
-   * 页面相关事件处理函数--监听用户下拉动作
270
-   */
271
-  onPullDownRefresh() {
272
-
273
-  },
274
-
275
-  /**
276
-   * 页面上拉触底事件的处理函数
277
-   */
278
-  onReachBottom() {
279
-
280
-  },
281
-
282
-  /**
283
-   * 用户点击右上角分享
284
-   */
285
-  onShareAppMessage() {
286
-
287
-  }
288
-})

+ 0
- 9
pages/scheduling/index.json ファイルの表示

@@ -1,9 +0,0 @@
1
-{
2
-  "usingComponents": {
3
-    "t-calendar": "tdesign-miniprogram/calendar/calendar",
4
-    "t-icon": "tdesign-miniprogram/icon/icon",
5
-    "t-popup": "tdesign-miniprogram/popup/popup",
6
-    "t-checkbox-group": "tdesign-miniprogram/checkbox-group/checkbox-group",
7
-    "t-checkbox": "tdesign-miniprogram/checkbox/checkbox"
8
-  }
9
-}

+ 0
- 50
pages/scheduling/index.wxml ファイルの表示

@@ -1,50 +0,0 @@
1
-<!--pages/scheduling/index.wxml-->
2
-<view class="scheduling">
3
-  <t-calendar 
4
-    value="{{value}}" 
5
-    switch-mode="year-month" 
6
-    use-popup="{{false}}" 
7
-    type="single" 
8
-    title="日历标题"
9
-    minDate="{{minDate}}" 
10
-    maxDate="{{maxDate}}" 
11
-    show-lunar="{{true}}" 
12
-    format="{{format}}"
13
-    bind:select="handleSelect"  
14
-    bind:confirm="handleConfirm"
15
-    bind:panel-change="handlePanelChange"
16
-  />
17
-
18
-<view class="content">
19
-<view class="content_fonst">
20
-<view>{{valuename}} 值班</view>
21
-
22
-<view class="Scancode_lefticon" wx:if="{{partnerPosition!=1}}">
23
-  <t-icon bind:tap="ondutyadd" name="add" size="60rpx" data-name="add"/>
24
- </view>
25
- </view>
26
-<view class="Scancode_content" wx:for="{{selectschedudata[0].partner}}">{{item.partnerName}} 
27
-  <!-- 1: '值班员', 2: '值长', 3: '站长', 4: '董事长'  -->
28
-<text class="Scancode_content11" wx:if="{{item.partnerPosition==1}}">值班员</text>
29
-<text class="Scancode_content11" wx:if="{{item.partnerPosition==2}}">值长</text>
30
-<text class="Scancode_content11" wx:if="{{item.partnerPosition==3}}">站长</text>
31
-<text class="Scancode_content11" wx:if="{{item.partnerPosition==4}}">董事长</text>
32
-</view>
33
-
34
-</view>
35
-</view>
36
-
37
-<t-popup
38
-  visible="{{visible}}"
39
-  usingCustomNavbar
40
-  bind:visible-change="onVisibleChange"
41
-  placement="bottom"
42
->
43
-   <view class="popupbox">
44
-   <view class="popupboxname">选择值班员</view>
45
-   <t-checkbox-group value="{{current}}" bind:change="handleGroupChange" options="{{options}}" />
46
-   <view class="workorder_box">
47
-<view class="workorder" bind:tap="onworkorder">提交</view>
48
-</view>
49
-   </view>
50
-</t-popup>

+ 0
- 187
pages/scheduling/index.wxss ファイルの表示

@@ -1,187 +0,0 @@
1
-/* pages/scheduling/index.wxss */
2
-
3
-page{
4
-  width: 100%;
5
-  height: 100%;
6
-  background-color: #f5f5f5;
7
-box-sizing: border-box;
8
-
9
-}
10
-.scheduling{
11
-  padding:20rpx 20rpx;
12
-box-sizing: border-box;
13
-
14
-}
15
-.content{
16
-  width: 100%;
17
-  margin-top: 20rpx;
18
-  padding: 20rpx;
19
-background-color: #ffffff;
20
-border-radius: 10rpx;
21
-display: flex;
22
-flex-direction: column;
23
-box-sizing: border-box;
24
-
25
-}
26
-.Scancode_content{
27
-  width: 600rpx;
28
-  display: flex;
29
-  margin-top: 20rpx;
30
-  box-sizing: border-box;
31
-}
32
-.Scancode_lefticon{
33
-  width: 100rpx;
34
-  margin-top: 20rpx;
35
-  display: flex;
36
-  align-items: center;
37
-  justify-content: center;
38
-  border: 1rpx solid #cccccc;
39
-  border-radius: 10rpx;
40
-  box-sizing: border-box;
41
-
42
-
43
-}
44
-.popupbox{
45
-  width: 100%;
46
-  min-height: 600rpx;
47
-}
48
-.content_fonst{
49
-  display: flex;
50
-  align-items: center;
51
-  justify-content: space-between;
52
-  /* justify-content:space-around; */
53
-  font-size: 36rpx;
54
-  margin-bottom: 20rpx;
55
-  box-sizing: border-box;
56
-}
57
-.popupboxname{
58
-  width: 100%;
59
-  display: flex;
60
-  justify-content: center;
61
-  align-items: center;
62
-  font-size: 36rpx;
63
-  padding: 20rpx 0rpx;
64
-}
65
-.box {
66
-  padding: 32rpx;
67
-  display: flex;
68
-  justify-content: space-between;
69
-  flex-wrap: wrap;
70
-  background-color: var(--td-bg-color-container, #fff);
71
-}
72
-/* 日历容器 */
73
-.scheduling {
74
-  width: 100%;
75
-  padding: 20rpx;
76
-  background: #f8f9fa;
77
-  min-height: 100vh;
78
-}
79
-
80
-/* 节日样式 */
81
-.is-festival .t-calendar__cell--solar {
82
-  color: #e74c3c !important;
83
-  font-weight: bold !important;
84
-}
85
-
86
-.is-festival .t-calendar__cell--lunar {
87
-  color: #e74c3c !important;
88
-  font-weight: bold !important;
89
-}
90
-
91
-/* 节气样式 */
92
-.is-term .t-calendar__cell--solar {
93
-  color: #27ae60 !important;
94
-}
95
-
96
-.is-term .t-calendar__cell--lunar {
97
-  color: #27ae60 !important;
98
-  font-weight: bold !important;
99
-}
100
-
101
-/* 周末样式 */
102
-.is-weekend .t-calendar__cell--solar {
103
-  color: #7f8c8d !important;
104
-}
105
-
106
-/* 有节日的单元格 */
107
-.has-festival .t-calendar__cell--suffix {
108
-  position: absolute;
109
-  top: 4rpx;
110
-  right: 4rpx;
111
-  font-size: 18rpx;
112
-  color: #e74c3c;
113
-  background: rgba(231, 76, 60, 0.1);
114
-  padding: 2rpx 6rpx;
115
-  border-radius: 8rpx;
116
-  transform: scale(0.8);
117
-}
118
-
119
-/* 调整农历显示样式 */
120
-.t-calendar__cell--lunar {
121
-  font-size: 20rpx !important;
122
-  color: #666 !important;
123
-  margin-top: 2rpx !important;
124
-}
125
-
126
-/* 选中状态样式 */
127
-.t-calendar__cell--selected .t-calendar__cell--solar,
128
-.t-calendar__cell--selected .t-calendar__cell--lunar {
129
-  color: #ffffff !important;
130
-}
131
-
132
-/* 今天日期样式 */
133
-.t-calendar__cell--now .t-calendar__cell--solar {
134
-  color: #007aff !important;
135
-  font-weight: bold !important;
136
-}
137
-
138
-.t-calendar__cell--now .t-calendar__cell--lunar {
139
-  color: #007aff !important;
140
-}
141
-
142
-/* 调整单元格高度 */
143
-.t-calendar__cell {
144
-  min-height: 110rpx !important;
145
-  padding: 8rpx 4rpx !important;
146
-}
147
-
148
-/* 月份切换面板样式 */
149
-.t-calendar__panel {
150
-  background: #fff;
151
-  border-radius: 16rpx;
152
-  margin-bottom: 20rpx;
153
-}
154
-.workorder_box{
155
-  width: 100%;
156
-
157
-  padding-top:30rpx;
158
-  display: flex;
159
-/* align-items: center; */
160
-justify-content: center;
161
-box-sizing: border-box;
162
-background-color: #ffffff;
163
-}
164
-.workorder{
165
-  width: 480rpx;
166
-  height: 80rpx;
167
-  font-size: 32rpx;
168
-  background-color: rgba(15, 128, 220, 0.2);
169
-  color: #0F80DC;
170
-  border:1rpx solid #0F80DC;
171
-display: flex;
172
-align-items: center;
173
-justify-content: center;
174
-border-radius: 10rpx;
175
-}
176
-.Scancode_content11{
177
-  display: flex;
178
-  align-items: center;
179
-  justify-content: center;
180
-  padding: 4rpx 10rpx;
181
-  background-color: #0F80DC;
182
-  border: 1rpx solid #0F80DC;
183
-  border-radius: 100rpx;
184
-margin-left: 20rpx;
185
-  color: #fff;
186
-  box-sizing: border-box;
187
-}

+ 10
- 6
pages/setup/index.js ファイルの表示

@@ -29,7 +29,7 @@ inputValue: '' // 初始值
29 29
   },
30 30
   onsetup(){
31 31
     wx.navigateTo({
32
-      url: '/pages/setuplevel/index', // 登录页面的路径,注意路径前面加上 '/' 表示从根目录开始
32
+      url: '/package-setup/pages/setuplevel/index', // 登录页面的路径,注意路径前面加上 '/' 表示从根目录开始
33 33
     });
34 34
   },
35 35
   // 电站详情
@@ -59,13 +59,17 @@ inputValue: '' // 初始值
59 59
   },
60 60
   toconfigure(e){
61 61
     console.log(e.currentTarget.dataset.name);
62
-    if (e.currentTarget.dataset.name=="project") {
62
+    if (e.currentTarget.dataset.name=="userlist") {
63 63
       wx.navigateTo({
64
-        url: '/pages/project/index', // 登录页面的路径,注意路径前面加上 '/' 表示从根目录开始
64
+        url: '/pages/userlist/index',
65 65
       });
66
-    }else if (e.currentTarget.dataset.name=="customer"){
66
+    }else if (e.currentTarget.dataset.name=="driver"){
67 67
       wx.navigateTo({
68
-        url: '/pages/customer/index', // 登录页面的路径,注意路径前面加上 '/' 表示从根目录开始
68
+        url: '/pages/driver/index',
69
+      });
70
+    }else if (e.currentTarget.dataset.name=="address"){
71
+      wx.navigateTo({
72
+        url: '/pages/address/index',
69 73
       });
70 74
     }else{
71 75
       wx.showToast({
@@ -125,7 +129,7 @@ inputValue: '' // 初始值
125 129
    * 生命周期函数--监听页面显示
126 130
    */
127 131
   onShow() {
128
- this.getuser()
132
+//  this.getuser()
129 133
 
130 134
     this.setData({
131 135
       station:wx.getStorageSync('station')

+ 1
- 1
pages/setup/index.json ファイルの表示

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

+ 21
- 13
pages/setup/index.wxml ファイルの表示

@@ -1,12 +1,5 @@
1 1
 <view class="setup">
2
-  <view class="navigation-container" style="{{'height: ' + navStatusBarHeight +'px'}}">
3
-  <!-- 空白来占位状态栏 -->
4
-  <view style="{{'height: ' + statusBarHeight +'px'}}"></view>
5
-  <!-- 自定义导航栏 -->
6
-  <view class="navigation-bar" style="{{'height:' + navBarHeight +'px'}}">
7
-    <!-- <view class="title">个人中心</view> -->
8
-  </view>
9
-</view>
2
+ 
10 3
 <view style="width: 100%;height:60rpx"></view>
11 4
 <view class="user">
12 5
 <image bind:tap="onuser" class="user_to" src="{{user.partnerAvite||'https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132'}}" mode=""/>
@@ -21,16 +14,31 @@
21 14
 </view>
22 15
 </view>
23 16
 <view style="width: 100%;height:40rpx"></view>
24
-<!---->
25
-<!-- <view class="allocation_box">
26
-<view class="allocation" data-name="project" bind:tap="toconfigure">
27
-<view class="allocation_3">排班</view>
17
+<!-- -->
18
+<view class="allocation_box">
19
+<view class="allocation" data-name="userlist" bind:tap="toconfigure">
20
+<view class="allocation_3">用户</view>
21
+<view class="allocation_1">
22
+<view class="allocation_2"></view>
23
+<t-icon name="chevron-right-s" size="40rpx" data-name="chevron-right-s"/>
24
+</view>
25
+</view>
26
+<view class="allocation" data-name="driver" bind:tap="toconfigure">
27
+<view class="allocation_3">司机</view>
28
+<view class="allocation_1">
29
+<view class="allocation_2"></view>
30
+<t-icon name="chevron-right-s" size="40rpx" data-name="chevron-right-s"/>
31
+</view>
32
+</view>
33
+<view class="allocation" data-name="address" bind:tap="toconfigure">
34
+<view class="allocation_3">地址</view>
28 35
 <view class="allocation_1">
29 36
 <view class="allocation_2"></view>
30 37
 <t-icon name="chevron-right-s" size="40rpx" data-name="chevron-right-s"/>
31 38
 </view>
32 39
 </view>
33
-</view> -->
40
+</view>
41
+
34 42
 <view class="allocation_box">
35 43
  
36 44
 <view class="allocation">

+ 4
- 4
pages/setup/index.wxss ファイルの表示

@@ -1,7 +1,7 @@
1 1
 .setup{
2 2
   width: 100%;
3 3
   height: 100vh;
4
-  background: linear-gradient(to bottom, #0F80DC -40%, #F0F5F5 40%,#F0F5F5 100%);
4
+  background: linear-gradient(to bottom, #F0F5F5 -40%, #F0F5F5 40%,#F0F5F5 100%);
5 5
   padding: 0rpx 30rpx;
6 6
   box-sizing: border-box;
7 7
 
@@ -78,8 +78,7 @@ width: 100%;
78 78
   width: 48%;
79 79
   background-color: #ffffff;
80 80
   border-radius: 10rpx;
81
-  box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1);
82
-
81
+    box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1);
83 82
 }
84 83
 .equipment_rightdiv{
85 84
   width: 78rpx;
@@ -155,7 +154,8 @@ box-sizing: border-box;
155 154
    padding: 10rpx 0rpx;
156 155
    box-sizing: border-box;
157 156
    margin-top: 30rpx;
158
-box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1);
157
+  box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1);
158
+
159 159
 
160 160
  }
161 161
  .allocation_2{

+ 0
- 164
pages/statistics/index.js ファイルの表示

@@ -1,164 +0,0 @@
1
-// pages/statistics/index.js
2
-
3
-const api = require('../../api/index.js');
4
-
5
-Page({
6
-
7
-  /**
8
-   * 页面的初始数据
9
-   */
10
-  data: {
11
-    // 状态栏高度
12
-    statusBarHeight: wx.getStorageSync('statusBarHeight'),
13
-    // 导航栏高度
14
-    navBarHeight: wx.getStorageSync('navBarHeight'),
15
-    // 导航栏和状态栏高度
16
-    navStatusBarHeight: wx.getStorageSync('navStatusBarHeight'),
17
-    // 胶囊
18
-    menu:wx.getStorageSync('menu'),
19
-    sunec: {
20
-      lazyLoad: true
21
-    }
22
-  },
23
-
24
-  /**
25
-   * 生命周期函数--监听页面加载
26
-   */
27
-  onLoad(options) {
28
-    this.sunline = this.selectComponent('#sunlinechart')
29
-    this.onworkorder()
30
-  //  this.getsunlinechart()
31
-  },
32
-  onlevel(){
33
-    console.log(1111111);
34
-wx.navigateBack({
35
-  data:1
36
-})
37
-  },
38
-  onworkorder(){
39
-    let data = {
40
-      workorderType:''
41
-    }
42
-    api.request(`/workoder/statistics`, 'POST',data)
43
-    .then((res) => {
44
-      console.log(res);
45
-      this.setData({
46
-        workorder:res.data
47
-      })
48
-    })
49
-    .catch((err) => {
50
-      console.error('请求失败:', err);
51
-      // 在这里处理请求失败的情况
52
-    });
53
-  },
54
-  // 日用电价走势
55
-  getsunlinechart() {
56
-    this.sunline.init((canvas, width, height, dpr) => {
57
-      const chart = echarts.init(canvas, null, {
58
-        width: width,
59
-        height: height,
60
-        devicePixelRatio: dpr
61
-      });
62
-      canvas.setChart(chart);
63
-      var option = {
64
-        xAxis: {
65
-          type: 'category',
66
-          data: [1,2,3,4,5,6,7,8,9,10]
67
-        },
68
-        yAxis: {
69
-          type: 'value',
70
-          axisLine: {
71
-            show: true,
72
-            lineStyle: {
73
-              color: '#999',
74
-              width: 1
75
-            }
76
-          },
77
-          axisTick: {
78
-            show: false
79
-          },
80
-          splitLine: {
81
-            show: true,
82
-            lineStyle: {
83
-              type: 'dotted',
84
-              color: '#ccc',
85
-              width: 1,
86
-              opacity: 0.6
87
-            }
88
-          }
89
-        },
90
-        grid: {
91
-          top: '10%',
92
-          left: '0%',
93
-          right: '4%',
94
-          bottom: '3%',
95
-          containLabel: true
96
-        },
97
-        series: [
98
-          {
99
-            data: [10,20,30,40,50,60,70,70,70,70,70],
100
-            showSymbol: false,
101
-            type: 'line',
102
-            step: 'start',
103
-            color: '#B2D5CB',
104
-          }
105
-        ]
106
-      };
107
-
108
-      chart.setOption(option);
109
-      return chart;
110
-    });
111
-  },
112
-  /**
113
-   * 生命周期函数--监听页面初次渲染完成
114
-   */
115
-  onReady() {
116
-
117
-  },
118
-  onstatistics(){
119
-    wx.switchTab({
120
-      url: '/pages/tool/index',
121
-    })
122
-  },
123
-  /**
124
-   * 生命周期函数--监听页面显示
125
-   */
126
-  onShow() {
127
-
128
-  },
129
-
130
-  /**
131
-   * 生命周期函数--监听页面隐藏
132
-   */
133
-  onHide() {
134
-
135
-  },
136
-
137
-  /**
138
-   * 生命周期函数--监听页面卸载
139
-   */
140
-  onUnload() {
141
-
142
-  },
143
-
144
-  /**
145
-   * 页面相关事件处理函数--监听用户下拉动作
146
-   */
147
-  onPullDownRefresh() {
148
-
149
-  },
150
-
151
-  /**
152
-   * 页面上拉触底事件的处理函数
153
-   */
154
-  onReachBottom() {
155
-
156
-  },
157
-
158
-  /**
159
-   * 用户点击右上角分享
160
-   */
161
-  onShareAppMessage() {
162
-
163
-  }
164
-})

+ 0
- 109
pages/statistics/index.wxml ファイルの表示

@@ -1,109 +0,0 @@
1
-<!--pages/statistics/index.wxml-->
2
-<view class="statistics_bj">
3
-  <view class="navigation-container" style="{{'height: ' + navStatusBarHeight +'px'}}">
4
-    <!--空白来占位状态栏-->
5
-    <view style="{{'height: ' + statusBarHeight +'px'}}"></view>
6
-    <!--自定义导航栏 -->
7
-    <view class="navigation-bar" style="{{'height:' + navBarHeight +'px'}}">
8
-      <t-icon name="chevron-left" size="70rpx" data-name="chevron-left" bind:tap="onlevel" />
9
-    </view>
10
-
11
- 
12
-  </view>
13
-  <view class="statistics">
14
-      <view class="piece" bind:tap="onstatistics">
15
-        <view class="statistics_top">
16
-          <view class="statistics_1">
17
-            <view class="statistics_digit">{{workorder.allcount}}</view>
18
-            <view class="statistics_title">全部工单</view>
19
-          </view>
20
-          <view class="statistics_1">
21
-            <view class="statistics_digit">{{workorder.incompletecount}}</view>
22
-            <view class="statistics_title">全部待办</view>
23
-          </view>
24
-          <view class="statistics_1">
25
-            <view class="statistics_digit">{{workorder.completecount}}</view>
26
-            <view class="statistics_title">全部办结</view>
27
-          </view>
28
-        </view>
29
-        <view style="height: 20rpx;"></view>
30
-        <view class="statistics_top">
31
-          <view class="statistics_1">
32
-            <view class="statistics_digit">{{workorder.myworkodercount}}</view>
33
-            <view class="statistics_title">我的工单</view>
34
-          </view>
35
-          <view class="statistics_1">
36
-            <view class="statistics_digit">{{workorder.myworkodertodo}}</view>
37
-            <view class="statistics_title">我的待办</view>
38
-          </view>
39
-          <view class="statistics_1">
40
-            <view class="statistics_digit">{{workorder.myworkoderend}}</view>
41
-            <view class="statistics_title">我的已办</view>
42
-          </view>
43
-        </view>
44
-      </view>
45
-<!--  -->
46
-      <view style="height: 40rpx;"></view>
47
-      <view class="piece">
48
-
49
-        <view class="statistics_top">
50
-          <view class="statistics_1">
51
-            <view class="statistics_digit">{{workorder.dayworkoderAssemble}}</view>
52
-            <view class="statistics_title">今天工单</view>
53
-          </view>
54
-          <view class="statistics_1">
55
-            <view class="statistics_digit">{{workorder.dayworkoderTodo}}</view>
56
-            <view class="statistics_title">今天待办</view>
57
-          </view>
58
-          <view class="statistics_1">
59
-            <view class="statistics_digit">{{workorder.dayworkoderEnd}}</view>
60
-            <view class="statistics_title">今天已办</view>
61
-          </view>
62
-        </view>
63
-        <view style="height: 20rpx;"></view>
64
-
65
-        <view class="statistics_top">
66
-          <view class="statistics_1">
67
-            <view class="statistics_digit">{{workorder.weeksworkoderAssemble}}</view>
68
-            <view class="statistics_title">周工单</view>
69
-          </view>
70
-          <view class="statistics_1">
71
-            <view class="statistics_digit">{{workorder.monthworkoderAssemble}}</view>
72
-            <view class="statistics_title">月工单</view>
73
-          </view>
74
-          <view class="statistics_1">
75
-            <view class="statistics_digit">{{workorder.yearworkoderAssemble}}</view>
76
-            <view class="statistics_title">年工单</view>
77
-          </view>
78
-        </view>
79
-        <view class="statistics_top">
80
-          <view class="statistics_1">
81
-            <view class="statistics_digit">{{workorder.failcount}}</view>
82
-            <view class="statistics_title">审核失败</view>
83
-          </view>
84
-          <view class="statistics_1">
85
-            <view class="statistics_digit">{{workorder.successcount}}</view>
86
-            <view class="statistics_title">审核完成</view>
87
-          </view>
88
-          <view class="statistics_1">
89
-            <view class="statistics_digit1"></view>
90
-            <view class="statistics_title1"></view>
91
-          </view>
92
-        </view>
93
-      </view>
94
-    </view>
95
-
96
-    <view class="qiun_data">
97
-        <!-- <qiun-data-charts type="line" :opts="daylineopts" :chartData="daylinechart" /> -->
98
-        <!-- <view class="qiun_box">
99
-          每日工单
100
-    <view class="eccanvas">
101
-
102
-        <ec-canvas force-use-old-canvas="true" id="sunlinechart" canvas-id="sunlinechart" ec="{{ sunec }}"></ec-canvas>
103
-      </view>
104
-        </view> -->
105
-      
106
-      </view>
107
-
108
-
109
-</view>

+ 0
- 93
pages/statistics/index.wxss ファイルの表示

@@ -1,93 +0,0 @@
1
-/* pages/statistics/index.wxss */
2
-page{
3
-  width: 100%;
4
-  height: 100%;
5
-}
6
-.statistics_bj{
7
-  width: 100%;
8
-  height: 100%;
9
-  background-image: url('https://esos-iot.bjdexn.cn/myminio/project/40d665be18f5406daefdd1716164466e.png');
10
-  background-repeat: no-repeat;
11
-  background-size: 100% 100%;
12
-}
13
-.navigation-container {
14
-  position: fixed;
15
-  width: 100%;
16
-  z-index: 99;
17
-}
18
-.navigation-bar {
19
-  position: relative;
20
-  width: 100%;
21
-  display: flex;
22
-  align-items: center;
23
-  /* justify-content: center; */
24
-  padding-left: 20rpx;
25
-  flex-direction: row;
26
-  color: #333333;
27
-}
28
-.statistics{
29
-  width: 100%;
30
-  padding: 0rpx 20rpx;
31
-  padding-top: 400rpx;
32
-  box-sizing: border-box;
33
-}
34
-.statistics_top{
35
-  display: flex;
36
-  justify-content: space-between;
37
-}
38
-.piece{
39
-  border-radius: 10rpx;
40
-  background-color: #ffffff;
41
-  padding: 10rpx 20rpx;
42
-
43
-}
44
-.statistics_1{
45
-  display: flex;
46
-  flex-direction: column;
47
-  justify-content: center;
48
-  align-items: center;
49
-}
50
-.statistics_digit{
51
-  font-size: 48rpx;
52
-}
53
-.statistics_digit1{
54
-  width: 116rpx;
55
-  font-size: 48rpx;
56
-}
57
-.statistics_title1{
58
-  margin-top: 10rpx;
59
-}
60
-.statistics_title{
61
-  margin-top: 10rpx;
62
-}
63
-
64
-.qiun_data {
65
-  width: 100%;
66
-  margin-top: 20rpx;
67
-  padding: 20rpx;
68
-  display: flex;
69
-  flex-direction: column;
70
-  /* overflow: auto; */
71
-  box-sizing: border-box;
72
-  border-radius: 8rpx;
73
-overflow: hidden;
74
-  
75
-}
76
-.qiun_box{
77
-  width: 100%;
78
-  height: 100%;
79
-  background-color: #ffffff;
80
-  padding: 20rpx;
81
-  box-sizing: border-box;
82
-
83
-}
84
-.eccanvas{
85
-  width: 100%;
86
-  height: 500rpx;
87
-  box-sizing: border-box;
88
-  }
89
-#mychart_line{
90
-  width: 100%;
91
-    height: 500rpx;
92
-  box-sizing: border-box;
93
-  }

+ 48
- 123
pages/tool/index.js ファイルの表示

@@ -2,152 +2,77 @@ const api = require('../../api/index.js');
2 2
 Page({
3 3
 
4 4
   data: {
5
-    visible:false,
6
-    tabsindex:"1,2",
7
-    workorderName:'',
8
-    datestart:'',
9
-    dateend:'',
10
-    array:['日常','故障','其他'],
11
-    priority:'',
12
-    index:'',
13
-    reviewdata:[],
14
-    examineType:0
5
+    tabsindex:"1",
6
+    driverlist:[],
7
+    selected:1,
8
+    userdata:[]
15 9
   },
16 10
   onLoad() {
17
-  },
18
-  // 选项卡
19
-  onTabsChange(e){
20
-  console.log(e.detail.value);
21
-  this.setData({
22
-    tabsindex:e.detail.value
23
-  })
24
-  this.gitreview()
25
-  },
26
-  // 输入工单名称
27
-  onPeakprice(e){
28
-console.log(e.detail.value);
29
-this.setData({
30
-  workorderName:e.detail.value
31
-})
32
-  },
33
-    // 事件
34
-    bindeventChange(e){
35
-      console.log(e.detail.value);
36
-      this.setData({
37
-        index:e.detail.value
38
-      })
39
-        },
40
-  // 开始事件
41
-  bindstartChange: function(e) {
42
-    console.log('picker发送选择改变,携带值为', e.detail.value)
11
+    // this.getdriver()
43 12
     this.setData({
44
-      datestart: e.detail.value
13
+      userdata:wx.getStorageSync('user')
45 14
     })
46 15
   },
47
-  // 结束时间
48
-  bindendChange: function(e) {
49
-    console.log('picker发送选择改变,携带值为', e.detail.value)
50
-    this.setData({
51
-      dateend: e.detail.value
52
-    })
16
+  onselected(e){
17
+    console.log(e.currentTarget.dataset.index);
18
+this.setData({
19
+  selected:e.currentTarget.dataset.index
20
+})
21
+this.getdriver()
53 22
   },
54
-    // 工单优先级
55
-    onradio(e){
56
-      console.log(e.detail.value); 
57
-      this.setData({
58
-        priority:e.detail.value
59
-      })
60
-        },
61
-          // 工单审核状态
62
-          onexamineType(e){
63
-      console.log(e.detail.value); 
64
-      this.setData({
65
-        examineType:e.detail.value
66
-      })
67
-        },
68
-        
69
-        onworkorder(){
70
-         this.setData({
71
-          visible:false
72
-         })
73
-        this.gitreview()
74
-        },
75
-        onreset(){
76
-          this.setData({
77
-            workorderName:'',
78
-            tabsindex:"1,2",
79
-            datestart:'',
80
-            dateend:'',
81
-            index:'',
82
-            priority:'',
83
-            examineType:0
84
-          })
85
-          this.gitreview()
86
-
87
-        },
88
-  gitreview(){
89
-    
90
-    let data = {
91
-      workorderName:this.data.workorderName,
92
-      workorderType:this.data.tabsindex==0?'':this.data.tabsindex,
93
-      workorderAddress:'',
94
-      starttime:this.data.datestart,
95
-      endtime:this.data.dateend,
96
-      type:this.data.index==''?'':this.data.index*1+1,
97
-      examineType:this.data.examineType==0?'':this.data.examineType
23
+  getdriver(){
24
+    let data ={
25
+      workorderId:'',
26
+      workorderName:'',
27
+      addressId:'',
28
+      driverId:'',
29
+      carId:'',
30
+      customerId:'',
31
+      workorderType:'',
32
+      chargedischargeType:this.data.selected,
98 33
     }
99
-  
100
-    api.request(`/workoder/selectworkoder`, 'POST',data)
101
-    .then((res) => {
102
-  if (res.data) {
103
-    this.setData({
104
-      reviewdata:res.data
105
-    })
106
-  }else{
34
+
35
+    api.request(`/sysworkorder/selectworkorderlist`, 'post',data,{ isPublic: false })
36
+    .then((data) => {
37
+  console.log(data.data);
38
+  if (data.code==200) {
107 39
     this.setData({
108
-      reviewdata:[]
40
+      driverlist:data.data
109 41
     })
110 42
   }
43
+  //  wx.navigateTo({
44
+  //   url: '/pages/map/index',
45
+  // })
111 46
     })
112 47
     .catch((err) => {
48
+
113 49
       console.error('请求失败:', err);
114
-    
115
-      // 在这里处理请求失败的情况
116 50
     });
117 51
   },
118
-  onfilter(){
119
-    this.setData({
120
-      visible:true
121
-    })
122
-  },
123
-  onVisibleChange(){
124
-    this.setData({
125
-      visible:false
126
-    })
52
+  // 选项卡
53
+  onTabsChange(e){
54
+  console.log(e.detail.value);
55
+  this.setData({
56
+    tabsindex:e.detail.value
57
+  })
58
+  // this.gitreview()
127 59
   },
128
-  ondetails(e){
129
-    console.log(e.currentTarget.dataset);
130
-wx.navigateTo({
131
-  url: `/pages/workorderdetails/index?id=${e.currentTarget.dataset.id}&workorderId=${e.currentTarget.dataset.workorderid}`,
132
-})
60
+  details(e){
61
+    console.log(e.currentTarget.dataset.id);
62
+    wx.navigateTo({
63
+    url: `/package-map/pages/map/index?id=${e.currentTarget.dataset.id}`,
64
+  })
133 65
   },
66
+
134 67
   onShow() {
135
-    // this.setData({
136
-    //   workorderName:'',
137
-    //   tabsindex:"1,2",
138
-    //   datestart:'',
139
-    //   dateend:'',
140
-    //   index:''
141
-    // })
142
-    this.gitreview()
68
+    this.getdriver()
143 69
 
144 70
   },
145 71
    /**
146 72
    * 页面相关事件处理函数--监听用户下拉动作
147 73
    */
148
-  async onPullDownRefresh() {
149
-   await this.gitreview()
150
-   await wx.stopPullDownRefresh();
74
+   onPullDownRefresh() {
75
+
151 76
 
152 77
   }
153 78
 });

+ 2
- 0
pages/tool/index.json ファイルの表示

@@ -1,6 +1,8 @@
1 1
 {
2 2
   "navigationBarBackgroundColor": "#fff",
3 3
   "enablePullDownRefresh": true,
4
+  "navigationBarTitleText": "订单",
5
+  "navigationStyle": "custom",
4 6
   "usingComponents": {
5 7
     "t-side-bar": "tdesign-miniprogram/side-bar/side-bar",
6 8
     "t-side-bar-item": "tdesign-miniprogram/side-bar-item/side-bar-item",

+ 49
- 129
pages/tool/index.wxml ファイルの表示

@@ -4,144 +4,64 @@
4 4
 </view> -->
5 5
 
6 6
 <view class="workorder">
7
+  <view class="discharge">
8
+<view class="discharge_cheng {{selected==1?'selected':''}}" data-index="1" bind:tap="onselected">充电</view>
9
+<view class="discharge_fang {{selected==2?'selected':''}}" data-index="2" bind:tap="onselected">放电</view>
10
+</view>
11
+<view class="discharge_tabs" wx:if="{{userdata.operationRole==4}}">
7 12
   <t-tabs value="{{tabsindex}}" bind:change="onTabsChange" bind:click="onTabsClick" t-class="custom-tabs" split="{{false}}">
8
-    <t-tab-panel label="待办" value="1,2" />
9
-    <t-tab-panel label="办结" value="3" />
10
-  <t-tab-panel label="全部" value="0" />
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" />
11 17
 </t-tabs>
12
-<view bind:tap="onfilter">
13
-  <t-icon name="filter" size="50rpx" color="#585CE5" data-name="filter" />
14 18
 </view>
19
+<view class="discharge_tabs" wx:if="{{userdata.operationRole==5}}">
20
+  <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="2" />
23
+  <t-tab-panel label="已完成" value="4" />
24
+</t-tabs>
15 25
 </view>
16
-<view style="height: 100rpx;"></view>
17
-<view class="examine_list">
18
-  <view class="examine_box" wx:for="{{reviewdata}}" wx:key="index" data-id="{{item.id}}" data-workorderId="{{item.workorderId}}" bind:tap="ondetails">
19
-<view class="examine_title">
20
-<view class="examine_title0" wx:if="{{item.type==1}}">日常<text style="padding: 0rpx 10rpx;">/</text><text wx:if="{{item.workorderGrade==1}}"> 低</text><text wx:if="{{item.workorderGrade==2}}"> 中</text><text wx:if="{{item.workorderGrade==3}}"> 高</text></view>
21
-<view class="examine_title01" wx:if="{{item.type==2}}">故障 <text style="padding: 0rpx 10rpx;">/</text> <text wx:if="{{item.workorderGrade==1}}"> 低</text><text wx:if="{{item.workorderGrade==2}}"> 中</text><text wx:if="{{item.workorderGrade==3}}"> 高</text></view>
22
-<view class="examine_title02" wx:if="{{item.type==3}}">其他<text style="padding: 0rpx 10rpx;">/</text> <text wx:if="{{item.workorderGrade==1}}"> 低</text><text wx:if="{{item.workorderGrade==2}}"> 中</text><text wx:if="{{item.workorderGrade==3}}"> 高</text></view>
23
-<view class="examine_title1">{{item.workorderName}}</view>
24
-<view class="process_bj2" wx:if="{{item.workorderType==1}}">待处理</view>
25
-<view class="process_bj3" wx:if="{{item.workorderType==2}}">处理中</view>
26
-<view class="examine_title2" wx:if="{{item.workorderType==3}}">处理完成</view>
27
-<!-- <view class="examine_title2" wx:if="{{item.workorderType==3&&item.examineType==5}}">待审核</view>
28
-<view class="examine_title2" wx:if="{{item.workorderType==3&&item.examineType==6}}">审核完成</view>
29
-<view class="examine_title2" wx:if="{{item.workorderType==3&&item.examineType==7}}">审核失败</view> -->
26
+<!-- <view bind:tap="onfilter">
27
+  <t-icon name="filter" size="50rpx" color="#585CE5" data-name="filter" />
28
+</view> -->
30 29
 </view>
31
-<view class="examine_content">
32
-<view class="examine_name">描述:{{item.workorderContent}}</view>
33
-<view class="feedback examine_name" wx:if="{{item.examineType==7}}">退回原因:{{item.workoderReason}}</view>
34
-<view class="feedback examine_name" wx:if="{{item.examineCount!=0&&item.examineType!=7}}">退回原因:{{item.lastfail||'无'}}</view>
30
+<view style="height: 260rpx;"></view>
31
+<view class="order">
32
+<view class="order_box" wx:for="{{driverlist}}" wx:key="workorderId" data-id="{{item.workorderId}}" bind:tap="details">
33
+<view class="order_title">
34
+<view class="order_title1"> <image class="order_image" src="https://esos-iot.bjdexn.cn/myminio/project/458bb7eea14f42cc958eebf0a8b89da3.png" mode="aspectFit"/>
35
+<!-- <text>{{item.carName}}</text> -->
36
+<text>光伏</text>
37
+<!-- <text>风电</text> -->
38
+<!-- <text>网电</text> -->
39
+</view> 
40
+<!-- <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
+<view wx:if="{{item.workorderType==0}}">待处理</view>
42
+<view wx:if="{{item.workorderType==1}}">待出发</view>
43
+<view wx:if="{{item.workorderType==2}}">行驶中</view>
44
+<view wx:if="{{item.workorderType==3}}">到达地点</view>
45
+<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>
35 49
 </view>
36
-<view class="examine_bottom">
37
-<view class="examine_bottompro">
38
-  <view class="promoter"> 
39
- <view class="promoter_people">发起人</view>
40
- <view class="promoter_name">{{item.workorderPromoter}}</view> 
41
- </view>
42
- <view class="promoter_right">
43
-  <view class="promoter_people">发起时间</view>
44
-  <view class="promoter_name">{{item.workorderStarttime}}</view>
45
- </view>
50
+<view class="order_direction"><text class="order_text">方向:</text>
51
+<text style="color: #FDBA67;" wx:if="{{item.chargedischargeType==2}}">放电</text>
52
+<text style="color: #00C775;" wx:if="{{item.chargedischargeType==1}}">充电</text>
46 53
 </view>
54
+<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>
47 56
 
48
- <view class="promoter_review">
49
-  <text class="promoter_review_color" wx:if="{{item.workorderType==3&&item.examineType==5}}">待审核</text>
50
-  <text class="promoter_review_color" wx:if="{{item.workorderType==3&&item.examineType==6}}">审核完成</text>
51
-  <text class="promoter_review_colors" wx:if="{{item.workorderType==3&&item.examineType==7}}">审核失败</text>
52
- </view>
57
+<view class="order_bottom">
58
+  <view class="order_time"><text class="order_text">时间:</text> {{item.workorderCreatetime}}</view>
59
+<!-- <view class="order_view" data-id="{{item.workorderId}}" bind:tap="details">查看详情</view> -->
53 60
 </view>
54
-<!-- <view class="examine_button">
55
-<view class="examine_buttonleft">通过</view>
56
-<view class="examine_buttonright">不通过</view>
57
-</view> -->
58
-</view>
59
-<view class="available" wx:if="{{reviewdata.length==0}}">
60
-<image src="https://esos-iot.bjdexn.cn/myminio/project/9efa1691f71a48b6ae20648c0a2dae56.png" mode="aspectFit"/>
61 61
 </view>
62 62
 </view>
63
+<view class="available" wx:if="{{driverlist.length<1}}">
64
+<image src="https://esos-iot.bjdexn.cn/myminio/project/9efa1691f71a48b6ae20648c0a2dae56.png" mode="aspectFit"/>
65
+</view> 
63 66
 <view style="height: 30rpx;"></view>
64
-
65
-<t-popup
66
-  visible="{{visible}}"
67
-  bind:visible-change="onVisibleChange"
68
-  placement="right"
69
->
70
-  <view class="filter">
71
-    <view class="mtinput">
72
-<input class="uni-mt-5" trim="all" value="{{workorderName}}" clearSize="0"
73
-										placeholder="请输入工单标题" 	bindinput="onPeakprice"></input>
74
-</view>
75
-<view class="owner_type1">
76
-          <picker mode="date" value="{{datestart}}" start="2000-01-01" end="2060-09-01" bindchange="bindstartChange">
77
-					<view class="calculation_top">
78
-						<view class="calculation_left">
79
-              开始时间
80
-						</view>
81
-            <view class="event">
82
-						<view class="uni-input">{{datestart}}</view>
83
-							<t-icon name="chevron-right" size="40rpx" data-name="chevron-right"/>
84
-            </view>
85
-					</view>
86
-				</picker>
87
-        </view>
88
-        <view class="owner_type1">
89
-          <picker mode="date" value="{{dateend}}" start="2000-01-01" end="2060-09-01" bindchange="bindendChange">   
90
-					<view class="calculation_top">                                                                            
91
-						<view class="calculation_left">
92
-              结束时间
93
-						</view>
94
-            <view class="event">
95
-						<view class="uni-input">{{dateend}}</view>
96
-							<t-icon name="chevron-right" size="40rpx" data-name="chevron-right"/>
97
-            </view>
98
-					</view>
99
-				</picker>
100
-        </view>
101
-        <view class="owner_type1">
102
-					<picker bindcolumnchange="bindcolumn" bindchange="bindeventChange" value="{{index}}" range="{{array}}">
103
-          <view class="calculation_top">                                                                            
104
-						<view class="calculation_left">
105
-              事件
106
-						</view>
107
-            <view class="event">
108
-						<view class="uni-input">{{array[index]}}</view>
109
-							<t-icon name="chevron-right" size="40rpx" data-name="chevron-right"/>
110
-            </view>
111
-					</view>
112
-        </picker>
113
-        </view>
114
- 
115
-       
116
-
117
-        <view class="owner_type11">
118
-        	<view class="calculation_strategy">
119
-					工单优先级
120
-					</view>
121
-				  <view class="calculation_capsule">
122
-            <t-radio-group default-value="{{priority}}" value="{{priority}}" borderless t-class="box" bindchange="onradio">
123
-  <t-radio block="{{false}}" label="低" value="0" />
124
-  <t-radio block="{{false}}" label="中" value="1" />
125
-  <t-radio block="{{false}}" label="高" value="2" />
126
-</t-radio-group>
127
-					</view>
128
-        </view>
129
-        <view class="owner_type11">
130
-        	<view class="calculation_strategy">
131
-            审核状态
132
-					</view>
133
-				  <view class="calculation_capsule">
134
-            <t-radio-group default-value="{{examineType}}" value="{{examineType}}" borderless t-class="box" bindchange="onexamineType">
135
-  <t-radio block="{{false}}" label="成功" value="6" />
136
-  <t-radio block="{{false}}" label="失败" value="7" />
137
-</t-radio-group>
138
-					</view>
139
-        </view>
140
-        <view class="workorder_box">
141
-
142
-<view class="workorder1" bind:tap="onworkorder">提交</view>
143
-<view class="workorder1" bind:tap="onreset">重置</view>
144
-</view>
145
-  </view>
146
-</t-popup>
147
-<!--   -->
67
+<!---->

+ 75
- 288
pages/tool/index.wxss ファイルの表示

@@ -1,6 +1,7 @@
1 1
 page {
2 2
   background-color: var(--td-bg-color-container);
3
-  background-color: #f9f9f9;
3
+  /* background-color: #f9f9f9; */
4
+  background: linear-gradient(to bottom, #F0F5F5 -40%, #F0F5F5 40%,#F0F5F5 100%);
4 5
 }
5 6
 
6 7
 page .round-image {
@@ -11,7 +12,6 @@ page .round-image {
11 12
   display: flex;
12 13
   height: 100vh;
13 14
   overflow: hidden;
14
-
15 15
   --td-grid-item-text-font-size: 24rpx;
16 16
 }
17 17
 
@@ -83,327 +83,114 @@ box-sizing: border-box;
83 83
   top: 0rpx;
84 84
   left: 0rpx;
85 85
   display: flex;
86
+  flex-direction: column;
86 87
   align-items: center;
87 88
   justify-content: space-between;
88 89
   background-color: #ffffff;
89 90
   box-sizing: border-box;
90 91
 }
91
-.examine_list{
92
-  padding: 0rpx 20rpx;
93
-  box-sizing: border-box;
92
+.order{
93
+
94
+padding: 0rpx 20rpx;
95
+
94 96
 }
95
-.examine_box{
97
+.order_box{
96 98
   width: 100%;
97 99
   background-color: #ffffff;
98
-  padding: 30rpx 0rpx;
99
-margin-top: 20rpx;
100
-border-radius: 10rpx;
100
+padding: 20rpx 20rpx;
101 101
 box-sizing: border-box;
102
-}
103
-.examine_title{
104
-  width: 100%;
105
-  display: flex;
106
-  align-items: center;
107
-  padding: 0rpx 0rpx 0rpx 20rpx;
108
-  box-sizing: border-box;
109
-}
110
-.examine_title0{
111
- width: 120rpx;
112
- height: 40rpx;
113
- font-size: 22rpx; 
114
- display: flex;
115
- align-items: center;
116
- justify-content: center;
117
- border-radius: 30rpx;
118
- /* background-color: #0F80DC; */
119
- background-color: rgba(0, 117, 68, 0.2);
120
- color: #007544;
121
- 
122
- border: 1rpx solid #007544;
123
-box-sizing: border-box;
124
-}
125
-.examine_title01{
126
-  width: 120rpx;
127
-  height: 40rpx;
128
-  font-size: 22rpx; 
129
-  display: flex;
130
-  align-items: center;
131
-  justify-content: center;
132
-  border-radius: 30rpx;
133
-  /* background-color: #0F80DC; */
134
-  color:#ee8d60;
135
-  background-color: rgba(241, 120, 20, 0.2);
102
+  margin-top: 20rpx;
103
+  border-radius: 10rpx;
104
+/*   box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1);
105
+ */
106
+box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1);
136 107
 
137
-  border: 1rpx solid #f39b72;
138
- box-sizing: border-box;
139
- }
140
- .examine_title02{
141
-  width: 120rpx;
142
-  height: 40rpx;
143
-  font-size: 22rpx; 
144
-  display: flex;
145
-  align-items: center;
146
-  justify-content: center;
147
-  border-radius: 30rpx;
148
-  /* background-color: #0F80DC; */
149
-  color:#0F80DC;
150
-  background-color: rgba(15, 128, 220, 0.2);
151
-  /* color: #007544; */
152
-  border: 1rpx solid #0F80DC;
153
- box-sizing: border-box;
154
- }
155
-.examine_title1{
156
-  flex: 1;
157
-  font-weight: 600;
158
-  font-size: 32rpx;
159
-  display: flex;
160
-  align-items: center;
161
-  padding: 0rpx 10rpx;
162
-  overflow: hidden;
163
-  display: -webkit-box;
164
-  text-overflow: ellipsis;
165
-  box-orient: vertical;
166
-  -webkit-box-orient: vertical;
167
-  -moz-box-orient: vertical;
168
-  -o-box-orient: vertical;
169
-  -ms-box-orient: vertical;
170
-  line-clamp: 1; /* 超出2行显示省略号 */
171
-  -webkit-line-clamp: 1; /* 超出2行显示省略号 */
172
-  box-sizing: border-box;
173
-}
174
-.examine_title2{
175
-  width: 100rpx;
176
-  height: 40rpx;
177
- font-size: 22rpx; 
178
-  display: flex;
179
-  align-items: center;
180
-  justify-content: center;
181
-border-top-left-radius:100rpx;
182
-border-bottom-left-radius:100rpx;
183
-color:#2BB991;
184
-background: linear-gradient(to bottom, #EAFFFA -40%, #EAFFFA 100%,#F0F5F5 100%);
185
-  border: 1rpx solid #2BB991;
186
-  border-right: 0rpx solid #2BB991;
187
-box-sizing: border-box;
188 108
 }
189
-.process_bj2{
190
-  width: 100rpx;
191
-  height: 40rpx;
192
- font-size: 22rpx; 
193
-  display: flex;
194
-  align-items: center;
195
-  justify-content: center;
196
-border-top-left-radius:100rpx;
197
-border-bottom-left-radius:100rpx;
198
-color:#0F80DC;
199
-background: linear-gradient(to bottom, #cbe4f8 -40%, #cbe4f8 100%,#F0F5F5 100%);
200
-  border: 1rpx solid #0F80DC;
201
-  border-right: 0rpx solid #0F80DC;
202
-box-sizing: border-box;
203
-}.process_bj3{
204
-  width: 100rpx;
205
-  height: 40rpx;
206
- font-size: 22rpx; 
207
-  display: flex;
208
-  align-items: center;
209
-  justify-content: center;
210
-border-top-left-radius:100rpx;
211
-border-bottom-left-radius:100rpx;
212
-color:#D1815C;
213
-
214
-  background: linear-gradient(to bottom, #FFF6F5 -40%, #FFF6F5 100%,#F0F5F5 100%);
215
- border: 1rpx solid red;
216
-  border-right: 0rpx solid red;
217
-box-sizing: border-box;
218
-}
219
-
220
-.examine_content{
221
-  flex: 1;
222
-  font-size: 24rpx;
223
-  padding: 20rpx 20rpx;
224
-  margin: 20rpx 20rpx;
225
-  background-color: #f9f9f9;
226
-  border-radius: 8rpx;
227
-  box-sizing: border-box;
228
-}
229
-.feedback{
230
- margin-top: 8rpx;
231
-}
232
-
233
-.examine_bottom{
109
+.order_title{
110
+  padding-bottom:12rpx;
234 111
   display: flex;
235 112
   align-items: center;
236 113
   justify-content: space-between;
237
-  /* padding: 0rpx 20rpx; */
238
-box-sizing: border-box;
239
-}
240
-.examine_bottompro{
241
-  display: flex;
242
-  align-items: center;
243
-  /* padding: 0rpx 20rpx; */
244
-box-sizing: border-box;
114
+  border-bottom: 1rpx solid #cccccc;
245 115
 }
246
-.promoter_review{
247
-  color: #2BB991;
248
- /* border: 1rpx solid #2BB991; */
249
- /* border-right: 0rpx solid #2BB991; */
250
- border-top-left-radius:100rpx;
251
-border-bottom-left-radius:100rpx;
252
- padding: 4rpx 10rpx;
253
- box-sizing: border-box;
254
-}
255
-.promoter_review_color{
256
-  margin-right: 8rpx;
116
+.order_title1{
117
+display: flex;
118
+align-items: center;
257 119
 }
258
-.promoter_review_colors{
259
-  color: red;
120
+.order_image {
121
+  width: 60rpx;
122
+  height: 60rpx;
123
+  margin-right: 20rpx;
260 124
 }
261
-.examine_button{
262
-  width: 100%;
263
-  padding: 0rpx 20rpx;
264
-  margin-top: 30rpx;
265
-  display: flex;
266
-  align-items: center;
267
-  justify-content: space-between;
268
-  box-sizing: border-box;
125
+.order_direction{
126
+  margin-top: 40rpx;
269 127
 
270 128
 }
271
-.examine_name{
129
+.order_text{
272 130
   color: #cccccc;
273 131
 }
274
-.t-tabs{
275
-  background-color: rgba(255, 255, 255, 0);
276
-}
277
-.promoter{
278
-  display: flex;
279
-  flex-direction: column;
280
-  justify-content: center;
281
-  align-items: center;
282
-  padding: 0rpx 40rpx;
283
-  border-right:1rpx solid #cccccc;
284
-}
285
-.promoter_name{
132
+.order_address{
286 133
 margin-top: 20rpx;
287 134
 }
288
-.promoter_right{
289
-  display: flex;
290
-  flex-direction: column;
291
-  padding: 0rpx 40rpx;
292
-}
293
-.filter{
294
-  width: 500rpx;
295
-  padding: 30rpx;
296
-  box-sizing: border-box;
297
-
298
-}
299
-.mtinput{
300
-  width: 100%;
301
-  /* padding: 20rpx; */
302
-  box-sizing: border-box;
303
-/* background-color: #ffffff; */
135
+.order_time{
136
+margin-top: 20rpx;
304 137
 
305 138
 }
306
-.uni-mt-5{
307
-  width: 100%;
308
-  height: 80rpx;
309
-  border-radius: 100rpx;
310
-  border: 1rpx solid #cccccc;
311
-  padding: 0rpx 20rpx;
312
-  box-sizing: border-box;
313
-}
314
-.owner_type1 {
315
-  width: 100%;
316
-  height: 120rpx;
139
+.order_bottom{
317 140
   display: flex;
318 141
   align-items: center;
319
-  justify-content: space-between;
320
-  border-bottom: #f0f5f5 1rpx solid;
142
+  justify-content:space-between;
321 143
 }
322
-.owner_type11 {
323
-  width: 100%;
324
-  /* height: 120rpx; */
325
-  display: flex;
326
-  flex-direction: column;
327
-  /* align-items: center; */
328
-  justify-content: space-between;
329
-  border-bottom: #f0f5f5 1rpx solid;
330
-}
331
-.calculation_strategy {
332
-  font-size: 26rpx;
333
-  color: #222;
334
-  padding: 20rpx 0rpx;
335
-}
336
-.calculation_capsule {
337
-   width: 100%;
338
-  font-size: 26rpx;
339
-  color: #222;
340
-  padding: 10rpx 20rpx;
341
-}
342
-.owner_easyinput1 {
343
-  width: 100%;
344
-  display: flex;
144
+.order_view{
145
+margin-top: 20rpx;
146
+padding: 10rpx 20rpx;
147
+color: #ffffff;
148
+font-weight: 500;
149
+display: flex;
150
+align-items: center;
151
+justify-content: center;
152
+text-align: right;
153
+border-radius:50rpx;
154
+background-color: #00C775;
345 155
 }
346
-.event{
347
-  /* width: 70%; */
348
-  display: flex;
349
-  justify-content: space-between;
350
-  padding-left: 20rpx;
351
-  align-items: center;
156
+.available{
157
+display: flex;
158
+ justify-content: center;
159
+ align-items: center;
352 160
 }
353
-.calculation_top {
161
+.discharge{
354 162
   width: 100%;
355
-  height: 100%;
356
-  font-size: 26rpx;
163
+  margin-top: 100rpx;
357 164
   display: flex;
358 165
   align-items: center;
359
-  justify-content: space-between;
360
-}
361
-.calculation_left {
362
-  display: flex;
363
-  font-size: 28rpx;
364
-}
365
-picker{
366
-  width: 100%;
367
-}
368
-.switch-container{
369
-  width: 100%;
370
-}
371
-.t-radio-group{
372
-  width: 100%;
373
-}
374
-.t-radio{
375
-  margin-right: 40rpx;
376
-}
377
-.workorder_box{
378
-  padding-top:300rpx;
379
-  display: flex;
380
-align-items: center;
381
- flex-direction: column;
382
-justify-content: center;
383
-box-sizing: border-box;
384
-background-color: #ffffff;
166
+ justify-content: center;
385 167
 }
386
-.workorder1{
387
-  width: 480rpx;
388
-  height: 68rpx;
389
-  font-size: 32rpx;
390
-  margin-top: 40rpx;
391
-  background-color: rgba(15, 128, 220, 0.2);
392
-  color: #0F80DC;
393
-  border:1rpx solid #0F80DC;
394
-display: flex;
395
-align-items: center;
396
-justify-content: center;
397
-border-radius: 10rpx;
168
+.discharge_cheng{
169
+ padding: 10rpx 40rpx;
170
+ background-color: #ffffff;
171
+ color: #EA6E38;
172
+
173
+ border-top-left-radius: 10rpx;
174
+ border-bottom-left-radius: 10rpx;
175
+ border: 1rpx solid #EA6E38;
176
+ border-right: 0rpx solid #EA6E38;
398 177
 }
399
-.t-overlay{
400
-  width: 100%; 
401
-  height: 100%;
178
+
179
+.discharge_fang{
180
+  padding: 10rpx 40rpx;
181
+ background-color: #ffffff;
182
+color: #EA6E38;
183
+
184
+ border-top-right-radius: 10rpx;
185
+ border-bottom-right-radius: 10rpx;
186
+ border: 1rpx solid #EA6E38;
187
+ border-left: 0rpx solid #EA6E38;
188
+
402 189
 }
403
-.available{
190
+.selected{
191
+  background-color: #EA6E38;
192
+ color: #ffffff;
193
+ }
194
+.discharge_tabs{
404 195
   width: 100%;
405
-  display: flex;
406
-  align-items: center;
407
-  justify-content: center;
408
-  margin-top: 260rpx;
409 196
 }

+ 0
- 336
pages/workorder/index.js ファイルの表示

@@ -1,336 +0,0 @@
1
-// pages/workorder/index.js
2
-const api = require('../../api/index.js');
3
-
4
-Page({
5
-
6
-  /**
7
-   * 页面的初始数据
8
-   */
9
-  data: {
10
-    array:['日常','故障','其他'],
11
-    namelist:[],
12
-    typelist:['日常','故障','其他'],
13
-    devicedata:[],
14
-    index:1,
15
-    nameindex:'',
16
-    typeindex:0,
17
-    deviceindex:'',
18
-    date:'',
19
-    partnerAvite:[],
20
-    priority:'1',
21
-    workorderContent:'',
22
-    switchtype:true,
23
-    datestart:'',
24
-    dateend:''
25
-  },
26
-
27
-  /**
28
-   * 生命周期函数--监听页面加载
29
-   */
30
-  onLoad(options) {
31
-    console.log(options.name);
32
-    this.setData({
33
-      index:options.name
34
-    })
35
-this.getselectinformationall()
36
-this.getselectdevicelist()
37
-  },
38
-  onworkorder(){
39
-
40
-    if (this.data.workorderName==''||this.data.workorderAddress==''||this.data.dateend==''||this.data.datestart==''||this.data.nameindex==''||this.data.deviceindex=='') {
41
-      wx.showToast({
42
-        title: '请填写完整工单',
43
-        icon: 'none'
44
-      });
45
-      return
46
-    }
47
-       
48
-    if (!this.data.switchtype) {
49
-      return
50
-    }
51
-    this.setData({
52
-      switchtype:false
53
-    })
54
-    let data = {
55
-      workorderName:this.data.workorderName,
56
-      workorderAddress:this.data.workorderAddress,
57
-      workorderImg:this.data.partnerAvite.length>0?this.data.partnerAvite.toString():'',
58
-      workorderContent:this.data.workorderContent,
59
-      workoderPartner:this.data.namelist[this.data.nameindex].partnerId,
60
-      workorderEndtime:this.data.dateend,   // 开始时间
61
-      workorderStarttime:this.data.datestart,  // 结束时间
62
-      workorderGrade:this.data.priority,
63
-      type:(this.data.index*1)+1,
64
-      deviceId:this.data.devicedata[this.data.deviceindex].deviceId
65
-    }
66
-    api.request(`/workoder/createworkorder`, 'POST',data)
67
-    .then((res) => {
68
-      console.log(res);
69
-   if (res.code==200) {
70
-    // this.requestSubscribeMessage();
71
-    // this.loadMessages();
72
-    this.setData({
73
-      switchtype:true
74
-    })
75
-     wx.switchTab({
76
-       url: '/pages/index/index',
77
-     })
78
-   }
79
-    })
80
-    .catch((err) => {
81
-      console.error('请求失败:', err);
82
-      // 在这里处理请求失败的情况
83
-      this.setData({
84
-        switchtype:true
85
-      })
86
-    });
87
-  },
88
-
89
-  // 用户信息
90
-  getselectinformationall(){
91
-    let data = {
92
-   
93
-    }
94
-    api.request(`/partner/selectinformationall`, 'POST',data)
95
-    .then((res) => {
96
-      console.log(res);
97
-      this.setData({
98
-        namelist:res.data
99
-      })
100
-    })
101
-    .catch((err) => {
102
-      console.error('请求失败:', err);
103
-      // 在这里处理请求失败的情况
104
-    });
105
-  },
106
-    // 设备列表
107
-    getselectdevicelist(){
108
-      let data = {
109
-      }
110
-      api.request(`/device/selectdevicelist`, 'POST',data)
111
-      .then((res) => {
112
-        console.log(res);
113
-        this.setData({
114
-          devicedata:res.data
115
-        })
116
-      })
117
-      .catch((err) => {
118
-        console.error('请求失败:', err);
119
-        // 在这里处理请求失败的情况
120
-      });
121
-    },
122
-  onPeakprice(e){
123
-    console.log(e.detail.value);
124
-    this.setData({
125
-      workorderName:e.detail.value
126
-    })
127
-  },
128
-  onaddress(e){
129
-    console.log(e.detail.value);
130
-    this.setData({
131
-      workorderAddress:e.detail.value
132
-    })
133
-  },
134
-  ontextarea(e){
135
-    console.log(e);
136
-    this.setData({
137
-      workorderContent:e.detail.value
138
-    })
139
-  },
140
-  bindPickerChange(e){
141
-    console.log('picker发送选择改变,携带值为', e.detail.value)
142
-    this.setData({
143
-      nameindex: e.detail.value
144
-    })
145
-  },
146
-  binddeviceChange(e){
147
-    console.log('picker发送选择改变,携带值为', e.detail.value)
148
-    this.setData({
149
-      deviceindex: e.detail.value,
150
-      workorderAddress:this.data.devicedata[e.detail.value].devicesName
151
-    })
152
-  },
153
-  bindeventChange(e){
154
-    this.setData({
155
-      index: e.detail.value
156
-    })
157
-  },
158
-  // 开始时间
159
-  bindstartChange: function(e) {
160
-    console.log('picker发送选择改变,携带值为', e.detail.value)
161
-    this.setData({
162
-      datestart: e.detail.value
163
-    })
164
-  },
165
-  // 结束时间
166
-  bindendChange: function(e) {
167
-    const selectedEnd = e.detail.value;
168
-    console.log('picker发送选择改变,携带值为', e.detail.value)
169
-    const { datestart } = this.data;
170
-  
171
-    // 检查结束时间是否早于开始时间
172
-    if (datestart && selectedEnd < datestart) {
173
-      wx.showToast({
174
-        title: '结束时间不能早于开始时间',
175
-        icon: 'none',
176
-        duration: 2000
177
-      });
178
-      return;  // 不更新结束时间
179
-    }
180
-    
181
-    // 验证通过,更新结束时间
182
-    this.setData({
183
-      dateend: selectedEnd
184
-    });
185
-  
186
-  },
187
-  // 工单优先级 
188
-  onradio(e){
189
-console.log(e.detail.value); 
190
-this.setData({
191
-  priority:e.detail.value
192
-})
193
-  },
194
-   // 预览图片
195
-   previewImage(e) {
196
-    const src = e.currentTarget.dataset.src;
197
-    wx.previewImage({
198
-      current: src, // 当前显示图片的http链接
199
-      urls: [src]   // 需要预览的图片http链接列表
200
-    });
201
-  },
202
-  bindCancel(e){
203
-    console.log(e.currentTarget.dataset.index);
204
-    let index = e.currentTarget.dataset.index
205
-      // 使用 filter 方法创建新数组(推荐)
206
-  const newPartnerAvite = this.data.partnerAvite.filter((item, i) => i !== index);
207
-  
208
-  this.setData({
209
-    partnerAvite: newPartnerAvite
210
-  });
211
-  },
212
-  // 上传头像--项目--文件1
213
-bindtoImage(){
214
-  let _this = this
215
-  // 先检查隐私授权状态 
216
-  wx.getPrivacySetting({
217
-    success: (res) => {
218
-      if (res.needAuthorization) {
219
-        // 弹出隐私协议弹窗
220
-        wx.requirePrivacyAuthorize({
221
-          success: () => {
222
-            console.log('用户已同意隐私协议');
223
-            _this.choosetoImage(); // 继续执行上传
224
-          },
225
-          fail: () => {
226
-            console.log('用户拒绝了隐私协议');
227
-            wx.showToast({
228
-              title: '需同意隐私协议才能使用',
229
-              icon: 'none'
230
-            });
231
-          }
232
-        });
233
-      } else {
234
-          _this.choosetoImage(); // 已授权,直接上传
235
-      }
236
-    }
237
-  });
238
-},
239
-// 上传头像图片
240
-choosetoImage() {
241
-  let _this = this
242
-  wx.chooseMedia({    
243
-    count: 1,
244
-    mediaType: ['image','video'],
245
-    sourceType: ['album', 'camera'],
246
-    success(res) {
247
-      console.log(res);
248
-      const tempFiles = res.tempFiles;
249
-      _this.setData({
250
-        imageList: tempFiles.map(file => file.tempFilePath),
251
-      });
252
-      _this.uploadtoImages(tempFiles);
253
-    },
254
-    fail(err) {
255
-      console.error("选择失败:", err);
256
-    }
257
-  })
258
-  },
259
-  // 上传到服务器
260
-  uploadtoImages(files) {
261
-  let _this =this
262
-  const token = wx.getStorageSync('token');
263
-  files.forEach((file) => {
264
-  wx.uploadFile({
265
-  url: 'https://esos-iot.bjdexn.cn:8443/config/upload/webPost',
266
-  filePath: file.tempFilePath,
267
-  name: 'file',
268
-  formData: {
269
-    file:file.tempFilePath
270
-  },
271
-  header: {
272
-    'Authorization': 'Bearer ' + token // Also add to header if needed
273
-  },
274
-  success: (res) => {
275
-  console.log(res);
276
-  const obj = JSON.parse(res.data);
277
-  this.data.partnerAvite.push(obj.data.partnerAvite)
278
-  this.setData({
279
-    partnerAvite:this.data.partnerAvite
280
-   })
281
-  },
282
-  fail: (err) => {
283
-    console.error('上传失败', err);
284
-  },
285
-  });
286
-  });
287
-  },
288
-  /**
289
-   * 生命周期函数--监听页面初次渲染完成
290
-   */
291
-  onReady() {
292
-
293
-  },
294
-
295
-  /**
296
-   * 生命周期函数--监听页面显示
297
-   */
298
-  onShow() {
299
-
300
-  },
301
-
302
-  /**
303
-   * 生命周期函数--监听页面隐藏
304
-   */
305
-  onHide() {
306
-
307
-  },
308
-
309
-  /**
310
-   * 生命周期函数--监听页面卸载
311
-   */
312
-  onUnload() {
313
-
314
-  },
315
-
316
-  /**
317
-   * 页面相关事件处理函数--监听用户下拉动作
318
-   */
319
-  onPullDownRefresh() {
320
-
321
-  },
322
-
323
-  /**
324
-   * 页面上拉触底事件的处理函数
325
-   */
326
-  onReachBottom() {
327
-
328
-  },
329
-
330
-  /**
331
-   * 用户点击右上角分享
332
-   */
333
-  onShareAppMessage() {
334
-
335
-  }
336
-})

+ 0
- 9
pages/workorder/index.json ファイルの表示

@@ -1,9 +0,0 @@
1
-{
2
-  "navigationBarTitleText": "创建工单",
3
-  "usingComponents": {
4
-    "t-icon": "tdesign-miniprogram/icon/icon",
5
-    "t-radio-group": "tdesign-miniprogram/radio-group/radio-group",
6
-    "t-radio": "tdesign-miniprogram/radio/radio",
7
-    "t-textarea": "tdesign-miniprogram/textarea/textarea"
8
-  }
9
-}

+ 0
- 182
pages/workorder/index.wxml ファイルの表示

@@ -1,182 +0,0 @@
1
-<!--pages/workorder/index.wxml-->
2
-<view class="setup">
3
-
4
-<view class="workorder_list">
5
-  <view class="owner_type1">
6
-					<view class="calculation_strategy">
7
-						<text style="color: red;margin-right: 8rpx;">*</text>工单标题
8
-					</view>
9
-					<view class="event">
10
-						<view class="switch-container">
11
-							<view class="owner_easyinput1">
12
-								<view class="calculation_use">
13
-									<input class="uni-mt-5" trim="all" value="{{workorderName}}" clearSize="0"
14
-										placeholder="请输入工单标题" 	bindinput="onPeakprice"></input>
15
-								</view>
16
-							</view>
17
- 
18
-						</view>
19
-					</view>
20
-				</view>
21
-        <view class="owner_type1">
22
-    <picker bindcolumnchange="bindcolumn" bindchange="bindeventChange" value="{{index}}" range="{{array}}">
23
-					<view class="calculation_top">
24
-						<view class="calculation_left">
25
-              <text style="color: red;margin-right: 8rpx;">*</text>事件
26
-						</view>
27
-            <view class="event">
28
-						<view class="uni-input">{{array[index]}}</view>
29
-							<t-icon name="chevron-right" size="40rpx" data-name="chevron-right"/>
30
-            </view>
31
-					</view>
32
-				</picker>
33
-				
34
-				</view>
35
-        <view class="owner_type1">
36
-          <picker mode="date" value="{{datestart}}" start="2000-01-01" end="2060-09-01" bindchange="bindstartChange">
37
-					<view class="calculation_top">
38
-						<view class="calculation_left">
39
-              <text style="color: red;margin-right: 8rpx;">*</text>
40
-              开始时间
41
-						</view>
42
-            <view class="event">
43
-						<view class="uni-inputcolor" wx:if="{{datestart==''}}">请选择开始时间</view>
44
-						<view class="uni-input" wx:else>{{datestart}}</view>
45
-							<t-icon name="chevron-right" size="40rpx" data-name="chevron-right"/>
46
-            </view>
47
-					</view>
48
-				</picker>
49
-        </view>
50
-        <view class="owner_type1">
51
-          <picker mode="date" value="{{dateend}}" start="2000-01-01" end="2060-09-01" bindchange="bindendChange">
52
-					<view class="calculation_top">
53
-						<view class="calculation_left">
54
-              <text style="color: red;margin-right: 8rpx;">*</text>
55
-              结束时间
56
-						</view>
57
-            <view class="event">
58
-						<view class="uni-inputcolor" wx:if="{{dateend==''}}">请选择结束时间</view>
59
-						<view class="uni-input" wx:else>{{dateend}}</view>
60
-							<t-icon name="chevron-right" size="40rpx" data-name="chevron-right"/>
61
-            </view>
62
-					</view>
63
-				</picker>
64
-        </view>
65
-
66
-        <view class="owner_type1">
67
-          <picker bindcolumnchange="bindcolumn" value="{{nameindex}}" range="{{namelist}}" range-key="partnerName" bindchange="bindPickerChange">
68
-					<view class="calculation_top">
69
-						<view class="calculation_left">
70
-              <text style="color: red;margin-right: 8rpx;">*</text>处理人
71
-						</view>
72
-            <view class="event">
73
-						<view class="uni-input" wx:if="{{namelist[nameindex].partnerName}}">{{namelist[nameindex].partnerName}}</view>
74
-						<view class="uni-inputcolor" wx:else>请选择处理人</view>
75
-							<t-icon name="chevron-right" size="40rpx" data-name="chevron-right"/>
76
-            </view>
77
-					</view>
78
-				</picker>
79
-        </view>
80
-        <!-- <view class="owner_type1">
81
-          <picker bindcolumnchange="bindcolumn" bindchange="bindPickerChange" value="{{typeindex}}" range="{{typelist}}">
82
-					<view class="calculation_top">
83
-						<view class="calculation_left">
84
-              <text style="color: red;margin-right: 8rpx;">*</text>类型
85
-						</view>
86
-            <view class="event">
87
-						<view class="uni-input">{{typelist[typeindex]}}</view>
88
-							<t-icon name="chevron-right" size="40rpx" data-name="chevron-right"/>
89
-            </view>
90
-					</view>
91
-				</picker>
92
-        </view> -->
93
-        <view class="owner_type1">
94
-          <picker bindcolumnchange="bindcolumn" bindchange="binddeviceChange" value="{{deviceindex}}" range="{{devicedata}}" range-key="devicesName">
95
-					<view class="calculation_top">
96
-						<view class="calculation_left">
97
-              <text style="color: red;margin-right: 8rpx;">*</text>设备/巡检
98
-						</view>
99
-            <view class="event">
100
-						<view class="uni-input" wx:if="{{devicedata[deviceindex].devicesName}}">{{devicedata[deviceindex].devicesName}}</view>
101
-						<view class="uni-inputcolor" wx:else>请选择设备/巡检</view>
102
-							<t-icon name="chevron-right" size="40rpx" data-name="chevron-right"/>
103
-            </view>
104
-					</view>
105
-				</picker>
106
-        </view>
107
-       
108
-        <view class="owner_type1">
109
-        	<view class="calculation_strategy">
110
-					<text style="color: red;margin-right: 8rpx;">*</text>工单优先级
111
-					</view>
112
-					<view class="calculation_capsule">
113
-            <t-radio-group default-value="{{priority}}" borderless t-class="box" bindchange="onradio">
114
-  <t-radio block="{{false}}" label="低" value="1" />
115
-  <t-radio block="{{false}}" label="中" value="2" />
116
-  <t-radio block="{{false}}" label="高" value="3" />
117
-</t-radio-group>
118
-					</view>
119
-        </view>
120
-        <view class="owner_type1">
121
-					<view class="calculation_strategy">
122
-						<text style="color: red;margin-right: 8rpx;">*</text>报修地点
123
-					</view>
124
-					<view class="event">
125
-						<view class="switch-container">
126
-							<view class="owner_easyinput1">
127
-								<view class="calculation_usebox">
128
-									<input class="uni-mt-5" trim="all" value="{{workorderAddress}}" clearSize="0"
129
-										placeholder="请输入报修地点"	bindinput="onaddress"></input>
130
-               
131
-								</view>
132
-							</view>
133
-
134
-						</view>
135
-					</view>
136
-				</view>
137
-     
138
-        <view class="owner_type1x">
139
-					<view class="calculation_strategy">
140
-						附件上传
141
-					</view>
142
-					<view class="event">
143
-						<view class="switch-container">
144
-							<view class="owner_easyinput1">
145
-              <view class="calculation_imagebox" wx:if="{{partnerAvite}}" wx:for="{{partnerAvite}}" wx:key="index">
146
-							 <image class="calculation_image" src="{{item}}" mode="aspectFit"  data-src="{{item}}" bindtap="previewImage"/>
147
-              <t-icon class="calculation_imagex" data-index="{{index}}" bind:tap="bindCancel" name="close-circle" size="30rpx" data-name="close-circle"/>
148
-              </view>
149
-								<view class="calculation_usebox1" bind:tap="bindtoImage">
150
-                    <t-icon name="add" size="100rpx" data-name="add"/>
151
-								</view>
152
-							</view>
153
-              
154
-						</view>
155
-					</view>
156
-				</view>
157
-        <view class="owner_type2">
158
-        	<view class="calculation_strategy">
159
-            <text style="color: red;margin-right: 20rpx;"></text>描述
160
-					</view>
161
-					<view class="calculation_capsule1">
162
-            <t-textarea
163
-  t-class="external-class"
164
-  placeholder="请输入描述"
165
-  maxlength="200"
166
-  value="{{workorderContent}}"
167
-  disableDefaultPadding="{{true}}"
168
-  indicator
169
-  bindchange="ontextarea"
170
-/>
171
-					</view>
172
-        </view>
173
-</view>
174
-
175
-<view style="height: 200rpx;"></view>
176
-</view>
177
-
178
-<view class="workorder_box">
179
-
180
-<view class="workorder" bind:tap="onworkorder">提交</view>
181
-</view>
182
-

+ 0
- 160
pages/workorder/index.wxss ファイルの表示

@@ -1,160 +0,0 @@
1
-/* pages/workorder/index.wxss */
2
-page{
3
-  width: 100%;
4
-  height: 100%;
5
-}
6
-.setup{
7
-  width: 100%;
8
-  /* height: 100%; */
9
-  background: linear-gradient(to bottom, #0F80DC -40%, #F0F5F5 40%,#F0F5F5 100%);
10
-  padding: 20rpx 20rpx;
11
-  box-sizing: border-box;
12
-}
13
-.workorder_list{
14
-background-color: #ffffff;
15
-border-radius: 10rpx;
16
-padding: 0rpx 20rpx;
17
-}
18
-picker{
19
-  width: 100%;
20
-}
21
-.owner_type1 {
22
-  width: 100%;
23
-  height: 120rpx;
24
-  display: flex;
25
-  align-items: center;
26
-  justify-content: space-between;
27
-  border-bottom: #f0f5f5 1rpx solid;
28
-}
29
-.owner_type1x{
30
-  width: 100%;
31
-  padding: 20rpx 0rpx;
32
-  display: flex;
33
-  align-items: center;
34
-  justify-content: space-between;
35
-  border-bottom: #f0f5f5 1rpx solid;
36
-}
37
-.calculation_strategy {
38
-  font-size: 26rpx;
39
-  color: #222;
40
-  padding: 20rpx 0rpx;
41
-}
42
-.calculation_capsule {
43
-   width: 70%;
44
-  font-size: 26rpx;
45
-  color: #222;
46
-  padding: 10rpx 20rpx;
47
-}
48
-.owner_easyinput1 {
49
-  width: 100%;
50
-  display: flex;
51
-  flex-wrap: wrap; 
52
-}
53
-.uni-mt-5{
54
-  width: 100%;
55
-  text-align: left;
56
-}
57
-.calculation_use {
58
-  width: 100%;
59
-  font-size: 26rpx;
60
-  display: flex;
61
-  justify-content: space-between;
62
-}
63
-
64
-.calculation_top {
65
-  width: 100%;
66
-  height: 100%;
67
-  font-size: 26rpx;
68
-  display: flex;
69
-  align-items: center;
70
-  justify-content: space-between;
71
-}
72
-.calculation_left {
73
-  display: flex;
74
-  font-size: 28rpx;
75
-}
76
-.uni-input{
77
-  font-size: 28rpx;
78
-  }
79
-  .uni-inputcolor{
80
-    color: #cccccc;
81
-  }
82
- .event{
83
-   width: 70%;
84
-   display: flex;
85
-   justify-content: space-between;
86
-   padding-left: 20rpx;
87
-   align-items: center;
88
- }
89
- .switch-container{
90
-   width: 100%;
91
- }
92
- .t-radio{
93
-   margin-right: 40rpx;
94
- }
95
- .owner_type2 {
96
-  width: 100%;
97
-  display: flex;
98
-  justify-content: space-between;
99
-  border-bottom: #f0f5f5 1rpx solid;
100
-}
101
- .calculation_capsule1 {
102
-  width: 72%;
103
- font-size: 26rpx;
104
- color: #222;
105
- padding: 20rpx 0rpx;
106
-}
107
-.external-class{
108
-  font-size: 28rpx;
109
-  height: 200rpx;
110
-}
111
-.workorder_box{
112
-  width: 100%;
113
-  height: 180rpx;
114
-  position: fixed;
115
-  bottom: 0rpx;
116
-  left: 0rpx;
117
-  padding-top:30rpx;
118
-  display: flex;
119
-/* align-items: center; */
120
-justify-content: center;
121
-box-sizing: border-box;
122
-background-color: #ffffff;
123
-}
124
-.workorder{
125
-  width: 480rpx;
126
-  height: 80rpx;
127
-  font-size: 32rpx;
128
-  background-color: rgba(15, 128, 220, 0.2);
129
-  color: #0F80DC;
130
-  border:1rpx solid #0F80DC;
131
-display: flex;
132
-align-items: center;
133
-justify-content: center;
134
-border-radius: 10rpx;
135
-}
136
-.calculation_usebox1 {
137
-  font-size: 26rpx;
138
-  display: flex;
139
-  align-items: center;
140
-  margin-top: 20rpx;
141
-  border: 1rpx solid #cccccc;
142
-  border-radius: 10rpx;
143
-  /* justify-content: space-between; */
144
-}
145
-.calculation_imagebox{
146
-  width: 120rpx;
147
- height: 120rpx;
148
- margin-right: 40rpx;
149
- position:relative;
150
-}
151
-.calculation_imagex{
152
-position: absolute;
153
-
154
-  top: 0rpx;
155
-  right: 0rpx;
156
-}
157
-.calculation_image{
158
-  width: 120rpx;
159
-  height: 120rpx;
160
-}

+ 0
- 503
pages/workorderdetails/index.js ファイルの表示

@@ -1,503 +0,0 @@
1
-// pages/Workorderdetails/index.js
2
-const api = require('../../api/index.js');
3
-
4
-Page({
5
-
6
-  /**
7
-   * 页面的初始数据
8
-   */
9
-  data: {
10
-    first: 1,
11
-    second: 1,
12
-    third: 1,
13
-    visible: false,
14
-    workorder: [],
15
-    optionsid: '',
16
-    workorderId: '',
17
-    partnerAvite: [],
18
-    bindreviewtype: '',
19
-    latitude: null,
20
-    longitude: null,
21
-    locationName: '获取中...',
22
-    checkinStatus: 'waiting', // waiting, success, fail
23
-    checkinRecords: [],
24
-    distance: null, // 距离目标点的距离
25
-    canCheckin: false,
26
-    showPermissionGuide: null,
27
-    workorderContent: '',
28
-    switchtype: false,
29
-    partnerPosition: wx.getStorageSync('partnerPosition'),
30
-    scanCode:{},
31
-    result:''
32
-  },
33
-
34
-  /**
35
-   * 生命周期函数--监听页面加载
36
-   */
37
-  onLoad(options) {
38
-
39
-    console.log(options);
40
-    this.setData({
41
-      optionsid: options.id,
42
-      workorderId: options.workorderId
43
-    })
44
-    this.onworkorder()
45
-
46
-  },
47
-  // 获取当前位置
48
-  getCurrentLocation() {
49
-    const that = this;
50
-    // 先检查位置权限
51
-    wx.getSetting({
52
-      success: (res) => {
53
-        if (!res.authSetting['scope.userLocation']) {
54
-          // 如果没有授权,请求授权
55
-          wx.authorize({
56
-            scope: 'scope.userLocation',
57
-            success: () => {
58
-              that._getLocation();
59
-            },
60
-            fail: () => {
61
-              wx.showModal({
62
-                title: '位置权限提示',
63
-                content: '需要位置权限才能使用此功能,是否去设置开启?',
64
-                success: (res) => {
65
-                  if (res.confirm) {
66
-                    wx.openSetting();
67
-                  }
68
-                }
69
-              });
70
-            }
71
-          });
72
-        } else {
73
-          // 已经授权,直接获取位置
74
-          that._getLocation();
75
-        }
76
-      }
77
-    });
78
-  },
79
-  // 提取获取位置的具体逻辑
80
-  _getLocation() {
81
-    const that = this;
82
-    wx.getLocation({
83
-      type: 'wgs84',
84
-      success: (res) => {
85
-        console.log('位置获取成功:', res);
86
-        that.setData({
87
-          latitude: res.latitude,
88
-          longitude: res.longitude
89
-        });
90
-        // that.reverseGeocode(res.latitude, res.longitude);
91
-        that.checkDistance();
92
-      },
93
-      fail: (err) => {
94
-        console.error('获取位置失败:', err);
95
-        wx.showToast({
96
-          title: '获取位置失败,请重试',
97
-          icon: 'none'
98
-        });
99
-      }
100
-    })
101
-  },
102
-  checkDistance() {
103
-    // this.data.workorder.devicesLatitudelongitude.split(",")
104
-
105
-    let position = this.data.workorder.devicesLatitudelongitude;
106
-    console.log(position);
107
-    const targetLng = position[0]; // 目标经度
108
-    const targetLat = position[1]; // 目标纬度
109
-    const allowedDistance = 100; // 允许打卡距离(米)
110
-    // longitude: 116.66504838681816      2号楼位置
111
-    // latitude: 40.088160079721874    2号楼位置
112
-    // longitude: 116.66504838932426   工位位置
113
-    // latitude: 40.08816007901852   工位位置
114
-
115
-    const distance = this.calculateDistance(
116
-      this.data.latitude,
117
-      this.data.longitude,
118
-      targetLat,
119
-      targetLng
120
-    );
121
-
122
-    this.setData({
123
-      distance: distance.toFixed(2),
124
-      canCheckin: distance <= allowedDistance
125
-    });
126
-    console.log(this.data.distance);
127
-    console.log(this.data.canCheckin);
128
-  },
129
-  // 计算两点间距离(Haversine公式)
130
-  calculateDistance(lat1, lng1, lat2, lng2) {
131
-    const R = 6371000; // 地球半径(米)
132
-    const dLat = (lat2 - lat1) * Math.PI / 180;
133
-    const dLng = (lng2 - lng1) * Math.PI / 180;
134
-    const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +
135
-      Math.cos(lat1 * Math.PI / 180) * Math.cos(lat2 * Math.PI / 180) *
136
-      Math.sin(dLng / 2) * Math.sin(dLng / 2);
137
-    const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
138
-    return R * c;
139
-  },
140
-  onposition() {
141
-    this.checkLocationPermission();
142
-
143
-  },
144
-  onworkorder() {
145
-    let _this = this
146
-    let data = {
147
-      workorderId: this.data.workorderId,
148
-      id: this.data.optionsid
149
-    }
150
-    api.request(`/workoder/selectsysworkoderid`, 'POST', data)
151
-      .then((res) => {
152
-        console.log(res);
153
-        if (res.code == 200) {
154
-          if (res.data.workorderImg) {
155
-            res.data.workorderImg = res.data.workorderImg.split(",")
156
-          }
157
-          // console.log(res.data.workoderstationimg==undefined);
158
-          if (res.data.workoderstationimg) {
159
-            res.data.workoderstationimg = res.data.workoderstationimg.split(",")
160
-          }
161
-          if (res.data.workoderendimg) {
162
-            res.data.workoderendimg = res.data.workoderendimg.split(",")
163
-          }
164
-          if (res.data.devicesLatitudelongitude) {
165
-            res.data.devicesLatitudelongitude.split(",")
166
-          } else {
167
-            res.data.devicesLatitudelongitude = ['116.66504838681816', '40.088160079721874']
168
-          }
169
-          this.setData({
170
-            workorder: res.data
171
-          })
172
-          if (res.data.workorderType == 1) {
173
-            console.log('定位开始');
174
-            // _this.goToSetting();
175
-            // this.checkLocationPermission();
176
-            this.getCurrentLocation();
177
-
178
-          }
179
-
180
-        }
181
-
182
-        // .split(" ")
183
-      })
184
-      .catch((err) => {
185
-        console.error('请求失败:', err);
186
-        // 在这里处理请求失败的情况
187
-      });
188
-  },
189
-  onFirstChange(e) {
190
-    this.setData({ first: e.detail.current });
191
-  },
192
-  onSecondChange(e) {
193
-    this.setData({ second: e.detail.current });
194
-  },
195
-  onThirdChange(e) {
196
-    this.setData({ third: e.detail.current });
197
-  },
198
-  onstep() {
199
-    this.setData({
200
-      visible: true
201
-    })
202
-
203
-
204
-    // wx.navigateTo({
205
-    //   url: '/pages/workorderstep/index',
206
-    // })
207
-  },
208
-  // 删除图片
209
-  bindCancel(e) {
210
-    console.log(e.currentTarget.dataset.index);
211
-    let index = e.currentTarget.dataset.index
212
-    // 使用 filter 方法创建新数组(推荐)
213
-    const newPartnerAvite = this.data.partnerAvite.filter((item, i) => i !== index);
214
-
215
-    this.setData({
216
-      partnerAvite: newPartnerAvite
217
-    });
218
-  },
219
-  onVisibleChange() {
220
-    this.setData({
221
-      visible: false
222
-    })
223
-  },
224
-  ontextarea(e) {
225
-    this.setData({
226
-      workorderContent: e.detail.value
227
-    })
228
-  },
229
-  submit() {
230
-
231
-    if (!this.data.switchtype) {
232
-      return
233
-    }
234
-    this.setData({
235
-      switchtype: false
236
-    })
237
-    let data = {
238
-      id: this.data.workorder.id,
239
-      workoderImg: this.data.partnerAvite.length > 0 ? this.data.partnerAvite.toString() : '',
240
-      workoderDetails: this.data.workorderContent,
241
-      devicesRange: this.data.canCheckin ? '到达设备范围' : '不在设备范围'
242
-    }
243
-    api.request(`/workoder/addwork`, 'POST', data)
244
-      .then((res) => {
245
-        console.log(res);
246
-        if (res.code == 200) {
247
-
248
-          wx.showToast({
249
-            title: '提交成功',
250
-            icon: 'success',
251
-          });
252
-          this.setData({
253
-            visible: false,
254
-            partnerAvite: [],
255
-            switchtype: true,
256
-            workorderContent: ''
257
-          })
258
-          if (this.data.workorder.workorderType == 2) {
259
-            wx.reLaunch({
260
-              url: '/pages/index/index',
261
-            })
262
-          }
263
-          this.onworkorder()
264
-        }
265
-
266
-      })
267
-      .catch((err) => {
268
-        console.error('请求失败:', err);
269
-        this.setData({
270
-          switchtype: true
271
-        })
272
-        // 在这里处理请求失败的情况
273
-      });
274
-  },
275
-  // 审核
276
-  bindreview(e) {
277
-    this.setData({
278
-      bindreviewtype: e.currentTarget.dataset.type
279
-    })
280
-    if (e.currentTarget.dataset.type == '不通过') {
281
-      this.setData({
282
-        visible: true,
283
-      })
284
-      return
285
-    }
286
-    let data = {
287
-      id: this.data.workorder.id,
288
-      examineType: e.currentTarget.dataset.type,
289
-      workoderReason: this.data.workorderContent
290
-    }
291
-    api.request(`/workoder/examine`, 'POST', data)
292
-      .then((res) => {
293
-        console.log(res);
294
-        if (res.code == 200) {
295
-          wx.showToast({
296
-            title: '提交成功',
297
-            icon: 'success',
298
-          });
299
-          this.setData({
300
-            visible: false
301
-          })
302
-          wx.reLaunch({
303
-            url: '/pages/index/index',
304
-          })
305
-          // this.onworkorder()
306
-        }
307
-
308
-      })
309
-      .catch((err) => {
310
-        console.error('请求失败:', err);
311
-        // 在这里处理请求失败的情况
312
-      });
313
-  },
314
-  // 预览图片
315
-  previewImage(e) {
316
-    console.log(e);
317
-    const src = e.currentTarget.dataset.src;
318
-    wx.previewImage({
319
-      current: src, // 当前显示图片的http链接
320
-      urls: [src]   // 需要预览的图片http链接列表
321
-    });
322
-  },
323
-  // 上传头像
324
-  bindtoImage() {
325
-    let _this = this
326
-    // 先检查隐私授权状态
327
-    wx.getPrivacySetting({
328
-      success: (res) => {
329
-        if (res.needAuthorization) {
330
-          // 弹出隐私协议弹窗
331
-          wx.requirePrivacyAuthorize({
332
-            success: () => {
333
-              console.log('用户已同意隐私协议');
334
-              _this.choosetoImage(); // 继续执行上传
335
-            },
336
-            fail: () => {
337
-              console.log('用户拒绝了隐私协议');
338
-              wx.showToast({
339
-                title: '需同意隐私协议才能使用',
340
-                icon: 'none'
341
-              });
342
-            }
343
-          });
344
-        } else {
345
-          _this.choosetoImage(); // 已授权,直接上传
346
-        }
347
-      }
348
-    });
349
-  },
350
-  // 上传头像图片
351
-  choosetoImage() {
352
-    let _this = this
353
-    wx.chooseMedia({
354
-      count: 1,
355
-      mediaType: ['image', 'video'],
356
-      sourceType: ['album', 'camera'],
357
-      success(res) {
358
-        console.log(res);
359
-        const tempFiles = res.tempFiles;
360
-        _this.setData({
361
-          imageList: tempFiles.map(file => file.tempFilePath),
362
-        });
363
-        _this.uploadtoImages(tempFiles);
364
-      },
365
-      fail(err) {
366
-        console.error("选择失败:", err);
367
-      }
368
-    })
369
-  },
370
-  // 上传到服务器
371
-  uploadtoImages(files) {
372
-    let _this = this
373
-    const token = wx.getStorageSync('token');
374
-    files.forEach((file) => {
375
-      wx.uploadFile({
376
-        url: 'https://esos-iot.bjdexn.cn:8443/config/upload/webPost',
377
-        filePath: file.tempFilePath,
378
-        name: 'file',
379
-        formData: {
380
-          file: file.tempFilePath
381
-        },
382
-        header: {
383
-          'Authorization': 'Bearer ' + token // Also add to header if needed
384
-        },
385
-        success: (res) => {
386
-          console.log(res);
387
-          const obj = JSON.parse(res.data);
388
-          this.data.partnerAvite.push(obj.data.partnerAvite)
389
-          this.setData({
390
-            partnerAvite: this.data.partnerAvite
391
-          })
392
-        },
393
-        fail: (err) => {
394
-          console.error('上传失败', err);
395
-        },
396
-      });
397
-    });
398
-  },
399
-  scancode() {
400
-    wx.scanCode({
401
-      onlyFromCamera:true,
402
-      success: (res) => {
403
-        console.log(res);
404
-       let rawData = this.data.workorder.devicesQrcode.split(",")
405
-        console.log(rawData);
406
-        for (let index = 0; index < rawData.length; index++) {
407
-            if (rawData[index] ==res.rawData) {
408
-              this.setData({
409
-                switchtype:true,
410
-                result:res.result
411
-              })
412
-              return
413
-            }
414
-        }
415
-        wx.showToast({
416
-          title: '没有匹配到设备码',
417
-          icon: 'none'
418
-        });
419
-     
420
-        console.log(this.data.scanCode);
421
-      },
422
-      fail: (err) => {
423
-        console.log(err);
424
-        wx.showToast({
425
-          title: '扫码失败',
426
-          icon: 'none'
427
-        });
428
-      }
429
-    })
430
-  },
431
-  onqrcode(e){
432
-    console.log(e.target.dataset.name);
433
-    // console.log(this.data.scanCode.result);
434
-  // 优化后的复制代码,增加错误处理
435
-wx.setClipboardData({
436
-  data: e.target.dataset.name,
437
-  success (res) {
438
-    console.log('设置剪贴板成功', res)
439
-    wx.showToast({
440
-      title: '复制成功',
441
-      icon: 'none'
442
-    });
443
- 
444
-  },
445
-  fail (err) {
446
-    console.error('设置剪贴板失败:', err)
447
-    wx.showToast({
448
-      title: '复制失败,请重试',
449
-      icon: 'none'
450
-    });
451
-  }
452
-})
453
- 
454
- 
455
-  },
456
-  /**
457
-   * 生命周期函数--监听页面初次渲染完成
458
-   */
459
-  onReady() {
460
-
461
-  },
462
-
463
-  /**
464
-   * 生命周期函数--监听页面显示
465
-   */
466
-  onShow() {
467
-  },
468
-
469
-  /**
470
-   * 生命周期函数--监听页面隐藏
471
-   */
472
-  onHide() {
473
-
474
-  },
475
-
476
-  /**
477
-   * 生命周期函数--监听页面卸载
478
-   */
479
-  onUnload() {
480
-
481
-  },
482
-
483
-  /**
484
-   * 页面相关事件处理函数--监听用户下拉动作
485
-   */
486
-  onPullDownRefresh() {
487
-
488
-  },
489
-
490
-  /**
491
-   * 页面上拉触底事件的处理函数
492
-   */
493
-  onReachBottom() {
494
-
495
-  },
496
-
497
-  /**
498
-   * 用户点击右上角分享
499
-   */
500
-  onShareAppMessage() {
501
-
502
-  }
503
-})

+ 0
- 13
pages/workorderdetails/index.json ファイルの表示

@@ -1,13 +0,0 @@
1
-{
2
-  "navigationBarTitleText": "工单详情",
3
-  "component": true,
4
-  "styleIsolation": "apply-shared",
5
-  "usingComponents": {
6
-    "t-steps": "tdesign-miniprogram/steps/steps",
7
-    "t-step-item": "tdesign-miniprogram/step-item/step-item",
8
-    "t-popup": "tdesign-miniprogram/popup/popup",
9
-    "t-button": "tdesign-miniprogram/button/button",
10
-    "t-icon": "tdesign-miniprogram/icon/icon",
11
-    "t-textarea": "tdesign-miniprogram/textarea/textarea"
12
-  }
13
-}

+ 0
- 174
pages/workorderdetails/index.wxml ファイルの表示

@@ -1,174 +0,0 @@
1
-<!--pages/Workorderdetails/index.wxml-->
2
-<view class="process_bj1" wx:if="{{workorder.workorderType==1&&workorder.examineType==4}}">
3
-<view class="process_name">待处理...</view>
4
-
5
-<image class="process_tp" src="https://esos-iot.bjdexn.cn/myminio/project/b5f745598db6435aac98a4a2b31284d3.png" mode="aspectFit"/>
6
-</view>
7
-<view class="process_bj2" wx:if="{{workorder.workorderType==2&&workorder.examineType==4}}">
8
-<view class="process_name">处理中...</view>
9
-<image class="process_tp" src="https://esos-iot.bjdexn.cn/myminio/project/40dbc668f38a4208940e76a120477467.png" mode="aspectFit"/>
10
-</view>
11
-<view class="process_bj3" wx:if="{{workorder.workorderType==3&&workorder.examineType==5}}">
12
-<view class="process_name">待审核...</view>
13
-<image class="process_tp" src="https://esos-iot.bjdexn.cn/myminio/project/746fd45617b0466cbbe138d8e6dc0567.png" mode="aspectFit"/>
14
-</view>
15
-<view class="process_bj4" wx:if="{{workorder.examineType==6}}">
16
-<view class="process_name">审核成功...</view>
17
-<image class="process_tp" src="https://esos-iot.bjdexn.cn/myminio/project/a76948bfa5094d4c90e2a4c5514481e1.png" mode="aspectFit"/>
18
-</view>
19
-<view class="process_bj5" wx:if="{{workorder.examineType==7}}">
20
-<view class="process_name">审核失败...</view>
21
-<image class="process_tp" src="https://esos-iot.bjdexn.cn/myminio/project/8de18dd8fd204b2d95477a2f2f890ba8.png" mode="aspectFit"/>
22
-</view>
23
-<!-- <view class="flow_box">
24
-  <view class="block">
25
-  <view class="flowflow_name">工单流程</view>
26
-  <t-steps layout="vertical" current="{{first}}" bind:change="onFirstChange">
27
-    <t-step-item title="张三创建维修工单" content="2025-11-12 12:11:22"/>
28
-    <t-step-item title="李四开始处理工单" content="2025-11-12 12:11:22"/>
29
-    <t-step-item title="工单处理中" content="2025-11-12 12:11:22"/>
30
-    <t-step-item title="工单处理完成" content="2025-11-12 12:11:22"/>
31
-    <t-step-item title="工单待审核" content="2025-11-12 12:11:22"/>
32
-    <t-step-item title="工单审核成功" content="2025-11-12 12:11:22"/>
33
-    <t-step-item title="工单审核失败" content="2025-11-12 12:11:22"/>
34
-  </t-steps>
35
-</view>
36
-</view> -->
37
-<view class="flow_box">
38
-  <view class="flowflow">
39
-<!-- <view class="flowflow_name">工单信息</view> -->
40
-<view class="flow_content"> 
41
-<!--  -->
42
-<view class="order" wx:if="{{workorder.workoderReason!=''&&workorder.workoderReason!=null}}"><view class="workorder">审核失败原因:</view><view>{{workorder.workoderReason||'--'}}</view> </view>
43
-
44
-
45
-<view class="order"  wx:if="{{workorder.examineCount!=0&&workorder.examineCount!=null&&workorder.workoderReason==''&&workorder.workoderReason==null}}"><view class="workorder">退回工单原因:</view><view>{{workorder.lastfail||'--'}}</view> </view>
46
-<view class="order" data-name="{{workorder.workorderName}}" bind:tap="onqrcode"><view class="workorder">工单名称:</view> {{workorder.workorderName}}</view>
47
-
48
-<view class="order"><view class="workorder">工单所属:</view> {{workorder.powerstationname}} > {{workorder.devicesname}}</view>
49
-<view class="order"><view class="workorder">创建人:</view> {{workorder.promotername}}</view>
50
-<view class="order"><view class="workorder">工单类型:</view> <text wx:if="{{workorder.type==1}}">日常</text><text wx:if="{{workorder.type==2}}">故障</text> <text wx:if="{{workorder.type==3}}">其他</text>  </view>
51
-<view class="order"><view class="workorder">工单开始时间:</view> {{workorder.workorderStarttime}}</view>
52
-<view class="order"><view class="workorder">工单结束时间:</view> {{workorder.workorderEndtime}}</view>
53
-<view class="order"><view class="workorder">工单编号:</view> {{workorder.workorderId}}</view>
54
-<view class="order"><view class="workorder">创建时间:</view>{{workorder.workorderTime}}</view>
55
-<view class="order"><view class="workorder">位置:</view>{{workorder.workorderAddress}}</view>
56
-<view class="order"><view class="workorder">问题描述:</view>{{workorder.workorderContent}}</view>
57
-<view class="order"><view class="workorder">故障照片:</view><image wx:for="{{workorder.workorderImg}}" wx:key="index" class="workorderimg" src="{{item}}" mode="aspectFit" data-src="{{item}}" bindtap="previewImage"/></view>
58
-</view>
59
-</view>
60
-<view class="block">
61
-  <view class="order"><view class="workorder">处理人:</view>{{workorder.partnername}}</view>
62
-<view class="order"><view class="workorder">当前状态:</view>
63
- <text wx:if="{{workorder.workorderType==1}}">待处理</text> 
64
- <text wx:if="{{workorder.workorderType==2}}">处理中</text> 
65
- <text wx:if="{{workorder.workorderType==3}}">工单完成</text> 
66
- 
67
- </view>
68
- <view class="order"><view class="workorder">地点签到:</view>{{workorder.devicesRange||'--'}}</view>
69
-
70
- <view class="order" wx:if="{{workorder.workorderType==3}}"><view class="workorder">审核状态:</view>
71
- <text wx:if="{{workorder.examineType==5}}">待审核</text> 
72
- <text wx:if="{{workorder.examineType==6}}">审核完成</text> 
73
- <text wx:if="{{workorder.examineType==7}}">审核失败</text> 
74
- </view>
75
-<view class="order"><view class="workorder">处理前照片:</view>
76
-<view wx:if="{{workorder.workoderstationimg}}">
77
-  <image wx:for="{{workorder.workoderstationimg}}" wx:key="index" class="workorderimg" src="{{item}}" mode="" data-src="{{item}}" bindtap="previewImage"/>
78
-</view>
79
-<text wx:else>--</text>
80
-</view>
81
-<view class="order"><view class="workorder">处理后照片:</view>
82
-<view wx:if="{{workorder.workoderendimg}}">
83
-<image wx:for="{{workorder.workoderendimg}}" wx:key="index" class="workorderimg" src="{{item}}" mode="" data-src="{{item}}" bindtap="previewImage"/>
84
-</view>
85
-<text wx:else>--</text>
86
-</view>
87
-
88
-<view class="order"><view class="workorder">处理开始时间:</view>{{workorder.workodersubmittime||'--'}}</view>
89
-<view class="order"><view class="workorder">处理结束时间:</view>{{workorder.workoderResulttime||'--'}}</view>
90
-<view class="order"><view class="workorder">反馈:</view>{{workorder.workoderendContent||'--'}}</view>
91
-
92
-  </view>
93
-</view>
94
-<view style="height: 130rpx;" wx:if="{{workorder.examineType!=6&&workorder.examineType!=7}}"></view>
95
-<view style="height: 60rpx;"></view>
96
-<view class="step" wx:if="{{workorder.examineType!=6&&workorder.examineType!=7}}">
97
-<view class="step_button" bind:tap="onstep" wx:if="{{workorder.workorderType==1&&partnerPosition.partnerId == workorder.workoderPartnerId&&partnerPosition.partnerId == workorder.workoderPartnerId}}">开始工单</view>
98
-<view class="step_button" bind:tap="onstep" wx:if="{{workorder.workorderType==2&&partnerPosition.partnerId == workorder.workoderPartnerId}}">提交工单</view>
99
-<!-- <view class="step_button" bind:tap="onstep" wx:if="{{workorder.workorderType==3}}">待审核</view> -->
100
-<view class="onreview" wx:if="{{workorder.workorderType==3&&workorder.examineType==5&&workorder.permission==1&&partnerPosition.partnerId == workorder.workorderPromoterId}}">
101
-  <view class="step_buttonfailure" data-type="不通过" bind:tap="bindreview">不通过</view>
102
-  <view class="step_button" data-type="6" bind:tap="bindreview">通过</view>
103
-</view>
104
-</view>
105
-<t-popup
106
-  visible="{{visible}}"
107
-  bind:visible-change="onVisibleChange"
108
-  placement="bottom"
109
->
110
-  <view class="popup_box">
111
-    <view class="Scan_problem">
112
-<view class="Scan_feedback1" wx:if="{{workorder.workorderType==1}}">
113
- <view class="Scan_width"><t-icon name="qrcode" size="40rpx" data-name="qrcode"/><view class="Scancode_left"><text style="color: red;">*</text>设备码</view> </view>
114
-  <view class="Scancode_right1" wx:if="{{!switchtype}}" bind:tap="scancode"><view><t-icon name="scan" size="100rpx" data-name="scan"/></view> <view class="Scancode_lefticon1">
115
-   点击扫码</view> </view>
116
-   <view wx:else>{{result}}</view>
117
-</view>
118
-<!-- <view bind:tap="onqrcode">
119
-{{scanCode.result}}|{{scanCode.rawData}}
120
-</view> -->
121
-<view class="Scan_feedback1" wx:if="{{workorder.workorderType==1}}">
122
- <view class="Scan_width"><t-icon name="map-information-2" size="40rpx" data-name="map-information-2"/><view class="Scancode_left"><text style="color: red;">*</text>设备范围</view> </view>
123
-  <view class="Scancode_right1">
124
-   <view class="Scancode_lefticon1" wx:if="{{canCheckin}}">
125
-   <!-- {{distance}}米 -->
126
-   <text class="position_left">到达范围</text></view>
127
-   <view class="Scancode_lefticon1" wx:else>
128
-   <!-- {{distance}}米 -->
129
-   <text class="position_left">不在范围</text></view>
130
-    </view> <view class="position" bind:tap="onposition"><t-icon name="refresh" size="40rpx" data-name="refresh"/> <text class="position_left">刷新</text> </view>
131
-</view>
132
-<view class="Scan_feedback" wx:if="{{workorder.examineType==4}}">
133
-<view class="Scan_width"><t-icon name="image" size="40rpx" data-name="image"/>
134
-<view class="Scancode_left" wx:if="{{workorder.workorderType==1}}">处理前图片</view> 
135
-<view class="Scancode_left" wx:if="{{workorder.workorderType==2}}">处理后图片</view> 
136
-</view>
137
-<view class="calculation_imagebox" wx:if="{{partnerAvite}}" wx:for="{{partnerAvite}}" wx:key="index">
138
-  <image class="Scan_image" wx:if="{{partnerAvite}}" src="{{item}}" mode="aspectFit" data-src="{{item}}" bindtap="previewImage"/>
139
-              <t-icon class="calculation_imagex" data-index="{{index}}" bind:tap="bindCancel" name="close-circle" size="30rpx" data-name="close-circle"/>
140
-              </view>
141
-
142
- <!-- <image class="Scan_image" src="https://esos-iot.bjdexn.cn/myminio/project/8c06ea7e8bfe4b49ab1e3a60132dda3a.jpg" mode=""/>
143
- <image class="Scan_image" src="https://esos-iot.bjdexn.cn/myminio/project/8c06ea7e8bfe4b49ab1e3a60132dda3a.jpg" mode=""/> -->
144
-<view class="Scancode_lefticon" bind:tap="bindtoImage">
145
-  <t-icon name="add" size="60rpx" data-name="add"/>
146
- </view>
147
-</view>
148
-<view class="Scan_feedback" wx:if="{{workorder.workorderType==2||bindreviewtype=='不通过'}}">
149
-<view class="Scan_width"><t-icon name="chat-message" size="40rpx" data-name="chat-message"/>
150
-<view class="Scancode_left">问题反馈</view>
151
- </view>
152
-  <view class="Scancode_textarea"><t-textarea
153
-  t-class="external-class"
154
-  placeholder="请输入描述"
155
-  maxlength="200"
156
-  value="{{workorderContent}}"
157
-
158
-  disableDefaultPadding="{{true}}"
159
-  indicator
160
-  bindchange="ontextarea"
161
-/></view>
162
-</view>
163
-</view>
164
-<view class="onstep">
165
-<view class="onstepbutton" bind:tap="submit" wx:if="{{workorder.workorderType==1&&switchtype}}">开始处理</view>
166
-<view class="onstepbuttonccc" wx:if="{{workorder.workorderType==1&&!switchtype}}">开始处理</view>
167
-<view class="onstepbutton" bind:tap="submit" wx:if="{{workorder.workorderType==2}}">完成处理</view>
168
-<view class="step_buttonfailure" wx:if="{{bindreviewtype=='不通过'}}" data-type="7" bind:tap="bindreview">不通过</view>
169
-</view>
170
-  </view>
171
-</t-popup>
172
-<!-- 
173
-  
174
- -->

+ 0
- 285
pages/workorderdetails/index.wxss ファイルの表示

@@ -1,285 +0,0 @@
1
-/* pages/Workorderdetails/index.wxss */
2
-page{
3
-  width: 100%;
4
-  height: 100%;
5
-background: linear-gradient(to bottom, #f9f9f9 -40%, #f9f9f9 100%,#F0F5F5 100%);
6
-/* background-color: #0F80DC; */
7
-}
8
-.process_bj1{
9
-width: 100%;
10
-height: 180rpx;
11
-display: flex;
12
-align-items: center;
13
-justify-content: space-around;
14
-/* background-color: #cccccc; */
15
-color:#2BB991;
16
-background: linear-gradient(to bottom, #EAFFFA -40%, #EAFFFA 100%,#F0F5F5 100%);
17
-}
18
-.process_bj2{
19
-  width: 100%;
20
-  height: 180rpx;
21
-  display: flex;
22
-  align-items: center;
23
-  justify-content: space-around;
24
-  /* background-color: #cccccc; */
25
-  color:#0F80DC;
26
-  background: linear-gradient(to bottom, #cbe4f8 -40%, #cbe4f8 100%,#F0F5F5 100%);
27
-}
28
-.process_bj3{
29
-  width: 100%;
30
-  height: 180rpx;
31
-  display: flex;
32
-  align-items: center;
33
-  justify-content: space-around;
34
-  /* background-color: #cccccc; */
35
-color:#D1815C;
36
-
37
-  background: linear-gradient(to bottom, #FFF6F5 -40%, #FFF6F5 100%,#F0F5F5 100%);
38
-}
39
-.process_bj4{
40
-  width: 100%;
41
-  height: 180rpx;
42
-  display: flex;
43
-  align-items: center;
44
-  justify-content: space-around;
45
-  /* background-color: #cccccc; */
46
-color:#0F80DC;
47
-
48
-  background: linear-gradient(to bottom, #cbe4f8 -40%, #cbe4f8 100%,#F0F5F5 100%);
49
-}
50
-.process_bj5{
51
-  width: 100%;
52
-  height: 180rpx;
53
-  display: flex;
54
-  align-items: center;
55
-  justify-content: space-around;
56
-  /* background-color: #cccccc; */
57
-color:#D1815C;
58
-
59
-  background: linear-gradient(to bottom, #FFF6F5 -40%, #FFF6F5 100%,#F0F5F5 100%);
60
-}
61
-.process_tp{
62
-  width: 88rpx;
63
-  height: 88rpx;
64
-}
65
-.process_name{
66
-  font-size: 42rpx;
67
-}
68
-.flow_box{
69
-  padding: 20rpx 20rpx 0rpx 20rpx;
70
-box-sizing: border-box;
71
-}
72
-.block {
73
-  background-color: var(--bg-color-demo);
74
-  padding: 32rpx;
75
-  margin: 2rpx 0 0rpx;
76
-background-color: #ffffff;
77
-border-radius: 10rpx;
78
-
79
-}
80
-.flowflow{
81
-width: 100%;
82
-padding: 16rpx;
83
-margin-bottom: 20rpx;
84
-border-radius: 10rpx;
85
-background-color: #ffffff;
86
-box-sizing: border-box;
87
-}
88
-.flowflow_name{
89
-  font-size: 32rpx;
90
-  margin-bottom: 30rpx;
91
-}
92
-.flow_content{
93
-  padding: 0rpx 20rpx;
94
-}
95
-.order{
96
-  display: flex;
97
-  margin-top: 20rpx;
98
-}
99
-.workorder{
100
-  width: 200rpx;
101
-  min-width: 200rpx;
102
-  font-size: 28rpx;
103
-  color: #cccccc;
104
-}
105
-.workorderimg{
106
-  width: 100rpx;
107
-  height: 100rpx;
108
-  margin-right: 20rpx;
109
-}
110
-.step{
111
-  width: 100%;
112
-  height: 160rpx;
113
-  display: flex;
114
-  /* align-items: center; */
115
-  justify-content: center;
116
-  padding-top: 20rpx;
117
-  position: fixed;
118
-  bottom: 0rpx;
119
-  left: 0rpx;
120
-  background-color: #ffffff;
121
-box-sizing: border-box;
122
-}
123
-.step_button{
124
-  width: 260rpx;
125
-  height: 88rpx;
126
-  display: flex;
127
-  align-items: center;
128
-  justify-content: center;
129
-  color: #ffffff;
130
-  background-color: #0F80DC;
131
-  border-radius: 100rpx;
132
-}
133
-.step_buttonfailure{
134
-  width: 260rpx;
135
-  height: 88rpx;
136
-  display: flex;
137
-  align-items: center;
138
-  justify-content: center;
139
-  color: #ffffff;
140
-  background-color: #e67373;
141
-  border-radius: 100rpx;
142
-}
143
-.popup_box{
144
-  width: 100%;
145
-  height: 600rpx;
146
-  padding: 20rpx;
147
-  box-sizing: border-box;
148
-}
149
-
150
-.Scan_problem{
151
-  padding:0rpx 30rpx 20rpx 30rpx;
152
-  margin-top: 40rpx;
153
-  background-color: #ffffff;
154
-}
155
-.Scan_problemname{
156
-  font-size: 32rpx;
157
-  color: #999999;
158
-}
159
-.Scan_handle{
160
-  display: flex;
161
-  font-size: 28rpx;
162
-  margin-top: 30rpx;
163
-  color: #999999;
164
-}
165
-.Scancode_right{
166
-  display: flex;
167
-}
168
-.Scancode_right1{
169
-  display: flex;
170
-  align-items: center;
171
-  justify-content: center;
172
-}
173
-.Scancode_left{
174
-  margin-left: 6rpx;
175
-}
176
-.Scancode_lefticon1{
177
-  display: flex;
178
-  align-items: center;
179
-  justify-content: center;
180
-  margin-left: 20rpx;
181
-}
182
-.Scan_image{
183
-  width: 100rpx;
184
-  height: 100rpx;
185
-  margin-right: 20rpx;
186
-  border-radius: 10rpx;
187
-
188
-}
189
-.Scancode_lefticon{
190
-  width: 100rpx;
191
-  height: 100rpx;
192
-  display: flex;
193
-  align-items: center;
194
-  justify-content: center;
195
-  border: 1rpx solid #cccccc;
196
-  border-radius: 10rpx;
197
-}
198
-.Scan_feedback{
199
-  display: flex;
200
-  font-size: 28rpx;
201
-  margin-top: 40rpx;
202
-  color: #222222;
203
-  box-sizing: border-box;
204
-}
205
-.Scan_feedback1{
206
-  display: flex;
207
-  font-size: 28rpx;
208
-  margin-top: 40rpx;
209
-  color: #222222;
210
-}
211
-.Scan_width{
212
- width: 200rpx; 
213
- min-width: 200rpx;
214
- display: flex;
215
- align-items: center;
216
-}
217
-.Scancode_textarea{
218
-  width: 100%;
219
- height: 160rpx; 
220
-border: 1rpx solid #cccccc;
221
-padding: 0rpx;
222
-border-radius: 10rpx;
223
-font-size: 26rpx;
224
-}
225
-
226
-.external-class{
227
-  width: 100%;
228
- height: 160rpx; 
229
-
230
-}
231
-.onstep{
232
-  position: fixed;
233
-  left: 0rpx;
234
-  bottom: 60rpx;
235
-  width: 100%;
236
-  display: flex;
237
-  align-items: center;
238
-  justify-content: center;
239
-}
240
-.onstepbutton{
241
-width: 400rpx;
242
-height: 80rpx;
243
-display: flex;
244
-align-items: center;
245
-justify-content: center;
246
-border-radius: 100rpx;
247
-color: #ffffff;
248
-background-color: #0F80DC;
249
-}
250
-.onstepbuttonccc{
251
-  width: 400rpx;
252
-  height: 80rpx;
253
-  display: flex;
254
-  align-items: center;
255
-  justify-content: center;
256
-  border-radius: 100rpx;
257
-  color: #222222;
258
-  background-color: #cccccc;
259
-  }
260
-.onreview{
261
-  width: 100%;
262
-  display: flex;
263
-  padding: 0rpx 40rpx;
264
- justify-content: space-around;
265
-    /* justify-content: space-between; */
266
-}
267
-.calculation_imagebox{
268
-  width: 120rpx;
269
- height: 120rpx;
270
- margin-right: 40rpx;
271
- position:relative;
272
-}
273
-.calculation_imagex{
274
-position: absolute;
275
-
276
-  top: 0rpx;
277
-  right: 0rpx;
278
-}
279
-.position{
280
-margin-left: 60rpx;
281
-display: flex;
282
-}
283
-.position_left{
284
-  margin-left: 10rpx;
285
-}

+ 0
- 8
pages/workorderstep/index.json ファイルの表示

@@ -1,8 +0,0 @@
1
-{
2
-  "usingComponents": {
3
-    "t-icon": "tdesign-miniprogram/icon/icon",
4
-    "t-steps": "tdesign-miniprogram/steps/steps",
5
-    "t-step-item": "tdesign-miniprogram/step-item/step-item",
6
-    "t-textarea": "tdesign-miniprogram/textarea/textarea"
7
-  }
8
-}

+ 0
- 51
pages/workorderstep/index.wxml ファイルの表示

@@ -1,51 +0,0 @@
1
-<view class="Scanbox">
2
-  <view class="block">
3
-  <t-steps current="{{first}}" bind:change="onFirstChange">
4
-    <!-- <t-step-item wx:for="{{4}}" wx:key="index" title="{{_.getText(first, index)}}" content="辅助信息" /> -->
5
-    <t-step-item title="待处理" />
6
-    <t-step-item title="处理中" />
7
-    <t-step-item title="处理完成" />
8
-  </t-steps>
9
-</view>
10
-<view class="Scan_problem">
11
- <!-- <view class="Scan_problemname">工单信息</view> -->
12
- <view class="Scan_feedback1" style="color: #999999;">工单编号:123456789</view>
13
- <view class="Scan_handle">工单标题:光伏板损坏</view>
14
- <view class="Scan_handle">报修设备:光伏板</view>
15
- <view class="Scan_handle">工单优先级:高</view>
16
- <view class="Scan_handle">工单类型:故障</view>
17
- <view class="Scan_handle">工单地点:光伏矩阵1号</view>
18
- <view class="Scan_handle">工单描述:更换新的光伏板损坏</view>
19
- <view class="Scan_handle">报修图片:<image class="Scan_image" src="https://esos-iot.bjdexn.cn/myminio/project/8c06ea7e8bfe4b49ab1e3a60132dda3a.jpg" mode=""/></view>
20
-</view>
21
-<view class="Scan_problem">
22
-<view class="Scan_feedback1">
23
- <view class="Scan_width"><t-icon name="qrcode" size="40rpx" data-name="qrcode"/><view class="Scancode_left">设备码</view> </view>
24
-  <view class="Scancode_right"><t-icon name="scan" size="40rpx" data-name="scan"/> <view class="Scancode_left">点击扫码</view> </view>
25
-</view>
26
-<view class="Scan_feedback">
27
-<view class="Scan_width"><t-icon name="image" size="40rpx" data-name="image"/><view class="Scancode_left">处理前图片</view> </view>
28
- <image class="Scan_image" src="https://esos-iot.bjdexn.cn/myminio/project/8c06ea7e8bfe4b49ab1e3a60132dda3a.jpg" mode=""/>
29
- <image class="Scan_image" src="https://esos-iot.bjdexn.cn/myminio/project/8c06ea7e8bfe4b49ab1e3a60132dda3a.jpg" mode=""/>
30
- <image class="Scan_image" src="https://esos-iot.bjdexn.cn/myminio/project/8c06ea7e8bfe4b49ab1e3a60132dda3a.jpg" mode=""/>
31
-<view class="Scancode_lefticon">
32
-  <t-icon name="add" size="60rpx" data-name="add"/>
33
- </view>
34
-</view>
35
-<view class="Scan_feedback">
36
-<view class="Scan_width"><t-icon name="chat-message" size="40rpx" data-name="chat-message"/><view class="Scancode_left">问题反馈</view> </view>
37
-  <view class="Scancode_textarea"><t-textarea
38
-  t-class="external-class"
39
-  placeholder="请输入描述"
40
-  maxlength="200"
41
-  disableDefaultPadding="{{true}}"
42
-  indicator
43
-/></view>
44
-</view>
45
-</view>
46
-<view class="onstep">
47
-<view class="onstepbutton">开始处理</view>
48
-
49
-</view>
50
-
51
-</view>

+ 0
- 95
pages/workorderstep/index.wxss ファイルの表示

@@ -1,95 +0,0 @@
1
-/* pages/workorderstep/index.wxss */
2
-page{
3
-  width: 100%;
4
-  /* height: 100%; */
5
-  background-color: #f9f9f9;
6
-}
7
-.block{
8
-  margin-top: 30rpx;
9
-}
10
-.Scancode{
11
-  display: flex;
12
-  padding: 30rpx;
13
-  margin-top: 40rpx;
14
-}
15
-.Scancode_left{
16
-  margin-left: 10rpx;
17
-
18
-}
19
-.Scancode_lefticon{
20
-  width: 100rpx;
21
-  display: flex;
22
-  align-items: center;
23
-  justify-content: center;
24
-  border: 1rpx solid #cccccc;
25
-}
26
-.Scancode_right{
27
-  display: flex;
28
-  align-items: center;
29
-}
30
-.Scan_problem{
31
-  padding:20rpx 30rpx 20rpx 30rpx;
32
-  margin-top: 40rpx;
33
-  background-color: #ffffff;
34
-}
35
-.Scan_problemname{
36
-  font-size: 32rpx;
37
-  color: #999999;
38
-}
39
-.Scan_handle{
40
-  display: flex;
41
-  font-size: 28rpx;
42
-  margin-top: 30rpx;
43
-  color: #999999;
44
-}
45
-.Scan_image{
46
-  width: 100rpx;
47
-  height: 100rpx;
48
-  margin-right: 20rpx;
49
-}
50
-.Scan_feedback{
51
-  display: flex;
52
-  font-size: 28rpx;
53
-  margin-top: 40rpx;
54
-  color: #222222;
55
-}
56
-.Scan_feedback1{
57
-  display: flex;
58
-  font-size: 28rpx;
59
-  margin-top: 20rpx;
60
-  color: #222222;
61
-}
62
-.Scan_width{
63
- width: 200rpx; 
64
- min-width: 200rpx;
65
- display: flex;
66
-}
67
-.Scancode_textarea{
68
-  width: 100%;
69
- height: 100rpx; 
70
-
71
-}
72
-.external-class{
73
-  width: 100%;
74
- height: 100rpx; 
75
-
76
-}
77
-.onstep{
78
-  position: fixed;
79
-  left: 0rpx;
80
-  bottom: 60rpx;
81
-  width: 100%;
82
-  display: flex;
83
-  align-items: center;
84
-  justify-content: center;
85
-}
86
-.onstepbutton{
87
-width: 400rpx;
88
-height: 80rpx;
89
-display: flex;
90
-align-items: center;
91
-justify-content: center;
92
-border-radius: 100rpx;
93
-color: #ffffff;
94
-background-color: #0F80DC;
95
-}

+ 1
- 8
project.private.config.json ファイルの表示

@@ -1,6 +1,6 @@
1 1
 {
2 2
   "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
3
-  "projectname": "partner_wx",
3
+  "projectname": "movecar_wx",
4 4
   "setting": {
5 5
     "compileHotReLoad": true,
6 6
     "urlCheck": false,
@@ -23,13 +23,6 @@
23 23
     "miniprogram": {
24 24
       "list": [
25 25
         {
26
-          "name": "pages/login/index",
27
-          "pathName": "pages/login/index",
28
-          "query": "",
29
-          "scene": null,
30
-          "launchMode": "default"
31
-        },
32
-        {
33 26
           "name": "pages/index/index",
34 27
           "pathName": "pages/index/index",
35 28
           "query": "",

バイナリ
static/1.png ファイルの表示


バイナリ
static/11.png ファイルの表示


+ 0
- 0
static/111.png ファイルの表示


変更されたファイルが多すぎるため、一部のファイルは表示されません

読み込み中…
キャンセル
保存