Commit e9d92d27 by 严久程

Merge branch 'feature/v3' of…

Merge branch 'feature/v3' of ssh://gitlab.yidianling.com:2224/app_android_lib/YDL-Component into feature/v3
parents a9c32924 79079b9e
......@@ -183,10 +183,11 @@ dependencies {
implementation project(':m-tests')
implementation project(':m-consultant')
implementation modularPublication('com.ydl:m-consultant-api')
implementation project(':m-confide')
// implementation project(':m-confide')
api project(':m-home')
// api project(':m-confide')
// api "com.ydl:m-consultant-api:0.0.2"
// api 'com.ydl:m-consultant-module-ydl:0.0.18@aar'
......@@ -201,7 +202,7 @@ dependencies {
implementation project(':m-muse')
// implementation project(':m-muse')
implementation project(':m-im')
implementation project(':m-dynamic')
......
......@@ -10,6 +10,7 @@ import android.net.Uri
import android.os.IBinder
import android.provider.Settings
import android.util.Log
import android.widget.LinearLayout
import com.alibaba.android.arouter.launcher.ARouter
import com.tbruyelle.rxpermissions2.RxPermissions
import com.umeng.analytics.MobclickAgent
......@@ -17,6 +18,7 @@ import com.ydl.component.home.HomeActivity
import com.ydl.component.music.FragmentContainerActivity
import com.ydl.component.mvp.DemoContract
import com.ydl.component.mvp.DemoPresenter
//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
......
......@@ -190,6 +190,6 @@
<com.ydl.ydlcommon.mvp.lce.view.YDLStateView
android:id="@+id/lce_state_view"
android:layout_width="match_parent"
android:layout_height="300dp" />
android:layout_height="30dp" />
</LinearLayout>
\ No newline at end of file
......@@ -43,40 +43,41 @@ ext {
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.40.1",
"m-consultant" : "0.0.50.1",
"m-fm" : "0.0.23.1",
"m-user" : "0.0.40.1",
"m-home" : "0.0.6.3",
"m-muse" : "0.0.20.1",
"m-tests" : "0.0.15.1",
"m-course" : "0.0.34.1",
"m-im" : "0.0.2",
"m-dynamic" : "0.0.1",
"m-confide" : "0.0.41.1",
"m-consultant" : "0.0.51.1",
"m-fm" : "0.0.23.3",
"m-user" : "0.0.40.3",
"m-home" : "0.0.6.6",
"m-muse" : "0.0.20.3",
"m-tests" : "0.0.15.2",
"m-course" : "0.0.34.3",
"m-im" : "0.0.3.1",
"m-dynamic" : "0.0.1.1",
//-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.5",
"m-confide-api" : "0.0.1",
"m-confide-api" : "0.0.1.1",
"m-consultant-api": "0.0.4",
"m-course-api" : "0.0.2",
"m-fm-api" : "0.0.2",
"m-muse-api" : "0.0.1",
"m-tests-api" : "0.0.1",
"m-user-api" : "0.0.8",
"m-user-api" : "0.0.9",
"m-home-api" : "0.0.3",
"m-im-api" : "0.0.2",
"m-im-api" : "0.0.3",
"m-dynamic-api" : "0.0.1",
//-------------- 功能组件 --------------
//第一步
"ydl-platform" : "0.0.28.7",
"ydl-platform" : "0.0.29.1",
//第二步 若干
"ydl-webview" : "0.0.28.2",
"ydl-media" : "0.0.14.2",
"ydl-pay" : "0.0.11.3",
"m-audioim" : "0.0.40.2",
"ydl-webview" : "0.0.28.4",
"ydl-media" : "0.0.14.3",
"ydl-pay" : "0.0.11.4",
"m-audioim" : "0.0.40.3",
//以下 几乎不会动
"router" : "0.0.1",
......@@ -89,7 +90,7 @@ ext {
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.40",
"m-consultant" : "0.0.26",
"m-consultant" : "0.0.28",
"m-course" : "0.0.22",
"m-fm" : "0.0.15",
"m-user" : "0.0.25",
......@@ -102,26 +103,26 @@ ext {
"m-tests" : "0.0.4",
//-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.5",
"m-confide-api" : "0.0.1",
"m-confide-api" : "0.0.1.1",
"m-consultant-api": "0.0.4",
"m-course-api" : "0.0.2",
"m-fm-api" : "0.0.2",
"m-muse-api" : "0.0.1",
"m-tests-api" : "0.0.1",
"m-user-api" : "0.0.8",
"m-user-api" : "0.0.9",
"m-home-api" : "0.0.3",
"m-im-api" : "0.0.2",
"m-im-api" : "0.0.3",
"m-dynamic-api" : "0.0.1",
//-------------- 功能组件 --------------
//第一步
"ydl-platform" : "0.0.28.7",
"ydl-platform" : "0.0.29.1",
//第二步 若干
"ydl-webview" : "0.0.28.2",
"ydl-media" : "0.0.14.2",
"ydl-pay" : "0.0.11.3",
"m-audioim" : "0.0.40.2",
"ydl-webview" : "0.0.28.3",
"ydl-media" : "0.0.14.3",
"ydl-pay" : "0.0.11.4",
"m-audioim" : "0.0.40.3",
//以下 几乎不会动
......@@ -288,6 +289,8 @@ ext {
"ydl-m-home-api" : "com.ydl:m-home-api:${ydlCompileVersion["m-home-api"]}",
"ydl-m-consultant-api" : "com.ydl:m-consultant-api:${ydlCompileVersion["m-consultant-api"]}",
"ydl-m-dynamic-api" : "com.ydl:m-dynamic-api:${ydlCompileVersion["m-dynamic-api"]}",
"ydl-m-confide-api" : "com.ydl:m-confide-api:${ydlCompileVersion["m-confide-api"]}",
"ydl-m-course-api" : "com.ydl:m-course-api:${ydlCompileVersion["m-course-api"]}",
]
}
......@@ -163,6 +163,8 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi
//频道管理器
private var channelManager : ChannelManager? = null
private var isLeavelChannel:Boolean = false
/**
* 声网事件回调 (SDK 通过指定的事件通知应用程序 SDK 的运行事件,如: 加入或离开频道,新用户加入频道等)
*/
......@@ -917,7 +919,7 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi
channelId
)
var cmd = NoticePushCommand()
cmd.data = Gson().toJson(msgBean)
cmd.data = msgBean
cmd.pushId = listenerUid
if (isCall) {
cmd.status = "CALL"
......@@ -932,11 +934,14 @@ class AudioHomeActivity : BaseMvpActivity<IAudioHomeActivityContract.View, IAudi
* 声网离开频道
*/
private fun leaveChannel() {
//刷新h5页面
EventBus.getDefault().post(RefreshWebEvent(false))
stopPlaying()
//播放结束音频
playFinishMusic()
if (!isLeavelChannel) {
isLeavelChannel = true
//刷新h5页面
EventBus.getDefault().post(RefreshWebEvent(false))
stopPlaying()
//播放结束音频
playFinishMusic()
}
}
override fun onResume() {
......
......@@ -50,7 +50,8 @@ interface AudioNetAPi {
/**
*通知服务端发送推送
*/
@POST("api/push/notify/doctor")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA,"Content-Type:application/json")
@POST("push/notify/doctor")
fun noticeServerPush(@Body body: RequestBody): Observable<BaseResponse<Any>>
/**
......
package com.ydl.audioim.http.command;
import com.ydl.ydl_av.chat.bean.AudioMessageBean;
import com.ydl.ydlcommon.data.http.BaseCommand;
/**
......@@ -11,7 +12,7 @@ import com.ydl.ydlcommon.data.http.BaseCommand;
* @date 2018/11/17
*/
public class NoticePushCommand extends BaseCommand {
public String data;//AudioMessageBean的字符串
public AudioMessageBean data;//AudioMessageBean的字符串
public String pushId;//专家uid
public String status;//CALL 呼叫 CALL_OFF 取消呼叫
public String title = "您有一条倾诉消息";
......
......@@ -85,6 +85,9 @@ dependencies {
api project(':ydl-media')
api project(':ydl-platform')
api project(':m-audioim')
implementation modularPublication('com.ydl:m-im-api')
implementation modularPublication('com.ydl:m-user-api')
implementation modularPublication('com.ydl:m-confide-api')
}else {
//发布时使用
api rootProject.ext.dependencies["ydl-media"]
......@@ -92,5 +95,8 @@ dependencies {
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-confide-api"]
}
}
......@@ -24,6 +24,7 @@ import com.ydl.confide.home.listener.ConfideHomeRecycleViewListener
import com.ydl.confide.home.listener.ConfideHomeRecyleSuspendListener
import com.ydl.confide.home.presenter.ConfideHomePresenterImpl
import com.ydl.confide.home.util.ConfideHomeUtils
import com.ydl.confide.router.PhoneCallIn
import com.ydl.ydl_image.listener.YDLImageRecyclerOnScrollListener
import com.ydl.ydlcommon.mvp.lce.BaseLceActivity
import com.ydl.ydlcommon.utils.StatusBarUtils
......@@ -31,7 +32,6 @@ import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.ydl.ydlcommon.view.DrawableRightTextView
import com.ydl.ydlcommon.view.WrapContentLinearLayoutManager
import com.yidianling.common.tools.RxImageTool
import com.yidianling.router.RouterManager
import kotlinx.android.synthetic.main.confide_home_activity.*
import kotlinx.android.synthetic.main.confide_title_bar.*
......@@ -523,8 +523,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
override fun onBackPressed() {
if (isSplash) {
//跳转主页
var int = RouterManager.getAppRouter()?.mainIntent(this)
startActivity(int)
PhoneCallIn.getAppService().mainIntent(this)
}
super.onBackPressed()
}
......
......@@ -8,9 +8,6 @@ import android.support.v7.app.AppCompatActivity
import android.text.TextUtils
import android.view.View
import com.ydl.confide.home.ConfideHomeActivity
import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydl_router.manager.YDLRouterParams
import com.yidianling.common.tools.ToastUtil
import com.ydl.confide.home.adapter.ConfideHomeAdapter
import com.ydl.confide.home.bean.ConfideHomeAllFiltersBean
import com.ydl.confide.home.bean.ConfideHomeBodyBean
......@@ -27,11 +24,13 @@ import com.ydl.media.audio.AudioPlayer
import com.ydl.media.audio.model.Music
import com.ydl.media.view.PlayerFloatHelper
import com.ydl.media.view.PlayerFloatView
import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydl_router.manager.YDLRouterParams
import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.yidianling.router.RouterManager
import com.yidianling.router.im.IMRequestCallback
import com.yidianling.common.tools.ToastUtil
import com.yidianling.im.api.bean.IMRequestCallback
/**
* @author yuanwai
......@@ -267,7 +266,8 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo
if (mContext is AppCompatActivity && !TextUtils.isEmpty(doctorId)) {
PhoneCallIn.startChat(mContext as AppCompatActivity, doctorId!!, 0x001, 0)
}
RouterManager.getImRouter().createTextMessage(doctorId, "你好,我想找你倾诉,请尽快上线私聊我,我在等你。", object : IMRequestCallback<Void> {
PhoneCallIn.getImService().createTextMessage(doctorId, "你好,我想找你倾诉,请尽快上线私聊我,我在等你。", object :
IMRequestCallback<Void> {
override fun onSuccess(aVoid: Void?) {
(mContext as BaseActivity).dismissProgressDialog()
ToastHelper.show("发送成功")
......
package com.ydl.confide.router
package com.ydl.confide.home.modular.service
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.support.v4.app.DialogFragment
import com.alibaba.android.arouter.facade.annotation.Route
import com.ydl.confide.api.IConfideService
import com.ydl.confide.home.ConfideHomeActivity
import com.yidianling.router.phoneCall.IPhoneCallRouter
class PhoneCallImp : IPhoneCallRouter {
/**
* Created by haorui on 2019-12-11 .
* Des:
*/
@Route(path = "/confide/ConfideService")
class ConfdieServiceImpl : IConfideService {
override fun init(context: Context?) {
}
override fun phoneCallFragment(head: String, callId: String): DialogFragment {
//废弃
return DialogFragment()
......@@ -21,15 +33,15 @@ class PhoneCallImp : IPhoneCallRouter {
override fun openConfideHome(context: Context) {
val intent = Intent(context, ConfideHomeActivity::class.java)
if (context !is Activity){
if (context !is Activity) {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
}
context.startActivity(intent)
}
override fun closePlayer() {
// if (MyPlayer.isStart()) {
// MyPlayer.getInstance().releaseMedia()
// }
}
}
\ No newline at end of file
......@@ -3,7 +3,10 @@ package com.ydl.confide.router
import android.app.Activity
import android.content.Intent
import android.support.v7.app.AppCompatActivity
import com.yidianling.router.RouterManager
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.yidianling.im.api.service.IImService
import com.yidianling.user.api.service.IAppService
import com.yidianling.user.api.service.IUserService
/**
* author : Zhangwenchao
......@@ -12,77 +15,31 @@ import com.yidianling.router.RouterManager
*/
object PhoneCallIn {
fun isLogin(): Boolean {
return RouterManager.getUserRouter()?.isLogin()?:false
}
fun rechargeIntent(activity: Activity): Intent? {
return RouterManager.getAppRouter()?.rechargeIntent(activity)
fun getImService(): IImService {
return ModularServiceManager.provide(IImService::class.java)
}
fun inputPhoneIntent(activity: Activity, smsAction: String): Intent? {
return RouterManager.getUserRouter()?.inputPhoneIntent(activity, smsAction)
fun getAppService(): IAppService {
return ModularServiceManager.provide(IAppService::class.java)
}
fun loginWayIntent(activity: Activity): Intent? {
return RouterManager.getUserRouter()?.loginWayIntent(activity)
fun getUserService(): IUserService {
return ModularServiceManager.provide(IUserService::class.java)
}
fun publishTrendIntent(activity: Activity, url: String, cover: String, title: String): Intent? {
return RouterManager.getDynamicRouter()?.publishTrendIntent(activity, url, cover, title)
}
fun myRedPacketIntent(activity: Activity): Intent? {
return RouterManager.getAppRouter()?.myRedPockIntent(activity)
}
fun fmDetailIntent(activity: Activity, fmId: Int): Intent? {
return RouterManager.getFMRouter()?.fmDetailIntent(activity, fmId)
}
fun isFmPlaying(): Boolean {
return RouterManager.getFMRouter()?.isPlaying() ?: false
}
fun isCoursePlaying(): Boolean {
return RouterManager.getCourseRouter()?.isPlaying() ?: false
}
fun getFmId(): Int {
return RouterManager.getFMRouter()?.getFmId() ?: 0
}
/**
* 课程播放页
*/
fun startCoursePlayPage(activity: Activity){
RouterManager.getCourseRouter()?.startCoursePlayPage(activity,1)
}
fun playCourse(){
if (!isCoursePlaying()){
RouterManager.getCourseRouter()?.play()
}
}
fun pauseCourse(){
if (isCoursePlaying()){
RouterManager.getCourseRouter()?.pause()
}
fun isLogin(): Boolean {
return getUserService()?.isLogin()?:false
}
fun rePlayFM(){
RouterManager.getFMRouter()?.replay()
}
fun pauseFm(){
RouterManager.getFMRouter()?.pause()
fun loginWayIntent(activity: Activity): Intent? {
return getUserService()?.loginWayIntent(activity)
}
/**
* 私聊
*/
fun startChat(context: AppCompatActivity, toUid: String, flag: Int, canTalk: Int) {
RouterManager.getImRouter().startChat(context,toUid,flag,canTalk)
getImService().startChat(context,toUid,flag,canTalk)
}
}
\ No newline at end of file
package com.ydl.confide.api
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.support.v4.app.DialogFragment
import com.alibaba.android.arouter.facade.template.IProvider
interface IPhoneCallRouter{
interface IConfideService : IProvider {
fun phoneCallIntent(activity: Activity): Intent
fun phoneCallFragment(head: String, callId: String): DialogFragment
fun closePlayer()
......
......@@ -73,11 +73,13 @@ dependencies {
if (rootProject.ext.dev_mode){
//开发时使用
implementation modularPublication('com.ydl:m-user-api')
implementation modularPublication('com.ydl:m-im-api')
api project(":ydl-webview")
api project(":ydl-platform")
} else {
//发布时使用
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
api rootProject.ext.dependencies["ydl-webview"]
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
......
......@@ -28,17 +28,14 @@ import com.ydl.webview.NewH5Activity
import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydl_image.listener.YDLImageRecyclerOnScrollListener
import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.ydl.ydl_router.manager.YDLRouterParams
import com.ydl.ydlcommon.base.BaseMvpActivity
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.ui.LogoLoadingView
import com.ydl.ydlcommon.utils.BuryPointUtils
import com.ydl.ydlcommon.utils.StatusBarUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.ydl.ydlcommon.view.banner.GlideImageLoader
import com.ydl.ydlcommon.view.listener.EndlessRecyclerViewScrollListener
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxDeviceTool
......@@ -51,7 +48,6 @@ import com.yidianling.consultant.listener.OnFilterConfirmListener
import com.yidianling.consultant.listener.OnSortItemSelectedListener
import com.yidianling.consultant.model.bean.*
import com.yidianling.consultant.modular.singlton.ConsultAssistantDialogUtils
import com.yidianling.consultant.modular.utils.TempH5RouteUtils
import com.yidianling.consultant.router.ConsultantIn
import com.yidianling.consultant.ui.view.AreaPopupWindow
import com.yidianling.consultant.ui.view.CategoryPopupWindow
......@@ -60,7 +56,6 @@ import com.yidianling.consultant.ui.view.SortPopupWindow
import kotlinx.android.synthetic.main.consultant_activity_expert_search_list.*
import kotlinx.android.synthetic.main.consultant_item_filter_online.view.*
import kotlinx.android.synthetic.main.consultant_layout_search_content.*
import kotlinx.android.synthetic.main.consultant_layout_search_head_bg.*
import kotlinx.android.synthetic.main.consultant_layout_search_toolbar.*
import org.json.JSONObject
import java.util.concurrent.Executors
......@@ -227,11 +222,15 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
super.onScrollStateChanged(recyclerView, newState)
hideSoftInput()
if (newState == RecyclerView.SCROLL_STATE_DRAGGING || newState == RecyclerView.SCROLL_STATE_SETTLING) {
//滚动
ConsultAssistantDialogUtils.INSTANCE.hideAssistantActivity()
sIsScrolling = true
if (!this@ExpertSearchActivity.isFinishing) {
// GlideApp.with(this@ExpertSearchActivity).pauseRequests()
}
} else if (newState == RecyclerView.SCROLL_STATE_IDLE) {
//没有滚动
ConsultAssistantDialogUtils.INSTANCE.fitRequest(this@ExpertSearchActivity, "doctor_list", true)
if (sIsScrolling) {
if (!this@ExpertSearchActivity.isFinishing) {
// GlideApp.with(this@ExpertSearchActivity).resumeRequests()
......@@ -363,8 +362,6 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
getPresenter().fetchListHead()
//加载本地缓存数据
getPresenter().localData(initShowType)
//加载banner
getPresenter().fetchBannerList()
refresh(false)
v_loading.visibility = View.VISIBLE
......@@ -375,34 +372,6 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
}
}
override fun onBannerListFetched(data: MutableList<ExpertBannerBean>?) {
if (null == data) {
if (bannerList.isEmpty()) {
bannerList.add("https://h2.yidianling.com/ct/list")
}
}
if (null != data && data.isNotEmpty()) {
bannerList.clear()
for (item in data) {
bannerList.add(item.image!!)
}
}
banner_search.setOnBannerListener {
if (null == data || data.isEmpty()) {
TempH5RouteUtils.tempH5Route(
IYDLRouterConstant.ROUTER_H5_H5,
YDLRouterParams().putExtra(IYDLRouterConstant.EXTRA_URL, "https://h2.yidianling.com/ct/list"), "")
} else {
if (it < data.size) {
TempH5RouteUtils.tempH5Route(data[it].linkUrl)
}
}
}
banner_search.setImageLoader(GlideImageLoader(R.drawable.consultant_expert_banner_default)).setImages(bannerList).start()
banner_search.setIndicatorBottomPadding(20)
}
override fun onNewIntent(intent: Intent?) {
super.onNewIntent(intent)
initData(intent!!)
......@@ -425,7 +394,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
//返回键处理,热门搜索如果可见,则隐藏,来自启动页,则打开主界面
override fun onBackPressed() {
if (isFromSplash) {
startActivity(ConsultantIn.mainIntent(this))
ConsultantIn.mainIntent(this)
}
finish()
}
......@@ -1003,7 +972,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
}
filterPopupWindow.isClippingEnabled = false
filterPopupWindow.showAtLocation(viewSep2.rootView, Gravity.TOP + Gravity.RIGHT, 0, 0)
ConsultAssistantDialogUtils.INSTANCE.hide()
ConsultAssistantDialogUtils.INSTANCE.hideAssistantActivity()
filterPopupWindow.onFilterConfirmListener = this
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_OPEN)
// viewDim.visibility = View.VISIBLE
......
......@@ -24,17 +24,14 @@ import com.ydl.webview.NewH5Activity
import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydl_image.listener.YDLImageRecyclerOnScrollListener
import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.ydl.ydl_router.manager.YDLRouterParams
import com.ydl.ydlcommon.base.BaseMvpFragment
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.ui.LogoLoadingView
import com.ydl.ydlcommon.utils.BuryPointUtils
import com.ydl.ydlcommon.utils.DisplayUtils
import com.ydl.ydlcommon.utils.StatusBarUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.ydl.ydlcommon.view.banner.GlideImageLoader
import com.ydl.ydlcommon.view.listener.EndlessRecyclerViewScrollListener
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxDeviceTool
......@@ -47,7 +44,6 @@ import com.yidianling.consultant.listener.OnFilterConfirmListener
import com.yidianling.consultant.listener.OnSortItemSelectedListener
import com.yidianling.consultant.model.bean.*
import com.yidianling.consultant.modular.singlton.ConsultAssistantDialogUtils
import com.yidianling.consultant.modular.utils.TempH5RouteUtils
import com.yidianling.consultant.router.ConsultantIn
import com.yidianling.consultant.ui.view.AreaPopupWindow
import com.yidianling.consultant.ui.view.CategoryPopupWindow
......@@ -56,7 +52,6 @@ import com.yidianling.consultant.ui.view.SortPopupWindow
import kotlinx.android.synthetic.main.consultant_activity_expert_search_list.*
import kotlinx.android.synthetic.main.consultant_item_filter_online.view.*
import kotlinx.android.synthetic.main.consultant_layout_search_content.*
import kotlinx.android.synthetic.main.consultant_layout_search_head_bg.*
import kotlinx.android.synthetic.main.consultant_layout_search_toolbar.*
import org.json.JSONObject
import java.util.concurrent.Executors
......@@ -84,15 +79,21 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
}
override fun showImage(url: String?, imgView: ImageView) {
YDLImageCacheManager.showImage(activity, url, imgView)
if (isAdded) {
YDLImageCacheManager.showImage(activity, url, imgView)
}
}
override fun showImage(url: String?, imgView: ImageView, ops: SimpleImageOpConfiger) {
YDLImageCacheManager.showImage(activity, url, imgView, ops)
if (isAdded) {
YDLImageCacheManager.showImage(activity, url, imgView, ops)
}
}
override fun showImage(url: String?, imgView: ImageView, width: Int, heigh: Int, ops: SimpleImageOpConfiger) {
YDLImageCacheManager.showImage(activity, url, imgView, width, heigh, ops)
if (isAdded) {
YDLImageCacheManager.showImage(activity, url, imgView, width, heigh, ops)
}
}
//
// override fun getStatusViewOptions(): StatusBarOptions {
......@@ -180,8 +181,12 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
hideSoftInput()
if (newState == RecyclerView.SCROLL_STATE_DRAGGING || newState == RecyclerView.SCROLL_STATE_SETTLING) {
sIsScrolling = true
//滚动
hideConsultAssistantDialog()
} else if (newState == RecyclerView.SCROLL_STATE_IDLE) {
//没有滚动
showConsultAssistantDialog()
if (sIsScrolling) {
}
......@@ -313,8 +318,6 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
getPresenter().fetchListHead()
//加载本地缓存数据
getPresenter().localData(initShowType)
//加载banner
getPresenter().fetchBannerList()
//refresh(false)
v_loading.visibility = View.VISIBLE
......@@ -325,35 +328,6 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
}
}
override fun onBannerListFetched(data: MutableList<ExpertBannerBean>?) {
if (null == data) {
if (bannerList.isEmpty()) {
bannerList.add("https://h2.yidianling.com/ct/list")
}
}
if (null != data && data.isNotEmpty()) {
bannerList.clear()
for (item in data) {
bannerList.add(item.image!!)
}
}
banner_search.setOnBannerListener {
if (null == data || data.isEmpty()) {
TempH5RouteUtils.tempH5Route(
IYDLRouterConstant.ROUTER_H5_H5,
YDLRouterParams().putExtra(IYDLRouterConstant.EXTRA_URL, "https://h2.yidianling.com/ct/list"), "")
} else {
if (it < data.size) {
TempH5RouteUtils.tempH5Route(data[it].linkUrl)
}
}
}
banner_search.setImageLoader(GlideImageLoader(R.drawable.consultant_expert_banner_default)).setImages(bannerList).start()
banner_search.setIndicatorBottomPadding(20)
}
/**
* 初始化状态栏位置
*/
......
......@@ -42,26 +42,6 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
})
}
@SuppressLint("CheckResult")
fun fetchBannerList() {
ExpertSearchDataManager.getHttp().getBannerList()
.subscribeOn(Schedulers.io())
.compose(RxLifecycleUtils.bindToLifecycle(mView!!))
.compose(RxUtils.resultJavaData())
.map { it }
.filter { it != null }
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer {
mView.onBannerListFetched(it)
}, object : ThrowableConsumer() {
override fun accept(msg: String) {
mView.onBannerListFetched(null)
// mView.fetchFailed(msg)
}
})
}
/**
* 加载缓存
*/
......
......@@ -23,7 +23,6 @@ interface IExpertSearchView : IView {
fun fetchFailed(msg: String?)
fun fetchListFailed(msg: String?)
fun fetchListEmpty(msg: String?)
fun onBannerListFetched(data: MutableList<ExpertBannerBean>?)
/**
* 加载图片
*/
......
package com.yidianling.consultant.bean;
import java.util.List;
public class ExpertSearchBigShotBean {
/**
* id : 62
* specialTopicName : 1
* specialTopicType : 2
* specialTopicTitle : 大咖专场1
* specialTopicSubhead : 副标题1
* status : 0
* weight : 2
* jumpWay : 2
* createTime : Dec 13, 2019 9:56:26 PM
* updateTime : Dec 16, 2019 5:05:36 PM
* createrId : 22
* specialTopicUrl : https://testh2.yidianling.com/post/view-out/139?last_source=app
* topicImages : [{"id":88,"parentId":62,"iamgeType":2,"isShow":1,"createTime":"Dec 13, 2019 9:35:45 PM","updateTime":"Dec 16, 2019 4:31:42 PM","createrId":1,"imageUrl":"https://pic.ydlcdn.com/6n5AcChhYa.png"},{"id":133,"parentId":62,"iamgeType":1,"isShow":1,"createTime":"Dec 16, 2019 4:23:00 PM","updateTime":"Dec 16, 2019 4:34:48 PM","createrId":0,"imageUrl":"https://pic.ydlcdn.com/6n5AcChhYa.png"},{"id":134,"parentId":62,"iamgeType":1,"isShow":1,"createTime":"Dec 16, 2019 4:28:03 PM","updateTime":"Dec 16, 2019 4:29:58 PM","createrId":1,"imageUrl":"https://pic.ydlcdn.com/6n5AcChhYa.png"},{"id":146,"parentId":62,"iamgeType":3,"isShow":1,"createTime":"Dec 16, 2019 4:32:15 PM","updateTime":"Dec 16, 2019 4:34:01 PM","createrId":1,"imageUrl":"https://pic.ydlcdn.com/6n5AcChhYa.png"}]
*/
private int id;
private String specialTopicName;
private int specialTopicType;
private String specialTopicTitle;
private String specialTopicSubhead;
private int status;
private int weight;
private int jumpWay;
private String createTime;
private String updateTime;
private int createrId;
private String specialTopicUrl;
private List<TopicImagesBean> topicImages;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getSpecialTopicName() {
return specialTopicName;
}
public void setSpecialTopicName(String specialTopicName) {
this.specialTopicName = specialTopicName;
}
public int getSpecialTopicType() {
return specialTopicType;
}
public void setSpecialTopicType(int specialTopicType) {
this.specialTopicType = specialTopicType;
}
public String getSpecialTopicTitle() {
return specialTopicTitle;
}
public void setSpecialTopicTitle(String specialTopicTitle) {
this.specialTopicTitle = specialTopicTitle;
}
public String getSpecialTopicSubhead() {
return specialTopicSubhead;
}
public void setSpecialTopicSubhead(String specialTopicSubhead) {
this.specialTopicSubhead = specialTopicSubhead;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public int getWeight() {
return weight;
}
public void setWeight(int weight) {
this.weight = weight;
}
public int getJumpWay() {
return jumpWay;
}
public void setJumpWay(int jumpWay) {
this.jumpWay = jumpWay;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public String getUpdateTime() {
return updateTime;
}
public void setUpdateTime(String updateTime) {
this.updateTime = updateTime;
}
public int getCreaterId() {
return createrId;
}
public void setCreaterId(int createrId) {
this.createrId = createrId;
}
public String getSpecialTopicUrl() {
return specialTopicUrl;
}
public void setSpecialTopicUrl(String specialTopicUrl) {
this.specialTopicUrl = specialTopicUrl;
}
public List<TopicImagesBean> getTopicImages() {
return topicImages;
}
public void setTopicImages(List<TopicImagesBean> topicImages) {
this.topicImages = topicImages;
}
public static class TopicImagesBean {
/**
* id : 88
* parentId : 62
* iamgeType : 2
* isShow : 1
* createTime : Dec 13, 2019 9:35:45 PM
* updateTime : Dec 16, 2019 4:31:42 PM
* createrId : 1
* imageUrl : https://pic.ydlcdn.com/6n5AcChhYa.png
*/
private int id;
private int parentId;
private int iamgeType;
private int isShow;
private String createTime;
private String updateTime;
private int createrId;
private String imageUrl;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getParentId() {
return parentId;
}
public void setParentId(int parentId) {
this.parentId = parentId;
}
public int getIamgeType() {
return iamgeType;
}
public void setIamgeType(int iamgeType) {
this.iamgeType = iamgeType;
}
public int getIsShow() {
return isShow;
}
public void setIsShow(int isShow) {
this.isShow = isShow;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public String getUpdateTime() {
return updateTime;
}
public void setUpdateTime(String updateTime) {
this.updateTime = updateTime;
}
public int getCreaterId() {
return createrId;
}
public void setCreaterId(int createrId) {
this.createrId = createrId;
}
public String getImageUrl() {
return imageUrl;
}
public void setImageUrl(String imageUrl) {
this.imageUrl = imageUrl;
}
}
}
package com.yidianling.consultant.bean;
import java.util.List;
public class ExpertSearchRecommandBean {
/**
* id : 68
* specialTopicName : 3
* specialTopicType : 1
* specialTopicTitle : 婚姻幸福
* specialTopicSubhead : 副标题副标题1
* status : 0
* weight : 1
* jumpWay : 1
* createTime : Dec 13, 2019 9:35:47 PM
* updateTime : Dec 16, 2019 5:44:47 PM
* createrId : 11
* specialTopicUrl : https://testh2.yidianling.com/post/view-out/139?last_source=app
* topicImages : [{"id":103,"parentId":68,"iamgeType":2,"isShow":1,"createTime":"Dec 13, 2019 9:35:47 PM","updateTime":"Dec 16, 2019 4:31:55 PM","createrId":1,"imageUrl":"https://pic.ydlcdn.com/6n5AcChhYa.png"},{"id":140,"parentId":68,"iamgeType":1,"isShow":1,"createTime":"Dec 16, 2019 4:28:05 PM","updateTime":"Dec 16, 2019 4:30:13 PM","createrId":1,"imageUrl":"https://pic.ydlcdn.com/6n5AcChhYa.png"},{"id":152,"parentId":68,"iamgeType":3,"isShow":1,"createTime":"Dec 16, 2019 4:32:18 PM","updateTime":"Dec 16, 2019 4:34:15 PM","createrId":1,"imageUrl":"https://pic.ydlcdn.com/6n5AcChhYa.png"}]
*/
private int id;
private String specialTopicName;
private int specialTopicType;
private String specialTopicTitle;
private String specialTopicSubhead;
private int status;
private int weight;
private int jumpWay;
private String createTime;
private String updateTime;
private int createrId;
private String specialTopicUrl;
private List<TopicImagesBean> topicImages;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getSpecialTopicName() {
return specialTopicName;
}
public void setSpecialTopicName(String specialTopicName) {
this.specialTopicName = specialTopicName;
}
public int getSpecialTopicType() {
return specialTopicType;
}
public void setSpecialTopicType(int specialTopicType) {
this.specialTopicType = specialTopicType;
}
public String getSpecialTopicTitle() {
return specialTopicTitle;
}
public void setSpecialTopicTitle(String specialTopicTitle) {
this.specialTopicTitle = specialTopicTitle;
}
public String getSpecialTopicSubhead() {
return specialTopicSubhead;
}
public void setSpecialTopicSubhead(String specialTopicSubhead) {
this.specialTopicSubhead = specialTopicSubhead;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public int getWeight() {
return weight;
}
public void setWeight(int weight) {
this.weight = weight;
}
public int getJumpWay() {
return jumpWay;
}
public void setJumpWay(int jumpWay) {
this.jumpWay = jumpWay;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public String getUpdateTime() {
return updateTime;
}
public void setUpdateTime(String updateTime) {
this.updateTime = updateTime;
}
public int getCreaterId() {
return createrId;
}
public void setCreaterId(int createrId) {
this.createrId = createrId;
}
public String getSpecialTopicUrl() {
return specialTopicUrl;
}
public void setSpecialTopicUrl(String specialTopicUrl) {
this.specialTopicUrl = specialTopicUrl;
}
public List<TopicImagesBean> getTopicImages() {
return topicImages;
}
public void setTopicImages(List<TopicImagesBean> topicImages) {
this.topicImages = topicImages;
}
public static class TopicImagesBean {
/**
* id : 103
* parentId : 68
* iamgeType : 2
* isShow : 1
* createTime : Dec 13, 2019 9:35:47 PM
* updateTime : Dec 16, 2019 4:31:55 PM
* createrId : 1
* imageUrl : https://pic.ydlcdn.com/6n5AcChhYa.png
*/
private int id;
private int parentId;
private int iamgeType;
private int isShow;
private String createTime;
private String updateTime;
private int createrId;
private String imageUrl;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getParentId() {
return parentId;
}
public void setParentId(int parentId) {
this.parentId = parentId;
}
public int getIamgeType() {
return iamgeType;
}
public void setIamgeType(int iamgeType) {
this.iamgeType = iamgeType;
}
public int getIsShow() {
return isShow;
}
public void setIsShow(int isShow) {
this.isShow = isShow;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public String getUpdateTime() {
return updateTime;
}
public void setUpdateTime(String updateTime) {
this.updateTime = updateTime;
}
public int getCreaterId() {
return createrId;
}
public void setCreaterId(int createrId) {
this.createrId = createrId;
}
public String getImageUrl() {
return imageUrl;
}
public void setImageUrl(String imageUrl) {
this.imageUrl = imageUrl;
}
}
}
package com.yidianling.consultant.bean
class ExpertSearchTopShowBean (
var doctorSpecialTopics: ArrayList<ExpertSearchBigShotBean>,
var sceneSpecialTopic: ArrayList<ExpertSearchRecommandBean>
)
package com.yidianling.consultant.dialog
import android.animation.Animator
import android.animation.ObjectAnimator
import android.app.Dialog
import android.content.Context
import android.os.Bundle
import android.os.Handler
import android.view.Gravity
import android.view.View
import android.view.WindowManager
import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.yidianling.common.tools.RxImageTool
import com.yidianling.consultant.R
import com.yidianling.consultant.modular.singlton.ConsultAssistantDialogUtils
import kotlinx.android.synthetic.main.consultant_expert_consult_assistant_popup_window.*
/**
......@@ -14,7 +21,13 @@ import kotlinx.android.synthetic.main.consultant_expert_consult_assistant_popup_
* Created by xj on 2019/10/30.
*/
class ConsultAssistantDialog(context: Context, val consultAssistantClickListener: OnConsultAssistantClickListener?) : Dialog(context, R.style.consultant_expert_dialog_default_style) {
class ConsultAssistantDialog(
mContext: Context,
val consultAssistantClickListener: OnConsultAssistantClickListener?
) : Dialog(mContext, R.style.consultant_expert_dialog_default_style) {
private var animate: ObjectAnimator? = null
private var minWidth: Int? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
......@@ -31,14 +44,87 @@ class ConsultAssistantDialog(context: Context, val consultAssistantClickListener
window.setWindowAnimations(R.style.consultant_expert_consult_assistant_dialog_animate)
consult_assistant.setOnClickListener {
if (!ConsultAssistantDialogUtils.INSTANCE.canShowDesc()) {
consultant_assistant_dialog_desc_ll.visibility = View.GONE
consultant_assistant_dialog_desc_outside_ll.visibility = View.GONE
refreshDialogLayout(ConsultAssistantDialogUtils.INSTANCE.minWidth)
}
consultant_assistant_dialog_close.setOnClickListener {
if (minWidth == null) {
minWidth = (consultant_assistant.measuredWidth * 1.5).toInt()
}
ConsultAssistantDialogUtils.INSTANCE.minWidth = minWidth!!
//一个dialog关闭左侧desc,所有导医左侧desc都关闭
SharedPreferencesEditor.putString(
ConsultAssistantDialogUtils.INSTANCE.ASSISTANT_DIALOG_SP_TAG,
System.currentTimeMillis().toString()
)
animate = ObjectAnimator.ofFloat(
consultant_assistant_dialog_desc_ll,
"translationX",
0.0f,
consultant_assistant_dialog_desc_ll.measuredWidth.toFloat()
)
animate?.setDuration(900)?.start()
animate?.addListener(object : Animator.AnimatorListener {
override fun onAnimationRepeat(animation: Animator?) {
}
override fun onAnimationEnd(animation: Animator?) {
ConsultAssistantDialogUtils.INSTANCE.setDescHide()
hide()
// show()
Handler().postDelayed({
show()
}, 10)
}
override fun onAnimationCancel(animation: Animator?) {
}
override fun onAnimationStart(animation: Animator?) {
}
})
}
consultant_assistant.setOnClickListener {
consultAssistantClickListener?.onClickAction()
}
setCanceledOnTouchOutside(false)
}
public fun setDescHide() {
if (null != consultant_assistant_dialog_desc_ll) {
consultant_assistant_dialog_desc_ll.visibility = View.GONE
consultant_assistant_dialog_desc_outside_ll.visibility = View.GONE
refreshDialogLayout(ConsultAssistantDialogUtils.INSTANCE.minWidth)
}
}
// 刷新dialog布局,减小拦截点击区域
fun refreshDialogLayout(width: Int) {
val params = window.attributes
if (width != 0) {
minWidth = width
} else {
minWidth = (RxImageTool.dp2px(60f) * 1.5).toInt()
}
params.width = minWidth!!
params.height = WindowManager.LayoutParams.WRAP_CONTENT
params.gravity = Gravity.RIGHT + Gravity.BOTTOM
params.verticalMargin = 0.07f
params.horizontalMargin = 0.01f
window.setWindowAnimations(0)
window.attributes = params
}
interface OnConsultAssistantClickListener {
fun onClickAction() //隐私设置
fun onClickAction()
}
}
\ No newline at end of file
......@@ -3,6 +3,7 @@ package com.yidianling.consultant.http
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.consultant.bean.ExpertSearchTopShowBean
import com.yidianling.consultant.model.SearchApi
import com.yidianling.consultant.model.bean.ExpertBannerBean
import com.yidianling.consultant.model.bean.ExpertSearchBean
......@@ -49,8 +50,8 @@ class ExpertSearchHttpImpl : IExpertSearchHttp {
}
override fun getBannerList(): Observable<BaseAPIResponse<MutableList<ExpertBannerBean>>> {
return getSearchApi().expertBannerList()
override fun getBigShotData(): Observable<BaseAPIResponse<ExpertSearchTopShowBean>> {
return getSearchApi().getBigShotData()
}
......
package com.yidianling.consultant.http
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.yidianling.consultant.bean.ExpertSearchTopShowBean
import com.yidianling.consultant.model.bean.ExpertBannerBean
import com.yidianling.consultant.model.bean.ExpertSearchBean
import io.reactivex.Observable
......@@ -19,12 +20,13 @@ interface IExpertSearchHttp{
fun searchDoctor(params : String?): Observable<BaseAPIResponse<ExpertSearchBean>>
/**
* 专家首页banner
* 获取当前筛选条件结果数
*/
fun getBannerList(): Observable<BaseAPIResponse<MutableList<ExpertBannerBean>>>
fun getFilterCount(params:String?): Observable<BaseAPIResponse<Int>>
/**
* 获取当前筛选条件结果数
* 获取大咖专区和顶部推荐数据数据
*/
fun getFilterCount(params:String?): Observable<BaseAPIResponse<Int>>
fun getBigShotData(): Observable<BaseAPIResponse<ExpertSearchTopShowBean>>
}
\ No newline at end of file
......@@ -6,6 +6,7 @@ import com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseResponse
import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.consultant.bean.ExpertSearchTopShowBean
import com.yidianling.consultant.bean.HotSearchBean
import com.yidianling.consultant.model.bean.ExpertBannerBean
import com.yidianling.consultant.model.bean.ExpertSearchBean
......@@ -46,11 +47,6 @@ interface SearchApi {
@GET
fun searchDoctorService(@Url url : String): Observable<BaseAPIResponse<ExpertSearchBean>>
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA,"Content-Type:application/json")
@GET("delivery/banner")
fun expertBannerList(@Query(value = "planId") planId:String?="32"): Observable<BaseAPIResponse<MutableList<ExpertBannerBean>>>
//搜索页面接口
@retrofit2.http.Headers(YDL_DOMAIN+ YDL_DOMAIN_JAVA,"Content-Type:application/json")
@GET("home/search-page")
......@@ -70,4 +66,9 @@ interface SearchApi {
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA,"Content-Type:application/json")
@GET("consult/assistant/chat-distribute")
fun getConsultAssistantUidRequest(): Observable<BaseAPIResponse<Long>>
//获取咨询助理uid
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA,"Content-Type:application/json")
@POST("doctor/querySpecialTopic")
fun getBigShotData(): Observable<BaseAPIResponse<ExpertSearchTopShowBean>>
}
\ No newline at end of file
......@@ -2,10 +2,10 @@ package com.yidianling.consultant.router
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.support.v7.app.AppCompatActivity
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.yidianling.router.RouterManager
import com.yidianling.im.api.service.IImService
import com.yidianling.user.api.service.IAppService
import com.yidianling.user.api.service.IUserService
/**
......@@ -15,9 +15,20 @@ import com.yidianling.user.api.service.IUserService
*/
object ConsultantIn {
fun getImService(): IImService {
return ModularServiceManager.provide(IImService::class.java)
}
fun getAppService(): IAppService {
return ModularServiceManager.provide(IAppService::class.java)
}
fun getUserService(): IUserService {
return ModularServiceManager.provide(IUserService::class.java)
}
// 打开小壹聊天界面
fun startP2PXiaoYi(context: Context) {
RouterManager.getImRouter().startP2PXiaoYi(context)
getImService().startP2PXiaoYi(context)
}
fun isLogin(): Boolean {
......@@ -25,11 +36,11 @@ object ConsultantIn {
}
fun startP2PSession(context: AppCompatActivity, toUid: String) {
RouterManager.getImRouter().startP2PSession(context, toUid)
getImService().startP2PSession(context, toUid)
}
fun mainIntent(activity: Activity): Intent? {
return RouterManager.getAppRouter()?.mainIntent(activity)
fun mainIntent(activity: Activity){
getAppService().mainIntent(activity)
}
fun getUserImpl(): IUserService {
......
package com.yidianling.consultant.router
import android.app.Activity
import android.content.Intent
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import com.ydl.ydlcommon.utils.LogUtil
import com.yidianling.consultant.ExpertSearchActivity
import com.yidianling.consultant.data.ConsultantDataManager
import com.yidianling.router.consultant.IConsultantRouter
import com.yidianling.router.consultant.Keyworks
class ConsultantRouterImp : IConsultantRouter{
val gson: Gson = Gson()
override fun expertSearchIntent(activity: Activity, category: Int, showType: Int, isInitShowHot: Boolean): Intent {
return ExpertSearchActivity.newIntent(activity, category, showType, isInitShowHot)
}
override fun getHotSearch(): MutableList<Keyworks> {
val hotSearch = ConsultantDataManager.getRam().getHotSearch()
if (hotSearch.size==0){
return mutableListOf()
}
val list = try {
val jsonStr = gson.toJson(hotSearch)
gson.fromJson<MutableList<Keyworks>>(jsonStr, object : TypeToken<MutableList<Keyworks>>() {
}.type)
} catch (e: Exception) {
LogUtil.e(e.message)
return mutableListOf()
}
return list
}
override fun setHotSearch(hotSearch: MutableList<Keyworks>) {
if (hotSearch.size==0){
return
}
val list: MutableList<com.yidianling.consultant.bean.Keyworks> = try {
val jsonStr = gson.toJson(hotSearch)
Gson().fromJson<MutableList<com.yidianling.consultant.bean.Keyworks>>(jsonStr, object : TypeToken<MutableList<com.yidianling.consultant.bean.Keyworks>>() {
}.type)
} catch (e: Exception) {
LogUtil.e(e.message)
mutableListOf()
}
return ConsultantDataManager.getRam().setHotSearch(list)
}
}
\ No newline at end of file
package com.yidianling.consultant.ui.view.topView
import android.content.Context
import android.util.AttributeSet
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydl_image.module.GlideApp
import com.yidianling.consultant.R
import com.yidianling.consultant.bean.ExpertSearchBigShotBean
import kotlinx.android.synthetic.main.consultant_expert_search_big_shot_one.view.*
class BigShotOneView : LinearLayout {
constructor(context: Context) : super(context) {
mContext = context
initView()
}
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
mContext = context
initView()
}
constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(
context,
attrs,
defStyle
) {
mContext = context
initView()
}
private var mContext: Context? = null
private fun initView() {
layoutParams = LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT
)
orientation = HORIZONTAL
View.inflate(mContext, R.layout.consultant_expert_search_big_shot_one, this)
}
fun setUrl(bean: ExpertSearchBigShotBean) {
GlideApp.with(mContext).load(bean.topicImages[0]).into(consultant_one_img_1)
consultant_one_img_1.setOnClickListener {
val h5Params = H5Params(bean.specialTopicUrl, null)
NewH5Activity.start(context, h5Params)
}
}
}
\ No newline at end of file
package com.yidianling.consultant.ui.view.topView
import android.content.Context
import android.util.AttributeSet
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydl_image.module.GlideApp
import com.yidianling.consultant.R
import com.yidianling.consultant.bean.ExpertSearchBigShotBean
import kotlinx.android.synthetic.main.consultant_expert_search_big_shot_three.view.*
class BigShotThreeView : LinearLayout {
constructor(context: Context) : super(context) {
mContext = context
initView()
}
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
mContext = context
initView()
}
constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(
context,
attrs,
defStyle
) {
mContext = context
initView()
}
private var mContext: Context? = null
private fun initView() {
layoutParams = LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT
)
orientation = HORIZONTAL
View.inflate(mContext, R.layout.consultant_expert_search_big_shot_three, this)
}
fun setUrl(
bean1: ExpertSearchBigShotBean,
bean2: ExpertSearchBigShotBean,
bean3: ExpertSearchBigShotBean
) {
GlideApp.with(mContext).load(bean1.topicImages[2].imageUrl).into(consultant_three_img_1)
consultant_three_img_1.setOnClickListener {
val h5Params = H5Params(bean1.specialTopicUrl, null)
NewH5Activity.start(context, h5Params)
}
GlideApp.with(mContext).load(bean2.topicImages[2].imageUrl).into(consultant_three_img_2)
consultant_three_img_2.setOnClickListener {
val h5Params = H5Params(bean2.specialTopicUrl, null)
NewH5Activity.start(context, h5Params)
}
GlideApp.with(mContext).load(bean3.topicImages[2].imageUrl).into(consultant_three_img_3)
consultant_three_img_3.setOnClickListener {
val h5Params = H5Params(bean3.specialTopicUrl, null)
NewH5Activity.start(context, h5Params)
}
}
}
\ No newline at end of file
package com.yidianling.consultant.ui.view.topView
import android.content.Context
import android.util.AttributeSet
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydl_image.module.GlideApp
import com.yidianling.consultant.R
import com.yidianling.consultant.bean.ExpertSearchBigShotBean
import kotlinx.android.synthetic.main.consultant_expert_search_big_shot_two.view.*
class BigShotTwoView : LinearLayout {
constructor(context: Context) : super(context) {
mContext = context
initView()
}
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
mContext = context
initView()
}
constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(
context,
attrs,
defStyle
) {
mContext = context
initView()
}
private var mContext: Context? = null
private fun initView() {
layoutParams = LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT
)
orientation = HORIZONTAL
View.inflate(mContext, R.layout.consultant_expert_search_big_shot_two, this)
}
fun setUrl(bean1: ExpertSearchBigShotBean, bean2: ExpertSearchBigShotBean) {
GlideApp.with(mContext).load(bean1.topicImages[1].imageUrl).into(consultant_two_img_1)
consultant_two_img_1.setOnClickListener {
val h5Params = H5Params(bean1.specialTopicUrl, null)
NewH5Activity.start(context, h5Params)
}
GlideApp.with(mContext).load(bean2.topicImages[1].imageUrl).into(consultant_two_img_2)
consultant_two_img_2.setOnClickListener {
val h5Params = H5Params(bean2.specialTopicUrl, null)
NewH5Activity.start(context, h5Params)
}
}
}
\ No newline at end of file
package com.yidianling.consultant.ui.view.topView
import android.content.Context
import android.util.AttributeSet
import android.view.View
import android.widget.LinearLayout
import com.alibaba.android.arouter.launcher.ARouter
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydlcommon.base.config.HttpConfig
import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.RxImageTool
import com.yidianling.consultant.R
import com.yidianling.consultant.bean.ExpertSearchRecommandBean
import kotlinx.android.synthetic.main.consultant_expert_search_top_item_view.view.*
import java.net.URLDecoder
class RecommendItemView : LinearLayout {
constructor(context: Context) : super(context) {
mContext = context
initView()
}
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
mContext = context
initView()
}
constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(
context,
attrs,
defStyle
) {
mContext = context
initView()
}
private var mContext: Context? = null
private fun initView() {
val mWidth: Int = RxDeviceTool.getScreenWidth(mContext) / 2
val mHeight: Int = RxImageTool.dp2px(60f)
val params = LayoutParams(
mWidth,
mHeight
)
params.height = mHeight
layoutParams = params
orientation = HORIZONTAL
setPadding(RxImageTool.dp2px(15f), RxImageTool.dp2px(9f), 0, RxImageTool.dp2px(11f))
View.inflate(mContext, R.layout.consultant_expert_search_top_item_view, this)
}
fun setData(bean: ExpertSearchRecommandBean) {
if (bean.topicImages.isNotEmpty() && bean.topicImages.size > 0 && bean.topicImages[0].imageUrl.isNotEmpty()) {
GlideApp.with(mContext).load(bean.topicImages[0].imageUrl).into(top_item_img)
}
top_item_title.text = bean.specialTopicTitle?:""
top_item_desc.text = bean.specialTopicSubhead?:""
setOnClickListener {
val h5Params = H5Params(bean.specialTopicUrl, null)
NewH5Activity.start(context, h5Params)
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:topLeftRadius="22dp"
android:bottomLeftRadius="22dp"/>
<gradient
android:angle="0"
android:startColor="#DDFF7A5C"
android:endColor="#DDFF406C"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<size android:height="5dp"
android:width="15dp" />
<corners android:radius="2.5dp" />
<solid android:color="#000000"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<size android:height="5dp"
android:width="5dp" />
<corners android:radius="2.5dp" />
<solid android:color="#dddddd"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<include
layout="@layout/consultant_layout_search_toolbar"
android:layout_width="match_parent"
android:layout_height="48dp" />
<android.support.design.widget.CoordinatorLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/consultant_colorBg"
tools:ignore="InefficientWeight">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/consultant_colorBg"
android:clipChildren="false"
android:clipToPadding="false"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:elevation="0dp">
<android.support.design.widget.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="false"
android:clipToPadding="false"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<include layout="@layout/consultant_layout_search_head_bg" />
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<include layout="@layout/consultant_layout_search_content" />
<!--<include layout="@layout/layout_search_head_input"/>-->
<!--筛选弹窗半透明背景-->
<View
android:id="@+id/viewDim_filter"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#40000000"
android:visibility="gone" />
</android.support.design.widget.CoordinatorLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<include
layout="@layout/consultant_layout_search_toolbar"
android:layout_width="match_parent"
android:layout_height="48dp" />
<android.support.design.widget.CoordinatorLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/consultant_colorBg"
tools:ignore="InefficientWeight">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/consultant_colorBg"
android:clipChildren="false"
android:clipToPadding="false"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:elevation="0dp">
<android.support.design.widget.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="false"
android:clipToPadding="false"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<com.yidianling.consultant.ui.view.topView.RecommendListView
android:id="@+id/recommendListView"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</com.yidianling.consultant.ui.view.topView.RecommendListView>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<include layout="@layout/consultant_layout_search_content" />
<!--<include layout="@layout/layout_search_head_input"/>-->
<!--筛选弹窗半透明背景-->
<View
android:id="@+id/viewDim_filter"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#40000000"
android:visibility="gone" />
</android.support.design.widget.CoordinatorLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:paddingBottom="60dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="11dp">
<LinearLayout
android:id="@+id/consultant_assistant_dialog_desc_outside_ll"
android:layout_width="wrap_content"
android:layout_height="84dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="25dp"
android:clipChildren="true"
android:gravity="center"
android:orientation="horizontal"
android:paddingRight="25dp"
android:paddingBottom="40dp">
<LinearLayout
android:id="@+id/consultant_assistant_dialog_desc_ll"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@drawable/consultant_assistant_dialog_text_bg"
android:gravity="center">
<ImageView
android:id="@+id/consultant_assistant_dialog_close"
android:layout_width="35dp"
android:layout_height="30dp"
android:paddingLeft="15dp"
android:paddingTop="10dp"
android:paddingRight="10dp"
android:paddingBottom="10dp"
android:src="@drawable/consultant_assistant_dialog_close_icon" />
<View
android:layout_width="0.5dp"
android:layout_height="26dp"
android:layout_marginRight="8dp"
android:background="#ffffff" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="15dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="不知道如何选择?"
android:textColor="#ffffff"
android:textSize="12dp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="为你精准匹配咨询师 "
android:textColor="#ffffff"
android:textSize="12dp" />
<ImageView
android:layout_width="10dp"
android:layout_height="10dp"
android:src="@drawable/consultant_assistant_dialog_go_icon" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<ImageView
android:id="@+id/consult_assistant"
android:layout_width="66dp"
android:layout_height="68dp"
android:id="@+id/consultant_assistant"
android:layout_width="61dp"
android:layout_height="101dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:scaleType="centerCrop"
android:src="@drawable/consultant_expert_consult_assistant_img"/>
android:src="@drawable/consultant_assistant_dialog_img"
android:paddingBottom="40dp" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="84dp"
android:orientation="vertical"
xmlns:app="http://schemas.android.com/apk/res-auto">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cardElevation="0dp"
app:cardCornerRadius="6dp">
<ImageView
android:id="@+id/consultant_one_img_1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:background="#eeeeee"/>
</android.support.v7.widget.CardView>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="84dp"
android:orientation="horizontal"
xmlns:app="http://schemas.android.com/apk/res-auto">
<android.support.v7.widget.CardView
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
app:cardElevation="0dp"
app:cardCornerRadius="6dp"
android:layout_marginRight="5dp">
<ImageView
android:id="@+id/consultant_three_img_1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:background="#eeeeee"/>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
app:cardElevation="0dp"
app:cardCornerRadius="6dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp">
<ImageView
android:id="@+id/consultant_three_img_2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:background="#eeeeee"/>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
app:cardElevation="0dp"
app:cardCornerRadius="6dp"
android:layout_marginLeft="5dp">
<ImageView
android:id="@+id/consultant_three_img_3"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:background="#eeeeee"/>
</android.support.v7.widget.CardView>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="84dp"
android:orientation="horizontal"
xmlns:app="http://schemas.android.com/apk/res-auto">
<android.support.v7.widget.CardView
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
app:cardElevation="0dp"
app:cardCornerRadius="6dp"
android:layout_marginRight="5dp">
<ImageView
android:id="@+id/consultant_two_img_1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:background="#eeeeee"/>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
app:cardElevation="0dp"
app:cardCornerRadius="6dp"
android:layout_marginLeft="5dp">
<ImageView
android:id="@+id/consultant_two_img_2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:background="#eeeeee"/>
</android.support.v7.widget.CardView>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:parentTag="android.widget.LinearLayout">
</merge>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipChildren="true">
<android.support.v4.view.ViewPager
android:id="@+id/recommendViewPager"
android:paddingTop="11dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FAFAFA" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="15dp"
android:orientation="horizontal"
android:background="#FAFAFA"
android:gravity="center">
<View
android:id="@+id/leftIndicator"
android:layout_width="15dp"
android:layout_height="5dp"
android:layout_marginRight="3dp"/>
<View
android:id="@+id/rightIndicator"
android:layout_width="15dp"
android:layout_height="5dp"
android:layout_marginLeft="3dp"/>
</LinearLayout>
<LinearLayout
android:id="@+id/itemListView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="15dp"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:paddingBottom="15dp"
android:orientation="vertical"
android:background="#FFFFFF">
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:parentTag="LinearLayout">
<android.support.v7.widget.CardView
android:layout_width="40dp"
android:layout_height="40dp"
android:background="#eeeeee"
android:layout_marginRight="10dp"
>
<ImageView
android:id="@+id/top_item_img"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"/>
</android.support.v7.widget.CardView>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/top_item_title"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="left|top"
android:text="标题"
android:textSize="14dp"
android:textColor="#242424"
android:textStyle="bold"/>
<TextView
android:id="@+id/top_item_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left|top"
android:text="我是描述"
android:textSize="11dp"
android:textColor="#999999"/>
</LinearLayout>
</merge>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<com.yidianling.consultant.ui.view.DisInterceptNestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/search_head_bg"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/platform_white"
android:clipChildren="false"
android:clipToPadding="false"
app:layout_collapseMode="parallax"
app:layout_collapseParallaxMultiplier="0.8">
<android.support.v7.widget.CardView
android:id="@+id/user_head_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginTop="10dp"
android:layout_marginRight="15dp"
android:layout_marginBottom="10dp"
android:elevation="0dp"
android:orientation="vertical"
app:cardCornerRadius="4dp">
<com.ydl.ydlcommon.view.banner.Banner
android:id="@+id/banner_search"
android:layout_width="match_parent"
android:layout_height="99dp"
android:scaleType="centerCrop"
app:pa_indicator_different_width="14dp"
app:pa_indicator_drawable_selected="@drawable/consultant_banner_indicator_select"
app:pa_indicator_drawable_unselected="@drawable/consultant_banner_indicator_unselect"
app:pa_indicator_height="5dp"
app:pa_indicator_margin="1.25dp"
app:pa_is_selected_same_unselected="false"
app:pa_is_show_indicator="false" />
</android.support.v7.widget.CardView>
</com.yidianling.consultant.ui.view.DisInterceptNestedScrollView>
......@@ -69,6 +69,7 @@ dependencies {
if (rootProject.ext.dev_mode){
//开发时使用
implementation modularPublication('com.ydl:m-user-api')
implementation modularPublication('com.ydl:m-dynamic-api')
api project(":ydl-webview")
api project(":ydl-platform")
api project(":ydl-media")
......@@ -78,6 +79,7 @@ dependencies {
} else {
//发布时使用
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-dynamic-api"]
api rootProject.ext.dependencies["ydl-webview"]
api (rootProject.ext.dependencies["ydl-media"]){
transitive = true
......
......@@ -20,8 +20,8 @@ import com.yidianling.course.bean.CourseCouponBean
import com.yidianling.course.constants.CourseBIConstants
import com.yidianling.course.flutterPlugin.CourseSendPlugin
import com.yidianling.course.net.CourseRetrofitUtils
import com.yidianling.course.router.CourseIn
import com.yidianling.course.widget.CourseCouponDialog
import com.yidianling.router.RouterManager
import io.flutter.view.FlutterView
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Consumer
......@@ -66,7 +66,7 @@ class FlutterCourseHomeFragment : BaseFlutterFragment() {
*/
private fun prepareCoupon() {
//判断是否登录 以及本次app启动后是否已经请求过
if (RouterManager.getUserRouter()?.isLogin() == true && !hasRequestCoupon) {
if (CourseIn.getUserService()?.isLogin() && !hasRequestCoupon) {
Handler().postDelayed({
//优惠券逻辑
if (compareCouponTime()) {
......
......@@ -573,8 +573,7 @@ class CoursePlayActivity : BaseActivity() {
private fun toTrend(share: ShareData) {
var url = if (TextUtils.isEmpty(share.url)) share.share_url else share.url
YdlCommonRouterManager.getYdlCommonRoute()
.publishArticleToTrend(this@CoursePlayActivity, url!!, share.cover!!, share.title!!)
CourseIn.getDynamicService().publishArticleToTrend(this@CoursePlayActivity, url!!, share.cover!!, share.title!!)
}
override fun onPause() {
......
......@@ -3,7 +3,7 @@ package com.yidianling.course.router
import android.app.Activity
import android.content.Intent
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.yidianling.router.RouterManager
import com.yidianling.dynamic.api.IDynamicService
import com.yidianling.user.api.service.IUserService
/**
......@@ -13,6 +13,14 @@ import com.yidianling.user.api.service.IUserService
*/
object CourseIn {
fun getUserService(): IUserService {
return ModularServiceManager.provide(IUserService::class.java)
}
fun getDynamicService(): IDynamicService {
return ModularServiceManager.provide(IDynamicService::class.java)
}
fun isLogin(): Boolean {
return ModularServiceManager.provide(IUserService::class.java).isLogin()
}
......@@ -21,8 +29,4 @@ object CourseIn {
return ModularServiceManager.provide(IUserService::class.java).loginWayIntent(activity)
}
fun mainIntent(activity: Activity): Intent? {
return RouterManager.getAppRouter()?.mainIntent(activity)
}
}
\ No newline at end of file
package com.yidianling.course.router
import android.app.Activity
import android.content.Intent
import com.alibaba.android.arouter.launcher.ARouter
import com.ydl.media.audio.AudioPlayer
import com.yidianling.course.courseNew.CourseTopicActivity
import com.yidianling.router.course.ICourseRouter
/**
* Created by hgw on 2018/5/3.
*/
class CourseRouterImp : ICourseRouter{
override fun closePlayer() {
if (AudioPlayer.get().isPlaying) {
AudioPlayer.get().stopPlayer()
}
}
override fun isPlaying(): Boolean {
return AudioPlayer.get().isPlaying
}
override fun play(){
AudioPlayer.get().play()
}
override fun pause(){
AudioPlayer.get().playPause()
}
override fun startCoursePlayPage(activity: Activity, from: Int) {
ARouter.getInstance()
.build("/course/play")
.withInt("from", from)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
.withBoolean("isFromFloatView", false)
.navigation()
}
override fun courseTopic(activity: Activity, id: String){
return CourseTopicActivity.start(activity, id)
}
}
\ No newline at end of file
......@@ -98,13 +98,25 @@ dependencies {
api project(':ydl-webview')
api project(':ydl-platform')
api project(":ydl-pay")
implementation modularPublication('com.ydl:m-im-api')
implementation modularPublication('com.ydl:m-user-api')
implementation modularPublication('com.ydl:m-dynamic-api')
implementation modularPublication('com.ydl:m-tests-api')
implementation modularPublication('com.ydl:m-course-api')
implementation modularPublication('com.ydl:m-fm-api')
implementation modularPublication('com.ydl:m-consultant-api')
implementation modularPublication('com.ydl:m-confide-api')
}else {
//发布时使用
api rootProject.ext.dependencies["ydl-pay"]
compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-dynamic-api"]
compileOnly rootProject.ext.dependencies["ydl-m-tests-api"]
compileOnly rootProject.ext.dependencies["ydl-m-course-api"]
compileOnly rootProject.ext.dependencies["ydl-m-fm-api"]
compileOnly rootProject.ext.dependencies["ydl-m-consultant-api"]
compileOnly rootProject.ext.dependencies["ydl-m-confide-api"]
api rootProject.ext.dependencies["ydl-webview"]
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
......
......@@ -438,7 +438,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene
*/
private void JumpToPersonInfo() {
// OuterEmptyImp.jumpToPersonInfoActivity(MembersActivity.this);
startActivity(DynamicIn.INSTANCE.personalInfoIntent(this));
DynamicIn.INSTANCE.personalInfoIntent(this);
}
/**
......
......@@ -4,12 +4,19 @@ import android.app.Activity
import android.content.Intent
import android.support.v4.app.DialogFragment
import android.support.v7.app.AppCompatActivity
import com.ydl.confide.api.IConfideService
import com.ydl.course.api.ICourseService
import com.ydl.ydlcommon.actions.imagepicker.PickerCallback
import com.ydl.ydlcommon.actions.imagepicker.YdlImagePicker
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.yidianling.router.RouterManager
import com.yidianling.consultant.api.IConsultantService
import com.yidianling.dynamic.api.IDynamicService
import com.yidianling.fm.api.service.IFMService
import com.yidianling.im.api.service.IImService
import com.yidianling.tests.api.service.ITestsApiService
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.api.service.IAppService
import com.yidianling.user.api.service.IUserService
/**
......@@ -19,14 +26,42 @@ import com.yidianling.user.api.service.IUserService
*/
object DynamicIn {
// fun getImService(): IMServiceImpl {
// return ModularServiceManager.provide(IMServiceImpl::class.java)
// }
fun getImService(): IImService {
return ModularServiceManager.provide(IImService::class.java)
}
fun getAppService(): IAppService {
return ModularServiceManager.provide(IAppService::class.java)
}
fun getUserService(): IUserService {
return ModularServiceManager.provide(IUserService::class.java)
}
fun getDynamicService(): IDynamicService {
return ModularServiceManager.provide(IDynamicService::class.java)
}
fun getCourseService(): ICourseService {
return ModularServiceManager.provide(ICourseService::class.java)
}
fun getTestsService(): ITestsApiService {
return ModularServiceManager.provide(ITestsApiService::class.java)
}
fun getFMService(): IFMService {
return ModularServiceManager.provide(IFMService::class.java)
}
fun getConsultService(): IConsultantService {
return ModularServiceManager.provide(IConsultantService::class.java)
}
fun getConfideService(): IConfideService {
return ModularServiceManager.provide(IConfideService::class.java)
}
/**
* 获取专家主页url
*/
......@@ -48,98 +83,89 @@ object DynamicIn {
return getUserService().loginWayIntent(activity)
}
fun personalInfoIntent(activity: Activity): Intent? {
return RouterManager.getAppRouter()?.personalInfoIntent(activity)
fun personalInfoIntent(activity: Activity){
getAppService().personalInfoIntent(activity)
}
fun inputPhoneIntent(activity: Activity, smsAction: String): Intent? {
return getUserService().inputPhoneIntent(activity, smsAction)
}
fun mainIntent(activity: Activity): Intent? {
return RouterManager.getAppRouter()?.mainIntent(activity)
}
fun expertSearchIntent(activity: Activity, category: Int, showType: Int, isInitShowHot: Boolean): Intent? {
return RouterManager.getConsultantRouter()?.expertSearchIntent(activity, category, showType, isInitShowHot)
fun mainIntent(activity: Activity){
getAppService().mainIntent(activity)
}
fun testResultIntent(activity: Activity, testResultId: Int): Intent? {
return RouterManager.getTestsRouter()?.testResultIntent(activity, testResultId)
fun mainIntent(activity: Activity,tab :Int){
getAppService().mainIntent(activity,tab,false)
}
fun testDetailIntent(activity: Activity, testId: Int): Intent? {
return RouterManager.getTestsRouter()?.testDetailIntent(activity, testId)
fun expertSearchIntent(activity: Activity, category: Int, showType: Int, isInitShowHot: Boolean): Intent? {
return getConsultService().expertSearchIntent(activity, category, showType, isInitShowHot)
}
fun testResultH5(testResultId: Int){
RouterManager.getTestsRouter()!!.testH5Result(testResultId.toString())
getTestsService().testH5Result(testResultId.toString())
}
fun testDetailH5(testId: Int){
RouterManager.getTestsRouter()?.testDetailH5(testId.toString());
getTestsService().testDetailH5(testId.toString());
}
fun phoneCallIntent(activity: Activity): Intent? {
return RouterManager.getPhoneCallRouter()?.phoneCallIntent(activity)
return getConfideService().phoneCallIntent(activity)
}
fun fmDetailIntent(activity: Activity, fmId: Int): Intent? {
return RouterManager.getFMRouter()?.fmDetailIntent(activity, fmId)
return getFMService().fmDetailIntent(activity, fmId)
}
fun getFmId(): Int {
return RouterManager.getFMRouter()?.getFmId() ?: 0
return getFMService().getFmId() ?: 0
}
fun testAnswerIntent(activity: Activity): Intent? {
return RouterManager.getTestsRouter()?.testAnswerIntent(activity)
}
fun rechargeIntent(activity: Activity): Intent? {
return RouterManager.getAppRouter()?.rechargeIntent(activity)
fun rechargeIntent(activity: Activity){
getAppService().rechargeIntent(activity)
}
fun phoneCallFragment(head: String, callId: String): DialogFragment? {
return RouterManager.getPhoneCallRouter()?.phoneCallFragment(head, callId)
return getConfideService().phoneCallFragment(head, callId)
}
fun startChat(activity: AppCompatActivity, toUid: String) {
RouterManager.getImRouter().startP2PSession(activity, toUid)
getImService().startP2PSession(activity, toUid)
}
fun isFmPlaying(): Boolean {
return RouterManager.getFMRouter()?.isPlaying() ?: false
return getFMService().isPlaying() ?: false
}
fun isCoursePlaying(): Boolean {
return RouterManager.getCourseRouter()?.isPlaying() ?: false
return getCourseService().isPlaying() ?: false
}
fun playCourse(){
if (!isCoursePlaying()){
RouterManager.getCourseRouter()?.play()
getCourseService().play()
}
}
fun pauseCourse(){
if (isCoursePlaying()){
RouterManager.getCourseRouter()?.pause()
getCourseService().pause()
}
}
fun rePlayFM(){
RouterManager.getFMRouter()?.replay()
getFMService().replay()
}
fun pauseFm(){
RouterManager.getFMRouter()?.pause()
getFMService().pause()
}
fun showSelector(activity: Activity, requestCode: Int) {
RouterManager.getImRouter().showSelector(activity, requestCode)
getImService().showSelector(activity, requestCode)
}
fun startPicker(activity: AppCompatActivity, openCamera: Boolean, callback: PickerCallback) {
......@@ -150,6 +176,6 @@ object DynamicIn {
* 课程播放页
*/
fun startCoursePlayPage(activity: Activity){
RouterManager.getCourseRouter()?.startCoursePlayPage(activity,1)
getCourseService().startCoursePlayPage(activity,1)
}
}
\ No newline at end of file
package com.yidianling.dynamic.router
import android.app.Activity
import android.content.Context
import android.content.Intent
import com.yidianling.dynamic.activity.TrendsReplyInfoActivity
import com.yidianling.dynamic.members.MembersActivity
import com.yidianling.dynamic.publishTrend.PublishTrendActivity
import com.yidianling.dynamic.topic.topicDetail.TopicDetailActivity
import com.yidianling.dynamic.trendsDetail.TrendsDetailActivity
import com.yidianling.dynamic.api.IDynamicService
import com.yidianling.router.dynamic.IDynamicRouter
class DynamicRouterImp : IDynamicRouter {
override fun membersIntent(activity: Activity, userId: String): Intent {
return MembersActivity.newIntent(activity, userId)
}
override fun replyInfoIntent(activity: Activity, replyId: String, aid: String): Intent {
return TrendsReplyInfoActivity.newIntent(activity, replyId, aid)
}
override fun trendsDetailIntent(activity: Activity, trendId: Int): Intent {
return TrendsDetailActivity.newIntent(activity, trendId)
}
override fun trendsDetailIntent(activity: Activity, trendId: Int, isScrollToZan: Boolean): Intent {
return TrendsDetailActivity.newIntent(activity, trendId, isScrollToZan)
}
override fun trendsDetailIntent(activity: Activity, trendId: Int, isScrollToZan: Boolean, lastId: Int): Intent {
return TrendsDetailActivity.newIntent(activity, trendId, isScrollToZan, lastId)
}
override fun publishTrendIntent(activity: Activity, url: String, cover: String, title: String): Intent {
return PublishTrendActivity.newIntent(activity, url, cover, title)
}
override fun publishFmToTrend(activity: Activity, url: String, cover: String, title: String): Intent {
return PublishTrendActivity.newIntentForFm(activity, url, cover, title, 1)
}
override fun publishArticleToTrend(activity: Activity, url: String, cover: String, title: String): Intent {
return PublishTrendActivity.newIntentForArticle(activity, url, cover, title)
}
override fun topicDetailIntent(context: Context, isSplash: Boolean, topicId: String): Intent {
return TopicDetailActivity.newIntent(context, isSplash, topicId)
}
}
\ No newline at end of file
......@@ -163,7 +163,7 @@ public class ShowIntroduceDialogFragment extends BaseDialogFragment {
@Override
public void onClick(View v) {
// OuterEmptyImp.jumpToRechargeActivity(getActivity(),needRecharge+"");
startActivity(DynamicIn.INSTANCE.rechargeIntent(getActivity()));
DynamicIn.INSTANCE.rechargeIntent(getActivity());
// Intent intent = new Intent(getActivity(), RechargeActivity.class);
// intent.putExtra("money", needRecharge + "");
// startActivity(intent);
......
......@@ -376,7 +376,7 @@ public class TopicDetailActivity extends BaseMvpActivity<TopicDetailView, TopicD
private void back() {
if (isSplash) {
startActivity(DynamicIn.INSTANCE.mainIntent(this));
DynamicIn.INSTANCE.mainIntent(this);
}
finish();
}
......@@ -437,7 +437,7 @@ public class TopicDetailActivity extends BaseMvpActivity<TopicDetailView, TopicD
dialog.dismiss();
});
backhome_lin.setOnClickListener(v -> {
startActivity(DynamicIn.INSTANCE.mainIntent(this));
DynamicIn.INSTANCE.mainIntent(this);
dialog.dismiss();
});
}
......
......@@ -1134,7 +1134,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
}
} else if (v.getId() == R.id.image_back) {
if (isFromSplash) {
startActivity(DynamicIn.INSTANCE.mainIntent(this));
DynamicIn.INSTANCE.mainIntent(this);
finish();
}
setResultForActivity();
......@@ -1672,11 +1672,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
}
private void backHome() {
Intent intent = DynamicIn.INSTANCE.mainIntent(this);
Bundle bundle = new Bundle();
bundle.putInt("selectTab", 0);
intent.putExtra("bundle", bundle);
startActivity(intent);
DynamicIn.INSTANCE.mainIntent(this,0);
}
/**
......
......@@ -75,11 +75,13 @@ dependencies {
api project(":ydl-platform")
api project(':m-user')
implementation modularPublication('com.ydl:m-user-api')
implementation modularPublication('com.ydl:m-dynamic-api')
implementation project(':ydl-media')
} else {
//发布时使用
implementation rootProject.ext.dependencies["ydl-media"]
implementation rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-dynamic-api"]
implementation (rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
......
......@@ -576,7 +576,7 @@ public class FMDetailActivity extends BaseActivity implements View.OnClickListen
private void Back() {
if (isSplash) {
// FMOut.INSTANCE.startMain(this);
startActivity(FMIn.INSTANCE.mainIntent(this));
FMIn.INSTANCE.mainIntent(this);
finish();
} else {
finish();
......
......@@ -3,7 +3,8 @@ package com.yidianling.fm.router
import android.app.Activity
import android.content.Intent
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.yidianling.router.RouterManager
import com.yidianling.dynamic.api.IDynamicService
import com.yidianling.user.api.service.IAppService
import com.yidianling.user.api.service.IUserService
/**
......@@ -12,14 +13,20 @@ import com.yidianling.user.api.service.IUserService
* time : 2018/04/25
*/
object FMIn {
fun getAppService(): IAppService {
return ModularServiceManager.provide(IAppService::class.java)
}
fun getDynamicService(): IDynamicService {
return ModularServiceManager.provide(IDynamicService::class.java)
}
fun isLogin(): Boolean {
return ModularServiceManager.provide(IUserService::class.java).isLogin()
}
fun mainIntent(activity: Activity): Intent? {
//todo xujian 跳转到MainActivity 待修改
return RouterManager.getAppRouter()?.mainIntent(activity)
fun mainIntent(activity: Activity){
getAppService().mainIntent(activity)
}
fun loginWayIntent(activity: Activity): Intent? {
......@@ -30,8 +37,7 @@ object FMIn {
* FM分享到心事动态
*/
fun publisFmToTrend(activity: Activity, url: String, cover: String, title: String) : Intent?{
//todo xujian 待修改
return RouterManager.getDynamicRouter()?.publishFmToTrend(activity,url,cover,title)
return getDynamicService()?.publishFmToTrend(activity,url,cover,title)
}
......
package com.yidianling.fm.router
import android.app.Activity
import android.content.Intent
import com.ydl.media.audio.AudioPlayer
import com.ydl.media.view.PlayerFloatHelper
import com.yidianling.fm.FMDetailActivity
import com.yidianling.router.fm.IFMRouter
class FmRouterImp : IFMRouter{
override fun fmDetailIntent(activity: Activity, id: Int): Intent {
return FMDetailActivity.newIntent(activity, id)
}
override fun fmDetailIntent(activity: Activity, id: Int, isSplash: Boolean): Intent {
return FMDetailActivity.newIntent(activity, id, isSplash)
}
override fun getFmId(): Int {
return PlayerFloatHelper.getFmId()
}
override fun closePlayer() {
if (AudioPlayer.get().isPlaying) {
AudioPlayer.get().stopPlayer()
}
}
override fun isPlaying(): Boolean {
return AudioPlayer.get().isPlaying
}
override fun pause(){
AudioPlayer.get().pausePlayer()
}
override fun replay() {}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -58,25 +58,30 @@ class HomeConsultBean: HomeItemBaseBean {
*/
//字段名称改了
var uid: Int = 0
var doctorUid: Int = 0
var doctorId: String = ""
var doctorName: String? = null
var doctorHead: String? = null
var profesBack: String? = null
var name: String = ""
var doctorName: String = ""
var head: String = ""
var doctorHead: String = ""
var profesBack: String = ""
var minBookingPrice: Int = 0
var serviceFee: Int = 0
var zixunOrderNum: Int = 0
var feedbackRate: Float = 0f
var province: String? = null
var city: String? = null
var province: String = ""
var city: String = ""
var isOnline: Int = 0
var mUrl: String? = null
var hUrl: String? = null
var mUrl: String = ""
var linkUrl: String = ""
var hUrl: String = ""
var share: ShareBean? = null
var isHiddenXcx: String? = null
var tags: String? = null
var isHiddenXcx: String = ""
var tags: String = ""
//私聊文案
var chatBtnText: String? = null
var chatBtnText: String = ""
class ShareBean {
/**
......@@ -87,11 +92,11 @@ class HomeConsultBean: HomeItemBaseBean {
* share_url : https://m.ydl.com/experts/1614
*/
var title: String? = null
var cover: String? = null
var desc: String? = null
var shareUrl: String? = null
var share_url: String? = null
var title: String = ""
var cover: String = ""
var desc: String = ""
var shareUrl: String = ""
var share_url: String = ""
}
}
}
......@@ -10,24 +10,24 @@ class HomePagerDataBean() {
this.type = type;
}
constructor(homeHeaderBean: HomeHeaderBean,
homeConsultBean: HomeConsultBean,
homeConfideBean: HomeConfideBean,
homeCourseBean: HomeCourseBean,
constructor(headerBean: HomeHeaderBean,
consultBean: HomeConsultBean,
confideBean: HomeConfideBean,
courseBean: HomeCourseBean,
testListBean: MutableList<HomeTestItemBean>?,
homeAskBean: HomeAskBean,
askBean: HomeAskBean,
museBean: MuseModuleBean,
homeFMBean: HomeFMBean,
homeArticleBean: HomeArticleBean):this(){
this.headerBean = homeHeaderBean
this.consultBean = homeConsultBean
this.articleBean = homeArticleBean
this.askBean = homeAskBean
this.courseBean = homeCourseBean
fmBean: HomeFMBean,
articleBean: HomeArticleBean):this(){
this.headerBean = headerBean
this.consultBean = consultBean
this.articleBean = articleBean
this.askBean = askBean
this.courseBean = courseBean
this.testListBean = testListBean
this.museBean = museBean
this.fmBean = homeFMBean
this.confideBean = homeConfideBean
this.fmBean = fmBean
this.confideBean = confideBean
}
/**
* 咨询模块数据
......
......@@ -22,13 +22,13 @@ class YdlHomeViewHolderConstract {
*/
val CONSULT_VIEW = 10003
/**
* 倾诉*排解模块
* 课程*成长模块
*/
val CONFIDE_VIEW = 10004
val COURSE_VIEW = 10004
/**
* 课程*成长模块
* 倾诉*排解模块
*/
val COURSE_VIEW = 10005
val CONFIDE_VIEW = 10005
/**
* 测试模块
*/
......
......@@ -34,8 +34,6 @@ import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.ydl.ydlcommon.view.dialog.CommonDialog
import com.yidianling.router.RouterManager
import com.yidianling.router.im.IMRequestCallback
import com.yidianling.tests.api.service.ITestsApiService
import com.yidianling.user.api.service.IUserService
import org.json.JSONObject
......
......@@ -27,6 +27,7 @@ import io.reactivex.functions.Consumer
import io.reactivex.schedulers.Schedulers
import java.text.SimpleDateFormat
import java.util.*
import java.util.concurrent.TimeUnit
/**
......@@ -55,17 +56,17 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac
.setHotSearch(it)
}
}
//BUTTON_BANNER_VIEW的数据与PAGER_BANNER_VIEW一致,不需要再次设置
// YdlHomeViewHolderConstract.BUTTON_BANNER_VIEW -> {
// homeBean.headerBean = dataBean.headerBean
// }
YdlHomeViewHolderConstract.CONSULT_VIEW -> {
YdlHomeViewHolderConstract.BUTTON_BANNER_VIEW -> {
homeBean.headerBean = dataBean.headerBean
dataBean.headerBean?.keywordData?.let {
ModularServiceManager.provide(IConsultantService::class.java)
.setHotSearch(it)
}
}
YdlHomeViewHolderConstract.CONSULT_VIEW -> {
homeBean.consultBean = dataBean.consultBean
}
YdlHomeViewHolderConstract.CONFIDE_VIEW -> {
homeBean.headerBean = dataBean.headerBean
homeBean.confideBean = dataBean.confideBean
}
YdlHomeViewHolderConstract.COURSE_VIEW -> {
......@@ -244,13 +245,21 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac
}, Action {
homeList.sortWith(compareBy { it.type })
//更新本地缓存数据,这边顶部数据保存了两份,一个10001,一个10002,防止第二次进来读取的时候homeDataResponse回调中的remove(0)把10002删除
SharedPreferencesEditor.putString(CACHE_HOME_PAGER_DATA, Gson().toJson(homeList))
Observable.interval(5000, TimeUnit.SECONDS)
.compose(RxUtils.applySchedulers(mView))
.subscribe {
SharedPreferencesEditor.putString(CACHE_HOME_PAGER_DATA, Gson().toJson(homeList))
SharedPreferencesEditor.putString(IS_NEW_CACHE_HOME_PAGER_DATA, true.toString())
SharedPreferencesEditor.putString(
HOME_PAGER_DATA_CACHE_VERISON,
RxAppTool.getAppVersionCode(BaseApp.getApp()).toString()
)
}
mView.homeDataResponse(homeList)
SharedPreferencesEditor.putString(IS_NEW_CACHE_HOME_PAGER_DATA, true.toString())
SharedPreferencesEditor.putString(
HOME_PAGER_DATA_CACHE_VERISON,
RxAppTool.getAppVersionCode(BaseApp.getApp()).toString()
)
HomeLogPrinter.printLongLog(
HomePresenterImpl::class.java.simpleName,
Gson().toJson(homeList)
......
......@@ -49,7 +49,7 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
//设置头像
setHead(bean)
//设置名称
tv_consult_name.text = bean.doctorName
tv_consult_name.text = bean.name
//咨询师标签
tag_view.initData(StringUtils.strToList(bean.tags))
//设置向TA倾诉人数
......@@ -70,7 +70,7 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
* 设置头像
*/
private fun setHead(bean: HomeConsultBean.ListBean) {
YDLImageCacheManager.showImage(mContext, bean?.doctorHead, img_consult_head)
YDLImageCacheManager.showImage(mContext, bean?.head, img_consult_head)
}
/**
......@@ -139,7 +139,7 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
}
private fun setPrice(bodyBean: HomeConsultBean.ListBean) {
val confideFee = bodyBean.serviceFee
val confideFee = bodyBean.minBookingPrice
tv_consult_price.text = "¥$confideFee"
}
}
......@@ -133,14 +133,22 @@ class HomePresenterImpl: BaseHomePresenterImpl<IHomeContract.View, IHomeContract
}
}, Action {
homeList.sortWith(compareBy { it.type })
//更新本地缓存数据
Observable.interval(5000, TimeUnit.SECONDS)
.compose(RxUtils.applySchedulers(mView))
.subscribe {
SharedPreferencesEditor.putString(CACHE_HOME_PAGER_DATA, Gson().toJson(homeList))
SharedPreferencesEditor.putString(IS_NEW_CACHE_HOME_PAGER_DATA, true.toString())
SharedPreferencesEditor.putString(
HOME_PAGER_DATA_CACHE_VERISON,
RxAppTool.getAppVersionCode(BaseApp.getApp()).toString()
)
}
mView.homeDataResponse(homeList)
//更新本地缓存数据
SharedPreferencesEditor.putString(CACHE_HOME_PAGER_DATA, Gson().toJson(homeList))
SharedPreferencesEditor.putString(IS_NEW_CACHE_HOME_PAGER_DATA, true.toString())
SharedPreferencesEditor.putString(
HOME_PAGER_DATA_CACHE_VERISON,
RxAppTool.getAppVersionCode(BaseApp.getApp()).toString()
)
HomeLogPrinter.printLongLog(
HomePresenterImpl::class.java.simpleName,
Gson().toJson(homeList)
......
......@@ -98,10 +98,20 @@ dependencies {
implementation modularPublication('com.ydl:m-user-api')
implementation modularPublication('com.ydl:m-dynamic-api')
implementation modularPublication('com.ydl:m-tests-api')
implementation modularPublication('com.ydl:m-course-api')
implementation modularPublication('com.ydl:m-fm-api')
implementation modularPublication('com.ydl:m-consultant-api')
implementation modularPublication('com.ydl:m-confide-api')
}else {
//发布时使用
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-dynamic-api"]
compileOnly rootProject.ext.dependencies["ydl-m-tests-api"]
compileOnly rootProject.ext.dependencies["ydl-m-course-api"]
compileOnly rootProject.ext.dependencies["ydl-m-fm-api"]
compileOnly rootProject.ext.dependencies["ydl-m-consultant-api"]
compileOnly rootProject.ext.dependencies["ydl-m-confide-api"]
api rootProject.ext.dependencies["ydl-webview"]
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
......
......@@ -62,7 +62,7 @@ import com.yidianling.im.session.extension.CustomAttachmentPhoneCallSystemNotice
import com.yidianling.im.session.extension.CustomRecommendExpertListMsg;
import com.yidianling.im.session.extension.CustomSystemTips;
import com.yidianling.im.ui.widget.ChatTeamHisDialog;
import com.yidianling.router.im.IMExpertBuild;
import com.yidianling.im.api.bean.IMExpertBuild;
import com.yidianling.uikit.business.session.helper.MessageListPanelHelper;
import com.yidianling.uikit.custom.bridge.IP2PCustomActionHandler;
import com.yidianling.uikit.custom.http.response.RecommendExpertBean;
......@@ -170,7 +170,7 @@ public class P2PCustomActionHandlerImpl implements IP2PCustomActionHandler {
// Bundle bundle = new Bundle();
// bundle.putString("to_uid",toChatUsername);
// ImIn.INSTANCE.SendRedPacketActivity(activity,bundle,44);
activity.startActivityForResult(ImIn.INSTANCE.sendRedPacketIntent(activity, toChatUsername), 44);
ImIn.INSTANCE.sendRedPacketIntent(activity, toChatUsername,44);
}
//判定是否是今天第一次发送提醒上线通知,不是的话则不发消息通知|普通消息
......@@ -588,7 +588,7 @@ public class P2PCustomActionHandlerImpl implements IP2PCustomActionHandler {
dialog.dismiss();
break;
case "返回首页":
mActivity.startActivity(ImIn.INSTANCE.mainIntent(mActivity, 0));
ImIn.INSTANCE.mainIntent(mActivity, 0);
dialog.dismiss();
break;
case "客服热线":
......@@ -916,7 +916,7 @@ public class P2PCustomActionHandlerImpl implements IP2PCustomActionHandler {
@Override
public void startFeedback(Context context) {
context.startActivity(ImIn.INSTANCE.feedBackIntent((Activity) context));
ImIn.INSTANCE.feedBackIntent((Activity) context);
}
@Override
......
......@@ -24,7 +24,7 @@ import com.yidianling.im.config.constants.ImConstants;
import com.yidianling.im.http.ImRetrofitApi;
import com.yidianling.im.router.ImIn;
import com.yidianling.im.session.SessionHelper;
import com.yidianling.router.im.IMExpertBuild;
import com.yidianling.im.api.bean.IMExpertBuild;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
......
......@@ -10,7 +10,7 @@ import com.yidianling.im.ui.page.fragment.bean.ChatModelBean
import com.yidianling.im.ui.page.fragment.bean.InteractBean
import com.yidianling.im.ui.page.fragment.bean.NoticeItemBean
import com.yidianling.im.ui.page.fragment.bean.UnreadMessageBean
import com.yidianling.router.im.IMExpertBuild
import com.yidianling.im.api.bean.IMExpertBuild
import io.reactivex.Observable
import retrofit2.http.*
......
......@@ -7,7 +7,7 @@ import com.yidianling.im.message.param.MsgListParam
import com.yidianling.im.message.param.ReadParam
import com.yidianling.im.ui.page.fragment.bean.*
import com.yidianling.im.ui.param.*
import com.yidianling.router.im.IMExpertBuild
import com.yidianling.im.api.bean.IMExpertBuild
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseResponse
import io.reactivex.Observable
......
......@@ -17,7 +17,7 @@ import com.yidianling.im.ui.page.fragment.bean.InteractBean
import com.yidianling.im.ui.page.fragment.bean.NoticeItemBean
import com.yidianling.im.ui.page.fragment.bean.UnreadMessageBean
import com.yidianling.im.ui.param.*
import com.yidianling.router.im.IMExpertBuild
import com.yidianling.im.api.bean.IMExpertBuild
import io.reactivex.Observable
/**
......
......@@ -9,7 +9,7 @@ import com.yidianling.im.bean.CourseStatusBean
import com.yidianling.im.bean.DoctorAssistantRespDtoBean
import com.yidianling.im.bean.PushConfideStatusBean
import com.yidianling.im.bean.RedPacketDetailBean
import com.yidianling.router.im.IMExpertBuild
import com.yidianling.im.api.bean.IMExpertBuild
import io.reactivex.Observable
import retrofit2.http.*
......
......@@ -19,6 +19,7 @@ import com.yidianling.im.api.bean.IMRequestCallback
import com.yidianling.im.api.service.IImService
import com.yidianling.im.bridge.P2PCustomActionHandlerImpl
import com.yidianling.im.helper.IMUtil
import com.yidianling.im.helper.MsgReceiveHelper
import com.yidianling.im.preference.IMCache
import com.yidianling.im.router.ImIn
import com.yidianling.im.session.SessionHelper
......@@ -35,6 +36,10 @@ import com.yidianling.uikit.business.session.helper.MessageListPanelHelper
@Route(path = "/im/ImService")
class IMServiceImpl : IImService {
override fun isHasUnread(): Boolean {
return MsgReceiveHelper.isHasUnread
}
override fun init(context: Context?) {
}
......
package com.yidianling.im.router
import android.app.Activity
import android.content.Context
import android.support.v7.app.AppCompatActivity
import com.netease.nimlib.sdk.NIMClient
import com.netease.nimlib.sdk.RequestCallback
import com.netease.nimlib.sdk.auth.AuthService
import com.netease.nimlib.sdk.auth.LoginInfo
import com.netease.nimlib.sdk.msg.MessageBuilder
import com.netease.nimlib.sdk.msg.MsgService
import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum
import com.ydl.ydlcommon.router.YdlCommonOut
import com.ydl.ydlcommon.utils.StringUtils
import com.yidianling.im.R
import com.yidianling.im.bridge.P2PCustomActionHandlerImpl
import com.yidianling.im.helper.IMUtil
import com.yidianling.im.preference.IMCache
import com.yidianling.im.session.SessionHelper
import com.yidianling.im.session.extension.CustomAttachSubScriptTime
import com.yidianling.im.session.extension.CustomAttachmentTest
import com.yidianling.nimbase.common.media.picker.PickImageHelper
import com.yidianling.router.im.IIMRouter
import com.yidianling.router.im.IMLoginInfo
import com.yidianling.router.im.IMRequestCallback
import com.yidianling.uikit.api.NimUIKit
import com.yidianling.uikit.business.session.helper.MessageListPanelHelper
/**
* author : Zhangwenchao
* e-mail : zhangwch@yidianling.com
* time : 2018/04/23
* 暴漏给其他module使用
*/
class IMRouterImp : IIMRouter {
override fun startP2PSession(context: AppCompatActivity, toUid: String) {
IMUtil.startChat(context, toUid, IMUtil.FLAG_SAVE or IMUtil.FLAG_USE_UM, 0, null)
}
override fun startP2PXiaoYi(context: Context) {
if (!ImIn.isLogin()) {
context.startActivity(ImIn.loginWayIntent(context))
return
}
SessionHelper.startP2PSession(context, -1, "14", null,
P2PCustomActionHandlerImpl("14",
"客服小壹", "https://static.ydlcdn.com/mobile/images/avatar_girl_app.png"))
}
override fun imLogin(info: IMLoginInfo) {
NimUIKit.setAccount(info.account)
try {
NIMClient.getService(AuthService::class.java).login(LoginInfo(info.account, info.passWord))
} catch (e: Exception) {
e.printStackTrace()
}
}
override fun login(info: IMLoginInfo, callback: IMRequestCallback<IMLoginInfo>?) {
NimUIKit.login(LoginInfo(info.account, info.passWord), object : RequestCallback<LoginInfo> {
override fun onSuccess(param: LoginInfo?) {
if (param != null) {
val newParam = IMLoginInfo(param.account, param.token)
callback?.onSuccess(newParam)
}
}
override fun onFailed(code: Int) {
callback?.onFailed(code)
}
override fun onException(exception: Throwable?) {
callback?.onException(exception)
}
})
}
override fun setAccount(account: String) {
NimUIKit.setAccount(account)
}
override fun setChattingAccountAll() {
NIMClient.getService(MsgService::class.java).setChattingAccount(MsgService.MSG_CHATTING_ACCOUNT_ALL, SessionTypeEnum.None)
}
override fun setChattingAccountNone() {
NIMClient.getService(MsgService::class.java).setChattingAccount(MsgService.MSG_CHATTING_ACCOUNT_NONE, SessionTypeEnum.None)
}
override fun logout() {
NIMClient.getService(AuthService::class.java).logout()
}
override fun clear() {
NimUIKit.logout()
IMCache.clear()
}
override fun createTextMessage(sessionId: String?, content: String, callback: IMRequestCallback<Void>) {
val message = MessageBuilder.createTextMessage(sessionId, SessionTypeEnum.P2P, content)
NIMClient.getService(MsgService::class.java)
.sendMessage(message, false)
.setCallback(object : RequestCallback<Void> {
override fun onSuccess(param: Void?) {
callback.onSuccess(param)
MessageListPanelHelper.getInstance().notifyAddMessage(message)
}
override fun onException(exception: Throwable?) {
callback.onException(exception)
}
override fun onFailed(code: Int) {
callback.onFailed(code)
}
})
}
override fun sendSubscriptionTimeMessage(sessionId: String?, content: String, callback: IMRequestCallback<Void>) {
val customTime = CustomAttachSubScriptTime(content)
val message = MessageBuilder.createCustomMessage(sessionId, SessionTypeEnum.P2P, content, customTime)
NIMClient.getService(MsgService::class.java)
.sendMessage(message, false)
.setCallback(object : RequestCallback<Void> {
override fun onSuccess(param: Void?) {
callback.onSuccess(param)
MessageListPanelHelper.getInstance().notifyAddMessage(message)
}
override fun onException(exception: Throwable?) {
callback.onException(exception)
}
override fun onFailed(code: Int) {
callback.onFailed(code)
}
})
}
override fun showSelector(activity: Activity, requestCode: Int) {
val option = PickImageHelper.PickImageOption()
option.titleResId = R.string.im_input_panel_photo
option.multiSelect = true
option.multiSelectMaxCount = 9
option.crop = false
option.cropOutputImageWidth = 720
option.cropOutputImageHeight = 720
// option.outputPath = StorageUtil.getWritePath(StringUtils.get32UUID() + ".jpg", StorageType.TYPE_TEMP)
option.outputPath = YdlCommonOut.getApp().externalCacheDir.absolutePath + "/" + StringUtils.get32UUID() + ".jpg"
PickImageHelper.pickImage(activity, requestCode, option)
}
override fun sendTestResultMessage(uid: String, content: String, title: String?, head: String?, url: String?, id: Int, share_url: String?, callback: IMRequestCallback<Void>) {
val customAttachmentTest = CustomAttachmentTest(
CustomAttachmentTest.FLAG_RESULT,
title,
head,
url,
id,
share_url
)
val message = MessageBuilder.createCustomMessage(uid, SessionTypeEnum.P2P, "测试结果", customAttachmentTest)
NIMClient.getService(MsgService::class.java).sendMessage(message, false).setCallback(object : RequestCallback<Void> {
override fun onSuccess(param: Void?) {
callback.onSuccess(param)
MessageListPanelHelper.getInstance().notifyAddMessage(message)
}
override fun onFailed(code: Int) {
callback.onFailed(code)
}
override fun onException(exception: Throwable?) {
callback.onException(exception)
}
})
}
/**
* 跳转私聊界面
*/
override fun startChat(context: AppCompatActivity, toUid: String, flag: Int, canTalk: Int) {
//这里虽然是倾述流程进入私聊,但不需要发送自定义消息
IMUtil.startChat(context, toUid, 0x001, canTalk, null, 0, false)
}
}
\ No newline at end of file
......@@ -4,25 +4,33 @@ import android.app.Activity
import android.content.Context
import android.content.Intent
import android.util.Log
import com.alibaba.android.arouter.launcher.ARouter
import com.netease.nimlib.sdk.NIMClient
import com.netease.nimlib.sdk.RequestCallback
import com.netease.nimlib.sdk.auth.LoginInfo
import com.netease.nimlib.sdk.msg.MsgService
import com.netease.nimlib.sdk.uinfo.UserService
import com.netease.nimlib.sdk.uinfo.constant.UserInfoFieldEnum
import com.ydl.confide.api.IConfideService
import com.ydl.course.api.ICourseService
import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.bean.GlobalInfo
import com.ydl.ydlcommon.data.PlatformDataManager
import com.ydl.ydlcommon.data.http.GsonProvider
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.yidianling.consultant.api.IConsultantService
import com.yidianling.dynamic.api.IDynamicService
import com.yidianling.fm.api.service.IFMService
import com.yidianling.im.api.bean.ReceiveRedPacketParam
import com.yidianling.im.api.service.IImService
import com.yidianling.im.config.constants.UserPreferences
import com.yidianling.im.modular.service.IMServiceImpl
import com.yidianling.im.preference.IMCache
import com.yidianling.router.RouterManager
import com.yidianling.router.app.ReceiveRedPacketParam
import com.yidianling.tests.api.service.ITestsApiService
import com.yidianling.uikit.api.NimUIKit
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.api.service.IAppService
import com.yidianling.user.api.service.IUserService
/**
......@@ -32,14 +40,42 @@ import com.yidianling.user.api.service.IUserService
*/
object ImIn {
fun getImService(): IMServiceImpl {
return ModularServiceManager.provide(IMServiceImpl::class.java)
fun getImService(): IImService {
return ModularServiceManager.provide(IImService::class.java)
}
fun getAppService(): IAppService {
return ModularServiceManager.provide(IAppService::class.java)
}
fun getUserService(): IUserService {
return ModularServiceManager.provide(IUserService::class.java)
}
fun getDynamicService(): IDynamicService {
return ModularServiceManager.provide(IDynamicService::class.java)
}
fun getCourseService(): ICourseService{
return ModularServiceManager.provide(ICourseService::class.java)
}
fun getTestsService(): ITestsApiService{
return ModularServiceManager.provide(ITestsApiService::class.java)
}
fun getFMService(): IFMService{
return ModularServiceManager.provide(IFMService::class.java)
}
fun getConsultService(): IConsultantService {
return ModularServiceManager.provide(IConsultantService::class.java)
}
fun getConfideService(): IConfideService {
return ModularServiceManager.provide(IConfideService::class.java)
}
/**
* 获取专家主页url
*/
......@@ -55,10 +91,6 @@ object ImIn {
return HttpConfig.H5_URL+"booking/order-detail?orderid="
}
fun closeMeidplayer(){
RouterManager.getCourseRouter()?.closePlayer()
RouterManager.getFMRouter()?.closePlayer()
}
/**
* 更新用户设置
*/
......@@ -79,40 +111,34 @@ object ImIn {
}
fun membersIntent(activity: Activity, userId: String): Intent? {
// TODO: 2019-12-12 待替换 by:HaoRui
return RouterManager.getDynamicRouter()?.membersIntent(activity, userId)
return getDynamicService().membersIntent(activity, userId)
}
fun replayInfoIntent(activity: Activity, replyId: String, aid: String): Intent? {
// TODO: 2019-12-12 待替换 by:HaoRui
return RouterManager.getDynamicRouter()?.replyInfoIntent(activity, replyId, aid)
return getDynamicService().replyInfoIntent(activity, replyId, aid)
}
fun myRedPockIntent(activity: Activity): Intent? {
return RouterManager.getAppRouter()?.myRedPockIntent(activity)
fun myRedPockIntent(activity: Activity){
getAppService().myRedPockIntent(activity)
}
fun trendsDetailIntent(activity: Activity, trendId: Int): Intent? {
// TODO: 2019-12-12 待替换 by:HaoRui
return RouterManager.getDynamicRouter()?.trendsDetailIntent(activity, trendId)
return getDynamicService().trendsDetailIntent(activity, trendId)
}
fun trendsDetailIntent(activity: Activity, trendId: Int, isScrollToZan: Boolean): Intent? {
// TODO: 2019-12-12 待替换 by:HaoRui
return RouterManager.getDynamicRouter()?.trendsDetailIntent(activity, trendId, isScrollToZan)
return getDynamicService().trendsDetailIntent(activity, trendId, isScrollToZan)
}
fun trendsDetailIntent(activity: Activity, trendId: Int, isScrollToZan: Boolean, lastId: Int): Intent? {
// TODO: 2019-12-12 待替换 by:HaoRui
return RouterManager.getDynamicRouter()?.trendsDetailIntent(activity, trendId, isScrollToZan, lastId)
return getDynamicService().trendsDetailIntent(activity, trendId, isScrollToZan, lastId)
}
/**
* 跳转话题详情
*/
fun topicDetailActivity(context: Context,topic_id : String){
var intent = RouterManager.getDynamicRouter()?.topicDetailIntent(context, false,topic_id)
var intent = getDynamicService().topicDetailIntent(context, false,topic_id)
intent?.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
context.startActivity(intent)
}
......@@ -121,32 +147,33 @@ object ImIn {
* 课程专题页面
*/
fun courseTopic(activity: Activity,id : String){
RouterManager.getCourseRouter()?.courseTopic(activity,id)
getCourseService().courseTopic(activity,id)
}
fun fmDetailIntent(activity: Activity, id: Int): Intent? {
return RouterManager.getFMRouter()?.fmDetailIntent(activity, id)
return getFMService().fmDetailIntent(activity, id)
}
fun sendRedPacketIntent(activity: Activity, toUid: String): Intent? {
return RouterManager.getAppRouter()?.sendRedPacketIntent(activity, toUid)
fun sendRedPacketIntent(activity: Activity, toUid: String,code:Int){
//getAppService().sendRedPacketIntent(activity, toUid)
ARouter.getInstance().build("/main/sendRedPacket").withString("to_uid",toUid).navigation(activity,code)
}
fun testResultH5(testResultId: Int){
RouterManager.getTestsRouter()!!.testH5Result(testResultId.toString())
getTestsService().testH5Result(testResultId.toString())
}
fun testDetailH5(testId: Int){
RouterManager.getTestsRouter()?.testDetailH5(testId.toString());
getTestsService().testDetailH5(testId.toString());
}
fun receiveRedPacketIntent(activity: Activity, param: ReceiveRedPacketParam): Intent? {
return RouterManager.getAppRouter()?.receiverRedPacketIntent(activity, param)
fun receiveRedPacketIntent(activity: Activity, param: ReceiveRedPacketParam){
getAppService().receiverRedPacketIntent(activity, GsonProvider.getGson().toJson(param))
}
fun inputPhoneIntent(activity: Activity, smsAction: String): Intent? {
return getUserService()?.inputPhoneIntent(activity, smsAction)
return getUserService().inputPhoneIntent(activity, smsAction)
}
/**
......@@ -256,16 +283,12 @@ object ImIn {
return getUserService().loginWayIntent(context)
}
/* fun mainIntent(context: Context): Intent? {
return RouterManager.getAppRouter()?.mainIntent(context)
}*/
fun mainIntent(context: Context, selectTab: Int): Intent? {
return RouterManager.getAppRouter()?.mainIntent(context, selectTab, false)
fun mainIntent(context: Context, selectTab: Int){
getAppService().mainIntent(context, selectTab, false)
}
fun feedBackIntent(activity: Activity): Intent? {
return RouterManager.getAppRouter()?.feedBackIntent(activity)
fun feedBackIntent(activity: Activity){
getAppService().feedBackIntent(activity)
}
fun getGlobalInfo(): GlobalInfo? {
......
......@@ -14,7 +14,7 @@ import com.yidianling.im.http.ImHttpImpl;
import com.yidianling.im.http.ImRetrofitApi;
import com.yidianling.im.http.param.ExpertParam;
import com.yidianling.nimbase.business.session.actions.BaseAction;
import com.yidianling.router.im.IMExpertBuild;
import com.yidianling.im.api.bean.IMExpertBuild;
import org.jetbrains.annotations.NotNull;
......
......@@ -16,7 +16,7 @@ import com.yidianling.im.http.ImRetrofitApi;
import com.yidianling.im.router.ImIn;
import com.yidianling.im.session.extension.CustomAttachRedPacket;
import com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter;
import com.yidianling.router.app.ReceiveRedPacketParam;
import com.yidianling.im.api.bean.ReceiveRedPacketParam;
import com.yidianling.uikit.business.session.viewholder.MsgViewHolderBase;
import com.yidianling.user.api.bean.UserResponseBean;
......@@ -83,7 +83,7 @@ public class MsgViewHolderRedPacket extends MsgViewHolderBase {
data.get_time
);
context.startActivity(ImIn.INSTANCE.receiveRedPacketIntent((Activity) context, param));
ImIn.INSTANCE.receiveRedPacketIntent((Activity) context, param);
}
}, throwable -> HttpErrorUtils.Companion.handleError(context, throwable));
......
......@@ -18,7 +18,7 @@ import com.yidianling.im.http.ImRetrofitApi;
import com.yidianling.im.router.ImIn;
import com.yidianling.im.session.extension.CustomAttachmentRedStatus;
import com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter;
import com.yidianling.router.app.ReceiveRedPacketParam;
import com.yidianling.im.api.bean.ReceiveRedPacketParam;
import com.yidianling.user.api.bean.UserResponseBean;
import com.yidianling.uikit.business.session.viewholder.MsgViewHolderBase;
......@@ -88,7 +88,7 @@ public class MsgViewHolderRedStatus extends MsgViewHolderBase {
user.getNickName(),
data.get_time
);
context.startActivity(ImIn.INSTANCE.receiveRedPacketIntent((Activity) context, param));
ImIn.INSTANCE.receiveRedPacketIntent((Activity) context, param);
}
......
......@@ -172,7 +172,7 @@ public class MsgListAdapter extends CommonAdapter<MsgData> {
case 1003:
// ImIn.INSTANCE.MyRedPackActivity(context,null);
context.startActivity(ImIn.INSTANCE.myRedPockIntent(context));
ImIn.INSTANCE.myRedPockIntent(context);
break;
}
}, new ThrowableConsumer() {
......
......@@ -19,7 +19,6 @@ import com.yidianling.im.ui.page.fragment.bean.ChatModelBean
import com.yidianling.im.ui.page.fragment.view.ChatFooterItemView
import com.yidianling.im.ui.page.widget.ChatUnusualView
import com.yidianling.im.ui.param.ChatParam
import com.yidianling.router.RouterManager
import de.greenrobot.event.EventBus
import kotlinx.android.synthetic.main.im_chat_fragment_layout.*
......@@ -268,9 +267,7 @@ class ChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
}
ll_chat_unusual_view.setListener(object : ChatUnusualView.ChatUnusualListener {
override fun onButtonClick() {
RouterManager.getConsultantRouter()?.let {
startActivity(RouterManager.getConsultantRouter()?.expertSearchIntent(activity, 0, 0, false))
}
startActivity(ImIn.getConsultService().expertSearchIntent(activity, 0, 0, false))
}
})
}
......
......@@ -4,8 +4,13 @@ import android.app.Activity
import android.content.Context
import android.support.v7.widget.RecyclerView
import android.view.ViewGroup
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.utils.StringUtils
import com.yidianling.im.bean.MsgDetail
import com.yidianling.im.config.constants.ImConstants
import com.yidianling.im.event.ReQureyUnreadNum
import com.yidianling.im.http.ImHttpImpl
import com.yidianling.im.message.param.MsgDetailParam
import com.yidianling.im.router.ImIn
......@@ -13,11 +18,6 @@ import com.yidianling.im.ui.page.fragment.bean.InteractItemBean
import com.yidianling.im.ui.page.fragment.view.InteractFooterItemView
import com.yidianling.im.ui.page.fragment.view.InteractItemView
import com.yidianling.im.ui.page.fragment.view.InteractTimeItemView
import com.yidianling.im.event.ReQureyUnreadNum
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.utils.StringUtils
import de.greenrobot.event.EventBus
import io.reactivex.android.schedulers.AndroidSchedulers
......@@ -87,7 +87,7 @@ class InteractAdapter(var context: Context, private var mList: ArrayList<Interac
1002 -> {
} //心事被回复
1003 -> { //首次说心事-送2元红包
context.startActivity(ImIn.myRedPockIntent(context as Activity))
ImIn.myRedPockIntent(context as Activity)
}
1004 -> {
} //心事收到温暖
......
......@@ -12,19 +12,18 @@ import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.ydl.webview.H5Params;
import com.ydl.webview.NewH5Activity;
import com.ydl.ydl_image.module.GlideApp;
import com.ydl.ydlcommon.adapter.BaseRecyclerAdapter;
import com.ydl.ydlcommon.bean.ShareData;
import com.ydl.ydlcommon.view.BaseViewHolder;
import com.ydl.ydlcommon.view.JumpTextView;
import com.yidianling.common.tools.LogUtil;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.R;
import com.yidianling.im.bean.SystemMsgBean;
import com.yidianling.im.router.ImIn;
import com.yidianling.router.RouterManager;
import com.ydl.ydlcommon.adapter.BaseRecyclerAdapter;
import com.ydl.ydlcommon.bean.ShareData;
import com.ydl.webview.H5Params;
import com.ydl.webview.NewH5Activity;
import com.ydl.ydlcommon.view.BaseViewHolder;
import com.ydl.ydlcommon.view.JumpTextView;
import java.util.ArrayList;
import java.util.List;
......@@ -201,7 +200,7 @@ public class SystemItemView extends LinearLayout {
String courseId = id;
ImIn.INSTANCE.courseTopic((Activity) context, courseId);
} else {
context.startActivity(ImIn.INSTANCE.mainIntent(context, 2));
ImIn.INSTANCE.mainIntent(context, 2);
}
break;
case "fm":
......@@ -214,7 +213,7 @@ public class SystemItemView extends LinearLayout {
//倾诉
if("/home".equals(uri.getPath())){
//倾诉首页
RouterManager.INSTANCE.getPhoneCallRouter().openConfideHome(context);
ImIn.INSTANCE.getConfideService().openConfideHome(context);
}
break;
}
......
package com.yidianling.im.api.bean;
/**
* Created by xj on 2019/6/27.
*/
public class IMDoctorBriefInfo {
public String smallImage = "";
public double feedbackRate = 0.000;
public int orderNum = 0;
public int helpLong = 0;
}
package com.yidianling.im.api.bean;
/**
* Created by hgw on 2018/3/13.
*/
public class IMExpertBuild {
public IMShareDataBuild shareData;
public String tips; //禁言提示内容
public String url;//禁言帮助URL
public IMDoctorBriefInfo doctorBriefInfo = new IMDoctorBriefInfo();
}
\ No newline at end of file
package com.yidianling.im.api.bean;
import com.google.gson.annotations.SerializedName;
/**
* Created by hgw on 2018/3/13.
*/
public class IMShareDataBuild {
public String toUid;
public String doctorId;
public String listenerId;
// public String name;
public String title;
@SerializedName(value = "isOnline", alternate = "is_online")
public int is_online;//专家倾述在线状态 1.在线 2.离线 3通话中 4-继续拨打 ,
public int isChatOnline;//专家私聊在线状态 1.在线 2.离线
public String cover;
public String desc;
@SerializedName(value = "urlShare", alternate = "url_share")
public String url_share;
public String price;
public String unitTxt;
public String url;
public String urlTitle;
public String blackStatus;
@SerializedName(value = "userType", alternate = "user_type")
public int user_type;//1用户,2专家,3助理
public int is_first;//1表示第一次聊天0不是
public paramsBuild params = new paramsBuild();
public int hasAvailableListenOrder;//是否还有未完成的倾诉订单 1、没有 2、有
public int listenOrderCommentStatus;//倾诉订单评论状态 1:未评价 9:已评价 ,
public String listenOrderCommentUrl;//倾诉订单评价页url
public String listenOrderUrl;//订单详情页面url
public String listenOrderDesc;//倾诉订单状态描述
public String listenOrderRemainTime;//未完成倾诉订单剩余时间
@SerializedName(value = "orderUrl", alternate = "order_url")
public String order_url;
@SerializedName(value = "name", alternate = "doctorName")
public String doctorName;
/**
* 是否开启电话倾诉
* 1.开启 2.关闭
*/
public int listenerIsOpen;
public static class paramsBuild {
//php接口此字段返回值始终为0,更换java接口后,服务端去掉了此字段,本地改动太多,先给默认值
public String orderid = "0";
}
public String tag1 = ""; //该字段是私聊改造项目新加的,用于在获取推荐专家列表的时候,catName字段
}
\ No newline at end of file
package com.yidianling.im.api.bean
import android.os.Parcel
import android.os.Parcelable
/**
* author : Zhangwenchao
* e-mail : zhangwch@yidianling.com
* time : 2018/05/04
*/
data class ReceiveRedPacketParam(
var status: Int = 0,
var money: String? = null,
var name: String? = null,
var headUrl: String? = null,
var expertUrl: String? = null,
var expertName: String? = null,
var expertTime: String? = null) : Parcelable {
constructor(parcel: Parcel) : this(
parcel.readInt(),
parcel.readString(),
parcel.readString(),
parcel.readString(),
parcel.readString(),
parcel.readString(),
parcel.readString()) {
}
override fun writeToParcel(parcel: Parcel, flags: Int) {
parcel.writeInt(status)
parcel.writeString(money)
parcel.writeString(name)
parcel.writeString(headUrl)
parcel.writeString(expertUrl)
parcel.writeString(expertName)
parcel.writeString(expertTime)
}
override fun describeContents(): Int {
return 0
}
companion object CREATOR : Parcelable.Creator<ReceiveRedPacketParam> {
override fun createFromParcel(parcel: Parcel): ReceiveRedPacketParam {
return ReceiveRedPacketParam(parcel)
}
override fun newArray(size: Int): Array<ReceiveRedPacketParam?> {
return arrayOfNulls(size)
}
}
}
\ No newline at end of file
......@@ -25,6 +25,8 @@ interface IImService : IProvider {
fun setChattingAccountNone()
fun isHasUnread():Boolean
fun login(info: IMLoginInfo, callback: IMRequestCallback<IMLoginInfo>?)
/**
......
......@@ -78,10 +78,14 @@ dependencies {
implementation project(':ydl-flutter-base')
implementation modularPublication('com.ydl:m-test-api')
implementation modularPublication('com.ydl:m-user-api')
implementation modularPublication('com.ydl:m-dynamic-api')
implementation modularPublication('com.ydl:m-im-api')
}else {
//发布时使用
compileOnly rootProject.ext.dependencies["ydl-m-tests-api"]
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-dynamic-api"]
compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
api rootProject.ext.dependencies["ydl-webview"]
api(rootProject.ext.dependencies["ydl-platform"]) {
......
......@@ -16,7 +16,7 @@ import com.ydl.ydlcommon.router.YdlCommonOut
import com.ydl.ydlcommon.utils.NetworkParamsUtils
import com.ydl.ydlcommon.utils.remind.HttpErrorUtils
import com.ydl.ydlcommon.view.dialog.NormalDialog
import com.yidianling.router.im.IMRequestCallback
import com.yidianling.im.api.bean.IMRequestCallback
import com.yidianling.tests.home.param.RecentCmd
import com.yidianling.tests.router.TestsIn
import io.reactivex.android.schedulers.AndroidSchedulers
......
......@@ -10,7 +10,6 @@ import android.view.View
import android.widget.TextView
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.utils.MainUtils
import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.yidianling.common.tools.LogUtil
......@@ -20,6 +19,7 @@ import com.yidianling.tests.home.bean.TestHomeBodyBean
import com.yidianling.tests.home.bean.TestHomeDataBean
import com.yidianling.tests.home.config.ITestHomeConfig
import com.yidianling.tests.home.event.UpdateCouponMoneyEvent
import com.yidianling.tests.router.TestsIn
import de.greenrobot.event.EventBus
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Consumer
......@@ -250,7 +250,7 @@ class TestHomeUtils {
* 只有当和上一次优惠券金额不一致时才会发事件通知更新
*/
fun updateCouponMoney(){
var userId = ModularServiceManager.getPlatformUserService()?.getUser()?.userId?: "";
var userId = TestsIn.getUserService().getUserInfo()?.uid?: "";
TestRetrofitApi.getTestRetrofitApi()
.fetchMaxCoupon(userId)
.subscribeOn(Schedulers.io())
......
......@@ -4,10 +4,12 @@ import android.app.Activity
import android.content.Intent
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.router.YdlUserInfo
import com.yidianling.router.RouterManager
import com.yidianling.router.im.IMRequestCallback
import com.yidianling.dynamic.api.IDynamicService
import com.yidianling.im.api.bean.IMRequestCallback
import com.yidianling.im.api.service.IImService
import com.yidianling.tests.api.service.ITestsApiService
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.api.service.IAppService
import com.yidianling.user.api.service.IUserService
/**
......@@ -17,6 +19,22 @@ import com.yidianling.user.api.service.IUserService
*/
object TestsIn {
fun getUserService(): IUserService {
return ModularServiceManager.provide(IUserService::class.java)
}
fun getImService(): IImService {
return ModularServiceManager.provide(IImService::class.java)
}
fun getAppService(): IAppService {
return ModularServiceManager.provide(IAppService::class.java)
}
fun getDynamicService(): IDynamicService {
return ModularServiceManager.provide(IDynamicService::class.java)
}
fun getTestsImpl(): ITestsApiService {
return ModularServiceManager.provide(ITestsApiService::class.java)
}
......@@ -37,17 +55,17 @@ object TestsIn {
}
fun publishTrendIntent(activity: Activity, url: String, cover: String, title: String): Intent? {
return RouterManager.getDynamicRouter()?.publishTrendIntent(activity, url, cover, title)
return getDynamicService()?.publishTrendIntent(activity, url, cover, title)
}
fun sendTestResultMessage(uid : String,content : String,title: String?,head : String?,url : String?,id : Int,share_url : String?, callback: IMRequestCallback<Void>) {
RouterManager.getImRouter().sendTestResultMessage(uid, content, title, head, url, id, share_url, callback)
getImService().sendTestResultMessage(uid, content, title, head, url, id, share_url, callback)
}
/**
* 跳转红包
*/
fun myRedPockIntent(activity: Activity){
activity.startActivity(RouterManager.getAppRouter()?.myRedPockIntent(activity))
getAppService().myRedPockIntent(activity)
}
}
\ No newline at end of file
package com.yidianling.tests.router
import android.app.Activity
import android.content.Intent
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.base.config.HttpConfig
import com.yidianling.router.tests.ITestsRouter
class TestsRouterImp : ITestsRouter {
override fun testH5Result(testResultId: String) {
val h5Params = H5Params(HttpConfig.MH5_URL+"ceshi/result/"+testResultId, null)
NewH5Activity.start(BaseApp.getApp(),h5Params)
}
override fun testDetailH5(testId: String) {
val h5Params = H5Params(HttpConfig.MH5_URL+"ceshi/"+testId, null)
NewH5Activity.start(BaseApp.getApp(),h5Params)
}
override fun testDetailIntent(activity: Activity, testId: Int): Intent {
return Intent()
}
override fun testResultIntent(activity: Activity, testResultId: Int): Intent {
return Intent()
}
override fun testAnswerIntent(activity: Activity): Intent {
return Intent()
}
}
\ No newline at end of file
......@@ -88,11 +88,15 @@ dependencies {
implementation modularPublication('com.ydl:m-user-api')
implementation modularPublication('com.ydl:m-audioim-api')
implementation modularPublication('com.ydl:m-home-api')
implementation modularPublication('com.ydl:m-im-api')
implementation modularPublication('com.ydl:m-fm-api')
}else {
//发布时使用
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies['ydl-m-home-api']
compileOnly rootProject.ext.dependencies["ydl-m-audioim-api"]
compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
compileOnly rootProject.ext.dependencies["ydl-m-fm-api"]
api rootProject.ext.dependencies["ydl-webview"]
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
......
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