|
@@ -22,6 +22,7 @@ import android.webkit.CookieManager;
|
|
|
import android.webkit.CookieSyncManager;
|
|
import android.webkit.CookieSyncManager;
|
|
|
import android.webkit.ValueCallback;
|
|
import android.webkit.ValueCallback;
|
|
|
import android.webkit.WebChromeClient;
|
|
import android.webkit.WebChromeClient;
|
|
|
|
|
+import android.webkit.WebResourceResponse;
|
|
|
import android.webkit.WebSettings;
|
|
import android.webkit.WebSettings;
|
|
|
import android.webkit.WebView;
|
|
import android.webkit.WebView;
|
|
|
import android.webkit.WebViewClient;
|
|
import android.webkit.WebViewClient;
|
|
@@ -86,6 +87,8 @@ public class FgtWeb extends BaseFgtWeb {
|
|
|
protected WebParams webParams;
|
|
protected WebParams webParams;
|
|
|
|
|
|
|
|
private String finallyUrl;
|
|
private String finallyUrl;
|
|
|
|
|
+ private boolean needWxLogin = false;
|
|
|
|
|
+ private KFZSJs kfzsJs;
|
|
|
|
|
|
|
|
public String getFirstUrl() {
|
|
public String getFirstUrl() {
|
|
|
return finallyUrl;
|
|
return finallyUrl;
|
|
@@ -125,6 +128,7 @@ public class FgtWeb extends BaseFgtWeb {
|
|
|
setLandscape();
|
|
setLandscape();
|
|
|
}
|
|
}
|
|
|
initWebViewSettings(mWebView);
|
|
initWebViewSettings(mWebView);
|
|
|
|
|
+ kfzsJs = new KFZSJs(SheepApp.getInstance().getCurrentActivity(), this);
|
|
|
if (TextUtils.isEmpty(jsUrl)) {
|
|
if (TextUtils.isEmpty(jsUrl)) {
|
|
|
loadUrl(url);
|
|
loadUrl(url);
|
|
|
} else {
|
|
} else {
|
|
@@ -380,6 +384,17 @@ public class FgtWeb extends BaseFgtWeb {
|
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ public WebResourceResponse shouldInterceptRequest(WebView view, String s) {
|
|
|
|
|
+ if(url.contains("h5.qzone.qq.com")){
|
|
|
|
|
+ if(s.equals("https://qzonestyle.gtimg.cn/qz-proj/qz-common/img/m-error/pic-error.png")){
|
|
|
|
|
+ needWxLogin = true;
|
|
|
|
|
+ kfzsJs.loginThirdPartApp("wx");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return super.shouldInterceptRequest(view, s);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
|
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
|
|
LogUtil.println("ActWeb", "shouldOverrideUrlLoading", url);
|
|
LogUtil.println("ActWeb", "shouldOverrideUrlLoading", url);
|
|
|
//微信H5支付核心代码
|
|
//微信H5支付核心代码
|
|
@@ -458,7 +473,7 @@ public class FgtWeb extends BaseFgtWeb {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
if (webParams.isNeedJsInteract()) {
|
|
if (webParams.isNeedJsInteract()) {
|
|
|
- mWebView.addJavascriptInterface(new KFZSJs(SheepApp.getInstance().getCurrentActivity(), this), "kfzsjs");
|
|
|
|
|
|
|
+ mWebView.addJavascriptInterface(kfzsJs, "kfzsjs");
|
|
|
String loadUrl = url;
|
|
String loadUrl = url;
|
|
|
if (webParams.getTokenKey() != null) {
|
|
if (webParams.getTokenKey() != null) {
|
|
|
if (url.startsWith(Config.YF_SHOP_HOME)
|
|
if (url.startsWith(Config.YF_SHOP_HOME)
|
|
@@ -681,6 +696,10 @@ public class FgtWeb extends BaseFgtWeb {
|
|
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
|
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
|
|
|
CookieSyncManager.createInstance(getContext()).sync();
|
|
CookieSyncManager.createInstance(getContext()).sync();
|
|
|
}
|
|
}
|
|
|
|
|
+ if(needWxLogin){
|
|
|
|
|
+ needWxLogin = false;
|
|
|
|
|
+ loadUrl(webParams.getUrl());
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|