0235699曾露 7 часов назад
Родитель
Сommit
8015029c18
1 измененных файлов с 5 добавлено и 2 удалено
  1. 5 2
      common-page/pages/map-open/index.js

+ 5 - 2
common-page/pages/map-open/index.js

@@ -68,11 +68,14 @@ Page({
    * 打开地图
    */
   openLocation(latitude, longitude, name, address) {
+    // 交换 name 和 address 的显示
+    // 微信地图中 name 显示在上面(大字),address 显示在下面(小字)
+    // 需求:上面显示地址,下面显示门店名
     wx.openLocation({
       latitude: parseFloat(latitude),
       longitude: parseFloat(longitude),
-      name: name,
-      address: address,
+      name: address || name,      // 上面显示地址
+      address: name || address,   // 下面显示门店名
       scale: 18,
       success: () => {
         console.log('✅ 地图打开成功');