|
@@ -141,6 +141,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup name="HomeSubmit">
|
|
|
+import { showLoadingToast, closeToast } from 'vant';
|
|
|
import { computed, reactive, unref } from 'vue';
|
|
|
import { useUserStore } from '/@/store/modules/user';
|
|
|
import { showToast, showSuccessToast } from 'vant';
|
|
@@ -213,6 +214,12 @@ function clzpAfterRead(file) {
|
|
|
let formData = new FormData();
|
|
|
// 调用append()方法添加数据
|
|
|
formData.append('file', file.file);
|
|
|
+ showLoadingToast({
|
|
|
+ message: '上传中...',
|
|
|
+ forbidClick: true,
|
|
|
+ duration: 0,
|
|
|
+ iconSize: 35,
|
|
|
+ });
|
|
|
axios({
|
|
|
url: '/service/sale/upload/file',
|
|
|
method: 'POST',
|
|
@@ -222,12 +229,15 @@ function clzpAfterRead(file) {
|
|
|
},
|
|
|
}).then((res) => {
|
|
|
let { data } = res;
|
|
|
+ closeToast()
|
|
|
if (data.code == 200) {
|
|
|
// 上传状态提示关闭
|
|
|
file.url = data.data;
|
|
|
file.status = 'done';
|
|
|
showToast('上传成功!');
|
|
|
}
|
|
|
+ }).catch(() =>{
|
|
|
+ closeToast()
|
|
|
});
|
|
|
}
|
|
|
</script>
|