vue - js 智能识别快递地址 电话 收件人

智能识别收货地址Pro
引用: https://github.com/wzc570738205/smartParsePro

引用方式:
//1. 下载
npm install address-smart-parse


//2. 引入
import smart from 'address-smart-parse'


//3. 使用
// console.log(smart('xxxxxxx))
vue代码使用示例:
        var textAdd = smart("需要识别的地址");  //识别到的地址对象
        //识别地址
        this.$set(this.对象, "addresseesName", textAdd.name);
        this.$set(this.对象, "buyerPhone", textAdd.phone);
        var address = "";
        if (textAdd.province != undefined) {
          address = address + textAdd.province
        }
        console.log(textAdd.city)
        if (textAdd.city != undefined) {
          address = address + textAdd.city
        }
        if (textAdd.county != undefined) {
          address = address + textAdd.county
        }
        if (textAdd.street != undefined) {
          address = address + textAdd.street
        }
        if (textAdd.address != undefined) {
          address = address + textAdd.address
        }
        if (textAdd.province != undefined) {
          address = address + textAdd.province
        }
        this.$set(this.对象, "addresseesPrintAddr", address);

使用效果:

 

 实际返回数据格式:

{
 zipCode:710061

 province:陕西省

 provinceCode:61

 city:西安市

 cityCode:6101

 county:雁塔区

 countyCode:610113

 street:丈八沟街道

 streetCode:610113007

 address:高新四路高新大都荟

 name:刘国良

 phone:13593464918

 idCard:211381198512096810
}

评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值