Commit 79dbb056 by 霍志良

feat:首页咨询.理解模块,8-10点跳转自主,其他时间跳转导医

parent ab00ce0f
......@@ -6,10 +6,10 @@ ext {
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.48.74",
"m-consultant" : "0.0.59.34",
"m-consultant" : "0.0.59.35",
"m-fm" : "0.0.30.00",
"m-user" : "0.0.60.26",
"m-home" : "0.0.22.31",
"m-home" : "0.0.22.32",
"m-im" : "0.0.18.16",
"m-dynamic" : "0.0.7.13",
"m-article" : "0.0.0.6",
......@@ -21,7 +21,7 @@ ext {
//-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.6",
"m-confide-api" : "0.0.2.1",
"m-consultant-api": "0.0.5.4",
"m-consultant-api": "0.0.5.6",
"m-course-api" : "0.0.3.6",
"m-fm-api" : "0.0.3",
"m-muse-api" : "0.0.1",
......@@ -90,10 +90,10 @@ ext {
//第三步 若干
"m-confide" : "0.0.41.3",
"m-consultant" : "0.0.51.13",
"m-consultant" : "0.0.51.16",
"m-fm" : "0.0.23.5",
"m-user" : "0.0.41.5",
"m-home" : "0.0.6.26",
"m-home" : "0.0.6.27",
"m-im" : "0.0.3.10",
"m-dynamic" : "0.0.1.7",
......@@ -103,7 +103,7 @@ ext {
//-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.6",
"m-confide-api" : "0.0.2.1",
"m-consultant-api": "0.0.5.4",
"m-consultant-api": "0.0.5.6",
"m-course-api" : "0.0.3.6",
"m-fm-api" : "0.0.3",
"m-muse-api" : "0.0.1",
......
......@@ -13,6 +13,7 @@ import com.yidianling.consultant.model.bean.ExpertSearchBean
import com.yidianling.consultant.model.bean.HeadData
import io.reactivex.Observable
import retrofit2.http.*
import kotlin.reflect.jvm.internal.impl.load.kotlin.JvmType
/**
......@@ -76,4 +77,12 @@ interface SearchApi {
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
@GET("testGeneral/daoyi/setting")
fun getGuideData(): Observable<BaseAPIResponse<Map<String, List<GuideBean>>>>
//8-22点跳自主,其他时间跳导医,
// 0 自主默认
//1 自主
//2 导医
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA, "Content-Type:application/json")
@GET("consult/assistant/chat-time-setting")
fun getJumpTypeRequest(): Observable<BaseAPIResponse<Int>>
}
\ No newline at end of file
......@@ -10,6 +10,7 @@ import com.alibaba.android.arouter.facade.annotation.Route
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.yidianling.common.tools.LogUtil
import com.yidianling.consultant.ExpertSearchActivity
import com.yidianling.consultant.ExpertSearchFragment
import com.yidianling.consultant.api.IConsultantService
......@@ -117,6 +118,10 @@ class ConsultantServiceImp : IConsultantService {
ConsultAssistantEntryUtils.jumpConsultAssistant(activity,location)
}
override fun dueToTypeJumpAutoOrGuide(activity: Activity, location: Int, doctorId: Int,url:String) {
ConsultAssistantEntryUtils.getTypeJump(activity,location,doctorId,url)
}
override fun resetConsultAssistantDialogStatus() {
ConsultAssistantDialogUtils.INSTANCE.resetStatus()
}
......
......@@ -3,8 +3,13 @@ package com.yidianling.consultant.modular.utils
import android.annotation.SuppressLint
import android.app.Activity
import android.support.v7.app.AppCompatActivity
import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydl_router.manager.YDLRouterParams
import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.utils.Utils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.ConsultAssistantCenterActivity
import com.yidianling.consultant.constants.ConsultBIConstants
......@@ -48,5 +53,65 @@ class ConsultAssistantEntryUtils {
}
}
/*
* 根据Type0,1跳自主,2跳导医
* 在跳自主的(type=1)情况下,点击item是跳专家详情页
*
* */
@SuppressLint("CheckResult")
fun getTypeJump(activity: Activity, location: Int,doctorUid:Int,url:String?){
SearchApi.getSearchApi().getJumpTypeRequest()
.subscribeOn((Schedulers.io()))
.observeOn(AndroidSchedulers.mainThread())
.subscribe (Consumer {
when(it.code){
"200"->{
when(it.data){
0->{
jumpToAutoTalk(activity, doctorUid)
}
1->{
if (url.isNullOrEmpty()){
jumpToAutoTalk(activity, doctorUid)
}else{
if (url.startsWith("http")) {
YDLRouterManager.router(
IYDLRouterConstant.ROUTER_H5_H5,
YDLRouterParams().putExtra(IYDLRouterConstant.EXTRA_URL, url), ""
)
} else {
YDLRouterManager.router(url)
}
}
}
2->{
jumpConsultAssistant(activity,location)
}
else->{
jumpToAutoTalk(activity, doctorUid)
LogUtil.e(it.data.toString())
}
}
}
else->{
ToastUtil.toastShort(it.code)
}
}
},object:ThrowableConsumer(){
override fun accept(msg: String) {
ToastUtil.toastShort(msg)
}
})
}
private fun jumpToAutoTalk(activity: Activity, doctorUid: Int) {
ConsultantIn.startP2PSession(
activity as AppCompatActivity,
doctorUid.toString()
)
}
}
}
\ No newline at end of file
......@@ -40,4 +40,7 @@ interface IConsultantService: IProvider {
fun requestGuideData()
fun jumpConsultAssistant(activity: Activity, location:Int)
//根据返回Type跳转自主或者导医
fun dueToTypeJumpAutoOrGuide(activity: Activity, location:Int,doctorId:Int,url:String)
}
\ No newline at end of file
......@@ -11,9 +11,12 @@ import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.utils.StringUtils
import com.ydl.ydlcommon.utils.URLUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxImageTool
import com.yidianling.consultant.api.IConsultantService
import com.yidianling.home.R
import com.yidianling.home.constants.HomeBIConstants
import com.yidianling.home.event.IHomeBaseEvent
import com.yidianling.home.model.bean.HomeConsultBean
import kotlinx.android.synthetic.ydl.home_consult_item_view.view.*
......@@ -64,10 +67,21 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
// val url = URLUtils.appendParmas(bean.linkUrl,"cateId",cateId)
// homeEvent!!.consultItemClick(url,bean.doctorId)
ModularServiceManager.provide(IConsultantService::class.java).jumpConsultAssistant(
/*ModularServiceManager.provide(IConsultantService::class.java).jumpConsultAssistant(
mContext as Activity,
11
)*/
//补充点击事件埋点
ActionCountUtils.count(HomeBIConstants.YDL_USER_EXPERT_INTRODUCTION_CLICK, bean.uid.toString())
val url = URLUtils.appendParmas(bean.linkUrl,"cateId",cateId)
ModularServiceManager.provide(IConsultantService::class.java).dueToTypeJumpAutoOrGuide(
mContext as Activity,
11,
bean.uid,
url
)
/*val url = URLUtils.appendParmas(bean.linkUrl,"cateId",cateId)
homeEvent!!.consultItemClick(url,bean.uid.toString())*/
}
}
......@@ -122,9 +136,16 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
private fun setConfideButton(bodyBean: HomeConsultBean.ListBean) {
tv_consult_chat.setOnClickListener {
// homeEvent!!.consultChatClick(bodyBean.uid.toString())
ModularServiceManager.provide(IConsultantService::class.java).jumpConsultAssistant(
/*ModularServiceManager.provide(IConsultantService::class.java).jumpConsultAssistant(
mContext as Activity,
11
)*/
ModularServiceManager.provide(IConsultantService::class.java).dueToTypeJumpAutoOrGuide(
mContext as Activity,
11,
bodyBean.uid,
""
)
}
}
......
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