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 1cb3d4ef6d22e5d1f3ee5165778524f0c1710f04..5b823552cb2b179127ea46c88611dd603ecbbdeb 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()