Commit 110d9a4e by 万齐军

Merge branch 'feat/qj/confide_2.0' into 'd/v_confide_2.0'

feat: 视频点击事件跳转h5

See merge request app_android_lib/YDL-Component!41
parents 9acdb8b5 cdd63b69
ext {
kotlin_version = "1.3.21"
dev_mode = true
dev_mode = false
ydlPublishVersion = [
// -------------- 业务模块 --------------
......
......@@ -4,8 +4,10 @@ import android.annotation.SuppressLint
import android.app.Dialog
import android.net.Uri
import android.os.Bundle
import android.text.TextUtils
import android.view.*
import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import android.widget.TextView
import androidx.fragment.app.FragmentActivity
......@@ -26,17 +28,13 @@ import com.ydl.webview.TellData
import com.ydl.webview.WebModularServiceUtils
import com.ydl.ydlcommon.modular.findRouteService
import com.ydl.ydlcommon.utils.TimeUtil
import com.ydl.ydlcommon.utils.log.AliYunLogConfig
import com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper.Companion.getInstance
import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxImageTool
import com.yidianling.common.tools.ToastUtil
import com.yidianling.im.api.service.IImService
import com.yidianling.user.api.service.IUserService
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.item_expert_intro.*
class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
companion object {
......@@ -234,8 +232,6 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
setting.setAllowFileAccessFromFileURLs(true)
setting.setAppCacheEnabled(true)
setting.setAllowFileAccess(true)
// 解决图片不显示
// 解决图片不显示
setting.setBlockNetworkImage(false)
wv_content!!.scrollBarStyle = View.SCROLLBARS_INSIDE_OVERLAY //滚动条风格,为0指滚动条不占用空间,直接覆盖在网页上
......@@ -243,9 +239,8 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
.getJavascripHandler(requireActivity(), tellData = TellData())
wv_content!!.addJavascriptInterface(jtoJHandle, "javascriptHandler")
var jumpurl = "http://192.168.210.152/jy/listenMask?listenerId=257&isFromApp=1"
var url = WebUrlParamsUtils.getSuffix(jumpurl, jtoJHandle.getUriAppendSuffix())
LogUtil.e("AAA" + url)
// var jumpurl = "http://192.168.210.152/jy/listenMask?listenerId=257&isFromApp=1"
val url = WebUrlParamsUtils.getSuffix(jumpUrl, jtoJHandle.getUriAppendSuffix())
wv_content.loadUrl(url)
// wv_content.loadUrl(jumpUrl)
......
......@@ -7,11 +7,13 @@ import androidx.databinding.ObservableField
import androidx.databinding.ObservableInt
import androidx.recyclerview.widget.RecyclerView
import com.ydl.confide.R
import com.ydl.confide.api.ConfideRoute
import com.ydl.confide.databinding.ItemConfideHomeRecentBinding
import com.ydl.confide.databinding.ItemVideoShowBinding
import com.ydl.confide.home.bean.ConfideHomeBodyBean
import com.ydl.confide.home.event.IConfideHomeEvent
import com.ydl.confide.intro.BindingViewHolder
import com.ydl.ydlcommon.base.config.HttpConfig
class VideoShowAdapter(private val data: List<ConfideHomeBodyBean>?, private val event: IConfideHomeEvent) :
RecyclerView.Adapter<BindingViewHolder<ItemVideoShowBinding>>() {
......@@ -76,8 +78,10 @@ internal fun ItemVideoShowViewModel.mapOf(bean: ConfideHomeBodyBean): ItemVideoS
coverUrl.set(bean.confidedIcon)
videoCoverUrl.set(bean.coverVideoPicture)
state.set(bean.confideLine ?: 0)
linkUrl = bean.linkUrl
doctorId = bean.doctorId
doctorId?.let {
linkUrl = HttpConfig.MH5_URL + ConfideRoute.h5ConfideIntro(it)
}
return this
}
......
......@@ -7,6 +7,7 @@ import android.net.Uri
import android.text.TextUtils
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.FragmentActivity
import com.alibaba.fastjson.JSON
import com.ydl.confide.api.ConfideRoute
import com.ydl.confide.home.ConfideBottomSheetDialogFragment
......@@ -131,8 +132,9 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo
* @param linkUrl 跳转地址
*/
override fun consultantClick(linkUrl: String?, doctorId: String?) {
if (linkUrl.isNullOrBlank()) return
ConfideBottomSheetDialogFragment()
.showBottomSheetDialog(mContext as BaseActivity, linkUrl!!, doctorId!!)
.showBottomSheetDialog(mContext as FragmentActivity, linkUrl, doctorId!!)
// link(linkUrl)
}
......
......@@ -5,20 +5,20 @@ import android.app.Application
import android.content.Context
import android.content.Intent
import android.net.Uri
import androidx.fragment.app.DialogFragment
import android.text.TextUtils
import androidx.fragment.app.DialogFragment
import androidx.fragment.app.FragmentActivity
import com.alibaba.android.arouter.facade.annotation.Route
import com.google.gson.Gson
import com.ydl.audioim.YDLavManager
import com.ydl.audioim.widget.AxbConfirmDialog
import com.ydl.confide.api.IConfideService
import com.ydl.confide.home.ConfideBottomSheetDialogFragment
import com.ydl.confide.home.ConfideHomeActivity
import com.ydl.webview.TellData
import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.base.config.YDLConstants
import com.ydl.ydlcommon.utils.YDLCacheUtils
import com.yidianling.common.tools.RxSPTool
import com.yidianling.common.tools.ToastUtil
/**
* Created by haorui on 2019-12-11 .
......@@ -116,5 +116,8 @@ class ConfdieServiceImpl : IConfideService {
}
override fun showExpertDetailDialog(activity: FragmentActivity, jumpUrl: String, doctorId: String) {
ConfideBottomSheetDialogFragment().showBottomSheetDialog(activity, jumpUrl, doctorId, false)
}
}
\ No newline at end of file
......@@ -11,6 +11,7 @@ import androidx.databinding.ViewDataBinding
import androidx.fragment.app.FragmentActivity
import androidx.recyclerview.widget.RecyclerView
import com.dou361.ijkplayer.widget.IjkVideoView
import com.ydl.confide.api.ConfideRoute
import com.ydl.confide.databinding.ItemExpertIntroBinding
import com.ydl.confide.home.ConfideBottomSheetDialogFragment
import com.ydl.confide.home.bean.ConfideHomeBodyBean
......@@ -57,8 +58,14 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
}
}
binding.btnEvaluate.setOnClickListener {
ConfideBottomSheetDialogFragment()
.showBottomSheetDialog(itemView.context as FragmentActivity, item.linkUrl!!,item.doctorId!!)
item.doctorId?.let {
ConfideBottomSheetDialogFragment()
.showBottomSheetDialog(
itemView.context as FragmentActivity,
HttpConfig.MH5_URL + ConfideRoute.h5ExpertEval(it),
it
)
}
}
binding.tvName.setOnClickListener {
showDoctorDetail(item)
......@@ -69,7 +76,7 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
binding.vDisableClick.setOnClickListener { }
binding.btnShare.setOnClickListener {
val aty = it.context as? Activity
if (aty != null && !item.linkUrl.isNullOrBlank()) {
if (aty != null) {
var shareUrl = "${HttpConfig.MH5_URL}experts/${item.doctorId}"
if (!item.confideId.isNullOrBlank()) {
shareUrl += "?id=${item.confideId}"
......@@ -193,8 +200,10 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
}
private fun showDoctorDetail(item: VideoViewModel) {
ConfideBottomSheetDialogFragment()
.showBottomSheetDialog(itemView.context as FragmentActivity, item.linkUrl!!, item.doctorId!!)
if (!item.linkUrl.isNullOrBlank()) {
ConfideBottomSheetDialogFragment()
.showBottomSheetDialog(itemView.context as FragmentActivity, item.linkUrl!!, item.doctorId!!)
}
}
}
......@@ -247,7 +256,9 @@ internal fun VideoViewModel.mapOf(bean: ConfideHomeBodyBean): VideoViewModel {
uid = bean.uid?.toString()
doctorId = bean.doctorId
confideId = bean.confidedId
linkUrl = bean.linkUrl
doctorId?.let {
linkUrl = HttpConfig.MH5_URL + ConfideRoute.h5ExpertEval(it)
}
return this
}
......
......@@ -5,6 +5,7 @@ import android.app.Application
import android.content.Context
import android.content.Intent
import androidx.fragment.app.DialogFragment
import androidx.fragment.app.FragmentActivity
import com.alibaba.android.arouter.facade.template.IProvider
interface IConfideService : IProvider {
......@@ -26,4 +27,10 @@ interface IConfideService : IProvider {
fun initYdlavManager(app: Application)
fun showAxbConfirmDialog(activity: Activity?, type: Int, phoneNumber: String?)
fun showExpertDetailDialog(
activity: FragmentActivity,
jumpUrl: String,
doctorId: String
)
}
\ No newline at end of file
package com.ydl.confide.api
object ConfideRoute{
object ConfideRoute {
const val R_VIDEO_SHOW = "/confide/expert_video"
fun h5ConfideIntro(id: String) = "/jy/listenMask?listenerId=${id}"
fun h5ExpertEval(id: String) = "/comment/evaList/${id}?listenerId=${id}"
}
\ No newline at end of file
......@@ -68,14 +68,9 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.fragment:fragment-ktx:1.2.4'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
api "com.airbnb.android:lottie:3.4.0"
implementation "com.alibaba:arouter-api:$arouter_api"
// 注意此处的依赖方式:kotlin中使用和java中使用方式有不同
kapt "com.alibaba:arouter-compiler:$arouter_compiler"
implementation rootProject.ext.dependencies["ydl-user-router"]
......@@ -87,6 +82,7 @@ dependencies {
implementation modularPublication('com.ydl:m-tests-api')
implementation modularPublication('com.ydl:m-home-api')
implementation modularPublication('com.ydl:m-im-api')
implementation modularPublication('com.ydl:m-confide-api')
implementation project(':ydl-webview')
implementation project(':ydl-media')
implementation project(":ydl-platform")
......@@ -98,6 +94,7 @@ dependencies {
compileOnly rootProject.ext.dependencies["ydl-m-home-api"]
compileOnly rootProject.ext.dependencies['ydl-m-tests-api']
compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
compileOnly rootProject.ext.dependencies["ydl-m-confide-api"]
api (rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
......
......@@ -7,8 +7,11 @@ import android.os.Bundle
import android.text.TextUtils
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.FragmentActivity
import androidx.recyclerview.widget.RecyclerView
import com.alibaba.android.arouter.launcher.ARouter
import com.ydl.confide.api.ConfideRoute
import com.ydl.confide.api.IConfideService
import com.ydl.media.audio.AudioPlayer
import com.ydl.media.audio.model.Music
import com.ydl.media.view.PlayTypeEnum
......@@ -23,7 +26,7 @@ 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
import com.ydl.ydlcommon.modular.ModularServiceManager.provide
import com.ydl.ydlcommon.modular.findRouteService
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlcommon.utils.Utils
......@@ -357,14 +360,12 @@ open class HomeBaseImpl : IHomeBaseEvent {
doctorId.toString()
)
if (linkUrl.startsWith("http")) {
YDLRouterManager.router(
IYDLRouterConstant.ROUTER_H5_H5,
YDLRouterParams().putExtra(IYDLRouterConstant.EXTRA_URL, linkUrl), ""
findRouteService(IConfideService::class.java)
?.showExpertDetailDialog(
mContext as FragmentActivity,
HttpConfig.MH5_URL + ConfideRoute.h5ConfideIntro(doctorId.toString()),
doctorId.toString()
)
} else {
YDLRouterManager.router(linkUrl)
}
}
/**
......
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