From 382ae57d8f243cb6a52d3aa515ad5b03c7bfee84 Mon Sep 17 00:00:00 2001 From: Anne_LXM <54163582+anne-lxm@users.noreply.github.com> Date: Tue, 20 Feb 2024 15:57:57 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9APC=E8=AE=BE=E7=BD=AE=E5=A4=B4?= =?UTF-8?q?=E5=83=8F=E6=97=A0=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../uni-id-pages-avatar.vue | 38 +++++++++---------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/uni_modules/uni-id-pages/components/uni-id-pages-avatar/uni-id-pages-avatar.vue b/uni_modules/uni-id-pages/components/uni-id-pages-avatar/uni-id-pages-avatar.vue index 1cb3d4e..5b82355 100644 --- a/uni_modules/uni-id-pages/components/uni-id-pages-avatar/uni-id-pages-avatar.vue +++ b/uni_modules/uni-id-pages/components/uni-id-pages-avatar/uni-id-pages-avatar.vue @@ -129,26 +129,24 @@ filePath = res.tempFilePaths[0] //非app端剪裁头像,app端用内置的原生裁剪 - // #ifndef APP-PLUS - filePath = await new Promise((callback) => { - // #ifdef H5 - if (!this.isPC) { - uni.navigateTo({ - url: '/uni_modules/uni-id-pages/pages/userinfo/cropImage/cropImage?path=' + - filePath + `&options=${JSON.stringify(crop)}`, - animationType: "fade-in", - events: { - success: url => { - callback(url) - } - }, - complete(e) { - // console.log(e); - } - }); - } - // #endif - }) + // #ifdef H5 + if (!this.isPC) { + filePath = await new Promise((callback) => { + uni.navigateTo({ + url: '/uni_modules/uni-id-pages/pages/userinfo/cropImage/cropImage?path=' + + filePath + `&options=${JSON.stringify(crop)}`, + animationType: "fade-in", + events: { + success: url => { + callback(url) + } + }, + complete(e) { + console.log(e); + } + }); + }) + } // #endif let cloudPath = this.userInfo._id + '' + Date.now() -- GitLab