diff --git a/src/pages/address/addAddress.vue b/src/pages/address/addAddress.vue
index 117431f..9a801e8 100644
--- a/src/pages/address/addAddress.vue
+++ b/src/pages/address/addAddress.vue
@@ -77,7 +77,11 @@
+
@@ -195,7 +199,11 @@ export default {
if (this.addId) {
params.add_id = this.addId
}
- store.dispatch('address/edit', params)
+ store.dispatch('address/edit', params).then(() => {
+ uni.navigateBack({
+ delta: 1
+ })
+ })
}
}
}
diff --git a/src/pages/address/addressList.vue b/src/pages/address/addressList.vue
index 4613278..0d712d5 100644
--- a/src/pages/address/addressList.vue
+++ b/src/pages/address/addressList.vue
@@ -43,7 +43,7 @@
>
暂无收货地址
-
+
@@ -65,6 +65,15 @@ export default {
store.dispatch('address/list')
},
methods: {
+ toAddAddress() {
+ console.log('aaaaa-a')
+ uni.navigateTo({
+ url: 'addAddress',
+ fail: (error) => {
+ console.error('跳转出现错误', error)
+ }
+ })
+ },
toEditAddress (addId) {
console.log('addId', addId)
uni.navigateTo({
diff --git a/src/store/modules/address.js b/src/store/modules/address.js
index ed4308a..a93733f 100644
--- a/src/store/modules/address.js
+++ b/src/store/modules/address.js
@@ -19,10 +19,12 @@ const mutations = {
const actions = {
edit(mutations, param, success) {
- request({
+ return new Promise((resolve) => request({
url: editAddress,
data: param,
- success,
+ success: () => {
+ resolve()
+ },
fail: () => {
uni.showModal({
content: '编辑失败',
@@ -32,7 +34,7 @@ const actions = {
complete: (res) => {
console.log('complete status === > ', res)
}
- })
+ }))
},
list({ commit }) {
request({