微信小程序 中wx.chooseAddress(OBJECT)實(shí)例詳解
1、wx.chooseAddress(OBJECT)
概述
調(diào)起用戶編輯收貨地址原生界面,并在編輯完成后返回用戶選擇的地址。
OBJECT參數(shù)說明
代碼實(shí)現(xiàn)
if(wx.chooseAddress){
wx.chooseAddress({
success: function (res) {
console.log(JSON.stringify(res))
},
fail: function(err){
console.log(JSON.stringify(err))
}
})
}else{
console.log('當(dāng)前微信版本不支持chooseAddress');
}
wx.chooseAddress用戶編輯收貨地址原生界面展示
每次進(jìn)入都會(huì)有免責(zé)聲明
新增地址界面1
第一次沒有地址會(huì)直接進(jìn)入新增地址界面
新增地址界面2
當(dāng)有保存的地址時(shí),展示我的地址界面。當(dāng)點(diǎn)擊完成時(shí),"errMsg":"chooseAddress:ok"。當(dāng)點(diǎn)擊返回時(shí),"errMsg":"chooseAddress:cancel"。
我的地址界面
返回結(jié)果返回參數(shù)說明
success返回參數(shù)說明
success返回結(jié)果
{
"errMsg":"chooseAddress:ok",
"userName":"張三",
"telNumber": "12345678901",
"nationalCode":"510630",
"postalCode":"510000",
"provinceName":"廣東省",
"cityName":"廣州市",
"countyName":"天河區(qū)",
"detailInfo":"某巷某號(hào)"
}
fail返回結(jié)果
{"errMsg":"chooseAddress:cancel"}
感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!
相關(guān)文章
package.json依賴環(huán)境相關(guān)屬性詳解
詳解微信小程序 通過控制CSS實(shí)現(xiàn)view隱藏與顯示
微信小程序 POST請求(網(wǎng)絡(luò)請求)詳解及實(shí)例代碼
js實(shí)現(xiàn)保存文本框內(nèi)容為本地文件兼容IE,chrome,火狐瀏覽器
微信小程序 詳解頁面跳轉(zhuǎn)與返回并回傳數(shù)據(jù)
微信小程序 刪除項(xiàng)目工程實(shí)現(xiàn)步驟






