Compare commits

..

No commits in common. "b19e4e0c0af515ebeb497712e1116d8f40b30143" and "1b0778606e38fd86c045f6b624875baf34834f77" have entirely different histories.

2 changed files with 8 additions and 6 deletions

View File

@ -75,10 +75,11 @@ export default {
async updateDefaultAddr(item) { async updateDefaultAddr(item) {
try { try {
let param = { let param = {
"addrId":item.addrId, "id":item.id,
"userId":uni.getStorageSync('userId') "userId":uni.getStorageSync('userId')
} }
const res = await updateDefaultAddrApi(param) const res = await updateDefaultAddrApi(param)
console.log('?? ~ getList ~ res:', res)
if(res.code==200){ if(res.code==200){
uni.$u.toast(`操作成功!`) uni.$u.toast(`操作成功!`)
this.queryCustAddrList() this.queryCustAddrList()
@ -92,6 +93,7 @@ export default {
handleEdit(address) { handleEdit(address) {
// //
// uni.$u.toast(`${index + 1}`) // uni.$u.toast(`${index + 1}`)
console.log('?? ==='+address)
uni.navigateTo({ uni.navigateTo({
// url: `/pages/mine/me/upAddress?address=${encodeURIComponent(JSON.stringify(address))}` // url: `/pages/mine/me/upAddress?address=${encodeURIComponent(JSON.stringify(address))}`
url: `/pages/mine/me/upAddress?address=${JSON.stringify(address)}` url: `/pages/mine/me/upAddress?address=${JSON.stringify(address)}`

View File

@ -40,7 +40,8 @@
fontValue:uni.getStorageSync('fontSize') || 8, fontValue:uni.getStorageSync('fontSize') || 8,
NavbarTitle:"收货地址", NavbarTitle:"收货地址",
address:{ address:{
addrId: "", id: "",
// ifDefault:0,
addrFullName: "", addrFullName: "",
detailAddr: "", detailAddr: "",
contactName: "", contactName: "",
@ -101,8 +102,8 @@
}else if(this.address.detailAddr==""){ }else if(this.address.detailAddr==""){
uni.$u.toast(`详细地址不能为空`) uni.$u.toast(`详细地址不能为空`)
}else{ }else{
const addrId=this.address.addrId; const id=this.address.id;
if(addrId!=undefined && addrId!=""){ if(id!=undefined&&id!=""){
this.updatedata(); this.updatedata();
}else{ }else{
this.insertdata(); this.insertdata();
@ -112,7 +113,6 @@
async updatedata(){ async updatedata(){
let param = { let param = {
"id":this.address.id, "id":this.address.id,
"addrId":this.address.addrId,
"userId":uni.getStorageSync('userId'), "userId":uni.getStorageSync('userId'),
"contactName": this.address.contactName, "contactName": this.address.contactName,
"mobile": this.address.mobile, "mobile": this.address.mobile,
@ -154,7 +154,7 @@
} }
}, },
async delAddress(){ async delAddress(){
const res = await deleteCustAddrForAppApi({id:this.address.addrId}); const res = await deleteCustAddrForAppApi({id:this.address.id});
if(res.code==200){ if(res.code==200){
uni.$u.toast(`删除成功!`) uni.$u.toast(`删除成功!`)
setTimeout(()=>{ setTimeout(()=>{