Commit 5988366e authored by 王雪伟's avatar 王雪伟

[提交人]:王雪伟

[提交简述] :小象省钱
[实现方案] :
parent c6810392
......@@ -325,7 +325,7 @@ object PayDialog : PayContract.View {
return true //没有安装该app时,返回true,表示拦截自定义链接,但不跳转,避免弹出上面的错误页面
}
//处理http和https开头的url
view?.loadUrl(url)
// view?.loadUrl(url)
return false
}
......
......@@ -247,8 +247,6 @@ class RightsDetailActivity : BaseActivity(), RightsDetailContract.View, RightsPa
isClickPayBtn = false
SettingPreference.setOutTradeNo("")
showResultLoading(true)
showToast("成功!")
Log.d("wxw","成功")
}
override fun verifyOrderFail(errorMsg: String) {
......@@ -319,6 +317,7 @@ class RightsDetailActivity : BaseActivity(), RightsDetailContract.View, RightsPa
) {
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
startActivity(intent)
EventUtils.onEvent("h5_open_zfb_suc")
return true
}
} catch (e: Exception) { //防止crash (如果手机上没有安装处理某个scheme开头的url的APP, 会导致crash)
......@@ -346,7 +345,16 @@ class RightsDetailActivity : BaseActivity(), RightsDetailContract.View, RightsPa
error: WebResourceError?
) {
super.onReceivedError(view, request, error)
EventUtils.onEvent("h5_pay_error1", error.toString())
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
// Log.d("wxw", "1error${error?.errorCode}")
// Log.d("wxw", "2error${error?.description}")
EventUtils.onEvent(
"h5_pay_error1",
"code: ${error?.errorCode} desc: ${error?.description}"
)
} else {
EventUtils.onEvent("h5_pay_error1", error.toString())
}
showResultLoading(false)
}
......@@ -355,9 +363,21 @@ class RightsDetailActivity : BaseActivity(), RightsDetailContract.View, RightsPa
request: WebResourceRequest?,
errorResponse: WebResourceResponse?
) {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
if (request?.url?.path?.endsWith("/favicon.ico") == true) {
} else {
EventUtils.onEvent(
"h5_pay_error2",
errorResponse?.statusCode.toString() + " url:${request?.url}"
)
showResultLoading(false)
}
} else {
EventUtils.onEvent("h5_pay_error2", errorResponse.toString())
showResultLoading(false)
}
super.onReceivedHttpError(view, request, errorResponse)
EventUtils.onEvent("h5_pay_error2", errorResponse.toString())
showResultLoading(false)
}
}
id_rights_pay_web_view.loadUrl(NetConfig.H5.WEB_URL_H5_PAY)
......
......@@ -392,4 +392,9 @@
android:textSize="16sp"
android:textStyle="bold" />
</LinearLayout>
<WebView
android:id="@+id/id_rights_pay_web_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone" />
</RelativeLayout>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment