Commit 7f36c40d by 万齐军

feat: bug fix

parent 3e3e3d33
......@@ -398,10 +398,11 @@ class WebJavascriptHandler : IJavascriptHandler{
"show_popup_window" -> {
val doctorId = jsData.cmd?.params?.doctorId?.toString()
val confideId = jsData.cmd?.params?.confidedId
val uid = jsData.cmd?.params?.uid?.toString()
val topActivity = BaseActivityMgr.INST.getTopActivity()
if (topActivity is FragmentActivity && doctorId != null && confideId != null) {
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 {
ydlPublishVersion = [
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.49.85",
"m-confide" : "0.0.49.86",
"m-consultant" : "0.0.60.27",
"m-fm" : "0.0.30.09",
"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-dynamic" : "0.0.7.74",
"m-article" : "0.0.0.10",
......@@ -20,7 +20,7 @@ ext {
//-------------- 业务模块 API 层 --------------
"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-course-api" : "0.0.3.6",
"m-fm-api" : "0.0.3",
......@@ -90,11 +90,11 @@ ext {
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.49.85",
"m-confide" : "0.0.49.86",
"m-consultant" : "0.0.60.27",
"m-fm" : "0.0.30.09",
"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-dynamic" : "0.0.7.74",
"m-article" : "0.0.0.8",
......@@ -104,7 +104,7 @@ ext {
"m-course" : "0.0.43.39",
//-------------- 业务模块 API 层 --------------
"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-course-api" : "0.0.3.6",
"m-fm-api" : "0.0.3",
......
......@@ -67,6 +67,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
lateinit var layoutBottom: View
lateinit var itemView: View
private var behavior: BottomSheetBehavior<*>? = null
lateinit var jumpUrl: String
lateinit var doctorId: String
......@@ -210,11 +211,11 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
dialog?.window?.addContentView(itemView, layoutParams)
val bottomSheet =
(it as BottomSheetDialog).findViewById<View>(com.google.android.material.R.id.design_bottom_sheet) as FrameLayout?
val behavior = BottomSheetBehavior.from(bottomSheet!!)
behavior.peekHeight = (resources.displayMetrics.heightPixels * 0.7F).roundToInt()
behavior = BottomSheetBehavior.from(bottomSheet!!)
behavior?.peekHeight = (resources.displayMetrics.heightPixels * 0.7F).roundToInt()
//true是跳过peekHeight,直接滑下去,false是可以滑动到顶部还可以保持peekHeight在滑下去
// behavior?.skipCollapsed=true
behavior.addBottomSheetCallback(object : BottomSheetBehavior.BottomSheetCallback() {
behavior?.addBottomSheetCallback(object : BottomSheetBehavior.BottomSheetCallback() {
override fun onStateChanged(bottomSheet: View, newState: Int) {
when (newState) {
3 -> {
......@@ -257,6 +258,9 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
fun onEventMainThread(event: ConfideDialogEvent) {
// 第一位表示拨打按钮,第二位代表再换一位按钮
val show = event.show
if (show == 0) {
behavior?.state = BottomSheetBehavior.STATE_EXPANDED
}
layoutCall.visibility = if (show and 0x01 == 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() {
text_title.text = title
confideProgress.visibility = View.GONE
layout_change_text.visibility = View.VISIBLE
this.doctorId = doctorId
onLoadDialStatus(doctorId)
callJsFun(wv_content, "setUnRead(${getUnReadByUid(uid = uid)})")
}
......@@ -443,11 +448,14 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
}
fun getUnReadByUid(uid: String): Int {
if (uid.isBlank()) return 0
return ARouter.getInstance().navigation(IImService::class.java).getUnReadByUid(uid)
}
@SuppressLint("CheckResult")
private fun onLoadDialStatus(doctorId: String) {
if (doctorId.isBlank()) return
if (doctorId == "0") return
val confideApi = YDLHttpUtils.obtainApi(ConfideHomeApi::class.java)
confideApi.getDialStatus(doctorId)
.subscribeOn(Schedulers.io())
......@@ -462,16 +470,19 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
when (lineStatus) {
1 -> {
tvCall.text = "立即拨打"
tvTime.visibility = View.GONE
layoutCall.background =
context?.getDrawable(R.drawable.confide_line_bg_1)
}
2 -> {
tvCall.text = "已离线"
tvTime.visibility = View.GONE
layoutCall.background =
context?.getDrawable(R.drawable.confide_line_bg_2)
}
3 -> {
tvCall.text = "通话中"
tvTime.visibility = View.GONE
layoutCall.background =
context?.getDrawable(R.drawable.confide_line_bg_3)
}
......
......@@ -118,8 +118,8 @@ class ConfdieServiceImpl : IConfideService {
}
override fun showExpertDetailDialog(activity: FragmentActivity, jumpUrl: String, doctorId: String) {
ConfideBottomSheetDialogFragment().showBottomSheetDialog(activity, jumpUrl, doctorId, false)
override fun showExpertDetailDialog(activity: FragmentActivity, jumpUrl: String, doctorId: String, uid: String) {
ConfideBottomSheetDialogFragment().showBottomSheetDialog(activity, jumpUrl, doctorId, false, uid)
}
}
\ No newline at end of file
......@@ -31,6 +31,7 @@ interface IConfideService : IProvider {
fun showExpertDetailDialog(
activity: FragmentActivity,
jumpUrl: String,
doctorId: String
doctorId: String,
uid: String
)
}
\ No newline at end of file
......@@ -7,9 +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
......@@ -24,6 +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.findRouteService
import com.ydl.ydlcommon.modular.route
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.utils.LogUtil
......@@ -345,7 +348,7 @@ open class HomeBaseImpl : IHomeBaseEvent {
* 倾述咨询师点击
* @param linkUrl 跳转地址
*/
override fun confideClick(linkUrl: String?, doctorId: Int) {
override fun confideClick(linkUrl: String?, confideId:String, doctorId: Int, uid:String?) {
if (Utils.isFastClick()) {
//防止连击
return
......@@ -359,14 +362,13 @@ 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(confideId),
doctorId.toString(),
uid ?: ""
)
} else {
YDLRouterManager.router(linkUrl)
}
}
/**
......
......@@ -103,7 +103,7 @@ interface IHomeBaseEvent {
* 倾述咨询师点击
* @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
import android.view.View
import android.view.ViewGroup
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.manager.YDLImageCacheManager
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.*
/**
......@@ -65,7 +65,7 @@ class HomeConfideExpertInfoView(private var mContext: Context, private var homeE
view_line.visibility = View.VISIBLE
}
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
if (bodyBean.confideLine == 2) {//喊他上线 私聊
homeEvent!!.toChatForMsg(bodyBean.uid.toString())
} 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