From 2663efa3a66fd3158f2a603e946e8ca71475cfa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E4=BA=9A=E7=90=AA?= Date: Thu, 6 Jun 2024 11:22:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E5=B9=B6=E4=B8=8A=E4=BC=A0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../unicloud-file-api/unicloud-file-api.uvue | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/pages/API/unicloud-file-api/unicloud-file-api.uvue b/pages/API/unicloud-file-api/unicloud-file-api.uvue index 838a5816..d6a32187 100644 --- a/pages/API/unicloud-file-api/unicloud-file-api.uvue +++ b/pages/API/unicloud-file-api/unicloud-file-api.uvue @@ -7,6 +7,7 @@ + @@ -62,6 +63,26 @@ console.error('chooseImage fail: ', err) } }) + }, + chooseAndUploadFile() { + uniCloud.chooseAndUploadFile({ + type: 'image' + }).then(function (res) { + uni.hideLoading() + console.log(res) + uni.showModal({ + content: '上传成功', + showCancel: false + }); + }) + .catch(function (err : any | null) { + uni.hideLoading() + const error = err as UniCloudError + uni.showModal({ + content: '上传失败,' + error.errMsg, + showCancel: false + }); + }) } } } -- GitLab