Commit b1647ea3 by fengzhaoyu

fix:去掉打印 加loading

parent aee956fc
...@@ -9,7 +9,6 @@ function getImg() { ...@@ -9,7 +9,6 @@ function getImg() {
dd.chooseImage({ dd.chooseImage({
count: 1, count: 1,
success: (res) => { success: (res) => {
console.log(JSON.stringify())
if (res.files[0].size > 20 * 1024 * 1024) { if (res.files[0].size > 20 * 1024 * 1024) {
rejects({ code: -1, msg: '文件小一点', ...res }) rejects({ code: -1, msg: '文件小一点', ...res })
} else { } else {
...@@ -61,9 +60,14 @@ async function uploadImg(imgInfo) { ...@@ -61,9 +60,14 @@ async function uploadImg(imgInfo) {
export async function getFileInfoFromOss() { export async function getFileInfoFromOss() {
try { try {
const imgInfo = await getImg(); const imgInfo = await getImg();
dd.showLoading({
content: '正在上传...',
});
const fileInfo = await uploadImg(imgInfo); const fileInfo = await uploadImg(imgInfo);
dd.hideLoading()
return { code: 0, msg: 'success', data: fileInfo } return { code: 0, msg: 'success', data: fileInfo }
} catch (err) { } catch (err) {
dd.hideLoading()
return err return err
} }
} }
\ No newline at end of file
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