From 1f1ac71bb0f3254b90b83cd89948f695329209a8 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Mon, 1 Apr 2024 10:56:44 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=AE=A2=E6=9C=8Dwebview=E6=96=B0?= =?UTF-8?q?=E5=A2=9EisZh=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CustomerServiceWebViewActivity.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/main/src/main/java/com/yunbao/main/activity/CustomerServiceWebViewActivity.java b/main/src/main/java/com/yunbao/main/activity/CustomerServiceWebViewActivity.java index e6042a0f2..64b9464a0 100644 --- a/main/src/main/java/com/yunbao/main/activity/CustomerServiceWebViewActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/CustomerServiceWebViewActivity.java @@ -40,7 +40,9 @@ import com.yunbao.common.utils.JavascriptInterfaceUtils; import com.yunbao.common.utils.L; import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.SVGAViewUtils; +import com.yunbao.common.utils.StringUtil; import com.yunbao.common.utils.ToastUtil; +import com.yunbao.common.utils.WordUtil; import com.yunbao.share.ui.InvitePopDialog; import org.greenrobot.eventbus.Subscribe; @@ -72,7 +74,14 @@ public class CustomerServiceWebViewActivity extends AbsActivity { super.main(); Bus.getOn(this); String url = getIntent().getStringExtra(Constants.URL); - L.e("H5-------->" + url); + if (StringUtil.isEmpty(url)) { + finish(); + return; + } + if (!url.contains("isZh")) { + url += "&isZh=" + (WordUtil.isNewZh() ? 1 : 0); + } + L.e("客服H5-------->" + url); mProgressBar = (ProgressBar) findViewById(R.id.progressbar); rootView = findViewById(R.id.webView_root); mWebView = findViewById(R.id.webView); @@ -82,7 +91,7 @@ public class CustomerServiceWebViewActivity extends AbsActivity { params.bottomMargin = getNavigationBarHeight(mContext); }*/ //mWebView.setLayoutParams(params); - // mWebView.setOverScrollMode(View.OVER_SCROLL_IF_CONTENT_SCROLLS); + // mWebView.setOverScrollMode(View.OVER_SCROLL_IF_CONTENT_SCROLLS); mWebView.setWebViewClient(new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { @@ -233,7 +242,7 @@ public class CustomerServiceWebViewActivity extends AbsActivity { } protected boolean canGoBack() { - if (!isKefu(mWebView.getUrl()==null?"":mWebView.getUrl())) { + if (!isKefu(mWebView.getUrl() == null ? "" : mWebView.getUrl())) { mWebView.loadUrl("javascript:userBackShowPraise()"); return false; } @@ -244,7 +253,7 @@ public class CustomerServiceWebViewActivity extends AbsActivity { @Override public void onBackPressed() { - if (!isKefu(mWebView.getUrl()==null?"":mWebView.getUrl())) { + if (!isKefu(mWebView.getUrl() == null ? "" : mWebView.getUrl())) { finish(); return; }