|
|
@ -305,4 +305,40 @@ Page({ |
|
|
|
url: '../address/upaddress?addr_id=' + addrId, |
|
|
|
}) |
|
|
|
}, |
|
|
|
chooseAddress: function () { |
|
|
|
var that = this; |
|
|
|
if (wx.chooseAddress) { |
|
|
|
wx.chooseAddress({ |
|
|
|
success: function (res) { |
|
|
|
that.setData({ |
|
|
|
userName: res.userName, |
|
|
|
mobile: res.telNumber, |
|
|
|
place: res.provinceName+'-'+res.cityName+'-'+res.countyName, |
|
|
|
address: res.detailInfo, |
|
|
|
}) |
|
|
|
that.saveAddress() |
|
|
|
}, |
|
|
|
}) |
|
|
|
} else { |
|
|
|
console.log('当前微信版本不支持chooseAddress'); |
|
|
|
} |
|
|
|
}, |
|
|
|
// 点击保存
|
|
|
|
saveAddress: function (e) { |
|
|
|
var that = this; |
|
|
|
WXAPI.saveAddress({ |
|
|
|
accessId: app.globalData.accessId, |
|
|
|
storeId: 239, |
|
|
|
storeType: 1, |
|
|
|
user_name: that.data.userName, |
|
|
|
mobile: that.data.mobile, |
|
|
|
place: that.data.place, |
|
|
|
is_default: 1, |
|
|
|
address: that.data.address, |
|
|
|
}).then(res => { |
|
|
|
if (res.code == 200) { |
|
|
|
|
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
}) |