From 72935b2a35765bcc3622561bb06f2eccd64caf83 Mon Sep 17 00:00:00 2001 From: qingyiay <2386314947@qq.com> Date: 星期二, 16 五月 2023 16:49:00 +0800 Subject: [PATCH] 修改上传图片时页面跳转问题 --- pages/public-page/mapRoute/mapRoute.vue | 90 +++++++++++++++++++++++++++++++------------- 1 files changed, 63 insertions(+), 27 deletions(-) diff --git a/pages/public-page/mapRoute/mapRoute.vue b/pages/public-page/mapRoute/mapRoute.vue index f686e1c..b534ca6 100644 --- a/pages/public-page/mapRoute/mapRoute.vue +++ b/pages/public-page/mapRoute/mapRoute.vue @@ -15,6 +15,7 @@ <text>{{ duration || '' }}</text> </view> </view> + <view class="open-button" @click="awaken"><button type="default">璺宠浆</button></view> </view> </template> @@ -38,13 +39,13 @@ { latitude: null, longitude: null, - iconPath: '../../../static/image/banner/location.png', + iconPath: 'https://mx.jzeg.cn:9095/appimg/image/banner/location.png', width: 23, height: 33, id: 0, callout: { content: '璧风偣', //鏂囨湰 - color: '#ffffff', //鏂囧瓧棰滆壊 + color: '#000000', //鏂囧瓧棰滆壊 fontSize: 14, //鏂囨湰澶у皬 borderRadius: 15, //杈规鍦嗚 borderWidth: '10', @@ -55,7 +56,7 @@ { latitude: null, longitude: null, - iconPath: '../../../static/image/banner/location.png', + iconPath: 'https://mx.jzeg.cn:9095/appimg/image/banner/location.png', width: 23, height: 33, id: 1, @@ -81,7 +82,9 @@ } ], distance: null, - duration: null + duration: null, + fromLocation: {}, + toLocation: {} }; }, methods: { @@ -93,39 +96,45 @@ let qqmapsdk = new QQMapWX({ key: 'HTNBZ-LZGRQ-YDB5S-B4KAS-KLHJH-GHBUE' // 蹇呭~ }); - const params = this.toFiledId ? { toFiledId: this.toFiledId } : { customerId: this.customerId, filedId: this.filedId }; - this.$reqGet('getAppLocation', params).then(res => { - console.log(res, '鑵捐缁忕含搴�'); + const params = this.toFiledId ? { filedId: this.filedId, toFiledId: this.toFiledId } : { customerId: this.customerId, filedId: this.filedId }; + this.$reqGet('getAppLocation', params).then(result => { + console.log(result, '鑵捐缁忕含搴�'); let _this = this; + console.log(_this.orderType, '绫诲瀷'); let fromLocation; let toLocation; if (_this.orderType == '澶栬喘' || _this.orderType == '澶栭攢') { - _this.$set(_this.markers[0], 'longitude', res.data.customerLongitude); - _this.$set(_this.markers[0], 'latitude', res.data.customerLatitude); fromLocation = { - longitude: res.data.customerLongitude, - latitude: res.data.customerLatitude + longitude: result.data.customerLongitude, + latitude: result.data.customerLatitude }; - _this.$set(_this.markers[1], 'longitude', res.data.filedLongitude); - _this.$set(_this.markers[1], 'latitude', res.data.filedLatitude); toLocation = { - longitude: res.data.filedLongitude, - latitude: res.data.filedLatitude + longitude: result.data.filedLongitude, + latitude: result.data.filedLatitude }; } else if (_this.orderType == '鍐呰喘' || _this.orderType == '鍐呴攢') { - _this.$set(_this.markers[0], 'longitude', res.data.filedLongitude); - _this.$set(_this.markers[0], 'latitude', res.data.filedLatitude); fromLocation = { - longitude: res.data.filedLongitude, - latitude: res.data.filedLatitude + longitude: result.data.filedLongitude, + latitude: result.data.filedLatitude }; - _this.$set(_this.markers[1], 'longitude', res.data.customerLongitude); - _this.$set(_this.markers[1], 'latitude', res.data.customerLatitude); toLocation = { - longitude: res.data.customerLongitude, - latitude: res.data.customerLatitude + longitude: result.data.customerLongitude, + latitude: result.data.customerLatitude }; + } else { + fromLocation = { + longitude: result.data.filedLongitude, + latitude: result.data.filedLatitude + }; + toLocation = { + longitude: result.data.toFiledLongitude, + latitude: result.data.toFiledLatitude + }; + _this.fromLocation = fromLocation; + _this.toLocation = toLocation; } + _this.fromLocation = fromLocation; + _this.toLocation = toLocation; //璋冪敤璺濈璁$畻鎺ュ彛 qqmapsdk.direction({ mode: 'driving', @@ -158,6 +167,22 @@ arrowLine: true } ]; + if (_this.orderType == '澶栬喘' || _this.orderType == '澶栭攢') { + _this.$set(_this.markers[0], 'longitude', result.data.customerLongitude); + _this.$set(_this.markers[0], 'latitude', result.data.customerLatitude); + _this.$set(_this.markers[1], 'longitude', result.data.filedLongitude); + _this.$set(_this.markers[1], 'latitude', result.data.filedLatitude); + } else if (_this.orderType == '鍐呰喘' || _this.orderType == '鍐呴攢') { + _this.$set(_this.markers[0], 'longitude', result.data.filedLongitude); + _this.$set(_this.markers[0], 'latitude', result.data.filedLatitude); + _this.$set(_this.markers[1], 'longitude', result.data.customerLongitude); + _this.$set(_this.markers[1], 'latitude', result.data.customerLatitude); + } else { + _this.$set(_this.markers[0], 'longitude', result.data.filedLongitude); + _this.$set(_this.markers[0], 'latitude', result.data.filedLatitude); + _this.$set(_this.markers[1], 'longitude', result.data.toFiledLongitude); + _this.$set(_this.markers[1], 'latitude', result.data.toFiledLatitude); + } }, fail: function(error) { console.error(error); @@ -185,6 +210,15 @@ .toString() .padStart(2, '0'); return hours + ':' + minutes; + }, + // 鍞ら啋 + awaken() { + uni.openLocation({ + latitude: this.markers[1].latitude, + longitude: this.markers[1].longitude, + name: '鐩殑鍦颁綅缃�', + address: '鐩殑鍦颁綅缃�' + }); } }, onLoad(params) { @@ -196,10 +230,8 @@ } }, onShow() { - if (this.orderType !== '杞叆' || this.orderType !== '杞嚭') { - this.getLocation(); - } else { - } + this.getLocation(); + // this.awaken(); } }; </script> @@ -220,4 +252,8 @@ } } } +.open-button { + width: 200rpx; + margin: 10rpx 0; +} </style> -- Gitblit v1.9.1