Commit cdc1619a authored by Junling Bu's avatar Junling Bu
Browse files

fix[litemall-wx-api, litemall-wx]: 修复收货地址不能修改

parent cd27350a
...@@ -85,10 +85,11 @@ public class WxAddressController { ...@@ -85,10 +85,11 @@ public class WxAddressController {
* name: xxx, * name: xxx,
* provinceId: xxx, * provinceId: xxx,
* cityId: xxx, * cityId: xxx,
* districtId: xxx, * areaId: xxx,
* mobile: xxx, * mobile: xxx,
* address: xxx, * address: xxx,
* isDefault: xxx, * isDefault: xxx,
* version: xxx
* provinceName: xxx, * provinceName: xxx,
* cityName: xxx, * cityName: xxx,
* areaName: xxx * areaName: xxx
...@@ -112,10 +113,11 @@ public class WxAddressController { ...@@ -112,10 +113,11 @@ public class WxAddressController {
data.put("name", address.getName()); data.put("name", address.getName());
data.put("provinceId", address.getProvinceId()); data.put("provinceId", address.getProvinceId());
data.put("cityId", address.getCityId()); data.put("cityId", address.getCityId());
data.put("districtId", address.getAreaId()); data.put("areaId", address.getAreaId());
data.put("mobile", address.getMobile()); data.put("mobile", address.getMobile());
data.put("address", address.getAddress()); data.put("address", address.getAddress());
data.put("isDefault", address.getIsDefault()); data.put("isDefault", address.getIsDefault());
data.put("version", address.getVersion());
String pname = regionService.findById(address.getProvinceId()).getName(); String pname = regionService.findById(address.getProvinceId()).getName();
data.put("provinceName", pname); data.put("provinceName", pname);
String cname = regionService.findById(address.getCityId()).getName(); String cname = regionService.findById(address.getCityId()).getName();
...@@ -211,7 +213,7 @@ public class WxAddressController { ...@@ -211,7 +213,7 @@ public class WxAddressController {
return ResponseUtil.updatedDateExpired(); return ResponseUtil.updatedDateExpired();
} }
} }
return ResponseUtil.ok(address.getId()); return ResponseUtil.ok(address);
} }
/** /**
......
...@@ -14,6 +14,7 @@ Page({ ...@@ -14,6 +14,7 @@ Page({
name: '', name: '',
mobile: '', mobile: '',
isDefault: 0, isDefault: 0,
version: 0,
provinceName: '', provinceName: '',
cityName: '', cityName: '',
areaName: '' areaName: ''
...@@ -302,9 +303,7 @@ Page({ ...@@ -302,9 +303,7 @@ Page({
areaId: address.areaId, areaId: address.areaId,
address: address.address, address: address.address,
isDefault: address.isDefault, isDefault: address.isDefault,
provinceName: address.provinceName, version: address.version
cityName: address.cityName,
countyName: address.areaName
}, 'POST').then(function (res) { }, 'POST').then(function (res) {
if (res.errno === 0) { if (res.errno === 0) {
//返回之前,先取出上一页对象,并设置addressId //返回之前,先取出上一页对象,并设置addressId
...@@ -313,11 +312,11 @@ Page({ ...@@ -313,11 +312,11 @@ Page({
console.log(prevPage); console.log(prevPage);
if (prevPage.route == "pages/checkout/checkout") { if (prevPage.route == "pages/checkout/checkout") {
prevPage.setData({ prevPage.setData({
addressId: res.data addressId: res.data.id
}) })
try { try {
wx.setStorageSync('addressId', res.data); wx.setStorageSync('addressId', res.data.id);
} catch (e) { } catch (e) {
} }
......
...@@ -14,6 +14,7 @@ Page({ ...@@ -14,6 +14,7 @@ Page({
name: '', name: '',
mobile: '', mobile: '',
isDefault: 0, isDefault: 0,
version: 0,
provinceName: '', provinceName: '',
cityName: '', cityName: '',
areaName: '' areaName: ''
...@@ -302,9 +303,7 @@ Page({ ...@@ -302,9 +303,7 @@ Page({
areaId: address.areaId, areaId: address.areaId,
address: address.address, address: address.address,
isDefault: address.isDefault, isDefault: address.isDefault,
provinceName: address.provinceName, version: address.version
cityName: address.cityName,
countyName: address.areaName
}, 'POST').then(function (res) { }, 'POST').then(function (res) {
if (res.errno === 0) { if (res.errno === 0) {
//返回之前,先取出上一页对象,并设置addressId //返回之前,先取出上一页对象,并设置addressId
...@@ -313,11 +312,11 @@ Page({ ...@@ -313,11 +312,11 @@ Page({
console.log(prevPage); console.log(prevPage);
if (prevPage.route == "pages/checkout/checkout") { if (prevPage.route == "pages/checkout/checkout") {
prevPage.setData({ prevPage.setData({
addressId: res.data addressId: res.data.id
}) })
try { try {
wx.setStorageSync('addressId', res.data); wx.setStorageSync('addressId', res.data.id);
} catch (e) { } catch (e) {
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment