Commit 61142785 by 万齐军

feat: 添加uid

parent b72f91de
...@@ -47,6 +47,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -47,6 +47,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
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
...@@ -70,17 +71,19 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -70,17 +71,19 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
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")
} }
...@@ -106,6 +109,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -106,6 +109,7 @@ 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)
...@@ -145,7 +149,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -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) 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)
...@@ -159,7 +163,10 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -159,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
} }
...@@ -258,18 +265,19 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -258,18 +265,19 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
updateChange(event.doctorID, event.title, event.uid) 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") {//没有下一位了 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!!
...@@ -323,14 +331,14 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -323,14 +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) {
callJsFun(wv_content,"setUnRead(${uid?.let { getUnReadByUid(uid = it) }})") callJsFun(wv_content, "setUnRead(${uid?.let { getUnReadByUid(uid = it) }})")
} }
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
...@@ -434,9 +442,10 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -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) 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)
......
...@@ -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,
//对你留言 //对你留言
......
...@@ -31,6 +31,7 @@ import com.ydl.media.view.PlayerFloatView ...@@ -31,6 +31,7 @@ import com.ydl.media.view.PlayerFloatView
import com.ydl.ydl_router.manager.YDLRouterManager import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydl_router.manager.YDLRouterParams import com.ydl.ydl_router.manager.YDLRouterParams
import com.ydl.ydlcommon.base.BaseActivity import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.modular.route import com.ydl.ydlcommon.modular.route
import com.ydl.ydlcommon.router.IYDLRouterConstant import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.utils.remind.ToastHelper import com.ydl.ydlcommon.utils.remind.ToastHelper
...@@ -131,13 +132,13 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo ...@@ -131,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*/"http://192.168.210.152/" + 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 -> {
//跳转私聊 并发送自定义消息 //跳转私聊 并发送自定义消息
......
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