From 5a48567f38c926ea38576c382d1fc66488f7c5d0 Mon Sep 17 00:00:00 2001 From: duqingquan Date: Fri, 24 May 2024 12:18:37 +0800 Subject: [PATCH] =?UTF-8?q?anim-view=20=E9=80=82=E9=85=8Dasset=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../uts-animation-view/utssdk/app-android/index.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/uni_modules/uts-animation-view/utssdk/app-android/index.vue b/uni_modules/uts-animation-view/utssdk/app-android/index.vue index a298254..8a64c41 100644 --- a/uni_modules/uts-animation-view/utssdk/app-android/index.vue +++ b/uni_modules/uts-animation-view/utssdk/app-android/index.vue @@ -93,9 +93,13 @@ if (newPath.startsWith("http://") || newPath.startsWith("https://")) { lottieAnimationView.setAnimationFromUrl(newPath) } else { - // 默认是static了 - var realJsonPath = UTSAndroid.getResourcePath(newPath) - lottieAnimationView.setAnimation(new FileInputStream(realJsonPath),newPath) + // 正式打包会放在asset中,需要特殊处理 + let realJsonPath = UTSAndroid.getResourcePath(newPath) + if(realJsonPath.startsWith("/android_asset")){ + lottieAnimationView.setAnimation(realJsonPath!.substring(15)) + }else{ + lottieAnimationView.setAnimation(new FileInputStream(realJsonPath),newPath) + } } } if (this.autoplay) { -- GitLab