From 9a08d2c692fa2143852da968e65300461596e3e0 Mon Sep 17 00:00:00 2001 From: jiazhipeng Date: Sat, 14 Sep 2024 16:10:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=A6=E6=83=85=E5=AE=9A=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- subPackages/food/foodDetail.vue | 22 +++++++++++++++++++++- subPackages/hotelHomestay/detail.vue | 12 ++++++++++-- subPackages/ticketBooking/detail.vue | 12 ++++++++++-- 3 files changed, 41 insertions(+), 5 deletions(-) diff --git a/subPackages/food/foodDetail.vue b/subPackages/food/foodDetail.vue index a93cfdb..2e765e3 100644 --- a/subPackages/food/foodDetail.vue +++ b/subPackages/food/foodDetail.vue @@ -50,7 +50,7 @@ 商家地址 {{info.address}} - + @@ -158,6 +158,26 @@ url: '/subPackages/food/taocanDetail' }); }, + + goMap () { + if (!this.info.tengxun_map) { + uni.showToast({ + title: '暂未配置地理位置', + icon: 'none' + }) + return + } + + uni.openLocation({ + latitude: Number(this.info.tengxun_map.lat), + longitude: Number(this.info.tengxun_map.lon), + name: this.info.title, + address: this.info.address, + success: function () { + console.log('success'); + } + }); + }, }, onReachBottom() { diff --git a/subPackages/hotelHomestay/detail.vue b/subPackages/hotelHomestay/detail.vue index 33e4d2d..116e4e8 100644 --- a/subPackages/hotelHomestay/detail.vue +++ b/subPackages/hotelHomestay/detail.vue @@ -250,9 +250,17 @@ }, goMap () { + if (!this.info.tengxun_map) { + uni.showToast({ + title: '暂未配置地理位置', + icon: 'none' + }) + return + } + debugger uni.openLocation({ - latitude: Number(this.info.lat), - longitude: Number(this.info.lon), + latitude: Number(this.info.tengxun_map.lat), + longitude: Number(this.info.tengxun_map.lon), name: this.info.title, address: this.info.address, success: function () { diff --git a/subPackages/ticketBooking/detail.vue b/subPackages/ticketBooking/detail.vue index e000f38..1ca70a7 100644 --- a/subPackages/ticketBooking/detail.vue +++ b/subPackages/ticketBooking/detail.vue @@ -228,9 +228,17 @@ }, goMap () { + if (!this.info.tengxun_map) { + uni.showToast({ + title: '暂未配置地理位置', + icon: 'none' + }) + return + } + uni.openLocation({ - latitude: Number(this.info.lat), - longitude: Number(this.info.lon), + latitude: Number(this.info.tengxun_map.lat), + longitude: Number(this.info.tengxun_map.lon), name: this.info.title, address: this.info.address, success: function () {