From f7001fc4fc84592adf411e77d022d88145a52068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Thu, 7 May 2026 17:24:19 +0800 Subject: [PATCH] =?UTF-8?q?feat(map):=20=E6=9B=BF=E6=8D=A2=E5=9C=B0?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E8=AE=B0=E4=B8=BA=E4=B8=89=E8=BD=AE=E8=BD=A6?= =?UTF-8?q?=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 location.tsx 中导入并使用三轮车图标替代原有加标记点 - 在 trajectory.tsx 中导入并使用同样的三轮车图标替代原有加标记点 - 设置标记图标宽高为 32,确保图标在地图中正确显示和居中 - 统一地图上所有车辆标记使用送快递三轮车图标,提高视觉识别度 --- .workbuddy/memory/2026-05-07.md | 6 ++++++ src/pages/index/index.tsx | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/.workbuddy/memory/2026-05-07.md b/.workbuddy/memory/2026-05-07.md index 4b17c6c..f985b66 100644 --- a/.workbuddy/memory/2026-05-07.md +++ b/.workbuddy/memory/2026-05-07.md @@ -22,6 +22,12 @@ - 添加图标导入:`import tricycleIcon from '@/assets/icons/delivery_tricycle.png'` - markers 添加:`iconPath: tricycleIcon, width: 32, height: 32` +4. **修改 pages/index/index.tsx(首页)** + - 文件:`src/pages/index/index.tsx` + - 添加图标导入:`import tricycleIcon from '@/assets/icons/delivery_tricycle.png'` + - 第 244 行和第 319 行的 markers 添加:`iconPath: tricycleIcon, width: 32, height: 32` + - 该文件有两处设置 markers(pageHjmCarByMap 函数和 reload 函数) + ### 注意事项 - TypeScript 类型定义已包含 PNG 模块声明,无需额外配置 - 微信小程序 map 组件需要指定 width 和 height 属性 diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx index c5d9b8c..82223c3 100644 --- a/src/pages/index/index.tsx +++ b/src/pages/index/index.tsx @@ -14,6 +14,7 @@ import {pageByQQMap, pageHjmCar} from "@/api/hjm/hjmCar"; import {HjmCar} from "@/api/hjm/hjmCar/model"; // 导入GPS坐标转换工具 import GPS from '@/utils/gpsUtil.js'; +import tricycleIcon from '@/assets/icons/delivery_tricycle.png'; export interface Market { // 自增ID @@ -240,6 +241,9 @@ function Home() { id: item.id, latitude: markerLat, longitude: markerLng, + iconPath: tricycleIcon, + width: 32, + height: 32, label: { content: `${item?.code}`, color: '#000000', @@ -312,6 +316,9 @@ function Home() { id: data.id, latitude: displayLat, longitude: displayLng, + iconPath: tricycleIcon, + width: 32, + height: 32, // @ts-ignore label: { content: `${data?.code}`,