微信小程序如何获取用户收货地址


当前第2页 返回上一页

完整代码:

<button bindtap='aaaaaaa'>获取地址</button>
 aaaaaaa() {
 wx.getSetting({
 success(res) {
 console.log("vres.authSetting['scope.address']:",res.authSetting['scope.address'])
 if (res.authSetting['scope.address']) {
  console.log("111")
  wx.chooseAddress({
  success(res) {
  console.log(res.userName)
  console.log(res.postalCode)
  console.log(res.provinceName)
  console.log(res.cityName)
  console.log(res.countyName)
  console.log(res.detailInfo)
  console.log(res.nationalCode)
  console.log(res.telNumber)
  }
  })
  // 用户已经同意小程序使用录音功能,后续调用 wx.startRecord 接口不会弹窗询问
  
 } else {
  if (res.authSetting['scope.address'] == false) {
  console.log("222")
  wx.openSetting({
  success(res) {
  console.log(res.authSetting)
  
  }
  })
  } else {
  console.log("eee")
  wx.chooseAddress({
  success(res) {
  console.log(res.userName)
  console.log(res.postalCode)
  console.log(res.provinceName)
  console.log(res.cityName)
  console.log(res.countyName)
  console.log(res.detailInfo)
  console.log(res.nationalCode)
  console.log(res.telNumber)
  }
  })
  }
 }
 }
 })
},

为大家推荐现在关注度比较高的微信小程序教程一篇:《微信小程序开发教程》小编为大家精心整理的,希望喜欢。

更多ECSHOP内容来自木庄网络博客


标签:ECSHOP

返回前面的内容

相关阅读 >>

使用dedecms制作英文站的技巧说明

php获得客户端浏览器名称及版本的方法(基于ECSHOP函数)

微信小程序 商城开发(ECSHOP )简单实例

ECSHOP二次开发之常用函数汇总

php实现的交通银行网银在线支付接口ECSHOP插件和使用例子

让你的php7更快之hugepage用法分析

ECSHOP邮件服务器设置方法

php版交通银行网银支付接口开发入门教程

php错误allowed memory size of 67108864 bytes exhausted的3种解决办法

10款php开源商城系统汇总介绍

更多相关阅读请进入《ECSHOP》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...