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('电话为空') + } + }, + } }