From 16b09eb271be059b00a71c786483a0c20ba4ebd8 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:20:42 +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 | 28 +++++++++++++++++++++++++ src/assets/icons/delivery_tricycle.png | Bin 0 -> 704 bytes src/hjm/location.tsx | 6 ++++-- src/hjm/trajectory/trajectory.tsx | 5 ++++- 4 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 .workbuddy/memory/2026-05-07.md create mode 100644 src/assets/icons/delivery_tricycle.png diff --git a/.workbuddy/memory/2026-05-07.md b/.workbuddy/memory/2026-05-07.md new file mode 100644 index 0000000..4b17c6c --- /dev/null +++ b/.workbuddy/memory/2026-05-07.md @@ -0,0 +1,28 @@ +# 2026-05-07 工作记忆 + +## 地图标记图标修改 + +### 任务 +将地图上的小红点改成送快递的三轮车图标 + +### 修改内容 + +1. **创建三轮车图标** + - 位置:`src/assets/icons/delivery_tricycle.png` + - 尺寸:64x64 透明背景 PNG + - 设计:红色车身、绿色货箱的三轮快递车 + +2. **修改 location.tsx** + - 文件:`src/hjm/location.tsx` + - 添加图标导入:`import tricycleIcon from '@/assets/icons/delivery_tricycle.png'` + - markers 添加:`iconPath: tricycleIcon, width: 32, height: 32` + +3. **修改 trajectory.tsx** + - 文件:`src/hjm/trajectory/trajectory.tsx` + - 添加图标导入:`import tricycleIcon from '@/assets/icons/delivery_tricycle.png'` + - markers 添加:`iconPath: tricycleIcon, width: 32, height: 32` + +### 注意事项 +- TypeScript 类型定义已包含 PNG 模块声明,无需额外配置 +- 微信小程序 map 组件需要指定 width 和 height 属性 +- 图标居中显示在车辆 GPS 坐标位置 diff --git a/src/assets/icons/delivery_tricycle.png b/src/assets/icons/delivery_tricycle.png new file mode 100644 index 0000000000000000000000000000000000000000..6d50b5723728d78c57fd3161472386c4fa0f976e GIT binary patch literal 704 zcmV;x0zdtUP)~<5QeLZ2^3L00(HSaPy{zHR5Oiz90fx$6!aB*1K+_+4Gk0)1p~n&@IVobTq&Vt zoZY^==j<;UwrjfUud1n@9u^=Hi9{liNK;`@QZDyKyP~nh?N@JpCs42$5i=9m_xIbU zZ}3Tyhe(l_GLZP3EVNL{zR&V^3c$|(L3ej+^UoP_jH)0Tg!aQSxNFhMl*;v(tB}4F$or3KA1z%KZ9jyDQ5`)ksW?k1fTAewiVk$TyoRNFXq( z@+}$+o&B14JXhPQmN0~urI0y{~ zp(fZKiJ7ipQQM(O|0%_3u;aO5x_s{P9)OO9xX=zqJi}~nY|StA96Ii<&MTLF=0kXu z1Ho*?k5A9`j6dJsR4xe2R6G|xFf`I*^Y!ueFA!A-0`n!ls35rZA~ao4CSGUUC!&6& z)2BGhB>N`fs1kImz$S|#zf9K6?O$RlA^jRE0CYtHxcJuGQqLF#gMPoeKL52-1p%R) z;(s&SuQIazNCY2OJq`#Z6t4<`&t8Pka8PBypCM{2e2Y_I+K7q-O>a;IK{rUQ`0@jF zjM7ygn>>$~psX(*YQQy2d3wy-r}|; m?=n|izDq { id: 1, latitude: latitude, longitude: longitude, - iconPath: '', + iconPath: tricycleIcon, + width: 32, + height: 32, label: { content: item.code || '', color: '#ffffff', diff --git a/src/hjm/trajectory/trajectory.tsx b/src/hjm/trajectory/trajectory.tsx index a194a6d..6e226d9 100644 --- a/src/hjm/trajectory/trajectory.tsx +++ b/src/hjm/trajectory/trajectory.tsx @@ -7,8 +7,8 @@ import {HjmCar} from "@/api/hjm/hjmCar/model"; import './trajectory.scss' import {pageHjmGpsLog} from "@/api/hjm/hjmGpsLog"; import {formatCurrentDate, getCurrentHour} from "@/utils/time"; -// 导入GPS坐标转换工具 import GPS from '@/utils/gpsUtil.js'; +import tricycleIcon from '@/assets/icons/delivery_tricycle.png'; /** * 文章终极列表 @@ -313,6 +313,9 @@ const Location = () => { }, latitude: latitude, longitude: longitude, + iconPath: tricycleIcon, + width: 32, + height: 32, // @ts-ignore name: '位置' }]}