Commit 92efbc41 by 严久程

导医入口

parent 3eb4e373
...@@ -31,6 +31,8 @@ import kotlinx.android.synthetic.main.activity_main.* ...@@ -31,6 +31,8 @@ import kotlinx.android.synthetic.main.activity_main.*
import com.ydl.component.route.PlatformTempCommonRouteImpl import com.ydl.component.route.PlatformTempCommonRouteImpl
import com.ydl.confide.home.ConfideHomeActivity import com.ydl.confide.home.ConfideHomeActivity
import com.ydl.ydlcommon.router.YdlCommonRouterManager import com.ydl.ydlcommon.router.YdlCommonRouterManager
import com.yidianling.common.tools.LogUtil
import com.yidianling.consultant.api.IConsultantService
/** /**
...@@ -134,8 +136,14 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>( ...@@ -134,8 +136,14 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
// YDLavManager.instances.login("1193016") // YDLavManager.instances.login("1193016")
startActivity(Intent(this, ConfideHomeActivity::class.java)) startActivity(Intent(this, ConfideHomeActivity::class.java))
} }
ModularServiceManager.provide(IConsultantService::class.java).requestGuideData()
bt_to_muse.setOnClickListener { bt_to_muse.setOnClickListener {
val list= ModularServiceManager.provide(IConsultantService::class.java).getGuideImage(1)
list?.forEach {
LogUtil.e(it.toString())
}
// YDLRouterManager.router(IYDLRouterConstant.ROUTER_MUSE_CENTER, // YDLRouterManager.router(IYDLRouterConstant.ROUTER_MUSE_CENTER,
// YDLRouterParams().putExtra // YDLRouterParams().putExtra
// ("url", "http://video.yidianling.com/2019/05/30/746851e2f335baf5f44499f4fb49d3a9.mp3")) // ("url", "http://video.yidianling.com/2019/05/30/746851e2f335baf5f44499f4fb49d3a9.mp3"))
......
...@@ -20,8 +20,8 @@ import java.util.List; ...@@ -20,8 +20,8 @@ import java.util.List;
public final class DemoGlobalConfig implements IConfigModule { public final class DemoGlobalConfig implements IConfigModule {
String APP_DOMAIN = "https://api.github.com/"; String APP_DOMAIN = "https://api.github.com/";
// public static String appEnv = YDLConstants.ENV_AUTO_TEST; // public static String appEnv = YDLConstants.ENV_AUTO_TEST;
// public static String appEnv = YDLConstants.ENV_TEST; public static String appEnv = YDLConstants.ENV_TEST;
public static String appEnv = YDLConstants.ENV_PROD; // public static String appEnv = YDLConstants.ENV_PROD;
@Override @Override
public void injectAppLifecycle(@NotNull Context context, @NotNull List<IAppLifecycles> lifecycles) { public void injectAppLifecycle(@NotNull Context context, @NotNull List<IAppLifecycles> lifecycles) {
......
...@@ -21,7 +21,7 @@ ext { ...@@ -21,7 +21,7 @@ ext {
//-------------- 业务模块 API 层 -------------- //-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.6", "m-audioim-api" : "0.0.6",
"m-confide-api" : "0.0.2.1", "m-confide-api" : "0.0.2.1",
"m-consultant-api": "0.0.5.2", "m-consultant-api": "0.0.5.3",
"m-course-api" : "0.0.3.6", "m-course-api" : "0.0.3.6",
"m-fm-api" : "0.0.3", "m-fm-api" : "0.0.3",
"m-muse-api" : "0.0.1", "m-muse-api" : "0.0.1",
...@@ -269,7 +269,7 @@ ext { ...@@ -269,7 +269,7 @@ ext {
//flutter功能组件升级===>发布ydl-flutter组件===>引用flutter相关的业务模块 //flutter功能组件升级===>发布ydl-flutter组件===>引用flutter相关的业务模块
"ydl-flutter-base" : "com.ydl:ydl-flutter-base:${ydlCompileVersion["ydl-flutter-base"]}", //组件化项目中的flutter base模块 "ydl-flutter-base" : "com.ydl:ydl-flutter-base:${ydlCompileVersion["ydl-flutter-base"]}", //组件化项目中的flutter base模块
"ydl-flutter" : "com.ydl:ydl-flutter:0.0.20@aar", //flutter aar "ydl-flutter" : "com.ydl:ydl-flutter:0.0.22@aar", //flutter aar
"ydl-flutter-sp" : "com.ydl:ydl-flutter-sp:0.0.2@aar", //flutter 缓存 aar "ydl-flutter-sp" : "com.ydl:ydl-flutter-sp:0.0.2@aar", //flutter 缓存 aar
//基础组件 <<--- 先发这个,发完改这里的版本号 //基础组件 <<--- 先发这个,发完改这里的版本号
......
...@@ -768,7 +768,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -768,7 +768,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
if (page == 1) { if (page == 1) {
if (fromPageType != -1 && isDoSearch) { if (fromPageType != -1 && isDoSearch) {
LogUtil.d("keyword: " + keyWord + " isRecommend: " + isRecommend + " hasResult: " + (data.size > 0 && data != null ?: false) + " location: " + fromPages[fromPageType]) // LogUtil.d("keyword: " + keyWord + " isRecommend: " + isRecommend + " hasResult: " + (data.size > 0 && data != null ?: false) + " location: " + fromPages[fromPageType])
} }
serviceList.clear() serviceList.clear()
hasMore = true hasMore = true
...@@ -807,7 +807,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -807,7 +807,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
if (page == 1) { if (page == 1) {
if (fromPageType != -1 && isDoSearch) { if (fromPageType != -1 && isDoSearch) {
LogUtil.d("keyword: " + keyWord + " isRecommend: " + isRecommend + " hasResult: " + (data.size > 0 && data != null ?: false) + " location: " + fromPages[fromPageType]) // LogUtil.d("keyword: " + keyWord + " isRecommend: " + isRecommend + " hasResult: " + (data.size > 0 && data != null ?: false) + " location: " + fromPages[fromPageType])
} }
doctorList.clear() doctorList.clear()
doctorAdapter.hasMore = true doctorAdapter.hasMore = true
......
...@@ -735,7 +735,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -735,7 +735,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
if (page == 1) { if (page == 1) {
if (fromPageType != -1 && isDoSearch) { if (fromPageType != -1 && isDoSearch) {
LogUtil.d("keyword: " + keyWord + " isRecommend: " + isRecommend + " hasResult: " + (data.size > 0 && data != null ?: false) + " location: " + fromPages[fromPageType]) // LogUtil.d("keyword: " + keyWord + " isRecommend: " + isRecommend + " hasResult: " + (data.size > 0 && data != null ?: false) + " location: " + fromPages[fromPageType])
} }
serviceList.clear() serviceList.clear()
hasMore = true hasMore = true
...@@ -777,7 +777,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -777,7 +777,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
if (page == 1) { if (page == 1) {
if (fromPageType != -1 && isDoSearch) { if (fromPageType != -1 && isDoSearch) {
LogUtil.d("keyword: " + keyWord + " isRecommend: " + isRecommend + " hasResult: " + (data.size > 0 && data != null ?: false) + " location: " + fromPages[fromPageType]) // LogUtil.d("keyword: " + keyWord + " isRecommend: " + isRecommend + " hasResult: " + (data.size > 0 && data != null ?: false) + " location: " + fromPages[fromPageType])
} }
doctorList.clear() doctorList.clear()
doctorAdapter.hasMore = true doctorAdapter.hasMore = true
......
...@@ -14,37 +14,49 @@ import android.widget.TextView ...@@ -14,37 +14,49 @@ import android.widget.TextView
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.google.gson.Gson import com.google.gson.Gson
import com.google.gson.reflect.TypeToken import com.google.gson.reflect.TypeToken
import com.ydl.ydl_image.config.ISimpleImageOpConfig
import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.ydl.ydl_router.manager.YDLRouterParams import com.ydl.ydl_router.manager.YDLRouterParams
import com.ydl.ydlcommon.base.BaseMvpActivity import com.ydl.ydlcommon.base.BaseMvpActivity
import com.ydl.ydlcommon.bean.StatusBarOptions import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.router.IYDLRouterConstant import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.utils.FixSizeLinkedList import com.ydl.ydlcommon.utils.FixSizeLinkedList
import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlcommon.utils.SharedPreferencesEditor import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.ydl.ydlcommon.utils.StatusBarUtils import com.ydl.ydlcommon.utils.StatusBarUtils
import com.ydl.ydlcommon.view.banner.GlideImageLoader import com.ydl.ydlcommon.view.banner.GlideImageLoader
import com.yidianling.common.tools.RxDeviceTool import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.RxImageTool import com.yidianling.common.tools.RxImageTool
import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.api.IConsultantService
import com.yidianling.consultant.bean.HotSearchBean import com.yidianling.consultant.bean.HotSearchBean
import com.yidianling.consultant.bean.HotSearchFocusItemBean import com.yidianling.consultant.bean.HotSearchFocusItemBean
import com.yidianling.consultant.bean.HotSearchKeyWordDataBean import com.yidianling.consultant.bean.HotSearchKeyWordDataBean
import com.yidianling.consultant.bean.HotSearchPopularDoctorBean import com.yidianling.consultant.bean.HotSearchPopularDoctorBean
import com.yidianling.consultant.contract.IHotSearchContract import com.yidianling.consultant.contract.IHotSearchContract
import com.yidianling.consultant.modular.utils.ConsultAssistantEntryUtils
import com.yidianling.consultant.modular.utils.TempH5RouteUtils import com.yidianling.consultant.modular.utils.TempH5RouteUtils
import com.yidianling.consultant.presenter.HotSearchPresenterImpl import com.yidianling.consultant.presenter.HotSearchPresenterImpl
import kotlinx.android.synthetic.main.consultant_activity_hot_search.* import kotlinx.android.synthetic.main.consultant_activity_hot_search.*
import kotlinx.android.synthetic.main.consultant_item_expert_hot_search.view.* import kotlinx.android.synthetic.main.consultant_item_expert_hot_search.view.*
@Route(path = "/consult/hot_search") @Route(path = "/consult/hot_search")
class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View,IHotSearchContract.Presenter>(), IHotSearchContract.View { class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchContract.Presenter>(),
IHotSearchContract.View {
private val CACHE_CONSULT_SEARCH_HISTORY_DATA = "cache_consult_search_history_data" private val CACHE_CONSULT_SEARCH_HISTORY_DATA = "cache_consult_search_history_data"
private val HOT_SEARCH_DOCTOR_NAME = "hot_search_doctor_name" private val HOT_SEARCH_DOCTOR_NAME = "hot_search_doctor_name"
private var historyList: FixSizeLinkedList<String> = FixSizeLinkedList(15) private var historyList: FixSizeLinkedList<String> = FixSizeLinkedList(15)
private val bannerList = ArrayList<String>() private val bannerList = ArrayList<String>()
//历史搜索内容的最大宽度 //历史搜索内容的最大宽度
private var maxWidth: Int = 0 private var maxWidth: Int = 0
//历史搜索实际宽度 //历史搜索实际宽度
private var historyCurrentWidth: Int = 0 private var historyCurrentWidth: Int = 0
//热门专家搜索实际宽度 //热门专家搜索实际宽度
private var expertWidth: Int = 0 private var expertWidth: Int = 0
...@@ -61,6 +73,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View,IHotSearchCont ...@@ -61,6 +73,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View,IHotSearchCont
override fun getStatusViewOptions(): StatusBarOptions { override fun getStatusViewOptions(): StatusBarOptions {
return StatusBarOptions(isAddStatusView = true) return StatusBarOptions(isAddStatusView = true)
} }
override fun initDataAndEvent() { override fun initDataAndEvent() {
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE or WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN) window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE or WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN)
getDataFromIntent() getDataFromIntent()
...@@ -99,6 +112,24 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View,IHotSearchCont ...@@ -99,6 +112,24 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View,IHotSearchCont
SharedPreferencesEditor.putString(CACHE_CONSULT_SEARCH_HISTORY_DATA, "") SharedPreferencesEditor.putString(CACHE_CONSULT_SEARCH_HISTORY_DATA, "")
initHistoryData() initHistoryData()
} }
val data = ModularServiceManager.provide(IConsultantService::class.java).getGuideImage(10)
if (data?.size ?: 0 > 0) {
val imageUrl= data?.get(0)?.pic
iv_daoyi_image.visibility=View.VISIBLE
val sp = SimpleImageOpConfiger()
sp.transform = ISimpleImageOpConfig.TRANSFORM_ROUND
sp.radius = 8
YDLImageCacheManager.showImage(mContext,imageUrl, iv_daoyi_image, sp)
iv_daoyi_image.setOnClickListener {
LogUtil.e("跳转导医:location=${data?.get(0)!!.location},title=${data[0].title}")
ConsultAssistantEntryUtils.jumpConsultAssistant(this,data?.get(0)!!.location.toInt())
}
}
etSearch.addTextChangedListener(object : TextWatcher { etSearch.addTextChangedListener(object : TextWatcher {
override fun afterTextChanged(s: Editable?) { override fun afterTextChanged(s: Editable?) {
if (TextUtils.isEmpty(s)) { if (TextUtils.isEmpty(s)) {
...@@ -116,7 +147,8 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View,IHotSearchCont ...@@ -116,7 +147,8 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View,IHotSearchCont
}) })
StatusBarUtils.statusBarLightMode(this) StatusBarUtils.statusBarLightMode(this)
maxWidth = (2 * RxDeviceTool.getScreenWidth(this@HotSearchActivity)) - RxImageTool.dip2px(60f) maxWidth =
(2 * RxDeviceTool.getScreenWidth(this@HotSearchActivity)) - RxImageTool.dip2px(60f)
dp42 = RxImageTool.dip2px(60f) dp42 = RxImageTool.dip2px(60f)
} }
...@@ -155,7 +187,8 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View,IHotSearchCont ...@@ -155,7 +187,8 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View,IHotSearchCont
llHotSearch.visibility = View.VISIBLE llHotSearch.visibility = View.VISIBLE
flHotSearch.removeAllViews() flHotSearch.removeAllViews()
for (index in keywordData.indices) { for (index in keywordData.indices) {
val view = LayoutInflater.from(this).inflate(R.layout.consultant_item_expert_hot_search, flHotSearch, false) val view = LayoutInflater.from(this)
.inflate(R.layout.consultant_item_expert_hot_search, flHotSearch, false)
view.tvHotSearch.text = keywordData[index].keyword view.tvHotSearch.text = keywordData[index].keyword
view.setOnClickListener { view.setOnClickListener {
etSearch.setText(keywordData[index].keyword) etSearch.setText(keywordData[index].keyword)
...@@ -175,10 +208,17 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View,IHotSearchCont ...@@ -175,10 +208,17 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View,IHotSearchCont
expertWidth = 0 expertWidth = 0
flHotExpert.removeAllViews() flHotExpert.removeAllViews()
for (index in hotSearchExpert.indices) { for (index in hotSearchExpert.indices) {
val view = LayoutInflater.from(this).inflate(R.layout.consultant_item_expert_hot_search, flHotSearch, false) val view = LayoutInflater.from(this)
.inflate(R.layout.consultant_item_expert_hot_search, flHotSearch, false)
view.tvHotSearch.text = hotSearchExpert[index].name view.tvHotSearch.text = hotSearchExpert[index].name
if (!TextUtils.isEmpty(hotSearchExpert[index].name)) { if (!TextUtils.isEmpty(hotSearchExpert[index].name)) {
expertWidth += getTextContentWidth(view.findViewById(R.id.tvHotSearch), if (hotSearchExpert[index].name!!.length > 7) hotSearchExpert[index].name!!.substring(0, 8) else hotSearchExpert[index].name!!) + dp42 expertWidth += getTextContentWidth(
view.findViewById(R.id.tvHotSearch),
if (hotSearchExpert[index].name!!.length > 7) hotSearchExpert[index].name!!.substring(
0,
8
) else hotSearchExpert[index].name!!
) + dp42
if (expertWidth > maxWidth) { if (expertWidth > maxWidth) {
break break
} }
...@@ -210,12 +250,17 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View,IHotSearchCont ...@@ -210,12 +250,17 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View,IHotSearchCont
if (null == focusList || focusList.isEmpty()) { if (null == focusList || focusList.isEmpty()) {
TempH5RouteUtils.tempH5Route( TempH5RouteUtils.tempH5Route(
IYDLRouterConstant.ROUTER_H5_H5, IYDLRouterConstant.ROUTER_H5_H5,
YDLRouterParams().putExtra(IYDLRouterConstant.EXTRA_URL, "https://h2.yidianling.com/ct/list"), "") YDLRouterParams().putExtra(
IYDLRouterConstant.EXTRA_URL,
"https://h2.yidianling.com/ct/list"
), ""
)
} else { } else {
TempH5RouteUtils.tempH5Route(focusList[it].linkUrl) TempH5RouteUtils.tempH5Route(focusList[it].linkUrl)
} }
} }
banner.setImageLoader(GlideImageLoader(R.drawable.consultant_expert_banner_default)).setImages(bannerList).start() banner.setImageLoader(GlideImageLoader(R.drawable.consultant_expert_banner_default))
.setImages(bannerList).start()
banner.setIndicatorBottomPadding(5) banner.setIndicatorBottomPadding(5)
} }
...@@ -225,17 +270,23 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View,IHotSearchCont ...@@ -225,17 +270,23 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View,IHotSearchCont
val cacheHomeData = SharedPreferencesEditor.getString(CACHE_CONSULT_SEARCH_HISTORY_DATA) val cacheHomeData = SharedPreferencesEditor.getString(CACHE_CONSULT_SEARCH_HISTORY_DATA)
if (!TextUtils.isEmpty(cacheHomeData)) { if (!TextUtils.isEmpty(cacheHomeData)) {
ll_search_history.visibility = View.VISIBLE ll_search_history.visibility = View.VISIBLE
val list = Gson().fromJson<MutableList<String>>(cacheHomeData, object : TypeToken<MutableList<String>>() { val list = Gson().fromJson<MutableList<String>>(
}.type) cacheHomeData,
object : TypeToken<MutableList<String>>() {
}.type
)
historyList.addAll(list) historyList.addAll(list)
if (historyList.size > 0) { if (historyList.size > 0) {
for (historyStr in historyList.reversed()) { for (historyStr in historyList.reversed()) {
val view = LayoutInflater.from(this).inflate(R.layout.consultant_item_expert_hot_search, flHotSearch, false) val view = LayoutInflater.from(this)
.inflate(R.layout.consultant_item_expert_hot_search, flHotSearch, false)
view.tvHotSearch.text = historyStr view.tvHotSearch.text = historyStr
historyCurrentWidth += getTextContentWidth(view.findViewById(R.id.tvHotSearch), historyCurrentWidth += getTextContentWidth(
if (historyStr.length > 7) historyStr.substring(0, 8) else historyStr) + RxImageTool.dp2px(50f) view.findViewById(R.id.tvHotSearch),
if (historyCurrentWidth >maxWidth) { if (historyStr.length > 7) historyStr.substring(0, 8) else historyStr
) + RxImageTool.dp2px(50f)
if (historyCurrentWidth > maxWidth) {
break break
} }
view.setOnClickListener { view.setOnClickListener {
...@@ -271,7 +322,10 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View,IHotSearchCont ...@@ -271,7 +322,10 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View,IHotSearchCont
if (!TextUtils.isEmpty(keyWord)) { if (!TextUtils.isEmpty(keyWord)) {
historyList.remove(keyWord) historyList.remove(keyWord)
historyList.add(keyWord) historyList.add(keyWord)
SharedPreferencesEditor.putString(CACHE_CONSULT_SEARCH_HISTORY_DATA, Gson().toJson(historyList)) SharedPreferencesEditor.putString(
CACHE_CONSULT_SEARCH_HISTORY_DATA,
Gson().toJson(historyList)
)
} }
......
...@@ -4,6 +4,7 @@ package com.yidianling.consultant.constants ...@@ -4,6 +4,7 @@ package com.yidianling.consultant.constants
* Created by xj on 2019/7/1. * Created by xj on 2019/7/1.
*/ */
class ConsultBIConstants { class ConsultBIConstants {
companion object { companion object {
//咨询筛选页 //咨询筛选页
const val PART_ID_CONSULT_FILTER_PAGE = "consult_filter_page" const val PART_ID_CONSULT_FILTER_PAGE = "consult_filter_page"
...@@ -15,6 +16,7 @@ class ConsultBIConstants { ...@@ -15,6 +16,7 @@ class ConsultBIConstants {
const val POSITION_OTHER_CHOICE_CLICK = "other_choice_click" //其他选择 const val POSITION_OTHER_CHOICE_CLICK = "other_choice_click" //其他选择
const val POSITION_CONSULT_FILTER_RESET_CLICK = "consult_filter_reset_click" //重置 const val POSITION_CONSULT_FILTER_RESET_CLICK = "consult_filter_reset_click" //重置
const val POSITION_CONSULT_FILTER_CHECKOUT_CLICK = "consult_filter_checkoutallconsultants_click" //查看XXX位咨询师 const val POSITION_CONSULT_FILTER_CHECKOUT_CLICK = "consult_filter_checkoutallconsultants_click" //查看XXX位咨询师
const val POSITION_DAOYI_ADVERTISEMENT_CLICK="daoyi_advertisement_click"
} }
//====================APP咨询列表页(app_consult_list_page)==================== //====================APP咨询列表页(app_consult_list_page)====================
......
...@@ -7,8 +7,8 @@ import com.ydl.ydlcommon.data.http.BaseAPIResponse ...@@ -7,8 +7,8 @@ import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseResponse import com.ydl.ydlcommon.data.http.BaseResponse
import com.ydl.ydlnet.YDLHttpUtils import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.consultant.bean.ExpertSearchTopShowBean import com.yidianling.consultant.bean.ExpertSearchTopShowBean
import com.yidianling.consultant.bean.GuideBean
import com.yidianling.consultant.bean.HotSearchBean import com.yidianling.consultant.bean.HotSearchBean
import com.yidianling.consultant.model.bean.ExpertBannerBean
import com.yidianling.consultant.model.bean.ExpertSearchBean import com.yidianling.consultant.model.bean.ExpertSearchBean
import com.yidianling.consultant.model.bean.HeadData import com.yidianling.consultant.model.bean.HeadData
import io.reactivex.Observable import io.reactivex.Observable
...@@ -24,7 +24,7 @@ interface SearchApi { ...@@ -24,7 +24,7 @@ interface SearchApi {
var instance: SearchApi? = null var instance: SearchApi? = null
fun getSearchApi():SearchApi { fun getSearchApi(): SearchApi {
if (instance == null) { if (instance == null) {
instance = YDLHttpUtils.obtainApi(SearchApi::class.java) instance = YDLHttpUtils.obtainApi(SearchApi::class.java)
} }
...@@ -39,36 +39,41 @@ interface SearchApi { ...@@ -39,36 +39,41 @@ interface SearchApi {
//搜索条件 //搜索条件
@GET("consult/search/conditions") @GET("consult/search/conditions")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA) @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun searchConditions(): Observable<BaseAPIResponse<HeadData>> fun searchConditions(): Observable<BaseAPIResponse<HeadData>>
//专家服务搜索 //专家服务搜索
@retrofit2.http.Headers("Content-Type:application/json") @retrofit2.http.Headers("Content-Type:application/json")
@GET @GET
fun searchDoctorService(@Url url : String): Observable<BaseAPIResponse<ExpertSearchBean>> fun searchDoctorService(@Url url: String): Observable<BaseAPIResponse<ExpertSearchBean>>
//搜索页面接口 //搜索页面接口
@retrofit2.http.Headers(YDL_DOMAIN+ YDL_DOMAIN_JAVA,"Content-Type:application/json") @retrofit2.http.Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA, "Content-Type:application/json")
@GET("home/search-page") @GET("home/search-page")
fun searchPage(): Observable<BaseAPIResponse<HotSearchBean>> fun searchPage(): Observable<BaseAPIResponse<HotSearchBean>>
//筛选结果计数 //筛选结果计数
@retrofit2.http.Headers("Content-Type:application/json") @retrofit2.http.Headers("Content-Type:application/json")
@GET @GET
fun getFilterCount(@Url url : String?): Observable<BaseAPIResponse<Int>> fun getFilterCount(@Url url: String?): Observable<BaseAPIResponse<Int>>
//导医 //导医
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA,"Content-Type:application/json") @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA, "Content-Type:application/json")
@GET("consult/assistant/guide-switch") @GET("consult/assistant/guide-switch")
fun getConsultAssistantRequest(@Query("switchKey") switchKey: String): Observable<BaseAPIResponse<Boolean>> fun getConsultAssistantRequest(@Query("switchKey") switchKey: String): Observable<BaseAPIResponse<Boolean>>
//获取咨询助理uid //获取咨询助理uid
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA,"Content-Type:application/json") @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA, "Content-Type:application/json")
@GET("consult/assistant/chat-distribute") @GET("consult/assistant/chat-distribute")
fun getConsultAssistantUidRequest(): Observable<BaseAPIResponse<Long>> fun getConsultAssistantUidRequest(location: Int): Observable<BaseAPIResponse<Long>>
//获取咨询助理uid //获取咨询助理uid
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA,"Content-Type:application/json") @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA, "Content-Type:application/json")
@POST("doctor/querySpecialTopic") @POST("doctor/querySpecialTopic")
fun getBigShotData(): Observable<BaseAPIResponse<ExpertSearchTopShowBean>> fun getBigShotData(): Observable<BaseAPIResponse<ExpertSearchTopShowBean>>
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
@GET("testGeneral/daoyi/setting")
fun getGuideData(): Observable<BaseAPIResponse<Map<String, List<GuideBean>>>>
} }
\ No newline at end of file
package com.yidianling.consultant.modular package com.yidianling.consultant.modular
import android.annotation.SuppressLint
import android.app.Activity import android.app.Activity
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.support.v4.app.Fragment import android.support.v4.app.Fragment
import android.text.TextUtils
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.yidianling.consultant.ExpertSearchActivity import com.yidianling.consultant.ExpertSearchActivity
import com.yidianling.consultant.ExpertSearchFragment import com.yidianling.consultant.ExpertSearchFragment
import com.yidianling.consultant.api.IConsultantService import com.yidianling.consultant.api.IConsultantService
import com.yidianling.consultant.bean.GuideBean
import com.yidianling.consultant.bean.Keyworks import com.yidianling.consultant.bean.Keyworks
import com.yidianling.consultant.data.ConsultantDataManager import com.yidianling.consultant.data.ConsultantDataManager
import com.yidianling.consultant.model.SearchApi
import com.yidianling.consultant.modular.singlton.ConsultAssistantDialogUtils import com.yidianling.consultant.modular.singlton.ConsultAssistantDialogUtils
import com.yidianling.consultant.modular.utils.ConsultAssistantEntryUtils
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
/** /**
* Created by xj on 2019/11/14. * Created by xj on 2019/11/14.
*/ */
@Route(path = "/consultant/ConsultantService") @Route(path = "/consultant/ConsultantService")
class ConsultantServiceImp: IConsultantService { class ConsultantServiceImp : IConsultantService {
override fun init(context: Context?) { override fun init(context: Context?) {
} }
override fun expertSearchIntent(activity: Activity, category: Int, showType: Int, isInitShowHot: Boolean): Intent { override fun expertSearchIntent(
activity: Activity,
category: Int,
showType: Int,
isInitShowHot: Boolean
): Intent {
return ExpertSearchActivity.newIntent(activity, category, showType, isInitShowHot) return ExpertSearchActivity.newIntent(activity, category, showType, isInitShowHot)
} }
...@@ -62,6 +78,37 @@ class ConsultantServiceImp: IConsultantService { ...@@ -62,6 +78,37 @@ class ConsultantServiceImp: IConsultantService {
return ExpertSearchFragment() return ExpertSearchFragment()
} }
override fun getGuideImage(source: Int): List<GuideBean>? {
val dataString = SharedPreferencesEditor.getString("guide_data")
return if (TextUtils.isEmpty(dataString)) {
null
} else {
val gson = Gson()
val map: java.util.HashMap<String, List<GuideBean>> =
gson.fromJson(
dataString,
object : TypeToken<java.util.HashMap<String, List<GuideBean>>>() {}.type
)
map[source.toString()]
}
}
@SuppressLint("CheckResult")
override fun requestGuideData() {
SearchApi.getSearchApi().getGuideData()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({
if (it.data != null && it.data.isNotEmpty()) {
SharedPreferencesEditor.putString("guide_data", Gson().toJson(it.data))
}
}, {})
}
override fun jumpConsultAssistant(activity: Activity, location: Int) {
ConsultAssistantEntryUtils.jumpConsultAssistant(activity,location)
}
override fun resetConsultAssistantDialogStatus() { override fun resetConsultAssistantDialogStatus() {
ConsultAssistantDialogUtils.INSTANCE.resetStatus() ConsultAssistantDialogUtils.INSTANCE.resetStatus()
} }
......
...@@ -12,6 +12,7 @@ import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils ...@@ -12,6 +12,7 @@ import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.remind.ToastHelper import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.ConsultAssistantCenterActivity import com.yidianling.consultant.ConsultAssistantCenterActivity
import com.yidianling.consultant.constants.ConsultBIConstants
import com.yidianling.consultant.dialog.ConsultAssistantDialog import com.yidianling.consultant.dialog.ConsultAssistantDialog
import com.yidianling.consultant.model.SearchApi import com.yidianling.consultant.model.SearchApi
import com.yidianling.consultant.router.ConsultantIn import com.yidianling.consultant.router.ConsultantIn
...@@ -245,8 +246,9 @@ class ConsultAssistantDialogUtils private constructor() { ...@@ -245,8 +246,9 @@ class ConsultAssistantDialogUtils private constructor() {
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
fun getConsultAssistantUid(activity: Activity) { fun getConsultAssistantUid(activity: Activity) {
ActionCountUtils.count(ConsultBIConstants.POSITION_DAOYI_ADVERTISEMENT_CLICK,"1")
// 请求接口获取咨询助理的uid // 请求接口获取咨询助理的uid
SearchApi.getSearchApi().getConsultAssistantUidRequest() SearchApi.getSearchApi().getConsultAssistantUidRequest(1)
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe( Consumer { .subscribe( Consumer {
......
package com.yidianling.consultant.modular.utils
import android.annotation.SuppressLint
import android.app.Activity
import android.support.v7.app.AppCompatActivity
import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.ConsultAssistantCenterActivity
import com.yidianling.consultant.HotSearchActivity
import com.yidianling.consultant.constants.ConsultBIConstants
import com.yidianling.consultant.model.SearchApi
import com.yidianling.consultant.router.ConsultantIn
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Consumer
import io.reactivex.schedulers.Schedulers
class ConsultAssistantEntryUtils {
companion object{
@SuppressLint("CheckResult")
fun jumpConsultAssistant(activity: Activity, location:Int){
ActionCountUtils.count(ConsultBIConstants.POSITION_DAOYI_ADVERTISEMENT_CLICK,"$location")
// 请求接口获取咨询助理的uid
SearchApi.getSearchApi().getConsultAssistantUidRequest(location)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe( Consumer {
if (it.code == "200" && it.data != 0.toLong() && null != activity) {
ConsultantIn.startP2PSession(activity as AppCompatActivity, it.data.toString())
} else {
ToastUtil.toastShort("咨询助理忙碌中,请稍后再试")
}
}, object: ThrowableConsumer() {
override fun accept(msg: String) {
if (null != activity && activity is ConsultAssistantCenterActivity && !activity.isFinishing) activity.finish()
}
}
)
}
}
}
\ No newline at end of file
...@@ -35,7 +35,7 @@ object ConsultantIn { ...@@ -35,7 +35,7 @@ object ConsultantIn {
return ModularServiceManager.provide(IUserService::class.java).isLogin() return ModularServiceManager.provide(IUserService::class.java).isLogin()
} }
fun startP2PSession(context: AppCompatActivity, toUid: String) { fun startP2PSession(context: Activity, toUid: String) {
getImService().startP2PSession(context, toUid) getImService().startP2PSession(context, toUid)
} }
......
...@@ -4,6 +4,7 @@ import android.app.Activity ...@@ -4,6 +4,7 @@ import android.app.Activity
import android.content.Context import android.content.Context
import android.support.v4.app.Fragment import android.support.v4.app.Fragment
import com.alibaba.android.arouter.facade.template.IProvider import com.alibaba.android.arouter.facade.template.IProvider
import com.yidianling.consultant.bean.GuideBean
import com.yidianling.consultant.bean.Keyworks import com.yidianling.consultant.bean.Keyworks
/** /**
...@@ -28,4 +29,10 @@ interface IConsultantService: IProvider { ...@@ -28,4 +29,10 @@ interface IConsultantService: IProvider {
fun setHotSearch(hotSearch: kotlin.collections.MutableList<Keyworks>): kotlin.Unit fun setHotSearch(hotSearch: kotlin.collections.MutableList<Keyworks>): kotlin.Unit
fun getExpertSearchFragment(): Fragment fun getExpertSearchFragment(): Fragment
fun getGuideImage(source:Int):List<GuideBean>?
fun requestGuideData()
fun jumpConsultAssistant(activity: Activity, location:Int)
} }
\ No newline at end of file
package com.yidianling.consultant.bean;
public class GuideBean {
public String id;
public String title;
public String subTitle;
public String pic;
public String location;
public String source;
public String linkUrl;
@Override
public String toString() {
return "GuideBean{" +
"id='" + id + '\'' +
", title='" + title + '\'' +
", subTitle='" + subTitle + '\'' +
", pic='" + pic + '\'' +
", location='" + location + '\'' +
", source='" + source + '\'' +
", linkUrl='" + linkUrl + '\'' +
'}';
}
}
...@@ -93,14 +93,27 @@ ...@@ -93,14 +93,27 @@
android:layout_height="1px" android:layout_height="1px"
android:layout_below="@+id/rl_search" android:layout_below="@+id/rl_search"
android:layout_marginTop="@dimen/platform_dp_6" android:layout_marginTop="@dimen/platform_dp_6"
android:layout_marginBottom="13dp"
android:background="@color/platform_color_E0E0E0" /> android:background="@color/platform_color_E0E0E0" />
<ImageView
android:id="@+id/iv_daoyi_image"
android:layout_width="match_parent"
android:layout_marginLeft="15dp"
android:visibility="gone"
android:layout_marginRight="15dp"
android:layout_marginBottom="13dp"
android:layout_height="90dp"/>
<LinearLayout <LinearLayout
android:id="@+id/ll_search_history" android:id="@+id/ll_search_history"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/v_topLine" android:layout_below="@+id/v_topLine"
android:layout_marginTop="30dp"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
android:orientation="vertical" android:orientation="vertical"
......
...@@ -68,6 +68,7 @@ dependencies { ...@@ -68,6 +68,7 @@ dependencies {
api rootProject.ext.dependencies["butterknife"] api rootProject.ext.dependencies["butterknife"]
if (rootProject.ext.dev_mode){ if (rootProject.ext.dev_mode){
//开发时使用 //开发时使用
implementation modularPublication('com.ydl:m-consultant-api')
implementation modularPublication('com.ydl:m-user-api') implementation modularPublication('com.ydl:m-user-api')
implementation modularPublication('com.ydl:m-dynamic-api') implementation modularPublication('com.ydl:m-dynamic-api')
api project(":ydl-webview") api project(":ydl-webview")
......
...@@ -5,26 +5,65 @@ import android.view.View; ...@@ -5,26 +5,65 @@ import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import com.ydl.ydlcommon.adapter.CommonAdapter; import com.ydl.ydlcommon.adapter.CommonAdapter;
import com.ydl.ydlcommon.modular.ModularServiceManager;
import com.yidianling.consultant.api.IConsultantService;
import com.yidianling.consultant.bean.GuideBean;
import com.yidianling.course.bean.Course; import com.yidianling.course.bean.Course;
import com.yidianling.course.widget.CourseItemNewView; import com.yidianling.course.widget.CourseItemNewView;
import java.util.ArrayList;
import java.util.List;
public class CourseNewListAdapter extends CommonAdapter<Course> { public class CourseNewListAdapter extends CommonAdapter<Course> {
private Context context; private Context context;
private int guideImageIndex = 0;
private List<GuideBean> guideList = new ArrayList<>();
public CourseNewListAdapter(Context context) { public CourseNewListAdapter(Context context) {
this.context = context; this.context = context;
initGuideImageDate();
}
private void initGuideImageDate() {
List<GuideBean> list = ModularServiceManager.INSTANCE.provide(IConsultantService.class).getGuideImage(8);
if (list != null) {
guideList.addAll(list);
}
} }
@Override @Override
public View getView(int position, View convertView, ViewGroup parent) { public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) { if (convertView == null) {
convertView = new CourseItemNewView(context); convertView = new CourseItemNewView(context);
} }
((CourseItemNewView) convertView).setData(mDataList.get(position)); ((CourseItemNewView) convertView).setData(mDataList.get(position));
((CourseItemNewView) convertView).setBottomLineVisible();
if ((position + 1) % 10 == 0) {
GuideBean bean = getGuideData();
if (bean != null) {
((CourseItemNewView) convertView).setGuideData(bean);
}
}
return convertView; return convertView;
} }
private GuideBean getGuideData() {
if (guideList.size() == 0) {
return null;
}
GuideBean bean = null;
if (guideImageIndex >= guideList.size() - 1) {
guideImageIndex = 0;
}
bean = guideList.get(guideImageIndex);
guideImageIndex++;
return bean;
}
//修复 Android 4.4 Bug :cannot be cast to android.widget.AbsListView$LayoutParams //修复 Android 4.4 Bug :cannot be cast to android.widget.AbsListView$LayoutParams
@Override @Override
public boolean hasStableIds() { public boolean hasStableIds() {
......
import android.app.Activity
import android.app.AlertDialog import android.app.AlertDialog
import android.content.Intent import android.content.Intent
import android.net.Uri import android.net.Uri
...@@ -5,6 +6,7 @@ import android.os.Handler ...@@ -5,6 +6,7 @@ import android.os.Handler
import android.text.TextUtils import android.text.TextUtils
import com.channel.ydl_flutter_base.base.BaseFlutterFragment import com.channel.ydl_flutter_base.base.BaseFlutterFragment
import com.lzf.easyfloat.permission.PermissionUtils import com.lzf.easyfloat.permission.PermissionUtils
import com.ydl.course.event.ScrollStatusChangeEvent
import com.ydl.media.audio.AudioPlayer import com.ydl.media.audio.AudioPlayer
import com.ydl.media.audio.model.Music import com.ydl.media.audio.model.Music
import com.ydl.media.view.PlayTypeEnum import com.ydl.media.view.PlayTypeEnum
...@@ -16,11 +18,12 @@ import com.ydl.ydl_router.manager.YDLRouterManager ...@@ -16,11 +18,12 @@ import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydlcommon.base.BaseApp import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.data.PlatformDataManager import com.ydl.ydlcommon.data.PlatformDataManager
import com.ydl.ydlcommon.modular.ModularServiceManager import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.modular.ModularServiceManager.provide
import com.yidianling.common.tools.LogUtil import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxDeviceTool import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.api.IConsultantService
import com.yidianling.course.CourseConstants import com.yidianling.course.CourseConstants
import com.ydl.course.event.ScrollStatusChangeEvent
import com.yidianling.course.courseNew.mine.MyCourseActivity import com.yidianling.course.courseNew.mine.MyCourseActivity
import com.yidianling.course.course_special_list.activity.CourseSpecialListActivity import com.yidianling.course.course_special_list.activity.CourseSpecialListActivity
import com.yidianling.course.flutterPlugin.CourseSendPlugin import com.yidianling.course.flutterPlugin.CourseSendPlugin
...@@ -50,6 +53,8 @@ class CoursePlugin : MethodChannel.MethodCallHandler { ...@@ -50,6 +53,8 @@ class CoursePlugin : MethodChannel.MethodCallHandler {
const val CHANNEL: String = "base/channel/native/get" const val CHANNEL: String = "base/channel/native/get"
const val GETPUBLICPARAMAS: String = "getPublicParamas" const val GETPUBLICPARAMAS: String = "getPublicParamas"
const val JUMPURL: String = "jumpUrl" const val JUMPURL: String = "jumpUrl"
const val JUMPROUTERURL: String = "jumpRouterUrl"
const val GETASSIANSTGUIDEDATA: String = "getAssianstGuideData"
const val PLAYCOURSEFILE: String = "playCourseFile" const val PLAYCOURSEFILE: String = "playCourseFile"
const val PAUSECOURSEPLAY: String = "pauseCoursePlay" const val PAUSECOURSEPLAY: String = "pauseCoursePlay"
const val REQUESTDATACOMPLETE: String = "requestDataComplete" const val REQUESTDATACOMPLETE: String = "requestDataComplete"
...@@ -82,6 +87,25 @@ class CoursePlugin : MethodChannel.MethodCallHandler { ...@@ -82,6 +87,25 @@ class CoursePlugin : MethodChannel.MethodCallHandler {
) )
result.success(mMap) result.success(mMap)
} }
GETASSIANSTGUIDEDATA -> {
val mMap = mutableMapOf<String, Any>()
val listData =
provide(IConsultantService::class.java)
.getGuideImage(7)
if (listData?.size ?: 0 > 0) {
mMap["pic"] = listData!![0].pic
mMap["linkUrl"] = listData!![0].linkUrl
} else {
mMap["pic"] = ""
mMap["linkUrl"] = ""
}
result.success(mMap)
}
JUMPROUTERURL -> {
val jumpUrl: String? = methodCall.arguments.toString()
provide(IConsultantService::class.java).jumpConsultAssistant(mFragment!!.activity as Activity, 7)
}
JUMPURL -> { JUMPURL -> {
var jumpUrl: String? = methodCall.arguments.toString() var jumpUrl: String? = methodCall.arguments.toString()
if (!TextUtils.isEmpty(jumpUrl)) { if (!TextUtils.isEmpty(jumpUrl)) {
......
...@@ -18,10 +18,16 @@ import com.ydl.media.view.PlayerFloatHelper ...@@ -18,10 +18,16 @@ import com.ydl.media.view.PlayerFloatHelper
import com.ydl.media.view.PlayerFloatView import com.ydl.media.view.PlayerFloatView
import com.ydl.webview.H5Params import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity import com.ydl.webview.NewH5Activity
import com.ydl.ydl_image.config.ISimpleImageOpConfig
import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.ydl.ydl_image.module.GlideApp import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydlcommon.modular.ModularServiceManager.provide
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.common.tools.RxImageTool import com.yidianling.common.tools.RxImageTool
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.api.IConsultantService
import com.yidianling.consultant.bean.GuideBean
import com.yidianling.course.CourseConstants import com.yidianling.course.CourseConstants
import com.yidianling.course.R import com.yidianling.course.R
import com.yidianling.course.bean.Course import com.yidianling.course.bean.Course
...@@ -71,6 +77,7 @@ class CourseItemNewView : ConstraintLayout { ...@@ -71,6 +77,7 @@ class CourseItemNewView : ConstraintLayout {
} }
} }
iv_guide_image.visibility = View.GONE
GlideApp.with(mContext) GlideApp.with(mContext)
.load(headUrl) .load(headUrl)
.into(iv_head) .into(iv_head)
...@@ -242,6 +249,19 @@ class CourseItemNewView : ConstraintLayout { ...@@ -242,6 +249,19 @@ class CourseItemNewView : ConstraintLayout {
} }
} }
fun setGuideData(bean: GuideBean) {
view_bottom_line.visibility = View.INVISIBLE
iv_guide_image.visibility = View.VISIBLE
val sp = SimpleImageOpConfiger()
sp.transform = ISimpleImageOpConfig.TRANSFORM_ROUND
sp.radius = 8
YDLImageCacheManager.showImage(mContext, bean.pic, iv_guide_image, sp)
iv_guide_image.setOnClickListener {
provide(IConsultantService::class.java).jumpConsultAssistant(mContext as Activity, bean.location.toInt())
}
}
private fun playMedia() { private fun playMedia() {
if (PlayerFloatHelper.isShow(mContext)) { if (PlayerFloatHelper.isShow(mContext)) {
PlayerFloatHelper.hide() PlayerFloatHelper.hide()
......
...@@ -235,4 +235,14 @@ ...@@ -235,4 +235,14 @@
android:background="@color/course_color_EBEBEB" android:background="@color/course_color_EBEBEB"
app:layout_constraintTop_toBottomOf="@+id/iv_head"/> app:layout_constraintTop_toBottomOf="@+id/iv_head"/>
<ImageView
android:id="@+id/iv_guide_image"
android:layout_width="match_parent"
android:layout_height="90dp"
android:visibility="gone"
android:layout_marginTop="20dp"
tools:visibility="visible"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/iv_head"
/>
</merge> </merge>
\ No newline at end of file
...@@ -128,6 +128,8 @@ public class TrendsListBean { ...@@ -128,6 +128,8 @@ public class TrendsListBean {
* 广告跳转h5分享数据 * 广告跳转h5分享数据
*/ */
public ShareData share; public ShareData share;
public int isAssistantGuide =0;
public String assistantGuideImg;
/** /**
* 广告图片 * 广告图片
*/ */
......
...@@ -14,9 +14,20 @@ import android.view.View; ...@@ -14,9 +14,20 @@ import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ImageView; import android.widget.ImageView;
import com.ydl.webview.H5Params;
import com.ydl.webview.NewH5Activity;
import com.ydl.ydl_image.config.ISimpleImageOpConfig;
import com.ydl.ydl_image.config.SimpleImageOpConfiger; import com.ydl.ydl_image.config.SimpleImageOpConfiger;
import com.ydl.ydl_image.manager.YDLImageCacheManager; import com.ydl.ydl_image.manager.YDLImageCacheManager;
import com.ydl.ydlcommon.modular.ModularServiceManager;
import com.ydl.ydlcommon.utils.MoonUtil;
import com.ydl.ydlcommon.utils.StringUtils;
import com.ydl.ydlcommon.view.BaseViewHolder;
import com.yidianling.common.tools.LogUtil; import com.yidianling.common.tools.LogUtil;
import com.yidianling.common.tools.RxImageTool;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.consultant.api.IConsultantService;
import com.yidianling.consultant.bean.GuideBean;
import com.yidianling.dynamic.R; import com.yidianling.dynamic.R;
import com.yidianling.dynamic.common.view.ImageInfo; import com.yidianling.dynamic.common.view.ImageInfo;
import com.yidianling.dynamic.common.view.NineGridView; import com.yidianling.dynamic.common.view.NineGridView;
...@@ -24,16 +35,13 @@ import com.yidianling.dynamic.common.view.NineGridViewClickAdapter; ...@@ -24,16 +35,13 @@ import com.yidianling.dynamic.common.view.NineGridViewClickAdapter;
import com.yidianling.dynamic.members.MembersActivity; import com.yidianling.dynamic.members.MembersActivity;
import com.yidianling.dynamic.model.TrendsListBean; import com.yidianling.dynamic.model.TrendsListBean;
import com.yidianling.dynamic.router.DynamicIn; import com.yidianling.dynamic.router.DynamicIn;
import com.ydl.webview.H5Params;
import com.ydl.webview.NewH5Activity;;
import com.ydl.ydlcommon.utils.StringUtils;
import com.ydl.ydlcommon.utils.MoonUtil;
import com.ydl.ydlcommon.view.BaseViewHolder;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
;
/** /**
* Created by Jim on 2017/9/22 0022. * Created by Jim on 2017/9/22 0022.
*/ */
...@@ -219,6 +227,22 @@ public class TrendsCotentListAdapter extends RecyclerView.Adapter<BaseViewHolder ...@@ -219,6 +227,22 @@ public class TrendsCotentListAdapter extends RecyclerView.Adapter<BaseViewHolder
holder.setVisibility(R.id.item_trend_zan_iv, trend.isAd == 1 ? View.GONE : View.VISIBLE); holder.setVisibility(R.id.item_trend_zan_iv, trend.isAd == 1 ? View.GONE : View.VISIBLE);
holder.setVisibility(R.id.text_trend, trend.isAd == 1 ? View.GONE : View.VISIBLE); holder.setVisibility(R.id.text_trend, trend.isAd == 1 ? View.GONE : View.VISIBLE);
holder.setVisibility(R.id.item_trend_souce_tv, trend.isAd == 1 ? View.GONE : View.VISIBLE); holder.setVisibility(R.id.item_trend_souce_tv, trend.isAd == 1 ? View.GONE : View.VISIBLE);
if (trend.isAssistantGuide==1) {
holder.setVisibility(R.id.iv_assistant_guide_image, View.VISIBLE);
holder.setVisibility(R.id.nine_grid, View.GONE);
holder.setVisibility(R.id.item_trend_zan_rel, View.GONE);
ImageView guideImage = holder.getView(R.id.iv_assistant_guide_image);
SimpleImageOpConfiger sp = new SimpleImageOpConfiger();
sp.transform = ISimpleImageOpConfig.TRANSFORM_ROUND;
sp.radius =8;
YDLImageCacheManager.showImage(mContext, trend.assistantGuideImg, guideImage, sp);
} else {
holder.setVisibility(R.id.iv_assistant_guide_image, View.GONE);
holder.setVisibility(R.id.nine_grid, View.VISIBLE);
holder.setVisibility(R.id.item_trend_zan_rel, View.VISIBLE);
}
int type = trend.multitextType; int type = trend.multitextType;
switch (type) { switch (type) {
case TYPE_PURE_TEXT: case TYPE_PURE_TEXT:
...@@ -293,7 +317,13 @@ public class TrendsCotentListAdapter extends RecyclerView.Adapter<BaseViewHolder ...@@ -293,7 +317,13 @@ public class TrendsCotentListAdapter extends RecyclerView.Adapter<BaseViewHolder
}) })
.setOnClickListener(R.id.ll_trend_content, v -> { .setOnClickListener(R.id.ll_trend_content, v -> {
if (onItemClickListener != null) { if (onItemClickListener != null) {
onItemClickListener.onItemClick(Integer.valueOf(trend.id), Integer.valueOf(trend.commentsCount), position); if (trend.isAssistantGuide ==0) {
onItemClickListener.onItemClick(Integer.valueOf(trend.id), Integer.valueOf(trend.commentsCount), position);
} else {
// ToastUtil.toastShort("跳转到导医入口页面");
ModularServiceManager.INSTANCE.provide(IConsultantService.class).jumpConsultAssistant((Activity) mContext,3);
}
} }
}); });
} }
...@@ -317,11 +347,11 @@ public class TrendsCotentListAdapter extends RecyclerView.Adapter<BaseViewHolder ...@@ -317,11 +347,11 @@ public class TrendsCotentListAdapter extends RecyclerView.Adapter<BaseViewHolder
imageInfo.mShareData = trend.share; imageInfo.mShareData = trend.share;
imageInfos.add(imageInfo); imageInfos.add(imageInfo);
} else { } else {
if (null != trend && null != trend.smallAttach){ if (null != trend && null != trend.smallAttach) {
for (int i = 0; i < trend.smallAttach.size(); i++) { for (int i = 0; i < trend.smallAttach.size(); i++) {
ImageInfo imageInfo = new ImageInfo(); ImageInfo imageInfo = new ImageInfo();
imageInfo.setThumbnailUrl(trend.smallAttach.get(i)); imageInfo.setThumbnailUrl(trend.smallAttach.get(i));
if (null != trend.bigAttach && trend.bigAttach.size() > i){ if (null != trend.bigAttach && trend.bigAttach.size() > i) {
imageInfo.setBigImageUrl(trend.bigAttach.get(i)); imageInfo.setBigImageUrl(trend.bigAttach.get(i));
} }
imageInfos.add(imageInfo); imageInfos.add(imageInfo);
...@@ -346,7 +376,7 @@ public class TrendsCotentListAdapter extends RecyclerView.Adapter<BaseViewHolder ...@@ -346,7 +376,7 @@ public class TrendsCotentListAdapter extends RecyclerView.Adapter<BaseViewHolder
SimpleImageOpConfiger sp = new SimpleImageOpConfiger(); SimpleImageOpConfiger sp = new SimpleImageOpConfiger();
sp.errorPic = R.drawable.dynamic_ic_default_color; sp.errorPic = R.drawable.dynamic_ic_default_color;
sp.isCacheOnDisk = false; sp.isCacheOnDisk = false;
YDLImageCacheManager.showImage(context,url,imageView,sp); YDLImageCacheManager.showImage(context, url, imageView, sp);
} }
@Override @Override
...@@ -361,11 +391,11 @@ public class TrendsCotentListAdapter extends RecyclerView.Adapter<BaseViewHolder ...@@ -361,11 +391,11 @@ public class TrendsCotentListAdapter extends RecyclerView.Adapter<BaseViewHolder
setBasicInfo(position, holder, trend) setBasicInfo(position, holder, trend)
.setVisibility(R.id.item_trend_ad_rel, View.VISIBLE) .setVisibility(R.id.item_trend_ad_rel, View.VISIBLE)
.setVisibility(R.id.nine_grid, View.GONE) .setVisibility(R.id.nine_grid, View.GONE)
.setVisibility(R.id.iv_fm,(null != trend && null != trend.ext && trend.ext.url.contains("fm/detail")) ? View.VISIBLE : View.GONE) .setVisibility(R.id.iv_fm, (null != trend && null != trend.ext && trend.ext.url.contains("fm/detail")) ? View.VISIBLE : View.GONE)
.setImageWithUrl(R.id.item_trend_ad_iv, (null == trend || null == trend.ext) ? "" : trend.ext.cover) .setImageWithUrl(R.id.item_trend_ad_iv, (null == trend || null == trend.ext) ? "" : trend.ext.cover)
.setText(R.id.item_trend_ad_tv, (null == trend || null == trend.ext) ? "" : trend.ext.title) .setText(R.id.item_trend_ad_tv, (null == trend || null == trend.ext) ? "" : trend.ext.title)
.setOnClickListener(R.id.item_trend_ad_rel, v -> { .setOnClickListener(R.id.item_trend_ad_rel, v -> {
if (null != trend && null != trend.ext && !TextUtils.isEmpty(trend.ext.url)){ if (null != trend && null != trend.ext && !TextUtils.isEmpty(trend.ext.url)) {
Map<String, String> map = StringUtils.IsHttpReturn(trend.ext.url); Map<String, String> map = StringUtils.IsHttpReturn(trend.ext.url);
String jumpType = map.get("jump_type"); String jumpType = map.get("jump_type");
if ("url".equals(jumpType)) { if ("url".equals(jumpType)) {
...@@ -405,13 +435,13 @@ public class TrendsCotentListAdapter extends RecyclerView.Adapter<BaseViewHolder ...@@ -405,13 +435,13 @@ public class TrendsCotentListAdapter extends RecyclerView.Adapter<BaseViewHolder
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
e.printStackTrace(); e.printStackTrace();
} }
} else if (realUrl.contains("fm/detail")){ } else if (realUrl.contains("fm/detail")) {
//因为ios已经做了,就是这么判断的,所以后续改吧 //因为ios已经做了,就是这么判断的,所以后续改吧
String id = realUrl.substring(realUrl.lastIndexOf("/") + 1); String id = realUrl.substring(realUrl.lastIndexOf("/") + 1);
if (!TextUtils.isEmpty(id)){ if (!TextUtils.isEmpty(id)) {
mContext.startActivity(DynamicIn.INSTANCE.fmDetailIntent((Activity) mContext,Integer.valueOf(id))); mContext.startActivity(DynamicIn.INSTANCE.fmDetailIntent((Activity) mContext, Integer.valueOf(id)));
} }
}else { } else {
H5Params h5Params = new H5Params(realUrl, null); H5Params h5Params = new H5Params(realUrl, null);
NewH5Activity.start(mContext, h5Params); NewH5Activity.start(mContext, h5Params);
} }
......
...@@ -113,6 +113,17 @@ ...@@ -113,6 +113,17 @@
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
android:layout_marginTop="15dp" /> android:layout_marginTop="15dp" />
<ImageView
android:id="@+id/iv_assistant_guide_image"
android:layout_width="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="15dp"
android:visibility="gone"
android:layout_marginBottom="15dp"
android:layout_height="90dp"/>
<!-- Url布局--> <!-- Url布局-->
<RelativeLayout <RelativeLayout
android:id="@+id/item_trend_ad_rel" android:id="@+id/item_trend_ad_rel"
......
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