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 0000000..6d50b57 Binary files /dev/null and b/src/assets/icons/delivery_tricycle.png differ diff --git a/src/hjm/location.tsx b/src/hjm/location.tsx index e9e4562..699d3d2 100644 --- a/src/hjm/location.tsx +++ b/src/hjm/location.tsx @@ -5,8 +5,8 @@ import {Button, Input} from '@nutui/nutui-react-taro' import {useRouter} from '@tarojs/taro' import {getHjmCarByCode} from "@/api/hjm/hjmCar"; import {HjmCar} from "@/api/hjm/hjmCar/model"; -// 导入整个GPS对象,因为gpsUtil.js导出的是一个对象而不是命名导出 import GPS from '@/utils/gpsUtil.js'; +import tricycleIcon from '@/assets/icons/delivery_tricycle.png'; import './location.scss' /** @@ -344,7 +344,9 @@ const Location = () => { 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: '位置' }]}