|
@@ -121,12 +121,12 @@ Page({
|
|
|
}
|
|
|
|
|
|
wx.request({
|
|
|
- url: host+'',
|
|
|
+ url: host +'/adressapi/insertadd',
|
|
|
header: {
|
|
|
'content-type': 'application/x-www-form-urlencoded'
|
|
|
},
|
|
|
data:{
|
|
|
- userId: app.globalData.user_id, //'oovpNwjlsY6xx8ceCebFa1dOLd9E', //app.globalData.user_id,
|
|
|
+ user_id: app.globalData.user_id, //'oovpNwjlsY6xx8ceCebFa1dOLd9E', //app.globalData.user_id,
|
|
|
consignee: that.data.name, //收货人
|
|
|
province:that.data.region[0],
|
|
|
city: that.data.region[1],
|
|
@@ -137,7 +137,37 @@ Page({
|
|
|
},
|
|
|
success(res){
|
|
|
console.log(res,"地址保存")
|
|
|
+ wx.showToast({
|
|
|
+ title: '地址添加成功',
|
|
|
+ icon:'none',
|
|
|
+ success(){
|
|
|
+ setTimeout(()=>{
|
|
|
+ wx.navigateBack({
|
|
|
+ delta: 1
|
|
|
+ })
|
|
|
+ },1000)
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
}
|
|
|
})
|
|
|
+ },
|
|
|
+ getEditAddress(){ // 获取编辑的地址
|
|
|
+
|
|
|
+ let address = wx.getStorageSync('address'),
|
|
|
+ name = address.consignee,
|
|
|
+ phone =address.phone,
|
|
|
+ region = [address.province,address.city,address.area],
|
|
|
+ detailAddress =address.adress,
|
|
|
+ switchChecked = address.switchChecked;
|
|
|
+ console.log(address)
|
|
|
+ this.setData({
|
|
|
+ name:name,
|
|
|
+ phone:phone,
|
|
|
+ region: region,
|
|
|
+ detailAddress: detailAddress,
|
|
|
+ switchChecked: switchChecked
|
|
|
+ })
|
|
|
}
|
|
|
})
|