Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

晒订单分享,调用 sharePage() 方法未触发分享事件 #30

Open
ForgetAll opened this issue Jul 1, 2020 · 1 comment
Open

Comments

@ForgetAll
Copy link

        youzanWebView.webViewClient = object : com.tencent.smtt.sdk.WebViewClient() {
            override fun shouldOverrideUrlLoading(p0: WebView?, url: String?): Boolean {
                return super.shouldOverrideUrlLoading(p0, url)
            }

            override fun onPageStarted(p0: WebView?, p1: String?, p2: Bitmap?) {
                super.onPageStarted(p0, p1, p2)
                if (isFirstLoad) {
                    isFirstLoad = false
                    loadingView.visibility = View.VISIBLE
                }
            }

            override fun onPageFinished(p0: WebView?, p1: String?) {
                super.onPageFinished(p0, p1)
                LogUtils.i(p1)
                loadingView.visibility = View.GONE
                if (p1?.contains("share") == true) {
                    UiHandlers.postDelayed(Runnable {
                        (p0 as? YouzanBrowser)?.sharePage()
                    }, 200)
                }
            }
        }

晒订单点击后进入的页面未触发订阅的分享事件,于是这里自己加上了代码在带 share 的网页加载完成之后调用一次 sharePage(),依然没有触发订阅的分享事件

@ForgetAll
Copy link
Author

这是在付过款的订单里,选择的晒订单。首页的分享店铺和商品详情中的分享商品都是正常的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant