Commit f4915912 by 霍志良

feat:私聊未读数JS触发

parent 5acd7be6
...@@ -450,8 +450,8 @@ public class WVClickAbstractListener implements WebViewClientClickListener { ...@@ -450,8 +450,8 @@ public class WVClickAbstractListener implements WebViewClientClickListener {
} }
@Override @Override
public void getNextExpertStatus(String doctorID, String title) { public void getNextExpertStatus(String doctorID, String title,String uid) {
EventBus.getDefault().post(new ChangeAnotherExpertEvent(doctorID,title)); EventBus.getDefault().post(new ChangeAnotherExpertEvent(doctorID,title,uid));
} }
......
...@@ -383,7 +383,7 @@ class WebJavascriptHandler : IJavascriptHandler{ ...@@ -383,7 +383,7 @@ class WebJavascriptHandler : IJavascriptHandler{
} }
//再换一位 //再换一位
"get_next_doctor"->{ "get_next_doctor"->{
wvEnventPro?.getNextExpertStatus(jsData.cmd?.params?.doctorId.toString(),jsData.cmd?.params?.title) wvEnventPro?.getNextExpertStatus(jsData.cmd?.params?.doctorId.toString(),jsData.cmd?.params?.title,jsData.cmd?.params?.uid.toString())
} }
} }
} }
......
...@@ -181,5 +181,5 @@ public interface WebViewClientClickListener { ...@@ -181,5 +181,5 @@ public interface WebViewClientClickListener {
//设置当前页面类型 //设置当前页面类型
void setSelfPageType(int selfType); void setSelfPageType(int selfType);
void getNextExpertStatus(String doctorID,String title); void getNextExpertStatus(String doctorID,String title,String uid);
} }
ext { ext {
kotlin_version = "1.3.21" kotlin_version = "1.3.21"
dev_mode = false dev_mode = true
ydlPublishVersion = [ ydlPublishVersion = [
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
......
...@@ -9,6 +9,7 @@ import android.view.* ...@@ -9,6 +9,7 @@ import android.view.*
import android.widget.FrameLayout import android.widget.FrameLayout
import android.widget.TextView import android.widget.TextView
import androidx.fragment.app.FragmentActivity import androidx.fragment.app.FragmentActivity
import com.alibaba.android.arouter.launcher.ARouter
import com.google.android.material.bottomsheet.BottomSheetBehavior import com.google.android.material.bottomsheet.BottomSheetBehavior
import com.google.android.material.bottomsheet.BottomSheetDialog import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.bottomsheet.BottomSheetDialogFragment import com.google.android.material.bottomsheet.BottomSheetDialogFragment
...@@ -31,6 +32,7 @@ import com.ydl.ydlnet.YDLHttpUtils ...@@ -31,6 +32,7 @@ import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.common.tools.LogUtil import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxImageTool 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.user.api.service.IUserService import com.yidianling.user.api.service.IUserService
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers import io.reactivex.schedulers.Schedulers
...@@ -60,6 +62,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -60,6 +62,7 @@ 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
lateinit var uid:String
fun showBottomSheetDialog( fun showBottomSheetDialog(
activity: FragmentActivity, activity: FragmentActivity,
jumpUrl: String, jumpUrl: String,
...@@ -208,11 +211,13 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -208,11 +211,13 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
} }
} }
} }
fun updateChange(doctorId: String,title:String){ fun updateChange(doctorId: String,title:String,uid: String){
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 )})")
} }
@SuppressLint("ClickableViewAccessibility") @SuppressLint("ClickableViewAccessibility")
private fun webViewInit(wv_content: ProgressWebView) { private fun webViewInit(wv_content: ProgressWebView) {
...@@ -242,6 +247,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -242,6 +247,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
var url = WebUrlParamsUtils.getSuffix(jumpurl, jtoJHandle.getUriAppendSuffix()) var url = WebUrlParamsUtils.getSuffix(jumpurl, jtoJHandle.getUriAppendSuffix())
LogUtil.e("AAA" + url) LogUtil.e("AAA" + url)
wv_content.loadUrl(url) wv_content.loadUrl(url)
// wv_content.loadUrl(jumpUrl) // wv_content.loadUrl(jumpUrl)
wv_content.setOnTouchListener { p0, p1 -> //canScrollVertically(-1)的值表示是否能向下滚动,false表示已经滚动到顶部 wv_content.setOnTouchListener { p0, p1 -> //canScrollVertically(-1)的值表示是否能向下滚动,false表示已经滚动到顶部
if (!wv_content.canScrollVertically(-1)) { if (!wv_content.canScrollVertically(-1)) {
...@@ -264,6 +270,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -264,6 +270,7 @@ 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 wv_content.progressbar.visibility = View.GONE
callJsFun(wv_content,"setUnRead(${getUnReadByUid(uid =uid )})")
} else { } else {
if (wv_content.progressbar.visibility == View.GONE) { if (wv_content.progressbar.visibility == View.GONE) {
wv_content.progressbar.visibility = View.VISIBLE wv_content.progressbar.visibility = View.VISIBLE
...@@ -304,7 +311,9 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() { ...@@ -304,7 +311,9 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
} }
} }
} }
fun getUnReadByUid(uid:String):Int{
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)
......
...@@ -270,7 +270,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo ...@@ -270,7 +270,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
} }
} }
fun onEventMainThread(event: ChangeAnotherExpertEvent) { fun onEventMainThread(event: ChangeAnotherExpertEvent) {
bottomSheetDialogFragment.updateChange(event.doctorID,event.title) bottomSheetDialogFragment.updateChange(event.doctorID,event.title,event.uid)
} }
private fun initView() { private fun initView() {
img_back.setOnClickListener { img_back.setOnClickListener {
......
...@@ -2,5 +2,6 @@ package com.ydl.confide.home.event ...@@ -2,5 +2,6 @@ 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
) )
\ No newline at end of file
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