diff --git a/.gitignore b/.gitignore
index be09be3..c184490 100644
--- a/.gitignore
+++ b/.gitignore
@@ -210,6 +210,8 @@ server-go/server-go
*.png
# 应用内品牌/UI 图标属源码资源,需入库(2026-10-22 供应商系统换标)
!src/assets/brand-logo.png
+# 小程序地图「定位」图标(运行时资源,需入库)
+!miniprogram/assets/icons/*.png
.log-analysis.txt
.tablet-full-logcat.txt
.tablet-full-logcat-utf8.txt
diff --git a/docs/design/20261025-小程序配送地图定位当前位置.md b/docs/design/20261025-小程序配送地图定位当前位置.md
new file mode 100644
index 0000000..eeacd1b
--- /dev/null
+++ b/docs/design/20261025-小程序配送地图定位当前位置.md
@@ -0,0 +1,61 @@
+# 小程序配送地图:一键定位到我的当前位置
+
+- 日期:2026-10-25
+- 需求(开发者原话):「当前配送系统这块 我需要一个小按钮是在地图上定位到为我当前的所在位置」
+- 状态:已实施
+
+## 1. 改前事实
+
+| # | 事实 |
+|---|---|
+| F1 | `components/delivery-panel/index.wxml` 的地图已有 `show-location`(系统蓝点),但中心点始终由 `include-points` 按「任务点 + 路线」拟合,**没有回到自身位置**的入口 |
+| F2 | `map` 是原生组件,普通 `` 叠加层在部分机型会被原生图层盖住,叠加控件要用 `cover-view` |
+| F3 | 配送上报已有一套定位能力:`utils/deliveryLocation.js` 的 `ensureLocationAuth()`(含「去设置」引导)+ `getHighAccuracyLocation()`(`gcj02`) |
+| F4 | `MapContext.moveToLocation({ longitude, latitude })` 只平移地图中心,不改缩放与数据绑定 |
+
+## 2. 方案
+
+- 地图卡片右下角加一个**图标按钮**(72rpx 白色圆形 `cover-view` + 36rpx 十字准星 `cover-image` `/assets/icons/locate.png`);
+ 定位中图标降为 45% 透明度(防重复点击)。
+- **进入面板默认就定位一次**(开发者:「这个定位应该是一进入界面默认就执行」):
+ `onPanelShow` 完成 `loadTasks` 后走 `autoLocateSelf()`,`wx.nextTick` 后调 `locateSelf({ silent: true })`。
+ 静默语义 = **已授权才执行**(`wx.getSetting` 先查 `scope.userLocation`),不弹授权框、不弹失败提示、不改按钮态。
+- 点击链路:
+ 1. `await ensureLocationAuth()` —— 复用配送上报的授权口径(拒绝时首次弹「需要定位权限 / 去设置」);
+ 2. `await getHighAccuracyLocation()` —— `gcj02` 坐标系,与 `map` 组件一致;
+ 3. `wx.createMapContext('deliveryMap', this).moveToLocation({ longitude, latitude })`。
+- **只平移地图中心**:不改 `map.includePoints` / `map.scale` / markers / polyline,不触发任何服务端请求,也不改动配送上报与进圈判定。
+
+## 3. 失败与边界
+
+| 情形 | 表现 |
+|---|---|
+| 进入界面时未授权 | **静默跳过**(不弹授权框、不打扰),用户可点「定位」按钮走引导 |
+| 手动点击但未授权 | 首次弹「需要定位权限 / 去设置」;同一次启动内再次点击只提示「请在设置中开启定位权限」 |
+| 系统定位服务关闭 / 超时 | `wx.showToast('定位失败,请稍后重试')` |
+| 连续点击 | `locatingSelf` 在途锁,第二次点击直接返回 |
+| 无地图(`map.show === false`) | 按钮不渲染 |
+
+## 4. 改动清单
+
+| 层 | 文件 |
+|---|---|
+| 小程序 | `miniprogram/components/delivery-panel/index.wxml`(`id="deliveryMap"` + `cover-view` 按钮) |
+| 小程序 | `miniprogram/components/delivery-panel/index.js`(`locatingSelf` + `onLocateSelf()`) |
+| 小程序 | `miniprogram/components/delivery-panel/index.wxss`(`.map-locate`) |
+| 测试 | `server/tests/mpDeliveryMap.test.ts`(新增 1 条) |
+
+## 5. 验收标准
+
+- [x] **一进配送界面,地图就以当前所在位置为中心**(已授权时);
+- [x] 点「定位」后地图以当前所在位置为中心,蓝点可见;
+- [x] 未授权进入不弹窗;手动点「定位」才走「去设置」引导;
+- [x] 拒绝授权 → 按钮回到可点状态,连续点击不并发定位;
+- [x] 不改变路线拟合、任务列表与任何写路径。
+
+## 6. 证据
+
+- `server/tests/mpDeliveryMap.test.ts` 新增 1 条:`
{{nextNavLabel}} · 导航
diff --git a/miniprogram/components/delivery-panel/index.wxss b/miniprogram/components/delivery-panel/index.wxss
index 4cb4769..b3b8c1c 100644
--- a/miniprogram/components/delivery-panel/index.wxss
+++ b/miniprogram/components/delivery-panel/index.wxss
@@ -75,6 +75,29 @@
height: 320rpx;
}
+/* 地图上的「定位」图标按钮:map 为原生组件,只能用 cover-view / cover-image 叠加 */
+.map-locate {
+ position: absolute;
+ right: 20rpx;
+ bottom: 20rpx;
+ width: 72rpx;
+ height: 72rpx;
+ border-radius: 36rpx;
+ background: #ffffff;
+}
+
+.map-locate-icon {
+ position: absolute;
+ left: 18rpx;
+ top: 18rpx;
+ width: 36rpx;
+ height: 36rpx;
+}
+
+.map-locate.is-loading .map-locate-icon {
+ opacity: 0.45;
+}
+
.route-next {
margin: 12rpx 16rpx 16rpx;
padding: 12rpx 16rpx;
diff --git a/server/tests/mpDeliveryMap.test.ts b/server/tests/mpDeliveryMap.test.ts
index 8730de8..3b5aef1 100644
--- a/server/tests/mpDeliveryMap.test.ts
+++ b/server/tests/mpDeliveryMap.test.ts
@@ -76,6 +76,25 @@ describe('小程序配送腾讯地图脚手架', () => {
expect(mobileRoute).toMatch(/map_client: getMapClientConfig/);
});
+ it('map 上有「定位」小按钮,且进页默认定位当前位置', () => {
+ // map 是原生组件,普通 view 盖不住,必须用 cover-view + cover-image
+ expect(wxml).toMatch(/]*class="map-locate-icon"/);
+ expect(wxml).toMatch(/src="\/assets\/icons\/locate\.png"/);
+ expect(wxml).toMatch(/bindtap="onLocateSelf"/);
+ // 取点与授权复用配送上报同一套,坐标系 gcj02
+ expect(panelJs).toMatch(/onLocateSelf\(\)/);
+ expect(panelJs).toMatch(/wx\.createMapContext\('deliveryMap'/);
+ expect(panelJs).toMatch(/moveToLocation\(\{ longitude, latitude/);
+ expect(panelJs).toMatch(/await ensureLocationAuth\(\)/);
+ expect(panelJs).toMatch(/await getHighAccuracyLocation\(\)/);
+ // 一进界面就默认定位(静默:未授权时不弹授权框)
+ expect(panelJs).toMatch(/this\.autoLocateSelf\(\)/);
+ expect(panelJs).toMatch(/locateSelf\(\{ silent: true \}\)/);
+ expect(panelJs).toMatch(/hasForegroundLocationAuth/);
+ });
+
it('orders driver tasks by last_route_plan sequence', () => {
const plan = publicRoutePlanForDriver({
departure_time: '05:10',