Commit af04c26c by 万齐军

Merge branch 'feat/qj/confide2' into 'd/v_confide_2.0'

Feat/qj/confide2

See merge request app_android_lib/YDL-Component!71
parents 5c68892b cd1b3800
......@@ -5,7 +5,7 @@ ext {
ydlPublishVersion = [
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.49.86",
"m-confide" : "0.0.49.88",
"m-consultant" : "0.0.60.27",
"m-fm" : "0.0.30.09",
"m-user" : "0.0.62.18",
......@@ -90,7 +90,7 @@ ext {
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.49.86",
"m-confide" : "0.0.49.88",
"m-consultant" : "0.0.60.27",
"m-fm" : "0.0.30.09",
"m-user" : "0.0.62.18",
......
......@@ -58,6 +58,8 @@ import kotlinx.android.synthetic.main.confide_title_bar.*
@Route(path = ConfideRoute.R_CONFIDE_HOME)
class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHomeContract.Presenter>(),IConfideHomeContract.View,XRecyclerView.LoadingListener {
private var listenFree = false
override fun getContentViewId(): Int {
return R.id.rv_list
}
......@@ -208,12 +210,18 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
override fun onResume() {
super.onResume()
handleFree()
}
private fun handleFree() {
//登录了回来之后就不显示了
val isLogin = (findRouteService(IUserService::class.java).isLogin())
findViewById<View>(R.id.confide_Free).visibility = if (isLogin) View.GONE else View.VISIBLE
if (isLogin) {
findViewById<View>(R.id.confideRed).visibility = if (listenFree) View.VISIBLE else View.GONE
}
}
/**
* 初始化状态栏位置
*/
......@@ -250,7 +258,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
super.onScrolled(recyclerView, dx, dy)
if (dy>=0){
if (dy<=0){
//向上滚动恢复显示
quick_consult_card.visibility = View.VISIBLE
}else{
......@@ -463,6 +471,10 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
// rv_list.loadMoreComplete()
// }
mConfideAdapter!!.notifyDataSetChanged()
if (!bean.body.isNullOrEmpty()) {
listenFree = bean.body[0].listenFree ?: false
handleFree()
}
}
/**
......
......@@ -2,6 +2,7 @@ package com.ydl.confide.home.modular.service
import android.annotation.SuppressLint
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.text.TextUtils
......@@ -26,6 +27,7 @@ import com.yidianling.ydl_pay.pay.payDialog.CallBack
import com.yidianling.ydl_pay.pay.payDialog.ConfidePayParams
import com.yidianling.ydl_pay.pay.payDialog.PayDialog
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers
/**
......@@ -157,9 +159,47 @@ class ConfideWebServiceImpl {
})
}
fun connectionJava(
id: Int,
type: Int,
activity: Context,
callType: String?,
otherwise: (() -> Unit)? = null
): Disposable {
Loading.show(activity)
return ConfideHomeDataManager.getHttp()
.connectionJava(ConnectParamJava("" + id, "" + type, callType))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({
Loading.close()
if ("200" == it.code && 0 == it.data?.dialDetail?.dialStatus && it.data?.dialDetail?.callConnectType == 3) {
it.data?.dialDetail?.agoraExpertInfo ?: return@subscribe
if (!YDLavManager.isOnlineRtm) { // 判断如果账号在其它设备登录rtm是否在线
ToastUtil.toastShort("网络通话错误代码001")
return@subscribe
}
callAgora(
activity,
id,
it.data!!.dialDetail!!.agoraExpertInfo!!,
it.data.callId ?: "0",
it.data.listenOrderId ?: 0L,
null,
it.data.isShowAxb,
it.data?.dialDetail?.dialStatus.toString()
)
} else {
otherwise?.invoke()
}
}, {
ToastHelper.show(it.message ?: "连接失败")
})
}
//启动声网电话
private fun callAgora(
activity: Activity,
activity: Context,
confideId: Int,
expertInfo: ExpertInfoBean,
call_id: String,
......@@ -182,7 +222,7 @@ class ConfideWebServiceImpl {
expertInfo.remainingTime =
ExpertInfoBean.ListenRemainingTime(expertInfo.totalDuration);
}
YDLavManager.instances.callEventSave("10","用户点击拨打",expertInfo.channelId,"7")
YDLavManager.instances.callEventSave("10", "用户点击拨打", expertInfo.channelId, "7")
Loading.close()
ARouter.getInstance().build("/av/AudioHomeActivity")
.withString(IntentConstants.INTENT_EXPERT_HEAD_URL, expertInfo.expertHeadUrl)
......
......@@ -15,6 +15,7 @@ import com.ydl.confide.api.ConfideRoute
import com.ydl.confide.databinding.ItemExpertIntroBinding
import com.ydl.confide.home.ConfideBottomSheetDialogFragment
import com.ydl.confide.home.bean.ConfideHomeBodyBean
import com.ydl.confide.home.modular.service.ConfideWebServiceImpl
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.modular.findRouteService
import com.ydl.ydlcommon.utils.LogUtil
......@@ -57,7 +58,12 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
if (item.isVideo) "1" else "2",
"6"
)
showDoctorDetail(item)
if (!item.confideId.isNullOrBlank()) {
ConfideWebServiceImpl().connectionJava(item.confideId!!.toInt(), 3, it.context as Activity, null) {
showDoctorDetail(item)
}
}
// showDoctorDetail(item)
}
binding.btnChat.setOnClickListener {
val aty = it.context as? Activity
......
......@@ -89,6 +89,15 @@
android:textSize="13sp"
android:drawableRight="@drawable/confide_right_arrow" />
<ImageView
android:id="@+id/confideRed"
android:layout_width="@dimen/platform_dp_40"
android:layout_height="@dimen/confide_dp_25"
android:layout_gravity="right|top"
android:visibility="gone"
android:layout_marginEnd="10dp"
android:src="@drawable/confide__free" />
<TextView
android:id="@+id/confide_Free"
android:layout_width="wrap_content"
......
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