小程序智能识别收货地址

智能识别收货地址Pro
引用: GitHub - wzc570738205/smartParsePro: 地址智能识别Pro(支持省市区街道/电话/邮编/姓名/身份证号识别)
//1. 下载
npm install address-smart-parse
 
//2. 引入
import smart from 'address-smart-parse'
 
//3. 使用
smart('1111')

 使用代码

        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
}

https://www.cnblogs.com/xqschool/p/13746819.html

  • 2
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

zjm0115

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值