# getAreaList
获取地区列表
# 调用方式
getAreaList(params)
1
返回 Promise,使用 then/catch 或 await 处理结果。 接收单个业务参数;是否需要传参按下方参数表约定,无业务参数时可省略。具体字段及返回数据由宿主原生约定。
# 请求参数
参数对象字段由宿主约定;调用签名见上方。
# 接口调用示例
this.$bridge.getAreaList();
1
# 返回参数
| Prop | Type | Default | Description |
|---|---|---|---|
| list | Array | 地区列表 | |
| countryCode | String | 国家code | |
| phoneAreaCodeArray | Array | 区号集合 |
# 接口返回示例
this.$bridge.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 });
});
});
})
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12