From e3fa4b6a02e1902c0eaec9572d967561364b1f78 Mon Sep 17 00:00:00 2001 From: zoujing Date: Tue, 10 Mar 2026 23:04:42 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=B9=E9=80=A0=E5=95=86=E5=93=81?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E7=9A=84=E4=BD=8D=E7=BD=AE=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/LocationCard/index.vue | 59 +++++++++++++----- src/components/LocationCard/styles/index.scss | 61 ++++++++++--------- 2 files changed, 77 insertions(+), 43 deletions(-) diff --git a/src/components/LocationCard/index.vue b/src/components/LocationCard/index.vue index 9695135..9c28940 100644 --- a/src/components/LocationCard/index.vue +++ b/src/components/LocationCard/index.vue @@ -1,14 +1,26 @@ @@ -30,21 +42,38 @@ const openMap = () => { const longitude = Number(props.orderData.commodityLongitude); uni.getLocation({ - type: "gcj02", //返回可以用于uni.openLocation的经纬度 - success: (res) => { - console.log("当前经纬度", latitude, longitude); - + type: "gcj02", + success: () => { + uni.openLocation({ + latitude: latitude, + longitude: longitude, + address: address, + }); + }, + fail: () => { uni.openLocation({ latitude: latitude, longitude: longitude, address: address, - success: () => { - console.log("success"); - }, }); }, }); }; + +// 拨打电话 +const getPhoneNumber = () => { + const o = props.orderData || {}; + return o.commodityPhone || o.phone || o.contactPhone || ""; +}; + +const callPhone = () => { + const phone = getPhoneNumber(); + if (!phone) { + uni.showToast({ title: "未提供电话号码", icon: "none" }); + return; + } + uni.makePhoneCall({ phoneNumber: String(phone) }); +};