Commit 7f36c40d by 万齐军

feat: bug fix

parent 3e3e3d33
...@@ -398,10 +398,11 @@ class WebJavascriptHandler : IJavascriptHandler{ ...@@ -398,10 +398,11 @@ class WebJavascriptHandler : IJavascriptHandler{
"show_popup_window" -> { "show_popup_window" -> {
val doctorId = jsData.cmd?.params?.doctorId?.toString() val doctorId = jsData.cmd?.params?.doctorId?.toString()
val confideId = jsData.cmd?.params?.confidedId val confideId = jsData.cmd?.params?.confidedId
val uid = jsData.cmd?.params?.uid?.toString()
val topActivity = BaseActivityMgr.INST.getTopActivity() val topActivity = BaseActivityMgr.INST.getTopActivity()
if (topActivity is FragmentActivity && doctorId != null && confideId != null) { if (topActivity is FragmentActivity && doctorId != null && confideId != null) {
val url = HttpConfig.MH5_URL + ConfideRoute.h5ConfideIntro(confideId) val url = HttpConfig.MH5_URL + ConfideRoute.h5ConfideIntro(confideId)
findRouteService(IConfideService::class.java).showExpertDetailDialog(topActivity, url, doctorId) findRouteService(IConfideService::class.java).showExpertDetailDialog(topActivity, url, doctorId, uid ?: "")
} }
} }
} }
......
...@@ -5,11 +5,11 @@ ext { ...@@ -5,11 +5,11 @@ ext {
ydlPublishVersion = [ ydlPublishVersion = [
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.49.85", "m-confide" : "0.0.49.86",
"m-consultant" : "0.0.60.27", "m-consultant" : "0.0.60.27",
"m-fm" : "0.0.30.09", "m-fm" : "0.0.30.09",
"m-user" : "0.0.62.18", "m-user" : "0.0.62.18",
"m-home" : "0.0.23.66", "m-home" : "0.0.23.69",
"m-im" : "0.0.21.46", "m-im" : "0.0.21.46",
"m-dynamic" : "0.0.7.74", "m-dynamic" : "0.0.7.74",
"m-article" : "0.0.0.10", "m-article" : "0.0.0.10",
...@@ -20,7 +20,7 @@ ext { ...@@ -20,7 +20,7 @@ ext {
//-------------- 业务模块 API 层 -------------- //-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.6", "m-audioim-api" : "0.0.6",
"m-confide-api" : "0.0.2.15", "m-confide-api" : "0.0.2.16",
"m-consultant-api": "0.0.5.63", "m-consultant-api": "0.0.5.63",
"m-course-api" : "0.0.3.6", "m-course-api" : "0.0.3.6",
"m-fm-api" : "0.0.3", "m-fm-api" : "0.0.3",
...@@ -90,11 +90,11 @@ ext { ...@@ -90,11 +90,11 @@ ext {
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.49.85", "m-confide" : "0.0.49.86",
"m-consultant" : "0.0.60.27", "m-consultant" : "0.0.60.27",
"m-fm" : "0.0.30.09", "m-fm" : "0.0.30.09",
"m-user" : "0.0.62.18", "m-user" : "0.0.62.18",
"m-home" : "0.0.23.66", "m-home" : "0.0.23.69",
"m-im" : "0.0.21.46", "m-im" : "0.0.21.46",
"m-dynamic" : "0.0.7.74", "m-dynamic" : "0.0.7.74",
"m-article" : "0.0.0.8", "m-article" : "0.0.0.8",
...@@ -104,7 +104,7 @@ ext { ...@@ -104,7 +104,7 @@ ext {
"m-course" : "0.0.43.39", "m-course" : "0.0.43.39",
//-------------- 业务模块 API 层 -------------- //-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.6", "m-audioim-api" : "0.0.6",
"m-confide-api" : "0.0.2.15", "m-confide-api" : "0.0.2.16",
"m-consultant-api": "0.0.5.63", "m-consultant-api": "0.0.5.63",
"m-course-api" : "0.0.3.6", "m-course-api" : "0.0.3.6",
"m-fm-api" : "0.0.3", "m-fm-api" : "0.0.3",
......
...@@ -67,6 +67,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -67,6 +67,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
lateinit var layoutBottom: View lateinit var layoutBottom: View
lateinit var itemView: View lateinit var itemView: View
private var behavior: BottomSheetBehavior<*>? = null
lateinit var jumpUrl: String lateinit var jumpUrl: String
lateinit var doctorId: String lateinit var doctorId: String
...@@ -210,11 +211,11 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -210,11 +211,11 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
dialog?.window?.addContentView(itemView, layoutParams) dialog?.window?.addContentView(itemView, layoutParams)
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!!) behavior = BottomSheetBehavior.from(bottomSheet!!)
behavior.peekHeight = (resources.displayMetrics.heightPixels * 0.7F).roundToInt() 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() {
override fun onStateChanged(bottomSheet: View, newState: Int) { override fun onStateChanged(bottomSheet: View, newState: Int) {
when (newState) { when (newState) {
3 -> { 3 -> {
...@@ -257,6 +258,9 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -257,6 +258,9 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
fun onEventMainThread(event: ConfideDialogEvent) { fun onEventMainThread(event: ConfideDialogEvent) {
// 第一位表示拨打按钮,第二位代表再换一位按钮 // 第一位表示拨打按钮,第二位代表再换一位按钮
val show = event.show val show = event.show
if (show == 0) {
behavior?.state = BottomSheetBehavior.STATE_EXPANDED
}
layoutCall.visibility = if (show and 0x01 == 0x01) View.VISIBLE else View.GONE layoutCall.visibility = if (show and 0x01 == 0x01) View.VISIBLE else View.GONE
layoutChange.visibility = if (show and 0x02 == 0x01) View.VISIBLE else View.GONE layoutChange.visibility = if (show and 0x02 == 0x01) View.VISIBLE else View.GONE
} }
...@@ -274,6 +278,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -274,6 +278,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
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
this.doctorId = doctorId
onLoadDialStatus(doctorId) onLoadDialStatus(doctorId)
callJsFun(wv_content, "setUnRead(${getUnReadByUid(uid = uid)})") callJsFun(wv_content, "setUnRead(${getUnReadByUid(uid = uid)})")
} }
...@@ -443,11 +448,14 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -443,11 +448,14 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
} }
fun getUnReadByUid(uid: String): Int { fun getUnReadByUid(uid: String): Int {
if (uid.isBlank()) return 0
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) {
if (doctorId.isBlank()) return
if (doctorId == "0") return
val confideApi = YDLHttpUtils.obtainApi(ConfideHomeApi::class.java) val confideApi = YDLHttpUtils.obtainApi(ConfideHomeApi::class.java)
confideApi.getDialStatus(doctorId) confideApi.getDialStatus(doctorId)
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
...@@ -462,16 +470,19 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -462,16 +470,19 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
when (lineStatus) { when (lineStatus) {
1 -> { 1 -> {
tvCall.text = "立即拨打" tvCall.text = "立即拨打"
tvTime.visibility = View.GONE
layoutCall.background = layoutCall.background =
context?.getDrawable(R.drawable.confide_line_bg_1) context?.getDrawable(R.drawable.confide_line_bg_1)
} }
2 -> { 2 -> {
tvCall.text = "已离线" tvCall.text = "已离线"
tvTime.visibility = View.GONE
layoutCall.background = layoutCall.background =
context?.getDrawable(R.drawable.confide_line_bg_2) context?.getDrawable(R.drawable.confide_line_bg_2)
} }
3 -> { 3 -> {
tvCall.text = "通话中" tvCall.text = "通话中"
tvTime.visibility = View.GONE
layoutCall.background = layoutCall.background =
context?.getDrawable(R.drawable.confide_line_bg_3) context?.getDrawable(R.drawable.confide_line_bg_3)
} }
......
...@@ -118,8 +118,8 @@ class ConfdieServiceImpl : IConfideService { ...@@ -118,8 +118,8 @@ class ConfdieServiceImpl : IConfideService {
} }
override fun showExpertDetailDialog(activity: FragmentActivity, jumpUrl: String, doctorId: String) { override fun showExpertDetailDialog(activity: FragmentActivity, jumpUrl: String, doctorId: String, uid: String) {
ConfideBottomSheetDialogFragment().showBottomSheetDialog(activity, jumpUrl, doctorId, false) ConfideBottomSheetDialogFragment().showBottomSheetDialog(activity, jumpUrl, doctorId, false, uid)
} }
} }
\ No newline at end of file
...@@ -31,6 +31,7 @@ interface IConfideService : IProvider { ...@@ -31,6 +31,7 @@ interface IConfideService : IProvider {
fun showExpertDetailDialog( fun showExpertDetailDialog(
activity: FragmentActivity, activity: FragmentActivity,
jumpUrl: String, jumpUrl: String,
doctorId: String doctorId: String,
uid: String
) )
} }
\ No newline at end of file
...@@ -7,9 +7,11 @@ import android.os.Bundle ...@@ -7,9 +7,11 @@ import android.os.Bundle
import android.text.TextUtils import android.text.TextUtils
import android.view.View import android.view.View
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.FragmentActivity
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.alibaba.android.arouter.launcher.ARouter import com.alibaba.android.arouter.launcher.ARouter
import com.ydl.confide.api.ConfideRoute import com.ydl.confide.api.ConfideRoute
import com.ydl.confide.api.IConfideService
import com.ydl.media.audio.AudioPlayer import com.ydl.media.audio.AudioPlayer
import com.ydl.media.audio.model.Music import com.ydl.media.audio.model.Music
import com.ydl.media.view.PlayTypeEnum import com.ydl.media.view.PlayTypeEnum
...@@ -24,6 +26,7 @@ import com.ydl.ydlcommon.base.config.HttpConfig ...@@ -24,6 +26,7 @@ import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.bean.ShareData import com.ydl.ydlcommon.bean.ShareData
import com.ydl.ydlcommon.data.PlatformRamImpl import com.ydl.ydlcommon.data.PlatformRamImpl
import com.ydl.ydlcommon.modular.ModularServiceManager import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.modular.findRouteService
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.LogUtil import com.ydl.ydlcommon.utils.LogUtil
...@@ -345,7 +348,7 @@ open class HomeBaseImpl : IHomeBaseEvent { ...@@ -345,7 +348,7 @@ open class HomeBaseImpl : IHomeBaseEvent {
* 倾述咨询师点击 * 倾述咨询师点击
* @param linkUrl 跳转地址 * @param linkUrl 跳转地址
*/ */
override fun confideClick(linkUrl: String?, doctorId: Int) { override fun confideClick(linkUrl: String?, confideId:String, doctorId: Int, uid:String?) {
if (Utils.isFastClick()) { if (Utils.isFastClick()) {
//防止连击 //防止连击
return return
...@@ -359,14 +362,13 @@ open class HomeBaseImpl : IHomeBaseEvent { ...@@ -359,14 +362,13 @@ open class HomeBaseImpl : IHomeBaseEvent {
doctorId.toString() doctorId.toString()
) )
if (linkUrl.startsWith("http")) { findRouteService(IConfideService::class.java)
YDLRouterManager.router( .showExpertDetailDialog(
IYDLRouterConstant.ROUTER_H5_H5, mContext as FragmentActivity,
YDLRouterParams().putExtra(IYDLRouterConstant.EXTRA_URL, linkUrl), "" HttpConfig.MH5_URL + ConfideRoute.h5ConfideIntro(confideId),
doctorId.toString(),
uid ?: ""
) )
} else {
YDLRouterManager.router(linkUrl)
}
} }
/** /**
......
...@@ -103,7 +103,7 @@ interface IHomeBaseEvent { ...@@ -103,7 +103,7 @@ interface IHomeBaseEvent {
* 倾述咨询师点击 * 倾述咨询师点击
* @param linkUrl 跳转地址 * @param linkUrl 跳转地址
*/ */
fun confideClick(linkUrl: String?, doctorId: Int) fun confideClick(linkUrl: String?, confideId:String, doctorId: Int, uid: String?)
/** /**
* 私聊 * 私聊
*/ */
......
...@@ -7,12 +7,12 @@ import android.text.TextUtils ...@@ -7,12 +7,12 @@ import android.text.TextUtils
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.FrameLayout import android.widget.FrameLayout
import com.yidianling.home.R
import com.yidianling.home.event.IHomeBaseEvent
import com.yidianling.home.model.bean.HomeConfideBean
import com.ydl.ydl_image.config.SimpleImageOpConfiger import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydl_image.manager.YDLImageCacheManager import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.yidianling.common.tools.RxImageTool import com.yidianling.common.tools.RxImageTool
import com.yidianling.home.R
import com.yidianling.home.event.IHomeBaseEvent
import com.yidianling.home.model.bean.HomeConfideBean
import kotlinx.android.synthetic.ydl.home_confide_expert_info_view.view.* import kotlinx.android.synthetic.ydl.home_confide_expert_info_view.view.*
/** /**
...@@ -65,7 +65,7 @@ class HomeConfideExpertInfoView(private var mContext: Context, private var homeE ...@@ -65,7 +65,7 @@ class HomeConfideExpertInfoView(private var mContext: Context, private var homeE
view_line.visibility = View.VISIBLE view_line.visibility = View.VISIBLE
} }
this.setOnClickListener { this.setOnClickListener {
homeEvent!!.confideClick(bean.linkUrl,bean.doctorId) homeEvent!!.confideClick(bean.linkUrl, bean.confidedId.toString(), bean.doctorId, bean.uid.toString())
} }
} }
...@@ -130,7 +130,7 @@ class HomeConfideExpertInfoView(private var mContext: Context, private var homeE ...@@ -130,7 +130,7 @@ class HomeConfideExpertInfoView(private var mContext: Context, private var homeE
if (bodyBean.confideLine == 2) {//喊他上线 私聊 if (bodyBean.confideLine == 2) {//喊他上线 私聊
homeEvent!!.toChatForMsg(bodyBean.uid.toString()) homeEvent!!.toChatForMsg(bodyBean.uid.toString())
} else { } else {
homeEvent!!.confideClick(bodyBean.linkUrl, bodyBean.doctorId) homeEvent!!.confideClick(bodyBean.linkUrl, bodyBean.confidedId.toString(), bodyBean.doctorId, bodyBean.uid.toString())
} }
} }
} }
......
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