Skip to content

xiaoyucoding/mp-weixin-region-data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mp-weixin-region-data

微信小程序省市区选择器数据字典

说明

数据来源微信小程序的省市区选择器,主要有两个用处:

  • 自定义省市区选择器组件
  • 服务端数据字典与客户端一致

数据格式

有两种模式

multi

省、市、区(县)的数据独立存放,通过 value 作为 key 进行关联。

// province.json 省
{
    "value": "110000",
    "text": "北京"
}
// city.json 市
{
    "110000": [{
        "value": "110100",
        "text": "北京市"
    }]
}
// district.json 区
{
    "110100": [{
        "value": "110101",
        "text": "东城区"
    }, ...]
}

single

数据在一个文件中,类似父子结构存放。

{
    "value": "110000",
    "text": "北京市",
    "children": [{
        "value": "110100",
        "text": "北京市",
        "children": [{
            "value": "110101",
            "text": "东城区"
        }, {
            "value": "110102",
            "text": "西城区"
        }, {
            "value": "110105",
            "text": "朝阳区"
        }, {
            "value": "110106",
            "text": "丰台区"
        }, {
            "value": "110107",
            "text": "石景山区"
        }, {
            "value": "110108",
            "text": "海淀区"
        }, {
            "value": "110109",
            "text": "门头沟区"
        }, {
            "value": "110111",
            "text": "房山区"
        }, {
            "value": "110112",
            "text": "通州区"
        }, {
            "value": "110113",
            "text": "顺义区"
        }, {
            "value": "110114",
            "text": "昌平区"
        }, {
            "value": "110115",
            "text": "大兴区"
        }, {
            "value": "110116",
            "text": "怀柔区"
        }, {
            "value": "110117",
            "text": "平谷区"
        }, {
            "value": "110118",
            "text": "密云区"
        }, {
            "value": "110119",
            "text": "延庆区"
        }]
    }]
}

About

微信小程序省市区选择器数据字典

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published