1 Star 0 Fork 2

MR.lin / 中华人民共和国省市区街四级联动地址选择

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

中华人民共和国省市区街四级联动地址选择

项目介绍

省市区街四级联动地址选择

软件架构

包含三个目录,分别用于PC,微信网页版,微信小程序

PC版中的location.html为面向过程方式,locationOOP为面向对象方式,locationOOP-ES6为ES6中类的写法。

微信网页版中跟上面相同。

安装教程

使用说明

微信小程序使用:

  1. 将目录名换成合适的英文名,放到小程序目录中

  2. 在需要使用的主页面中引用,比如主页面名为test

  3. 在test.json中写

{
  "usingComponents": {
    "location": "../../location/location"
  }
}
  1. 在test.wxml中写

    <location id="addresSelect"></location>
  2. 获取组件中选择的地址数据

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {
     this.address = this.selectComponent("#addresSelect");
    },
    submit:function(){
      wx.showModal({
        title: '获取组件数据',
        content: this.address.data.locationResult,
        showCancel: false
      })
    },  

    pcas-location-wx-min.js是压缩之后的全国数据

    pcas-location-wx.js是未压缩的全国数据

    全国省市区数据来源于:https://github.com/modood/Administrative-divisions-of-China

参与贡献

The MIT License (MIT) Copyright (c) 2018 博丽灵梦 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

省市区街四级联动地址选择 展开 收起
JavaScript
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/NBdehuanglin/addresSelect.git
git@gitee.com:NBdehuanglin/addresSelect.git
NBdehuanglin
addresSelect
中华人民共和国省市区街四级联动地址选择
master

搜索帮助