fix[litemall-wx-api, litemall-wx]: 修复收货地址不能修改
This commit is contained in:
@@ -85,10 +85,11 @@ public class WxAddressController {
|
||||
* name: xxx,
|
||||
* provinceId: xxx,
|
||||
* cityId: xxx,
|
||||
* districtId: xxx,
|
||||
* areaId: xxx,
|
||||
* mobile: xxx,
|
||||
* address: xxx,
|
||||
* isDefault: xxx,
|
||||
* version: xxx
|
||||
* provinceName: xxx,
|
||||
* cityName: xxx,
|
||||
* areaName: xxx
|
||||
@@ -112,10 +113,11 @@ public class WxAddressController {
|
||||
data.put("name", address.getName());
|
||||
data.put("provinceId", address.getProvinceId());
|
||||
data.put("cityId", address.getCityId());
|
||||
data.put("districtId", address.getAreaId());
|
||||
data.put("areaId", address.getAreaId());
|
||||
data.put("mobile", address.getMobile());
|
||||
data.put("address", address.getAddress());
|
||||
data.put("isDefault", address.getIsDefault());
|
||||
data.put("version", address.getVersion());
|
||||
String pname = regionService.findById(address.getProvinceId()).getName();
|
||||
data.put("provinceName", pname);
|
||||
String cname = regionService.findById(address.getCityId()).getName();
|
||||
@@ -211,7 +213,7 @@ public class WxAddressController {
|
||||
return ResponseUtil.updatedDateExpired();
|
||||
}
|
||||
}
|
||||
return ResponseUtil.ok(address.getId());
|
||||
return ResponseUtil.ok(address);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,6 +14,7 @@ Page({
|
||||
name: '',
|
||||
mobile: '',
|
||||
isDefault: 0,
|
||||
version: 0,
|
||||
provinceName: '',
|
||||
cityName: '',
|
||||
areaName: ''
|
||||
@@ -302,9 +303,7 @@ Page({
|
||||
areaId: address.areaId,
|
||||
address: address.address,
|
||||
isDefault: address.isDefault,
|
||||
provinceName: address.provinceName,
|
||||
cityName: address.cityName,
|
||||
countyName: address.areaName
|
||||
version: address.version
|
||||
}, 'POST').then(function (res) {
|
||||
if (res.errno === 0) {
|
||||
//返回之前,先取出上一页对象,并设置addressId
|
||||
@@ -313,11 +312,11 @@ Page({
|
||||
console.log(prevPage);
|
||||
if (prevPage.route == "pages/checkout/checkout") {
|
||||
prevPage.setData({
|
||||
addressId: res.data
|
||||
addressId: res.data.id
|
||||
})
|
||||
|
||||
try {
|
||||
wx.setStorageSync('addressId', res.data);
|
||||
wx.setStorageSync('addressId', res.data.id);
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ Page({
|
||||
name: '',
|
||||
mobile: '',
|
||||
isDefault: 0,
|
||||
version: 0,
|
||||
provinceName: '',
|
||||
cityName: '',
|
||||
areaName: ''
|
||||
@@ -302,9 +303,7 @@ Page({
|
||||
areaId: address.areaId,
|
||||
address: address.address,
|
||||
isDefault: address.isDefault,
|
||||
provinceName: address.provinceName,
|
||||
cityName: address.cityName,
|
||||
countyName: address.areaName
|
||||
version: address.version
|
||||
}, 'POST').then(function (res) {
|
||||
if (res.errno === 0) {
|
||||
//返回之前,先取出上一页对象,并设置addressId
|
||||
@@ -313,11 +312,11 @@ Page({
|
||||
console.log(prevPage);
|
||||
if (prevPage.route == "pages/checkout/checkout") {
|
||||
prevPage.setData({
|
||||
addressId: res.data
|
||||
addressId: res.data.id
|
||||
})
|
||||
|
||||
try {
|
||||
wx.setStorageSync('addressId', res.data);
|
||||
wx.setStorageSync('addressId', res.data.id);
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user