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

提交

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