Commit 8dc7f65b authored by 刘玉宏's avatar 刘玉宏

提交

parent 42d43848
...@@ -95,23 +95,31 @@ function fieldNotEmpty(val) { ...@@ -95,23 +95,31 @@ function fieldNotEmpty(val) {
} }
const hdSubmit = async () => { const hdSubmit = async () => {
if (!content.value.addrId) { try {
await addAddress({ if (!content.value.addrId) {
...forMData.value, await addAddress({
commonAddr: forMData.value.commonAddr ? 1 : 0, ...forMData.value,
province: forMData.value.province, commonAddr: forMData.value.commonAddr ? 1 : 0,
city: forMData.value.city, province: forMData.value.province,
area: forMData.value.area, city: forMData.value.city,
area: forMData.value.area,
});
} else {
await updateAddress({
...forMData.value,
commonAddr: forMData.value.commonAddr ? 1 : 0,
});
}
uni.showToast({
title: '提交成功',
duration: 2000,
}); });
} else { uni.navigateTo({
await updateAddress({ url: '/pages/address/addressList',
...forMData.value,
commonAddr: forMData.value.commonAddr ? 1 : 0,
}); });
} catch (error) {
console.log(error, 'error');
} }
uni.navigateTo({
url: '/pages/address/addressList',
});
}; };
function handleSubmit() { function handleSubmit() {
reForm.value reForm.value
...@@ -119,10 +127,6 @@ function handleSubmit() { ...@@ -119,10 +127,6 @@ function handleSubmit() {
.then(({ valid }) => { .then(({ valid }) => {
if (valid) { if (valid) {
hdSubmit(); hdSubmit();
xma.showToast({
title: '提交成功',
duration: 2000,
});
} }
}) })
.catch((error) => { .catch((error) => {
......
Markdown is supported
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