# getAreaList
获取地区列表
# 请求参数
无
# 接口请求示例
nativeService.getAreaList();
# 返回参数
Prop | Type | Default | Description |
---|---|---|---|
-- | Promise | 获取值之后的回调 | |
-list | Array | 地区列表 | |
--countryCode | String | 国家code | |
--phoneAreaCodeArray | Array | 区号集合 |
# 接口返回示例
nativeService.getAreaList().then((data) => {
const tempArr = [];
data.list.forEach((item) => {
// eslint-disable-next-line camelcase, no-unused-vars
item.phoneAreaCodeArray.forEach((item_phoneAreaCodeArray, index) => { // 循环phoneAreaCodeArray数组,如有多个区号,push到列表里
// eslint-disable-next-line camelcase
const phoneAreaCodeArray_temp = [];
phoneAreaCodeArray_temp.push(item_phoneAreaCodeArray);
tempArr.push({ ...item, phoneAreaCodeArray: phoneAreaCodeArray_temp });
});
});
})