hejianhao
2026-03-16 431bb44e5254d504a880c32ff495114a794ad2d7
fix: 修复金额格式化精度并传递electronicAreaId参数

- 在fetchMapData中向getNearestSite调用添加遗漏的electronicAreaId参数
- 将formatMoney的金额显示精度从1位小数修正为2位小数,确保金额显示准确
2个文件已修改
10 ■■■■■ 已修改文件
src/utils/Robotaxi-public-method.ts 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/websocket.ts 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/Robotaxi-public-method.ts
@@ -277,7 +277,7 @@
    // 2. 只有在运营区域内才获取附近站点
    let sites: any = { points: [] };
    if (isInside) {
      sites = await getNearestSite({ latitude: lat, longitude: lng }).catch(e => {
      sites = await getNearestSite({ latitude: lat, longitude: lng, electronicAreaId }).catch(e => {
        return { points: [] };
      });
      // 兼容处理
@@ -403,7 +403,7 @@
  if (Number.isNaN(num)) {
    return '--';
  }
  return num.toFixed(1);
  return num.toFixed(2);
};
export const formatNumber = (value: any, digits = 1) => {
src/utils/websocket.ts
@@ -42,7 +42,7 @@
    const uid = await getStorage(_UID) || '-1';
    const task = Taro.connectSocket({
      header: {
        'XP-Uid': '20260227200715' || uid.toString(),
        'XP-Uid': uid.toString(),
      },
      url: this.url,
      success: () => { },
@@ -88,7 +88,7 @@
        this.reconnectAttempts = 0;
        this.startHeartbeat();
        const uid = await getStorage(_UID) || '-1';
        this.send({ type: 'auth', appUserId: '20260227200715' || uid.toString(), timestamp: Date.now() });
        this.send({ type: 'auth', appUserId: uid.toString(), timestamp: Date.now() });
        this.notifyListeners('open', { status: 'connected' });
      });
@@ -136,7 +136,7 @@
      this.reconnectAttempts = 0;
      this.startHeartbeat();
      const uid = await getStorage(_UID) || '-1';
      this.send({ type: 'auth', appUserId:'20260227200715' || uid.toString(), timestamp: Date.now() });
      this.send({ type: 'auth', appUserId: uid.toString(), timestamp: Date.now() });
      this.notifyListeners('open', { status: 'connected' });
    });