Commit b310c420 by 万齐军

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

Feat/qj/confide2

See merge request app_android_lib/YDL-Component!67
parents 963b1c63 61142785
package com.ydl.component.service.web
import com.google.gson.JsonObject
import com.google.gson.JsonParser
import com.ydl.confide.home.event.ConfideDialogEvent
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydlcommon.base.BaseActivityMgr
import com.ydl.ydlcommon.ui.Loading
import com.yidianling.common.tools.ToastUtil
import de.greenrobot.event.EventBus
class JsMethod {
fun handle(param: String): Boolean {
try {
val obj = JsonParser().parse(param).asJsonObject
val cmd = obj.getAsJsonObject("cmd")
val actionName = cmd?.getAsJsonPrimitive("action_name")?.asString
if (actionName.isNullOrBlank()) return false
return innerHandle(actionName, cmd)
} catch (throwable: Throwable) {
throwable.printStackTrace()
return false
}
}
private fun innerHandle(actionName: String, obj: JsonObject): Boolean {
val param = obj.getAsJsonObject("params")
when (actionName) {
"handle_confide_btn" -> {
val show = param.getAsJsonPrimitive("show").asInt
EventBus.getDefault().post(ConfideDialogEvent(show))
return true
}
"show_loading" -> {
val topActivity = BaseActivityMgr.INST.getTopActivity()
Loading.show(topActivity)
return true
}
"close_loading" -> {
Loading.close()
return true
}
"open_app_eval_list"->{
val url = param.getAsJsonPrimitive("url").asString
val topActivity = BaseActivityMgr.INST.getTopActivity()
NewH5Activity.start(topActivity, H5Params(url, ""))
return true
}
"toast" -> {
val msg = param.getAsJsonPrimitive("msg").asString
if (!msg.isNullOrBlank()) {
ToastUtil.toastShort(msg)
}
return true
}
else -> {
return false
}
}
}
}
\ No newline at end of file
...@@ -22,6 +22,9 @@ import com.yidianling.user.UserHelper ...@@ -22,6 +22,9 @@ import com.yidianling.user.UserHelper
*/ */
class WebJavascriptHandler : IJavascriptHandler{ class WebJavascriptHandler : IJavascriptHandler{
private val js = JsMethod()
override fun getUriAppendSuffix(): String { override fun getUriAppendSuffix(): String {
return "platform_main_theme=00C9E2&platform_main_theme_light=00D4DF&platform_main_theme_bright=EAFAFC" return "platform_main_theme=00C9E2&platform_main_theme_light=00D4DF&platform_main_theme_bright=EAFAFC"
} }
...@@ -47,6 +50,7 @@ class WebJavascriptHandler : IJavascriptHandler{ ...@@ -47,6 +50,7 @@ class WebJavascriptHandler : IJavascriptHandler{
if (YDLRouterManager.router(params)) { if (YDLRouterManager.router(params)) {
return return
} }
if (js.handle(params)) return
val jsData = Gson().fromJson(params, H5JsBean::class.java) val jsData = Gson().fromJson(params, H5JsBean::class.java)
//是否登录 //是否登录
if (jsData.cmd?.action_name != null && jsData.cmd!!.action_name.equals("login")) { if (jsData.cmd?.action_name != null && jsData.cmd!!.action_name.equals("login")) {
......
...@@ -20,6 +20,8 @@ import com.google.android.material.bottomsheet.BottomSheetDialogFragment ...@@ -20,6 +20,8 @@ import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import com.tencent.smtt.export.external.interfaces.JsResult import com.tencent.smtt.export.external.interfaces.JsResult
import com.tencent.smtt.sdk.* import com.tencent.smtt.sdk.*
import com.ydl.confide.R import com.ydl.confide.R
import com.ydl.confide.home.event.ChangeAnotherExpertEvent
import com.ydl.confide.home.event.ConfideDialogEvent
import com.ydl.confide.home.http.ConfideHomeApi import com.ydl.confide.home.http.ConfideHomeApi
import com.ydl.confide.router.PhoneCallIn import com.ydl.confide.router.PhoneCallIn
import com.ydl.utils.WebUrlParamsUtils import com.ydl.utils.WebUrlParamsUtils
...@@ -34,15 +36,18 @@ import com.ydl.ydlnet.YDLHttpUtils ...@@ -34,15 +36,18 @@ import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import com.yidianling.im.api.service.IImService import com.yidianling.im.api.service.IImService
import com.yidianling.user.api.service.IUserService import com.yidianling.user.api.service.IUserService
import de.greenrobot.event.EventBus
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers import io.reactivex.schedulers.Schedulers
import java.util.* import java.util.*
import kotlin.math.roundToInt
class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
companion object { companion object {
private const val KEY_JUMP_URL = "jumpUrl" private const val KEY_JUMP_URL = "jumpUrl"
private const val KEY_DOCTOR_ID = "doctor_id" private const val KEY_DOCTOR_ID = "doctor_id"
private const val KEY_SHOULD_SHOW = "should_show" private const val KEY_SHOULD_SHOW = "should_show"
private const val KEY_UID = "uid"
} }
private var firstVisitWXH5PayUrl = true private var firstVisitWXH5PayUrl = true
...@@ -59,23 +64,26 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -59,23 +64,26 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
lateinit var first_order: View lateinit var first_order: View
lateinit var confideProgress: View lateinit var confideProgress: View
lateinit var layout_change_text: View lateinit var layout_change_text: View
lateinit var layoutBottom: View
lateinit var itemView: View lateinit var itemView: View
lateinit var jumpUrl: String lateinit var jumpUrl: String
lateinit var doctorId: String lateinit var doctorId: String
var shouldShow: Boolean? = false var shouldShow: Boolean? = false
var uid:String?="0" var uid: String? = null
fun showBottomSheetDialog( fun showBottomSheetDialog(
activity: FragmentActivity, activity: FragmentActivity,
jumpUrl: String, jumpUrl: String,
doctorId: String, doctorId: String,
shouldShow: Boolean = false shouldShow: Boolean = false,
uid: String? = null
) { ) {
arguments = Bundle().apply { arguments = Bundle().apply {
putString(KEY_JUMP_URL, jumpUrl) putString(KEY_JUMP_URL, jumpUrl)
putString(KEY_DOCTOR_ID, doctorId) putString(KEY_DOCTOR_ID, doctorId)
putBoolean(KEY_SHOULD_SHOW, shouldShow) putBoolean(KEY_SHOULD_SHOW, shouldShow)
uid?.let { putString(KEY_UID, it) }
} }
show(activity.supportFragmentManager, "confide_bottom_showdialog") show(activity.supportFragmentManager, "confide_bottom_showdialog")
} }
...@@ -84,6 +92,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -84,6 +92,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setStyle(STYLE_NORMAL, R.style.AppBottomSheet) setStyle(STYLE_NORMAL, R.style.AppBottomSheet)
EventBus.getDefault().register(this)
} }
override fun onCreateView( override fun onCreateView(
...@@ -100,9 +109,11 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -100,9 +109,11 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
jumpUrl = arguments?.getString(KEY_JUMP_URL) ?: "" jumpUrl = arguments?.getString(KEY_JUMP_URL) ?: ""
doctorId = arguments?.getString(KEY_DOCTOR_ID) ?: "" doctorId = arguments?.getString(KEY_DOCTOR_ID) ?: ""
shouldShow = arguments?.getBoolean(KEY_SHOULD_SHOW) ?: false shouldShow = arguments?.getBoolean(KEY_SHOULD_SHOW) ?: false
uid = arguments?.getString(KEY_UID)
onLoadDialStatus(doctorId) onLoadDialStatus(doctorId)
// + // +
wv_content = view.findViewById<ProgressWebView>(com.ydl.webview.R.id.wv_content) wv_content = view.findViewById<ProgressWebView>(com.ydl.webview.R.id.wv_content)
wv_content.progressbar.visibility = View.GONE
close_webview_Icon = view.findViewById<View>(R.id.close_webview_Icon) close_webview_Icon = view.findViewById<View>(R.id.close_webview_Icon)
text_title = view.findViewById<TextView>(R.id.text_title) text_title = view.findViewById<TextView>(R.id.text_title)
line = view.findViewById<View>(R.id.line) line = view.findViewById<View>(R.id.line)
...@@ -138,12 +149,13 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -138,12 +149,13 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
} }
private fun onShowReady(){ private fun onShowReady() {
itemView = LayoutInflater.from(context).inflate(R.layout.confide_bottom_two, null, false) itemView = LayoutInflater.from(context).inflate(R.layout.confide_bottom_two, null, false)
layoutCall = itemView.findViewById<View>(R.id.layoutCall) layoutCall = itemView.findViewById<View>(R.id.layoutCall)
layoutChange = itemView.findViewById<View>(R.id.layoutChange) layoutChange = itemView.findViewById<View>(R.id.layoutChange)
confideProgress = itemView.findViewById<View>(R.id.confide_progress) confideProgress = itemView.findViewById<View>(R.id.confide_progress)
layout_change_text = itemView.findViewById<View>(R.id.layout_change_text) layout_change_text = itemView.findViewById<View>(R.id.layout_change_text)
layoutBottom = itemView.findViewById<View>(R.id.layoutBottom)
tvCall = itemView.findViewById<TextView>(R.id.tvCall) tvCall = itemView.findViewById<TextView>(R.id.tvCall)
tvTime = itemView.findViewById<TextView>(R.id.tvTime) tvTime = itemView.findViewById<TextView>(R.id.tvTime)
first_order = itemView.findViewById<TextView>(R.id.first_order) first_order = itemView.findViewById<TextView>(R.id.first_order)
...@@ -151,7 +163,10 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -151,7 +163,10 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
val isLogin = userService.isLogin() val isLogin = userService.isLogin()
first_order.visibility = if (isLogin) View.GONE else View.VISIBLE first_order.visibility = if (isLogin) View.GONE else View.VISIBLE
layoutCall.setOnClickListener { layoutCall.setOnClickListener {
ActionCountUtils.record("ydl_experts_detail_popupwindows_page", "ydl_experts_detail_popupwindows_page_visit") ActionCountUtils.record(
"ydl_experts_detail_popupwindows_page",
"ydl_experts_detail_popupwindows_page_visit"
)
if (!PhoneCallIn.loginByOneKeyLogin(requireContext(), true)) { if (!PhoneCallIn.loginByOneKeyLogin(requireContext(), true)) {
return@setOnClickListener return@setOnClickListener
} }
...@@ -196,7 +211,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -196,7 +211,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
val bottomSheet = val bottomSheet =
(it as BottomSheetDialog).findViewById<View>(com.google.android.material.R.id.design_bottom_sheet) as FrameLayout? (it as BottomSheetDialog).findViewById<View>(com.google.android.material.R.id.design_bottom_sheet) as FrameLayout?
val behavior = BottomSheetBehavior.from(bottomSheet!!) val behavior = BottomSheetBehavior.from(bottomSheet!!)
behavior.peekHeight = resources.displayMetrics.heightPixels / 2 behavior.peekHeight = (resources.displayMetrics.heightPixels * 0.7F).roundToInt()
//true是跳过peekHeight,直接滑下去,false是可以滑动到顶部还可以保持peekHeight在滑下去 //true是跳过peekHeight,直接滑下去,false是可以滑动到顶部还可以保持peekHeight在滑下去
// behavior?.skipCollapsed=true // behavior?.skipCollapsed=true
behavior.addBottomSheetCallback(object : BottomSheetBehavior.BottomSheetCallback() { behavior.addBottomSheetCallback(object : BottomSheetBehavior.BottomSheetCallback() {
...@@ -238,18 +253,31 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -238,18 +253,31 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
} }
} }
} }
fun updateChange(doctorId: String,title:String, uid: String) {
fun onEventMainThread(event: ConfideDialogEvent) {
// 第一位表示拨打按钮,第二位代表再换一位按钮
val show = event.show
layoutCall.visibility = if (show and 0x01 == 0x01) View.VISIBLE else View.GONE
layoutChange.visibility = if (show and 0x02 == 0x01) View.VISIBLE else View.GONE
}
fun onEventMainThread(event: ChangeAnotherExpertEvent) {
updateChange(event.doctorID, event.title, event.uid)
}
private fun updateChange(doctorId: String, title: String, uid: String) {
if (doctorId == "0") {//没有下一位了 if (doctorId == "0") {//没有下一位了
layoutChange.visibility = View.GONE layoutChange.visibility = View.GONE
return return
} }
this.uid=uid this.uid = uid
text_title.text=title text_title.text = title
confideProgress.visibility=View.GONE confideProgress.visibility = View.GONE
layout_change_text.visibility=View.VISIBLE layout_change_text.visibility = View.VISIBLE
onLoadDialStatus(doctorId) onLoadDialStatus(doctorId)
callJsFun(wv_content,"setUnRead(${getUnReadByUid(uid =uid )})") callJsFun(wv_content, "setUnRead(${getUnReadByUid(uid = uid)})")
} }
@SuppressLint("ClickableViewAccessibility") @SuppressLint("ClickableViewAccessibility")
private fun webViewInit(wv_content: ProgressWebView) { private fun webViewInit(wv_content: ProgressWebView) {
val setting: WebSettings = wv_content?.settings!! val setting: WebSettings = wv_content?.settings!!
...@@ -303,20 +331,14 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -303,20 +331,14 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
override fun onProgressChanged(view: WebView, newProgress: Int) { override fun onProgressChanged(view: WebView, newProgress: Int) {
if (newProgress == 100) { if (newProgress == 100) {
wv_content.progressbar.visibility = View.GONE callJsFun(wv_content, "setUnRead(${uid?.let { getUnReadByUid(uid = it) }})")
callJsFun(wv_content,"setUnRead(${uid?.let { getUnReadByUid(uid = it) }})")
} else {
if (wv_content.progressbar.visibility == View.GONE) {
wv_content.progressbar.visibility = View.VISIBLE
}
wv_content.progressbar.progress = newProgress
} }
super.onProgressChanged(view, newProgress) super.onProgressChanged(view, newProgress)
} }
override fun onReceivedTitle(view: WebView, title: String) { override fun onReceivedTitle(view: WebView, title: String) {
super.onReceivedTitle(view, title) super.onReceivedTitle(view, title)
text_title.text=title text_title.text = title
} }
// For Android < 3.0 // For Android < 3.0
...@@ -420,9 +442,10 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -420,9 +442,10 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
} }
} }
fun getUnReadByUid(uid:String):Int{ fun getUnReadByUid(uid: String): Int {
return ARouter.getInstance().navigation(IImService::class.java).getUnReadByUid(uid) return ARouter.getInstance().navigation(IImService::class.java).getUnReadByUid(uid)
} }
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
private fun onLoadDialStatus(doctorId: String) { private fun onLoadDialStatus(doctorId: String) {
val confideApi = YDLHttpUtils.obtainApi(ConfideHomeApi::class.java) val confideApi = YDLHttpUtils.obtainApi(ConfideHomeApi::class.java)
...@@ -473,4 +496,10 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -473,4 +496,10 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
} }
}, { throwable -> throwable.printStackTrace() }) }, { throwable -> throwable.printStackTrace() })
} }
override fun onDestroy() {
super.onDestroy()
wv_content.destroy()
EventBus.getDefault().unregister(this)
}
} }
\ No newline at end of file
...@@ -4,7 +4,6 @@ import android.annotation.SuppressLint ...@@ -4,7 +4,6 @@ import android.annotation.SuppressLint
import android.content.Context import android.content.Context
import android.graphics.Color import android.graphics.Color
import android.os.Build import android.os.Build
import android.os.Bundle
import android.view.View import android.view.View
import android.view.WindowManager import android.view.WindowManager
import androidx.fragment.app.FragmentActivity import androidx.fragment.app.FragmentActivity
...@@ -22,7 +21,6 @@ import com.ydl.confide.home.bean.ConfideHomeDataBean ...@@ -22,7 +21,6 @@ import com.ydl.confide.home.bean.ConfideHomeDataBean
import com.ydl.confide.home.bean.ConfideHomeFiterItemBean import com.ydl.confide.home.bean.ConfideHomeFiterItemBean
import com.ydl.confide.home.config.IConfideHomeConfig import com.ydl.confide.home.config.IConfideHomeConfig
import com.ydl.confide.home.contract.IConfideHomeContract import com.ydl.confide.home.contract.IConfideHomeContract
import com.ydl.confide.home.event.ChangeAnotherExpertEvent
import com.ydl.confide.home.event.ConfideHomeEventImpl import com.ydl.confide.home.event.ConfideHomeEventImpl
import com.ydl.confide.home.event.IConfideHomeEvent import com.ydl.confide.home.event.IConfideHomeEvent
import com.ydl.confide.home.listener.ConfideHomeRecycleViewListener import com.ydl.confide.home.listener.ConfideHomeRecycleViewListener
...@@ -47,7 +45,6 @@ import com.yidianling.common.tools.RxImageTool ...@@ -47,7 +45,6 @@ import com.yidianling.common.tools.RxImageTool
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import com.yidianling.im.api.service.IImService import com.yidianling.im.api.service.IImService
import com.yidianling.user.api.service.IUserService import com.yidianling.user.api.service.IUserService
import de.greenrobot.event.EventBus
import kotlinx.android.synthetic.main.confide_home_activity.* import kotlinx.android.synthetic.main.confide_home_activity.*
import kotlinx.android.synthetic.main.confide_title_bar.* import kotlinx.android.synthetic.main.confide_title_bar.*
...@@ -106,7 +103,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo ...@@ -106,7 +103,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
//是否有下一页(用于判断为你推荐条数,如果首页返回少于10条 那么就可以认为没有下一页了) 默认有下一页 //是否有下一页(用于判断为你推荐条数,如果首页返回少于10条 那么就可以认为没有下一页了) 默认有下一页
private var hasMore = true private var hasMore = true
private var dp48 = 0 private var dp48 = 0
private lateinit var bottomSheetDialogFragment:ConfideBottomSheetDialogFragment private var bottomSheetDialogFragment: ConfideBottomSheetDialogFragment? = null
init { init {
//初始化参数 //初始化参数
initParam() initParam()
...@@ -153,12 +150,6 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo ...@@ -153,12 +150,6 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
recommendList(page + 1) recommendList(page + 1)
} }
@SuppressLint("MissingSuperCall")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
EventBus.getDefault().register(this)
}
override fun recommendList(page: Int) { override fun recommendList(page: Int) {
//需要将当前列表已存在的老师uid数组发送到后端去重,因为排序实时变化 //需要将当前列表已存在的老师uid数组发送到后端去重,因为排序实时变化
this.page = page this.page = page
...@@ -280,14 +271,12 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo ...@@ -280,14 +271,12 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
return@setOnClickListener return@setOnClickListener
} }
bottomSheetDialogFragment=ConfideBottomSheetDialogFragment() bottomSheetDialogFragment=ConfideBottomSheetDialogFragment()
bottomSheetDialogFragment.showBottomSheetDialog(this as FragmentActivity, HttpConfig.MH5_URL + ConfideRoute.h5ConfideIntro("0"),"0",true) bottomSheetDialogFragment?.showBottomSheetDialog(this as FragmentActivity, HttpConfig.MH5_URL + ConfideRoute.h5ConfideIntro("0"),"0",true)
} }
} }
fun onEventMainThread(event: ChangeAnotherExpertEvent) {
bottomSheetDialogFragment.updateChange(event.doctorID,event.title,event.uid)
}
private fun initView() { private fun initView() {
img_back.setOnClickListener { img_back.setOnClickListener {
finish() finish()
...@@ -557,7 +546,6 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo ...@@ -557,7 +546,6 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
mConfideEvent!!.destoryPlayer() mConfideEvent!!.destoryPlayer()
EventBus.getDefault().unregister(this)
} }
override fun onBackPressed() { override fun onBackPressed() {
......
...@@ -69,7 +69,8 @@ class RecentConfideAdapter(val data: List<ItemVideoShowViewModel>, private val e ...@@ -69,7 +69,8 @@ class RecentConfideAdapter(val data: List<ItemVideoShowViewModel>, private val e
) )
event.consultantClick( event.consultantClick(
itemVideoShowViewModel.doctorId, itemVideoShowViewModel.doctorId,
itemVideoShowViewModel.confideId itemVideoShowViewModel.confideId,
itemVideoShowViewModel.uid
) )
} }
} }
...@@ -84,10 +85,11 @@ class ItemVideoShowViewModel { ...@@ -84,10 +85,11 @@ class ItemVideoShowViewModel {
val state = ObservableInt() val state = ObservableInt()
var doctorId: String? = null var doctorId: String? = null
var confideId: String? = null var confideId: String? = null
var uid: String? = null
} }
internal fun ItemVideoShowViewModel.mapOf(bean: ConfideHomeBodyBean): ItemVideoShowViewModel { internal fun ItemVideoShowViewModel.mapOf(bean: ConfideHomeBodyBean): ItemVideoShowViewModel {
name.set(bean.confidedName) name.set(bean.videoTitle ?: "")
coverUrl.set(bean.confidedIcon) coverUrl.set(bean.confidedIcon)
if (bean.coverVideoPicture.isNullOrBlank()) { if (bean.coverVideoPicture.isNullOrBlank()) {
videoCoverUrl.set(bean.coverPicture) videoCoverUrl.set(bean.coverPicture)
...@@ -97,6 +99,7 @@ internal fun ItemVideoShowViewModel.mapOf(bean: ConfideHomeBodyBean): ItemVideoS ...@@ -97,6 +99,7 @@ internal fun ItemVideoShowViewModel.mapOf(bean: ConfideHomeBodyBean): ItemVideoS
state.set(bean.confideLine ?: 0) state.set(bean.confideLine ?: 0)
doctorId = bean.doctorId doctorId = bean.doctorId
confideId = bean.confidedId confideId = bean.confidedId
uid = bean.uid?.toString()
return this return this
} }
......
...@@ -19,7 +19,8 @@ data class ConfideHomeBodyBean( ...@@ -19,7 +19,8 @@ data class ConfideHomeBodyBean(
//专家的uid //专家的uid
val uid : Int?, val uid : Int?,
//咨询师姓名 //咨询师姓名
val confidedName : String?, val confidedName: String?,
val videoTitle: String?,
//咨询师性别 1.男 2.女 //咨询师性别 1.男 2.女
val confideSex : Int = 1, val confideSex : Int = 1,
//对你留言 //对你留言
......
package com.ydl.confide.home.event package com.ydl.confide.home.event
data class ChangeAnotherExpertEvent( data class ChangeAnotherExpertEvent(
var doctorID:String, var doctorID: String,
var title:String, var title: String,
var uid:String var uid: String
) )
class ConfideDialogEvent(val show: Int)
\ No newline at end of file
...@@ -132,13 +132,13 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo ...@@ -132,13 +132,13 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo
* 最佳倾诉榜单--点我倾诉 * 最佳倾诉榜单--点我倾诉
* @param linkUrl 跳转地址 * @param linkUrl 跳转地址
*/ */
override fun consultantClick(doctorId: String?, confideId: String?) { override fun consultantClick(doctorId: String?, confideId: String?, uid: String?) {
confideId?.let { confideId?.let {
ConfideBottomSheetDialogFragment() ConfideBottomSheetDialogFragment()
.showBottomSheetDialog( .showBottomSheetDialog(
mContext as FragmentActivity, mContext as FragmentActivity,
HttpConfig.MH5_URL + ConfideRoute.h5ConfideIntro(it), HttpConfig.MH5_URL + ConfideRoute.h5ConfideIntro(it),
doctorId!! doctorId!!, uid = uid
) )
} }
} }
......
...@@ -73,7 +73,7 @@ interface IConfideHomeEvent { ...@@ -73,7 +73,7 @@ interface IConfideHomeEvent {
* 咨询师推荐--点我倾诉 * 咨询师推荐--点我倾诉
* @param linkUrl 跳转地址 * @param linkUrl 跳转地址
*/ */
fun consultantClick(doctorId: String?, confideId: String?) fun consultantClick(doctorId: String?, confideId: String?, uid: String?)
fun videoShowClick(index: Int, data: List<ConfideHomeBodyBean>?) fun videoShowClick(index: Int, data: List<ConfideHomeBodyBean>?)
......
...@@ -243,7 +243,7 @@ class ConfideHomeRecommendExpertItemView(mContext: Context, private var confideH ...@@ -243,7 +243,7 @@ class ConfideHomeRecommendExpertItemView(mContext: Context, private var confideH
private fun click(bodyBean: ConfideHomeBodyBean) { private fun click(bodyBean: ConfideHomeBodyBean) {
when (bodyBean.confideLine) {//1在线 2离线 3通话中 when (bodyBean.confideLine) {//1在线 2离线 3通话中
1, 3, 4 -> { 1, 3, 4 -> {
confideHomeEvent.consultantClick(bodyBean.doctorId, bodyBean.confidedId) confideHomeEvent.consultantClick(bodyBean.doctorId, bodyBean.confidedId, bodyBean.uid?.toString())
} }
2 -> { 2 -> {
//跳转私聊 并发送自定义消息 //跳转私聊 并发送自定义消息
......
...@@ -94,7 +94,7 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con ...@@ -94,7 +94,7 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
"1" "1"
) )
confideHomeEvent.consultantClick(bodyBean.doctorId, bodyBean.confidedId) confideHomeEvent.consultantClick(bodyBean.doctorId, bodyBean.confidedId, bodyBean.uid?.toString())
} }
img_head.setOnClickListener { img_head.setOnClickListener {
ActionCountUtils.record("listen_counselor_list_page", "head_portrait_click", "2") ActionCountUtils.record("listen_counselor_list_page", "head_portrait_click", "2")
...@@ -344,7 +344,7 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con ...@@ -344,7 +344,7 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
if (bodyBean.confideLine == 3) { if (bodyBean.confideLine == 3) {
} }
confideHomeEvent.consultantClick(bodyBean.doctorId, bodyBean.confidedId) confideHomeEvent.consultantClick(bodyBean.doctorId, bodyBean.confidedId, bodyBean.uid?.toString())
} }
2 -> { 2 -> {
//跳转私聊 并发送自定义消息 //跳转私聊 并发送自定义消息
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/layoutBottom"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/platform_dp_15" android:layout_marginStart="@dimen/platform_dp_15"
......
...@@ -79,6 +79,8 @@ ...@@ -79,6 +79,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="23dp" android:layout_marginBottom="23dp"
android:maxHeight="8dp" android:maxHeight="8dp"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:paddingStart="0dp" android:paddingStart="0dp"
android:paddingEnd="0dp" android:paddingEnd="0dp"
android:progressDrawable="@drawable/confide_seekbar_style" android:progressDrawable="@drawable/confide_seekbar_style"
......
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