From 4e9d88ff79d23d6d1fae728ea41a112ca15bcc89 Mon Sep 17 00:00:00 2001
From: mullins <476823686@qq.com>
Date: Tue, 26 May 2020 20:37:56 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E5=9C=B0=E5=9D=80=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/pages/address/addAddress.vue | 10 +++++++++-
src/pages/address/addressList.vue | 11 ++++++++++-
src/store/modules/address.js | 8 +++++---
3 files changed, 24 insertions(+), 5 deletions(-)
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({
--
2.0.0