Commit fbca9085171298f416a76a28c56bb779d939d343
1 parent
177df08c
提交12-9
Showing
11 changed files
with
2109 additions
and
2665 deletions
garbage-removal/src/apis/order.js
| ... | ... | @@ -211,3 +211,12 @@ export async function insertRandomCopyByTypeAndOrderId(params) { |
| 211 | 211 | export async function selectGarOrderCar(orderNo) { |
| 212 | 212 | return await request.get(`/order/selectGarOrderCar/${orderNo}`); |
| 213 | 213 | } |
| 214 | + | |
| 215 | +export async function deleteDriverByOrderNo(orderNo, carCode) { | |
| 216 | + return await request.post(`/order/deleteDriverByOrderNo`, null, { | |
| 217 | + params: { | |
| 218 | + orderNo, | |
| 219 | + carCode | |
| 220 | + } | |
| 221 | + }); | |
| 222 | +} | ... | ... |
garbage-removal/src/components/liu-delivery-time/liu-delivery-time.vue
| ... | ... | @@ -125,143 +125,69 @@ const getFutureDays = () => { |
| 125 | 125 | |
| 126 | 126 | |
| 127 | 127 | const getTimeList = () => { |
| 128 | - const timeList = [{ | |
| 129 | - time: '00:00-01:00', | |
| 130 | - start: '00:00', | |
| 131 | - end: '01:00', | |
| 132 | - timeStr:'22-07' | |
| 133 | - },{ | |
| 134 | - time: '01:00-02:00', | |
| 135 | - start: '01:00', | |
| 136 | - end: '02:00', | |
| 137 | - timeStr:'22-07' | |
| 138 | - },{ | |
| 139 | - time: '02:00-03:00', | |
| 140 | - start: '02:00', | |
| 141 | - end: '03:00', | |
| 142 | - timeStr:'22-07' | |
| 143 | - },{ | |
| 144 | - time: '03:00-04:00', | |
| 145 | - start: '03:00', | |
| 146 | - end: '04:00', | |
| 147 | - timeStr:'22-07' | |
| 148 | - },{ | |
| 149 | - time: '04:00-05:00', | |
| 150 | - start: '04:00', | |
| 151 | - end: '05:00', | |
| 152 | - timeStr:'22-07' | |
| 153 | - },{ | |
| 154 | - time: '05:00-06:00', | |
| 155 | - start: '05:00', | |
| 156 | - end: '06:00', | |
| 157 | - timeStr:'22-07' | |
| 158 | - },{ | |
| 159 | - time: '06:00-07:00', | |
| 160 | - start: '06:00', | |
| 161 | - end: '07:00', | |
| 162 | - timeStr:'22-07' | |
| 163 | - },{ | |
| 164 | - time: '07:00-08:00', | |
| 165 | - start: '07:00', | |
| 166 | - end: '08:00', | |
| 167 | - timeStr:'07-08' | |
| 168 | - },{ | |
| 169 | - time: '08:00-09:00', | |
| 170 | - start: '08:00', | |
| 171 | - end: '09:00', | |
| 172 | - timeStr:'08-09' | |
| 173 | - },{ | |
| 174 | - time: '09:00-10:00', | |
| 175 | - start: '09:00', | |
| 176 | - end: '10:00', | |
| 177 | - timeStr:'09-10' | |
| 178 | - }, | |
| 179 | - { | |
| 180 | - time: '10:00-11:00', | |
| 181 | - start: '10:00', | |
| 182 | - end: '11:00', | |
| 183 | - timeStr:'10-11' | |
| 184 | - }, | |
| 185 | - { | |
| 186 | - time: '11:00-12:00', | |
| 187 | - start: '11:00', | |
| 188 | - end: '12:00', | |
| 189 | - timeStr:'11-12' | |
| 190 | - }, | |
| 191 | - { | |
| 192 | - time: '12:00-13:00', | |
| 193 | - start: '12:00', | |
| 194 | - end: '13:00', | |
| 195 | - timeStr:'12-13' | |
| 196 | - }, | |
| 197 | - { | |
| 198 | - time: '13:00-14:00', | |
| 199 | - start: '13:00', | |
| 200 | - end: '14:00', | |
| 201 | - timeStr:'13-14' | |
| 202 | - }, | |
| 203 | - { | |
| 204 | - time: '14:00-15:00', | |
| 205 | - start: '14:00', | |
| 206 | - end: '15:00', | |
| 207 | - timeStr:'14-15' | |
| 208 | - }, | |
| 209 | - { | |
| 210 | - time: '15:00-16:00', | |
| 211 | - start: '15:00', | |
| 212 | - end: '16:00', | |
| 213 | - timeStr:'15-16' | |
| 214 | - }, | |
| 215 | - { | |
| 216 | - time: '16:00-17:00', | |
| 217 | - start: '16:00', | |
| 218 | - end: '17:00', | |
| 219 | - timeStr:'16-17' | |
| 220 | - }, | |
| 221 | - { | |
| 222 | - time: '17:00-18:00', | |
| 223 | - start: '17:00', | |
| 224 | - end: '18:00', | |
| 225 | - timeStr:'17-18' | |
| 226 | - }, | |
| 227 | - { | |
| 228 | - time: '18:00-19:00', | |
| 229 | - start: '18:00', | |
| 230 | - end: '19:00', | |
| 231 | - timeStr:'18-19' | |
| 232 | - }, | |
| 233 | - { | |
| 234 | - time: '19:00-20:00', | |
| 235 | - start: '19:00', | |
| 236 | - end: '20:00', | |
| 237 | - timeStr:'19-20' | |
| 238 | - }, | |
| 239 | - { | |
| 240 | - time: '20:00-21:00', | |
| 241 | - start: '20:00', | |
| 242 | - end: '21:00', | |
| 243 | - timeStr:'20-21' | |
| 244 | - }, | |
| 245 | - { | |
| 246 | - time: '21:00-22:00', | |
| 247 | - start: '21:00', | |
| 248 | - end: '22:00', | |
| 249 | - timeStr:'21-22' | |
| 250 | - }, | |
| 251 | - { | |
| 252 | - time: '22:00-23:00', | |
| 253 | - start: '22:00', | |
| 254 | - end: '23:00', | |
| 255 | - timeStr:'22-07' | |
| 256 | - }, | |
| 257 | - { | |
| 258 | - time: '23:00-24:00', | |
| 259 | - start: '23:00', | |
| 260 | - end: '24:00', | |
| 261 | - timeStr:'22-07' | |
| 262 | - } | |
| 263 | - ]; | |
| 264 | - return timeList | |
| 128 | + const timeList = [{ | |
| 129 | + time: '00:00-02:00', | |
| 130 | + start: '00:00', | |
| 131 | + end: '02:00', | |
| 132 | + timeStr:'22-07' | |
| 133 | + },{ | |
| 134 | + time: '02:00-04:00', | |
| 135 | + start: '02:00', | |
| 136 | + end: '04:00', | |
| 137 | + timeStr:'22-07' | |
| 138 | + },{ | |
| 139 | + time: '04:00-06:00', | |
| 140 | + start: '04:00', | |
| 141 | + end: '06:00', | |
| 142 | + timeStr:'22-07' | |
| 143 | + },{ | |
| 144 | + time: '06:00-08:00', | |
| 145 | + start: '06:00', | |
| 146 | + end: '08:00', | |
| 147 | + timeStr:'22-07' | |
| 148 | + },{ | |
| 149 | + time: '08:00-10:00', | |
| 150 | + start: '08:00', | |
| 151 | + end: '10:00', | |
| 152 | + timeStr:'07-08' | |
| 153 | + },{ | |
| 154 | + time: '10:00-12:00', | |
| 155 | + start: '10:00', | |
| 156 | + end: '12:00', | |
| 157 | + timeStr:'10-11' | |
| 158 | + },{ | |
| 159 | + time: '12:00-14:00', | |
| 160 | + start: '12:00', | |
| 161 | + end: '14:00', | |
| 162 | + timeStr:'12-13' | |
| 163 | + },{ | |
| 164 | + time: '14:00-16:00', | |
| 165 | + start: '14:00', | |
| 166 | + end: '16:00', | |
| 167 | + timeStr:'14-15' | |
| 168 | + },{ | |
| 169 | + time: '16:00-18:00', | |
| 170 | + start: '16:00', | |
| 171 | + end: '18:00', | |
| 172 | + timeStr:'16-17' | |
| 173 | + },{ | |
| 174 | + time: '18:00-20:00', | |
| 175 | + start: '18:00', | |
| 176 | + end: '20:00', | |
| 177 | + timeStr:'18-19' | |
| 178 | + },{ | |
| 179 | + time: '20:00-22:00', | |
| 180 | + start: '20:00', | |
| 181 | + end: '22:00', | |
| 182 | + timeStr:'20-21' | |
| 183 | + },{ | |
| 184 | + time: '22:00-24:00', | |
| 185 | + start: '22:00', | |
| 186 | + end: '24:00', | |
| 187 | + timeStr:'22-07' | |
| 188 | + } | |
| 189 | + ]; | |
| 190 | + return timeList | |
| 265 | 191 | } |
| 266 | 192 | |
| 267 | 193 | /** |
| ... | ... | @@ -271,12 +197,15 @@ const getTimeList = () => { |
| 271 | 197 | * @param {*} skip 跳过几个 |
| 272 | 198 | */ |
| 273 | 199 | const getCurrentDayTimeList = (startTime, hours, skip) => { |
| 274 | - const timeList = getTimeList(); | |
| 275 | - // 因为从9点开始所以从9点开始截取 | |
| 276 | - // let startIndex = startTime + skip; | |
| 277 | - let abs = startTime > hours ? 1 : -1; | |
| 278 | - let index = startTime - hours >= skip ? 0 : (startTime - hours) * abs + skip; | |
| 279 | - return timeList.slice(index, timeList.length + 1) | |
| 200 | + const timeList = getTimeList(); | |
| 201 | + // 计算当前小时所属的时间段索引 | |
| 202 | + // 每个时间段是2小时,从00:00-02:00开始 | |
| 203 | + let index = Math.floor(hours / 2) + 1; // 加1是为了跳过已过期的时间段 | |
| 204 | + // 确保不会超出数组范围 | |
| 205 | + if (index >= timeList.length) { | |
| 206 | + return []; // 如果没有可选时间段,返回空数组 | |
| 207 | + } | |
| 208 | + return timeList.slice(index, timeList.length) | |
| 280 | 209 | } |
| 281 | 210 | const open = () => { |
| 282 | 211 | isShow.value = true; | ... | ... |
garbage-removal/src/manifest.json
| ... | ... | @@ -28,7 +28,14 @@ |
| 28 | 28 | "<uses-permission android:name=\"android.permission.VIBRATE\"/>", |
| 29 | 29 | "<uses-permission android:name=\"android.permission.READ_LOGS\"/>", |
| 30 | 30 | "<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>", |
| 31 | - "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>", | |
| 31 | + "<uses-feature android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>", | |
| 32 | + "<uses-feature android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>", | |
| 33 | + "<uses-feature android:name=\"android.permission.ACCESS_LOCATION_EXTRA_COMMANDS\"/>", | |
| 34 | + "<uses-feature android:name=\"android.hardware.location.gps\"/>", | |
| 35 | + "<uses-feature android:name=\"android.hardware.location.network\"/>", | |
| 36 | + "<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>", | |
| 37 | + "<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>", | |
| 38 | + "<uses-permission android:name=\"android.permission.ACCESS_LOCATION_EXTRA_COMMANDS\"/>", | |
| 32 | 39 | "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", |
| 33 | 40 | "<uses-permission android:name=\"android.permission.CAMERA\"/>", |
| 34 | 41 | "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>", |
| ... | ... | @@ -58,7 +65,7 @@ |
| 58 | 65 | "appid" : "wx6c12c068d07c46f8", |
| 59 | 66 | "permission" : { |
| 60 | 67 | "scope.userLocation" : { |
| 61 | - "desc" : "你的位置信息将用于小程序位置接口的" | |
| 68 | + "desc" : "为了给您提供准确的地址定位服务" | |
| 62 | 69 | } |
| 63 | 70 | }, |
| 64 | 71 | "libVersion" : "latest", |
| ... | ... | @@ -71,9 +78,13 @@ |
| 71 | 78 | "router" : { |
| 72 | 79 | "mode" : "history" |
| 73 | 80 | }, |
| 74 | - "sdkConfigs" : { | |
| 75 | - "maps" : {} | |
| 76 | - } | |
| 81 | + "sdkConfigs" : { | |
| 82 | + "maps" : { | |
| 83 | + "qqmap": { | |
| 84 | + "key": "XICBZ-ALWKT-2KPXZ-VCBL7-XMRYO-2QFS4" | |
| 85 | + } | |
| 86 | + } | |
| 87 | + } | |
| 77 | 88 | }, |
| 78 | 89 | "mp-alipay" : { |
| 79 | 90 | "usingComponents" : true | ... | ... |
garbage-removal/src/pages/change-password/index.vue
| ... | ... | @@ -5,17 +5,6 @@ |
| 5 | 5 | <view class="title">修改密码</view> |
| 6 | 6 | |
| 7 | 7 | <view class="input-wrapper"> |
| 8 | - <u-icon name="account" size="36" color="#909399" class="input-icon"></u-icon> | |
| 9 | - <input | |
| 10 | - class="login-input" | |
| 11 | - type="text" | |
| 12 | - v-model="formData.phone" | |
| 13 | - placeholder="请输入手机号" | |
| 14 | - placeholder-class="placeholder-style" | |
| 15 | - /> | |
| 16 | - </view> | |
| 17 | - | |
| 18 | - <view class="input-wrapper"> | |
| 19 | 8 | <u-icon name="lock" size="36" color="#909399" class="input-icon"></u-icon> |
| 20 | 9 | <input |
| 21 | 10 | class="login-input" |
| ... | ... | @@ -49,10 +38,6 @@ |
| 49 | 38 | </view> |
| 50 | 39 | |
| 51 | 40 | <button @tap="handleChangePassword" class="submit-btn">确认修改</button> |
| 52 | - | |
| 53 | - <view class="back-to-login"> | |
| 54 | - <text class="link" @click="backToLogin">返回登录</text> | |
| 55 | - </view> | |
| 56 | 41 | </view> |
| 57 | 42 | </view> |
| 58 | 43 | </template> |
| ... | ... | @@ -103,10 +88,6 @@ const getCaptcha = () => { |
| 103 | 88 | // 修改密码 |
| 104 | 89 | const handleChangePassword = () => { |
| 105 | 90 | // 表单验证 |
| 106 | - if (!proxy.$u.test.mobile(formData.value.phone)) { | |
| 107 | - proxy.$u.toast("请输入正确的手机号"); | |
| 108 | - return; | |
| 109 | - } | |
| 110 | 91 | |
| 111 | 92 | if (!formData.value.oldPassword) { |
| 112 | 93 | proxy.$u.toast("请输入原密码"); |
| ... | ... | @@ -125,7 +106,6 @@ const handleChangePassword = () => { |
| 125 | 106 | |
| 126 | 107 | // 调用修改密码接口 |
| 127 | 108 | const params = { |
| 128 | - tel: formData.value.phone, | |
| 129 | 109 | oldPassword: formData.value.oldPassword, |
| 130 | 110 | newPassword: formData.value.newPassword, |
| 131 | 111 | }; | ... | ... |
garbage-removal/src/pages/home-info/address/addSite.vue
| ... | ... | @@ -162,739 +162,99 @@ const submit = () => { |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | /** |
| 165 | - * 打开地图选择地址 | |
| 165 | + * 打开地图选择地址(自动定位到当前位置,修复 startCompass:fail 问题) | |
| 166 | 166 | */ |
| 167 | 167 | const chooseAddressDetail = () => { |
| 168 | - console.log('打开地图选择地址'); | |
| 169 | - takeLocation(); | |
| 170 | - | |
| 171 | - // 创建选择方式的模态框 | |
| 172 | - const choiceContainer = document.createElement('div'); | |
| 173 | - choiceContainer.id = 'choiceContainer'; | |
| 174 | - choiceContainer.style.cssText = ` position: fixed; | |
| 175 | - top: 0; | |
| 176 | - left: 0; | |
| 177 | - width: 100%; | |
| 178 | - height: 100%; | |
| 179 | - background: rgba(0, 0, 0, 0.5); | |
| 180 | - z-index: 9999; | |
| 181 | - display: flex; | |
| 182 | - justify-content: center; | |
| 183 | - align-items: center; | |
| 184 | - `; | |
| 185 | - | |
| 186 | - const choiceBox = document.createElement('div'); | |
| 187 | - choiceBox.style.cssText = ` background: white; | |
| 188 | - padding: 20px; | |
| 189 | - border-radius: 8px; | |
| 190 | - text-align: center; | |
| 191 | - width: 80%; | |
| 192 | - max-width: 300px; | |
| 193 | - box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); | |
| 194 | - `; | |
| 195 | - | |
| 196 | - const title = document.createElement('h3'); | |
| 197 | - title.innerText = '请选择地址输入方式'; | |
| 198 | - title.style.cssText = ` margin-top: 0; | |
| 199 | - color: #333; | |
| 200 | - font-size: 18px; | |
| 201 | - `; | |
| 202 | - | |
| 203 | - const mapBtn = document.createElement('button'); | |
| 204 | - mapBtn.innerText = '地图选择'; | |
| 205 | - mapBtn.style.cssText = ` display: block; | |
| 206 | - width: 100%; | |
| 207 | - padding: 12px; | |
| 208 | - margin: 10px 0; | |
| 209 | - background: #19a97c; | |
| 210 | - color: white; | |
| 211 | - border: none; | |
| 212 | - border-radius: 4px; | |
| 213 | - cursor: pointer; | |
| 214 | - font-size: 16px; | |
| 215 | - transition: background 0.3s; | |
| 216 | - `; | |
| 217 | - | |
| 218 | - mapBtn.onmouseover = function() { | |
| 219 | - mapBtn.style.background = '#13966a'; | |
| 220 | - }; | |
| 221 | - | |
| 222 | - mapBtn.onmouseout = function() { | |
| 223 | - mapBtn.style.background = '#19a97c'; | |
| 224 | - }; | |
| 225 | - | |
| 226 | - const manualBtn = document.createElement('button'); | |
| 227 | - manualBtn.innerText = '手动输入'; | |
| 228 | - manualBtn.style.cssText = ` display: block; | |
| 229 | - width: 100%; | |
| 230 | - padding: 12px; | |
| 231 | - margin: 10px 0; | |
| 232 | - background: #409eff; | |
| 233 | - color: white; | |
| 234 | - border: none; | |
| 235 | - border-radius: 4px; | |
| 236 | - cursor: pointer; | |
| 237 | - font-size: 16px; | |
| 238 | - transition: background 0.3s; | |
| 239 | - `; | |
| 240 | - | |
| 241 | - manualBtn.onmouseover = function() { | |
| 242 | - manualBtn.style.background = '#3388e6'; | |
| 243 | - }; | |
| 244 | - | |
| 245 | - manualBtn.onmouseout = function() { | |
| 246 | - manualBtn.style.background = '#409eff'; | |
| 247 | - }; | |
| 248 | - | |
| 249 | - const cancelBtn = document.createElement('button'); | |
| 250 | - cancelBtn.innerText = '取消'; | |
| 251 | - cancelBtn.style.cssText = ` display: block; | |
| 252 | - width: 100%; | |
| 253 | - padding: 12px; | |
| 254 | - margin: 10px 0; | |
| 255 | - background: #ff4d4f; | |
| 256 | - color: white; | |
| 257 | - border: none; | |
| 258 | - border-radius: 4px; | |
| 259 | - cursor: pointer; | |
| 260 | - font-size: 16px; | |
| 261 | - transition: background 0.3s; | |
| 262 | - `; | |
| 263 | - | |
| 264 | - cancelBtn.onmouseover = function() { | |
| 265 | - cancelBtn.style.background = '#e63939'; | |
| 266 | - }; | |
| 267 | - | |
| 268 | - cancelBtn.onmouseout = function() { | |
| 269 | - cancelBtn.style.background = '#ff4d4f'; | |
| 270 | - }; | |
| 271 | - | |
| 272 | - choiceBox.appendChild(title); | |
| 273 | - choiceBox.appendChild(mapBtn); | |
| 274 | - choiceBox.appendChild(manualBtn); | |
| 275 | - choiceBox.appendChild(cancelBtn); | |
| 276 | - choiceContainer.appendChild(choiceBox); | |
| 277 | - document.body.appendChild(choiceContainer); | |
| 278 | - | |
| 279 | - // 地图选择按钮事件 | |
| 280 | - mapBtn.onclick = function() { | |
| 281 | - document.body.removeChild(choiceContainer); | |
| 282 | - | |
| 283 | - // 地图选择方式 | |
| 284 | - let coordinate = 'gcj02'; | |
| 285 | - | |
| 286 | - // 创建一个模态框来显示地图 | |
| 287 | - const mapContainer = document.createElement('div'); | |
| 288 | - mapContainer.id = 'mapContainerWrapper'; | |
| 289 | - mapContainer.style.cssText = ` position: fixed; | |
| 290 | - top: 0; | |
| 291 | - left: 0; | |
| 292 | - width: 100%; | |
| 293 | - height: 100%; | |
| 294 | - background: white; | |
| 295 | - z-index: 9999; | |
| 296 | - `; | |
| 297 | - | |
| 298 | - // 创建顶部工具栏 | |
| 299 | - const toolbar = document.createElement('div'); | |
| 300 | - toolbar.style.cssText = ` position: absolute; | |
| 301 | - top: 0; | |
| 302 | - left: 0; | |
| 303 | - width: 100%; | |
| 304 | - height: 50px; | |
| 305 | - background: #fff; | |
| 306 | - box-shadow: 0 2px 4px rgba(0,0,0,0.1); | |
| 307 | - z-index: 10000; | |
| 308 | - display: flex; | |
| 309 | - align-items: center; | |
| 310 | - padding: 0 15px; | |
| 311 | - box-sizing: border-box; | |
| 312 | - `; | |
| 313 | - | |
| 314 | - const titleText = document.createElement('div'); | |
| 315 | - titleText.innerText = '请选择地址'; | |
| 316 | - titleText.style.cssText = ` flex: 1; | |
| 317 | - text-align: center; | |
| 318 | - font-size: 16px; | |
| 319 | - font-weight: bold; | |
| 320 | - color: #333; | |
| 321 | - `; | |
| 322 | - | |
| 323 | - // 创建关闭按钮 | |
| 324 | - const closeBtn = document.createElement('button'); | |
| 325 | - closeBtn.innerText = '✕'; | |
| 326 | - closeBtn.style.cssText = ` width: 30px; | |
| 327 | - height: 30px; | |
| 328 | - background: #ff4d4f; | |
| 329 | - color: white; | |
| 330 | - border: none; | |
| 331 | - border-radius: 50%; | |
| 332 | - cursor: pointer; | |
| 333 | - font-size: 16px; | |
| 334 | - display: flex; | |
| 335 | - align-items: center; | |
| 336 | - justify-content: center; | |
| 337 | - `; | |
| 338 | - | |
| 339 | - toolbar.appendChild(titleText); | |
| 340 | - toolbar.appendChild(closeBtn); | |
| 341 | - | |
| 342 | - // 创建地图容器 | |
| 343 | - const mapElement = document.createElement('div'); | |
| 344 | - mapElement.id = 'mapContainer'; | |
| 345 | - mapElement.style.cssText = ` width: 100%; | |
| 346 | - height: 100%; | |
| 347 | - margin-top: 50px; | |
| 348 | - `; | |
| 349 | - | |
| 350 | - mapContainer.appendChild(toolbar); | |
| 351 | - mapContainer.appendChild(mapElement); | |
| 352 | - document.body.appendChild(mapContainer); | |
| 353 | - | |
| 354 | - // 加载腾讯地图API | |
| 355 | - const script = document.createElement('script'); | |
| 356 | - script.src = 'https://map.qq.com/api/js?v=2.exp&key=XICBZ-ALWKT-2KPXZ-VCBL7-XMRYO-2QFS4&callback=initMap'; | |
| 357 | - | |
| 358 | - // 定义全局回调函数 | |
| 359 | - window.initMap = function() { | |
| 360 | - // 初始化地图,设置默认位置为长沙 | |
| 361 | - const center = new qq.maps.LatLng(28.198265, 112.984353); // 长沙市坐标 | |
| 362 | - const map = new qq.maps.Map(mapElement, { | |
| 363 | - center: center, | |
| 364 | - zoom: 15 | |
| 365 | - }); | |
| 366 | - window.currentMapInstance = map; | |
| 367 | - // 地图初始化完成后自动获取当前位置 | |
| 368 | - setTimeout(() => { | |
| 369 | - takeLocation(); | |
| 370 | - }, 500); | |
| 371 | - | |
| 372 | - // 添加点击事件监听器 | |
| 373 | - qq.maps.event.addListener(map, 'click', function(event) { | |
| 374 | - const lat = event.latLng.getLat(); | |
| 375 | - const lng = event.latLng.getLng(); | |
| 376 | - | |
| 377 | - // 使用腾讯地图逆解析API获取地址信息 | |
| 378 | - const key = "XICBZ-ALWKT-2KPXZ-VCBL7-XMRYO-2QFS4"; | |
| 379 | - const url = `https://apis.map.qq.com/ws/geocoder/v1/?key=${key}&location=${lat},${lng}&output=jsonp`; | |
| 380 | - | |
| 381 | - // 创建script标签实现JSONP | |
| 382 | - const jsonpScript = document.createElement('script'); | |
| 383 | - const callbackName = 'jsonp_callback_' + Math.round(100000 * Math.random()); | |
| 384 | - | |
| 385 | - // 定义全局回调函数 | |
| 386 | - window[callbackName] = function(data) { | |
| 387 | - // 清理 | |
| 388 | - delete window[callbackName]; | |
| 389 | - document.body.removeChild(jsonpScript); | |
| 390 | - | |
| 391 | - if (data.status === 0) { | |
| 392 | - const component = data.result.address_component; | |
| 393 | - const address = data.result.address; | |
| 394 | - | |
| 395 | - // 创建确认选择的模态框 | |
| 396 | - const confirmContainer = document.createElement('div'); | |
| 397 | - confirmContainer.style.cssText = ` position: fixed; | |
| 398 | - top: 0; | |
| 399 | - left: 0; | |
| 400 | - width: 100%; | |
| 401 | - height: 100%; | |
| 402 | - background: rgba(0, 0, 0, 0.5); | |
| 403 | - z-index: 10001; | |
| 404 | - display: flex; | |
| 405 | - justify-content: center; | |
| 406 | - align-items: center; | |
| 407 | - `; | |
| 408 | - | |
| 409 | - const confirmBox = document.createElement('div'); | |
| 410 | - confirmBox.style.cssText = ` background: white; | |
| 411 | - padding: 20px; | |
| 412 | - border-radius: 8px; | |
| 413 | - text-align: center; | |
| 414 | - width: 80%; | |
| 415 | - max-width: 300px; | |
| 416 | - box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); | |
| 417 | - `; | |
| 418 | - | |
| 419 | - const confirmTitle = document.createElement('h3'); | |
| 420 | - confirmTitle.innerText = '确认地址'; | |
| 421 | - confirmTitle.style.cssText = ` margin-top: 0; | |
| 422 | - color: #333; | |
| 423 | - `; | |
| 424 | - | |
| 425 | - const confirmText = document.createElement('p'); | |
| 426 | - confirmText.innerText = address; | |
| 427 | - confirmText.style.cssText = ` color: #666; | |
| 428 | - font-size: 14px; | |
| 429 | - line-height: 1.5; | |
| 430 | - margin: 10px 0; | |
| 431 | - `; | |
| 432 | - | |
| 433 | - const confirmBtn = document.createElement('button'); | |
| 434 | - confirmBtn.innerText = '确认'; | |
| 435 | - confirmBtn.style.cssText = ` display: inline-block; | |
| 436 | - width: 45%; | |
| 437 | - padding: 10px; | |
| 438 | - margin: 5px; | |
| 439 | - background: #19a97c; | |
| 440 | - color: white; | |
| 441 | - border: none; | |
| 442 | - border-radius: 4px; | |
| 443 | - cursor: pointer; | |
| 444 | - font-size: 14px; | |
| 445 | - `; | |
| 446 | - | |
| 447 | - const cancelConfirmBtn = document.createElement('button'); | |
| 448 | - cancelConfirmBtn.innerText = '取消'; | |
| 449 | - cancelConfirmBtn.style.cssText = ` display: inline-block; | |
| 450 | - width: 45%; | |
| 451 | - padding: 10px; | |
| 452 | - margin: 5px; | |
| 453 | - background: #ff4d4f; | |
| 454 | - color: white; | |
| 455 | - border: none; | |
| 456 | - border-radius: 4px; | |
| 457 | - cursor: pointer; | |
| 458 | - font-size: 14px; | |
| 459 | - `; | |
| 460 | - | |
| 461 | - confirmBox.appendChild(confirmTitle); | |
| 462 | - confirmBox.appendChild(confirmText); | |
| 463 | - confirmBox.appendChild(confirmBtn); | |
| 464 | - confirmBox.appendChild(cancelConfirmBtn); | |
| 465 | - confirmContainer.appendChild(confirmBox); | |
| 466 | - document.body.appendChild(confirmContainer); | |
| 467 | - | |
| 468 | - // 确认按钮事件 | |
| 469 | - confirmBtn.onclick = function() { | |
| 470 | - addressInfo.garLongitude = lng; | |
| 471 | - addressInfo.garLatitude = lat; | |
| 472 | - addressInfo.garCoordinate = coordinate; | |
| 473 | - | |
| 474 | - if (component.province == "湖南省") { | |
| 475 | - addressInfo.addressDetail = address.replace(component.province + component.city + component.district, ""); | |
| 476 | - addressInfo.addressArea = component.province + '-' + component.city + '-' + component.district; | |
| 477 | - } else { | |
| 478 | - addressInfo.addressDetail = address; | |
| 479 | - } | |
| 480 | - | |
| 481 | - // 关闭所有模态框 | |
| 482 | - document.body.removeChild(confirmContainer); | |
| 483 | - document.body.removeChild(mapContainer); | |
| 484 | - // 清理全局函数 | |
| 485 | - delete window.initMap; | |
| 486 | - }; | |
| 487 | - | |
| 488 | - // 取消确认按钮事件 | |
| 489 | - cancelConfirmBtn.onclick = function() { | |
| 490 | - document.body.removeChild(confirmContainer); | |
| 491 | - }; | |
| 492 | - } else { | |
| 493 | - // 创建错误提示的模态框 | |
| 494 | - const errorContainer = document.createElement('div'); | |
| 495 | - errorContainer.style.cssText = ` position: fixed; | |
| 496 | - top: 0; | |
| 497 | - left: 0; | |
| 498 | - width: 100%; | |
| 499 | - height: 100%; | |
| 500 | - background: rgba(0, 0, 0, 0.5); | |
| 501 | - z-index: 10001; | |
| 502 | - display: flex; | |
| 503 | - justify-content: center; | |
| 504 | - align-items: center; | |
| 505 | - `; | |
| 506 | - | |
| 507 | - const errorBox = document.createElement('div'); | |
| 508 | - errorBox.style.cssText = ` background: white; | |
| 509 | - padding: 20px; | |
| 510 | - border-radius: 8px; | |
| 511 | - text-align: center; | |
| 512 | - width: 80%; | |
| 513 | - max-width: 300px; | |
| 514 | - box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); | |
| 515 | - `; | |
| 516 | - | |
| 517 | - const errorTitle = document.createElement('h3'); | |
| 518 | - errorTitle.innerText = '提示'; | |
| 519 | - errorTitle.style.cssText = ` margin-top: 0; | |
| 520 | - color: #333; | |
| 521 | - `; | |
| 522 | - | |
| 523 | - const errorText = document.createElement('p'); | |
| 524 | - errorText.innerText = '地址解析失败,请重新选择'; | |
| 525 | - errorText.style.cssText = ` color: #666; | |
| 526 | - font-size: 14px; | |
| 527 | - margin: 10px 0; | |
| 528 | - `; | |
| 529 | - | |
| 530 | - const okBtn = document.createElement('button'); | |
| 531 | - okBtn.innerText = '确定'; | |
| 532 | - okBtn.style.cssText = ` display: inline-block; | |
| 533 | - width: 100%; | |
| 534 | - padding: 10px; | |
| 535 | - margin: 5px 0; | |
| 536 | - background: #409eff; | |
| 537 | - color: white; | |
| 538 | - border: none; | |
| 539 | - border-radius: 4px; | |
| 540 | - cursor: pointer; | |
| 541 | - font-size: 14px; | |
| 542 | - `; | |
| 543 | - | |
| 544 | - errorBox.appendChild(errorTitle); | |
| 545 | - errorBox.appendChild(errorText); | |
| 546 | - errorBox.appendChild(okBtn); | |
| 547 | - errorContainer.appendChild(errorBox); | |
| 548 | - document.body.appendChild(errorContainer); | |
| 549 | - | |
| 550 | - // 确定按钮事件 | |
| 551 | - okBtn.onclick = function() { | |
| 552 | - document.body.removeChild(errorContainer); | |
| 553 | - }; | |
| 554 | - } | |
| 555 | - }; | |
| 556 | - | |
| 557 | - // 设置错误处理 | |
| 558 | - jsonpScript.onerror = function() { | |
| 559 | - // 清理 | |
| 560 | - delete window[callbackName]; | |
| 561 | - document.body.removeChild(jsonpScript); | |
| 562 | - | |
| 563 | - // 创建错误提示的模态框 | |
| 564 | - const errorContainer = document.createElement('div'); | |
| 565 | - errorContainer.style.cssText = ` position: fixed; | |
| 566 | - top: 0; | |
| 567 | - left: 0; | |
| 568 | - width: 100%; | |
| 569 | - height: 100%; | |
| 570 | - background: rgba(0, 0, 0, 0.5); | |
| 571 | - z-index: 10001; | |
| 572 | - display: flex; | |
| 573 | - justify-content: center; | |
| 574 | - align-items: center; | |
| 575 | - `; | |
| 576 | - | |
| 577 | - const errorBox = document.createElement('div'); | |
| 578 | - errorBox.style.cssText = ` background: white; | |
| 579 | - padding: 20px; | |
| 580 | - border-radius: 8px; | |
| 581 | - text-align: center; | |
| 582 | - width: 80%; | |
| 583 | - max-width: 300px; | |
| 584 | - box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); | |
| 585 | - `; | |
| 586 | - | |
| 587 | - const errorTitle = document.createElement('h3'); | |
| 588 | - errorTitle.innerText = '提示'; | |
| 589 | - errorTitle.style.cssText = ` margin-top: 0; | |
| 590 | - color: #333; | |
| 591 | - `; | |
| 592 | - | |
| 593 | - const errorText = document.createElement('p'); | |
| 594 | - errorText.innerText = '地址解析失败,请重新选择'; | |
| 595 | - errorText.style.cssText = ` color: #666; | |
| 596 | - font-size: 14px; | |
| 597 | - margin: 10px 0; | |
| 598 | - `; | |
| 599 | - | |
| 600 | - const okBtn = document.createElement('button'); | |
| 601 | - okBtn.innerText = '确定'; | |
| 602 | - okBtn.style.cssText = ` display: inline-block; | |
| 603 | - width: 100%; | |
| 604 | - padding: 10px; | |
| 605 | - margin: 5px 0; | |
| 606 | - background: #409eff; | |
| 607 | - color: white; | |
| 608 | - border: none; | |
| 609 | - border-radius: 4px; | |
| 610 | - cursor: pointer; | |
| 611 | - font-size: 14px; | |
| 612 | - `; | |
| 613 | - | |
| 614 | - errorBox.appendChild(errorTitle); | |
| 615 | - errorBox.appendChild(errorText); | |
| 616 | - errorBox.appendChild(okBtn); | |
| 617 | - errorContainer.appendChild(errorBox); | |
| 618 | - document.body.appendChild(errorContainer); | |
| 619 | - | |
| 620 | - // 确定按钮事件 | |
| 621 | - okBtn.onclick = function() { | |
| 622 | - document.body.removeChild(errorContainer); | |
| 623 | - }; | |
| 624 | - }; | |
| 625 | - | |
| 626 | - jsonpScript.src = url + '&callback=' + callbackName; | |
| 627 | - document.body.appendChild(jsonpScript); | |
| 628 | - }); | |
| 629 | - | |
| 630 | - // 添加当前位置定位功能 | |
| 631 | - if (navigator.geolocation) { | |
| 632 | - navigator.geolocation.getCurrentPosition( | |
| 633 | - (position) => { | |
| 634 | - const lat = position.coords.latitude; | |
| 635 | - const lng = position.coords.longitude; | |
| 636 | - const pos = new qq.maps.LatLng(lat, lng); | |
| 637 | - map.setCenter(pos); | |
| 638 | - }, | |
| 639 | - (error) => { | |
| 640 | - console.log('获取当前位置失败', error); | |
| 641 | - } | |
| 642 | - ); | |
| 643 | - } | |
| 644 | - }; | |
| 645 | - | |
| 646 | - // 关闭按钮事件 | |
| 647 | - closeBtn.onclick = function() { | |
| 648 | - document.body.removeChild(mapContainer); | |
| 649 | - // 清理全局函数 | |
| 650 | - delete window.initMap; | |
| 651 | - }; | |
| 652 | - | |
| 653 | - document.body.appendChild(script); | |
| 654 | - }; | |
| 655 | - | |
| 656 | - // 手动输入按钮事件 | |
| 657 | - manualBtn.onclick = function() { | |
| 658 | - document.body.removeChild(choiceContainer); | |
| 659 | - | |
| 660 | - // 创建自定义输入框模态框 | |
| 661 | - const inputContainer = document.createElement('div'); | |
| 662 | - inputContainer.style.cssText = ` position: fixed; | |
| 663 | - top: 0; | |
| 664 | - left: 0; | |
| 665 | - width: 100%; | |
| 666 | - height: 100%; | |
| 667 | - background: rgba(0, 0, 0, 0.5); | |
| 668 | - z-index: 9999; | |
| 669 | - display: flex; | |
| 670 | - justify-content: center; | |
| 671 | - align-items: center; | |
| 672 | - `; | |
| 673 | - | |
| 674 | - const inputBox = document.createElement('div'); | |
| 675 | - inputBox.style.cssText = ` background: white; | |
| 676 | - padding: 20px; | |
| 677 | - border-radius: 8px; | |
| 678 | - text-align: center; | |
| 679 | - width: 80%; | |
| 680 | - max-width: 300px; | |
| 681 | - box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); | |
| 682 | - `; | |
| 683 | - | |
| 684 | - const inputTitle = document.createElement('h3'); | |
| 685 | - inputTitle.innerText = '请输入详细地址'; | |
| 686 | - inputTitle.style.cssText = ` margin-top: 0; | |
| 687 | - color: #333; | |
| 688 | - `; | |
| 689 | - | |
| 690 | - const inputField = document.createElement('input'); | |
| 691 | - inputField.type = 'text'; | |
| 692 | - inputField.placeholder = '请输入详细地址'; | |
| 693 | - inputField.style.cssText = ` width: 100%; | |
| 694 | - padding: 10px; | |
| 695 | - margin: 10px 0; | |
| 696 | - border: 1px solid #ddd; | |
| 697 | - border-radius: 4px; | |
| 698 | - box-sizing: border-box; | |
| 699 | - font-size: 14px; | |
| 700 | - `; | |
| 701 | - | |
| 702 | - const submitBtn = document.createElement('button'); | |
| 703 | - submitBtn.innerText = '确定'; | |
| 704 | - submitBtn.style.cssText = ` display: inline-block; | |
| 705 | - width: 45%; | |
| 706 | - padding: 10px; | |
| 707 | - margin: 5px; | |
| 708 | - background: #19a97c; | |
| 709 | - color: white; | |
| 710 | - border: none; | |
| 711 | - border-radius: 4px; | |
| 712 | - cursor: pointer; | |
| 713 | - font-size: 14px; | |
| 714 | - `; | |
| 715 | - | |
| 716 | - const cancelInputBtn = document.createElement('button'); | |
| 717 | - cancelInputBtn.innerText = '取消'; | |
| 718 | - cancelInputBtn.style.cssText = ` display: inline-block; | |
| 719 | - width: 45%; | |
| 720 | - padding: 10px; | |
| 721 | - margin: 5px; | |
| 722 | - background: #ff4d4f; | |
| 723 | - color: white; | |
| 724 | - border: none; | |
| 725 | - border-radius: 4px; | |
| 726 | - cursor: pointer; | |
| 727 | - font-size: 14px; | |
| 728 | - `; | |
| 729 | - | |
| 730 | - inputBox.appendChild(inputTitle); | |
| 731 | - inputBox.appendChild(inputField); | |
| 732 | - inputBox.appendChild(submitBtn); | |
| 733 | - inputBox.appendChild(cancelInputBtn); | |
| 734 | - inputContainer.appendChild(inputBox); | |
| 735 | - document.body.appendChild(inputContainer); | |
| 736 | - | |
| 737 | - // 确定按钮事件 | |
| 738 | - submitBtn.onclick = function() { | |
| 739 | - const manualAddress = inputField.value.trim(); | |
| 740 | - if (manualAddress) { | |
| 741 | - addressInfo.addressDetail = manualAddress; | |
| 742 | - document.body.removeChild(inputContainer); | |
| 743 | - } else { | |
| 744 | - // 创建提示模态框 | |
| 745 | - const tipContainer = document.createElement('div'); | |
| 746 | - tipContainer.style.cssText = ` position: fixed; | |
| 747 | - top: 0; | |
| 748 | - left: 0; | |
| 749 | - width: 100%; | |
| 750 | - height: 100%; | |
| 751 | - background: rgba(0, 0, 0, 0.5); | |
| 752 | - z-index: 10000; | |
| 753 | - display: flex; | |
| 754 | - justify-content: center; | |
| 755 | - align-items: center; | |
| 756 | - `; | |
| 757 | - | |
| 758 | - const tipBox = document.createElement('div'); | |
| 759 | - tipBox.style.cssText = ` background: white; | |
| 760 | - padding: 20px; | |
| 761 | - border-radius: 8px; | |
| 762 | - text-align: center; | |
| 763 | - width: 80%; | |
| 764 | - max-width: 300px; | |
| 765 | - box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); | |
| 766 | - `; | |
| 767 | - | |
| 768 | - const tipText = document.createElement('p'); | |
| 769 | - tipText.innerText = '请输入详细地址'; | |
| 770 | - tipText.style.cssText = ` color: #666; | |
| 771 | - font-size: 14px; | |
| 772 | - margin: 10px 0; | |
| 773 | - `; | |
| 774 | - | |
| 775 | - const okBtn = document.createElement('button'); | |
| 776 | - okBtn.innerText = '确定'; | |
| 777 | - okBtn.style.cssText = ` display: inline-block; | |
| 778 | - width: 100%; | |
| 779 | - padding: 10px; | |
| 780 | - margin: 5px 0; | |
| 781 | - background: #409eff; | |
| 782 | - color: white; | |
| 783 | - border: none; | |
| 784 | - border-radius: 4px; | |
| 785 | - cursor: pointer; | |
| 786 | - font-size: 14px; | |
| 787 | - `; | |
| 788 | - | |
| 789 | - tipBox.appendChild(tipText); | |
| 790 | - tipBox.appendChild(okBtn); | |
| 791 | - tipContainer.appendChild(tipBox); | |
| 792 | - document.body.appendChild(tipContainer); | |
| 793 | - | |
| 794 | - // 确定按钮事件 | |
| 795 | - okBtn.onclick = function() { | |
| 796 | - document.body.removeChild(tipContainer); | |
| 797 | - }; | |
| 798 | - } | |
| 799 | - }; | |
| 800 | - | |
| 801 | - // 取消按钮事件 | |
| 802 | - cancelInputBtn.onclick = function() { | |
| 803 | - document.body.removeChild(inputContainer); | |
| 804 | - }; | |
| 805 | - | |
| 806 | - // 回车键确认 | |
| 807 | - inputField.addEventListener('keypress', function(e) { | |
| 808 | - if (e.key === 'Enter') { | |
| 809 | - submitBtn.click(); | |
| 810 | - } | |
| 811 | - }); | |
| 812 | - | |
| 813 | - // 聚焦到输入框 | |
| 814 | - setTimeout(() => { | |
| 815 | - inputField.focus(); | |
| 816 | - }, 100); | |
| 817 | - }; | |
| 818 | - | |
| 819 | - // 取消按钮事件 | |
| 820 | - cancelBtn.onclick = function() { | |
| 821 | - document.body.removeChild(choiceContainer); | |
| 822 | - }; | |
| 823 | -} | |
| 824 | - | |
| 825 | -// 定义定位回调函数 | |
| 826 | -const takeLocationCallBack = (lngLat) => { | |
| 827 | - const ll = lngLat.split(","); | |
| 828 | - console.log("定位结果:", ll); | |
| 829 | - | |
| 830 | - if (ll.length >= 2) { | |
| 831 | - const longitude = parseFloat(ll[0]); | |
| 832 | - const latitude = parseFloat(ll[1]); | |
| 833 | - | |
| 834 | - // 在地图上定位到当前位置 | |
| 835 | - const mapContainer = document.getElementById('mapContainer'); | |
| 836 | - if (mapContainer && window.qq && qq.maps && window.currentMapInstance) { | |
| 837 | - const pos = new qq.maps.LatLng(latitude, longitude); | |
| 838 | - window.currentMapInstance.setCenter(pos); | |
| 839 | - window.currentMapInstance.setZoom(17); // 放大一些以便更好地查看位置 | |
| 840 | - | |
| 841 | - // 清除之前的标记(如果有的话) | |
| 842 | - if (window.currentLocationMarker) { | |
| 843 | - window.currentLocationMarker.setMap(null); | |
| 844 | - } | |
| 845 | - | |
| 846 | - // 添加新的当前位置标记 | |
| 847 | - window.currentLocationMarker = new qq.maps.Marker({ | |
| 848 | - position: pos, | |
| 849 | - map: window.currentMapInstance | |
| 168 | + console.log('打开地图选择地址(自动定位)'); | |
| 169 | + | |
| 170 | + // 1. 先获取当前位置的经纬度(关键:统一坐标系为 gcj02,关闭 altitude 避免额外权限) | |
| 171 | + uni.getLocation({ | |
| 172 | + type: 'gcj02', // 必须使用 gcj02(腾讯/高德地图标准,避免坐标系不匹配) | |
| 173 | + altitude: false, // 关闭海拔获取,减少权限要求 | |
| 174 | + isHighAccuracy: false, // 关闭高精度定位(降低硬件依赖) | |
| 175 | + success: (locationRes) => { | |
| 176 | + console.log('当前位置经纬度:', locationRes); | |
| 177 | + const { latitude, longitude } = locationRes; | |
| 178 | + | |
| 179 | + // 2. 打开地图选择器(移除可能触发指南针的参数) | |
| 180 | + uni.chooseLocation({ | |
| 181 | + latitude: latitude, | |
| 182 | + longitude: longitude, | |
| 183 | + scale: 16, | |
| 184 | + name: addressInfo.addressDetail || '', | |
| 185 | + address: addressInfo.addressArea || '', | |
| 186 | + success: (res) => { | |
| 187 | + addressInfo.addressDetail = res.name; | |
| 188 | + addressInfo.garLongitude = res.longitude; | |
| 189 | + addressInfo.garLatitude = res.latitude; | |
| 190 | + }, | |
| 191 | + fail: (err) => { | |
| 192 | + console.error('地图选择失败:', err); | |
| 193 | + handleLocationError(err); | |
| 194 | + } | |
| 850 | 195 | }); |
| 196 | + }, | |
| 197 | + fail: (err) => { | |
| 198 | + console.error('获取当前位置失败:', err); | |
| 199 | + handleLocationError(err); | |
| 200 | + } | |
| 201 | + }); | |
| 202 | +}; | |
| 851 | 203 | |
| 852 | - // 创建或更新信息窗口 | |
| 853 | - if (!window.currentLocationInfoWindow) { | |
| 854 | - window.currentLocationInfoWindow = new qq.maps.InfoWindow({ | |
| 855 | - map: window.currentMapInstance | |
| 856 | - }); | |
| 204 | +/** | |
| 205 | + * 统一处理定位/地图错误 | |
| 206 | + */ | |
| 207 | +const handleLocationError = (err) => { | |
| 208 | + const errMsg = err.errMsg || ''; | |
| 209 | + | |
| 210 | + // 1. 处理权限拒绝 | |
| 211 | + if (errMsg.includes('auth deny') || errMsg.includes('permission denied')) { | |
| 212 | + uni.showModal({ | |
| 213 | + title: '授权提示', | |
| 214 | + content: '需要获取您的位置权限才能自动定位,请在设置中开启', | |
| 215 | + confirmText: '去设置', | |
| 216 | + cancelText: '手动输入', | |
| 217 | + success: (modalRes) => { | |
| 218 | + if (modalRes.confirm) { | |
| 219 | + uni.openSetting(); // 打开系统设置 | |
| 220 | + } else { | |
| 221 | + // 手动输入地址(隐藏地图选择,直接让用户输入) | |
| 222 | + uni.showToast({ title: '请手动输入详细地址', icon: 'none' }); | |
| 223 | + } | |
| 857 | 224 | } |
| 858 | - | |
| 859 | - // 设置信息窗口内容并打开 | |
| 860 | - window.currentLocationInfoWindow.setContent('<div style="padding:10px;">您的当前位置</div>'); | |
| 861 | - window.currentLocationInfoWindow.setPosition(pos); | |
| 862 | - window.currentLocationInfoWindow.open(); | |
| 863 | - } | |
| 864 | - } else { | |
| 865 | - uni.showToast({ | |
| 866 | - title: '定位结果异常', | |
| 867 | - icon: 'none' | |
| 868 | 225 | }); |
| 869 | 226 | } |
| 870 | -} | |
| 871 | 227 | |
| 872 | -const takeLocation = () => { | |
| 873 | - // 调用原生接口获取定位 | |
| 874 | - if (window.JsInterface && typeof window.JsInterface.takeLocation === 'function') { | |
| 875 | - window.JsInterface.takeLocation(); | |
| 876 | - } else { | |
| 877 | - // 如果没有原生接口,使用uni.getLocation作为备选方案 | |
| 878 | - uni.getLocation({ | |
| 879 | - type: 'gcj02', | |
| 880 | - success: function (res) { | |
| 881 | - // 直接处理结果 | |
| 882 | - handleLocationResult(res.longitude, res.latitude); | |
| 883 | - }, | |
| 884 | - fail: function (err) { | |
| 885 | - console.error('定位失败:', err); | |
| 886 | - uni.showToast({ | |
| 887 | - title: '定位失败', | |
| 888 | - icon: 'none' | |
| 228 | + // 2. 处理指南针失败(startCompass:fail) | |
| 229 | + else if (errMsg.includes('startCompass:fail')) { | |
| 230 | + uni.showModal({ | |
| 231 | + title: '提示', | |
| 232 | + content: '当前设备不支持指南针功能,将为您打开地图手动选择地址', | |
| 233 | + showCancel: false, | |
| 234 | + success: () => { | |
| 235 | + // 降级方案:不传递初始经纬度,直接打开地图 | |
| 236 | + uni.chooseLocation({ | |
| 237 | + success: (res) => { | |
| 238 | + addressInfo.addressDetail = res.name; | |
| 239 | + addressInfo.garLongitude = res.longitude; | |
| 240 | + addressInfo.garLatitude = res.latitude; | |
| 241 | + }, | |
| 242 | + fail: () => { | |
| 243 | + uni.showToast({ title: '地图选择失败,请手动输入地址', icon: 'none' }); | |
| 244 | + } | |
| 889 | 245 | }); |
| 890 | 246 | } |
| 891 | 247 | }); |
| 892 | 248 | } |
| 893 | -} | |
| 249 | + | |
| 250 | + // 3. 其他错误(网络/设备问题) | |
| 251 | + else { | |
| 252 | + uni.showToast({ title: '定位失败,请手动输入地址', icon: 'none' }); | |
| 253 | + } | |
| 254 | +}; | |
| 894 | 255 | |
| 895 | 256 | onMounted(() => { |
| 896 | 257 | proxy.$refs.addressFrom.setRules(rules) |
| 897 | - window.takeLocationCallBack = takeLocationCallBack | |
| 898 | 258 | }) |
| 899 | 259 | |
| 900 | 260 | onLoad((options) => { | ... | ... |
garbage-removal/src/pages/home-info/clean/index.vue
| ... | ... | @@ -71,7 +71,7 @@ |
| 71 | 71 | |
| 72 | 72 | <view class="company-clean-container-car-main-content-type"> |
| 73 | 73 | <view class="company-clean-container-car-main-content-type-price-area"> |
| 74 | - <text style="color: red;">*</text>添加车辆数量: | |
| 74 | + <text style="color: red;">*</text>预估车辆数(趟): | |
| 75 | 75 | </view> |
| 76 | 76 | <view style=" width:100%;display:flex; color:#909399; align-items: center;"> |
| 77 | 77 | <u-number-box :min="0" :max="9999" integer buttonSize="46" :inputWidth="100" | ... | ... |
garbage-removal/src/pages/home/index.vue
| ... | ... | @@ -45,10 +45,12 @@ |
| 45 | 45 | <u-dropdown active-color="#19a97c"> |
| 46 | 46 | <u-dropdown-item :height="'240rpx'" :placement="'left'" v-model="registrationAreaValue" |
| 47 | 47 | @change="handleDropdownAreaChange" :title="'所属区域'" :options="dropdownOptions[0]"></u-dropdown-item> |
| 48 | + | |
| 48 | 49 | <u-dropdown-item :placement="'center'" v-model="carTypeValue" @change="handleDropdownCarChange" |
| 49 | 50 | :title="'车辆类型'" :options="dropdownOptions[1]"></u-dropdown-item> |
| 51 | + | |
| 50 | 52 | <u-dropdown-item :placement="'right'" v-model="sortValue" @change="handleDropdownSortChange" |
| 51 | - :title="dropdownOptions[2][sortValue].label" :options="dropdownOptions[2]"></u-dropdown-item> | |
| 53 | + :title="'排序'" :options="dropdownOptions[2]"></u-dropdown-item> | |
| 52 | 54 | </u-dropdown> |
| 53 | 55 | </view> |
| 54 | 56 | </view> |
| ... | ... | @@ -158,18 +160,14 @@ const carTypeValue = ref('') |
| 158 | 160 | const carTypeRealValue = ref('') |
| 159 | 161 | const dropdownOptions = ref([ |
| 160 | 162 | [{ |
| 161 | - label: '芙蓉区', | |
| 162 | - value: '芙蓉区', | |
| 163 | + label: '湘江新区', | |
| 164 | + value: '湘江新区' | |
| 163 | 165 | }, |
| 164 | 166 | { |
| 165 | 167 | label: '天心区', |
| 166 | 168 | value: '天心区' |
| 167 | 169 | }, |
| 168 | 170 | { |
| 169 | - label: '岳麓区', | |
| 170 | - value: '岳麓区' | |
| 171 | - }, | |
| 172 | - { | |
| 173 | 171 | label: '开福区', |
| 174 | 172 | value: '开福区' |
| 175 | 173 | }, |
| ... | ... | @@ -194,25 +192,25 @@ const dropdownOptions = ref([ |
| 194 | 192 | value: '宁乡市' |
| 195 | 193 | }, |
| 196 | 194 | { |
| 197 | - label: '湘江新区', | |
| 198 | - value: '湘江新区' | |
| 195 | + label: '芙蓉区', | |
| 196 | + value: '芙蓉区' | |
| 199 | 197 | } |
| 200 | 198 | ], [{ |
| 201 | 199 | label: '暂未开放', |
| 202 | 200 | value: '暂未开放', |
| 203 | 201 | },] |
| 204 | 202 | , [{ |
| 205 | - label: '距离排序', | |
| 203 | + label: '距离优先', | |
| 206 | 204 | value: 0, |
| 207 | 205 | }, |
| 208 | - { | |
| 209 | - label: '清运排序', | |
| 210 | - value: 1 | |
| 211 | - }, | |
| 212 | - { | |
| 213 | - label: '评价排序', | |
| 214 | - value: 2 | |
| 215 | - }] | |
| 206 | + { | |
| 207 | + label: '运量优先', | |
| 208 | + value: 1 | |
| 209 | + }, | |
| 210 | + { | |
| 211 | + label: '评分优先', | |
| 212 | + value: 2 | |
| 213 | + }] | |
| 216 | 214 | ]) |
| 217 | 215 | |
| 218 | 216 | // 信息指南 |
| ... | ... | @@ -417,11 +415,27 @@ onShow(() => { |
| 417 | 415 | |
| 418 | 416 | const updateOrderBadge = async () => { |
| 419 | 417 | try { |
| 420 | - const res = await getOrderCountByType(0); | |
| 421 | - await uni.setTabBarBadge({ | |
| 422 | - index: 1, // 订单tab在tabBar中的索引 | |
| 423 | - text: String(res.data.data.total) | |
| 424 | - }); | |
| 418 | + // 获取待清运订单数量(type=0) | |
| 419 | + const pendingRes = await getOrderCountByType(0); | |
| 420 | + const pendingCount = pendingRes.data.data.total || 0; | |
| 421 | + | |
| 422 | + // 获取清运中订单数量(type=1) | |
| 423 | + const processingRes = await getOrderCountByType(1); | |
| 424 | + const processingCount = processingRes.data.data.total || 0; | |
| 425 | + | |
| 426 | + // 计算总数 | |
| 427 | + const totalCount = pendingCount + processingCount; | |
| 428 | + | |
| 429 | + if (totalCount > 0) { | |
| 430 | + await uni.setTabBarBadge({ | |
| 431 | + index: 1, // 订单tab在tabBar中的索引 | |
| 432 | + text: String(totalCount) | |
| 433 | + }); | |
| 434 | + } else { | |
| 435 | + await uni.removeTabBarBadge({ | |
| 436 | + index: 1 | |
| 437 | + }); | |
| 438 | + } | |
| 425 | 439 | } catch (error) { |
| 426 | 440 | console.error('获取订单数量失败:', error); |
| 427 | 441 | } | ... | ... |
garbage-removal/src/pages/login/code.vue
garbage-removal/src/pages/order-info/order-disposal/scan-detail/index.vue
| ... | ... | @@ -228,31 +228,44 @@ |
| 228 | 228 | const handlerInputChange = (val) => { |
| 229 | 229 | console.log(val); |
| 230 | 230 | } |
| 231 | - const handlerSubmit = async () => { | |
| 232 | - // 校验参数 | |
| 233 | - let params = { | |
| 234 | - ...details.value, | |
| 235 | - fillImageList: fileList.value.map((item) => item.url), | |
| 236 | - garOrderHandlerCompanyName: details.value.garOrderCompanyName, | |
| 237 | - garOrderHandlerCompanyId: details.value.garOrderCompanyId, | |
| 238 | - // 添加定位信息 | |
| 239 | - latitude: location.value.latitude, | |
| 240 | - longitude: location.value.longitude, | |
| 241 | - transportDistance : details.value.transportDistance | |
| 242 | - } | |
| 243 | - if (validateParams(params)) { | |
| 244 | - await askTransport(params).then((res) => { | |
| 245 | - console.log(res); | |
| 246 | - if (res.data.code == 200) { | |
| 247 | - // 修改提示框,添加跳转到订单页面的选项 | |
| 248 | - uni.$u.toast("当前趟次记录完毕!") | |
| 249 | - } | |
| 250 | - }).catch((err) => { | |
| 251 | - uni.$u.toast("当前趟次记录失败") | |
| 252 | - }) | |
| 253 | - } | |
| 254 | 231 | |
| 255 | - } | |
| 232 | + const handlerSubmit = async () => { | |
| 233 | + // 校验参数 | |
| 234 | + let params = { | |
| 235 | + ...details.value, | |
| 236 | + fillImageList: fileList.value.map((item) => item.url), | |
| 237 | + garOrderHandlerCompanyName: details.value.garOrderCompanyName, | |
| 238 | + garOrderHandlerCompanyId: details.value.garOrderCompanyId, | |
| 239 | + // 添加定位信息 | |
| 240 | + latitude: location.value.latitude, | |
| 241 | + longitude: location.value.longitude, | |
| 242 | + transportDistance : details.value.transportDistance | |
| 243 | + } | |
| 244 | + if (validateParams(params)) { | |
| 245 | + // 添加确认提醒对话框 | |
| 246 | + uni.showModal({ | |
| 247 | + title: '确认提交', | |
| 248 | + content: `请确认以下信息:\n\n车辆载重:${params.garCarryingWeight} 吨\n\n确认无误后点击确定提交`, | |
| 249 | + success: function (res) { | |
| 250 | + if (res.confirm) { | |
| 251 | + // 用户点击确定 | |
| 252 | + askTransport(params).then((res) => { | |
| 253 | + console.log(res); | |
| 254 | + if (res.data.code == 200) { | |
| 255 | + // 修改提示框,添加跳转到订单页面的选项 | |
| 256 | + uni.$u.toast("当前趟次记录完毕!") | |
| 257 | + } | |
| 258 | + }).catch((err) => { | |
| 259 | + uni.$u.toast("当前趟次记录失败") | |
| 260 | + }) | |
| 261 | + } else if (res.cancel) { | |
| 262 | + // 用户点击取消 | |
| 263 | + console.log('用户点击取消'); | |
| 264 | + } | |
| 265 | + } | |
| 266 | + }); | |
| 267 | + } | |
| 268 | + } | |
| 256 | 269 | |
| 257 | 270 | const validateParams = (params) => { |
| 258 | 271 | if (!params.garOrderHandlerName) { | ... | ... |
garbage-removal/src/pages/order-info/order-other/detail/index.vue
| 1 | + | |
| 1 | 2 | <template> |
| 2 | - <clashDriverDispatch ref="clashDriverDispatchRef" :valueKey="'licensePlateNumber'" | |
| 3 | - :onconfirm="handleDriverDispatchConfirm" :dataList="driverPersonnelList"> | |
| 4 | - </clashDriverDispatch> | |
| 5 | - <clashDisposalDispatch ref="clashDisposalDispatchRef" :valueKey="'companyName'" | |
| 6 | - :onconfirm="handleDisposalDispatchConfirm" :dataList="driverPersonnelList"> | |
| 7 | - </clashDisposalDispatch> | |
| 8 | - <u-popup :zIndex="10074" closeOnClickOverlay :show="carPopupShowFlag" :round="10" @close="handlePopupClick(false)" | |
| 9 | - @open="handlePopupClick(true)"> | |
| 10 | - <view class="company-clean-container-car-popup"> | |
| 11 | - <!-- 主要内容 --> | |
| 12 | - <view class="company-clean-container-car-popup-content"> | |
| 13 | - <view class="company-clean-container-car-popup-content-title"> | |
| 14 | - <view style="text-align: center;"> | |
| 15 | - 车辆类型 | |
| 16 | - </view> | |
| 17 | - </view> | |
| 18 | - <view class="company-clean-container-car-popup-content-box"> | |
| 19 | - <view class="company-clean-container-car-popup-content-box-item" | |
| 20 | - v-for="(item, index) in garCarInfoList" :key="index"> | |
| 21 | - <view class="company-clean-container-car-popup-content-box-item-text"> | |
| 22 | - {{ item.garOrderCarType }} | |
| 23 | - </view> | |
| 24 | - <view class="company-clean-container-car-popup-content-box-item-number" | |
| 25 | - hover-class="hoverClickStyle"> | |
| 26 | - <u-number-box :min="1" :max="9999" integer buttonSize="46" :inputWidth="100" | |
| 27 | - v-model="garCarInfoList[item.garOrderCarType].garOrderCarNumber" | |
| 28 | - :disabledInput="true"></u-number-box> | |
| 29 | - </view> | |
| 30 | - </view> | |
| 31 | - </view> | |
| 32 | - </view> | |
| 33 | - <!-- 占位盒子 --> | |
| 34 | - <view class="company-clean-container-car-popup-button-safe"> | |
| 35 | - <view class="company-clean-container-car-popup-button-safe-btn"> | |
| 36 | - <u-button type="primary" color="#19a97c" @click="submitUpdateCarInfo">确定</u-button> | |
| 37 | - </view> | |
| 38 | - </view> | |
| 39 | - </view> | |
| 40 | - </u-popup> | |
| 41 | - <view class="order-detail-container" v-if="dataGram != null || dataGram != undefined"> | |
| 42 | - <view class="order-detail-container-box"> | |
| 43 | - <view class="order-detail-top"> | |
| 44 | - <view class="order-detail-top-box"> | |
| 45 | - <view class="order-detail-top-box-step"> | |
| 46 | - <u-steps :current="currentStep(dataGram.garOrderHandlerStatus)" dot> | |
| 47 | - <u-steps-item title="待清运"></u-steps-item> | |
| 48 | - <u-steps-item title="清运中"></u-steps-item> | |
| 49 | - <u-steps-item title="已完成"></u-steps-item> | |
| 50 | - </u-steps> | |
| 51 | - </view> | |
| 52 | - </view> | |
| 53 | - </view> | |
| 54 | - <!-- 信息提示 --> | |
| 55 | - <view class="order-detail-container-box-card"> | |
| 56 | - <text v-if="dataGram.garCancelFlag == 0" style="color: red;">请于交易完成后线下支付!!</text> | |
| 57 | - <view v-else style="display: flex; color:red;"> | |
| 58 | - <u-icon name="close-circle" color="red"></u-icon> | |
| 59 | - <text> 订单已被取消!原因:{{ dataGram.garReason }}</text> | |
| 60 | - </view> | |
| 61 | - </view> | |
| 62 | - <!-- 订单信息 --> | |
| 3 | + <clashDriverDispatch ref="clashDriverDispatchRef" :valueKey="'licensePlateNumber'" | |
| 4 | + :onconfirm="handleDriverDispatchConfirm" :dataList="driverPersonnelList"> | |
| 5 | + </clashDriverDispatch> | |
| 6 | + <clashDisposalDispatch ref="clashDisposalDispatchRef" :valueKey="'companyName'" | |
| 7 | + :onconfirm="handleDisposalDispatchConfirm" :dataList="driverPersonnelList"> | |
| 8 | + </clashDisposalDispatch> | |
| 9 | + <u-popup :zIndex="10074" closeOnClickOverlay :show="carPopupShowFlag" :round="10" @close="handlePopupClick(false)" | |
| 10 | + @open="handlePopupClick(true)"> | |
| 11 | + <view class="company-clean-container-car-popup"> | |
| 12 | + <!-- 主要内容 --> | |
| 13 | + <view class="company-clean-container-car-popup-content"> | |
| 14 | + <view class="company-clean-container-car-popup-content-title"> | |
| 15 | + <view style="text-align: center;"> | |
| 16 | + 车辆类型 | |
| 17 | + </view> | |
| 18 | + </view> | |
| 19 | + <view class="company-clean-container-car-popup-content-box"> | |
| 20 | + <view class="company-clean-container-car-popup-content-box-item" | |
| 21 | + v-for="(item, index) in garCarInfoList" :key="index"> | |
| 22 | + <view class="company-clean-container-car-popup-content-box-item-text"> | |
| 23 | + {{ item.garOrderCarType }} | |
| 24 | + </view> | |
| 25 | + <view class="company-clean-container-car-popup-content-box-item-number" | |
| 26 | + hover-class="hoverClickStyle"> | |
| 27 | + <u-number-box :min="1" :max="9999" integer buttonSize="46" :inputWidth="100" | |
| 28 | + v-model="garCarInfoList[item.garOrderCarType].garOrderCarNumber" | |
| 29 | + :disabledInput="true"></u-number-box> | |
| 30 | + </view> | |
| 31 | + </view> | |
| 32 | + </view> | |
| 33 | + </view> | |
| 34 | + <!-- 占位盒子 --> | |
| 35 | + <view class="company-clean-container-car-popup-button-safe"> | |
| 36 | + <view class="company-clean-container-car-popup-button-safe-btn"> | |
| 37 | + <u-button type="primary" color="#19a97c" @click="submitUpdateCarInfo">确定</u-button> | |
| 38 | + </view> | |
| 39 | + </view> | |
| 40 | + </view> | |
| 41 | + </u-popup> | |
| 42 | + <view class="order-detail-container" v-if="dataGram != null || dataGram != undefined"> | |
| 43 | + <view class="order-detail-container-box"> | |
| 44 | + <view class="order-detail-top"> | |
| 45 | + <view class="order-detail-top-box"> | |
| 46 | + <view class="order-detail-top-box-step"> | |
| 47 | + <u-steps :current="currentStep(dataGram.garOrderHandlerStatus)" dot> | |
| 48 | + <u-steps-item title="待清运"></u-steps-item> | |
| 49 | + <u-steps-item title="清运中"></u-steps-item> | |
| 50 | + <u-steps-item title="已完成"></u-steps-item> | |
| 51 | + </u-steps> | |
| 52 | + </view> | |
| 53 | + </view> | |
| 54 | + </view> | |
| 55 | + <!-- 信息提示 --> | |
| 56 | + <view class="order-detail-container-box-card"> | |
| 57 | + <text v-if="dataGram.garCancelFlag == 0" style="color: red;">请于交易完成后线下支付!!</text> | |
| 58 | + <view v-else style="display: flex; color:red;"> | |
| 59 | + <u-icon name="close-circle" color="red"></u-icon> | |
| 60 | + <text> 订单已被取消!原因:{{ dataGram.garReason }}</text> | |
| 61 | + </view> | |
| 62 | + </view> | |
| 63 | + <!-- 订单信息 --> | |
| 63 | 64 | <view class="order-detail-container-box-card order-info-section"> |
| 64 | 65 | <view class="order-info-header"> |
| 65 | 66 | <view class="order-detail-container-header-card-uicon"></view> |
| ... | ... | @@ -133,9 +134,9 @@ |
| 133 | 134 | </view> |
| 134 | 135 | </view> |
| 135 | 136 | </view> |
| 136 | - <!-- 车辆信息 --> | |
| 137 | + <!-- 车辆信息 --> | |
| 137 | 138 | |
| 138 | - <view class="order-detail-container-box-card vehicle-section"> | |
| 139 | + <view class="order-detail-container-box-card vehicle-section" v-if="userType !== '用户'"> | |
| 139 | 140 | <view class="section-header"> |
| 140 | 141 | <view class="header-icon-bar"></view> |
| 141 | 142 | <u-icon name="car" size="22" color="#fff" style="margin-right: 10rpx;"></u-icon> |
| ... | ... | @@ -172,31 +173,7 @@ |
| 172 | 173 | </view> |
| 173 | 174 | </view> |
| 174 | 175 | |
| 175 | - <view class="driver-info-card" v-if="driverList.length > 0"> | |
| 176 | - <view class="card-header"> | |
| 177 | - <u-icon name="account" size="18" color="#19a97c"></u-icon> | |
| 178 | - <text class="card-title">驾驶员信息</text> | |
| 179 | - </view> | |
| 180 | - <view class="driver-list"> | |
| 181 | - <view class="driver-item" v-for="(driver, index) in driverList" :key="index"> | |
| 182 | - <view class="driver-basic-info"> | |
| 183 | - <u-icon name="account" size="16" color="#19a97c"></u-icon> | |
| 184 | - <text class="info-label">驾驶员:</text> | |
| 185 | - <text class="info-value">{{ driver.garOrderHandlerName }}</text> | |
| 186 | - </view> | |
| 187 | - <view class="driver-car-info"> | |
| 188 | - <u-icon name="car" size="16" color="#19a97c"></u-icon> | |
| 189 | - <text class="info-label">车牌号:</text> | |
| 190 | - <text class="info-value">{{ driver.garHandlerCarCode }}</text> | |
| 191 | - </view> | |
| 192 | - <view class="driver-status"> | |
| 193 | - <u-tag text="正在清运" type="success" size="mini" /> | |
| 194 | - </view> | |
| 195 | - </view> | |
| 196 | - </view> | |
| 197 | - </view> | |
| 198 | - | |
| 199 | - <view class="handler-list-card"> | |
| 176 | + <view class="handler-list-card" > | |
| 200 | 177 | <view class="card-header"> |
| 201 | 178 | <u-icon name="list" size="18" color="#19a97c"></u-icon> |
| 202 | 179 | <text class="card-title">处理人员信息</text> |
| ... | ... | @@ -207,101 +184,38 @@ |
| 207 | 184 | <text class="handler-car">{{ item.garHandlerCarCode }}</text> |
| 208 | 185 | <text class="handler-volume">{{ item.garOrderContainerVolume }}</text> |
| 209 | 186 | </view> |
| 210 | - <view class="handler-trip-count"> | |
| 211 | - <text class="count-label">趟次:</text> | |
| 212 | - <text class="count-value">{{ item.garCarCount }}车</text> | |
| 213 | - </view> | |
| 214 | - </view> | |
| 215 | - </view> | |
| 216 | - | |
| 217 | - <view class="assign-trip-card" v-if="userType == '运输企业负责人'"> | |
| 218 | - <view class="card-header"> | |
| 219 | - <u-icon name="edit-pen" size="18" color="#19a97c"></u-icon> | |
| 220 | - <text class="card-title">分配趟次</text> | |
| 221 | - </view> | |
| 222 | - <view class="assign-content"> | |
| 223 | - <view class="selector-wrapper"> | |
| 224 | - <text class="selector-label">分配人员:</text> | |
| 225 | - <select v-model="selectedHandlerTel" class="handler-selector"> | |
| 226 | - <option value="">请选择分配人员</option> | |
| 227 | - <option value="ADD_TOTAL_TRIPS">新增总趟次</option> | |
| 228 | - <option | |
| 229 | - v-for="handler in handlerList" | |
| 230 | - :key="handler.garOrderHandlerTel" | |
| 231 | - :value="handler.garOrderHandlerTel"> | |
| 232 | - {{ handler.garOrderHandlerName }} | |
| 233 | - </option> | |
| 234 | - </select> | |
| 235 | - </view> | |
| 236 | - | |
| 237 | - <view class="number-box-wrapper"> | |
| 238 | - <text class="number-label">趟次数量:</text> | |
| 239 | - <u-number-box | |
| 240 | - v-model="carCount" | |
| 241 | - :min="0" | |
| 242 | - :max="999" | |
| 243 | - integer | |
| 244 | - buttonSize="46" | |
| 245 | - inputWidth="70"> | |
| 246 | - </u-number-box> | |
| 247 | - </view> | |
| 248 | - | |
| 249 | - <u-button | |
| 250 | - type="success" | |
| 251 | - class="confirm-button" | |
| 252 | - @click="confirmAddVehicle" | |
| 253 | - :disabled="!isDriverAssigned"> | |
| 254 | - 确定 | |
| 255 | - </u-button> | |
| 256 | - </view> | |
| 257 | - </view> | |
| 258 | - | |
| 259 | - <view class="assign-trip-card" v-if="dataGram.garEvaluateFlag !== 0 && userType === '用户'"> | |
| 260 | - <view class="card-header"> | |
| 261 | - <u-icon name="edit-pen" size="18" color="#19a97c"></u-icon> | |
| 262 | - <text class="card-title">新增车辆</text> | |
| 263 | - </view> | |
| 264 | - <view class="assign-content"> | |
| 265 | - <view class="selector-wrapper"> | |
| 266 | - <text class="selector-label">新增车辆:</text> | |
| 267 | - <select v-model="selectedHandlerTels" class="handler-selector"> | |
| 268 | - <option value="">请选择新增车型</option> | |
| 269 | - <option | |
| 270 | - v-for="car in garCarTypeList" | |
| 271 | - :key="car.garOrderCarType" | |
| 272 | - :value="car.garOrderCarType"> | |
| 273 | - {{ car.garOrderCarType }} | |
| 274 | - </option> | |
| 275 | - </select> | |
| 276 | - </view> | |
| 277 | - | |
| 278 | - <view class="number-box-wrapper"> | |
| 279 | - <text class="number-label">趟次数量:</text> | |
| 187 | + <view class="handler-trip-controls"> | |
| 280 | 188 | <u-number-box |
| 281 | - v-model="carCount" | |
| 189 | + v-model="item.carCountInput" | |
| 282 | 190 | :min="0" |
| 283 | 191 | :max="999" |
| 284 | 192 | integer |
| 285 | - buttonSize="46" | |
| 286 | - inputWidth="70"> | |
| 193 | + buttonSize="30" | |
| 194 | + inputWidth="50"> | |
| 287 | 195 | </u-number-box> |
| 196 | + <u-button | |
| 197 | + type="success" | |
| 198 | + size="mini" | |
| 199 | + class="assign-button" | |
| 200 | + @click="assignTripToHandler(item)"> | |
| 201 | + {{ item.garCarCount && item.garCarCount > 0 ? '修改' : '分配' }} | |
| 202 | + </u-button> | |
| 203 | + <u-button | |
| 204 | + type="error" | |
| 205 | + size="mini" | |
| 206 | + class="delete-button" | |
| 207 | + @click="deleteHandler(item)"> | |
| 208 | + 删除 | |
| 209 | + </u-button> | |
| 288 | 210 | </view> |
| 289 | - | |
| 290 | - <u-button | |
| 291 | - type="success" | |
| 292 | - class="confirm-button" | |
| 293 | - @click="confirmAddVehicles" | |
| 294 | - > | |
| 295 | - 确定 | |
| 296 | - </u-button> | |
| 297 | 211 | </view> |
| 298 | 212 | </view> |
| 299 | - </view> | |
| 213 | + </view> | |
| 300 | 214 | |
| 301 | 215 | |
| 302 | 216 | |
| 303 | 217 | <!-- 订单人员 --> |
| 304 | - <view class="order-detail-container-box-card order-person-section"> | |
| 218 | + <view class="order-detail-container-box-card order-person-section" v-if="userType !== '用户'"> | |
| 305 | 219 | <view class="section-header"> |
| 306 | 220 | <view class="header-icon-bar"></view> |
| 307 | 221 | <u-icon name="account" size="22" color="#fff" style="margin-right: 8rpx;"></u-icon> |
| ... | ... | @@ -390,8 +304,8 @@ |
| 390 | 304 | <text class="empty-text">暂无处理照片</text> |
| 391 | 305 | </view> |
| 392 | 306 | </view> |
| 393 | - <view class="space-box">{{ spaceStr }}</view> | |
| 394 | - </view> | |
| 307 | + <view class="space-box">{{ spaceStr }}</view> | |
| 308 | + </view> | |
| 395 | 309 | |
| 396 | 310 | <!-- 占位符 --> |
| 397 | 311 | <view class="order-detail-bottom"> |
| ... | ... | @@ -449,15 +363,15 @@ |
| 449 | 363 | </view> |
| 450 | 364 | </view> |
| 451 | 365 | </view> |
| 452 | - <u-action-sheet :closeOnClickOverlay="true" :closeOnClickAction="false" @actionSheetClose="handleClose" | |
| 453 | - @submitFunction="submitFunction" @select="selectClick" :actions="list" round="15" title="取消订单" | |
| 454 | - :show="cancelShow"> | |
| 455 | - </u-action-sheet> | |
| 456 | - </view> | |
| 457 | - <view v-if="showUQRcode" class="mask-container" @click="showUQRcode = false"> | |
| 458 | - <uqrcode :h5SaveIsDownload="true" ref="qrCodeRef" canvas-id="qrcode" :value="qrCodeText" | |
| 459 | - :options="{ margin: 10, boxSizing: borderBox }"></uqrcode> | |
| 460 | - </view> | |
| 366 | + <u-action-sheet :closeOnClickOverlay="true" :closeOnClickAction="false" @actionSheetClose="handleClose" | |
| 367 | + @submitFunction="submitFunction" @select="selectClick" :actions="list" round="15" title="取消订单" | |
| 368 | + :show="cancelShow"> | |
| 369 | + </u-action-sheet> | |
| 370 | + </view> | |
| 371 | + <view v-if="showUQRcode" class="mask-container" @click="showUQRcode = false"> | |
| 372 | + <uqrcode :h5SaveIsDownload="true" ref="qrCodeRef" canvas-id="qrcode" :value="qrCodeText" | |
| 373 | + :options="{ margin: 10, boxSizing: borderBox }"></uqrcode> | |
| 374 | + </view> | |
| 461 | 375 | |
| 462 | 376 | <u-popup :zIndex="10075" closeOnClickOverlay :show="driverListPopupShowFlag" :round="10" @close="driverListPopupShowFlag = false"> |
| 463 | 377 | <view class="driver-list-popup"> |
| ... | ... | @@ -480,1820 +394,2021 @@ |
| 480 | 394 | </u-popup> |
| 481 | 395 | </template> |
| 482 | 396 | |
| 483 | -<script setup> | |
| 484 | - import { | |
| 485 | - queryCarList | |
| 486 | - } from '@/apis/carinfo.js'; | |
| 487 | - import { | |
| 488 | - dispatchDisposalOrders, | |
| 489 | - dispatchOrders, | |
| 490 | - getGarOrderMatchHandlers, | |
| 491 | - queryDisposalDispatch, | |
| 492 | - queryOrderDetail, | |
| 493 | - queryOrderDispatch, | |
| 494 | - sendToDriver, | |
| 495 | - updateGarRealCarCount, | |
| 496 | - updateOrder, | |
| 497 | - queryCarCode, | |
| 498 | - queryByOrderNo, | |
| 499 | - updateCarCount, | |
| 500 | - queryGarRealCarCountByGarOrderNo, | |
| 501 | - selectGarOrderCar, | |
| 502 | - insertRandomCopyByTypeAndOrderId | |
| 503 | - } from "@/apis/order.js"; | |
| 504 | - import { | |
| 505 | - createQrCode | |
| 506 | - } from '@/apis/qrcode.js'; | |
| 507 | - import uqrcode from '@/components/Sansnn-uQRCode_4.0.6/components/uqrcode/uqrcode.vue'; | |
| 508 | - import clashDisposalDispatch from '@/components/clash-disposal-dispatch/index.vue'; | |
| 509 | - import clashDriverDispatch from '@/components/clash-driver-dispatch/index.vue'; | |
| 510 | - import zStatic from '@/components/z-paging/js/z-paging-static'; | |
| 511 | - import { | |
| 512 | - useMainStore | |
| 513 | - } from '@/stores/index.js'; | |
| 514 | - import { | |
| 515 | - onLoad, | |
| 516 | - onShow | |
| 517 | - } from '@dcloudio/uni-app'; | |
| 518 | - import { | |
| 519 | - computed, watch | |
| 520 | - } from 'vue'; | |
| 521 | - import { ref } from 'vue'; | |
| 522 | - const paramFrom = ref({ | |
| 523 | - carNumber: 0, | |
| 524 | - carType: "" | |
| 525 | - }) | |
| 526 | - const totalCarNumber = ref(0); | |
| 527 | - const driverListPopupShowFlag = ref(false); | |
| 528 | - const driverListForAssignment = ref([]); | |
| 529 | - const garCarInfoList = ref({}) | |
| 530 | - const carPopupShowFlag = ref(false) | |
| 531 | - const driverList = ref([]); | |
| 532 | - const isOnloadIn = ref(false) | |
| 533 | - const clashDriverDispatchRef = ref() | |
| 534 | - const clashDisposalDispatchRef = ref() | |
| 535 | - const driverPersonnelList = ref([]) | |
| 536 | - const disposalPersonnelList = ref([]) | |
| 537 | - const handlerList = ref([]) | |
| 538 | - const orderNo = ref(null) | |
| 539 | - const carCount = ref(null) | |
| 540 | - const tel = ref(null) | |
| 541 | - const selectedHandlerTel = ref("") | |
| 542 | - const realCarCount = ref(null) | |
| 543 | - const store = useMainStore(); | |
| 544 | - const userType = computed(() => store.userType) | |
| 545 | - const dataGram = ref(); | |
| 546 | - const orderId = ref(null) | |
| 547 | - const currentImages = ref([]) | |
| 548 | - const putOnImages = ref([]) | |
| 549 | - const putOnImagesGrouped = ref([]) // 新增这个变量 | |
| 550 | - const putDownImages = ref([]) | |
| 551 | - const emptyBase64Image = ref(zStatic.base64Empty) | |
| 552 | - const showUQRcode = ref(false) | |
| 553 | - const spaceStr = ref("") | |
| 554 | - const cancelShow = ref(false) | |
| 555 | - const currentCancelName = ref("") | |
| 556 | - const qrCodeRef = ref() | |
| 557 | - const qrCodeText = ref() | |
| 558 | - const candidates = ref([]) | |
| 559 | - const garCarLabelInfoList = ref({}) | |
| 560 | - const garCarLabelInfoNow = ref() | |
| 561 | - const selectedHandlerTels = ref("") | |
| 562 | - const garCarTypeList = ref([]) | |
| 563 | - const driverAssigned = ref(false); // 添加这行,跟踪驾驶员是否已分配 | |
| 564 | - const disposalAssigned = ref(false); // 添加这行,跟踪处置场所是否已分配 | |
| 565 | - | |
| 566 | - | |
| 567 | - const isInTransit = (index) => { | |
| 568 | - // 如果订单已完成,所有趟次都不是"清运中" | |
| 569 | - if (dataGram.value.garOrderHandlerStatus === 3) { | |
| 570 | - return false; | |
| 571 | - } | |
| 397 | +<script setup>import { | |
| 398 | + queryCarList | |
| 399 | +} from '@/apis/carinfo.js'; | |
| 400 | +import { | |
| 401 | + dispatchDisposalOrders, | |
| 402 | + dispatchOrders, | |
| 403 | + getGarOrderMatchHandlers, | |
| 404 | + queryDisposalDispatch, | |
| 405 | + queryOrderDetail, | |
| 406 | + queryOrderDispatch, | |
| 407 | + sendToDriver, | |
| 408 | + updateGarRealCarCount, | |
| 409 | + updateOrder, | |
| 410 | + queryCarCode, | |
| 411 | + queryByOrderNo, | |
| 412 | + updateCarCount, | |
| 413 | + queryGarRealCarCountByGarOrderNo, | |
| 414 | + selectGarOrderCar, | |
| 415 | + insertRandomCopyByTypeAndOrderId, deleteDriverByOrderNo | |
| 416 | +} from "@/apis/order.js"; | |
| 417 | +import { | |
| 418 | + createQrCode | |
| 419 | +} from '@/apis/qrcode.js'; | |
| 420 | +import uqrcode from '@/components/Sansnn-uQRCode_4.0.6/components/uqrcode/uqrcode.vue'; | |
| 421 | +import clashDisposalDispatch from '@/components/clash-disposal-dispatch/index.vue'; | |
| 422 | +import clashDriverDispatch from '@/components/clash-driver-dispatch/index.vue'; | |
| 423 | +import zStatic from '@/components/z-paging/js/z-paging-static'; | |
| 424 | +import { | |
| 425 | + useMainStore | |
| 426 | +} from '@/stores/index.js'; | |
| 427 | +import { | |
| 428 | + onLoad, | |
| 429 | + onShow | |
| 430 | +} from '@dcloudio/uni-app'; | |
| 431 | +import { | |
| 432 | + computed, watch | |
| 433 | +} from 'vue'; | |
| 434 | +import { ref } from 'vue'; | |
| 435 | +const paramFrom = ref({ | |
| 436 | + carNumber: 0, | |
| 437 | + carType: "" | |
| 438 | +}) | |
| 439 | +const totalCarNumber = ref(0); | |
| 440 | +const driverListPopupShowFlag = ref(false); | |
| 441 | +const driverListForAssignment = ref([]); | |
| 442 | +const garCarInfoList = ref({}) | |
| 443 | +const carPopupShowFlag = ref(false) | |
| 444 | +const driverList = ref([]); | |
| 445 | +const isOnloadIn = ref(false) | |
| 446 | +const clashDriverDispatchRef = ref() | |
| 447 | +const clashDisposalDispatchRef = ref() | |
| 448 | +const driverPersonnelList = ref([]) | |
| 449 | +const disposalPersonnelList = ref([]) | |
| 450 | +const handlerList = ref([]) | |
| 451 | +const orderNo = ref(null) | |
| 452 | +const carCount = ref(null) | |
| 453 | +const tel = ref(null) | |
| 454 | +const selectedHandlerTel = ref("") | |
| 455 | +const realCarCount = ref(null) | |
| 456 | +const store = useMainStore(); | |
| 457 | +const userType = computed(() => store.userType) | |
| 458 | +const dataGram = ref(); | |
| 459 | +const orderId = ref(null) | |
| 460 | +const currentImages = ref([]) | |
| 461 | +const putOnImages = ref([]) | |
| 462 | +const putOnImagesGrouped = ref([]) // 新增这个变量 | |
| 463 | +const putDownImages = ref([]) | |
| 464 | +const emptyBase64Image = ref(zStatic.base64Empty) | |
| 465 | +const showUQRcode = ref(false) | |
| 466 | +const spaceStr = ref("") | |
| 467 | +const cancelShow = ref(false) | |
| 468 | +const currentCancelName = ref("") | |
| 469 | +const qrCodeRef = ref() | |
| 470 | +const qrCodeText = ref() | |
| 471 | +const candidates = ref([]) | |
| 472 | +const garCarLabelInfoList = ref({}) | |
| 473 | +const garCarLabelInfoNow = ref() | |
| 474 | +const selectedHandlerTels = ref("") | |
| 475 | +const garCarTypeList = ref([]) | |
| 476 | +const driverAssigned = ref(false); // 添加这行,跟踪驾驶员是否已分配 | |
| 477 | +const disposalAssigned = ref(false); // 添加这行,跟踪处置场所是否已分配 | |
| 478 | +// 新增:用于存储待分配的驾驶员列表 | |
| 479 | +const pendingDriverAssignments = ref({}) | |
| 480 | + | |
| 481 | + | |
| 482 | +const isInTransit = (index) => { | |
| 483 | + // 如果订单已完成,所有趟次都不是"清运中" | |
| 484 | + if (dataGram.value.garOrderHandlerStatus === 3) { | |
| 485 | + return false; | |
| 486 | + } | |
| 572 | 487 | |
| 573 | - // 当前正在清运的趟次索引(从1开始) | |
| 574 | - const currentTransitIndex = putOnImagesGrouped.value.length; | |
| 488 | + // 当前正在清运的趟次索引(从1开始) | |
| 489 | + const currentTransitIndex = putOnImagesGrouped.value.length; | |
| 575 | 490 | |
| 576 | - // 只有当前趟次是"清运中" | |
| 577 | - return index === currentTransitIndex; | |
| 578 | - }; | |
| 491 | + // 只有当前趟次是"清运中" | |
| 492 | + return index === currentTransitIndex; | |
| 493 | +}; | |
| 579 | 494 | |
| 580 | - const isCompleted = (index) => { | |
| 581 | - // 如果订单已完成,所有趟次都是"已运完" | |
| 582 | - if (dataGram.value.garOrderHandlerStatus === 3) { | |
| 583 | - return true; | |
| 584 | - } | |
| 495 | +const isCompleted = (index) => { | |
| 496 | + // 如果订单已完成,所有趟次都是"已运完" | |
| 497 | + if (dataGram.value.garOrderHandlerStatus === 3) { | |
| 498 | + return true; | |
| 499 | + } | |
| 585 | 500 | |
| 586 | - // 已完成的趟次索引小于当前正在清运的趟次索引 | |
| 587 | - const currentTransitIndex = putOnImagesGrouped.value.length; | |
| 501 | + // 已完成的趟次索引小于当前正在清运的趟次索引 | |
| 502 | + const currentTransitIndex = putOnImagesGrouped.value.length; | |
| 588 | 503 | |
| 589 | - return index < currentTransitIndex; | |
| 590 | - }; | |
| 504 | + return index < currentTransitIndex; | |
| 505 | +}; | |
| 591 | 506 | |
| 592 | - const getStatusText = (index) => { | |
| 593 | - // 如果订单已完成,显示"已运完" | |
| 594 | - if (dataGram.value.garOrderHandlerStatus === 3) { | |
| 595 | - return '已运完'; | |
| 596 | - } | |
| 507 | +const getStatusText = (index) => { | |
| 508 | + // 如果订单已完成,显示"已运完" | |
| 509 | + if (dataGram.value.garOrderHandlerStatus === 3) { | |
| 510 | + return '已运完'; | |
| 511 | + } | |
| 597 | 512 | |
| 598 | - // 当前正在清运的趟次索引(从1开始) | |
| 599 | - const currentTransitIndex = putOnImagesGrouped.value.length; | |
| 513 | + // 当前正在清运的趟次索引(从1开始) | |
| 514 | + const currentTransitIndex = putOnImagesGrouped.value.length; | |
| 600 | 515 | |
| 601 | - if (index === currentTransitIndex) { | |
| 602 | - return '正在清运'; | |
| 603 | - } else if (index < currentTransitIndex) { | |
| 604 | - return '已运完'; | |
| 605 | - } else { | |
| 606 | - return '正在清运'; | |
| 516 | + if (index === currentTransitIndex) { | |
| 517 | + return '正在清运'; | |
| 518 | + } else if (index < currentTransitIndex) { | |
| 519 | + return '已运完'; | |
| 520 | + } else { | |
| 521 | + return '正在清运'; | |
| 522 | + } | |
| 523 | +}; | |
| 524 | + | |
| 525 | +const list = computed(() => { | |
| 526 | + let reason = [{ | |
| 527 | + name: '订单信息填写有误', | |
| 528 | + }, | |
| 529 | + { | |
| 530 | + name: '线下协商有问题', | |
| 531 | + }, | |
| 532 | + { | |
| 533 | + name: '不需要清运了', | |
| 534 | + }, | |
| 535 | + { | |
| 536 | + name: '其他', | |
| 537 | + }, | |
| 538 | + { | |
| 539 | + name: '提交', | |
| 607 | 540 | } |
| 608 | - }; | |
| 609 | - | |
| 610 | - const list = computed(() => { | |
| 611 | - let reason = [{ | |
| 612 | - name: '订单信息填写有误', | |
| 613 | - }, | |
| 614 | - { | |
| 615 | - name: '线下协商有问题', | |
| 616 | - }, | |
| 617 | - { | |
| 618 | - name: '不需要清运了', | |
| 619 | - }, | |
| 620 | - { | |
| 621 | - name: '其他', | |
| 622 | - }, | |
| 623 | - { | |
| 624 | - name: '提交', | |
| 625 | - } | |
| 626 | - ] | |
| 627 | - if (userType.value === '用户') { | |
| 628 | - reason.unshift({ | |
| 629 | - name: '长时间无人接单', | |
| 630 | - }) | |
| 631 | - } | |
| 632 | - return reason | |
| 633 | - }) | |
| 634 | - | |
| 635 | - const isDriverAssigned = computed(() => { | |
| 636 | - // 检查是否有分配的驾驶员 | |
| 637 | - return handlerList.value && handlerList.value.length > 0; | |
| 638 | - }); | |
| 639 | - const isDriverAndDisposalAssigned = () => { | |
| 640 | - // 直接使用已有的响应式变量来判断分配状态 | |
| 641 | - const hasDrivers = driverAssigned.value; | |
| 642 | - const hasDisposalSites = disposalAssigned.value; | |
| 643 | - | |
| 644 | - return hasDrivers && hasDisposalSites; | |
| 645 | - }; | |
| 541 | + ] | |
| 542 | + if (userType.value === '用户') { | |
| 543 | + reason.unshift({ | |
| 544 | + name: '长时间无人接单', | |
| 545 | + }) | |
| 546 | + } | |
| 547 | + return reason | |
| 548 | +}) | |
| 549 | + | |
| 550 | +const isDriverAssigned = computed(() => { | |
| 551 | + // 检查是否有分配的驾驶员 | |
| 552 | + return handlerList.value && handlerList.value.length > 0; | |
| 553 | +}); | |
| 554 | +const isDriverAndDisposalAssigned = () => { | |
| 555 | + // 直接使用已有的响应式变量来判断分配状态 | |
| 556 | + const hasDrivers = driverAssigned.value || (pendingDriverAssignments.value && Object.keys(pendingDriverAssignments.value).length > 0); | |
| 557 | + const hasDisposalSites = disposalAssigned.value; | |
| 558 | + | |
| 559 | + return hasDrivers && hasDisposalSites; | |
| 560 | +}; | |
| 561 | + | |
| 562 | +const isAllTripsCompleted = () => { | |
| 563 | + // 检查所有趟次是否已完成 | |
| 564 | + if (!dataGram.value || !dataGram.value.garCarInfoList || !putOnImagesGrouped.value) { | |
| 565 | + return false; | |
| 566 | + } | |
| 646 | 567 | |
| 647 | - const isAllTripsCompleted = () => { | |
| 648 | - // 检查所有趟次是否已完成 | |
| 649 | - if (!dataGram.value || !dataGram.value.garCarInfoList || !putOnImagesGrouped.value) { | |
| 650 | - return false; | |
| 651 | - } | |
| 568 | + // 获取订单要求的趟次数 | |
| 569 | + const requiredTrips = dataGram.value.garCarInfoList.length; | |
| 652 | 570 | |
| 653 | - // 获取订单要求的趟次数 | |
| 654 | - const requiredTrips = dataGram.value.garCarInfoList.length; | |
| 571 | + // 获取实际完成的趟次数 | |
| 572 | + const completedTrips = putOnImagesGrouped.value.length; | |
| 655 | 573 | |
| 656 | - // 获取实际完成的趟次数 | |
| 657 | - const completedTrips = putOnImagesGrouped.value.length; | |
| 574 | + // 如果完成的趟次数大于等于要求的趟次数,则表示全部运完 | |
| 575 | + console.log("实际完成次数" + completedTrips + "要求次数" + requiredTrips) | |
| 576 | + return completedTrips >= requiredTrips; | |
| 577 | +} | |
| 658 | 578 | |
| 659 | - // 如果完成的趟次数大于等于要求的趟次数,则表示全部运完 | |
| 660 | - console.log("实际完成次数" + completedTrips + "要求次数" + requiredTrips) | |
| 661 | - return completedTrips >= requiredTrips; | |
| 662 | - } | |
| 579 | +const assignTripToDriver = ()=>{ | |
| 580 | + sendToDriver(orderId.value).then(res=>{ | |
| 581 | + if (res.data.success) { | |
| 582 | + uni.$u.toast('分配成功'); | |
| 583 | + } | |
| 584 | + }) | |
| 585 | +} | |
| 586 | +// 获取驾驶员列表的方法 | |
| 587 | +const fetchDriverList = (orderId) => { | |
| 588 | + queryCarCode(orderId).then(res => { | |
| 589 | + if (res.data.success) { | |
| 590 | + driverList.value = res.data.data; | |
| 591 | + } | |
| 592 | + }); | |
| 593 | +}; | |
| 594 | + | |
| 595 | +watch(selectedHandlerTel, (newVal) => { | |
| 596 | + tel.value = newVal; | |
| 597 | +}); | |
| 598 | + | |
| 599 | +const refreshOrderData = () => { | |
| 600 | + // 刷新处理人员列表 | |
| 601 | + queryByOrderNo(orderNo.value).then(res => { | |
| 602 | + if (res.data.success) { | |
| 603 | + handlerList.value = res.data.data | |
| 604 | + // 为每个处理人员初始化输入框的值 | |
| 605 | + handlerList.value.forEach(handler => { | |
| 606 | + // 将已分配的趟次数量作为初始值 | |
| 607 | + handler.carCountInput = handler.garCarCount || 0; | |
| 608 | + }); | |
| 609 | + } | |
| 610 | + }).catch(err => { | |
| 611 | + console.error('获取订单信息失败:', err); | |
| 612 | + }) | |
| 613 | + | |
| 614 | + // 刷新总趟次数 | |
| 615 | + queryGarRealCarCountByGarOrderNo(orderNo.value).then(res => { | |
| 616 | + if (res.data.success) { | |
| 617 | + realCarCount.value = res.data.data | |
| 618 | + } | |
| 619 | + }) | |
| 663 | 620 | |
| 664 | - const assignTripToDriver = ()=>{ | |
| 665 | - sendToDriver(orderId.value).then(res=>{ | |
| 666 | - if (res.data.success) { | |
| 667 | - uni.$u.toast('分配成功'); | |
| 668 | - } | |
| 669 | - }) | |
| 621 | + selectGarOrderCar(orderNo.value).then(res => { | |
| 622 | + if (res.data.success) { | |
| 623 | + garCarTypeList.value = res.data.data | |
| 624 | + } | |
| 625 | + }) | |
| 626 | +}; | |
| 627 | + | |
| 628 | +const onCarCountChange = (e, handler) => { | |
| 629 | + handler.carCountInput = e.value; | |
| 630 | +}; | |
| 631 | + | |
| 632 | +const assignTripToHandler = (handler) => { | |
| 633 | + // 检查必填字段 | |
| 634 | + if (handler.carCountInput === undefined || handler.carCountInput === null) { | |
| 635 | + uni.$u.toast(`请输入分配的趟次!`); | |
| 636 | + return; | |
| 670 | 637 | } |
| 671 | - // 获取驾驶员列表的方法 | |
| 672 | - const fetchDriverList = (orderId) => { | |
| 673 | - queryCarCode(orderId).then(res => { | |
| 674 | - if (res.data.success) { | |
| 675 | - driverList.value = res.data.data; | |
| 676 | - } | |
| 677 | - }); | |
| 678 | - }; | |
| 679 | 638 | |
| 680 | - watch(selectedHandlerTel, (newVal) => { | |
| 681 | - tel.value = newVal; | |
| 682 | - }); | |
| 639 | + // 确保输入的是非负整数 | |
| 640 | + if (handler.carCountInput < 0) { | |
| 641 | + uni.$u.toast(`分配趟次不能为负数!`); | |
| 642 | + handler.carCountInput = handler.garCarCount || 0; | |
| 643 | + return; | |
| 644 | + } | |
| 683 | 645 | |
| 684 | - const refreshOrderData = () => { | |
| 685 | - // 刷新处理人员列表 | |
| 686 | - queryByOrderNo(orderNo.value).then(res => { | |
| 687 | - if (res.data.success) { | |
| 688 | - handlerList.value = res.data.data | |
| 689 | - } | |
| 690 | - }).catch(err => { | |
| 691 | - console.error('获取订单信息失败:', err); | |
| 692 | - }) | |
| 646 | + // 获取当前已分配的趟次数 | |
| 647 | + const currentAllocated = handler.garCarCount || 0; | |
| 693 | 648 | |
| 694 | - // 刷新总趟次数 | |
| 695 | - queryGarRealCarCountByGarOrderNo(orderNo.value).then(res => { | |
| 696 | - if (res.data.success) { | |
| 697 | - realCarCount.value = res.data.data | |
| 698 | - } | |
| 699 | - }) | |
| 649 | + // 计算需要增加或减少的趟次数 | |
| 650 | + let delta = handler.carCountInput - currentAllocated; | |
| 700 | 651 | |
| 701 | - selectGarOrderCar(orderNo.value).then(res => { | |
| 702 | - if (res.data.success) { | |
| 703 | - garCarTypeList.value = res.data.data | |
| 704 | - } | |
| 705 | - }) | |
| 706 | - }; | |
| 707 | - const confirmAddVehicles = () =>{ | |
| 708 | - const params = { | |
| 709 | - carCount: carCount.value, | |
| 710 | - tel: tel.value, | |
| 711 | - orderNo : orderNo.value, | |
| 712 | - orderCarType :selectedHandlerTels.value | |
| 713 | - }; | |
| 714 | - if(selectedHandlerTels.value === ""){ | |
| 715 | - uni.$u.toast(`请选择车型!`); | |
| 716 | - return; | |
| 717 | - } | |
| 718 | - insertRandomCopyByTypeAndOrderId(params).then(res => { | |
| 719 | - if (res.data.success) { | |
| 720 | - uni.$u.toast(`添加成功!`); | |
| 721 | - // 刷新订单详情 | |
| 722 | - handleOrderDetail(orderId.value); | |
| 723 | - refreshOrderData() | |
| 724 | - } else { | |
| 725 | - uni.$u.toast(`添加失败!`); | |
| 726 | - } | |
| 727 | - }) | |
| 652 | + // 如果没有变化则不处理 | |
| 653 | + if (delta === 0) { | |
| 654 | + uni.$u.toast('分配数量未发生变化'); | |
| 655 | + return; | |
| 728 | 656 | } |
| 729 | 657 | |
| 658 | + // 检查如果是增加操作,是否会超过总需求趟次 | |
| 659 | + if (delta > 0) { | |
| 660 | + // 检查已分配趟次总和是否超过订单要求的总发车次数(排除当前正在修改的人员) | |
| 661 | + const allocatedTrips = handlerList.value.reduce((sum, h) => { | |
| 662 | + // 如果是当前正在操作的handler,就不要把它已有的趟次算进去 | |
| 663 | + if (h.garOrderHandlerTel === handler.garOrderHandlerTel) { | |
| 664 | + return sum; | |
| 665 | + } | |
| 666 | + return sum + parseInt(h.garCarCount || 0); | |
| 667 | + }, 0); | |
| 730 | 668 | |
| 669 | + const totalRequiredTrips = realCarCount.value || 0; | |
| 731 | 670 | |
| 732 | - const confirmAddVehicle = () => { | |
| 733 | - | |
| 734 | - // 检查必填字段 | |
| 735 | - if (!carCount.value) { | |
| 736 | - uni.$u.toast(`请选择分配的趟次!`); | |
| 737 | - return; | |
| 738 | - } | |
| 739 | - if (!tel.value) { | |
| 740 | - uni.$u.toast(`请选择分配人员!`); | |
| 671 | + if (allocatedTrips + handler.carCountInput > totalRequiredTrips) { | |
| 672 | + uni.$u.toast(`分配趟次过多,最多只能再分配${totalRequiredTrips - allocatedTrips}趟!`); | |
| 673 | + // 将输入框重置为之前的值 | |
| 674 | + handler.carCountInput = handler.garCarCount || 0; | |
| 741 | 675 | return; |
| 742 | 676 | } |
| 677 | + } | |
| 743 | 678 | |
| 679 | + // 调用API传递订单ID和车辆数量(传递差值,可能是负数) | |
| 680 | + const params = { | |
| 681 | + carCount: delta, // 传递差值,可能是正数(增加)或负数(减少) | |
| 682 | + tel: handler.garOrderHandlerTel, | |
| 683 | + orderNo : orderNo.value | |
| 684 | + }; | |
| 744 | 685 | |
| 745 | - if (selectedHandlerTel.value === 'ADD_TOTAL_TRIPS') { | |
| 746 | - updateGarRealCarCount(orderId.value, carCount.value) | |
| 747 | - .then(res => { | |
| 748 | - if (res.data.success) { | |
| 749 | - uni.$u.toast(`总趟次更新成功!`); | |
| 750 | - // 刷新订单详情 | |
| 751 | - handleOrderDetail(orderId.value); | |
| 752 | - refreshOrderData() | |
| 753 | - } else { | |
| 754 | - uni.$u.toast(`总趟次更新失败!`); | |
| 755 | - } | |
| 756 | - }) | |
| 757 | - .catch(err => { | |
| 758 | - uni.$u.toast('总趟次更新请求失败'); | |
| 759 | - console.error('总趟次更新失败:', err); | |
| 760 | - }); | |
| 761 | - return; | |
| 686 | + updateCarCount(params) | |
| 687 | + .then(res => { | |
| 688 | + if (res.data.success) { | |
| 689 | + if (delta === 0) { | |
| 690 | + uni.$u.toast('取消分配成功!'); | |
| 691 | + } else if (delta > 0) { | |
| 692 | + uni.$u.toast('增加分配成功!'); | |
| 693 | + } else { | |
| 694 | + uni.$u.toast('减少分配成功!'); | |
| 695 | + } | |
| 696 | + // 刷新订单详情 | |
| 697 | + handleOrderDetail(orderId.value); | |
| 698 | + refreshOrderData() | |
| 699 | + } else { | |
| 700 | + uni.$u.toast('操作失败!'); | |
| 701 | + // 将输入框重置为之前的值 | |
| 702 | + handler.carCountInput = handler.garCarCount || 0; | |
| 703 | + } | |
| 704 | + }) | |
| 705 | + .catch(err => { | |
| 706 | + uni.$u.toast('操作失败'); | |
| 707 | + console.error('操作失败:', err); | |
| 708 | + // 将输入框重置为之前的值 | |
| 709 | + handler.carCountInput = handler.garCarCount || 0; | |
| 710 | + }); | |
| 711 | +}; | |
| 712 | + | |
| 713 | +const confirmAddVehicles = () =>{ | |
| 714 | + const params = { | |
| 715 | + carCount: carCount.value, | |
| 716 | + tel: tel.value, | |
| 717 | + orderNo : orderNo.value, | |
| 718 | + orderCarType :selectedHandlerTels.value | |
| 719 | + }; | |
| 720 | + if(selectedHandlerTels.value === ""){ | |
| 721 | + uni.$u.toast(`请选择车型!`); | |
| 722 | + return; | |
| 723 | + } | |
| 724 | + insertRandomCopyByTypeAndOrderId(params).then(res => { | |
| 725 | + if (res.data.success) { | |
| 726 | + uni.$u.toast(`添加成功!`); | |
| 727 | + // 刷新订单详情 | |
| 728 | + handleOrderDetail(orderId.value); | |
| 729 | + refreshOrderData() | |
| 730 | + } else { | |
| 731 | + uni.$u.toast(`添加失败!`); | |
| 762 | 732 | } |
| 733 | + }) | |
| 734 | +} | |
| 763 | 735 | |
| 764 | - // 检查已分配趟次总和是否超过订单要求的总发车次数 | |
| 765 | - const allocatedTrips = handlerList.value.reduce((sum, handler) => sum + parseInt(handler.garCarCount || 0), 0); | |
| 766 | - const totalRequiredTrips = realCarCount.value || 0; | |
| 767 | 736 | |
| 768 | - console.log('已分配趟次总和:', allocatedTrips); | |
| 769 | - console.log('总需求趟次:', totalRequiredTrips); | |
| 770 | 737 | |
| 771 | - if (allocatedTrips >= totalRequiredTrips) { | |
| 772 | - uni.$u.toast(`全部趟次已分配完成,无需再分配!`); | |
| 773 | - return; | |
| 774 | - } | |
| 738 | +const confirmAddVehicle = () => { | |
| 775 | 739 | |
| 776 | - // 检查本次分配后是否会超过总发车次数 | |
| 777 | - if (allocatedTrips + carCount.value > totalRequiredTrips) { | |
| 778 | - uni.$u.toast(`分配趟次过多,最多只能再分配${totalRequiredTrips - allocatedTrips}趟!`); | |
| 779 | - return; | |
| 780 | - } | |
| 740 | + // 检查必填字段 | |
| 741 | + if (!carCount.value) { | |
| 742 | + uni.$u.toast(`请选择分配的趟次!`); | |
| 743 | + return; | |
| 744 | + } | |
| 745 | + if (!tel.value) { | |
| 746 | + uni.$u.toast(`请选择分配人员!`); | |
| 747 | + return; | |
| 748 | + } | |
| 781 | 749 | |
| 782 | - // 调用API传递订单ID和新增车辆数量 | |
| 783 | - const params = { | |
| 784 | - carCount: carCount.value, | |
| 785 | - tel: tel.value, | |
| 786 | - orderNo : orderNo.value | |
| 787 | - }; | |
| 788 | 750 | |
| 789 | - updateCarCount(params) | |
| 751 | + if (selectedHandlerTel.value === 'ADD_TOTAL_TRIPS') { | |
| 752 | + updateGarRealCarCount(orderId.value, carCount.value) | |
| 790 | 753 | .then(res => { |
| 791 | 754 | if (res.data.success) { |
| 792 | - uni.$u.toast(`分配成功!`); | |
| 755 | + uni.$u.toast(`总趟次更新成功!`); | |
| 793 | 756 | // 刷新订单详情 |
| 794 | 757 | handleOrderDetail(orderId.value); |
| 795 | - queryByOrderNo(orderNo.value).then(res => { | |
| 796 | - if (res.data.success) { | |
| 797 | - handlerList.value = res.data.data | |
| 798 | - } | |
| 799 | - }).catch(err => { | |
| 800 | - console.error('获取订单信息失败:', err); | |
| 801 | - }) | |
| 758 | + refreshOrderData() | |
| 802 | 759 | } else { |
| 803 | - uni.$u.toast(`分配失败!`); | |
| 760 | + uni.$u.toast(`总趟次更新失败!`); | |
| 804 | 761 | } |
| 805 | 762 | }) |
| 806 | 763 | .catch(err => { |
| 807 | - uni.$u.toast('新增车辆请求失败'); | |
| 808 | - console.error('新增车辆失败:', err); | |
| 764 | + uni.$u.toast('总趟次更新请求失败'); | |
| 765 | + console.error('总趟次更新失败:', err); | |
| 809 | 766 | }); |
| 810 | - }; | |
| 767 | + return; | |
| 768 | + } | |
| 811 | 769 | |
| 812 | - const handlePopupClick = (val) => { | |
| 813 | - carPopupShowFlag.value = val | |
| 814 | - } | |
| 815 | - // 创建二维码 | |
| 816 | - const createQrCodeLocal = (orderId) => { | |
| 817 | - // 获取本地地址拼接订单id | |
| 818 | - showUQRcode.value = true; | |
| 819 | - const hostname = window.location.hostname; | |
| 820 | - const port = window.location.port; | |
| 821 | - const protocol = window.location.protocol; | |
| 822 | - const localAddress = `${protocol}//${hostname}:${port}`; | |
| 823 | - // const localAddress = `http://localhost:5173`; | |
| 824 | - qrCodeText.value = localAddress + "/pages/order-info/order-other/guest/index?orderId=" + orderId; | |
| 825 | - console.log(qrCodeRef.value); | |
| 826 | - } | |
| 827 | - // 获取二维码 | |
| 828 | - const handleQrCodeClick = (orderId) => { | |
| 829 | - // 微信小程序可用 | |
| 830 | - // #ifdef MP-WEIXIN | |
| 831 | - createQrCode(orderId).then((res) => { | |
| 832 | - if (res.data.success) { | |
| 833 | - uni.previewImage({ | |
| 834 | - urls: [res.data.data], | |
| 835 | - longPressActions: { | |
| 836 | - itemList: ['发送给朋友', '保存图片', '收藏'], | |
| 837 | - success: function(res) { | |
| 838 | - console.log('选中了第' + (res.tapIndex + 1) + '个按钮'); | |
| 839 | - }, | |
| 840 | - fail: function(res) { | |
| 841 | - console.log(res); | |
| 842 | - } | |
| 843 | - } | |
| 844 | - }) | |
| 845 | - } | |
| 846 | - }) | |
| 847 | - // #endif | |
| 848 | - // H5 | |
| 849 | - // #ifdef H5 | |
| 850 | - createQrCodeLocal(orderId) | |
| 851 | - // #endif | |
| 852 | - } | |
| 853 | - | |
| 854 | - const handleOrderDispatchClick = (orderId) => { | |
| 855 | - // 获取订单车辆数量 | |
| 856 | - const orderCarCount = dataGram.value?.garCarInfoList?.length || 0; | |
| 857 | - | |
| 858 | - // 获取驾驶员人员 | |
| 859 | - queryOrderDispatch(orderId).then(res => { | |
| 860 | - console.log(res.data.data); | |
| 861 | - if (res.data.success) { | |
| 862 | - // 过滤车辆 非用户选择的车辆无法选中 | |
| 863 | - driverPersonnelList.value = res.data.data; | |
| 864 | - // 恢复原始的open调用方式,只传递dataList | |
| 865 | - clashDriverDispatchRef.value.open(res.data.data); | |
| 866 | - refreshOrderData() | |
| 867 | - } else { | |
| 868 | - uni.$u.toast("驾驶员分配成功!"); | |
| 869 | - refreshOrderData() | |
| 870 | - } | |
| 871 | - }) | |
| 872 | - } | |
| 873 | - const handleDisposalDispatchClick = (orderId) => { | |
| 874 | - // 获取处置场所人员 | |
| 875 | - queryDisposalDispatch(orderId).then(res => { | |
| 876 | - if (res.data.success) { | |
| 877 | - disposalPersonnelList.value = res.data.data | |
| 878 | - clashDisposalDispatchRef.value.open(res.data.data) | |
| 879 | - refreshOrderData() | |
| 880 | - } else { | |
| 881 | - uni.$u.toast("处理场所分配成功!") | |
| 882 | - refreshOrderData() | |
| 883 | - } | |
| 884 | - }) | |
| 885 | - } | |
| 886 | - | |
| 887 | - | |
| 888 | - | |
| 889 | - const handleClose = (e) => { | |
| 890 | - cancelShow.value = false | |
| 891 | - } | |
| 892 | - const handleEvaluateDetail = (orderId, userType) => { | |
| 893 | - uni.$u.route(`pages/order-info/order-other/evaluate-info/index`, { | |
| 894 | - orderId: orderId, | |
| 895 | - userType: userType | |
| 896 | - }) | |
| 897 | - } | |
| 898 | - const selectClick = (index) => { | |
| 899 | - currentCancelName.value = index.name; | |
| 900 | - } | |
| 901 | - const handleOrderDetail = (orderId) => { | |
| 902 | - queryOrderDetail(orderId).then(res => { | |
| 903 | - dataGram.value = res.data.data; | |
| 904 | - fetchDriverList(orderId); | |
| 905 | - currentImages.value = res.data.data.currentImages.map(item => { | |
| 906 | - return { | |
| 907 | - url: import.meta.env.VITE_BASE_URL + item | |
| 908 | - }; | |
| 909 | - }); | |
| 910 | - | |
| 911 | - putOnImages.value = res.data.data.putOnImages.map(item => { | |
| 912 | - let processedItem = item; | |
| 913 | - let carName = ''; | |
| 914 | - | |
| 915 | - // 提取name后面的字符串作为carName并从item中移除 | |
| 916 | - if (item.includes('name')) { | |
| 917 | - const nameIndex = item.indexOf('name'); | |
| 918 | - carName = item.substring(nameIndex + 4); | |
| 919 | - | |
| 920 | - processedItem = item.substring(0, nameIndex); | |
| 921 | - } | |
| 922 | - | |
| 923 | - // 保持原有逻辑不变,但添加carName到返回对象 | |
| 924 | - const newItem = processedItem.substring(0, processedItem.length - 6); | |
| 925 | - const newIndex = processedItem.substring(processedItem.length - 6); | |
| 926 | - return { url: import.meta.env.VITE_BASE_URL + newItem, newIndex, carName }; | |
| 927 | - }); | |
| 928 | - | |
| 929 | - // 按照newIndex升序排序 | |
| 930 | - putOnImages.value.sort((a, b) => { | |
| 931 | - return parseInt(a.newIndex) - parseInt(b.newIndex); | |
| 932 | - }); | |
| 933 | - | |
| 934 | - // 重新组织数据,将相同newIndex的图片放在一起 | |
| 935 | - const groupedImages = {}; | |
| 936 | - putOnImages.value.forEach(item => { | |
| 937 | - if (!groupedImages[item.newIndex]) { | |
| 938 | - groupedImages[item.newIndex] = []; | |
| 939 | - } | |
| 940 | - groupedImages[item.newIndex].push(item); | |
| 941 | - }); | |
| 942 | - | |
| 943 | - // 转换newIndex为1,2,3的连续数字 | |
| 944 | - const sortedKeys = Object.keys(groupedImages).sort((a, b) => parseInt(a) - parseInt(b)); | |
| 945 | - const newGroupedImages = {}; | |
| 946 | - sortedKeys.forEach((key, index) => { | |
| 947 | - newGroupedImages[index + 1] = groupedImages[key]; | |
| 948 | - }); | |
| 949 | - | |
| 950 | - // 转换为数组形式,方便在模板中遍历 | |
| 951 | - putOnImagesGrouped.value = Object.keys(newGroupedImages).map(key => ({ | |
| 952 | - index: key, | |
| 953 | - images: newGroupedImages[key], | |
| 954 | - carName: newGroupedImages[key] && newGroupedImages[key].length > 0 ? newGroupedImages[key][0].carName : '' | |
| 955 | - })); | |
| 956 | - console.log('putOnImagesGrouped.value:', putOnImagesGrouped.value); | |
| 957 | - putDownImages.value = res.data.data.putDownImages.map(item => { | |
| 958 | - return { | |
| 959 | - url: import.meta.env.VITE_BASE_URL + item | |
| 960 | - }; | |
| 961 | - }); | |
| 962 | - }) | |
| 963 | - } | |
| 964 | - /** | |
| 965 | - * 拨打电话回调 | |
| 966 | - */ | |
| 967 | - const handleContactClick = (val) => { | |
| 968 | - uni.makePhoneCall({ | |
| 969 | - phoneNumber: val | |
| 970 | - }).then(res => {}).catch(err => {}); | |
| 971 | - } | |
| 972 | - | |
| 973 | - const handlerJumpOtherApp = (latitude, longitude, garCoordinate) => { | |
| 974 | - console.log(latitude + "=================>" + longitude); | |
| 975 | - // 给出提示确定要跳转吗 | |
| 976 | - uni.showModal({ | |
| 977 | - title: '提示', | |
| 978 | - content: '是否跳转到app定位进行导航?', | |
| 979 | - success: function(res) { | |
| 980 | - if (res.confirm) { | |
| 981 | - uni.openLocation({ | |
| 982 | - latitude: latitude, | |
| 983 | - longitude: longitude, | |
| 984 | - success: function() { | |
| 985 | - console.log('success'); | |
| 986 | - } | |
| 987 | - }); | |
| 988 | - } | |
| 989 | - } | |
| 990 | - }) | |
| 991 | - } | |
| 992 | - | |
| 993 | - /** | |
| 994 | - * 取消订单 | |
| 995 | - * @param {*} orderId | |
| 996 | - */ | |
| 997 | - const handleOderCancelClick = () => { | |
| 998 | - cancelShow.value = true; | |
| 999 | - } | |
| 1000 | - | |
| 1001 | - /** | |
| 1002 | - * 提交取消订单 | |
| 1003 | - */ | |
| 1004 | - const submitFunction = (otherReason) => { | |
| 1005 | - let reason = otherReason | |
| 1006 | - if (currentCancelName.value != "其他") { | |
| 1007 | - reason = currentCancelName.value | |
| 1008 | - } | |
| 1009 | - if (!reason) { | |
| 1010 | - uni.$u.toast("请提供取消订单的原因") | |
| 1011 | - return | |
| 1012 | - } | |
| 1013 | - let params = { | |
| 1014 | - garOrderId: orderId.value, | |
| 1015 | - garCancelFlag: 1, | |
| 1016 | - garReason: reason | |
| 1017 | - } | |
| 1018 | - updateOrder(params).then(res => { | |
| 1019 | - if (res.data.success) { | |
| 1020 | - cancelShow.value = false | |
| 1021 | - uni.$u.toast(res.data.data) | |
| 1022 | - uni.$u.route({ | |
| 1023 | - type: "reLaunch", | |
| 1024 | - url: `pages/order/index`, | |
| 1025 | - }) | |
| 1026 | - } | |
| 1027 | - }) | |
| 1028 | - } | |
| 1029 | - // 提交完成 | |
| 1030 | -const handleSubmitSuccess = (orderId) => { | |
| 1031 | - uni.showModal({ | |
| 1032 | - title: '提示', | |
| 1033 | - content: '订单已经清运完成了吗?', | |
| 1034 | - success: function(res) { | |
| 1035 | - if (res.confirm) { | |
| 1036 | - updateOrder({ | |
| 1037 | - garOrderId: orderId, | |
| 1038 | - handleType: 3 | |
| 1039 | - }).then(res => { | |
| 1040 | - if (res.data.success) { | |
| 1041 | - uni.$u.toast("已完成") | |
| 1042 | - handleOrderDetail(orderId) | |
| 1043 | - } | |
| 1044 | - }) | |
| 1045 | - } else if (res.cancel) {} | |
| 1046 | - } | |
| 1047 | - }); | |
| 1048 | - } | |
| 1049 | - const handleEvaluate = (orderId, userType) => { | |
| 1050 | - uni.$u.route(`pages/order-info/order-other/evaluate/index?orderId=${orderId}&userType=${userType}`) | |
| 1051 | - } | |
| 1052 | - | |
| 1053 | - // 接收订单 | |
| 1054 | - const handleOrder = (orderId) => { | |
| 1055 | - updateOrder({ | |
| 1056 | - garOrderId: orderId, | |
| 1057 | - handleType: 0 | |
| 1058 | - }).then(res => { | |
| 1059 | - if (res.data.success) { | |
| 1060 | - if (res.data.data === "订单已经被别人接受啦") { | |
| 1061 | - uni.$u.toast(res.data.data) | |
| 1062 | - uni.$u.route({ | |
| 1063 | - type: "reLaunch", | |
| 1064 | - url: `pages/order/index`, | |
| 1065 | - }) | |
| 1066 | - } else { | |
| 1067 | - uni.$u.toast(res.data.data) | |
| 1068 | - handleOrderDetail(orderId) | |
| 1069 | - refreshOrderData() | |
| 1070 | - } | |
| 1071 | - } | |
| 1072 | - }) | |
| 1073 | - } | |
| 1074 | - | |
| 1075 | - const currentStep = (step) => { | |
| 1076 | - if (step > 2) { | |
| 1077 | - return step - 1; | |
| 1078 | - } | |
| 1079 | - return step; | |
| 1080 | - } | |
| 1081 | - | |
| 1082 | - /** | |
| 1083 | - * 清运状态 | |
| 1084 | - * @param {*} status | |
| 1085 | - */ | |
| 1086 | - const cleanStatus = (status) => { | |
| 1087 | - if (dataGram.garCancelFlag === 1) { | |
| 1088 | - return '取消清运'; | |
| 1089 | - } | |
| 1090 | - switch (status) { | |
| 1091 | - case 0: | |
| 1092 | - return '准备清运'; | |
| 1093 | - case 1: | |
| 1094 | - return '正在清运'; | |
| 1095 | - case 3: | |
| 1096 | - return '清运完成'; | |
| 1097 | - } | |
| 1098 | - } | |
| 1099 | - | |
| 1100 | - const handleDisposalDispatchConfirm = (val) => { | |
| 1101 | - console.log(val); | |
| 1102 | - if (!val) { | |
| 1103 | - return | |
| 1104 | - } | |
| 1105 | - let data = { | |
| 1106 | - garOrderId: orderId.value, | |
| 1107 | - dispatchList: [] | |
| 1108 | - } | |
| 1109 | - for (const key in val) { | |
| 1110 | - data.dispatchList.push({ | |
| 1111 | - ...val[key] | |
| 1112 | - }); | |
| 1113 | - } | |
| 1114 | - console.log(data); | |
| 1115 | - dispatchDisposalOrders(data).then(res => { | |
| 1116 | - if (res.data.success) { | |
| 1117 | - uni.$u.toast(res.data.msg) | |
| 1118 | - // 标记处置场所已分配 | |
| 1119 | - disposalAssigned.value = true; | |
| 1120 | - // 检查是否两个任务都已完成 | |
| 1121 | - } else { | |
| 1122 | - uni.$u.toast("指定人员失败,请重试") | |
| 1123 | - } | |
| 1124 | - clashDriverDispatchRef.value.close() | |
| 1125 | - }) | |
| 1126 | - } | |
| 1127 | - | |
| 1128 | - const handlerUpdateOrderClick = () => { | |
| 1129 | - carPopupShowFlag.value = true; | |
| 1130 | - // TODO 照搬一键清运得弹窗 | |
| 1131 | - console.log("点击了修改订单按钮"); | |
| 1132 | - // TODO | |
| 1133 | - queryCarList({ | |
| 1134 | - companyId: dataGram.value.garOrderCompanyId | |
| 1135 | - }).then(res => { | |
| 1136 | - // 设置车辆类型 | |
| 1137 | - candidates.value = [ | |
| 1138 | - [...new Set(res.data.rows | |
| 1139 | - .filter(item => item.containerVolume) | |
| 1140 | - .map(item => { | |
| 1141 | - garCarLabelInfoList.value[item.carType] = item | |
| 1142 | - return item.carType | |
| 1143 | - }))] | |
| 1144 | - ]; | |
| 1145 | - // 设置初始车辆数量 | |
| 1146 | - candidates.value[0].forEach((item, index) => { | |
| 1147 | - garCarInfoList.value[item] = { | |
| 1148 | - garOrderCarNumber: 1, | |
| 1149 | - garOrderCarType: item, | |
| 1150 | - id: garCarLabelInfoList.value[item].id, | |
| 1151 | - containerVolume: garCarLabelInfoList.value[item].containerVolume | |
| 1152 | - } | |
| 1153 | - }) | |
| 1154 | - // 设置默认车辆 | |
| 1155 | - paramFrom.value.carType = candidates.value[0][0]; | |
| 1156 | - garCarLabelInfoNow.value = garCarLabelInfoList.value[paramFrom.value.carType] | |
| 1157 | - console.log(garCarLabelInfoList.value, garCarInfoList.value, paramFrom.value.carType); | |
| 1158 | - }) | |
| 1159 | - } | |
| 1160 | - // 指定人员 | |
| 1161 | -const handleDriverDispatchConfirm = (val) => { | |
| 1162 | - console.log(val); | |
| 1163 | - if (!val) { | |
| 1164 | - return; | |
| 1165 | - } | |
| 1166 | - | |
| 1167 | - // 获取订单车辆数量 | |
| 1168 | - const orderCarCount = dataGram.value?.garCarInfoList?.length || 0; | |
| 1169 | - | |
| 1170 | - // 计算选择的驾驶员数量 | |
| 1171 | - const selectedDriverCount = Object.keys(val).length; | |
| 1172 | - | |
| 1173 | - // 检查驾驶员数量是否超过订单车辆数量 | |
| 1174 | - if (selectedDriverCount > orderCarCount) { | |
| 1175 | - jumpPrompt(`选择的驾驶员数量不能超过${orderCarCount}个`); | |
| 1176 | - return; | |
| 1177 | - } | |
| 1178 | - | |
| 1179 | - let data = { | |
| 1180 | - garOrderId: orderId.value, | |
| 1181 | - dispatchList: [] | |
| 1182 | - } | |
| 1183 | - for (const key in val) { | |
| 1184 | - data.dispatchList.push({ | |
| 1185 | - ...val[key] | |
| 1186 | - }); | |
| 1187 | - } | |
| 1188 | - console.log(data); | |
| 1189 | - dispatchOrders(data).then(res => { | |
| 1190 | - if (res.data.success) { | |
| 1191 | - uni.$u.toast(res.data.msg); | |
| 1192 | - // 标记驾驶员已分配 | |
| 1193 | - driverAssigned.value = true; | |
| 1194 | - refreshOrderData(); | |
| 1195 | - } else { | |
| 1196 | - uni.$u.toast("指定人员失败,请重试"); | |
| 1197 | - } | |
| 1198 | - clashDriverDispatchRef.value.close(); | |
| 1199 | - }) | |
| 1200 | - } | |
| 1201 | - | |
| 1202 | - const submitUpdateCarInfo = () => { | |
| 1203 | - let garCarInfos = []; | |
| 1204 | - for (const key in garCarInfoList.value) { | |
| 1205 | - garCarInfos.push(garCarInfoList.value[key]) | |
| 1206 | - } | |
| 1207 | - | |
| 1208 | - let data = { | |
| 1209 | - garOrderId: orderId.value, | |
| 1210 | - garCarInfoList: garCarInfos, | |
| 1211 | - updated: true | |
| 1212 | - } | |
| 1213 | - if (dataGram.value.garOrderAgreementTime) { | |
| 1214 | - let index = dataGram.value.garOrderAgreementTime.indexOf(' ') + 1; | |
| 1215 | - if (index > 0) { | |
| 1216 | - let val = dataGram.value.garOrderAgreementTime.substring(index, dataGram.value.garOrderAgreementTime | |
| 1217 | - .length); | |
| 1218 | - | |
| 1219 | - | |
| 1220 | - if (val == "07:00-08:00" || val == "08:00-09:00" || val == "09:00-10:00" || val == "10:00-11:00" || | |
| 1221 | - val == "11:00-12:00" || val == "12:00-13:00" || val == "13:00-14:00" || | |
| 1222 | - val == "14:00-15:00" || val == "15:00-16:00" || val == "16:00-17:00" || val == "17:00-18:00" || | |
| 1223 | - val == "18:00-19:00" || val == "19:00-20:00" || val == "20:00-21:00" || | |
| 1224 | - val == "21:00-22:00") { | |
| 1225 | - let size = garCarInfos.length; | |
| 1226 | - for (let index = 0; index < size; index++) { | |
| 1227 | - if ((garCarInfos[index].containerVolume == "8" || parseInt(garCarInfos[index] | |
| 1228 | - .containerVolume) >= 8) && garCarInfos[index].garOrderCarNumber > 0) { | |
| 1229 | - console.log(garCarInfos[index]); | |
| 1230 | - | |
| 1231 | - jumpPrompt("中大型车辆只能选择22:00-07:00时间段"); | |
| 1232 | - return; | |
| 1233 | - } | |
| 1234 | - | |
| 1235 | - } | |
| 1236 | - } | |
| 1237 | - | |
| 1238 | - } | |
| 1239 | - | |
| 1240 | - } | |
| 1241 | - console.log(dataGram.value.garOrderAgreementTime); | |
| 1242 | - console.log(garCarInfos); | |
| 1243 | - console.log("=================================>"); | |
| 1244 | - | |
| 1245 | - | |
| 1246 | - updateOrder(data).then(res => { | |
| 1247 | - if (res.data.code == 200) { | |
| 1248 | - uni.$u.toast("车辆信息修改成功") | |
| 1249 | - // 更新数据 | |
| 1250 | - handleOrderDetail(orderId.value) | |
| 1251 | - // 关闭弹窗 | |
| 1252 | - carPopupShowFlag.value = false | |
| 1253 | - } | |
| 1254 | - }).catch(err => { | |
| 1255 | - uni.$u.toast("修改失败,请重试") | |
| 1256 | - }) | |
| 1257 | - } | |
| 1258 | - | |
| 1259 | - | |
| 1260 | - | |
| 1261 | - const jumpPrompt = (msg) => { | |
| 1262 | - uni.showModal({ | |
| 1263 | - title: '提示', | |
| 1264 | - content: msg, | |
| 1265 | - showCancel: false, | |
| 1266 | - success: function(res) { | |
| 1267 | - if (res.confirm) {} else if (res.cancel) {} | |
| 1268 | - } | |
| 1269 | - }); | |
| 1270 | - } | |
| 1271 | - const showLeftButtons = computed(() => { | |
| 1272 | - return (dataGram.value?.garOrderHandlerStatus === 0 && userType.value == '运输企业负责人' && dataGram.value?.garCancelFlag === 0) || | |
| 1273 | - (dataGram.value?.garOrderScanHandlerFlag === 0 && userType.value == '用户' && dataGram.value?.garOrderHandlerStatus != 3 && dataGram.value?.garAskStatus != '1'); | |
| 1274 | - }); | |
| 770 | + // 检查已分配趟次总和是否超过订单要求的总发车次数 | |
| 771 | + const allocatedTrips = handlerList.value.reduce((sum, handler) => sum + parseInt(handler.garCarCount || 0), 0); | |
| 772 | + const totalRequiredTrips = realCarCount.value || 0; | |
| 1275 | 773 | |
| 1276 | - const showCenterButtons = computed(() => { | |
| 1277 | - return (dataGram.value?.garOrderHandlerStatus === 0 && userType.value == '运输企业负责人' && dataGram.value?.handleFlag && dataGram.value?.garCancelFlag === 0) || | |
| 1278 | - (dataGram.value?.garOrderHandlerStatus === 1 && userType.value == '运输企业负责人') || | |
| 1279 | - (dataGram.value?.garOrderHandlerStatus === 1 && userType.value == '运输企业负责人' && isAllTripsCompleted()); | |
| 1280 | - }); | |
| 774 | + console.log('已分配趟次总和:', allocatedTrips); | |
| 775 | + console.log('总需求趟次:', totalRequiredTrips); | |
| 1281 | 776 | |
| 1282 | - const showRightButtons = computed(() => { | |
| 1283 | - return (dataGram.value?.garOrderHandlerStatus === 0 && userType.value == '用户' && dataGram.value?.garCancelFlag === 0) || | |
| 1284 | - (dataGram.value?.garEvaluateFlag === 0 && userType.value === '用户') || | |
| 1285 | - (dataGram.value?.garHandlerEvaluateFlag === 0 && userType.value === '运输企业负责人' && dataGram.value?.haveEvaluateOfClient == 1) || | |
| 1286 | - (dataGram.value?.garHandlerEvaluateFlag === 1 && userType.value === '运输企业负责人' && dataGram.value?.haveEvaluateOfClient == 1) || | |
| 1287 | - (dataGram.value?.garEvaluateFlag === 1 && userType.value === '用户'); | |
| 1288 | - }); | |
| 777 | + if (allocatedTrips >= totalRequiredTrips) { | |
| 778 | + uni.$u.toast(`全部趟次已分配完成,无需再分配!`); | |
| 779 | + return; | |
| 780 | + } | |
| 1289 | 781 | |
| 1290 | - const showTopButtons = computed(() => { | |
| 1291 | - return (dataGram.value?.garOrderHandlerStatus === 0 && userType.value == '运输企业负责人' && dataGram.value?.handleFlag && dataGram.value?.garCancelFlag === 0) || | |
| 1292 | - (dataGram.value?.garOrderHandlerStatus === 1 && userType.value == '运输企业负责人' && !isAllTripsCompleted()) || | |
| 1293 | - (dataGram.value?.garOrderHandlerStatus === 1 && userType.value == '运输企业负责人' && isAllTripsCompleted()); | |
| 1294 | - }); | |
| 1295 | - /** | |
| 1296 | - * 初始化信息 | |
| 1297 | - */ | |
| 1298 | - onLoad((options) => { | |
| 1299 | - orderId.value = options.orderId | |
| 1300 | - orderNo.value = options.orderId | |
| 1301 | - handleOrderDetail(orderId.value) | |
| 1302 | - refreshOrderData() | |
| 1303 | - }) | |
| 1304 | - | |
| 1305 | - onShow(() => { | |
| 1306 | - try { | |
| 1307 | - if (isOnloadIn.value) { | |
| 1308 | - handleOrderDetail(orderId.value) | |
| 1309 | - } else { | |
| 1310 | - isOnloadIn.value = true | |
| 1311 | - } | |
| 1312 | - } catch (error) { | |
| 1313 | - console.log(error); | |
| 1314 | - } | |
| 1315 | - }) | |
| 1316 | -</script> | |
| 782 | + // 检查本次分配后是否会超过总发车次数 | |
| 783 | + if (allocatedTrips + carCount.value > totalRequiredTrips) { | |
| 784 | + uni.$u.toast(`分配趟次过多,最多只能再分配${totalRequiredTrips - allocatedTrips}趟!`); | |
| 785 | + return; | |
| 786 | + } | |
| 1317 | 787 | |
| 1318 | -<style lang="scss" scoped> | |
| 788 | + // 调用API传递订单ID和新增车辆数量 | |
| 789 | + const params = { | |
| 790 | + carCount: carCount.value, | |
| 791 | + tel: tel.value, | |
| 792 | + orderNo : orderNo.value | |
| 793 | + }; | |
| 1319 | 794 | |
| 1320 | - $custom-marin-bottom: 20rpx; | |
| 1321 | - $custom-page-padding: 20rpx; | |
| 1322 | - $custom-border-radio: 20rpx; | |
| 1323 | - $custom-bottom-height: 200rpx; | |
| 795 | + updateCarCount(params) | |
| 796 | + .then(res => { | |
| 797 | + if (res.data.success) { | |
| 798 | + uni.$u.toast(`分配成功!`); | |
| 799 | + // 刷新订单详情 | |
| 800 | + handleOrderDetail(orderId.value); | |
| 801 | + queryByOrderNo(orderNo.value).then(res => { | |
| 802 | + if (res.data.success) { | |
| 803 | + handlerList.value = res.data.data | |
| 804 | + } | |
| 805 | + }).catch(err => { | |
| 806 | + console.error('获取订单信息失败:', err); | |
| 807 | + }) | |
| 808 | + } else { | |
| 809 | + uni.$u.toast(`分配失败!`); | |
| 810 | + } | |
| 811 | + }) | |
| 812 | + .catch(err => { | |
| 813 | + uni.$u.toast('新增车辆请求失败'); | |
| 814 | + console.error('新增车辆失败:', err); | |
| 815 | + }); | |
| 816 | +}; | |
| 817 | + | |
| 818 | +const handlePopupClick = (val) => { | |
| 819 | + carPopupShowFlag.value = val | |
| 820 | +} | |
| 821 | +// 创建二维码 | |
| 822 | +const createQrCodeLocal = (orderId) => { | |
| 823 | + // 获取本地地址拼接订单id | |
| 824 | + showUQRcode.value = true; | |
| 825 | + const hostname = window.location.hostname; | |
| 826 | + const port = window.location.port; | |
| 827 | + const protocol = window.location.protocol; | |
| 828 | + const localAddress = `${protocol}//${hostname}:${port}`; | |
| 829 | + // const localAddress = `http://localhost:5173`; | |
| 830 | + qrCodeText.value = localAddress + "/pages/order-info/order-other/guest/index?orderId=" + orderId; | |
| 831 | + console.log(qrCodeRef.value); | |
| 832 | +} | |
| 833 | +// 获取二维码 | |
| 834 | +const handleQrCodeClick = (orderId) => { | |
| 835 | + // 微信小程序可用 | |
| 836 | + // #ifdef MP-WEIXIN | |
| 837 | + createQrCode(orderId).then((res) => { | |
| 838 | + if (res.data.success) { | |
| 839 | + uni.previewImage({ | |
| 840 | + urls: [res.data.data], | |
| 841 | + longPressActions: { | |
| 842 | + itemList: ['发送给朋友', '保存图片', '收藏'], | |
| 843 | + success: function(res) { | |
| 844 | + console.log('选中了第' + (res.tapIndex + 1) + '个按钮'); | |
| 845 | + }, | |
| 846 | + fail: function(res) { | |
| 847 | + console.log(res); | |
| 848 | + } | |
| 849 | + } | |
| 850 | + }) | |
| 851 | + } | |
| 852 | + }) | |
| 853 | + // #endif | |
| 854 | + // H5 | |
| 855 | + // #ifdef H5 | |
| 856 | + createQrCodeLocal(orderId) | |
| 857 | + // #endif | |
| 858 | +} | |
| 859 | + | |
| 860 | +const handleOrderDispatchClick = (orderId) => { | |
| 861 | + // 获取订单车辆数量 | |
| 862 | + const orderCarCount = dataGram.value?.garCarInfoList?.length || 0; | |
| 863 | + | |
| 864 | + // 获取驾驶员人员 | |
| 865 | + queryOrderDispatch(orderId).then(res => { | |
| 866 | + console.log(res.data.data); | |
| 867 | + if (res.data.success) { | |
| 868 | + // 过滤车辆 非用户选择的车辆无法选中 | |
| 869 | + driverPersonnelList.value = res.data.data; | |
| 870 | + // 恢复原始的open调用方式,只传递dataList | |
| 871 | + clashDriverDispatchRef.value.open(res.data.data); | |
| 872 | + refreshOrderData() | |
| 873 | + } else { | |
| 874 | + uni.$u.toast("驾驶员分配成功!"); | |
| 875 | + refreshOrderData() | |
| 876 | + } | |
| 877 | + }) | |
| 878 | +} | |
| 879 | +const handleDisposalDispatchClick = (orderId) => { | |
| 880 | + // 获取处置场所人员 | |
| 881 | + queryDisposalDispatch(orderId).then(res => { | |
| 882 | + if (res.data.success) { | |
| 883 | + disposalPersonnelList.value = res.data.data | |
| 884 | + clashDisposalDispatchRef.value.open(res.data.data) | |
| 885 | + refreshOrderData() | |
| 886 | + } else { | |
| 887 | + uni.$u.toast("处理场所分配成功!") | |
| 888 | + refreshOrderData() | |
| 889 | + } | |
| 890 | + }) | |
| 891 | +} | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | +const handleClose = (e) => { | |
| 896 | + cancelShow.value = false | |
| 897 | +} | |
| 898 | +const handleEvaluateDetail = (orderId, userType) => { | |
| 899 | + uni.$u.route(`pages/order-info/order-other/evaluate-info/index`, { | |
| 900 | + orderId: orderId, | |
| 901 | + userType: userType | |
| 902 | + }) | |
| 903 | +} | |
| 904 | +const selectClick = (index) => { | |
| 905 | + currentCancelName.value = index.name; | |
| 906 | +} | |
| 907 | +const handleOrderDetail = (orderId) => { | |
| 908 | + queryOrderDetail(orderId).then(res => { | |
| 909 | + dataGram.value = res.data.data; | |
| 910 | + fetchDriverList(orderId); | |
| 911 | + currentImages.value = res.data.data.currentImages.map(item => { | |
| 912 | + return { | |
| 913 | + url: import.meta.env.VITE_BASE_URL + item | |
| 914 | + }; | |
| 915 | + }); | |
| 1324 | 916 | |
| 1325 | - @mixin card { | |
| 1326 | - padding: $custom-page-padding; | |
| 1327 | - box-sizing: border-box; | |
| 1328 | - background-color: #ffffff; | |
| 1329 | - border-radius: $custom-border-radio; | |
| 1330 | - margin-bottom: $custom-marin-bottom; | |
| 1331 | - } | |
| 917 | + putOnImages.value = res.data.data.putOnImages.map(item => { | |
| 918 | + let processedItem = item; | |
| 919 | + let carName = ''; | |
| 1332 | 920 | |
| 1333 | - .order-detail-bottom { | |
| 1334 | - position: fixed; | |
| 1335 | - width: 100%; | |
| 1336 | - bottom: 0; | |
| 1337 | - left: 0; | |
| 1338 | - background-color: #fff; | |
| 1339 | - box-shadow: 0 -2rpx 10rpx rgba(0,0,0,0.05); | |
| 1340 | - padding: 20rpx $custom-page-padding; | |
| 1341 | - box-sizing: border-box; | |
| 921 | + // 提取name后面的字符串作为carName并从item中移除 | |
| 922 | + if (item.includes('name')) { | |
| 923 | + const nameIndex = item.indexOf('name'); | |
| 924 | + carName = item.substring(nameIndex + 4); | |
| 1342 | 925 | |
| 1343 | - .order-detail-bottom-box { | |
| 1344 | - display: flex; | |
| 1345 | - flex-direction: column; | |
| 1346 | - gap: 20rpx; | |
| 926 | + processedItem = item.substring(0, nameIndex); | |
| 927 | + } | |
| 1347 | 928 | |
| 1348 | - .order-detail-top-buttons { | |
| 1349 | - width: 100%; | |
| 929 | + // 保持原有逻辑不变,但添加carName到返回对象 | |
| 930 | + const newItem = processedItem.substring(0, processedItem.length - 6); | |
| 931 | + const newIndex = processedItem.substring(processedItem.length - 6); | |
| 932 | + return { url: import.meta.env.VITE_BASE_URL + newItem, newIndex, carName }; | |
| 933 | + }); | |
| 1350 | 934 | |
| 1351 | - .button-group-wrap, | |
| 1352 | - .button-group-spread { | |
| 1353 | - display: flex; | |
| 1354 | - gap: 20rpx; | |
| 1355 | - width: 100%; | |
| 935 | + // 按照newIndex升序排序 | |
| 936 | + putOnImages.value.sort((a, b) => { | |
| 937 | + return parseInt(a.newIndex) - parseInt(b.newIndex); | |
| 938 | + }); | |
| 1356 | 939 | |
| 1357 | - u-button { | |
| 1358 | - flex: 1; | |
| 1359 | - height: 72rpx; | |
| 1360 | - line-height: 72rpx; | |
| 1361 | - font-size: 26rpx; | |
| 1362 | - padding: 0 20rpx; | |
| 1363 | - border-radius: 36rpx; | |
| 1364 | - } | |
| 1365 | - } | |
| 940 | + // 重新组织数据,将相同newIndex的图片放在一起 | |
| 941 | + const groupedImages = {}; | |
| 942 | + putOnImages.value.forEach(item => { | |
| 943 | + if (!groupedImages[item.newIndex]) { | |
| 944 | + groupedImages[item.newIndex] = []; | |
| 945 | + } | |
| 946 | + groupedImages[item.newIndex].push(item); | |
| 947 | + }); | |
| 1366 | 948 | |
| 1367 | - .button-group-spread { | |
| 1368 | - justify-content: space-between; | |
| 949 | + // 转换newIndex为1,2,3的连续数字 | |
| 950 | + const sortedKeys = Object.keys(groupedImages).sort((a, b) => parseInt(a) - parseInt(b)); | |
| 951 | + const newGroupedImages = {}; | |
| 952 | + sortedKeys.forEach((key, index) => { | |
| 953 | + newGroupedImages[index + 1] = groupedImages[key]; | |
| 954 | + }); | |
| 1369 | 955 | |
| 1370 | - .btn-left, | |
| 1371 | - .btn-right { | |
| 1372 | - flex: 1; | |
| 956 | + // 转换为数组形式,方便在模板中遍历 | |
| 957 | + putOnImagesGrouped.value = Object.keys(newGroupedImages).map(key => ({ | |
| 958 | + index: key, | |
| 959 | + images: newGroupedImages[key], | |
| 960 | + carName: newGroupedImages[key] && newGroupedImages[key].length > 0 ? newGroupedImages[key][0].carName : '' | |
| 961 | + })); | |
| 962 | + console.log('putOnImagesGrouped.value:', putOnImagesGrouped.value); | |
| 963 | + putDownImages.value = res.data.data.putDownImages.map(item => { | |
| 964 | + return { | |
| 965 | + url: import.meta.env.VITE_BASE_URL + item | |
| 966 | + }; | |
| 967 | + }); | |
| 968 | + }) | |
| 969 | +} | |
| 970 | +/** | |
| 971 | + * 拨打电话回调 | |
| 972 | + */ | |
| 973 | +const handleContactClick = (val) => { | |
| 974 | + uni.makePhoneCall({ | |
| 975 | + phoneNumber: val | |
| 976 | + }).then(res => {}).catch(err => {}); | |
| 977 | +} | |
| 978 | + | |
| 979 | +const handlerJumpOtherApp = (latitude, longitude, garCoordinate) => { | |
| 980 | + console.log(latitude + "=================>" + longitude); | |
| 981 | + // 给出提示确定要跳转吗 | |
| 982 | + uni.showModal({ | |
| 983 | + title: '提示', | |
| 984 | + content: '是否跳转到app定位进行导航?', | |
| 985 | + success: function(res) { | |
| 986 | + if (res.confirm) { | |
| 987 | + uni.openLocation({ | |
| 988 | + latitude: latitude, | |
| 989 | + longitude: longitude, | |
| 990 | + success: function() { | |
| 991 | + console.log('success'); | |
| 1373 | 992 | } |
| 1374 | - } | |
| 993 | + }); | |
| 1375 | 994 | } |
| 1376 | - | |
| 1377 | - .order-detail-bottom-buttons { | |
| 1378 | - display: flex; | |
| 1379 | - flex-direction: column; | |
| 1380 | - width: 100%; | |
| 1381 | - gap: 20rpx; | |
| 1382 | - | |
| 1383 | - .cancel-button-container { | |
| 1384 | - width: 100%; | |
| 1385 | - | |
| 1386 | - u-button { | |
| 1387 | - width: 100%; | |
| 1388 | - height: 72rpx; | |
| 1389 | - line-height: 72rpx; | |
| 1390 | - font-size: 26rpx; | |
| 1391 | - border-radius: 36rpx; | |
| 995 | + } | |
| 996 | + }) | |
| 997 | +} | |
| 998 | + | |
| 999 | +/** | |
| 1000 | + * 取消订单 | |
| 1001 | + * @param {*} orderId | |
| 1002 | + */ | |
| 1003 | +const handleOderCancelClick = () => { | |
| 1004 | + cancelShow.value = true; | |
| 1005 | +} | |
| 1006 | + | |
| 1007 | +/** | |
| 1008 | + * 提交取消订单 | |
| 1009 | + */ | |
| 1010 | +const submitFunction = (otherReason) => { | |
| 1011 | + let reason = otherReason | |
| 1012 | + if (currentCancelName.value != "其他") { | |
| 1013 | + reason = currentCancelName.value | |
| 1014 | + } | |
| 1015 | + if (!reason) { | |
| 1016 | + uni.$u.toast("请提供取消订单的原因") | |
| 1017 | + return | |
| 1018 | + } | |
| 1019 | + let params = { | |
| 1020 | + garOrderId: orderId.value, | |
| 1021 | + garCancelFlag: 1, | |
| 1022 | + garReason: reason | |
| 1023 | + } | |
| 1024 | + updateOrder(params).then(res => { | |
| 1025 | + if (res.data.success) { | |
| 1026 | + cancelShow.value = false | |
| 1027 | + uni.$u.toast(res.data.data) | |
| 1028 | + uni.$u.route({ | |
| 1029 | + type: "reLaunch", | |
| 1030 | + url: `pages/order/index`, | |
| 1031 | + }) | |
| 1032 | + } | |
| 1033 | + }) | |
| 1034 | +} | |
| 1035 | +// 提交完成 | |
| 1036 | +const handleSubmitSuccess = (orderId) => { | |
| 1037 | + uni.showModal({ | |
| 1038 | + title: '提示', | |
| 1039 | + content: '订单已经清运完成了吗?', | |
| 1040 | + success: function(res) { | |
| 1041 | + if (res.confirm) { | |
| 1042 | + updateOrder({ | |
| 1043 | + garOrderId: orderId, | |
| 1044 | + handleType: 3 | |
| 1045 | + }).then(res => { | |
| 1046 | + if (res.data.success) { | |
| 1047 | + uni.$u.toast("已完成") | |
| 1048 | + handleOrderDetail(orderId) | |
| 1392 | 1049 | } |
| 1393 | - } | |
| 1050 | + }) | |
| 1051 | + } else if (res.cancel) {} | |
| 1052 | + } | |
| 1053 | + }); | |
| 1054 | +} | |
| 1055 | +const handleEvaluate = (orderId, userType) => { | |
| 1056 | + uni.$u.route(`pages/order-info/order-other/evaluate/index?orderId=${orderId}&userType=${userType}`) | |
| 1057 | +} | |
| 1058 | + | |
| 1059 | +// 接收订单 | |
| 1060 | +const handleOrder = (orderId) => { | |
| 1061 | + // 在开始运输前先分配驾驶员(如果有待分配的驾驶员) | |
| 1062 | + if (pendingDriverAssignments.value && Object.keys(pendingDriverAssignments.value).length > 0) { | |
| 1063 | + let data = { | |
| 1064 | + garOrderId: orderId, | |
| 1065 | + dispatchList: [] | |
| 1066 | + } | |
| 1067 | + for (const key in pendingDriverAssignments.value) { | |
| 1068 | + data.dispatchList.push({ | |
| 1069 | + ...pendingDriverAssignments.value[key] | |
| 1070 | + }); | |
| 1071 | + } | |
| 1394 | 1072 | |
| 1395 | - .evaluation-buttons-container { | |
| 1396 | - display: flex; | |
| 1397 | - gap: 20rpx; | |
| 1398 | - | |
| 1399 | - u-button { | |
| 1400 | - flex: 1; | |
| 1401 | - height: 72rpx; | |
| 1402 | - line-height: 72rpx; | |
| 1403 | - font-size: 26rpx; | |
| 1404 | - border-radius: 36rpx; | |
| 1073 | + dispatchOrders(data).then(res => { | |
| 1074 | + if (res.data.success) { | |
| 1075 | + // 清空待分配列表 | |
| 1076 | + pendingDriverAssignments.value = {}; | |
| 1077 | + // 标记驾驶员已分配 | |
| 1078 | + driverAssigned.value = true; | |
| 1079 | + | |
| 1080 | + // 然后更新订单状态为开始运输 | |
| 1081 | + updateOrder({ | |
| 1082 | + garOrderId: orderId, | |
| 1083 | + handleType: 0 | |
| 1084 | + }).then(res => { | |
| 1085 | + if (res.data.success) { | |
| 1086 | + if (res.data.data === "订单已经被别人接受啦") { | |
| 1087 | + uni.$u.toast(res.data.data) | |
| 1088 | + uni.$u.route({ | |
| 1089 | + type: "reLaunch", | |
| 1090 | + url: `pages/order/index`, | |
| 1091 | + }) | |
| 1092 | + } else { | |
| 1093 | + uni.$u.toast(res.data.data) | |
| 1094 | + handleOrderDetail(orderId) | |
| 1095 | + refreshOrderData() | |
| 1096 | + } | |
| 1405 | 1097 | } |
| 1098 | + }) | |
| 1099 | + } else { | |
| 1100 | + uni.$u.toast("指定人员失败,请重试"); | |
| 1101 | + } | |
| 1102 | + }) | |
| 1103 | + } else { | |
| 1104 | + // 没有待分配的驾驶员,直接开始运输 | |
| 1105 | + updateOrder({ | |
| 1106 | + garOrderId: orderId, | |
| 1107 | + handleType: 0 | |
| 1108 | + }).then(res => { | |
| 1109 | + if (res.data.success) { | |
| 1110 | + if (res.data.data === "订单已经被别人接受啦") { | |
| 1111 | + uni.$u.toast(res.data.data) | |
| 1112 | + uni.$u.route({ | |
| 1113 | + type: "reLaunch", | |
| 1114 | + url: `pages/order/index`, | |
| 1115 | + }) | |
| 1116 | + } else { | |
| 1117 | + uni.$u.toast(res.data.data) | |
| 1118 | + handleOrderDetail(orderId) | |
| 1119 | + refreshOrderData() | |
| 1406 | 1120 | } |
| 1407 | 1121 | } |
| 1122 | + }) | |
| 1123 | + } | |
| 1124 | +} | |
| 1125 | + | |
| 1126 | +const currentStep = (step) => { | |
| 1127 | + if (step > 2) { | |
| 1128 | + return step - 1; | |
| 1129 | + } | |
| 1130 | + return step; | |
| 1131 | +} | |
| 1132 | + | |
| 1133 | +/** | |
| 1134 | + * 清运状态 | |
| 1135 | + * @param {*} status | |
| 1136 | + */ | |
| 1137 | +const cleanStatus = (status) => { | |
| 1138 | + if (dataGram.garCancelFlag === 1) { | |
| 1139 | + return '取消清运'; | |
| 1140 | + } | |
| 1141 | + switch (status) { | |
| 1142 | + case 0: | |
| 1143 | + return '准备清运'; | |
| 1144 | + case 1: | |
| 1145 | + return '正在清运'; | |
| 1146 | + case 3: | |
| 1147 | + return '清运完成'; | |
| 1148 | + } | |
| 1149 | +} | |
| 1150 | + | |
| 1151 | +const handleDisposalDispatchConfirm = (val) => { | |
| 1152 | + console.log(val); | |
| 1153 | + if (!val) { | |
| 1154 | + return | |
| 1155 | + } | |
| 1156 | + let data = { | |
| 1157 | + garOrderId: orderId.value, | |
| 1158 | + dispatchList: [] | |
| 1159 | + } | |
| 1160 | + for (const key in val) { | |
| 1161 | + data.dispatchList.push({ | |
| 1162 | + ...val[key] | |
| 1163 | + }); | |
| 1164 | + } | |
| 1165 | + console.log(data); | |
| 1166 | + dispatchDisposalOrders(data).then(res => { | |
| 1167 | + if (res.data.success) { | |
| 1168 | + uni.$u.toast(res.data.msg) | |
| 1169 | + // 标记处置场所已分配 | |
| 1170 | + disposalAssigned.value = true; | |
| 1171 | + // 检查是否两个任务都已完成 | |
| 1172 | + } else { | |
| 1173 | + uni.$u.toast("指定人员失败,请重试") | |
| 1408 | 1174 | } |
| 1175 | + clashDriverDispatchRef.value.close() | |
| 1176 | + }) | |
| 1177 | +} | |
| 1178 | + | |
| 1179 | +const handlerUpdateOrderClick = () => { | |
| 1180 | + carPopupShowFlag.value = true; | |
| 1181 | + // TODO 照搬一键清运得弹窗 | |
| 1182 | + console.log("点击了修改订单按钮"); | |
| 1183 | + // TODO | |
| 1184 | + queryCarList({ | |
| 1185 | + companyId: dataGram.value.garOrderCompanyId | |
| 1186 | + }).then(res => { | |
| 1187 | + // 设置车辆类型 | |
| 1188 | + candidates.value = [ | |
| 1189 | + [...new Set(res.data.rows | |
| 1190 | + .filter(item => item.containerVolume) | |
| 1191 | + .map(item => { | |
| 1192 | + garCarLabelInfoList.value[item.carType] = item | |
| 1193 | + return item.carType | |
| 1194 | + }))] | |
| 1195 | + ]; | |
| 1196 | + // 设置初始车辆数量 | |
| 1197 | + candidates.value[0].forEach((item, index) => { | |
| 1198 | + garCarInfoList.value[item] = { | |
| 1199 | + garOrderCarNumber: 1, | |
| 1200 | + garOrderCarType: item, | |
| 1201 | + id: garCarLabelInfoList.value[item].id, | |
| 1202 | + containerVolume: garCarLabelInfoList.value[item].containerVolume | |
| 1203 | + } | |
| 1204 | + }) | |
| 1205 | + // 设置默认车辆 | |
| 1206 | + paramFrom.value.carType = candidates.value[0][0]; | |
| 1207 | + garCarLabelInfoNow.value = garCarLabelInfoList.value[paramFrom.value.carType] | |
| 1208 | + console.log(garCarLabelInfoList.value, garCarInfoList.value, paramFrom.value.carType); | |
| 1209 | + }) | |
| 1210 | +} | |
| 1211 | + | |
| 1212 | +// 指定人员 | |
| 1213 | + | |
| 1214 | +// 指定人员 | |
| 1215 | +const handleDriverDispatchConfirm = (val) => { | |
| 1216 | + console.log(val); | |
| 1217 | + if (!val) { | |
| 1218 | + return; | |
| 1409 | 1219 | } |
| 1410 | 1220 | |
| 1411 | - .order-detail-container { | |
| 1412 | - height: 100%; | |
| 1413 | - width: 100%; | |
| 1414 | - background-color: $u-info-light; | |
| 1415 | - box-sizing: border-box; | |
| 1416 | - overflow-y: scroll; | |
| 1417 | - background: linear-gradient(to bottom, #19a97c, $u-info-light, $u-info-light, $u-info-light); | |
| 1221 | + // 获取订单车辆数量 | |
| 1222 | + const orderCarCount = dataGram.value?.garCarInfoList?.length || 0; | |
| 1418 | 1223 | |
| 1224 | + // 计算选择的驾驶员数量 | |
| 1225 | + const selectedDriverCount = Object.keys(val).length; | |
| 1419 | 1226 | |
| 1420 | - .order-detail-container-box { | |
| 1421 | - height: 100%; | |
| 1422 | - width: 100%; | |
| 1423 | - padding: $custom-page-padding; | |
| 1424 | - box-sizing: border-box; | |
| 1227 | + // 检查驾驶员数量是否超过订单车辆数量 | |
| 1228 | + if (selectedDriverCount > orderCarCount) { | |
| 1229 | + jumpPrompt(`选择的驾驶员数量不能超过${orderCarCount}个`); | |
| 1230 | + return; | |
| 1231 | + } | |
| 1425 | 1232 | |
| 1426 | - .order-detail-top { | |
| 1427 | - @include card(); | |
| 1233 | + // 判断是否是重新分配(订单状态为1) | |
| 1234 | + const isReassigning = dataGram.value?.garOrderHandlerStatus === 1; | |
| 1428 | 1235 | |
| 1429 | - .order-detail-top-box { | |
| 1430 | - .order-detail-top-box-step { | |
| 1431 | - u-steps { | |
| 1432 | - u-steps-item {} | |
| 1433 | - } | |
| 1434 | - } | |
| 1435 | - } | |
| 1436 | - } | |
| 1236 | + if (isReassigning) { | |
| 1237 | + // 如果是重新分配,直接调用接口分配驾驶员 | |
| 1238 | + let data = { | |
| 1239 | + garOrderId: orderId.value, | |
| 1240 | + dispatchList: [] | |
| 1241 | + } | |
| 1242 | + for (const key in val) { | |
| 1243 | + data.dispatchList.push({ | |
| 1244 | + ...val[key] | |
| 1245 | + }); | |
| 1246 | + } | |
| 1437 | 1247 | |
| 1248 | + dispatchOrders(data).then(res => { | |
| 1249 | + if (res.data.success) { | |
| 1250 | + uni.$u.toast("驾驶员重新分配成功"); | |
| 1251 | + // 更新界面数据 | |
| 1252 | + handleOrderDetail(orderId.value); | |
| 1253 | + refreshOrderData(); | |
| 1254 | + // 标记驾驶员已分配 | |
| 1255 | + driverAssigned.value = true; | |
| 1256 | + } else { | |
| 1257 | + uni.$u.toast("指定人员失败,请重试"); | |
| 1258 | + } | |
| 1259 | + clashDriverDispatchRef.value.close(); | |
| 1260 | + }); | |
| 1261 | + } else { | |
| 1262 | + // 初次分配,将待分配的驾驶员存储起来,但不立即调用后端接口 | |
| 1263 | + pendingDriverAssignments.value = { ...val }; | |
| 1438 | 1264 | |
| 1439 | - .order-detail-container-box-card { | |
| 1440 | - @include card(); | |
| 1265 | + // 显示提示信息 | |
| 1266 | + uni.$u.toast("驾驶员已选择,将在开始运输时分配"); | |
| 1441 | 1267 | |
| 1442 | - .order-detail-container-header-card-title { | |
| 1443 | - font-weight: bold; | |
| 1444 | - line-height: 80rpx; | |
| 1445 | - border-bottom: 3rpx solid $u-info-light; | |
| 1446 | - margin-bottom: $custom-marin-bottom; | |
| 1447 | - color: $u-primary; | |
| 1448 | - display: flex; | |
| 1449 | - align-items: center; | |
| 1268 | + // 关闭弹窗 | |
| 1269 | + clashDriverDispatchRef.value.close(); | |
| 1270 | + } | |
| 1271 | +} | |
| 1450 | 1272 | |
| 1451 | - .order-detail-container-header-card-uicon { | |
| 1452 | - background-color: $u-primary; | |
| 1453 | - margin-right: 10rpx; | |
| 1454 | - height: 35rpx; | |
| 1455 | - width: 15rpx; | |
| 1456 | - border-radius: 4rpx; | |
| 1457 | - } | |
| 1458 | - } | |
| 1273 | +const submitUpdateCarInfo = () => { | |
| 1274 | + let garCarInfos = []; | |
| 1275 | + for (const key in garCarInfoList.value) { | |
| 1276 | + garCarInfos.push(garCarInfoList.value[key]) | |
| 1277 | + } | |
| 1459 | 1278 | |
| 1460 | - /* 订单信息标题特殊样式 */ | |
| 1461 | - .order-info-header { | |
| 1462 | - display: flex; | |
| 1463 | - align-items: center; | |
| 1464 | - background: linear-gradient(90deg, #19a97c, #19a97c80); | |
| 1465 | - color: white; | |
| 1466 | - padding: 15rpx; | |
| 1467 | - border-radius: 10rpx; | |
| 1468 | - margin-bottom: 15rpx; | |
| 1469 | - | |
| 1470 | - .order-detail-container-header-card-uicon { | |
| 1471 | - background-color: white; | |
| 1472 | - opacity: 0.8; | |
| 1473 | - margin-right: 8rpx; | |
| 1474 | - height: 25rpx; | |
| 1475 | - width: 6rpx; | |
| 1476 | - border-radius: 3rpx; | |
| 1279 | + let data = { | |
| 1280 | + garOrderId: orderId.value, | |
| 1281 | + garCarInfoList: garCarInfos, | |
| 1282 | + updated: true | |
| 1283 | + } | |
| 1284 | + if (dataGram.value.garOrderAgreementTime) { | |
| 1285 | + let index = dataGram.value.garOrderAgreementTime.indexOf(' ') + 1; | |
| 1286 | + if (index > 0) { | |
| 1287 | + let val = dataGram.value.garOrderAgreementTime.substring(index, dataGram.value.garOrderAgreementTime | |
| 1288 | + .length); | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + if (val == "07:00-08:00" || val == "08:00-09:00" || val == "09:00-10:00" || val == "10:00-11:00" || | |
| 1292 | + val == "11:00-12:00" || val == "12:00-13:00" || val == "13:00-14:00" || | |
| 1293 | + val == "14:00-15:00" || val == "15:00-16:00" || val == "16:00-17:00" || val == "17:00-18:00" || | |
| 1294 | + val == "18:00-19:00" || val == "19:00-20:00" || val == "20:00-21:00" || | |
| 1295 | + val == "21:00-22:00") { | |
| 1296 | + let size = garCarInfos.length; | |
| 1297 | + for (let index = 0; index < size; index++) { | |
| 1298 | + if ((garCarInfos[index].containerVolume == "8" || parseInt(garCarInfos[index] | |
| 1299 | + .containerVolume) >= 8) && garCarInfos[index].garOrderCarNumber > 0) { | |
| 1300 | + console.log(garCarInfos[index]); | |
| 1301 | + | |
| 1302 | + jumpPrompt("中大型车辆只能选择22:00-07:00时间段"); | |
| 1303 | + return; | |
| 1477 | 1304 | } |
| 1478 | 1305 | |
| 1479 | - .title-text { | |
| 1480 | - font-size: 28rpx; | |
| 1481 | - font-weight: bold; | |
| 1482 | - } | |
| 1483 | 1306 | } |
| 1307 | + } | |
| 1484 | 1308 | |
| 1485 | - .order-detail-container-header-item { | |
| 1486 | - display: flex; | |
| 1487 | - margin-bottom: $custom-marin-bottom; | |
| 1309 | + } | |
| 1488 | 1310 | |
| 1489 | - .order-detail-container-header-title { | |
| 1490 | - color: $u-main-color; | |
| 1491 | - white-space: nowrap; | |
| 1492 | - color: $u-info; | |
| 1311 | + } | |
| 1312 | + console.log(dataGram.value.garOrderAgreementTime); | |
| 1313 | + console.log(garCarInfos); | |
| 1314 | + console.log("=================================>"); | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + updateOrder(data).then(res => { | |
| 1318 | + if (res.data.code == 200) { | |
| 1319 | + uni.$u.toast("车辆信息修改成功") | |
| 1320 | + // 更新数据 | |
| 1321 | + handleOrderDetail(orderId.value) | |
| 1322 | + // 关闭弹窗 | |
| 1323 | + carPopupShowFlag.value = false | |
| 1324 | + } | |
| 1325 | + }).catch(err => { | |
| 1326 | + uni.$u.toast("修改失败,请重试") | |
| 1327 | + }) | |
| 1328 | +} | |
| 1329 | + | |
| 1330 | + | |
| 1331 | +const deleteHandler = (handler) => { | |
| 1332 | + uni.showModal({ | |
| 1333 | + title: '确认删除', | |
| 1334 | + content: `确定要删除处理人员 ${handler.garOrderHandlerName} 吗?`, | |
| 1335 | + success: function (res) { | |
| 1336 | + if (res.confirm) { | |
| 1337 | + deleteDriverByOrderNo(orderNo.value, handler.garHandlerCarCode).then(res => { | |
| 1338 | + if (res.data.success) { | |
| 1339 | + uni.$u.toast('删除成功'); | |
| 1340 | + // 重新加载处理人员信息 | |
| 1341 | + refreshOrderData(); | |
| 1342 | + // 重新获取驾驶员列表 | |
| 1343 | + fetchDriverList(orderId.value); | |
| 1344 | + } else { | |
| 1345 | + uni.$u.toast('删除失败: ' + res.data.msg); | |
| 1493 | 1346 | } |
| 1347 | + }).catch(err => { | |
| 1348 | + uni.$u.toast('删除失败'); | |
| 1349 | + console.error('删除处理人员失败:', err); | |
| 1350 | + }); | |
| 1351 | + } | |
| 1352 | + } | |
| 1353 | + }); | |
| 1354 | +}; | |
| 1494 | 1355 | |
| 1495 | - .order-detail-container-header-content { | |
| 1496 | - display: flex; | |
| 1497 | - } | |
| 1356 | + | |
| 1357 | +const jumpPrompt = (msg) => { | |
| 1358 | + uni.showModal({ | |
| 1359 | + title: '提示', | |
| 1360 | + content: msg, | |
| 1361 | + showCancel: false, | |
| 1362 | + success: function(res) { | |
| 1363 | + if (res.confirm) {} else if (res.cancel) {} | |
| 1364 | + } | |
| 1365 | + }); | |
| 1366 | +} | |
| 1367 | +const showLeftButtons = computed(() => { | |
| 1368 | + return (dataGram.value?.garOrderHandlerStatus === 0 && userType.value == '运输企业负责人' && dataGram.value?.garCancelFlag === 0) || | |
| 1369 | + (dataGram.value?.garOrderScanHandlerFlag === 0 && userType.value == '用户' && dataGram.value?.garOrderHandlerStatus != 3 && dataGram.value?.garAskStatus != '1'); | |
| 1370 | +}); | |
| 1371 | + | |
| 1372 | +const showCenterButtons = computed(() => { | |
| 1373 | + return (dataGram.value?.garOrderHandlerStatus === 0 && userType.value == '运输企业负责人' && dataGram.value?.handleFlag && dataGram.value?.garCancelFlag === 0) || | |
| 1374 | + (dataGram.value?.garOrderHandlerStatus === 1 && userType.value == '运输企业负责人') || | |
| 1375 | + (dataGram.value?.garOrderHandlerStatus === 1 && userType.value == '运输企业负责人' && isAllTripsCompleted()); | |
| 1376 | +}); | |
| 1377 | + | |
| 1378 | +const showRightButtons = computed(() => { | |
| 1379 | + return (dataGram.value?.garOrderHandlerStatus === 0 && userType.value == '用户' && dataGram.value?.garCancelFlag === 0) || | |
| 1380 | + (dataGram.value?.garEvaluateFlag === 0 && userType.value === '用户') || | |
| 1381 | + (dataGram.value?.garHandlerEvaluateFlag === 0 && userType.value === '运输企业负责人' && dataGram.value?.haveEvaluateOfClient == 1) || | |
| 1382 | + (dataGram.value?.garHandlerEvaluateFlag === 1 && userType.value === '运输企业负责人' && dataGram.value?.haveEvaluateOfClient == 1) || | |
| 1383 | + (dataGram.value?.garEvaluateFlag === 1 && userType.value === '用户'); | |
| 1384 | +}); | |
| 1385 | + | |
| 1386 | +const showTopButtons = computed(() => { | |
| 1387 | + return (dataGram.value?.garOrderHandlerStatus === 0 && userType.value == '运输企业负责人' && dataGram.value?.handleFlag && dataGram.value?.garCancelFlag === 0) || | |
| 1388 | + (dataGram.value?.garOrderHandlerStatus === 1 && userType.value == '运输企业负责人' && !isAllTripsCompleted()) || | |
| 1389 | + (dataGram.value?.garOrderHandlerStatus === 1 && userType.value == '运输企业负责人' && isAllTripsCompleted()); | |
| 1390 | +}); | |
| 1391 | +/** | |
| 1392 | + * 初始化信息 | |
| 1393 | + */ | |
| 1394 | +onLoad((options) => { | |
| 1395 | + orderId.value = options.orderId | |
| 1396 | + orderNo.value = options.orderId | |
| 1397 | + handleOrderDetail(orderId.value) | |
| 1398 | + refreshOrderData() | |
| 1399 | +}) | |
| 1400 | + | |
| 1401 | +onShow(() => { | |
| 1402 | + try { | |
| 1403 | + if (isOnloadIn.value) { | |
| 1404 | + handleOrderDetail(orderId.value) | |
| 1405 | + } else { | |
| 1406 | + isOnloadIn.value = true | |
| 1407 | + } | |
| 1408 | + } catch (error) { | |
| 1409 | + console.log(error); | |
| 1410 | + } | |
| 1411 | +}) | |
| 1412 | +</script> | |
| 1413 | + | |
| 1414 | + | |
| 1415 | +<style lang="scss" scoped> | |
| 1416 | +$custom-marin-bottom: 20rpx; | |
| 1417 | +$custom-page-padding: 20rpx; | |
| 1418 | +$custom-border-radio: 20rpx; | |
| 1419 | +$custom-bottom-height: 200rpx; | |
| 1420 | + | |
| 1421 | +@mixin card { | |
| 1422 | + padding: $custom-page-padding; | |
| 1423 | + box-sizing: border-box; | |
| 1424 | + background-color: #ffffff; | |
| 1425 | + border-radius: $custom-border-radio; | |
| 1426 | + margin-bottom: $custom-marin-bottom; | |
| 1427 | +} | |
| 1428 | + | |
| 1429 | +.order-detail-bottom { | |
| 1430 | + position: fixed; | |
| 1431 | + width: 100%; | |
| 1432 | + bottom: 0; | |
| 1433 | + left: 0; | |
| 1434 | + background-color: #fff; | |
| 1435 | + box-shadow: 0 -2rpx 10rpx rgba(0,0,0,0.05); | |
| 1436 | + padding: 20rpx $custom-page-padding; | |
| 1437 | + box-sizing: border-box; | |
| 1438 | + | |
| 1439 | + .order-detail-bottom-box { | |
| 1440 | + display: flex; | |
| 1441 | + flex-direction: column; | |
| 1442 | + gap: 20rpx; | |
| 1443 | + | |
| 1444 | + .order-detail-top-buttons { | |
| 1445 | + width: 100%; | |
| 1446 | + | |
| 1447 | + .button-group-wrap, | |
| 1448 | + .button-group-spread { | |
| 1449 | + display: flex; | |
| 1450 | + gap: 20rpx; | |
| 1451 | + width: 100%; | |
| 1452 | + | |
| 1453 | + u-button { | |
| 1454 | + flex: 1; | |
| 1455 | + height: 72rpx; | |
| 1456 | + line-height: 72rpx; | |
| 1457 | + font-size: 26rpx; | |
| 1458 | + padding: 0 20rpx; | |
| 1459 | + border-radius: 36rpx; | |
| 1498 | 1460 | } |
| 1499 | 1461 | } |
| 1500 | 1462 | |
| 1501 | - /* 车辆信息板块美化 */ | |
| 1463 | + .button-group-spread { | |
| 1464 | + justify-content: space-between; | |
| 1502 | 1465 | |
| 1503 | - /* 车辆信息板块美化 */ | |
| 1504 | - .vehicle-section { | |
| 1505 | - .section-header { | |
| 1506 | - display: flex; | |
| 1507 | - align-items: center; | |
| 1508 | - background: linear-gradient(90deg, #19a97c, #19a97c80); | |
| 1509 | - color: white; | |
| 1510 | - padding: 15rpx; /* 减小内边距 */ | |
| 1511 | - border-radius: 10rpx; /* 减小圆角 */ | |
| 1512 | - margin-bottom: 15rpx; /* 减小外边距 */ | |
| 1466 | + .btn-left, | |
| 1467 | + .btn-right { | |
| 1468 | + flex: 1; | |
| 1469 | + } | |
| 1470 | + } | |
| 1471 | + } | |
| 1513 | 1472 | |
| 1514 | - .header-icon-bar { | |
| 1515 | - background-color: white; | |
| 1516 | - opacity: 0.8; | |
| 1517 | - margin-right: 8rpx; /* 减小右边距 */ | |
| 1518 | - height: 25rpx; /* 减小高度 */ | |
| 1519 | - width: 6rpx; /* 减小宽度 */ | |
| 1520 | - border-radius: 3rpx; | |
| 1521 | - } | |
| 1473 | + .order-detail-bottom-buttons { | |
| 1474 | + display: flex; | |
| 1475 | + flex-direction: column; | |
| 1476 | + width: 100%; | |
| 1477 | + gap: 20rpx; | |
| 1522 | 1478 | |
| 1523 | - .header-title { | |
| 1524 | - font-size: 28rpx; /* 减小字体大小 */ | |
| 1525 | - font-weight: bold; | |
| 1526 | - } | |
| 1479 | + .cancel-button-container { | |
| 1480 | + width: 100%; | |
| 1481 | + | |
| 1482 | + u-button { | |
| 1483 | + width: 100%; | |
| 1484 | + height: 72rpx; | |
| 1485 | + line-height: 72rpx; | |
| 1486 | + font-size: 26rpx; | |
| 1487 | + border-radius: 36rpx; | |
| 1527 | 1488 | } |
| 1489 | + } | |
| 1528 | 1490 | |
| 1529 | - /* 卡片通用样式 */ | |
| 1530 | - .trip-summary-card, .vehicle-info-card, .driver-info-card, .handler-list-card, .assign-trip-card { | |
| 1531 | - background-color: #fff; | |
| 1532 | - border-radius: 10rpx; /* 减小圆角 */ | |
| 1533 | - box-shadow: 0 1rpx 8rpx rgba(0, 0, 0, 0.05); /* 减小阴影 */ | |
| 1534 | - margin-bottom: 15rpx; /* 减小外边距 */ | |
| 1535 | - overflow: hidden; | |
| 1491 | + .evaluation-buttons-container { | |
| 1492 | + display: flex; | |
| 1493 | + gap: 20rpx; | |
| 1494 | + | |
| 1495 | + u-button { | |
| 1496 | + flex: 1; | |
| 1497 | + height: 72rpx; | |
| 1498 | + line-height: 72rpx; | |
| 1499 | + font-size: 26rpx; | |
| 1500 | + border-radius: 36rpx; | |
| 1536 | 1501 | } |
| 1502 | + } | |
| 1503 | + } | |
| 1504 | + } | |
| 1505 | +} | |
| 1537 | 1506 | |
| 1538 | - .card-header { | |
| 1539 | - display: flex; | |
| 1540 | - align-items: center; | |
| 1541 | - padding: 15rpx; /* 减小内边距 */ | |
| 1542 | - background-color: #f5f5f5; | |
| 1543 | - border-bottom: 1rpx solid #eee; | |
| 1507 | +.order-detail-container { | |
| 1508 | + height: 100%; | |
| 1509 | + width: 100%; | |
| 1510 | + background-color: $u-info-light; | |
| 1511 | + box-sizing: border-box; | |
| 1512 | + overflow-y: scroll; | |
| 1513 | + background: linear-gradient(to bottom, #19a97c, $u-info-light, $u-info-light, $u-info-light); | |
| 1544 | 1514 | |
| 1545 | - .card-title { | |
| 1546 | - font-weight: bold; | |
| 1547 | - color: #333; | |
| 1548 | - margin-left: 8rpx; /* 减小左边距 */ | |
| 1549 | - font-size: 26rpx; /* 减小字体大小 */ | |
| 1515 | + | |
| 1516 | + .order-detail-container-box { | |
| 1517 | + height: 100%; | |
| 1518 | + width: 100%; | |
| 1519 | + padding: $custom-page-padding; | |
| 1520 | + box-sizing: border-box; | |
| 1521 | + | |
| 1522 | + .order-detail-top { | |
| 1523 | + @include card(); | |
| 1524 | + | |
| 1525 | + .order-detail-top-box { | |
| 1526 | + .order-detail-top-box-step { | |
| 1527 | + u-steps { | |
| 1528 | + u-steps-item {} | |
| 1550 | 1529 | } |
| 1551 | 1530 | } |
| 1531 | + } | |
| 1532 | + } | |
| 1552 | 1533 | |
| 1553 | - /* 发车次数摘要 */ | |
| 1554 | - .trip-summary-card { | |
| 1555 | - .summary-content { | |
| 1556 | - display: flex; | |
| 1557 | - align-items: center; | |
| 1558 | - padding: 20rpx 15rpx; /* 减小内边距 */ | |
| 1559 | - background: linear-gradient(90deg, #e8f4f0, #fff); | |
| 1560 | 1534 | |
| 1561 | - .summary-label { | |
| 1562 | - color: #666; | |
| 1563 | - margin-right: 8rpx; /* 减小右边距 */ | |
| 1564 | - font-size: 24rpx; /* 减小字体大小 */ | |
| 1565 | - } | |
| 1535 | + .order-detail-container-box-card { | |
| 1536 | + @include card(); | |
| 1566 | 1537 | |
| 1567 | - .summary-value { | |
| 1568 | - color: #19a97c; | |
| 1569 | - font-weight: bold; | |
| 1570 | - font-size: 28rpx; /* 减小字体大小 */ | |
| 1571 | - margin: 0 4rpx; /* 减小边距 */ | |
| 1572 | - } | |
| 1538 | + .order-detail-container-header-card-title { | |
| 1539 | + font-weight: bold; | |
| 1540 | + line-height: 80rpx; | |
| 1541 | + border-bottom: 3rpx solid $u-info-light; | |
| 1542 | + margin-bottom: $custom-marin-bottom; | |
| 1543 | + color: $u-primary; | |
| 1544 | + display: flex; | |
| 1545 | + align-items: center; | |
| 1573 | 1546 | |
| 1574 | - .summary-unit { | |
| 1575 | - color: #666; | |
| 1576 | - font-size: 24rpx; /* 减小字体大小 */ | |
| 1577 | - } | |
| 1578 | - } | |
| 1547 | + .order-detail-container-header-card-uicon { | |
| 1548 | + background-color: $u-primary; | |
| 1549 | + margin-right: 10rpx; | |
| 1550 | + height: 35rpx; | |
| 1551 | + width: 15rpx; | |
| 1552 | + border-radius: 4rpx; | |
| 1579 | 1553 | } |
| 1554 | + } | |
| 1580 | 1555 | |
| 1581 | - /* 车辆类型详情 */ | |
| 1582 | - .vehicle-info-card { | |
| 1583 | - .car-type-list { | |
| 1584 | - padding: 15rpx; /* 减小内边距 */ | |
| 1556 | + /* 订单信息标题特殊样式 */ | |
| 1557 | + .order-info-header { | |
| 1558 | + display: flex; | |
| 1559 | + align-items: center; | |
| 1560 | + background: linear-gradient(90deg, #19a97c, #19a97c80); | |
| 1561 | + color: white; | |
| 1562 | + padding: 15rpx; | |
| 1563 | + border-radius: 10rpx; | |
| 1564 | + margin-bottom: 15rpx; | |
| 1585 | 1565 | |
| 1586 | - .car-type-item { | |
| 1587 | - display: flex; | |
| 1588 | - flex-wrap: wrap; | |
| 1589 | - padding: 15rpx; /* 减小内边距 */ | |
| 1590 | - background-color: #f8f8f8; | |
| 1591 | - border-radius: 6rpx; /* 减小圆角 */ | |
| 1592 | - margin-bottom: 10rpx; /* 减小外边距 */ | |
| 1566 | + .order-detail-container-header-card-uicon { | |
| 1567 | + background-color: white; | |
| 1568 | + opacity: 0.8; | |
| 1569 | + margin-right: 8rpx; | |
| 1570 | + height: 25rpx; | |
| 1571 | + width: 6rpx; | |
| 1572 | + border-radius: 3rpx; | |
| 1573 | + } | |
| 1593 | 1574 | |
| 1594 | - &:last-child { | |
| 1595 | - margin-bottom: 0; | |
| 1596 | - } | |
| 1575 | + .title-text { | |
| 1576 | + font-size: 28rpx; | |
| 1577 | + font-weight: bold; | |
| 1578 | + } | |
| 1579 | + } | |
| 1597 | 1580 | |
| 1598 | - .car-type-info, .car-count-info { | |
| 1599 | - display: flex; | |
| 1600 | - align-items: center; | |
| 1601 | - width: 100%; | |
| 1602 | - margin-bottom: 8rpx; /* 减小外边距 */ | |
| 1603 | - | |
| 1604 | - &:last-child { | |
| 1605 | - margin-bottom: 0; | |
| 1606 | - } | |
| 1607 | - | |
| 1608 | - .info-label { | |
| 1609 | - color: #666; | |
| 1610 | - margin: 0 8rpx; /* 减小边距 */ | |
| 1611 | - font-size: 24rpx; /* 减小字体大小 */ | |
| 1612 | - min-width: 80rpx; /* 减小最小宽度 */ | |
| 1613 | - } | |
| 1614 | - | |
| 1615 | - .info-value { | |
| 1616 | - color: #333; | |
| 1617 | - font-weight: 500; | |
| 1618 | - font-size: 24rpx; /* 减小字体大小 */ | |
| 1619 | - } | |
| 1620 | - } | |
| 1621 | - } | |
| 1622 | - } | |
| 1581 | + .order-detail-container-header-item { | |
| 1582 | + display: flex; | |
| 1583 | + margin-bottom: $custom-marin-bottom; | |
| 1584 | + | |
| 1585 | + .order-detail-container-header-title { | |
| 1586 | + color: $u-main-color; | |
| 1587 | + white-space: nowrap; | |
| 1588 | + color: $u-info; | |
| 1623 | 1589 | } |
| 1624 | 1590 | |
| 1625 | - /* 驾驶员信息 */ | |
| 1626 | - .driver-info-card { | |
| 1627 | - .driver-list { | |
| 1628 | - padding: 15rpx; /* 减小内边距 */ | |
| 1591 | + .order-detail-container-header-content { | |
| 1592 | + display: flex; | |
| 1593 | + } | |
| 1594 | + } | |
| 1595 | + } | |
| 1629 | 1596 | |
| 1630 | - .driver-item { | |
| 1631 | - padding: 15rpx; /* 减小内边距 */ | |
| 1632 | - background-color: #f8f8f8; | |
| 1633 | - border-radius: 6rpx; /* 减小圆角 */ | |
| 1634 | - margin-bottom: 10rpx; /* 减小外边距 */ | |
| 1597 | + /* 车辆信息板块美化 */ | |
| 1635 | 1598 | |
| 1636 | - &:last-child { | |
| 1637 | - margin-bottom: 0; | |
| 1638 | - } | |
| 1599 | + /* 车辆信息板块美化 */ | |
| 1600 | + .vehicle-section { | |
| 1601 | + .section-header { | |
| 1602 | + display: flex; | |
| 1603 | + align-items: center; | |
| 1604 | + background: linear-gradient(90deg, #19a97c, #19a97c80); | |
| 1605 | + color: white; | |
| 1606 | + padding: 15rpx; /* 减小内边距 */ | |
| 1607 | + border-radius: 10rpx; /* 减小圆角 */ | |
| 1608 | + margin-bottom: 15rpx; /* 减小外边距 */ | |
| 1609 | + | |
| 1610 | + .header-icon-bar { | |
| 1611 | + background-color: white; | |
| 1612 | + opacity: 0.8; | |
| 1613 | + margin-right: 8rpx; /* 减小右边距 */ | |
| 1614 | + height: 25rpx; /* 减小高度 */ | |
| 1615 | + width: 6rpx; /* 减小宽度 */ | |
| 1616 | + border-radius: 3rpx; | |
| 1617 | + } | |
| 1639 | 1618 | |
| 1640 | - .driver-basic-info, .driver-car-info { | |
| 1641 | - display: flex; | |
| 1642 | - align-items: center; | |
| 1643 | - margin-bottom: 8rpx; /* 减小外边距 */ | |
| 1644 | - | |
| 1645 | - &:last-child { | |
| 1646 | - margin-bottom: 0; | |
| 1647 | - } | |
| 1648 | - | |
| 1649 | - .info-label { | |
| 1650 | - color: #666; | |
| 1651 | - margin: 0 8rpx; /* 减小边距 */ | |
| 1652 | - font-size: 24rpx; /* 减小字体大小 */ | |
| 1653 | - min-width: 100rpx; /* 减小最小宽度 */ | |
| 1654 | - } | |
| 1655 | - | |
| 1656 | - .info-value { | |
| 1657 | - color: #333; | |
| 1658 | - font-weight: 500; | |
| 1659 | - font-size: 24rpx; /* 减小字体大小 */ | |
| 1660 | - } | |
| 1661 | - } | |
| 1619 | + .header-title { | |
| 1620 | + font-size: 28rpx; /* 减小字体大小 */ | |
| 1621 | + font-weight: bold; | |
| 1622 | + } | |
| 1623 | + } | |
| 1662 | 1624 | |
| 1663 | - .driver-status { | |
| 1664 | - text-align: right; | |
| 1665 | - margin-top: 8rpx; /* 减小外边距 */ | |
| 1666 | - } | |
| 1667 | - } | |
| 1625 | + /* 卡片通用样式 */ | |
| 1626 | + .trip-summary-card, .vehicle-info-card, .driver-info-card, .handler-list-card, .assign-trip-card { | |
| 1627 | + background-color: #fff; | |
| 1628 | + border-radius: 10rpx; /* 减小圆角 */ | |
| 1629 | + box-shadow: 0 1rpx 8rpx rgba(0, 0, 0, 0.05); /* 减小阴影 */ | |
| 1630 | + margin-bottom: 15rpx; /* 减小外边距 */ | |
| 1631 | + overflow: hidden; | |
| 1632 | + } | |
| 1633 | + | |
| 1634 | + .card-header { | |
| 1635 | + display: flex; | |
| 1636 | + align-items: center; | |
| 1637 | + padding: 15rpx; /* 减小内边距 */ | |
| 1638 | + background-color: #f5f5f5; | |
| 1639 | + border-bottom: 1rpx solid #eee; | |
| 1640 | + | |
| 1641 | + .card-title { | |
| 1642 | + font-weight: bold; | |
| 1643 | + color: #333; | |
| 1644 | + margin-left: 8rpx; /* 减小左边距 */ | |
| 1645 | + font-size: 26rpx; /* 减小字体大小 */ | |
| 1646 | + } | |
| 1647 | + } | |
| 1648 | + | |
| 1649 | + /* 发车次数摘要 */ | |
| 1650 | + .trip-summary-card { | |
| 1651 | + .summary-content { | |
| 1652 | + display: flex; | |
| 1653 | + align-items: center; | |
| 1654 | + padding: 20rpx 15rpx; /* 减小内边距 */ | |
| 1655 | + background: linear-gradient(90deg, #e8f4f0, #fff); | |
| 1656 | + | |
| 1657 | + .summary-label { | |
| 1658 | + color: #666; | |
| 1659 | + margin-right: 8rpx; /* 减小右边距 */ | |
| 1660 | + font-size: 24rpx; /* 减小字体大小 */ | |
| 1661 | + } | |
| 1662 | + | |
| 1663 | + .summary-value { | |
| 1664 | + color: #19a97c; | |
| 1665 | + font-weight: bold; | |
| 1666 | + font-size: 28rpx; /* 减小字体大小 */ | |
| 1667 | + margin: 0 4rpx; /* 减小边距 */ | |
| 1668 | + } | |
| 1669 | + | |
| 1670 | + .summary-unit { | |
| 1671 | + color: #666; | |
| 1672 | + font-size: 24rpx; /* 减小字体大小 */ | |
| 1668 | 1673 | } |
| 1669 | 1674 | } |
| 1675 | + } | |
| 1670 | 1676 | |
| 1671 | - /* 处理人员信息 */ | |
| 1672 | - .handler-list-card { | |
| 1673 | - .handler-item { | |
| 1677 | + /* 车辆类型详情 */ | |
| 1678 | + .vehicle-info-card { | |
| 1679 | + .car-type-list { | |
| 1680 | + padding: 15rpx; /* 减小内边距 */ | |
| 1681 | + | |
| 1682 | + .car-type-item { | |
| 1674 | 1683 | display: flex; |
| 1675 | - justify-content: space-between; | |
| 1676 | - align-items: center; | |
| 1684 | + flex-wrap: wrap; | |
| 1677 | 1685 | padding: 15rpx; /* 减小内边距 */ |
| 1678 | - border-bottom: 1rpx solid #eee; | |
| 1686 | + background-color: #f8f8f8; | |
| 1687 | + border-radius: 6rpx; /* 减小圆角 */ | |
| 1688 | + margin-bottom: 10rpx; /* 减小外边距 */ | |
| 1679 | 1689 | |
| 1680 | 1690 | &:last-child { |
| 1681 | - border-bottom: none; | |
| 1691 | + margin-bottom: 0; | |
| 1682 | 1692 | } |
| 1683 | 1693 | |
| 1684 | - .handler-basic-info { | |
| 1694 | + .car-type-info, .car-count-info { | |
| 1685 | 1695 | display: flex; |
| 1686 | - flex-direction: column; | |
| 1687 | - | |
| 1688 | - .handler-name { | |
| 1689 | - font-weight: bold; | |
| 1690 | - font-size: 26rpx; /* 减小字体大小 */ | |
| 1691 | - color: #333; | |
| 1692 | - margin-bottom: 4rpx; /* 减小外边距 */ | |
| 1693 | - } | |
| 1696 | + align-items: center; | |
| 1697 | + width: 100%; | |
| 1698 | + margin-bottom: 8rpx; /* 减小外边距 */ | |
| 1694 | 1699 | |
| 1695 | - .handler-car, .handler-volume { | |
| 1696 | - font-size: 22rpx; /* 减小字体大小 */ | |
| 1697 | - color: #666; | |
| 1698 | - margin-right: 10rpx; /* 减小右边距 */ | |
| 1700 | + &:last-child { | |
| 1701 | + margin-bottom: 0; | |
| 1699 | 1702 | } |
| 1700 | - } | |
| 1701 | 1703 | |
| 1702 | - .handler-trip-count { | |
| 1703 | - display: flex; | |
| 1704 | - flex-direction: column; | |
| 1705 | - align-items: flex-end; | |
| 1706 | - | |
| 1707 | - .count-label { | |
| 1708 | - font-size: 22rpx; /* 减小字体大小 */ | |
| 1704 | + .info-label { | |
| 1709 | 1705 | color: #666; |
| 1710 | - margin-bottom: 4rpx; /* 减小外边距 */ | |
| 1706 | + margin: 0 8rpx; /* 减小边距 */ | |
| 1707 | + font-size: 24rpx; /* 减小字体大小 */ | |
| 1708 | + min-width: 80rpx; /* 减小最小宽度 */ | |
| 1711 | 1709 | } |
| 1712 | 1710 | |
| 1713 | - .count-value { | |
| 1714 | - font-weight: bold; | |
| 1715 | - color: #19a97c; | |
| 1716 | - font-size: 26rpx; /* 减小字体大小 */ | |
| 1711 | + .info-value { | |
| 1712 | + color: #333; | |
| 1713 | + font-weight: 500; | |
| 1714 | + font-size: 24rpx; /* 减小字体大小 */ | |
| 1717 | 1715 | } |
| 1718 | 1716 | } |
| 1719 | 1717 | } |
| 1720 | 1718 | } |
| 1719 | + } | |
| 1720 | + | |
| 1721 | + /* 驾驶员信息 */ | |
| 1722 | + .driver-info-card { | |
| 1723 | + .driver-list { | |
| 1724 | + padding: 15rpx; /* 减小内边距 */ | |
| 1721 | 1725 | |
| 1722 | - /* 分配趟次 */ | |
| 1723 | - .assign-trip-card { | |
| 1724 | - .assign-content { | |
| 1726 | + .driver-item { | |
| 1725 | 1727 | padding: 15rpx; /* 减小内边距 */ |
| 1728 | + background-color: #f8f8f8; | |
| 1729 | + border-radius: 6rpx; /* 减小圆角 */ | |
| 1730 | + margin-bottom: 10rpx; /* 减小外边距 */ | |
| 1726 | 1731 | |
| 1727 | - .selector-wrapper, .number-box-wrapper { | |
| 1732 | + &:last-child { | |
| 1733 | + margin-bottom: 0; | |
| 1734 | + } | |
| 1735 | + | |
| 1736 | + .driver-basic-info, .driver-car-info { | |
| 1728 | 1737 | display: flex; |
| 1729 | 1738 | align-items: center; |
| 1730 | - margin-bottom: 15rpx; /* 减小外边距 */ | |
| 1739 | + margin-bottom: 8rpx; /* 减小外边距 */ | |
| 1731 | 1740 | |
| 1732 | 1741 | &:last-child { |
| 1733 | 1742 | margin-bottom: 0; |
| 1734 | 1743 | } |
| 1735 | 1744 | |
| 1736 | - .selector-label, .number-label { | |
| 1737 | - width: 140rpx; /* 减小宽度 */ | |
| 1745 | + .info-label { | |
| 1746 | + color: #666; | |
| 1747 | + margin: 0 8rpx; /* 减小边距 */ | |
| 1738 | 1748 | font-size: 24rpx; /* 减小字体大小 */ |
| 1739 | - color: #333; | |
| 1749 | + min-width: 100rpx; /* 减小最小宽度 */ | |
| 1740 | 1750 | } |
| 1741 | 1751 | |
| 1742 | - .handler-selector { | |
| 1743 | - flex: 1; | |
| 1744 | - height: 40rpx; /* 减小高度 */ | |
| 1745 | - border: 1px solid #DCDFE6; | |
| 1746 | - border-radius: 4px; | |
| 1747 | - padding: 0 8rpx; /* 减小内边距 */ | |
| 1748 | - outline: none; | |
| 1752 | + .info-value { | |
| 1753 | + color: #333; | |
| 1754 | + font-weight: 500; | |
| 1749 | 1755 | font-size: 24rpx; /* 减小字体大小 */ |
| 1750 | 1756 | } |
| 1751 | 1757 | } |
| 1752 | 1758 | |
| 1753 | - .confirm-button { | |
| 1754 | - width: 100%; | |
| 1755 | - border-radius: 6rpx; /* 减小圆角 */ | |
| 1756 | - font-size: 26rpx; /* 减小字体大小 */ | |
| 1757 | - height: 40rpx; /* 减小高度 */ | |
| 1759 | + .driver-status { | |
| 1760 | + text-align: right; | |
| 1761 | + margin-top: 8rpx; /* 减小外边距 */ | |
| 1758 | 1762 | } |
| 1759 | 1763 | } |
| 1760 | 1764 | } |
| 1761 | 1765 | } |
| 1762 | - } | |
| 1763 | 1766 | |
| 1767 | + /* 处理人员信息 */ | |
| 1768 | + .handler-list-card { | |
| 1769 | + .handler-item { | |
| 1770 | + display: flex; | |
| 1771 | + justify-content: space-between; | |
| 1772 | + align-items: center; | |
| 1773 | + padding: 15rpx; /* 减小内边距 */ | |
| 1774 | + border-bottom: 1rpx solid #eee; | |
| 1764 | 1775 | |
| 1765 | - .space-box { | |
| 1766 | - padding-bottom: $custom-bottom-height; | |
| 1767 | - margin-bottom: 40rpx; | |
| 1768 | - } | |
| 1776 | + &:last-child { | |
| 1777 | + border-bottom: none; | |
| 1778 | + } | |
| 1769 | 1779 | |
| 1780 | + .handler-basic-info { | |
| 1781 | + display: flex; | |
| 1782 | + flex-direction: column; | |
| 1770 | 1783 | |
| 1771 | - .order-detail-bottom { | |
| 1772 | - position: fixed; // 改为fixed定位,确保始终在底部 | |
| 1773 | - width: 100%; | |
| 1774 | - bottom: 0; | |
| 1775 | - left: 0; | |
| 1776 | - background-color: #fff; // 添加背景色,避免穿透 | |
| 1777 | - box-shadow: 0 -2rpx 10rpx rgba(0,0,0,0.05); // 添加阴影,提升层次感 | |
| 1778 | - padding: 20rpx $custom-page-padding; // 上下内边距,左右和页面一致 | |
| 1779 | - box-sizing: border-box; | |
| 1784 | + .handler-name { | |
| 1785 | + font-weight: bold; | |
| 1786 | + font-size: 26rpx; /* 减小字体大小 */ | |
| 1787 | + color: #333; | |
| 1788 | + margin-bottom: 4rpx; /* 减小外边距 */ | |
| 1789 | + } | |
| 1780 | 1790 | |
| 1781 | - .order-detail-bottom-box { | |
| 1782 | - height: auto; // 取消固定高度,自适应内容 | |
| 1783 | - padding: 0; // 移除原有内边距 | |
| 1784 | - display: flex; | |
| 1785 | - flex-wrap: wrap; // 允许换行 | |
| 1786 | - gap: 16rpx; // 按钮之间统一间距 | |
| 1787 | - align-items: center; | |
| 1788 | - } | |
| 1791 | + .handler-car, .handler-volume { | |
| 1792 | + font-size: 22rpx; /* 减小字体大小 */ | |
| 1793 | + color: #666; | |
| 1794 | + margin-right: 10rpx; /* 减小右边距 */ | |
| 1795 | + } | |
| 1796 | + } | |
| 1789 | 1797 | |
| 1790 | - .button-group-vertical { | |
| 1791 | - display: flex; | |
| 1792 | - flex-direction: column; | |
| 1793 | - gap: 20rpx; | |
| 1794 | - width: 100%; | |
| 1795 | - } | |
| 1798 | + .handler-trip-count { | |
| 1799 | + display: flex; | |
| 1800 | + flex-direction: column; | |
| 1801 | + align-items: flex-end; | |
| 1796 | 1802 | |
| 1797 | - // 左中右三个区域统一处理 | |
| 1798 | - .order-detail-bottom-left, | |
| 1799 | - .order-detail-bottom-center, | |
| 1800 | - .order-detail-bottom-right { | |
| 1801 | - min-width: auto; // 取消最小宽度限制 | |
| 1802 | - flex: 1; // 三个区域平均分配宽度 | |
| 1803 | - display: flex; | |
| 1804 | - justify-content: center; | |
| 1805 | - align-items: center; | |
| 1806 | - } | |
| 1803 | + .count-label { | |
| 1804 | + font-size: 22rpx; /* 减小字体大小 */ | |
| 1805 | + color: #666; | |
| 1806 | + margin-bottom: 4rpx; /* 减小外边距 */ | |
| 1807 | + } | |
| 1807 | 1808 | |
| 1808 | - // 左侧区域单独处理(取消订单按钮) | |
| 1809 | - .order-detail-bottom-left { | |
| 1810 | - justify-content: flex-start; | |
| 1811 | - flex-direction: column; | |
| 1812 | - align-items: flex-start; | |
| 1809 | + .count-value { | |
| 1810 | + font-weight: bold; | |
| 1811 | + color: #19a97c; | |
| 1812 | + font-size: 26rpx; /* 减小字体大小 */ | |
| 1813 | + } | |
| 1814 | + } | |
| 1815 | + | |
| 1816 | + .handler-trip-controls { | |
| 1817 | + display: flex; | |
| 1818 | + align-items: center; | |
| 1819 | + gap: 10rpx; | |
| 1820 | + | |
| 1821 | + .assign-button { | |
| 1822 | + padding: 0 15rpx; | |
| 1823 | + font-size: 22rpx; | |
| 1824 | + height: 50rpx; | |
| 1825 | + line-height: 50rpx; | |
| 1826 | + } | |
| 1827 | + .delete-button { | |
| 1828 | + padding: 0 15rpx; | |
| 1829 | + font-size: 22rpx; | |
| 1830 | + height: 50rpx; | |
| 1831 | + line-height: 50rpx; | |
| 1832 | + } | |
| 1833 | + } | |
| 1834 | + } | |
| 1813 | 1835 | } |
| 1814 | 1836 | |
| 1815 | - // 右侧区域单独处理(评价相关按钮) | |
| 1816 | - .order-detail-bottom-right { | |
| 1817 | - justify-content: flex-end; | |
| 1837 | + /* 分配趟次 */ | |
| 1838 | + .assign-trip-card { | |
| 1839 | + .assign-content { | |
| 1840 | + padding: 15rpx; /* 减小内边距 */ | |
| 1841 | + | |
| 1842 | + .selector-wrapper, .number-box-wrapper { | |
| 1843 | + display: flex; | |
| 1844 | + align-items: center; | |
| 1845 | + margin-bottom: 15rpx; /* 减小外边距 */ | |
| 1846 | + | |
| 1847 | + &:last-child { | |
| 1848 | + margin-bottom: 0; | |
| 1849 | + } | |
| 1850 | + | |
| 1851 | + .selector-label, .number-label { | |
| 1852 | + width: 140rpx; /* 减小宽度 */ | |
| 1853 | + font-size: 24rpx; /* 减小字体大小 */ | |
| 1854 | + color: #333; | |
| 1855 | + } | |
| 1856 | + | |
| 1857 | + .handler-selector { | |
| 1858 | + flex: 1; | |
| 1859 | + height: 40rpx; /* 减小高度 */ | |
| 1860 | + border: 1px solid #DCDFE6; | |
| 1861 | + border-radius: 4px; | |
| 1862 | + padding: 0 8rpx; /* 减小内边距 */ | |
| 1863 | + outline: none; | |
| 1864 | + font-size: 24rpx; /* 减小字体大小 */ | |
| 1865 | + } | |
| 1866 | + } | |
| 1867 | + | |
| 1868 | + .confirm-button { | |
| 1869 | + width: 100%; | |
| 1870 | + border-radius: 6rpx; /* 减小圆角 */ | |
| 1871 | + font-size: 26rpx; /* 减小字体大小 */ | |
| 1872 | + height: 40rpx; /* 减小高度 */ | |
| 1873 | + } | |
| 1874 | + } | |
| 1818 | 1875 | } |
| 1819 | 1876 | } |
| 1877 | + } | |
| 1820 | 1878 | |
| 1821 | - // 中间按钮组优化(分配/处理订单按钮) | |
| 1822 | - .order-detail-bottom-center { | |
| 1823 | - .button-group-wrap { | |
| 1824 | - display: flex; | |
| 1825 | - flex-wrap: wrap; // 超出时自动换行 | |
| 1826 | - gap: 16rpx; // 按钮之间间距 | |
| 1827 | - justify-content: center; | |
| 1828 | - width: 100%; | |
| 1829 | - } | |
| 1830 | 1879 | |
| 1831 | - // 单个按钮样式统一优化 | |
| 1832 | - u-button { | |
| 1833 | - flex: 0 0 auto; // 不自动拉伸 | |
| 1834 | - min-width: 180rpx; // 最小宽度,确保按钮不会太窄 | |
| 1835 | - max-width: 240rpx; // 最大宽度,避免过宽 | |
| 1836 | - height: 72rpx; // 统一按钮高度 | |
| 1837 | - line-height: 72rpx; // 垂直居中 | |
| 1838 | - font-size: 26rpx; // 字体大小优化 | |
| 1839 | - padding: 0 20rpx; | |
| 1840 | - border-radius: 36rpx; // 圆角优化,更美观 | |
| 1841 | - } | |
| 1880 | + .space-box { | |
| 1881 | + padding-bottom: $custom-bottom-height; | |
| 1882 | + margin-bottom: 40rpx; | |
| 1883 | + } | |
| 1842 | 1884 | |
| 1843 | - // 重新分配按钮组样式 | |
| 1844 | - .button-group-spread { | |
| 1845 | - display: flex; | |
| 1846 | - justify-content: space-between; | |
| 1847 | - align-items: center; | |
| 1848 | - width: 100%; | |
| 1849 | - gap: 16rpx; // 中间间距 | |
| 1850 | - } | |
| 1885 | + | |
| 1886 | + .order-detail-bottom { | |
| 1887 | + position: fixed; // 改为fixed定位,确保始终在底部 | |
| 1888 | + width: 100%; | |
| 1889 | + bottom: 0; | |
| 1890 | + left: 0; | |
| 1891 | + background-color: #fff; // 添加背景色,避免穿透 | |
| 1892 | + box-shadow: 0 -2rpx 10rpx rgba(0,0,0,0.05); // 添加阴影,提升层次感 | |
| 1893 | + padding: 20rpx $custom-page-padding; // 上下内边距,左右和页面一致 | |
| 1894 | + box-sizing: border-box; | |
| 1895 | + | |
| 1896 | + .order-detail-bottom-box { | |
| 1897 | + height: auto; // 取消固定高度,自适应内容 | |
| 1898 | + padding: 0; // 移除原有内边距 | |
| 1899 | + display: flex; | |
| 1900 | + flex-wrap: wrap; // 允许换行 | |
| 1901 | + gap: 16rpx; // 按钮之间统一间距 | |
| 1902 | + align-items: center; | |
| 1851 | 1903 | } |
| 1852 | 1904 | |
| 1853 | - // 适配小屏幕,当按钮过多时自动换行 | |
| 1854 | - @media (max-width: 375px) { | |
| 1855 | - .order-detail-bottom-box { | |
| 1856 | - gap: 12rpx; | |
| 1857 | - } | |
| 1905 | + .button-group-vertical { | |
| 1906 | + display: flex; | |
| 1907 | + flex-direction: column; | |
| 1908 | + gap: 20rpx; | |
| 1909 | + width: 100%; | |
| 1910 | + } | |
| 1858 | 1911 | |
| 1859 | - .order-detail-bottom-center u-button { | |
| 1860 | - min-width: 160rpx; | |
| 1861 | - font-size: 24rpx; | |
| 1862 | - height: 68rpx; | |
| 1863 | - line-height: 68rpx; | |
| 1864 | - } | |
| 1912 | + // 左中右三个区域统一处理 | |
| 1913 | + .order-detail-bottom-left, | |
| 1914 | + .order-detail-bottom-center, | |
| 1915 | + .order-detail-bottom-right { | |
| 1916 | + min-width: auto; // 取消最小宽度限制 | |
| 1917 | + flex: 1; // 三个区域平均分配宽度 | |
| 1918 | + display: flex; | |
| 1919 | + justify-content: center; | |
| 1920 | + align-items: center; | |
| 1865 | 1921 | } |
| 1866 | - } | |
| 1867 | - | |
| 1868 | - .mask-container { | |
| 1869 | - position: fixed; | |
| 1870 | - top: 0; | |
| 1871 | - left: 0; | |
| 1872 | - width: 100%; | |
| 1873 | - height: 100%; | |
| 1874 | - z-index: 999; | |
| 1875 | - background-color: rgba(0, 0, 0, 0.5); | |
| 1876 | - display: flex; | |
| 1877 | - align-items: center; | |
| 1878 | - justify-content: center; | |
| 1879 | - } | |
| 1880 | - | |
| 1881 | - // 弹出框 | |
| 1882 | - .company-clean-container-car-popup { | |
| 1883 | - min-height: 450rpx; | |
| 1884 | - padding: $custom-page-padding; | |
| 1885 | - box-sizing: border-box; | |
| 1886 | - | |
| 1887 | - .company-clean-container-car-popup-content { | |
| 1888 | - font-size: 28rpx; | |
| 1889 | - | |
| 1890 | - .company-clean-container-car-popup-content-box { | |
| 1891 | - box-sizing: border-box; | |
| 1892 | - padding: $custom-page-padding; | |
| 1893 | - border: 2rpx solid #19a97c; | |
| 1894 | - border-radius: 10rpx; | |
| 1895 | - | |
| 1896 | - .company-clean-container-car-popup-content-box-item { | |
| 1897 | - display: flex; | |
| 1898 | - align-items: center; | |
| 1899 | - justify-content: space-between; | |
| 1900 | - margin: 20rpx 0; | |
| 1901 | - box-sizing: border-box; | |
| 1902 | - | |
| 1903 | - .company-clean-container-car-popup-content-box-item-text {} | |
| 1904 | - | |
| 1905 | - .company-clean-container-car-popup-content-box-item-number {} | |
| 1906 | - } | |
| 1907 | - } | |
| 1908 | - | |
| 1909 | - .company-clean-container-car-popup-content-title { | |
| 1910 | - color: $u-main-color; | |
| 1911 | - box-sizing: border-box; | |
| 1912 | - margin-bottom: 20rpx; | |
| 1913 | - font-size: 30rpx; | |
| 1914 | - font-weight: bold; | |
| 1915 | - } | |
| 1916 | - } | |
| 1917 | - | |
| 1918 | - .company-clean-container-car-popup-button-safe { | |
| 1919 | - width: 100%; | |
| 1920 | - height: $custom-bottom-height; | |
| 1921 | - box-sizing: border-box; | |
| 1922 | - padding: 20rpx; | |
| 1923 | - | |
| 1924 | - .company-clean-container-car-popup-button-safe-btn { | |
| 1925 | - width: 100%; | |
| 1926 | - height: 100%; | |
| 1927 | - border-radius: 10rpx; | |
| 1928 | - font-size: 30rpx; | |
| 1929 | - line-height: 100rpx; | |
| 1930 | - text-align: center; | |
| 1931 | - } | |
| 1932 | - } | |
| 1933 | - } | |
| 1934 | - .image-group { | |
| 1935 | - margin-bottom: 20px; | |
| 1936 | - padding: 10px; | |
| 1937 | - background-color: #f5f5f5; | |
| 1938 | - border-radius: 5px; | |
| 1939 | - } | |
| 1940 | - | |
| 1941 | - .image-group-title { | |
| 1942 | - margin-bottom: 10px; | |
| 1943 | - font-weight: bold; | |
| 1944 | - color: #333; | |
| 1945 | - } | |
| 1946 | 1922 | |
| 1947 | -/* 确保u-upload组件内的图片水平排列 */ | |
| 1948 | - .image-group .u-upload { | |
| 1949 | - display: flex; | |
| 1950 | - flex-wrap: wrap; | |
| 1951 | - } | |
| 1952 | - .image-group-header { | |
| 1953 | - display: flex; | |
| 1954 | - justify-content: space-between; | |
| 1955 | - align-items: center; | |
| 1956 | - margin-bottom: 10rpx; | |
| 1923 | + // 左侧区域单独处理(取消订单按钮) | |
| 1924 | + .order-detail-bottom-left { | |
| 1925 | + justify-content: flex-start; | |
| 1926 | + flex-direction: column; | |
| 1927 | + align-items: flex-start; | |
| 1928 | + } | |
| 1929 | + | |
| 1930 | + // 右侧区域单独处理(评价相关按钮) | |
| 1931 | + .order-detail-bottom-right { | |
| 1932 | + justify-content: flex-end; | |
| 1933 | + } | |
| 1957 | 1934 | } |
| 1958 | 1935 | |
| 1959 | - .car-status { | |
| 1960 | - padding: 4rpx 12rpx; | |
| 1961 | - border-radius: 6rpx; | |
| 1962 | - font-size: 24rpx; | |
| 1963 | - font-weight: bold; | |
| 1936 | + // 中间按钮组优化(分配/处理订单按钮) | |
| 1937 | + .order-detail-bottom-center { | |
| 1938 | + .button-group-wrap { | |
| 1939 | + display: flex; | |
| 1940 | + flex-wrap: wrap; // 超出时自动换行 | |
| 1941 | + gap: 16rpx; // 按钮之间间距 | |
| 1942 | + justify-content: center; | |
| 1943 | + width: 100%; | |
| 1944 | + } | |
| 1964 | 1945 | |
| 1965 | - &.in-transit { | |
| 1966 | - background-color: #fff7e6; | |
| 1967 | - color: #ff9900; | |
| 1946 | + // 单个按钮样式统一优化 | |
| 1947 | + u-button { | |
| 1948 | + flex: 0 0 auto; // 不自动拉伸 | |
| 1949 | + min-width: 180rpx; // 最小宽度,确保按钮不会太窄 | |
| 1950 | + max-width: 240rpx; // 最大宽度,避免过宽 | |
| 1951 | + height: 72rpx; // 统一按钮高度 | |
| 1952 | + line-height: 72rpx; // 垂直居中 | |
| 1953 | + font-size: 26rpx; // 字体大小优化 | |
| 1954 | + padding: 0 20rpx; | |
| 1955 | + border-radius: 36rpx; // 圆角优化,更美观 | |
| 1968 | 1956 | } |
| 1969 | 1957 | |
| 1970 | - &.completed { | |
| 1971 | - background-color: #e6f7ff; | |
| 1972 | - color: #19a97c; | |
| 1958 | + // 重新分配按钮组样式 | |
| 1959 | + .button-group-spread { | |
| 1960 | + display: flex; | |
| 1961 | + justify-content: space-between; | |
| 1962 | + align-items: center; | |
| 1963 | + width: 100%; | |
| 1964 | + gap: 16rpx; // 中间间距 | |
| 1973 | 1965 | } |
| 1974 | 1966 | } |
| 1975 | - .driver-list-popup { | |
| 1976 | - min-height: 400rpx; | |
| 1977 | - max-height: 800rpx; | |
| 1978 | - padding: $custom-page-padding; | |
| 1979 | - box-sizing: border-box; | |
| 1980 | 1967 | |
| 1981 | - .driver-list-popup-header { | |
| 1982 | - text-align: center; | |
| 1983 | - margin-bottom: 30rpx; | |
| 1984 | - | |
| 1985 | - .driver-list-popup-title { | |
| 1986 | - font-size: 32rpx; | |
| 1987 | - font-weight: bold; | |
| 1988 | - color: $u-main-color; | |
| 1989 | - } | |
| 1968 | + // 适配小屏幕,当按钮过多时自动换行 | |
| 1969 | + @media (max-width: 375px) { | |
| 1970 | + .order-detail-bottom-box { | |
| 1971 | + gap: 12rpx; | |
| 1990 | 1972 | } |
| 1991 | 1973 | |
| 1992 | - .driver-list-popup-content { | |
| 1993 | - max-height: 600rpx; | |
| 1994 | - overflow-y: auto; | |
| 1974 | + .order-detail-bottom-center u-button { | |
| 1975 | + min-width: 160rpx; | |
| 1976 | + font-size: 24rpx; | |
| 1977 | + height: 68rpx; | |
| 1978 | + line-height: 68rpx; | |
| 1979 | + } | |
| 1980 | + } | |
| 1981 | +} | |
| 1982 | + | |
| 1983 | +.mask-container { | |
| 1984 | + position: fixed; | |
| 1985 | + top: 0; | |
| 1986 | + left: 0; | |
| 1987 | + width: 100%; | |
| 1988 | + height: 100%; | |
| 1989 | + z-index: 999; | |
| 1990 | + background-color: rgba(0, 0, 0, 0.5); | |
| 1991 | + display: flex; | |
| 1992 | + align-items: center; | |
| 1993 | + justify-content: center; | |
| 1994 | +} | |
| 1995 | + | |
| 1996 | +// 弹出框 | |
| 1997 | +.company-clean-container-car-popup { | |
| 1998 | + min-height: 450rpx; | |
| 1999 | + padding: $custom-page-padding; | |
| 2000 | + box-sizing: border-box; | |
| 2001 | + | |
| 2002 | + .company-clean-container-car-popup-content { | |
| 2003 | + font-size: 28rpx; | |
| 2004 | + | |
| 2005 | + .company-clean-container-car-popup-content-box { | |
| 2006 | + box-sizing: border-box; | |
| 2007 | + padding: $custom-page-padding; | |
| 2008 | + border: 2rpx solid #19a97c; | |
| 2009 | + border-radius: 10rpx; | |
| 1995 | 2010 | |
| 1996 | - .driver-item { | |
| 2011 | + .company-clean-container-car-popup-content-box-item { | |
| 1997 | 2012 | display: flex; |
| 1998 | - justify-content: space-between; | |
| 1999 | 2013 | align-items: center; |
| 2000 | - padding: 20rpx 0; | |
| 2001 | - border-bottom: 1rpx solid $u-border-color; | |
| 2002 | - | |
| 2003 | - .driver-info { | |
| 2004 | - display: flex; | |
| 2005 | - flex-direction: column; | |
| 2014 | + justify-content: space-between; | |
| 2015 | + margin: 20rpx 0; | |
| 2016 | + box-sizing: border-box; | |
| 2006 | 2017 | |
| 2007 | - .driver-name { | |
| 2008 | - font-size: 28rpx; | |
| 2009 | - font-weight: bold; | |
| 2010 | - margin-bottom: 10rpx; | |
| 2011 | - } | |
| 2018 | + .company-clean-container-car-popup-content-box-item-text {} | |
| 2012 | 2019 | |
| 2013 | - .driver-phone { | |
| 2014 | - font-size: 24rpx; | |
| 2015 | - color: $u-tips-color; | |
| 2016 | - } | |
| 2017 | - } | |
| 2020 | + .company-clean-container-car-popup-content-box-item-number {} | |
| 2018 | 2021 | } |
| 2019 | 2022 | } |
| 2020 | 2023 | |
| 2021 | - .driver-list-popup-footer { | |
| 2022 | - margin-top: 30rpx; | |
| 2023 | - text-align: center; | |
| 2024 | + .company-clean-container-car-popup-content-title { | |
| 2025 | + color: $u-main-color; | |
| 2026 | + box-sizing: border-box; | |
| 2027 | + margin-bottom: 20rpx; | |
| 2028 | + font-size: 30rpx; | |
| 2029 | + font-weight: bold; | |
| 2024 | 2030 | } |
| 2025 | 2031 | } |
| 2026 | - .driver-info-container { | |
| 2027 | - .driver-info-row { | |
| 2028 | - display: flex; | |
| 2029 | - flex-wrap: wrap; | |
| 2030 | - padding: 10rpx 0; | |
| 2031 | - border-bottom: 1rpx solid $u-border-color; | |
| 2032 | - justify-content: flex-start; | |
| 2033 | 2032 | |
| 2034 | - .driver-name, .car-code { | |
| 2035 | - margin-right: 20rpx; | |
| 2036 | - color: $u-main-color; | |
| 2037 | - } | |
| 2033 | + .company-clean-container-car-popup-button-safe { | |
| 2034 | + width: 100%; | |
| 2035 | + height: $custom-bottom-height; | |
| 2036 | + box-sizing: border-box; | |
| 2037 | + padding: 20rpx; | |
| 2038 | 2038 | |
| 2039 | - .driver-name { | |
| 2040 | - font-weight: bold; | |
| 2041 | - } | |
| 2039 | + .company-clean-container-car-popup-button-safe-btn { | |
| 2040 | + width: 100%; | |
| 2041 | + height: 100%; | |
| 2042 | + border-radius: 10rpx; | |
| 2043 | + font-size: 30rpx; | |
| 2044 | + line-height: 100rpx; | |
| 2045 | + text-align: center; | |
| 2042 | 2046 | } |
| 2047 | + } | |
| 2048 | +} | |
| 2049 | +.image-group { | |
| 2050 | + margin-bottom: 20px; | |
| 2051 | + padding: 10px; | |
| 2052 | + background-color: #f5f5f5; | |
| 2053 | + border-radius: 5px; | |
| 2054 | +} | |
| 2055 | + | |
| 2056 | +.image-group-title { | |
| 2057 | + margin-bottom: 10px; | |
| 2058 | + font-weight: bold; | |
| 2059 | + color: #333; | |
| 2060 | +} | |
| 2043 | 2061 | |
| 2044 | - .driver-info-row:last-child { | |
| 2045 | - border-bottom: none; | |
| 2046 | - } | |
| 2062 | +/* 确保u-upload组件内的图片水平排列 */ | |
| 2063 | +.image-group .u-upload { | |
| 2064 | + display: flex; | |
| 2065 | + flex-wrap: wrap; | |
| 2066 | +} | |
| 2067 | +.image-group-header { | |
| 2068 | + display: flex; | |
| 2069 | + justify-content: space-between; | |
| 2070 | + align-items: center; | |
| 2071 | + margin-bottom: 10rpx; | |
| 2072 | +} | |
| 2073 | + | |
| 2074 | +.car-status { | |
| 2075 | + padding: 4rpx 12rpx; | |
| 2076 | + border-radius: 6rpx; | |
| 2077 | + font-size: 24rpx; | |
| 2078 | + font-weight: bold; | |
| 2079 | + | |
| 2080 | + &.in-transit { | |
| 2081 | + background-color: #fff7e6; | |
| 2082 | + color: #ff9900; | |
| 2047 | 2083 | } |
| 2048 | 2084 | |
| 2049 | - /* 车辆类型列表样式 */ | |
| 2050 | - .car-type-info-container { | |
| 2051 | - .car-type-info-header { | |
| 2085 | + &.completed { | |
| 2086 | + background-color: #e6f7ff; | |
| 2087 | + color: #19a97c; | |
| 2088 | + } | |
| 2089 | +} | |
| 2090 | +.driver-list-popup { | |
| 2091 | + min-height: 400rpx; | |
| 2092 | + max-height: 800rpx; | |
| 2093 | + padding: $custom-page-padding; | |
| 2094 | + box-sizing: border-box; | |
| 2095 | + | |
| 2096 | + .driver-list-popup-header { | |
| 2097 | + text-align: center; | |
| 2098 | + margin-bottom: 30rpx; | |
| 2099 | + | |
| 2100 | + .driver-list-popup-title { | |
| 2101 | + font-size: 32rpx; | |
| 2052 | 2102 | font-weight: bold; |
| 2053 | - color: $u-primary; | |
| 2054 | - margin-bottom: 20rpx; | |
| 2055 | - padding-bottom: 15rpx; | |
| 2056 | - border-bottom: 2rpx solid $u-primary; | |
| 2057 | - display: flex; | |
| 2058 | - align-items: center; | |
| 2059 | - | |
| 2060 | - .header-icon { | |
| 2061 | - display: inline-block; | |
| 2062 | - width: 6rpx; | |
| 2063 | - height: 30rpx; | |
| 2064 | - background-color: $u-primary; | |
| 2065 | - border-radius: 3rpx; | |
| 2066 | - margin-right: 15rpx; | |
| 2067 | - } | |
| 2103 | + color: $u-main-color; | |
| 2068 | 2104 | } |
| 2105 | + } | |
| 2106 | + | |
| 2107 | + .driver-list-popup-content { | |
| 2108 | + max-height: 600rpx; | |
| 2109 | + overflow-y: auto; | |
| 2069 | 2110 | |
| 2070 | - .car-type-info-row { | |
| 2111 | + .driver-item { | |
| 2071 | 2112 | display: flex; |
| 2072 | - flex-direction: column; | |
| 2073 | - padding: 20rpx 15rpx; | |
| 2074 | - background-color: #f8f8f8; | |
| 2075 | - border-radius: 12rpx; | |
| 2076 | - margin-bottom: 15rpx; | |
| 2077 | - box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05); | |
| 2113 | + justify-content: space-between; | |
| 2114 | + align-items: center; | |
| 2115 | + padding: 20rpx 0; | |
| 2116 | + border-bottom: 1rpx solid $u-border-color; | |
| 2078 | 2117 | |
| 2079 | - .car-info-item { | |
| 2118 | + .driver-info { | |
| 2080 | 2119 | display: flex; |
| 2081 | - align-items: center; | |
| 2082 | - margin-bottom: 10rpx; | |
| 2083 | - | |
| 2084 | - &:last-child { | |
| 2085 | - margin-bottom: 0; | |
| 2086 | - } | |
| 2087 | - | |
| 2088 | - .car-type-label, .car-count-label { | |
| 2089 | - font-weight: 500; | |
| 2090 | - color: #666; | |
| 2091 | - margin-right: 10rpx; | |
| 2092 | - width: 100rpx; | |
| 2093 | - } | |
| 2120 | + flex-direction: column; | |
| 2094 | 2121 | |
| 2095 | - .car-type-value, .car-count-value { | |
| 2096 | - color: $u-main-color; | |
| 2122 | + .driver-name { | |
| 2123 | + font-size: 28rpx; | |
| 2097 | 2124 | font-weight: bold; |
| 2125 | + margin-bottom: 10rpx; | |
| 2098 | 2126 | } |
| 2099 | 2127 | |
| 2100 | - .car-count-value { | |
| 2101 | - color: $u-primary; | |
| 2128 | + .driver-phone { | |
| 2129 | + font-size: 24rpx; | |
| 2130 | + color: $u-tips-color; | |
| 2102 | 2131 | } |
| 2103 | 2132 | } |
| 2133 | + } | |
| 2134 | + } | |
| 2104 | 2135 | |
| 2105 | - &:last-child { | |
| 2106 | - margin-bottom: 0; | |
| 2107 | - } | |
| 2136 | + .driver-list-popup-footer { | |
| 2137 | + margin-top: 30rpx; | |
| 2138 | + text-align: center; | |
| 2139 | + } | |
| 2140 | +} | |
| 2141 | +.driver-info-container { | |
| 2142 | + .driver-info-row { | |
| 2143 | + display: flex; | |
| 2144 | + flex-wrap: wrap; | |
| 2145 | + padding: 10rpx 0; | |
| 2146 | + border-bottom: 1rpx solid $u-border-color; | |
| 2147 | + justify-content: flex-start; | |
| 2148 | + | |
| 2149 | + .driver-name, .car-code { | |
| 2150 | + margin-right: 20rpx; | |
| 2151 | + color: $u-main-color; | |
| 2152 | + } | |
| 2153 | + | |
| 2154 | + .driver-name { | |
| 2155 | + font-weight: bold; | |
| 2108 | 2156 | } |
| 2109 | 2157 | } |
| 2110 | 2158 | |
| 2111 | - /* 订单信息板块样式 */ | |
| 2112 | - .order-info-section { | |
| 2113 | - .info-item { | |
| 2159 | + .driver-info-row:last-child { | |
| 2160 | + border-bottom: none; | |
| 2161 | + } | |
| 2162 | +} | |
| 2163 | + | |
| 2164 | +/* 车辆类型列表样式 */ | |
| 2165 | +.car-type-info-container { | |
| 2166 | + .car-type-info-header { | |
| 2167 | + font-weight: bold; | |
| 2168 | + color: $u-primary; | |
| 2169 | + margin-bottom: 20rpx; | |
| 2170 | + padding-bottom: 15rpx; | |
| 2171 | + border-bottom: 2rpx solid $u-primary; | |
| 2172 | + display: flex; | |
| 2173 | + align-items: center; | |
| 2174 | + | |
| 2175 | + .header-icon { | |
| 2176 | + display: inline-block; | |
| 2177 | + width: 6rpx; | |
| 2178 | + height: 30rpx; | |
| 2179 | + background-color: $u-primary; | |
| 2180 | + border-radius: 3rpx; | |
| 2181 | + margin-right: 15rpx; | |
| 2182 | + } | |
| 2183 | + } | |
| 2184 | + | |
| 2185 | + .car-type-info-row { | |
| 2186 | + display: flex; | |
| 2187 | + flex-direction: column; | |
| 2188 | + padding: 20rpx 15rpx; | |
| 2189 | + background-color: #f8f8f8; | |
| 2190 | + border-radius: 12rpx; | |
| 2191 | + margin-bottom: 15rpx; | |
| 2192 | + box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05); | |
| 2193 | + | |
| 2194 | + .car-info-item { | |
| 2114 | 2195 | display: flex; |
| 2115 | - padding: 15rpx; | |
| 2116 | - background-color: #f8f8f8; | |
| 2117 | - border-radius: 6rpx; | |
| 2196 | + align-items: center; | |
| 2118 | 2197 | margin-bottom: 10rpx; |
| 2119 | 2198 | |
| 2120 | 2199 | &:last-child { |
| 2121 | 2200 | margin-bottom: 0; |
| 2122 | 2201 | } |
| 2123 | 2202 | |
| 2124 | - .info-label { | |
| 2125 | - display: flex; | |
| 2126 | - align-items: center; | |
| 2127 | - min-width: 140rpx; | |
| 2203 | + .car-type-label, .car-count-label { | |
| 2204 | + font-weight: 500; | |
| 2128 | 2205 | color: #666; |
| 2129 | - font-size: 24rpx; | |
| 2206 | + margin-right: 10rpx; | |
| 2207 | + width: 100rpx; | |
| 2130 | 2208 | } |
| 2131 | 2209 | |
| 2132 | - .info-content { | |
| 2133 | - flex: 1; | |
| 2134 | - display: flex; | |
| 2135 | - align-items: center; | |
| 2136 | - color: #333; | |
| 2137 | - font-size: 24rpx; | |
| 2138 | - | |
| 2139 | - .content-text { | |
| 2140 | - flex: 1; | |
| 2141 | - } | |
| 2210 | + .car-type-value, .car-count-value { | |
| 2211 | + color: $u-main-color; | |
| 2212 | + font-weight: bold; | |
| 2213 | + } | |
| 2142 | 2214 | |
| 2143 | - .qr-code-icon { | |
| 2144 | - margin-left: 10rpx; | |
| 2145 | - } | |
| 2215 | + .car-count-value { | |
| 2216 | + color: $u-primary; | |
| 2146 | 2217 | } |
| 2147 | 2218 | } |
| 2148 | 2219 | |
| 2149 | - /* 处置场地特殊处理 */ | |
| 2150 | - .info-item:nth-child(n+5):nth-child(-n+7) { | |
| 2151 | - .info-label { | |
| 2152 | - min-width: 140rpx; | |
| 2153 | - } | |
| 2220 | + &:last-child { | |
| 2221 | + margin-bottom: 0; | |
| 2154 | 2222 | } |
| 2155 | 2223 | } |
| 2224 | +} | |
| 2156 | 2225 | |
| 2157 | - /* 订单人员板块样式 */ | |
| 2158 | - .order-person-section { | |
| 2159 | - .section-header { | |
| 2160 | - display: flex; | |
| 2161 | - align-items: center; | |
| 2162 | - background: linear-gradient(90deg, #19a97c, #19a97c80); | |
| 2163 | - color: white; | |
| 2164 | - padding: 15rpx; | |
| 2165 | - border-radius: 10rpx; | |
| 2166 | - margin-bottom: 15rpx; | |
| 2226 | +/* 订单信息板块样式 */ | |
| 2227 | +.order-info-section { | |
| 2228 | + .info-item { | |
| 2229 | + display: flex; | |
| 2230 | + padding: 15rpx; | |
| 2231 | + background-color: #f8f8f8; | |
| 2232 | + border-radius: 6rpx; | |
| 2233 | + margin-bottom: 10rpx; | |
| 2167 | 2234 | |
| 2168 | - .header-icon-bar { | |
| 2169 | - background-color: white; | |
| 2170 | - opacity: 0.8; | |
| 2171 | - margin-right: 8rpx; | |
| 2172 | - height: 25rpx; | |
| 2173 | - width: 6rpx; | |
| 2174 | - border-radius: 3rpx; | |
| 2175 | - } | |
| 2235 | + &:last-child { | |
| 2236 | + margin-bottom: 0; | |
| 2237 | + } | |
| 2176 | 2238 | |
| 2177 | - .header-title { | |
| 2178 | - font-size: 28rpx; | |
| 2179 | - font-weight: bold; | |
| 2180 | - } | |
| 2239 | + .info-label { | |
| 2240 | + display: flex; | |
| 2241 | + align-items: center; | |
| 2242 | + min-width: 140rpx; | |
| 2243 | + color: #666; | |
| 2244 | + font-size: 24rpx; | |
| 2181 | 2245 | } |
| 2182 | 2246 | |
| 2183 | - .info-item { | |
| 2247 | + .info-content { | |
| 2248 | + flex: 1; | |
| 2184 | 2249 | display: flex; |
| 2185 | - padding: 15rpx; | |
| 2186 | - background-color: #f8f8f8; | |
| 2187 | - border-radius: 6rpx; | |
| 2188 | - margin-bottom: 10rpx; | |
| 2250 | + align-items: center; | |
| 2251 | + color: #333; | |
| 2252 | + font-size: 24rpx; | |
| 2189 | 2253 | |
| 2190 | - &:last-child { | |
| 2191 | - margin-bottom: 0; | |
| 2254 | + .content-text { | |
| 2255 | + flex: 1; | |
| 2192 | 2256 | } |
| 2193 | 2257 | |
| 2194 | - .info-label { | |
| 2195 | - display: flex; | |
| 2196 | - align-items: center; | |
| 2197 | - min-width: 140rpx; | |
| 2198 | - color: #666; | |
| 2199 | - font-size: 24rpx; | |
| 2258 | + .qr-code-icon { | |
| 2259 | + margin-left: 10rpx; | |
| 2200 | 2260 | } |
| 2261 | + } | |
| 2262 | + } | |
| 2201 | 2263 | |
| 2202 | - .info-content { | |
| 2203 | - flex: 1; | |
| 2204 | - display: flex; | |
| 2205 | - align-items: center; | |
| 2206 | - color: #333; | |
| 2207 | - font-size: 24rpx; | |
| 2264 | + /* 处置场地特殊处理 */ | |
| 2265 | + .info-item:nth-child(n+5):nth-child(-n+7) { | |
| 2266 | + .info-label { | |
| 2267 | + min-width: 140rpx; | |
| 2268 | + } | |
| 2269 | + } | |
| 2270 | +} | |
| 2208 | 2271 | |
| 2209 | - .content-text { | |
| 2210 | - flex: 1; | |
| 2211 | - } | |
| 2272 | +/* 订单人员板块样式 */ | |
| 2273 | +.order-person-section { | |
| 2274 | + .section-header { | |
| 2275 | + display: flex; | |
| 2276 | + align-items: center; | |
| 2277 | + background: linear-gradient(90deg, #19a97c, #19a97c80); | |
| 2278 | + color: white; | |
| 2279 | + padding: 15rpx; | |
| 2280 | + border-radius: 10rpx; | |
| 2281 | + margin-bottom: 15rpx; | |
| 2282 | + | |
| 2283 | + .header-icon-bar { | |
| 2284 | + background-color: white; | |
| 2285 | + opacity: 0.8; | |
| 2286 | + margin-right: 8rpx; | |
| 2287 | + height: 25rpx; | |
| 2288 | + width: 6rpx; | |
| 2289 | + border-radius: 3rpx; | |
| 2290 | + } | |
| 2212 | 2291 | |
| 2213 | - .icon-box { | |
| 2214 | - margin-left: 10rpx; | |
| 2215 | - } | |
| 2216 | - } | |
| 2292 | + .header-title { | |
| 2293 | + font-size: 28rpx; | |
| 2294 | + font-weight: bold; | |
| 2217 | 2295 | } |
| 2218 | 2296 | } |
| 2219 | 2297 | |
| 2220 | - /* 处理信息板块样式 */ | |
| 2221 | - .process-info-section { | |
| 2222 | - .section-header { | |
| 2298 | + .info-item { | |
| 2299 | + display: flex; | |
| 2300 | + padding: 15rpx; | |
| 2301 | + background-color: #f8f8f8; | |
| 2302 | + border-radius: 6rpx; | |
| 2303 | + margin-bottom: 10rpx; | |
| 2304 | + | |
| 2305 | + &:last-child { | |
| 2306 | + margin-bottom: 0; | |
| 2307 | + } | |
| 2308 | + | |
| 2309 | + .info-label { | |
| 2223 | 2310 | display: flex; |
| 2224 | 2311 | align-items: center; |
| 2225 | - background: linear-gradient(90deg, #19a97c, #19a97c80); | |
| 2226 | - color: white; | |
| 2227 | - padding: 15rpx; | |
| 2228 | - border-radius: 10rpx; | |
| 2229 | - margin-bottom: 15rpx; | |
| 2312 | + min-width: 140rpx; | |
| 2313 | + color: #666; | |
| 2314 | + font-size: 24rpx; | |
| 2315 | + } | |
| 2316 | + | |
| 2317 | + .info-content { | |
| 2318 | + flex: 1; | |
| 2319 | + display: flex; | |
| 2320 | + align-items: center; | |
| 2321 | + color: #333; | |
| 2322 | + font-size: 24rpx; | |
| 2230 | 2323 | |
| 2231 | - .header-icon-bar { | |
| 2232 | - background-color: white; | |
| 2233 | - opacity: 0.8; | |
| 2234 | - margin-right: 8rpx; | |
| 2235 | - height: 25rpx; | |
| 2236 | - width: 6rpx; | |
| 2237 | - border-radius: 3rpx; | |
| 2324 | + .content-text { | |
| 2325 | + flex: 1; | |
| 2238 | 2326 | } |
| 2239 | 2327 | |
| 2240 | - .header-title { | |
| 2241 | - font-size: 28rpx; | |
| 2242 | - font-weight: bold; | |
| 2328 | + .icon-box { | |
| 2329 | + margin-left: 10rpx; | |
| 2243 | 2330 | } |
| 2244 | 2331 | } |
| 2332 | + } | |
| 2333 | +} | |
| 2245 | 2334 | |
| 2246 | - .photo-section { | |
| 2247 | - .info-item { | |
| 2248 | - margin-bottom: 15rpx; | |
| 2335 | +/* 处理信息板块样式 */ | |
| 2336 | +.process-info-section { | |
| 2337 | + .section-header { | |
| 2338 | + display: flex; | |
| 2339 | + align-items: center; | |
| 2340 | + background: linear-gradient(90deg, #19a97c, #19a97c80); | |
| 2341 | + color: white; | |
| 2342 | + padding: 15rpx; | |
| 2343 | + border-radius: 10rpx; | |
| 2344 | + margin-bottom: 15rpx; | |
| 2345 | + | |
| 2346 | + .header-icon-bar { | |
| 2347 | + background-color: white; | |
| 2348 | + opacity: 0.8; | |
| 2349 | + margin-right: 8rpx; | |
| 2350 | + height: 25rpx; | |
| 2351 | + width: 6rpx; | |
| 2352 | + border-radius: 3rpx; | |
| 2353 | + } | |
| 2249 | 2354 | |
| 2250 | - .info-label { | |
| 2251 | - display: flex; | |
| 2252 | - align-items: center; | |
| 2253 | - color: #666; | |
| 2254 | - font-size: 24rpx; | |
| 2255 | - } | |
| 2355 | + .header-title { | |
| 2356 | + font-size: 28rpx; | |
| 2357 | + font-weight: bold; | |
| 2358 | + } | |
| 2359 | + } | |
| 2360 | + | |
| 2361 | + .photo-section { | |
| 2362 | + .info-item { | |
| 2363 | + margin-bottom: 15rpx; | |
| 2364 | + | |
| 2365 | + .info-label { | |
| 2366 | + display: flex; | |
| 2367 | + align-items: center; | |
| 2368 | + color: #666; | |
| 2369 | + font-size: 24rpx; | |
| 2256 | 2370 | } |
| 2371 | + } | |
| 2257 | 2372 | |
| 2258 | - .image-groups { | |
| 2259 | - .image-group { | |
| 2260 | - padding: 15rpx; | |
| 2261 | - background-color: #f8f8f8; | |
| 2262 | - border-radius: 6rpx; | |
| 2263 | - margin-bottom: 15rpx; | |
| 2373 | + .image-groups { | |
| 2374 | + .image-group { | |
| 2375 | + padding: 15rpx; | |
| 2376 | + background-color: #f8f8f8; | |
| 2377 | + border-radius: 6rpx; | |
| 2378 | + margin-bottom: 15rpx; | |
| 2264 | 2379 | |
| 2265 | - &:last-child { | |
| 2266 | - margin-bottom: 0; | |
| 2267 | - } | |
| 2380 | + &:last-child { | |
| 2381 | + margin-bottom: 0; | |
| 2382 | + } | |
| 2268 | 2383 | |
| 2269 | - .image-group-header { | |
| 2270 | - display: flex; | |
| 2271 | - justify-content: space-between; | |
| 2272 | - align-items: center; | |
| 2273 | - margin-bottom: 10rpx; | |
| 2384 | + .image-group-header { | |
| 2385 | + display: flex; | |
| 2386 | + justify-content: space-between; | |
| 2387 | + align-items: center; | |
| 2388 | + margin-bottom: 10rpx; | |
| 2274 | 2389 | |
| 2275 | - .image-group-title { | |
| 2276 | - font-size: 24rpx; | |
| 2277 | - font-weight: bold; | |
| 2278 | - color: #333; | |
| 2279 | - } | |
| 2390 | + .image-group-title { | |
| 2391 | + font-size: 24rpx; | |
| 2392 | + font-weight: bold; | |
| 2393 | + color: #333; | |
| 2280 | 2394 | } |
| 2281 | 2395 | } |
| 2282 | 2396 | } |
| 2283 | 2397 | } |
| 2398 | + } | |
| 2284 | 2399 | |
| 2285 | - .empty-image-section { | |
| 2286 | - display: flex; | |
| 2287 | - flex-direction: column; | |
| 2288 | - align-items: center; | |
| 2289 | - justify-content: center; | |
| 2290 | - padding: 30rpx; | |
| 2400 | + .empty-image-section { | |
| 2401 | + display: flex; | |
| 2402 | + flex-direction: column; | |
| 2403 | + align-items: center; | |
| 2404 | + justify-content: center; | |
| 2405 | + padding: 30rpx; | |
| 2291 | 2406 | |
| 2292 | - .empty-text { | |
| 2293 | - margin-top: 20rpx; | |
| 2294 | - color: #999; | |
| 2295 | - font-size: 24rpx; | |
| 2296 | - } | |
| 2407 | + .empty-text { | |
| 2408 | + margin-top: 20rpx; | |
| 2409 | + color: #999; | |
| 2410 | + font-size: 24rpx; | |
| 2297 | 2411 | } |
| 2298 | 2412 | } |
| 2413 | +} | |
| 2299 | 2414 | </style> |
| 2300 | 2415 | \ No newline at end of file | ... | ... |
garbage-removal/src/pages/wode/index.vue
| ... | ... | @@ -34,6 +34,14 @@ |
| 34 | 34 | <text>地址管理</text> |
| 35 | 35 | </view> |
| 36 | 36 | </view> |
| 37 | + <view class="cell-box" @click="toChangePassword" hover-class="handlerClick"> | |
| 38 | + <view class="cell-icon"> | |
| 39 | + <image width="35rpx" height="35rpx" src="../../static/image/address-manager.png"></image> | |
| 40 | + </view> | |
| 41 | + <view class="cell-label"> | |
| 42 | + <text>修改密码</text> | |
| 43 | + </view> | |
| 44 | + </view> | |
| 37 | 45 | <view class="cell-box" @click="handlerChangeRole" hover-class="handlerClick"> |
| 38 | 46 | <view class="cell-icon"> |
| 39 | 47 | <image src="../../static/image/role-change.png"></image> |
| ... | ... | @@ -81,6 +89,12 @@ const userNameMrthod = (userName) => { |
| 81 | 89 | return null == userName?"":undefined == userName?"":"undefined"==userName?"":userName; |
| 82 | 90 | } |
| 83 | 91 | |
| 92 | +const toChangePassword = () => { | |
| 93 | + uni.$u.route({ | |
| 94 | + url: 'pages/change-password/index' | |
| 95 | + }); | |
| 96 | +}; | |
| 97 | + | |
| 84 | 98 | |
| 85 | 99 | const handlerChangeRole = () => { |
| 86 | 100 | uni.showModal({ | ... | ... |