Commit c9e642e5 by 徐健

增加咨询模块的导医代码

parent 3c78d0a1
......@@ -117,6 +117,7 @@ android {
signingConfig signingConfigs.ydl
}
xlzx {
applicationId rootProject.ext.xlzx_app["applicationId"]
versionName rootProject.ext.xlzx_app["versionName"]
......@@ -170,6 +171,7 @@ dependencies {
implementation modularPublication('com.ydl:m-user-api')
// api project(':m-tests')
api project(':m-consultant')
implementation modularPublication('com.ydl:m-consultant-api')
// api project(':m-confide')
api (project(':ydl-platform')){
transitive = true
......
......@@ -16,7 +16,7 @@ import com.umeng.analytics.MobclickAgent
import com.ydl.component.music.MusicPlayActivity
import com.ydl.component.mvp.DemoContract
import com.ydl.component.mvp.DemoPresenter
import com.ydl.confide.home.ConfideHomeActivity
//import com.ydl.confide.home.ConfideHomeActivity
import com.ydl.media.audio.PlayService
import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydl_router.manager.YDLRouterParams
......@@ -24,6 +24,8 @@ import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.mvp.lce.BaseLceActivity
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.ExpertSearchActivity.Companion.HOT_SEARCH_DOCTOR_NAME
import com.yidianling.consultant.api.IConsultantService
import com.yidianling.fm.api.service.IFMService
//import com.yidianling.tests.home.TestHomeActivity
import kotlinx.android.synthetic.main.activity_main.*
......@@ -76,15 +78,15 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
.withBoolean("isFromGuide", true)
.navigation()
}
// bt_to_consultant.setOnClickListener {
// ARouter.getInstance()
// .build("/consult/hot_search")
// .withString(
// HOT_SEARCH_DOCTOR_NAME,
// this.resources?.getString(R.string.platform_search_hint)
// )
// .navigation()
// }
bt_to_consultant.setOnClickListener {
ARouter.getInstance()
.build("/consult/hot_search")
.withString(
HOT_SEARCH_DOCTOR_NAME,
this.resources?.getString(R.string.platform_search_hint)
)
.navigation()
}
bt_to_music.setOnClickListener {
startActivity(Intent(this, MusicPlayActivity::class.java))
}
......@@ -92,7 +94,7 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
// startActivity(Intent(this, TestHomeActivity::class.java))
}
bt_to_confide.setOnClickListener {
startActivity(Intent(this, ConfideHomeActivity::class.java))
// startActivity(Intent(this, ConfideHomeActivity::class.java))
}
bt_to_muse.setOnClickListener {
YDLRouterManager.router(IYDLRouterConstant.ROUTER_MUSE,
......@@ -128,7 +130,6 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
}
override fun reLoadData() {
mPresenter?.loadUsers()
}
......@@ -168,6 +169,8 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
override fun onResume() {
super.onResume()
MobclickAgent.onResume(this)
ModularServiceManager.provide(IConsultantService::class.java).showConsultAssistantDialog(this)
}
......
ext {
kotlin_version = '1.3.21'
dev_mode = true
dev_mode = false
ydl_app = [
appName : "心理咨询壹点灵",
......
......@@ -15,7 +15,7 @@ modular {
groupId = "com.ydl"
artifactId = "m-consultant-module-ydl"
// 上报的 壹点灵 业务模块 aar 包的版本号
version = "0.0.14"
version = "0.0.15"
}
}
......@@ -24,7 +24,7 @@ modular {
groupId = "com.ydl"
artifactId = "m-consultant-api"
//开发时注释掉版本号,发布api时打开
//version = "0.0.1"
version = "0.0.1"
// API 层打包时需要引入的依赖
apiDependencies {
implementation "com.google.code.gson:gson:2.8.2"
......
......@@ -1477,7 +1477,8 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
//todo xujian 条件添加完整
if (ConsultantIn.isLogin() &&
ConsultantIn.getUserImpl().getUserInfo()?.user_type == 1
/** && YdlDataManager.getRam().getChannelName() == "android_huawei"*/) {
/** WalleChannelReader.getChannel(BaseApp.Companion.getApp()) == "android_huawei" */
) {
getPresenter().requestConsultAssistantBtnShown()
}
......
package com.yidianling.consultant.modular
import android.app.Activity
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.yidianling.consultant.api.IConsultantService
import com.yidianling.consultant.modular.singlton.ConsultAssistantDialogUtils
/**
* Created by xj on 2019/11/14.
*/
@Route(path = "/consultant/ConsultantService")
class ConsultantServiceImp: IConsultantService {
override fun init(context: Context?) {
}
override fun showConsultAssistantDialog(activity: Activity) {
ConsultAssistantDialogUtils.INSTANCE.showDialog(activity)
}
override fun hideConsultAssistantDialog() {
ConsultAssistantDialogUtils.INSTANCE.hideDialog()
}
}
\ No newline at end of file
package com.yidianling.consultant.modular.singlton
import android.app.Activity
import android.content.Context
import android.support.v7.app.AppCompatActivity
import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.dialog.ConsultAssistantDialog
import com.yidianling.consultant.model.SearchApi
import com.yidianling.consultant.router.ConsultantIn
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
/**
* Created by xj on 2019/11/14.
*/
class ConsultAssistantDialogUtils private constructor(){
companion object {
val INSTANCE by lazy { ConsultAssistantDialogUtils() }
}
var consultAssistantDialog: ConsultAssistantDialog? = null
fun showDialog(activity: Activity) {
if (consultAssistantDialog == null) {
consultAssistantDialog = ConsultAssistantDialog(activity, object : ConsultAssistantDialog.OnConsultAssistantClickListener {
override fun onClickAction() {
//获取用户uid
getConsultAssistantUid(activity)
}
})
}
consultAssistantDialog!!.show()
}
fun hideDialog() {
consultAssistantDialog?.dismiss()
consultAssistantDialog = null
}
private fun getConsultAssistantUid(activity: Activity) {
SearchApi.getSearchApi().getConsultAssistantUidRequest()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe{
if (it.code == "200" && it.data != 0.toLong()) {
ConsultantIn.startP2PSession(activity as AppCompatActivity, it.data.toString())
}else {
ToastUtil.toastShort("咨询助理忙碌中,请稍后再试")
}
}
}
}
\ No newline at end of file
package com.yidianling.consultant.api
import android.app.Activity
import com.alibaba.android.arouter.facade.template.IProvider
/**
* Created by xj on 2019/11/14.
*/
interface IConsultantService: IProvider {
// 显示咨询助理弹框
fun showConsultAssistantDialog(activity: Activity)
// 隐藏咨询助理弹框
fun hideConsultAssistantDialog()
}
\ 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