Giter Club home page Giter Club logo

mp-weixin-region-data's Introduction

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": "延庆区"
        }]
    }]
}

mp-weixin-region-data's People

Contributors

xiaoyucoding avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.