HomeBaseImpl.kt 21.7 KB
Newer Older
1 2 3 4 5 6 7 8
package com.yidianling.home.event

import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.text.TextUtils
import android.view.View
霍志良 committed
9
import androidx.appcompat.app.AppCompatActivity
万齐军 committed
10
import androidx.fragment.app.FragmentActivity
霍志良 committed
11
import androidx.recyclerview.widget.RecyclerView
12
import com.alibaba.android.arouter.launcher.ARouter
13
import com.ydl.confide.api.ConfideRoute
万齐军 committed
14
import com.ydl.confide.api.IConfideService
15 16 17 18 19 20 21 22 23 24 25 26 27 28
import com.ydl.media.audio.AudioPlayer
import com.ydl.media.audio.model.Music
import com.ydl.media.view.PlayTypeEnum
import com.ydl.media.view.PlayerFloatHelper
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydl_router.manager.YDLRouterParams
import com.ydl.ydl_router.util.YDLRouterParamsUrls
import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.bean.ShareData
import com.ydl.ydlcommon.data.PlatformRamImpl
import com.ydl.ydlcommon.modular.ModularServiceManager
万齐军 committed
29
import com.ydl.ydlcommon.modular.findRouteService
万齐军 committed
30
import com.ydl.ydlcommon.modular.route
31
import com.ydl.ydlcommon.router.IYDLRouterConstant
konghaorui committed
32
import com.ydl.ydlcommon.utils.LogUtil
33 34 35 36 37
import com.ydl.ydlcommon.utils.Utils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.ydl.ydlcommon.view.dialog.CommonDialog
import com.yidianling.home.R
徐健 committed
38
import com.yidianling.home.api.event.HomeModuleTabEvent
konghaorui committed
39
import com.yidianling.home.constants.HomeBIConstants
40 41
import com.yidianling.home.constract.IHomeContract
import com.yidianling.home.model.bean.*
42 43
import com.yidianling.im.api.bean.IMRequestCallback
import com.yidianling.im.api.service.IImService
44 45 46 47 48
import com.yidianling.tests.api.service.ITestsApiService
import com.yidianling.user.api.service.IUserService
import de.greenrobot.event.EventBus
import org.json.JSONObject

49
open class HomeBaseImpl : IHomeBaseEvent {
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64

    val HOT_SEARCH_DOCTOR_NAME = "hot_search_doctor_name"
    override fun consultItemClick(linkUrl: String?, doctorId: String) {
        if (Utils.isFastClick()) {
            //防止连击
            return
        }
        ActionCountUtils.count(HomeBIConstants.YDL_USER_EXPERT_INTRODUCTION_CLICK, doctorId)

        if (null == linkUrl || linkUrl.isEmpty()) {
            return
        }
        if (linkUrl.startsWith("http")) {
            YDLRouterManager.router(
                IYDLRouterConstant.ROUTER_H5_H5,
65 66
                YDLRouterParams().putExtra(IYDLRouterConstant.EXTRA_URL, linkUrl), ""
            )
67 68 69 70 71 72 73 74 75 76 77 78
        } else {
            YDLRouterManager.router(linkUrl)
        }
    }

    override fun consultChatClick(doctorId: String?) {
        if (Utils.isFastClick()) {
            //防止连击
            return
        }
        ActionCountUtils.count(
            HomeBIConstants.YDL_USER_PRIVATE_CHAT_CLICK, doctorId
79 80
                ?: ""
        )
81

82
        if (!ModularServiceManager.provide(IUserService::class.java).loginByOneKeyLogin(mContext as Context,true)) {
83 84 85 86 87 88 89 90 91
            //跳转登录
            return
        }
        if (mContext is AppCompatActivity && !TextUtils.isEmpty(doctorId)) {
            //私聊
            YDLRouterManager.router(
                IYDLRouterConstant.ROUTER_CHAT_PRIVATE,
                YDLRouterParams()
                    .putExtra(IYDLRouterConstant.EXTRA_TOUID, doctorId!!)
92 93
                    .putExtra(IYDLRouterConstant.EXTRA_USERTYPE, "1")
            )
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
        }
    }

    fun jumpToLogin() {
        ARouter.getInstance().build("/user/login")
            .navigation()
    }

    /**
     * 获取咨询列表数据
     * 最终调用
     * @see com.yidianling.home.ui.fragment.YdlHomeFragment.getConsultData
     *
     * @param type 倾述类型
     * @param selectPosition 选中的position
     */
    override fun getConsultData(type: HomeHeaderBean.ConsultCategoryDateBean, selectPosition: Int) {
        ActionCountUtils.count(
            HomeBIConstants.YDL_USER_CONSULT_TYPE_CLICK, type.name
113 114
                ?: ""
        )
115 116 117
        mHomeView!!.getConsultData(type.id.toString(), selectPosition)
    }

霍志良 committed
118 119 120 121 122 123 124 125 126 127
    override fun jumpToTopicDetail(topic_id: String) {
        val bundle = Bundle()
        bundle.putString("topic_id", topic_id)
        bundle.putBoolean("isSplash", false)
        //动态详情
        ARouter.getInstance().build("/topic/detail")
            .withBundle("bundle", bundle)
            .navigation()
    }

128 129 130 131 132 133 134 135 136 137 138 139 140 141

    private var headerView: View? = null
    var mContext: Context? = null
    var mHomeView: IHomeContract.View? = null
    var COURSE_DETAIL_H5 = HttpConfig.WEB_URL + "fe-app-yidianling/course/Detail/"


    constructor(context: Context, homeView: IHomeContract.View) {
        mContext = context
        this.mHomeView = homeView
    }

    override fun onPageScroll(view_rl_top_bg: View): RecyclerView.OnScrollListener? {
        return object : RecyclerView.OnScrollListener() {
YKai committed
142
            override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
143
                super.onScrolled(recyclerView, dx, dy)
YKai committed
144
                if (headerView == null) headerView = recyclerView.getChildAt(0)
145 146 147 148 149 150 151 152
                val top = headerView?.top
                val height = Math.abs(top!!)
                var per = height.toFloat() / 500
                //最大比例为1
                if (per > 1f) {
                    per = 1f
                }
                val alpha = (per * 255).toInt()
konghaorui committed
153
                LogUtil.i("Tag", "alpha=$alpha--per=$per")
154 155 156 157 158 159 160 161 162 163 164 165 166
                view_rl_top_bg.background.mutate().alpha = alpha
            }
        }
    }


    override fun serviceCallClick() {
        try {
            if (Utils.isFastClick()) {
                //防止连击
                return
            }
            ActionCountUtils.count(HomeBIConstants.YDL_USER_TELEPHONE_CUSTOMER_SERVICE_CLICK)
167
            val tel =
168 169
                if (PlatformRamImpl.getInstance().getGlobalInfo() == null) "400-765-1010" else PlatformRamImpl.getInstance().getGlobalInfo()!!.info.tel
            var con = "\n400-765-1010\n早8:30-凌晨2:00"
170
            if (PlatformRamImpl.getInstance().getGlobalInfo() != null && PlatformRamImpl.getInstance().getGlobalInfo()!!.info != null) {
171 172
                con =
                    PlatformRamImpl.getInstance().getGlobalInfo()?.info?.tel + "\n" + PlatformRamImpl.getInstance().getGlobalInfo()?.info?.work_time
173 174 175 176 177 178 179 180 181 182

            }
            val dialog = CommonDialog(mContext)
                .setTitle("欢迎致电壹点灵客服热线")
                .setMessage(con)
                .setLeftOnclick("取消") { v1 ->

                }.setRightClick("拨打") { v12 ->
                    val phoneIntent = Intent(
                        Intent.ACTION_DIAL,
183 184
                        Uri.parse("tel:$tel")
                    )
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201
                    mContext?.startActivity(phoneIntent)
                }
            dialog.setMessageOnclick {

            }
            dialog.show()
        } catch (e: Exception) {
            e.printStackTrace()
        }

    }

    override fun searchTvClick(text: String) {
        if (Utils.isFastClick()) {
            //防止连击
            return
        }
202
        var doctorName =
konghaorui committed
203
            if (text != mContext?.resources?.getString(R.string.home_search_hint) && text != mContext?.resources?.getString(
204 205 206
                    R.string.platform_search
                )
            ) text else ""
207 208 209 210 211 212 213 214 215 216 217 218

        ARouter.getInstance()
            .build("/consult/hot_search")
            .withString(HOT_SEARCH_DOCTOR_NAME, doctorName)
            .navigation()
    }

    override fun consultMoreClick() {
        if (Utils.isFastClick()) {
            //防止连击
            return
        }
YKai committed
219 220 221 222 223
        EventBus.getDefault().post(
            HomeModuleTabEvent(
                2
            )
        )
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240
        ActionCountUtils.count(HomeBIConstants.YDL_USER_CONSULT_MORE_CLICK)
    }


    override fun bannerClick(banner: HomeHeaderBean.FocusListBean) {
        ActionCountUtils.count(HomeBIConstants.YDL_USER_BANNER_CLICK, banner.focId.toString())
        linkTo(banner.linkUrl.toString())
    }


    override fun categoryClick(data: HomeHeaderBean.AskCategoryDataBean) {
//        linkTo(data.url.toString())
        if (Utils.isFastClick()) {
            //防止连击
            return
        }
        ActionCountUtils.count(
241 242 243 244 245
            HomeBIConstants.YDL_USER_CONSULT_CLASSIFICATION_CLICK,
            data.cateId.toString(),
            data.cateTitle
                ?: ""
        )
246 247 248 249 250 251 252 253
        goExpertSearch(data)
    }

    private fun goExpertSearch(data: HomeHeaderBean.AskCategoryDataBean) {
        if (!TextUtils.isEmpty(data.url) && data.url!!.endsWith("?")) {
            data.url = data.url!!.substring(0, data.url!!.length - 1)
        }
        if ("全部类别" == data.cateTitle || "全部分类" == data.cateTitle) {
254
            /*YDLRouterManager.router(
255
                IYDLRouterConstant.ROUTER_H5_H5,
256 257 258 259
                YDLRouterParams().putExtra(
                    IYDLRouterConstant.EXTRA_URL,
                    HttpConfig.H5_URL + "experts/cates"
                )
260 261 262
            )*/
            //因心理咨询迁移新系统,跳转咨询列表页
            EventBus.getDefault().post(HomeModuleTabEvent(2))
263 264 265 266
        } else {
            //跳转咨询频道页 服务入口
            YDLRouterManager.router(
                IYDLRouterConstant.ROUTER_CONSULT_LIST,
267 268 269 270 271 272 273 274 275
                YDLRouterParams().putExtra(
                    IYDLRouterConstant.EXTRA_CATEID,
                    data.cateId.toString()
                ).putExtra(
                    IYDLRouterConstant.EXTRA_CATETITLE, data.cateTitle!!
                ).putExtra(
                    IYDLRouterConstant.EXTRA_SHOWTYPE, "0"
                )
            )
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291
        }
    }

    override fun linkTo(linkUrl: String) {
        if (Utils.isFastClick()) {
            //防止连击
            return
        }
        YDLRouterManager.router(linkUrl)
    }

    override fun reservationExpertsClick() {
        if (Utils.isFastClick()) {
            //防止连击
            return
        }
YKai committed
292
        EventBus.getDefault().post(
upwork.021 committed
293
            HomeModuleTabEvent(2,"11")
YKai committed
294
        )
295 296 297
        ActionCountUtils.count(HomeBIConstants.YDL_USER_CONSULT_CLICK)
    }

万齐军 committed
298
    override fun nowConfideClick(listenFree: Boolean) {
299 300 301 302 303 304 305
        if (Utils.isFastClick()) {
            //防止连击
            return
        }
        ActionCountUtils.count(HomeBIConstants.YDL_USER_TALK_IN_TIME_CLICK)

        //倾诉首页 ydl-user://confide/home
万齐军 committed
306
        ActionCountUtils.record("listen_counselor_list_page", "listen_counselor_list_page_visit", "1")
万齐军 committed
307
        route(mContext, ConfideRoute.R_CONFIDE_HOME)
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329
    }

    override fun psychologyClassClick() {
        if (Utils.isFastClick()) {
            //防止连击
            return
        }
        //课程频道页 ydl-user://course/home
//        YDLRouterManager.router(IYDLRouterConstant.ROUTER_COURSE_HOME)
        //埋点
        ActionCountUtils.count(HomeBIConstants.YDL_USER_PSYCHOLOGICAL_CLASSROOM_CLICK)

        ARouter.getInstance().build("/course/home").navigation()
    }

    override fun psychologyTestClick() {
        if (Utils.isFastClick()) {
            //防止连击
            return
        }
        ActionCountUtils.count(HomeBIConstants.YDL_USER_PSYCHOLOGICAL_TEST_CLICK)
        //测评频道首页 ydl-user://ceshi/home
严久程 committed
330 331
//        YDLRouterManager.router(IYDLRouterConstant.ROUTER_TEST_HOME)
        ARouter.getInstance().build("/ceshi/home").navigation()
332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348
    }

    override fun confideMoreClick() {
        if (Utils.isFastClick()) {
            //防止连击
            return
        }
        ActionCountUtils.count(HomeBIConstants.YDL_USER_LISTEN_MORE_CLICK)

        //倾诉首页 ydl-user://qingshu/home
        YDLRouterManager.router(IYDLRouterConstant.ROUTER_CONFIDE_HOME)
    }

    /**
     * 倾述咨询师点击
     * @param linkUrl 跳转地址
     */
万齐军 committed
349
    override fun confideClick(linkUrl: String?, confideId:String, doctorId: Int, uid:String?) {
350 351 352 353 354 355 356 357
        if (Utils.isFastClick()) {
            //防止连击
            return
        }
        if (null == linkUrl || linkUrl.isEmpty()) {
            return
        }

358 359 360 361
        ActionCountUtils.count(
            HomeBIConstants.YDL_USER_LISTENER_INTRODUCTION_CLICK,
            doctorId.toString()
        )
362

万齐军 committed
363 364 365 366 367 368
        findRouteService(IConfideService::class.java)
            .showExpertDetailDialog(
                mContext as FragmentActivity,
                HttpConfig.MH5_URL + ConfideRoute.h5ConfideIntro(confideId),
                doctorId.toString(),
                uid ?: ""
369
            )
370 371 372 373 374 375 376 377 378 379
    }

    /**
     * 私聊
     */
    override fun toChatForMsg(doctorId: String?) {
        if (Utils.isFastClick()) {
            //防止连击
            return
        }
380 381
        if (!ModularServiceManager.provide(IUserService::class.java).loginByOneKeyLogin(mContext as Context,true)) {
            //判断登录状态内部已完成 跳转登录
382 383 384 385 386 387 388 389
            return
        }
        if (mContext is AppCompatActivity && !TextUtils.isEmpty(doctorId)) {
            //私聊
            YDLRouterManager.router(
                IYDLRouterConstant.ROUTER_CHAT_PRIVATE,
                YDLRouterParams()
                    .putExtra(IYDLRouterConstant.EXTRA_TOUID, doctorId!!)
390 391 392 393 394 395 396 397 398 399
                    .putExtra(IYDLRouterConstant.EXTRA_USERTYPE, "1")
            )
        }
        ModularServiceManager.provide(IImService::class.java)
            .createTextMessage(doctorId, "你好,我想找你倾诉,请尽快上线私聊我,我在等你。", object :
                IMRequestCallback<Void> {
                override fun onSuccess(aVoid: Void?) {
                    (mContext as BaseActivity).dismissProgressDialog()
                    ToastHelper.show("发送成功")
                }
400

401 402 403 404 405 406 407
                override fun onFailed(i: Int) {
                    (mContext as BaseActivity).dismissProgressDialog()
                    var message = "发送失败"
                    if (i == 7101) {
                        message = "您已被对方拉黑!"
                    }
                    ToastHelper.show(message)
408 409
                }

410 411 412 413 414
                override fun onException(throwable: Throwable?) {
                    (mContext as BaseActivity).dismissProgressDialog()
                    ToastHelper.show("发送异常")
                }
            })
415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435
    }


    override fun courseMreClick() {
        if (Utils.isFastClick()) {
            //防止连击
            return
        }
        //课程频道页 ydl-user://course/home
//        YDLRouterManager.router(IYDLRouterConstant.ROUTER_COURSE_HOME)
        ActionCountUtils.count(HomeBIConstants.YDL_USER_COURSE_MORE_CLICK)
        ARouter.getInstance().build("/course/home").navigation()
    }

    override fun courseItemClick(bean: HomeCourseBean.ListBean) {
        if (Utils.isFastClick()) {
            //防止连击
            return
        }
        ActionCountUtils.count(HomeBIConstants.YDL_USER_COURSE_CLICK, bean.id.toString())

436 437 438 439
        val h5Params = H5Params(
            COURSE_DETAIL_H5 + bean.id,
            mContext?.getString(R.string.platform_course_detail)
        )
440
        if (!TextUtils.isEmpty(bean.shareData?.shareUrl)) {
441 442 443 444 445 446
            val shareData = ShareData(
                bean.shareData?.shareUrl,
                bean.shareData?.title,
                bean.shareData?.cover,
                bean.shareData?.desc
            )
447 448 449 450 451 452 453
            h5Params.shareData = shareData
        }

        NewH5Activity.start(mContext, h5Params)
    }

    override fun askItemFocusClick(position: Int, id: String) {
454 455
        if (!ModularServiceManager.provide(IUserService::class.java).loginByOneKeyLogin(mContext as Context,true)) {
            //判断登录状态内部已完成 跳转登录
456 457 458 459 460 461 462
            return
        }
        //关注用户
        mHomeView?.askFocus(position, id)
    }

    override fun askItemZanClick(position: Int, index: Int, id: String) {
463 464
        if (!ModularServiceManager.provide(IUserService::class.java).loginByOneKeyLogin(mContext as Context,true)) {
            //判断登录状态内部已完成 跳转登录
465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489
            return
        }
        //问答动态点赞
        mHomeView?.askZan(position, index, id)
    }

    override fun askMoreClick() {
        if (Utils.isFastClick()) {
            //防止连击
            return
        }
        ActionCountUtils.count(HomeBIConstants.YDL_USER_ASK_MORE_CLICK)
        //心事动态频道页(首页--问答) ydl-user://answers/home
        YDLRouterManager.router(IYDLRouterConstant.ROUTER_ANSWERS_HOME)
    }

    override fun fmItemClick(bean: HomeFMBean.ListBean) {
        if (Utils.isFastClick()) {
            //防止连击
            return
        }
        ActionCountUtils.count(HomeBIConstants.YDL_USER_RADIO_CLICK, bean.id.toString())
        //电台详情页面
        YDLRouterManager.router(
            IYDLRouterConstant.ROUTER_FM_DETAIL,
490 491
            YDLRouterParams().putExtra(IYDLRouterConstant.EXTRA_ID, bean.id.toString())
        )
492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545
    }

    override fun fmPlayClick(fmDetail: HomeFMBean.ListBean) {
        ActionCountUtils.count(HomeBIConstants.YDL_USER_RADIO_PLAY_CLICK, fmDetail.id.toString())

        if (!TextUtils.isEmpty(fmDetail.fmUrl)) {
            val music = Music()
            music.path = fmDetail.fmUrl
            music.album = fmDetail.imageUrl
            music.artist = fmDetail.author
            music.coverPath = fmDetail.imageUrl
            music.title = fmDetail.name
            AudioPlayer.get().singlePlay(music, false)
            PlayerFloatHelper.playingType = PlayTypeEnum.PLAY_TYPE_FM
        }

        PlayerFloatHelper.isCanClick = true
        if (PlayerFloatHelper.isShow(mContext!!)) {
            if (PlayerFloatHelper.playingType != PlayTypeEnum.PLAY_TYPE_FM) {
                PlayerFloatHelper.removeView(mContext!!)

                PlayerFloatHelper.show(mContext!!)
            } else {
                PlayerFloatHelper.setPlayingState(mContext!!)
            }

        } else {
            mContext?.let { PlayerFloatHelper.show(it) }
        }
    }

    override fun fmMoreClick() {
        if (Utils.isFastClick()) {
            //防止连击
            return
        }
        ActionCountUtils.count(HomeBIConstants.YDL_USER_HEART_RADIO_MORE_CLICK)
        //fm列表页  ydl-user://fm/list
        YDLRouterManager.router(IYDLRouterConstant.ROUTER_FM_LIST)
    }

    override fun articleItemClick(bean: HomeArticleBean.Bean?) {
        if (Utils.isFastClick()) {
            //防止连击
            return
        }
        if (bean == null) {
            return
        }

        ActionCountUtils.count(HomeBIConstants.YDL_USER_ARTICLE_CLICK, bean.id.toString())

        YDLRouterManager.router(
            IYDLRouterConstant.ROUTER_H5_H5,
546 547
            YDLRouterParams().putExtra(IYDLRouterConstant.EXTRA_URL, bean.gethUrl()!!), ""
        )
548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603
    }

    override fun articleMoreClick() {
        if (Utils.isFastClick()) {
            //防止连击
            return
        }
        ActionCountUtils.count(HomeBIConstants.YDL_USER_ARTICLE_MORE_CLICK)

        //文章列表页 ydl-user://article/list
        ARouter.getInstance().build("/article/list").navigation()
//        YDLRouterManager.router(IYDLRouterConstant.ROUTER_ARTICLE_LIST)
    }

    override fun askItemClick(bean: HomeAskBean.DataBean) {
        if (Utils.isFastClick()) {
            //防止连击
            return
        }
        ActionCountUtils.count(HomeBIConstants.YDL_USER_ASK_COMMENT_CLICK, bean.id.toString())
        val bundle = Bundle()
        bundle.putInt("trend_id", bean.id)
        bundle.putInt("comment_count", bean.commentsCount)
        bundle.putBoolean("is_comment", false)

        //动态详情
        ARouter.getInstance().build("/trends/detail")
            .withBundle("bundle", bundle)
            .navigation()
    }

    override fun publishTrendClick() {

        val bundle = Bundle()
        bundle.putString("publish_type", "topic_publish")
        bundle.putString("topic_id", "44")
        bundle.putString("topic_title", "今日打卡")

        //发布动态
        ARouter.getInstance().build("/trend/publish")
            .withBundle("bundle", bundle)
            .navigation()
    }


    /**
     * 获取倾述列表数据
     * 最终调用
     * @see com.yidianling.home.ui.fragment.YdlHomeFragment.getConfideData
     *
     * @param type 倾述类型
     * @param selectPosition 选中的position
     */
    override fun getConfideData(type: HomeHeaderBean.ListenCategoryDateBean, selectPosition: Int) {
        ActionCountUtils.count(
            HomeBIConstants.YDL_USER_LISTEN_TYPE_CLICK, type.name
604 605
                ?: ""
        )
606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625
        mHomeView!!.getConfideData(type.id.toString(), selectPosition)
    }

    override fun testItemClick(linkUrl: String?) {
        if (Utils.isFastClick()) {
            //防止连击
            return
        }
        if (null == linkUrl || linkUrl.isEmpty()) {
            return
        }
        if (linkUrl.startsWith("app")) {
            val uri = Uri.parse(linkUrl)
            if ("ceshi" == uri.host) {
                val id = uri.getQueryParameter("id")
                ModularServiceManager.provide(ITestsApiService::class.java).testDetailH5(id)
            }
        } else if (linkUrl.startsWith("http")) {
            YDLRouterManager.router(
                IYDLRouterConstant.ROUTER_H5_H5,
626 627
                YDLRouterParams().putExtra(IYDLRouterConstant.EXTRA_URL, linkUrl), ""
            )
628 629 630
        } else if (linkUrl.contains("ceshi/detail?")) {
            val routerParamsUrls = YDLRouterParamsUrls(linkUrl)
            val jsonObject = JSONObject(routerParamsUrls.getParams())
631 632
            ModularServiceManager.provide(ITestsApiService::class.java)
                .testDetailH5(jsonObject.getString("id").toString())
633 634 635 636 637 638 639 640 641
        } else {
            YDLRouterManager.router(linkUrl)
        }
    }

    override fun testMoreClick() {
        psychologyTestClick()
    }
}