chooseaddress

地址选择器

API

pick

pick(params, callback) since v28.0.2

  • @params
  • @callback
    • ok {boolean}: true 表示成功, false表示失败
    • data {Object}: 数据对象
      • province {string}: 省
      • city {number}: 市
      • district {string}: 区
      • town {string}: 街道
      • address {string}: 地址
      • lat {string}: 纬度
      • lng {number}: 经度
      • locationType {string}: 坐标系类型(GCJ-02)
      • phoneNo {string}: 手机号码
      • userName {string}: 收货人姓名
      • gender {number}: 性别 (0男 1女)
const chooseaddress = weex.requireModule('chooseaddress');

chooseaddress.pick({
}, e => {
	if(e.ok) {
		this.province = e.data.province;
		this.city = e.data.city;
		this.district = e.data.district;
		this.town = e.data.town;
		this.address = e.data.address;
		this.phoneNo = e.data.phoneNo;
		this.userName = e.data.userName;
		this.gender = (e.data.gender == 0 ? '先生' : '女士');
	}
});