跳到主要内容

tlbs-map-react 通过 ref 设置中心点

· 阅读需 4 分钟
Quany
软件工程师

tlbs-map-react 中,通过 ref 设置地图中心点是一种非常灵活和强大的方式。下面我为您详细介绍几种实现方法:

🔧 方法一:使用 useRef 获取地图实例(推荐)

这是最常用和推荐的方法,通过 React 的 useRef Hook 获取地图实例,然后调用地图的原生方法。

import React, { useRef, useState } from 'react';
import { TMap } from 'tlbs-map-react';

const MapComponent = () => {
// 创建 ref 引用
const mapRef = useRef(null);
const [newCenter, setNewCenter] = useState({ lat: 39.916, lng: 116.397 });

// 地图加载完成后的回调
const handleMapLoad = (mapInstance) => {
mapRef.current = mapInstance;
console.log('地图实例已获取:', mapInstance);
};

// 通过 ref 设置中心点的函数
const setMapCenter = (lat, lng) => {
if (mapRef.current) {
// 方法1: 使用 setCenter 方法
mapRef.current.setCenter(new TMap.LatLng(lat, lng));

// 方法2: 或者使用 panTo 方法(平滑移动)
// mapRef.current.panTo(new TMap.LatLng(lat, lng));

console.log(`地图中心已设置为: ${lat}, ${lng}`);
} else {
console.warn('地图实例尚未就绪');
}
};

// 处理输入框变化
const handleInputChange = (e) => {
const { name, value } = e.target;
setNewCenter(prev => ({
...prev,
[name]: parseFloat(value)
}));
};

return (
<div style={{ width: '100%', height: '500px' }}>
{/* 控制面板 */}
<div style={{ marginBottom: '10px', padding: '10px', background: '#f5f5f5' }}>
<label>纬度: </label>
<input
type="number"
name="lat"
value={newCenter.lat}
onChange={handleInputChange}
step="0.0001"
/>
<label style={{ marginLeft: '10px' }}>经度: </label>
<input
type="number"
name="lng"
value={newCenter.lng}
onChange={handleInputChange}
step="0.0001"
/>
<button
onClick={() => setMapCenter(newCenter.lat, newCenter.lng)}
style={{ marginLeft: '10px' }}
>
设置中心点
</button>
</div>

{/* 地图组件 */}
<TMap
ref={mapRef}
apiKey="您的腾讯地图密钥"
options={{
center: newCenter, // 初始中心点
zoom: 12
}}
onLoad={handleMapLoad}
/>
</div>
);
};

export default MapComponent;

🎯 方法二:创建自定义 Hook

为了更好的代码复用,可以创建一个自定义 Hook:

import { useRef, useCallback } from 'react';

// 自定义 Hook:用于地图操作
export const useMapControl = () => {
const mapRef = useRef(null);

const setCenter = useCallback((lat, lng) => {
if (mapRef.current) {
mapRef.current.setCenter(new TMap.LatLng(lat, lng));
return true;
}
return false;
}, []);

const getCenter = useCallback(() => {
if (mapRef.current) {
return mapRef.current.getCenter();
}
return null;
}, []);

const setZoom = useCallback((zoomLevel) => {
if (mapRef.current) {
mapRef.current.setZoom(zoomLevel);
}
}, []);

return {
mapRef,
setCenter,
getCenter,
setZoom
};
};

// 在组件中使用
const MyMap = () => {
const { mapRef, setCenter, getCenter } = useMapControl();

const handleSetToBeijing = () => {
setCenter(39.9042, 116.4074);
};

const handleLogCenter = () => {
const center = getCenter();
if (center) {
console.log('当前中心点:', center.lat, center.lng);
}
};

return (
<div>
<div>
<button onClick={handleSetToBeijing}>定位到北京</button>
<button onClick={handleLogCenter}>打印中心点</button>
</div>

<TMap
ref={mapRef}
apiKey="您的密钥"
options={{
center: { lat: 39.916, lng: 116.397 },
zoom: 10
}}
/>
</div>
);
};

📍 方法三:结合地理编码设置中心点

在实际应用中,经常需要根据地址名称来设置中心点:

import React, { useRef, useState } from 'react';
import { TMap } from 'tlbs-map-react';

const GeocodingMap = () => {
const mapRef = useRef(null);
const [address, setAddress] = useState('');

// 地理编码函数
const geocodeAddress = async (address) => {
try {
// 使用腾讯地图地理编码服务
const geocoder = new TMap.service.Geocoder();

return new Promise((resolve, reject) => {
geocoder.getLocation({ address: address }, (result) => {
if (result && result.result && result.result.location) {
resolve(result.result.location);
} else {
reject('地址解析失败');
}
});
});
} catch (error) {
console.error('地理编码错误:', error);
throw error;
}
};

const handleSearch = async () => {
if (!address.trim()) return;

try {
const location = await geocodeAddress(address);
if (mapRef.current && location) {
mapRef.current.setCenter(new TMap.LatLng(location.lat, location.lng));
mapRef.current.setZoom(15); // 放大到更详细的级别
}
} catch (error) {
alert('无法找到该地址,请重试');
}
};

return (
<div>
<div style={{ marginBottom: '10px' }}>
<input
type="text"
value={address}
onChange={(e) => setAddress(e.target.value)}
placeholder="输入地址..."
style={{ width: '300px', padding: '8px' }}
onKeyPress={(e) => e.key === 'Enter' && handleSearch()}
/>
<button onClick={handleSearch} style={{ padding: '8px 16px', marginLeft: '10px' }}>
搜索
</button>
</div>

<TMap
ref={mapRef}
apiKey="您的密钥"
options={{
center: { lat: 39.916, lng: 116.397 },
zoom: 10
}}
style={{ width: '100%', height: '400px' }}
/>
</div>
);
};

⚠️ 重要注意事项

  1. 确保地图已加载:在调用 mapRef.current 的方法之前,务必检查 mapRef.current 不为 null

  2. 错误处理

const safeSetCenter = (lat, lng) => {
if (!mapRef.current) {
console.error('地图实例未就绪');
return;
}

try {
mapRef.current.setCenter(new TMap.LatLng(lat, lng));
} catch (error) {
console.error('设置中心点失败:', error);
}
};
  1. 性能优化:频繁设置中心点可能会影响性能,可以考虑使用防抖:
import { debounce } from 'lodash';

const debouncedSetCenter = debounce((lat, lng) => {
if (mapRef.current) {
mapRef.current.setCenter(new TMap.LatLng(lat, lng));
}
}, 300);

通过 ref 设置中心点为您提供了最大的灵活性,特别是在需要动态响应各种用户交互或数据变化的场景中。

微信公众号

微信公众号

热更新解决方案

· 阅读需 1 分钟
Deng
数据标注/AI训练师

问题

鑫联盟需求要 16 以下的 node版本,但react-native-update-cli需要 18 以上的版本,故而左右为难;

脚本: react-native-update-cli/lib/bundle.js

    const reactNativeBundleProcess = (0, _child_process.spawn)('/Volumes/Samsung/Home/.nvm/versions/node/v16.20.2/bin/node', reactNativeBundleArgs);
console.log(`Running bundle command: node ${reactNativeBundleArgs.join(' ')}`);

微信公众号

微信公众号

flutter app_settings 使用教程

· 阅读需 4 分钟
Quany
软件工程师

app_settings 插件让 Flutter 应用能够便捷地打开系统和应用自身的设置页面,这在引导用户开启权限或调整系统设置时非常实用。下面是一个详细的使用指南。

📲 安装与配置

首先,将 app_settings 插件添加到你的项目中。

  1. 添加依赖:在 pubspec.yaml 文件的 dependencies 部分添加最新版本的插件。

    dependencies:
    flutter:
    sdk: flutter
    app_settings: ^6.1.1

    然后运行 flutter pub get 命令来安装依赖。

  2. 平台特定配置(iOS)

    • 如果项目使用 Objective-C:需要在 ios/Podfile 中启用 use_frameworks!
      target 'Runner' do
      use_frameworks!
      # ... 其他配置
      end
    • 如果使用 Swift Package Manager (SPM):需要在终端执行 flutter config --enable-swift-package-manager 来启用 Swift 支持。

🎯 核心使用方法

完成安装后,你可以在代码中导入并使用插件。

1. 打开通用应用设置

最基本的功能是打开当前应用的系统设置页面,用户可以在这里管理应用权限。

import 'package:flutter/material.dart';
import 'package:app_settings/app_settings.dart';

ElevatedButton(
onPressed: () {
// 这将跳转到系统中本应用的设置界面
AppSettings.openAppSettings();
},
child: const Text('打开应用设置'),
)

2. 打开特定系统设置页面

插件支持直接跳转到特定的系统设置页面,如位置、Wi-Fi、蓝牙、通知等。当用户需要开启某项权限时,这能提供更直接的引导。

ElevatedButton(
onPressed: () {
// 直接打开系统的位置服务设置页面
AppSettings.openAppSettings(type: AppSettingsType.location);
},
child: const Text('打开位置设置'),
)

下面的表格汇总了插件支持打开的主要设置类型:

设置类型 (AppSettingsType)说明
settings当前应用的详细设置页面(默认)
location系统定位服务设置
wifiWi-Fi 网络设置
bluetooth蓝牙设置
notification通知设置
sound声音和音量设置
display显示设置
developer开发者选项(Android)

3. Android Q及以上版本的设置面板

对于 Android Q (API 29) 及更高版本,插件还支持打开快速设置面板(Settings Panel),它会在悬浮窗中显示部分常用设置,用户无需离开当前应用即可进行快速调整。

ElevatedButton(
onPressed: () {
// 在Android Q+设备上会弹出音量控制面板
AppSettings.openAppSettingsPanel(AppSettingsPanelType.volume);
},
child: const Text('快速调节音量'),
)

除了音量 (volume),支持的设置面板类型还包括互联网连接 (internetConnectivity)、NFC (nfc) 和电池状态 (battery) 等。

4. Android平台高级选项

在 Android 上,你可以在打开设置页面时使用 asAnotherTask 参数。将其设置为 true 会使设置页面在一个新的 Activity 中打开,这有助于维护应用的导航栈状态。

AppSettings.openAppSettings(
type: AppSettingsType.notification,
asAnotherTask: true, // 在新Activity中打开
);

💡 最佳实践与注意事项

为了确保最佳的用户体验和功能稳定性,这里有一些建议:

实践要点说明与建议
检查平台兼容性某些设置类型可能在某些平台或系统版本上不受支持。插件在遇到不支持的类型时会自动回退到打开通用应用设置页面。
清晰的用户引导在跳转设置页面前,最好通过对话框或文字向用户说明为何需要他们进行此操作(例如:“请在系统设置中开启位置权限,以便为您提供周边服务。”)。
处理回退场景从设置页面返回应用后,建议在 Widget 的生命周期方法(如 onResume)中检查用户是否已授权,并更新应用的UI状态。
iOS 私有 API 注意在 iOS 上,直接打开特定设置子页面(如 AppSettingsType.wifi)使用的是以 App-Prefs:root= 开头的私有 URL Scheme。请注意,在提交 App Store 审核时,使用私有 API 可能存在理论上的风险,尽管在实践中通常被接受。最稳妥的方式是仅打开通用应用设置(AppSettingsType.settings)。

希望这份详细的教程能帮助你顺利地在项目中集成 app_settings 插件。如果你在特定场景下遇到更具体的问题,欢迎随时提出。

微信公众号

微信公众号

热更新解决方案

· 阅读需 7 分钟
Quany
软件工程师

根据项目中的服务文件,我将API接口按功能模块进行了分类整理。以下是各模块的接口详情:

1. 公共接口 (common-service.ts)

获取枚举字段

function getFieldEnum(params: { code: string }): Promise<any>
  • URL: /operation-manager/object/field/enum/metadata/listFieldEnumValue
  • 参数:
    • code: string - 枚举字段代码
  • 返回: 枚举值列表

单图上传

function postSingleImgUpload(file: File)
  • URL: /resource/management/file/upload
  • 参数:
    • file: File - 图片文件对象
  • 返回: 上传结果,包含图片URL等信息

分类树形结构

function postCategoryList(params: Record<string, any>)
  • URL: /boMenuApi/gql/category/list
  • 参数: 分类查询参数
  • 返回: 分类树形结构数据

获取菜单分类分组

function getMenuCategory(params = { isArchived: false }): Promise<any>
  • URL: /boMenuApi/api/menu/tree
  • 参数:
    • isArchived: boolean - 是否包含归档项,默认false
  • 返回: 菜单分类树

查询业务配置

function queryBizConfig(params?: any, config?: any): Promise<any>
  • URL: /vulcan/special/queryConfig
  • 参数: 配置查询参数
  • 返回: 业务配置信息

发布菜单

function publishMenu(params: any, config?: any): Promise<any>
  • URL: /boMenuApi/bo-menu/api/publish-tool/addPos
  • 参数: 发布相关参数
  • 返回: 发布结果

新增商品规格类型

function postItemSizeAdd(params: Record<string, any> = {})
  • URL: /boMenuApi/api/item/size/add
  • 参数: 规格类型信息
  • 返回: 新增结果

AI识别图片上传

function postFilesUpload(params: any, config?: any)
  • URL: /boMenuApi/api/item/proxy/starship-upload
  • 参数: 上传相关参数
  • 返回: 上传结果

获取商户信息

function getCorporationInfo(params: any = {}): Promise<any>
  • URL: /boShopApi/api/corporation/corporationInfo
  • 参数: 查询参数
  • 返回: 商户信息

2. 门店管理接口 (store/service.ts)

查询门店

function queryStore(params: { dataId: string }): Promise<Response<StoreInfo | null>>
  • URL: /boShopApi/api/shop/query
  • 参数:
    • dataId: string - 门店ID(必填)
  • 返回: 门店信息对象

更新门店

function updateStore(params: UpdateStoreInfoParams): Promise<Response<any>>
  • URL: /boShopApi/api/shop/update
  • 参数: 门店信息更新对象
  • 返回: 更新结果

批量保存或更新语言

function batchSaveOrUpdateLanguage(params: BatchSaveOrUpdateLanguageParams): Promise<Response<null>>
  • URL: /operation-manager/content/language/batchSaveOrUpdate
  • 参数: 语言批量更新参数
  • 返回: 更新结果

获取语言内容

function getContentLanguage(params: { domain: string; resource: string; key: string }): Promise<Response<null>>
  • URL: /operation-manager/content/language/getContentLanguage
  • 参数:
    • domain: string - 域名
    • resource: string - 资源名
    • key: string - 键名
  • 返回: 语言内容

自动生成门店编码

function generateStoreCode(params: { corporationId: string; orgType: string }): Promise<Response<string>>
  • URL: /organize/generateOrgCode
  • 参数:
    • corporationId: string - 公司ID
    • orgType: string - 组织类型
  • 返回: 生成的门店编码

查询员工列表

function queryEmployeeList(params: QueryEmployeeListParams): Promise<Response<Employee[]>>
  • URL: /vulcan/employee/queryEmployeeByCodes
  • 参数: 员工查询参数
  • 返回: 员工列表

其他查询接口

接口名URL参数返回
查询语言列表/operation-manager/dictionary/listLanguage分页参数语言列表
查询品牌列表/organize/queryBrandListcorporationId: string品牌列表
查询货币列表/operation-manager/dictionary/listCurrency分页参数货币列表
获取日期格式列表/operation-manager/format/listDataFormatAll分页参数日期格式列表
获取时间格式列表/operation-manager/format/listTimeFormatAll分页参数时间格式列表
获取数字格式列表/operation-manager/format/listNumberFormat分页参数数字格式列表
获取电话格式列表/operation-manager/format/listPhoneFormatAllcountryCode: string电话格式列表
获取时区列表/operation-manager/dictionary/listTimeZone国家代码列表和归档状态时区列表
查询国家列表/operation-manager/dictionary/listCountrylanguageCode: string国家列表
查询区域/operation-manager/dictionary/listArea国家代码、语言代码等区域列表
查询地址格式/operation-manager/format/listAddressFormatAllcountryCode: string地址格式列表

地图相关接口

// 搜索地点
function searchLocation(params: { address: string }): Promise<Response<any>>
// 经纬度取位置信息
function getLocationInfo(params: { latitude: string; longitude: string }): Promise<Response<any>>

3. 桌台管理接口 (table/service.ts)

桌台相关接口

接口名URL参数返回
查询桌台/boShopApi/api/table/listTable区域ID、分页参数等桌台列表
新增桌台/boShopApi/api/table/createTable桌台信息对象添加结果
修改桌台/boShopApi/api/table/updateTable桌台信息对象更新结果
删除桌台/boShopApi/api/table/deleteTabletableId: string删除结果
查询单桌台/boShopApi/api/table/queryTabletableId: string桌台详情
排序桌台/boShopApi/api/table/tableSort桌台排序数组排序结果
批量新增桌台/boShopApi/api/table/batchInsertTable批量桌台参数批量添加结果
批量删除桌台/boShopApi/api/table/batchDeleteTable桌台ID数组批量删除结果
批量修改桌台/boShopApi/api/table/batchUpdateTable批量桌台参数批量更新结果

区域相关接口

接口名URL参数返回
查询区域/boShopApi/api/area/queryAreaareaId: string区域详情
新增区域/boShopApi/api/area/createArea区域信息对象添加结果
修改区域/boShopApi/api/area/updateArea区域信息对象更新结果
获取区域列表/boShopApi/api/area/listArea归档状态区域列表
排序区域/boShopApi/api/area/areaSort区域排序数组排序结果
删除区域/boShopApi/api/area/deleteAreaareaId: string删除结果

其他桌台管理接口

接口名URL参数返回
查询(处理服务费)/boMenuApi/surcharge/queryPage归档状态、服务费类型、分页参数服务费列表
发布桌台/boShopApi/api/area/publish发布结果

4. 菜单管理接口 (menus/service.ts)

菜单相关接口

接口名URL参数返回
查询菜单列表/boMenuApi/api/menu/tree归档状态、菜单渠道菜单树结构
添加菜单/boMenuApi/api/menu/add菜单信息对象添加结果
修改菜单/boMenuApi/api/menu/update菜单信息对象更新结果
查询菜单/boMenuApi/api/menu/querydataId: string菜单详情
菜单排序/boMenuApi/api/menu/set/sequence中心菜单UID、排序信息排序结果
获取价格带/boMenuApi/api/pricing/all查询参数价格带列表

菜单分组相关接口

接口名URL参数返回
创建菜单分组/boMenuApi/api/menu/group/add菜单分组信息添加结果
更新菜单分组/boMenuApi/api/menu/group/update菜单分组信息更新结果
获取菜单分组详情/boMenuApi/api/menu/group/query查询参数菜单分组详情

5. 商品分类接口 (categories/service.tsx)

分类相关接口

接口名URL参数返回
获取商品分类列表/boMenuApi/gql/category/list分类级别类型、归档状态分类列表
获取商品分类详情/boMenuApi/gql/category/v2/getOnedataId: string分类详情
新增分类/boMenuApi/gql/category/add分类信息添加结果
编辑分类/boMenuApi/gql/category/update分类信息更新结果

其他相关接口

接口名URL参数返回
查询备餐站列表/boShopApi/api/prep/station/shop/listPage分页参数、归档状态备餐站列表
查询税率列表/boMenuApi/api/tax/queryPage分页参数、归档状态税率列表
查询科目名称/boShopApi/api/financial/account/list查询参数科目列表
查询课程列表/boMenuApi/api/course/list归档状态课程列表

6. 通用功能接口 (commons/service.ts)

图片处理接口

接口名URL参数返回
批量裁剪图片/resource/management/image/space/shearImageBatch图片裁剪数据裁剪结果
上传图片/resource/management/file/upload图片文件上传结果

7. 接口返回数据结构

大部分接口的返回数据遵循以下通用结构:

// 基本响应结构
type Response<T> = {
code: string; // 响应码,000表示成功
message: string; // 响应消息
data: T; // 响应数据,具体类型由接口定义
}

// 带分页的响应结构
type ResponseWithPager<T> = {
code: string;
message: string;
data: {
list: T[]; // 数据列表
page: PageInfo; // 分页信息
};
}

// 分页信息
type PageInfo = {
total: number; // 总记录数
pageNo: number; // 当前页码
pageSize: number; // 每页大小
pageCount: number; // 总页数
}

以上是项目中所有主要API接口的汇总信息,包含了接口的分类、功能、请求参数和返回数据结构。

微信公众号

微信公众号

前端开发相关讨论

· 阅读需 4 分钟
Quany
软件工程师

讨论内容

会议讨论了前端开发的流程、规范、投产注意事项以及新工具MCP的使用等内容,具体如下:

  • 前端开发文档与流程
    • 入职手册内容:包含前端开发入职手册,涉及VPN、Git、Satan、OM系统等账号申请及使用说明,如VPN账号用于联网及登录其他系统,申请后用该账号登录Git并分配代码权限。
    • 投产流程规范:强调投产流程规范化,包括与产品沟通、检查单填写、后端先投前端再投、代码合并、项目构建与部署等步骤,新菜单需求分支合并有特殊要求。
    • 发版时间安排:遵循两周一次大迭代的节奏,不同地区发版时间不同,如周一晚10点发北京、第三天10点发东南亚、周四10点半发欧洲、下午发北美,周二周五不上线。
  • 代码规范与管理
    • 命名规范:商户APP分支命名有规范,如release、测试分支、需求分支等有特定命名方式,可避免混淆和代码管理问题。
    • 版本管理:不同APP版本管理方式不同,商户APP和预定APP需自行管理总分值和tag,养成规范打tag习惯有助于了解项目迭代情况。
    • 临时分支使用:临时分支可用于剔除特定需求,避免回滚代码,操作简单高效。
  • APP上架与更新
    • 苹果商店上架:需填写字符描述关键词、更新语等信息,选择上传test fly后的构建版本号,提交审核。
    • Google play上架:新增APP时需填资料,加版本号后上传AAB文件送审,审核进度可通过绑定邮箱查看。
  • 前端技术方案规范
    • 方案目的:是衔接产品、测试、前后端开发的核心文档,消除信息差,明确实现路径。
    • 内容要求:包括需求背景(结合产品文档加见解)、目的、核心功能、分工、待确认项等,可参考消息APP设置消息推送模板。
  • 投产配置与注意事项
    • 平台与仓库概念:常用管理平台业务环境OM和静态资源部署平台CSD,项目开发涉及自己的仓库和package仓库(类似后端阿波罗配置中心)。
    • 代码合并与部署:发生产时将对应区域生产分支合到本地,解决冲突后推上去合并,部署按开发、测试、UAT验证、生产环境流程进行。
    • 配置注意事项:业务对象、菜单和角色、翻译工作台等配置有要求和注意点,如业务对象配置多语言时英文借助工具精简,菜单发布需提前制定计划并与北京相关人员沟通。
  • MCP工具介绍与使用
    • 工具功能:是前端知识库,可查询文档规范、投产流程、代码使用方法等,提高工作效率,减少询问同事时间。
    • 数据存储与更新:数据存储在周佐他们的数据库,源头文档更新需手动同步。
    • 使用方法:通过特定指令查询,平台搭建未完成,后续会有全局config,大家可收集问题反馈。
  • 任务
    • 仓库统计添加:在文档中添加统计,记录只用 release 分支发版的仓库数量,同时维护项目分支情况,自行填写负责或设计的项目信息
    • UAT操作补充:补充发 UAT 版本时菜单开关的注意事项及操作流程,说明如何避免与他人操作相互覆盖,有问题可咨询说话人 5 或周云
    • 操作例子发送:将生产的 package 项目发 UAT 时,在 release 分支修改对应版本号的操作原理和快捷方式的例子发送到群里
    • 全局 config 整理:整理一个全局的 config,以便开发过程中遇到问题时更方便调用,无需再单独调用;收集日常开发问题,可找彭强反馈。

微信公众号

微信公众号

热更新解决方案

· 阅读需 12 分钟
Quany
软件工程师
  1. 睿管家App国际地区地图组件开发 11 月 19 号

    • Google API密钥 待提供
    • Flutter 插件开发 已完成
    • 地图页面 待完成
    • 国家/地区页面 待完成

    flutter 运行 iOS

// 获取国家列表 /operation-manager/dictionary/listCountry

  • 返回数据:
{
"code": "000",
"msg": "ok",
"data": [
{
"id": "41",
"countryCode": "BE",
"alpha3Code": "BEL",
"numericCode": "56",
"telephoneAreaCode": "",
"text": "比利时",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "develop",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "比利时",
"currency": "EUR",
"mapManufacturers": "Google Maps",
"localLanguage": "Belgien/België/Belgique",
"businessScenarioList": [
"base",
"Member"
]
},
{
"id": "40",
"countryCode": "FR",
"alpha3Code": "FRA",
"numericCode": "250",
"telephoneAreaCode": "",
"text": "法国",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "develop",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "法国",
"currency": "EUR",
"mapManufacturers": "Google Maps",
"localLanguage": "France",
"businessScenarioList": [
"base",
"Member"
]
},
{
"id": "100007",
"countryCode": "JP",
"alpha3Code": "JPN",
"numericCode": "392",
"telephoneAreaCode": "",
"text": "日本",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "sys",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "日本",
"currency": "JPY",
"mapManufacturers": "Google Maps",
"localLanguage": "日本",
"businessScenarioList": [
"base",
"Member"
]
},
{
"id": "100008",
"countryCode": "MN",
"alpha3Code": "MNG",
"numericCode": "496",
"telephoneAreaCode": "",
"text": "蒙古国",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "sys",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "蒙古国",
"currency": "MNT",
"mapManufacturers": "Google Maps",
"localLanguage": "Монгол Улс",
"businessScenarioList": [
"base",
"Member"
]
},
{
"id": "100006",
"countryCode": "TH",
"alpha3Code": "THA",
"numericCode": "764",
"telephoneAreaCode": "",
"text": "泰国",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "develop",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "泰王国",
"currency": "THB",
"mapManufacturers": "Google Maps",
"localLanguage": "ประเทศไทย",
"businessScenarioList": [
"base",
"Member"
]
},
{
"id": "33",
"countryCode": "CN",
"alpha3Code": "CHN",
"numericCode": "156",
"telephoneAreaCode": "",
"text": "中国",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "develop",
"modifiedBy": "zhaokun",
"isArchived": false,
"isDeleted": "0",
"fullName": "中国",
"currency": "CNY",
"mapManufacturers": "Tencent Map",
"localLanguage": "中国",
"businessScenarioList": [
"base",
"Member"
]
},
{
"id": "100022",
"countryCode": "IE",
"alpha3Code": "IRL",
"numericCode": "372",
"telephoneAreaCode": "",
"text": "爱尔兰",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "sys",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "Ireland",
"currency": "EUR",
"mapManufacturers": "Google Maps",
"localLanguage": "Éire/Ireland",
"businessScenarioList": [
"base",
"Member"
]
},
{
"id": "44",
"countryCode": "HU",
"alpha3Code": "HUN",
"numericCode": "348",
"telephoneAreaCode": "",
"text": "匈牙利",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "develop",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "匈牙利",
"currency": "HUF",
"mapManufacturers": "Google Maps",
"localLanguage": "Magyarország",
"businessScenarioList": [
"base",
"Member"
]
},
{
"id": "100024",
"countryCode": "KH",
"alpha3Code": "KHM",
"numericCode": "116",
"telephoneAreaCode": "",
"text": "柬埔寨",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "sys",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "柬埔寨",
"currency": "KHR",
"mapManufacturers": "Google Maps",
"localLanguage": "កម្ពុជា",
"businessScenarioList": [
"base",
"Member"
]
},
{
"id": "43",
"countryCode": "PH",
"alpha3Code": "PHL",
"numericCode": "608",
"telephoneAreaCode": "",
"text": "菲律宾",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "develop",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "菲律宾",
"currency": "PHP",
"mapManufacturers": "Google Maps",
"localLanguage": "Pilipinas",
"businessScenarioList": [
"base",
"Member"
]
},
{
"id": "42",
"countryCode": "NL",
"alpha3Code": "NLD",
"numericCode": "528",
"telephoneAreaCode": "",
"text": "荷兰",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "develop",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "荷兰",
"currency": "EUR",
"mapManufacturers": "Google Maps",
"localLanguage": "Nederlands",
"businessScenarioList": [
"base",
"Member"
]
},
{
"id": "39",
"countryCode": "SG",
"alpha3Code": "SGP",
"numericCode": "702",
"telephoneAreaCode": "",
"text": "新加坡",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "develop",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "新加坡",
"currency": "SGD",
"mapManufacturers": "Google Maps",
"localLanguage": "新加坡",
"businessScenarioList": [
"base",
"Member"
]
},
{
"id": "45",
"countryCode": "ID",
"alpha3Code": "IDN",
"numericCode": "360",
"telephoneAreaCode": "",
"text": "印度尼西亚",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "develop",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "印度尼西亚",
"currency": "IDR",
"mapManufacturers": "Google Maps",
"localLanguage": "Indonesia",
"businessScenarioList": [
"base",
"Member"
]
},
{
"id": "100001",
"countryCode": "NZ",
"alpha3Code": "NZL",
"numericCode": "554",
"telephoneAreaCode": "",
"text": "新西兰",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "develop",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "新西兰",
"currency": "NZD",
"mapManufacturers": "Google Maps",
"localLanguage": "New Zealand",
"businessScenarioList": [
"base",
"Member"
]
},
{
"id": "32",
"countryCode": "US",
"alpha3Code": "USA",
"numericCode": "840",
"telephoneAreaCode": "",
"text": "美国",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "develop",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "美国",
"currency": "USD",
"mapManufacturers": "Google Maps",
"localLanguage": "United States",
"businessScenarioList": [
"base",
"Member"
]
},
{
"id": "35",
"countryCode": "IT",
"alpha3Code": "ITA",
"numericCode": "380",
"telephoneAreaCode": "",
"text": "意大利",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "develop",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "意大利",
"currency": "EUR",
"mapManufacturers": "Google Maps",
"localLanguage": "Italia",
"businessScenarioList": [
"base",
"Member"
]
},
{
"id": "37",
"countryCode": "DE",
"alpha3Code": "DEU",
"numericCode": "276",
"telephoneAreaCode": "",
"text": "德国",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "develop",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "德国",
"currency": "EUR",
"mapManufacturers": "Google Maps",
"localLanguage": "Deutschland",
"businessScenarioList": [
"base",
"Member"
]
},
{
"id": "800002",
"countryCode": "MM",
"alpha3Code": "MMR",
"numericCode": "104",
"telephoneAreaCode": "",
"text": "缅甸",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "zhaohongyuan",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "缅甸联邦共和国",
"currency": "MMK",
"mapManufacturers": "Google Maps",
"localLanguage": "ပြည်ထောင်စု သမ္မတ မြန်မာနိုင်ငံတော်",
"businessScenarioList": [
"base"
]
},
{
"id": "34",
"countryCode": "ES",
"alpha3Code": "ESP",
"numericCode": "724",
"telephoneAreaCode": "",
"text": "西班牙",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "develop",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "西班牙",
"currency": "EUR",
"mapManufacturers": "Google Maps",
"localLanguage": "España",
"businessScenarioList": [
"base",
"Member"
]
},
{
"id": "600001",
"countryCode": "MX",
"alpha3Code": "MEX",
"numericCode": "484",
"telephoneAreaCode": "",
"text": "墨西哥",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "zhaohongyuan",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "Mexico",
"currency": "MXN",
"mapManufacturers": "Google Maps",
"localLanguage": "Mexico",
"businessScenarioList": [
"base"
]
},
{
"id": "700001",
"countryCode": "SB",
"alpha3Code": "SLB",
"numericCode": "090",
"telephoneAreaCode": "",
"text": "所罗门群岛",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "zhaohongyuan",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "所罗门群岛",
"currency": "SBD",
"mapManufacturers": "Google Maps",
"localLanguage": "所罗门群岛",
"businessScenarioList": [
"base"
]
},
{
"id": "100005",
"countryCode": "AE",
"alpha3Code": "ARE",
"numericCode": "784",
"telephoneAreaCode": "",
"text": "阿联酋",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "develop",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "阿拉伯联合酋长国",
"currency": "AED",
"mapManufacturers": "Google Maps",
"localLanguage": "الإمارات العربية المتحدة",
"businessScenarioList": [
"base",
"Member"
]
},
{
"id": "13",
"countryCode": "GB",
"alpha3Code": "GBR",
"numericCode": "826",
"telephoneAreaCode": "",
"text": "英国",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "develop",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "英国",
"currency": "GBP",
"mapManufacturers": "Google Maps",
"localLanguage": "United Kingdom / Britain",
"businessScenarioList": [
"base",
"Member"
]
},
{
"id": "700002",
"countryCode": "TW",
"alpha3Code": "TWN",
"numericCode": "158",
"telephoneAreaCode": "",
"text": "中国台湾",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "zhaohongyuan",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "中国台湾",
"currency": "TWD",
"mapManufacturers": "Google Maps",
"localLanguage": "中国台湾",
"businessScenarioList": [
"base"
]
},
{
"id": "200004",
"countryCode": "KR",
"alpha3Code": "KOR",
"numericCode": "410",
"telephoneAreaCode": "",
"text": "韩国",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "zhaohongyuan",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "韩国",
"currency": "KRW",
"mapManufacturers": "Google Maps",
"localLanguage": "대한민국",
"businessScenarioList": [
"base",
"Member"
]
},
{
"id": "47",
"countryCode": "LA",
"alpha3Code": "LAO",
"numericCode": "418",
"telephoneAreaCode": "",
"text": "老挝",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "develop",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "老挝",
"currency": "LAK",
"mapManufacturers": "Google Maps",
"localLanguage": "ປະເທດລາວ",
"businessScenarioList": [
"base",
"Member"
]
},
{
"id": "200001",
"countryCode": "SA",
"alpha3Code": "SAU",
"numericCode": "682",
"telephoneAreaCode": "",
"text": "沙特",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "sys",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "沙特阿拉伯王国",
"currency": "SAR",
"mapManufacturers": "Google Maps",
"localLanguage": "المملكة العربية السعودية",
"businessScenarioList": [
"base",
"Member"
]
},
{
"id": "300000",
"countryCode": "TJ",
"alpha3Code": "TJK",
"numericCode": "762",
"telephoneAreaCode": "",
"text": "塔吉克斯坦",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "zhaohongyuan",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "塔吉克斯坦",
"currency": "TJS",
"mapManufacturers": "Google Maps",
"localLanguage": "Тоҷикистон",
"businessScenarioList": [
"base",
"Member"
]
},
{
"id": "200005",
"countryCode": "AT",
"alpha3Code": "AUT",
"numericCode": "40",
"telephoneAreaCode": "",
"text": "奥地利",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "zhaohongyuan",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "奥地利",
"currency": "EUR",
"mapManufacturers": "Google Maps",
"localLanguage": "Österreich",
"businessScenarioList": [
"base",
"Member"
]
},
{
"id": "100000",
"countryCode": "AU",
"alpha3Code": "AUS",
"numericCode": "36",
"telephoneAreaCode": "",
"text": "澳大利亚",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "develop",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "澳大利亚",
"currency": "AUD",
"mapManufacturers": "Google Maps",
"localLanguage": "Australia",
"businessScenarioList": [
"base",
"Member"
]
},
{
"id": "200008",
"countryCode": "BR",
"alpha3Code": "BRA",
"numericCode": "76",
"telephoneAreaCode": "",
"text": "巴西",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "zhaohongyuan",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "巴西",
"currency": "BRL",
"mapManufacturers": "Google Maps",
"localLanguage": "Brasil",
"businessScenarioList": [
"base",
"Member"
]
},
{
"id": "36",
"countryCode": "CA",
"alpha3Code": "CAN",
"numericCode": "124",
"telephoneAreaCode": "",
"text": "加拿大",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "develop",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "加拿大",
"currency": "CAD",
"mapManufacturers": "Google Maps",
"localLanguage": "Canada",
"businessScenarioList": [
"base",
"Member"
]
},
{
"id": "100003",
"countryCode": "MY",
"alpha3Code": "MYS",
"numericCode": "458",
"telephoneAreaCode": "",
"text": "马来西亚",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "develop",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "马来西亚",
"currency": "MYR",
"mapManufacturers": "Google Maps",
"localLanguage": "Malaysia",
"businessScenarioList": [
"base",
"Member"
]
},
{
"id": "200007",
"countryCode": "OM",
"alpha3Code": "OMN",
"numericCode": "512",
"telephoneAreaCode": "",
"text": "阿曼",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "zhaohongyuan",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "阿曼",
"currency": "OMR",
"mapManufacturers": "Google Maps",
"localLanguage": "عُمان",
"businessScenarioList": [
"base",
"Member"
]
},
{
"id": "100004",
"countryCode": "PT",
"alpha3Code": "PRT",
"numericCode": "620",
"telephoneAreaCode": "",
"text": "葡萄牙",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "develop",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "葡萄牙",
"currency": "EUR",
"mapManufacturers": "Google Maps",
"localLanguage": "Portugal",
"businessScenarioList": [
"base",
"Member"
]
},
{
"id": "200003",
"countryCode": "UZ",
"alpha3Code": "UZB",
"numericCode": "860",
"telephoneAreaCode": "",
"text": "乌兹别克斯坦",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "zhaohongyuan",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "乌兹别克斯坦",
"currency": "UZS",
"mapManufacturers": "Google Maps",
"localLanguage": "O‘zbekiston",
"businessScenarioList": [
"base",
"Member"
]
},
{
"id": "100002",
"countryCode": "VN",
"alpha3Code": "VNM",
"numericCode": "704",
"telephoneAreaCode": "",
"text": "越南",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "develop",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "越南",
"currency": "VND",
"mapManufacturers": "Google Maps",
"localLanguage": "Việt Nam",
"businessScenarioList": [
"base",
"Member"
]
},
{
"id": "200006",
"countryCode": "MO",
"alpha3Code": "MAC",
"numericCode": "446",
"telephoneAreaCode": "",
"text": "中国澳门",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "zhaohongyuan",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "中国澳门",
"currency": "MOP",
"mapManufacturers": "Google Maps",
"localLanguage": "中国澳门",
"businessScenarioList": [
"base"
]
},
{
"id": "200000",
"countryCode": "HK",
"alpha3Code": "HKG",
"numericCode": "344",
"telephoneAreaCode": "",
"text": "中国香港",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "sys",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "中国香港",
"currency": "HKD",
"mapManufacturers": "Google Maps",
"localLanguage": "中国香港",
"businessScenarioList": [
"base"
]
},
{
"id": "700003",
"countryCode": "LK",
"alpha3Code": "LKA",
"numericCode": "144",
"telephoneAreaCode": "",
"text": "斯里兰卡",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "zhaohongyuan",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "斯里兰卡",
"currency": "LKR",
"mapManufacturers": "Google Maps",
"localLanguage": "斯里兰卡",
"businessScenarioList": [
"base"
]
},
{
"id": "700004",
"countryCode": "CO",
"alpha3Code": "COL",
"numericCode": "170",
"telephoneAreaCode": "",
"text": "哥伦比亚",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "zhaohongyuan",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "哥伦比亚共和国",
"currency": "COP",
"mapManufacturers": "Google Maps",
"localLanguage": "Colombia",
"businessScenarioList": [
"base"
]
},
{
"id": "800001",
"countryCode": "JO",
"alpha3Code": "JOR",
"numericCode": "400",
"telephoneAreaCode": "",
"text": "约旦",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "zhaohongyuan",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "约旦哈希姆王国",
"currency": "JOD",
"mapManufacturers": "Google Maps",
"localLanguage": "المملكة الأردنية الهاشمية",
"businessScenarioList": [
"base"
]
},
{
"id": "200002",
"countryCode": "RU",
"alpha3Code": "RUS",
"numericCode": "643",
"telephoneAreaCode": "",
"text": "俄罗斯",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "zhaohongyuan",
"modifiedBy": "zhaohongyuan",
"isArchived": true,
"isDeleted": "0",
"fullName": "俄罗斯联邦",
"currency": "RUB",
"mapManufacturers": "Google Maps",
"localLanguage": "Россия",
"businessScenarioList": [
"base",
"Member"
]
},
{
"id": "800003",
"countryCode": "BN",
"alpha3Code": "BRN",
"numericCode": "096",
"telephoneAreaCode": "",
"text": "文莱",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "zhaohongyuan",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "文莱达鲁萨兰国",
"currency": "BND",
"mapManufacturers": "Google Maps",
"localLanguage": "文莱",
"businessScenarioList": [
"base"
]
},
{
"id": "800004",
"countryCode": "FI",
"alpha3Code": "FIN",
"numericCode": "246",
"telephoneAreaCode": "",
"text": "Finland",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "zhaohongyuan",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "Finland",
"currency": "EUR",
"mapManufacturers": "Google Maps",
"localLanguage": "Suomi",
"businessScenarioList": [
"base"
]
},
{
"id": "800006",
"countryCode": "NO",
"alpha3Code": "NOR",
"numericCode": "578",
"telephoneAreaCode": "",
"text": "挪威",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "zhaohongyuan",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "挪威",
"currency": "NOK",
"mapManufacturers": "Google Maps",
"localLanguage": "Norge",
"businessScenarioList": [
"base"
]
},
{
"id": "800005",
"countryCode": "DK",
"alpha3Code": "DNK",
"numericCode": "208",
"telephoneAreaCode": "",
"text": "丹麦",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "zhaohongyuan",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "Danmark",
"currency": "DKK",
"mapManufacturers": "Google Maps",
"localLanguage": "Danmark",
"businessScenarioList": [
"base",
"Member",
"MemberRegistration"
]
},
{
"id": "800008",
"countryCode": "NG",
"alpha3Code": "NGA",
"numericCode": "566",
"telephoneAreaCode": "",
"text": "尼日利亚",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "zhaohongyuan",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "尼日利亚",
"currency": "NGN",
"mapManufacturers": "Google Maps",
"localLanguage": "Nigeria",
"businessScenarioList": [
"base"
]
},
{
"id": "800009",
"countryCode": "TZ",
"alpha3Code": "TZA",
"numericCode": "834",
"telephoneAreaCode": "",
"text": "坦桑尼亚",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "zhaohongyuan",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "坦桑尼亚联合共和国",
"currency": "TZS",
"mapManufacturers": "Google Maps",
"localLanguage": "Tanzania",
"businessScenarioList": [
"base"
]
},
{
"id": "800010",
"countryCode": "HN",
"alpha3Code": "HND",
"numericCode": "340",
"telephoneAreaCode": "",
"text": "洪都拉斯",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "zhaohongyuan",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "洪都拉斯",
"currency": "HNL",
"mapManufacturers": "Google Maps",
"localLanguage": "República de Honduras",
"businessScenarioList": [
"base"
]
},
{
"id": "800011",
"countryCode": "EG",
"alpha3Code": "EGY",
"numericCode": "818",
"telephoneAreaCode": "",
"text": "埃及",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "zhaohongyuan",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "埃及",
"currency": "EGP",
"mapManufacturers": "Google Maps",
"localLanguage": "جمهورية مصر العربية‎",
"businessScenarioList": [
"base"
]
},
{
"id": "800012",
"countryCode": "SN",
"alpha3Code": "SEN",
"numericCode": "686",
"telephoneAreaCode": "",
"text": "塞内加尔",
"createTime": "2025-11-13T02:49:10.684770Z",
"updateTime": "2025-11-13T02:49:10.684770Z",
"createdBy": "zhaohongyuan",
"modifiedBy": "zhaohongyuan",
"isArchived": false,
"isDeleted": "0",
"fullName": "塞内加尔",
"currency": "XOF",
"mapManufacturers": "Gaode",
"localLanguage": "",
"businessScenarioList": [
"base"
]
}
]
}
  • 根据:mapManufacturers 加载地图

微信公众号

微信公众号

Google地图是否可用

· 阅读需 5 分钟
Quany
软件工程师

要通过API请求检测Google地图是否可用,核心思路是尝试加载Maps JavaScript API,然后根据加载成功与否或具体的错误信息来判断。下面这个流程图梳理了主要的检测逻辑和关键环节:

下面我们具体看一下每个关键环节的操作和注意事项。

💡 检测逻辑与常见错误

检测Google Maps API是否可用的方法,主要是监听其加载成功或失败的事件,并检查常见的错误信息。

  1. 基本可用性检测:最直接的方法是检查加载Maps JavaScript API的脚本后,是否存在全局的 google.maps 对象。这表示核心库已加载。

    if (typeof google !== 'undefined' && google.maps) {
    console.log('Google Maps API 可用。');
    } else {
    console.log('Google Maps API 未成功加载。');
    }
  2. 监听加载事件:更可靠的做法是使用API加载时指定的回调函数。如果地图成功加载并初始化,这个回调函数会被调用。

    <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap"></script>
    function initMap() {
    // 此函数被调用,通常意味着API加载成功,可以在此进行地图初始化
    console.log('Google Maps API 已加载并准备就绪。');
    // 你可以进一步创建地图实例来确认完全可用
    // var map = new google.maps.Map(document.getElementById('map'), {...});
    }

    同时,建议监听窗口的错误事件,以防API脚本加载失败。

    window.addEventListener('error', function(e) {
    if (e.target.tagName === 'SCRIPT' && e.target.src.includes('maps.googleapis.com')) {
    console.error('Google Maps API 脚本加载失败。');
    }
    }, true);
  3. 识别常见错误:如果地图显示为暗色并有“仅用于开发目的”的水印,或控制台有特定错误,通常意味着API密钥、账单或权限问题。下表列出了常见错误及含义:

错误代码含义与解决方案
MissingKeyMapError请求中缺少必需的API密钥。检查脚本的src是否包含正确的key参数。
InvalidKeyMapErrorAPI密钥无效。请确保密钥正确无误且在Google Cloud控制台中处于启用状态。
ApiNotActivatedMapError项目中未启用Maps JavaScript API。需在Google Cloud控制台中为该API启用。
BillingNotEnabledMapError项目未启用结算功能。使用Google Maps Platform必须关联有效的结算账号。
RefererNotAllowedMapError当前网页的网址未添加到API密钥的“应用程序限制”中授权的网址列表里。

🛠️ 示例代码与注意事项

以下是一个综合性的检测函数示例,它结合了多种检查方式:

/**
* 检测Google Maps API是否可用
* @param {string} apiKey - 你的API密钥
* @param {function} onSuccess - 成功回调函数
* @param {function} onFailure - 失败回调函数
*/
function checkGoogleMapsAvailability(apiKey, onSuccess, onFailure) {
// 检查是否已存在google.maps对象(可能已被加载)
if (window.google && window.google.maps) {
console.log('Google Maps API 已加载。');
onSuccess();
return;
}

// 定义全局回调函数,在API加载完成后执行
window.onGoogleMapsLoaded = onSuccess;

// 创建脚本标签动态加载API
const script = document.createElement('script');
script.src = `https://maps.googleapis.com/maps/api/js?key=${apiKey}&callback=onGoogleMapsLoaded`;
script.async = true;
script.defer = true;

// 处理加载错误
script.onerror = function() {
console.error('无法加载 Google Maps API 脚本。');
onFailure('NETWORK_ERROR');
};

// 设置超时处理
const timeoutId = setTimeout(function() {
console.error('加载 Google Maps API 超时。');
onFailure('TIMEOUT');
}, 10000); // 10秒超时

// 重写全局回调以确保超时后也能清理
window.onGoogleMapsLoaded = function() {
clearTimeout(timeoutId);
onSuccess();
};

// 将脚本添加到文档中开始加载
document.head.appendChild(script);
}

// 使用示例
checkGoogleMapsAvailability(
'YOUR_API_KEY_HERE',
function() {
console.log('成功:Google Maps 可用。');
// 这里可以开始初始化地图
},
function(errorReason) {
console.error('失败:Google Maps 不可用。原因:', errorReason);
// 这里可以根据不同的错误原因向用户显示提示信息
}
);

重要注意事项

  • API密钥配置:确保你的API密钥在Google Cloud控制台中已启用Maps JavaScript API,并且其“应用程序限制”设置(如HTTP引荐来源网址)包含了你的网站域名,否则会导致 RefererNotAllowedMapError 错误。
  • 启用结算功能:使用Google Maps Platform必须为项目启用结算功能,否则即使有有效的API密钥,地图也不会正常显示。

💎 总结

总而言之,通过动态加载脚本并结合成功回调和错误处理,是检测Google Maps是否可用的可靠方法。一旦加载失败,浏览器控制台的错误信息是首要的排查依据。

希望这些信息能帮助你有效地集成检测功能。如果你在实践过程中遇到更具体的问题,比如某个特定的错误代码,欢迎随时提出。

微信公众号

微信公众号

地图开发

· 阅读需 1 分钟
Quany
软件工程师

腾讯地图所需接口

  1. 逆地址解析-坐标转地址(位置详情)/ws/geocoder/v1/?location=*
  2. 地址解析-地址转坐标(位置搜索)/ws/geocoder/v1/?address=*
  3. 地点搜索 /ws/place/v1/search
  4. 关键词输入提示 /ws/place/v1/suggestion
  5. IP定位 /ws/location/v1/ip
  6. 坐标转换 /ws/coord/v1/translate

Google 地图所需接口

  1. 逆地址解析-坐标转地址(位置详情)/maps/api/geocode/json?latlng=*
  2. 地址解析-地址转坐标(位置搜索)/maps/api/geocode/json?address=*
  3. 地点搜索 /maps/api/place/nearbysearch/json
  4. 关键词输入提示 /maps/api/place/autocomplete/json
  5. IP定位 /maps/api/geolocation/json

微信公众号

微信公众号

热更新解决方案

· 阅读需 1 分钟
Quany
软件工程师

问题

鑫联盟需求要 16 以下的 node版本,但react-native-update-cli需要 18 以上的版本,故而左右为难;

脚本: react-native-update-cli/lib/bundle.js

    const reactNativeBundleProcess = (0, _child_process.spawn)('/Volumes/Samsung/Home/.nvm/versions/node/v16.20.2/bin/node', reactNativeBundleArgs);
console.log(`Running bundle command: node ${reactNativeBundleArgs.join(' ')}`);

微信公众号

微信公众号

react-native-webview a 链接跳转自定义

· 阅读需 5 分钟
Quany
软件工程师

在 React Native 应用中使用 WebView 内嵌网页时,如果您希望自定义点击网页内链接(<a> 标签)后的行为(例如,在应用内打开特定页面或在系统浏览器中打开),可以通过拦截链接点击事件并利用 React Native 与 WebView 的通信机制来实现。下面的流程图概括了实现此功能的核心步骤与决策点:

下面我们具体看看两种主要实现方案的代码和关键配置。

🛠️ 实现方案与代码示例

实现自定义跳转的核心是 拦截 WebView 内原生的链接跳转行为,并根据你的业务逻辑进行处理。主要有两种思路:

  1. 拦截链接点击事件(推荐,控制粒度更细):向 WebView 注入 JavaScript 代码,拦截网页中所有 <a> 标签的点击事件。当点击发生时,阻止其在 WebView 内默认跳转,并将目标 URL 通过通信机制发送给 React Native 端。
  2. 监听导航状态变化:通过 WebView 的 onNavigationStateChange 属性监听其加载的 URL 变化。当检测到目标 URL 符合特定规则(如自定义的 URL Scheme 或路径)时,阻止 WebView 继续加载并执行自定义跳转逻辑。

以下是通过 注入 JavaScript 拦截点击事件 的详细代码示例,这是最常用和灵活的方案:

import React, { Component } from 'react';
import { WebView, Linking, Alert } from 'react-native-webview'; // 注意:从 react-native-webview 导入

class CustomLinkWebView extends Component {
// 定义要注入到WebView的JavaScript代码
injectJavaScript = `
(function() {
// 为所有a标签绑定点击事件
var links = document.getElementsByTagName('a');
for (var i = 0; i < links.length; i++) {
links[i].onclick = function(event) {
// 1. 阻止a标签的默认跳转行为
event.preventDefault();
// 2. 获取目标URL,并通过postMessage发送给React Native
if (this.href) {
window.ReactNativeWebView.postMessage(this.href);
}
};
}
})();
`;

// 处理从WebView接收到的消息(即被点击的链接URL)
onWebViewMessage = (event) => {
const url = event.nativeEvent.data;

// 在这里判断URL,执行你的自定义逻辑
if (url.includes('special-page://')) {
// 示例1: 跳转到应用内某个原生页面
this.props.navigation.navigate('MySpecialScreen', { sourceUrl: url });
} else if (url.includes('should-open-in-browser')) {
// 示例2: 使用系统浏览器打开
Linking.canOpenURL(url).then(supported => {
if (supported) {
Linking.openURL(url);
} else {
console.log("无法打开URL: " + url);
}
});
} else {
// 示例3: 对于其他普通链接,可以允许在WebView内直接跳转
// 注意:如果需要此功能,则不能完全阻止默认行为,或者需要更复杂的判断。
// 本例中我们拦截了所有点击,所以普通链接也需要在此处理。
// 简单地用WebView重新加载这个URL(效果类似跳转):
// this.webview.ref && this.webview.ref.injectJavaScript(`window.location.href = "${url}";`);
// 更常见的做法是:只拦截需要特殊处理的链接,其他链接放行。这需要更精细的JS注入代码。
}
};

render() {
return (
<WebView
ref={(ref) => (this.webview = ref)}
source={{ uri: 'https://your-website.com' }}
// 注入JS代码
injectedJavaScript={this.injectJavaScript}
// 设置消息监听器
onMessage={this.onWebViewMessage}
// 其他必要的WebView属性...
/>
);
}
}

⚙️ 关键配置与优化

  1. 高度自适应:如果 WebView 高度固定,内容可能显示不全。可以通过监听页面高度变化并动态设置 WebView 高度来实现自适应。

    // 在注入的JS中,添加获取高度并发送的代码
    window.ReactNativeWebView.postMessage(JSON.stringify({type: 'height', value: document.body.scrollHeight}));

    // 在RN的onMessage中
    onWebViewMessage = (event) => {
    const data = JSON.parse(event.nativeEvent.data);
    if (data.type === 'height') {
    this.setState({ webViewHeight: data.value });
    }
    // ... 其他处理
    }
  2. 处理特殊字符:如果 URL 中包含特殊字符(如 +, 空格, ?, &),可能导致传输或解析错误。务必在传递前进行编码(如使用 encodeURIComponent),在 RN 端进行解码。

  3. 精细化控制:上面的示例拦截了所有 <a> 标签的点击。在实际项目中,你可以在注入的 JavaScript 中增加判断逻辑,只拦截需要特殊处理的链接(例如,根据 href 是否包含某个特定前缀),让其他普通链接在 WebView 内正常跳转。

💎 总结

通过结合 injectedJavaScriptonMessage 属性,你可以有效拦截并自定义 WebView 内链接的跳转行为。关键在于通过注入的脚本阻止默认行为并传递 URL,然后在 React Native 端根据业务需求进行分发处理。

希望这些示例和说明能帮助你顺利实现需求。如果你在特定环节(比如特定链接的识别逻辑)遇到更具体的问题,欢迎继续提问。

微信公众号

微信公众号