加入上传图片等待

加入上传图片等待
This commit is contained in:
471615499@qq.com 2024-08-27 22:41:49 +08:00
parent 3c4e6da8ae
commit 7f61f124de
3 changed files with 11 additions and 2 deletions

View File

@ -1,6 +1,7 @@
const app = getApp() const app = getApp()
import Notify from '@vant/weapp/notify/notify'; import Notify from '@vant/weapp/notify/notify';
import Toast from '@vant/weapp/toast/toast';
import { import {
selfFormatTimeYMDHMS, selfFormatTimeYMDHMS,
@ -264,6 +265,11 @@ Page({
// 文件-上传后 // 文件-上传后
async fileAfterRead(event) { async fileAfterRead(event) {
Toast.loading({
message: '上传中...',
forbidClick: true,
duration: 0
})
let _this = this; let _this = this;
console.log('fileAfterRead', event); console.log('fileAfterRead', event);
// 上传完成需要更新 fileList // 上传完成需要更新 fileList
@ -280,6 +286,7 @@ Page({
repairId: _this.data.id, repairId: _this.data.id,
operate: 'feedback', operate: 'feedback',
}).then(res => { }).then(res => {
Toast.clear()
console.log('upload file ', res); console.log('upload file ', res);
fileList.push({ fileList.push({
id: res.id, id: res.id,

View File

@ -6,6 +6,7 @@
"van-uploader": "@vant/weapp/uploader/index", "van-uploader": "@vant/weapp/uploader/index",
"van-checkbox": "@vant/weapp/checkbox/index", "van-checkbox": "@vant/weapp/checkbox/index",
"van-checkbox-group": "@vant/weapp/checkbox-group/index", "van-checkbox-group": "@vant/weapp/checkbox-group/index",
"van-notify": "@vant/weapp/notify/index" "van-notify": "@vant/weapp/notify/index",
"van-toast": "@vant/weapp/toast/index"
} }
} }

View File

@ -142,3 +142,4 @@
</view> </view>
<!-- 消息通知 --> <!-- 消息通知 -->
<van-notify id="van-notify" /> <van-notify id="van-notify" />
<van-toast id="van-toast" />