From a8bdcd549565668304c9582c79c4a147d4609c0f Mon Sep 17 00:00:00 2001 From: modendeveloper Date: Sun, 24 Nov 2024 15:27:25 +0800 Subject: [PATCH] =?UTF-8?q?Fix=EF=BC=9A2641=20=E3=80=90=E5=9C=B0=E6=A0=87?= =?UTF-8?q?=E5=A5=BD=E7=89=A9=E3=80=91=E6=9C=8D=E5=8A=A1--=E5=AF=BC?= =?UTF-8?q?=E8=88=AA=E5=92=8C=E5=AE=A2=E6=9C=8D=E6=8C=89=E9=92=AE=E6=97=A0?= =?UTF-8?q?=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/home/components/serviec.vue | 35 +++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/pages/home/components/serviec.vue b/pages/home/components/serviec.vue index dfeaf43..6a97641 100644 --- a/pages/home/components/serviec.vue +++ b/pages/home/components/serviec.vue @@ -10,18 +10,18 @@ - {{ info.name }} - 办公时间:{{ info.officeTime }} - {{ info.address }} + {{ info.name || '' }} + 办公时间:{{ info.officeTime || '' }} + {{ info.address || '' }} - + 导航 - + @@ -35,7 +35,7 @@ 简介 - {{ info.intro }} + {{ info.intro || '' }} @@ -56,6 +56,29 @@ export default { mounted() { console.log(this.info); }, + methods: { + showLocation() { + console.log(this.info); + + if (!this.info.latitude || !this.info.longitude) { + this.$dialog.error('暂无位置信息') + } else { + uni.openLocation({ + latitude: this.info.latitude, + longitude: this.info.longitude + }) + } + }, + call() { + if (this.info.tel) { + uni.makePhoneCall({ + phoneNumber: this.info.tel + }) + } else { + this.$dialog.error('电话为空') + } + }, + } }