Commit 4d0f0f595bcc24cb37dcf80e6c1abbbc633ccd49
1 parent
1249937f
feat: 新增跳转
Showing
7 changed files
with
81 additions
and
22 deletions
garbage-removal/.hbuilderx/launch.json
0 → 100644
| 1 | +{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/ | |
| 2 | + // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数 | |
| 3 | + "version": "0.0", | |
| 4 | + "configurations": [{ | |
| 5 | + "default" : | |
| 6 | + { | |
| 7 | + "launchtype" : "local" | |
| 8 | + }, | |
| 9 | + "mp-weixin" : | |
| 10 | + { | |
| 11 | + "launchtype" : "local" | |
| 12 | + }, | |
| 13 | + "type" : "uniCloud" | |
| 14 | + } | |
| 15 | + ] | |
| 16 | +} | ... | ... |
garbage-removal/src/manifest.json
| ... | ... | @@ -50,7 +50,7 @@ |
| 50 | 50 | "quickapp" : {}, |
| 51 | 51 | /* 小程序特有相关 */ |
| 52 | 52 | "mp-weixin" : { |
| 53 | - "lazyCodeLoading": "requiredComponents", | |
| 53 | + "lazyCodeLoading" : "requiredComponents", | |
| 54 | 54 | "appid" : "wxc3f60667dc9d6cea", |
| 55 | 55 | "setting" : { |
| 56 | 56 | "urlCheck" : false |
| ... | ... | @@ -58,13 +58,15 @@ |
| 58 | 58 | "usingComponents" : true |
| 59 | 59 | }, |
| 60 | 60 | "h5" : { |
| 61 | - "router": { | |
| 62 | - "mode": "history" | |
| 61 | + "router" : { | |
| 62 | + "mode" : "history" | |
| 63 | 63 | }, |
| 64 | 64 | "sdkConfigs" : { |
| 65 | 65 | "maps" : { |
| 66 | - "qqmap" : { | |
| 67 | - "key" : "LNFBZ-YRSW3-HMU3T-RZP6V-XCWV5-EKFWP" | |
| 66 | + "amap" : { | |
| 67 | + "key" : "b1824190654be63b3111c33127a120ca", | |
| 68 | + "securityJsCode" : "63ff81bc91c64d3f044d7788bfa8e693", | |
| 69 | + "serviceHost" : "" | |
| 68 | 70 | } |
| 69 | 71 | } |
| 70 | 72 | } |
| ... | ... | @@ -78,8 +80,8 @@ |
| 78 | 80 | "mp-toutiao" : { |
| 79 | 81 | "usingComponents" : true |
| 80 | 82 | }, |
| 81 | - "uniStatistics": { | |
| 82 | - "enable": false | |
| 83 | + "uniStatistics" : { | |
| 84 | + "enable" : false | |
| 83 | 85 | }, |
| 84 | 86 | "vueVersion" : "3" |
| 85 | 87 | } | ... | ... |
garbage-removal/src/pages/home/address/addSite.vue
| ... | ... | @@ -11,10 +11,11 @@ |
| 11 | 11 | </view> |
| 12 | 12 | </u-form-item> |
| 13 | 13 | <u-form-item :required="true" label="详细地址" prop="addressDetail" borderBottom> |
| 14 | - <view class="wrap-from-container-address-details" style="display: flex;"> | |
| 15 | - <u--input border="none" type="text" v-model="addressInfo.addressDetail" placeholder-class="line" | |
| 16 | - placeholder="请填写详细地址"></u--input> | |
| 17 | - <u-icon name="map" size="40" @click="chooseAddressDetail"></u-icon> | |
| 14 | + <view @click.stop="chooseAddressDetail" class="wrap-from-container-address-details" style="display: flex;" | |
| 15 | + hover-class="click-box"> | |
| 16 | + <u--input border="none" readonly type="text" style="pointer-events:none" v-model="addressInfo.addressDetail" | |
| 17 | + placeholder-class="line" placeholder="请先选着地址,在输入补充"></u--input> | |
| 18 | + <u-icon name="map" size="40"></u-icon> | |
| 18 | 19 | </view> |
| 19 | 20 | </u-form-item> |
| 20 | 21 | <u-form-item :required="true" label="联系人" prop="contactPerson" borderBottom> |
| ... | ... | @@ -159,13 +160,19 @@ const submit = () => { |
| 159 | 160 | uni.$u.toast('请填写正确信息!') |
| 160 | 161 | }) |
| 161 | 162 | } |
| 163 | + | |
| 162 | 164 | /** |
| 163 | 165 | * 打开地图选择地址 |
| 164 | 166 | */ |
| 165 | 167 | const chooseAddressDetail = () => { |
| 168 | + let coordinate = 'gcj02'; | |
| 166 | 169 | uni.chooseLocation({ |
| 170 | + type: coordinate, | |
| 167 | 171 | success: function (res) { |
| 168 | 172 | addressInfo.addressDetail = res.address + res.name; |
| 173 | + addressInfo.garLongitude = res.longitude | |
| 174 | + addressInfo.garLatitude = res.latitude | |
| 175 | + addressInfo.garCoordinate = coordinate | |
| 169 | 176 | } |
| 170 | 177 | }); |
| 171 | 178 | } |
| ... | ... | @@ -183,6 +190,8 @@ onLoad((options) => { |
| 183 | 190 | addressInfo.defaultFlag = addressObj.garUserDefault == 1 ? true : false; |
| 184 | 191 | addressInfo.addressDetail = addressObj.garRemark; |
| 185 | 192 | addressInfo.garAddressId = addressObj.garAddressId |
| 193 | + addressInfo.garLongitude = addressObj.garLongitude | |
| 194 | + addressInfo.garLatitude = addressObj.garLatitude | |
| 186 | 195 | addFlag.value = false; |
| 187 | 196 | } |
| 188 | 197 | }) |
| ... | ... | @@ -193,6 +202,8 @@ const reset = () => { |
| 193 | 202 | addressInfo.defaultFlag = false |
| 194 | 203 | addressInfo.addressDetail = '' |
| 195 | 204 | addressInfo.garAddressId = '' |
| 205 | + addressInfo.garLongitude = '' | |
| 206 | + addressInfo.garLatitude = '' | |
| 196 | 207 | addFlag.value = true |
| 197 | 208 | } |
| 198 | 209 | </script> | ... | ... |
garbage-removal/src/pages/home/clean/index.vue
| ... | ... | @@ -25,7 +25,7 @@ |
| 25 | 25 | </view> |
| 26 | 26 | <view class="company-clean-container-car-popup-content-box-item-number" hover-class="hoverClickStyle"> |
| 27 | 27 | <u-number-box :min="0" :max="9999" integer buttonSize="46" :inputWidth="100" |
| 28 | - v-model="garCarInfoList[item.garOrderCarType].garOrderCarNumber"></u-number-box> | |
| 28 | + v-model="garCarInfoList[item.garOrderCarType].garOrderCarNumber" :disabledInput="true"></u-number-box> | |
| 29 | 29 | </view> |
| 30 | 30 | </view> |
| 31 | 31 | |
| ... | ... | @@ -172,7 +172,10 @@ const userAddress = ref({ |
| 172 | 172 | garUserContactName: "", |
| 173 | 173 | garUserContactTel: "", |
| 174 | 174 | garRemark: "", |
| 175 | - garUserAddress: "" | |
| 175 | + garUserAddress: "", | |
| 176 | + garCoordinate: "", | |
| 177 | + garLongitude: "", | |
| 178 | + garLatitude: "", | |
| 176 | 179 | }) |
| 177 | 180 | // 车辆信息 |
| 178 | 181 | const garCarInfoList = ref({}) |
| ... | ... | @@ -204,10 +207,14 @@ const garCarTransportInfo = computed(() => { |
| 204 | 207 | // 车辆数量 |
| 205 | 208 | const garCarNumberCount = computed(() => { |
| 206 | 209 | let count = 0; |
| 207 | - for (const key in garCarInfoList.value) { | |
| 208 | - const element = garCarInfoList.value[key]; | |
| 209 | - count += element.garOrderCarNumber; | |
| 210 | + if (garCarInfoList.value) { | |
| 211 | + for (const key in garCarInfoList.value) { | |
| 212 | + const element = garCarInfoList.value[key]; | |
| 213 | + count = typeof element.garOrderCarNumber === 'number' ? count + element.garOrderCarNumber : count; | |
| 214 | + console.log(element.garOrderCarNumber instanceof Number); | |
| 215 | + } | |
| 210 | 216 | } |
| 217 | + console.log(count); | |
| 211 | 218 | return count; |
| 212 | 219 | }) |
| 213 | 220 | const garbageTypeList = ref([["装修垃圾", "建筑垃圾"]]) |
| ... | ... | @@ -245,7 +252,6 @@ const handlePopupClick = (val) => { |
| 245 | 252 | * 初始化信息 |
| 246 | 253 | */ |
| 247 | 254 | onLoad((options) => { |
| 248 | - | |
| 249 | 255 | companyObj.value = JSON.parse(options.companyObj); |
| 250 | 256 | tel.value = options.tel; |
| 251 | 257 | userAddress.value = JSON.parse(options.userAddress); |
| ... | ... | @@ -392,6 +398,9 @@ const handleOderSure = () => { |
| 392 | 398 | * 图片列表 |
| 393 | 399 | */ |
| 394 | 400 | imageUrls: fileList.value.map(item => item.url), |
| 401 | + garLongitude: userAddress.value.garLongitude, | |
| 402 | + garLatitude: userAddress.value.garLatitude, | |
| 403 | + garCoordinate: userAddress.value.garCoordinate, | |
| 395 | 404 | } |
| 396 | 405 | if (!validateParams(params)) { |
| 397 | 406 | return; | ... | ... |
garbage-removal/src/pages/order/detail/index.vue
| ... | ... | @@ -29,9 +29,10 @@ |
| 29 | 29 | <view class="order-detail-container-header-card-uicon"></view> |
| 30 | 30 | 派单信息 |
| 31 | 31 | </view> |
| 32 | - <view class="order-detail-container-header-item"> | |
| 32 | + <view class="order-detail-container-header-item" | |
| 33 | + @click.stop="handlerJumpOtherApp(dataGram.garLatitude, dataGram.garLongitude, dataGram.garCoordinate)"> | |
| 33 | 34 | <text class="order-detail-container-header-title">派单地点:</text> |
| 34 | - <view class="order-detail-container-header-content"> | |
| 35 | + <view class="order-detail-container-header-content" style="text-decoration: underline"> | |
| 35 | 36 | {{ dataGram.garOrderAddress + dataGram.garOrderAddressDetails }} |
| 36 | 37 | </view> |
| 37 | 38 | </view> |
| ... | ... | @@ -340,6 +341,7 @@ const selectClick = (index) => { |
| 340 | 341 | const handleOrderDetail = (orderId) => { |
| 341 | 342 | queryOrderDetail(orderId).then(res => { |
| 342 | 343 | dataGram.value = res.data.data; |
| 344 | + console.log(res.data.data); | |
| 343 | 345 | currentImages.value = res.data.data.currentImages.map(item => { |
| 344 | 346 | return { url: import.meta.env.VITE_BASE_URL + item }; |
| 345 | 347 | }); |
| ... | ... | @@ -359,6 +361,26 @@ const handleContactClick = (val) => { |
| 359 | 361 | }).catch(err => { }); |
| 360 | 362 | } |
| 361 | 363 | |
| 364 | +const handlerJumpOtherApp = (latitude, longitude, garCoordinate) => { | |
| 365 | + console.log(latitude, longitude); | |
| 366 | + // 给出提示确定要跳转吗 | |
| 367 | + uni.showModal({ | |
| 368 | + title: '提示', | |
| 369 | + content: '是否跳转到app定位进行导航?', | |
| 370 | + success: function (res) { | |
| 371 | + if (res.confirm) { | |
| 372 | + uni.openLocation({ | |
| 373 | + latitude: latitude, | |
| 374 | + longitude: longitude, | |
| 375 | + success: function () { | |
| 376 | + console.log('success'); | |
| 377 | + } | |
| 378 | + }); | |
| 379 | + } | |
| 380 | + } | |
| 381 | + }) | |
| 382 | +} | |
| 383 | + | |
| 362 | 384 | /** |
| 363 | 385 | * 取消派单 |
| 364 | 386 | * @param {*} orderId |
| ... | ... | @@ -534,7 +556,6 @@ onLoad((options) => { |
| 534 | 556 | }) |
| 535 | 557 | |
| 536 | 558 | onShow(() => { |
| 537 | - | |
| 538 | 559 | try { |
| 539 | 560 | if (isOnloadIn.value) { |
| 540 | 561 | handleOrderDetail(orderId.value) | ... | ... |
garbage-removal/src/pages/wode/index.vue