Commit 4d0f0f595bcc24cb37dcf80e6c1abbbc633ccd49

Authored by guzijian
1 parent 1249937f

feat: 新增跳转

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,7 +50,7 @@
50 "quickapp" : {}, 50 "quickapp" : {},
51 /* 小程序特有相关 */ 51 /* 小程序特有相关 */
52 "mp-weixin" : { 52 "mp-weixin" : {
53 - "lazyCodeLoading": "requiredComponents", 53 + "lazyCodeLoading" : "requiredComponents",
54 "appid" : "wxc3f60667dc9d6cea", 54 "appid" : "wxc3f60667dc9d6cea",
55 "setting" : { 55 "setting" : {
56 "urlCheck" : false 56 "urlCheck" : false
@@ -58,13 +58,15 @@ @@ -58,13 +58,15 @@
58 "usingComponents" : true 58 "usingComponents" : true
59 }, 59 },
60 "h5" : { 60 "h5" : {
61 - "router": {  
62 - "mode": "history" 61 + "router" : {
  62 + "mode" : "history"
63 }, 63 },
64 "sdkConfigs" : { 64 "sdkConfigs" : {
65 "maps" : { 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,8 +80,8 @@
78 "mp-toutiao" : { 80 "mp-toutiao" : {
79 "usingComponents" : true 81 "usingComponents" : true
80 }, 82 },
81 - "uniStatistics": {  
82 - "enable": false 83 + "uniStatistics" : {
  84 + "enable" : false
83 }, 85 },
84 "vueVersion" : "3" 86 "vueVersion" : "3"
85 } 87 }
garbage-removal/src/pages/home/address/addSite.vue
@@ -11,10 +11,11 @@ @@ -11,10 +11,11 @@
11 </view> 11 </view>
12 </u-form-item> 12 </u-form-item>
13 <u-form-item :required="true" label="详细地址" prop="addressDetail" borderBottom> 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 </view> 19 </view>
19 </u-form-item> 20 </u-form-item>
20 <u-form-item :required="true" label="联系人" prop="contactPerson" borderBottom> 21 <u-form-item :required="true" label="联系人" prop="contactPerson" borderBottom>
@@ -159,13 +160,19 @@ const submit = () =&gt; { @@ -159,13 +160,19 @@ const submit = () =&gt; {
159 uni.$u.toast('请填写正确信息!') 160 uni.$u.toast('请填写正确信息!')
160 }) 161 })
161 } 162 }
  163 +
162 /** 164 /**
163 * 打开地图选择地址 165 * 打开地图选择地址
164 */ 166 */
165 const chooseAddressDetail = () => { 167 const chooseAddressDetail = () => {
  168 + let coordinate = 'gcj02';
166 uni.chooseLocation({ 169 uni.chooseLocation({
  170 + type: coordinate,
167 success: function (res) { 171 success: function (res) {
168 addressInfo.addressDetail = res.address + res.name; 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) =&gt; { @@ -183,6 +190,8 @@ onLoad((options) =&gt; {
183 addressInfo.defaultFlag = addressObj.garUserDefault == 1 ? true : false; 190 addressInfo.defaultFlag = addressObj.garUserDefault == 1 ? true : false;
184 addressInfo.addressDetail = addressObj.garRemark; 191 addressInfo.addressDetail = addressObj.garRemark;
185 addressInfo.garAddressId = addressObj.garAddressId 192 addressInfo.garAddressId = addressObj.garAddressId
  193 + addressInfo.garLongitude = addressObj.garLongitude
  194 + addressInfo.garLatitude = addressObj.garLatitude
186 addFlag.value = false; 195 addFlag.value = false;
187 } 196 }
188 }) 197 })
@@ -193,6 +202,8 @@ const reset = () =&gt; { @@ -193,6 +202,8 @@ const reset = () =&gt; {
193 addressInfo.defaultFlag = false 202 addressInfo.defaultFlag = false
194 addressInfo.addressDetail = '' 203 addressInfo.addressDetail = ''
195 addressInfo.garAddressId = '' 204 addressInfo.garAddressId = ''
  205 + addressInfo.garLongitude = ''
  206 + addressInfo.garLatitude = ''
196 addFlag.value = true 207 addFlag.value = true
197 } 208 }
198 </script> 209 </script>
garbage-removal/src/pages/home/clean/index.vue
@@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
25 </view> 25 </view>
26 <view class="company-clean-container-car-popup-content-box-item-number" hover-class="hoverClickStyle"> 26 <view class="company-clean-container-car-popup-content-box-item-number" hover-class="hoverClickStyle">
27 <u-number-box :min="0" :max="9999" integer buttonSize="46" :inputWidth="100" 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 </view> 29 </view>
30 </view> 30 </view>
31 31
@@ -172,7 +172,10 @@ const userAddress = ref({ @@ -172,7 +172,10 @@ const userAddress = ref({
172 garUserContactName: "", 172 garUserContactName: "",
173 garUserContactTel: "", 173 garUserContactTel: "",
174 garRemark: "", 174 garRemark: "",
175 - garUserAddress: "" 175 + garUserAddress: "",
  176 + garCoordinate: "",
  177 + garLongitude: "",
  178 + garLatitude: "",
176 }) 179 })
177 // 车辆信息 180 // 车辆信息
178 const garCarInfoList = ref({}) 181 const garCarInfoList = ref({})
@@ -204,10 +207,14 @@ const garCarTransportInfo = computed(() =&gt; { @@ -204,10 +207,14 @@ const garCarTransportInfo = computed(() =&gt; {
204 // 车辆数量 207 // 车辆数量
205 const garCarNumberCount = computed(() => { 208 const garCarNumberCount = computed(() => {
206 let count = 0; 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 return count; 218 return count;
212 }) 219 })
213 const garbageTypeList = ref([["装修垃圾", "建筑垃圾"]]) 220 const garbageTypeList = ref([["装修垃圾", "建筑垃圾"]])
@@ -245,7 +252,6 @@ const handlePopupClick = (val) =&gt; { @@ -245,7 +252,6 @@ const handlePopupClick = (val) =&gt; {
245 * 初始化信息 252 * 初始化信息
246 */ 253 */
247 onLoad((options) => { 254 onLoad((options) => {
248 -  
249 companyObj.value = JSON.parse(options.companyObj); 255 companyObj.value = JSON.parse(options.companyObj);
250 tel.value = options.tel; 256 tel.value = options.tel;
251 userAddress.value = JSON.parse(options.userAddress); 257 userAddress.value = JSON.parse(options.userAddress);
@@ -392,6 +398,9 @@ const handleOderSure = () =&gt; { @@ -392,6 +398,9 @@ const handleOderSure = () =&gt; {
392 * 图片列表 398 * 图片列表
393 */ 399 */
394 imageUrls: fileList.value.map(item => item.url), 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 if (!validateParams(params)) { 405 if (!validateParams(params)) {
397 return; 406 return;
garbage-removal/src/pages/order/detail/index.vue
@@ -29,9 +29,10 @@ @@ -29,9 +29,10 @@
29 <view class="order-detail-container-header-card-uicon"></view> 29 <view class="order-detail-container-header-card-uicon"></view>
30 派单信息 30 派单信息
31 </view> 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 <text class="order-detail-container-header-title">派单地点:</text> 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 {{ dataGram.garOrderAddress + dataGram.garOrderAddressDetails }} 36 {{ dataGram.garOrderAddress + dataGram.garOrderAddressDetails }}
36 </view> 37 </view>
37 </view> 38 </view>
@@ -340,6 +341,7 @@ const selectClick = (index) =&gt; { @@ -340,6 +341,7 @@ const selectClick = (index) =&gt; {
340 const handleOrderDetail = (orderId) => { 341 const handleOrderDetail = (orderId) => {
341 queryOrderDetail(orderId).then(res => { 342 queryOrderDetail(orderId).then(res => {
342 dataGram.value = res.data.data; 343 dataGram.value = res.data.data;
  344 + console.log(res.data.data);
343 currentImages.value = res.data.data.currentImages.map(item => { 345 currentImages.value = res.data.data.currentImages.map(item => {
344 return { url: import.meta.env.VITE_BASE_URL + item }; 346 return { url: import.meta.env.VITE_BASE_URL + item };
345 }); 347 });
@@ -359,6 +361,26 @@ const handleContactClick = (val) =&gt; { @@ -359,6 +361,26 @@ const handleContactClick = (val) =&gt; {
359 }).catch(err => { }); 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 * @param {*} orderId 386 * @param {*} orderId
@@ -534,7 +556,6 @@ onLoad((options) =&gt; { @@ -534,7 +556,6 @@ onLoad((options) =&gt; {
534 }) 556 })
535 557
536 onShow(() => { 558 onShow(() => {
537 -  
538 try { 559 try {
539 if (isOnloadIn.value) { 560 if (isOnloadIn.value) {
540 handleOrderDetail(orderId.value) 561 handleOrderDetail(orderId.value)
garbage-removal/src/pages/wode/index.vue
@@ -61,7 +61,7 @@ const handleAddressManager = () =&gt; { @@ -61,7 +61,7 @@ const handleAddressManager = () =&gt; {
61 const handleLoginOut = () => { 61 const handleLoginOut = () => {
62 uni.showModal({ 62 uni.showModal({
63 title: '提示', 63 title: '提示',
64 - content: '确定要退出', 64 + content: '确定要退出吗?',
65 success: function (res) { 65 success: function (res) {
66 if (res.confirm) { 66 if (res.confirm) {
67 loginOut().then(res => { 67 loginOut().then(res => {
garbage-removal/vite.config.js
@@ -12,5 +12,5 @@ export default defineConfig({ @@ -12,5 +12,5 @@ export default defineConfig({
12 "@": resolve(__dirname, "src"), // 设置@指向src 12 "@": resolve(__dirname, "src"), // 设置@指向src
13 "@components": resolve(__dirname, "src/components"), // 设置@components指向src/components 13 "@components": resolve(__dirname, "src/components"), // 设置@components指向src/components
14 }, 14 },
15 - }, 15 + }
16 }) 16 })