Commit 61142785 by 万齐军

feat: 添加uid

parent b72f91de
......@@ -47,6 +47,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
private const val KEY_JUMP_URL = "jumpUrl"
private const val KEY_DOCTOR_ID = "doctor_id"
private const val KEY_SHOULD_SHOW = "should_show"
private const val KEY_UID = "uid"
}
private var firstVisitWXH5PayUrl = true
......@@ -70,17 +71,19 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
lateinit var jumpUrl: String
lateinit var doctorId: String
var shouldShow: Boolean? = false
var uid:String?="0"
var uid: String? = null
fun showBottomSheetDialog(
activity: FragmentActivity,
jumpUrl: String,
doctorId: String,
shouldShow: Boolean = false
shouldShow: Boolean = false,
uid: String? = null
) {
arguments = Bundle().apply {
putString(KEY_JUMP_URL, jumpUrl)
putString(KEY_DOCTOR_ID, doctorId)
putBoolean(KEY_SHOULD_SHOW, shouldShow)
uid?.let { putString(KEY_UID, it) }
}
show(activity.supportFragmentManager, "confide_bottom_showdialog")
}
......@@ -106,6 +109,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
jumpUrl = arguments?.getString(KEY_JUMP_URL) ?: ""
doctorId = arguments?.getString(KEY_DOCTOR_ID) ?: ""
shouldShow = arguments?.getBoolean(KEY_SHOULD_SHOW) ?: false
uid = arguments?.getString(KEY_UID)
onLoadDialStatus(doctorId)
// +
wv_content = view.findViewById<ProgressWebView>(com.ydl.webview.R.id.wv_content)
......@@ -145,7 +149,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
}
private fun onShowReady(){
private fun onShowReady() {
itemView = LayoutInflater.from(context).inflate(R.layout.confide_bottom_two, null, false)
layoutCall = itemView.findViewById<View>(R.id.layoutCall)
layoutChange = itemView.findViewById<View>(R.id.layoutChange)
......@@ -159,7 +163,10 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
val isLogin = userService.isLogin()
first_order.visibility = if (isLogin) View.GONE else View.VISIBLE
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)) {
return@setOnClickListener
}
......@@ -258,18 +265,19 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
updateChange(event.doctorID, event.title, event.uid)
}
private fun updateChange(doctorId: String,title:String, uid: String) {
private fun updateChange(doctorId: String, title: String, uid: String) {
if (doctorId == "0") {//没有下一位了
layoutChange.visibility = View.GONE
return
}
this.uid=uid
text_title.text=title
confideProgress.visibility=View.GONE
layout_change_text.visibility=View.VISIBLE
this.uid = uid
text_title.text = title
confideProgress.visibility = View.GONE
layout_change_text.visibility = View.VISIBLE
onLoadDialStatus(doctorId)
callJsFun(wv_content,"setUnRead(${getUnReadByUid(uid =uid )})")
callJsFun(wv_content, "setUnRead(${getUnReadByUid(uid = uid)})")
}
@SuppressLint("ClickableViewAccessibility")
private fun webViewInit(wv_content: ProgressWebView) {
val setting: WebSettings = wv_content?.settings!!
......@@ -323,14 +331,14 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
override fun onProgressChanged(view: WebView, newProgress: Int) {
if (newProgress == 100) {
callJsFun(wv_content,"setUnRead(${uid?.let { getUnReadByUid(uid = it) }})")
callJsFun(wv_content, "setUnRead(${uid?.let { getUnReadByUid(uid = it) }})")
}
super.onProgressChanged(view, newProgress)
}
override fun onReceivedTitle(view: WebView, title: String) {
super.onReceivedTitle(view, title)
text_title.text=title
text_title.text = title
}
// For Android < 3.0
......@@ -434,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)
}
@SuppressLint("CheckResult")
private fun onLoadDialStatus(doctorId: String) {
val confideApi = YDLHttpUtils.obtainApi(ConfideHomeApi::class.java)
......
......@@ -69,7 +69,8 @@ class RecentConfideAdapter(val data: List<ItemVideoShowViewModel>, private val e
)
event.consultantClick(
itemVideoShowViewModel.doctorId,
itemVideoShowViewModel.confideId
itemVideoShowViewModel.confideId,
itemVideoShowViewModel.uid
)
}
}
......@@ -84,10 +85,11 @@ class ItemVideoShowViewModel {
val state = ObservableInt()
var doctorId: String? = null
var confideId: String? = null
var uid: String? = null
}
internal fun ItemVideoShowViewModel.mapOf(bean: ConfideHomeBodyBean): ItemVideoShowViewModel {
name.set(bean.confidedName)
name.set(bean.videoTitle ?: "")
coverUrl.set(bean.confidedIcon)
if (bean.coverVideoPicture.isNullOrBlank()) {
videoCoverUrl.set(bean.coverPicture)
......@@ -97,6 +99,7 @@ internal fun ItemVideoShowViewModel.mapOf(bean: ConfideHomeBodyBean): ItemVideoS
state.set(bean.confideLine ?: 0)
doctorId = bean.doctorId
confideId = bean.confidedId
uid = bean.uid?.toString()
return this
}
......
......@@ -19,7 +19,8 @@ data class ConfideHomeBodyBean(
//专家的uid
val uid : Int?,
//咨询师姓名
val confidedName : String?,
val confidedName: String?,
val videoTitle: String?,
//咨询师性别 1.男 2.女
val confideSex : Int = 1,
//对你留言
......
......@@ -31,6 +31,7 @@ import com.ydl.media.view.PlayerFloatView
import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydl_router.manager.YDLRouterParams
import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.modular.route
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.utils.remind.ToastHelper
......@@ -131,13 +132,13 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo
* 最佳倾诉榜单--点我倾诉
* @param linkUrl 跳转地址
*/
override fun consultantClick(doctorId: String?, confideId: String?) {
override fun consultantClick(doctorId: String?, confideId: String?, uid: String?) {
confideId?.let {
ConfideBottomSheetDialogFragment()
.showBottomSheetDialog(
mContext as FragmentActivity,
/*HttpConfig.MH5_URL*/"http://192.168.210.152/" + ConfideRoute.h5ConfideIntro(it),
doctorId!!
HttpConfig.MH5_URL + ConfideRoute.h5ConfideIntro(it),
doctorId!!, uid = uid
)
}
}
......
......@@ -73,7 +73,7 @@ interface IConfideHomeEvent {
* 咨询师推荐--点我倾诉
* @param linkUrl 跳转地址
*/
fun consultantClick(doctorId: String?, confideId: String?)
fun consultantClick(doctorId: String?, confideId: String?, uid: String?)
fun videoShowClick(index: Int, data: List<ConfideHomeBodyBean>?)
......
......@@ -243,7 +243,7 @@ class ConfideHomeRecommendExpertItemView(mContext: Context, private var confideH
private fun click(bodyBean: ConfideHomeBodyBean) {
when (bodyBean.confideLine) {//1在线 2离线 3通话中
1, 3, 4 -> {
confideHomeEvent.consultantClick(bodyBean.doctorId, bodyBean.confidedId)
confideHomeEvent.consultantClick(bodyBean.doctorId, bodyBean.confidedId, bodyBean.uid?.toString())
}
2 -> {
//跳转私聊 并发送自定义消息
......
......@@ -94,7 +94,7 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
"1"
)
confideHomeEvent.consultantClick(bodyBean.doctorId, bodyBean.confidedId)
confideHomeEvent.consultantClick(bodyBean.doctorId, bodyBean.confidedId, bodyBean.uid?.toString())
}
img_head.setOnClickListener {
ActionCountUtils.record("listen_counselor_list_page", "head_portrait_click", "2")
......@@ -344,7 +344,7 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
if (bodyBean.confideLine == 3) {
}
confideHomeEvent.consultantClick(bodyBean.doctorId, bodyBean.confidedId)
confideHomeEvent.consultantClick(bodyBean.doctorId, bodyBean.confidedId, bodyBean.uid?.toString())
}
2 -> {
//跳转私聊 并发送自定义消息
......
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