Commit 27a8bddb by 霍志良

feat:修改代码

parent b276c2f0
...@@ -4,5 +4,5 @@ import com.yidianling.consultant.bean.FunctionWordConsultBean ...@@ -4,5 +4,5 @@ import com.yidianling.consultant.bean.FunctionWordConsultBean
interface OnBottomWordListener { interface OnBottomWordListener {
fun onBottomWord(wordList: List<FunctionWordConsultBean>) fun onBottomWord(wordList: MutableList<FunctionWordConsultBean>)
} }
\ No newline at end of file
...@@ -520,9 +520,9 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -520,9 +520,9 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
} }
} }
override fun onFunctionWordFetched(wordBean: List<FunctionWordBean>?) { override fun onFunctionWordFetched(wordBean: MutableList<FunctionWordBean>) {
//获取底纹词 //获取底纹词
bottomWordlist = wordBean!! bottomWordlist = wordBean
if (bottomWordlist.isNullOrEmpty()) return if (bottomWordlist.isNullOrEmpty()) return
if (!searchWord.isNullOrEmpty()) { if (!searchWord.isNullOrEmpty()) {
tv_search_content.text = searchWord tv_search_content.text = searchWord
......
...@@ -430,9 +430,9 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -430,9 +430,9 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
} }
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
override fun onFunctionWordFetched(wordBean: List<FunctionWordBean>?) { override fun onFunctionWordFetched(wordBean: MutableList<FunctionWordBean>) {
//获取底纹词 //获取底纹词
bottomWordlist = wordBean!! bottomWordlist = wordBean
if (bottomWordlist.isNullOrEmpty()) return if (bottomWordlist.isNullOrEmpty()) return
if (bottomWordlist.size == 1) { if (bottomWordlist.size == 1) {
tv_search_content.text = bottomWordlist[0].word tv_search_content.text = bottomWordlist[0].word
......
...@@ -49,6 +49,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon ...@@ -49,6 +49,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
private var mSearchContent: String = "" private var mSearchContent: String = ""
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 val JUMP_WORD = "jump_word"
private var historyList: FixSizeLinkedList<String> = FixSizeLinkedList(15) private var historyList: FixSizeLinkedList<String> = FixSizeLinkedList(15)
private val bannerList = ArrayList<String>() private val bannerList = ArrayList<String>()
...@@ -114,7 +115,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon ...@@ -114,7 +115,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
relatedWords = searchSuggestList[0].suggest_content relatedWords = searchSuggestList[0].suggest_content
} }
if (searchSuggestList?.get(0)?.suggest_types?.contains("jump_word")) { if (searchSuggestList?.get(0)?.suggest_types?.contains(JUMP_WORD)) {
NewH5Activity.start(this, H5Params(searchSuggestList[0].jump_url!!, null)) NewH5Activity.start(this, H5Params(searchSuggestList[0].jump_url!!, null))
} else { } else {
if (etSearch.text.toString().isNullOrEmpty()) { if (etSearch.text.toString().isNullOrEmpty()) {
...@@ -177,7 +178,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon ...@@ -177,7 +178,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
relatedWords = searchSuggestList[position].suggest_content relatedWords = searchSuggestList[position].suggest_content
} }
} }
if (searchSuggestList[position].suggest_types?.contains("jump_word")) { if (searchSuggestList[position].suggest_types.contains(JUMP_WORD)) {
NewH5Activity.start(this, H5Params(searchSuggestList[position].jump_url!!, null)) NewH5Activity.start(this, H5Params(searchSuggestList[position].jump_url!!, null))
} else { } else {
doSearch( doSearch(
...@@ -255,7 +256,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon ...@@ -255,7 +256,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
} }
if (!searchWordsBean.search_suggests.isNullOrEmpty() && searchWordsBean.search_suggests?.get( if (!searchWordsBean.search_suggests.isNullOrEmpty() && searchWordsBean.search_suggests?.get(
0 0
)?.suggest_types?.contains("jump_word") )?.suggest_types?.contains(JUMP_WORD)
) { ) {
//将数据增加到历史搜索中 //将数据增加到历史搜索中
if (!TextUtils.isEmpty(searchContent)) { if (!TextUtils.isEmpty(searchContent)) {
...@@ -320,7 +321,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon ...@@ -320,7 +321,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
refreshBanner(hotSearchBean.focusList) refreshBanner(hotSearchBean.focusList)
} }
override fun searchHotWordData(wordList: List<FunctionWordBean>) { override fun searchHotWordData(wordList: MutableList<FunctionWordBean>) {
//热门词搜索结果 //热门词搜索结果
if (null == wordList || wordList.isEmpty()) { if (null == wordList || wordList.isEmpty()) {
llHotSearch.visibility = View.GONE llHotSearch.visibility = View.GONE
......
...@@ -18,7 +18,7 @@ interface IExpertSearchView : IView { ...@@ -18,7 +18,7 @@ interface IExpertSearchView : IView {
fun localData() fun localData()
fun onHeadFetched(headData: HeadData?) fun onHeadFetched(headData: HeadData?)
fun onFunctionWordFetched(wordBean: List<FunctionWordBean>?) fun onFunctionWordFetched(wordBean: MutableList<FunctionWordBean>)
fun onDoctorListFetched(data: MutableList<ExpertServiceItem>, extras: Extras?, curPage: Int) fun onDoctorListFetched(data: MutableList<ExpertServiceItem>, extras: Extras?, curPage: Int)
fun fetchFailed(msg: String?) fun fetchFailed(msg: String?)
fun fetchListFailed(msg: String?) fun fetchListFailed(msg: String?)
......
...@@ -28,7 +28,7 @@ class IHotSearchContract { ...@@ -28,7 +28,7 @@ class IHotSearchContract {
/** /**
* 搜索页请求热门词 * 搜索页请求热门词
*/ */
fun searchHotWordData(wordList: List<FunctionWordBean>) fun searchHotWordData(wordList: MutableList<FunctionWordBean>)
/** /**
* 请求失败 * 请求失败
...@@ -81,6 +81,6 @@ class IHotSearchContract { ...@@ -81,6 +81,6 @@ class IHotSearchContract {
/** /**
* 搜索页请求热门词 * 搜索页请求热门词
*/ */
fun searchHotWordData(map: HashMap<String, Any>): Observable<BaseAPIResponse<List<FunctionWordBean>>> fun searchHotWordData(map: HashMap<String, Any>): Observable<BaseAPIResponse<MutableList<FunctionWordBean>>>
} }
} }
\ No newline at end of file
...@@ -51,7 +51,7 @@ class HotSearchHttpImpl : IHotSearchHttp { ...@@ -51,7 +51,7 @@ class HotSearchHttpImpl : IHotSearchHttp {
} }
} }
override fun searchHotWordData(map: HashMap<String, Any>): Observable<BaseAPIResponse<List<FunctionWordBean>>> { override fun searchHotWordData(map: HashMap<String, Any>): Observable<BaseAPIResponse<MutableList<FunctionWordBean>>> {
return getSearchApi().searchFunctionWord(map) return getSearchApi().searchFunctionWord(map)
} }
......
...@@ -22,7 +22,7 @@ interface IHotSearchHttp { ...@@ -22,7 +22,7 @@ interface IHotSearchHttp {
/** /**
* 搜索页请求热门词 * 搜索页请求热门词
*/ */
fun searchHotWordData(map: HashMap<String, Any>): Observable<BaseAPIResponse<List<FunctionWordBean>>> fun searchHotWordData(map: HashMap<String, Any>): Observable<BaseAPIResponse<MutableList<FunctionWordBean>>>
/** /**
* 搜索联想词请求 * 搜索联想词请求
......
...@@ -25,7 +25,7 @@ class HotSearchModelImpl : IHotSearchContract.Model { ...@@ -25,7 +25,7 @@ class HotSearchModelImpl : IHotSearchContract.Model {
return HotSearchDataManager.getHttp().getSearchWords(map).compose(RxUtils.resultJavaData()) return HotSearchDataManager.getHttp().getSearchWords(map).compose(RxUtils.resultJavaData())
} }
override fun searchHotWordData(map: HashMap<String, Any>): Observable<BaseAPIResponse<List<FunctionWordBean>>> { override fun searchHotWordData(map: HashMap<String, Any>): Observable<BaseAPIResponse<MutableList<FunctionWordBean>>> {
return HotSearchDataManager.getHttp().searchHotWordData(map) return HotSearchDataManager.getHttp().searchHotWordData(map)
} }
} }
\ No newline at end of file
...@@ -45,13 +45,13 @@ interface SearchApi { ...@@ -45,13 +45,13 @@ interface SearchApi {
//(1热门词,2底纹词,3跳转词) //(1热门词,2底纹词,3跳转词)
@POST("function/word/queryList") @POST("function/word/queryList")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA) @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun searchFunctionWord(@Body map: Map<String, @JvmSuppressWildcards Any>): Observable<BaseAPIResponse<List<FunctionWordBean>>> fun searchFunctionWord(@Body map: Map<String, @JvmSuppressWildcards Any>): Observable<BaseAPIResponse<MutableList<FunctionWordBean>>>
//查询功能词、底纹词 //查询功能词、底纹词
//(1热门词,2底纹词,3跳转词) //(1热门词,2底纹词,3跳转词)
@POST("function/word/queryList") @POST("function/word/queryList")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA) @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun searchFunctionWordApi(@Body map: Map<String, @JvmSuppressWildcards Any>): Observable<BaseAPIResponse<List<FunctionWordConsultBean>>> fun searchFunctionWordApi(@Body map: Map<String, @JvmSuppressWildcards Any>): Observable<BaseAPIResponse<MutableList<FunctionWordConsultBean>>>
/** /**
* 新咨询师列表接口(包含搜索、筛选咨询师) * 新咨询师列表接口(包含搜索、筛选咨询师)
......
...@@ -136,8 +136,7 @@ class ConsultantServiceImp : IConsultantService { ...@@ -136,8 +136,7 @@ class ConsultantServiceImp : IConsultantService {
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
override fun getbottomWord(type: Int, listener: OnBottomWordListener) { override fun getbottomWord(type: Int, listener: OnBottomWordListener) {
val map = HashMap<String, Any>() val map = hashMapOf("type" to type)
map["type"] = type
SearchApi.getSearchApi() SearchApi.getSearchApi()
.searchFunctionWordApi(map) .searchFunctionWordApi(map)
.compose(RxUtils.resultJavaData()) .compose(RxUtils.resultJavaData())
......
...@@ -93,7 +93,7 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>() ...@@ -93,7 +93,7 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
private var isFromCreate: Boolean = true private var isFromCreate: Boolean = true
var startTime = System.currentTimeMillis() var startTime = System.currentTimeMillis()
var endTime by Delegates.notNull<Long>() var endTime by Delegates.notNull<Long>()
private lateinit var bottomWordlist: List<FunctionWordConsultBean> private lateinit var bottomWordlist: MutableList<FunctionWordConsultBean>
var bottomWordDisposable: Disposable? = null var bottomWordDisposable: Disposable? = null
override fun layoutResId(): Int { override fun layoutResId(): Int {
return R.layout.home_fragment_home_module return R.layout.home_fragment_home_module
...@@ -391,8 +391,8 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>() ...@@ -391,8 +391,8 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
private fun getBottomWord() { private fun getBottomWord() {
ModularServiceManager.provide(IConsultantService::class.java) ModularServiceManager.provide(IConsultantService::class.java)
.getbottomWord(2, object : OnBottomWordListener { .getbottomWord(2, object : OnBottomWordListener {
override fun onBottomWord(wordList: List<FunctionWordConsultBean>) { override fun onBottomWord(wordList: MutableList<FunctionWordConsultBean>) {
bottomWordlist = wordList!! bottomWordlist = wordList
if (bottomWordlist.isNullOrEmpty()) return if (bottomWordlist.isNullOrEmpty()) return
if (bottomWordlist.size == 1) { if (bottomWordlist.size == 1) {
etSearch.hint = bottomWordlist[0].word etSearch.hint = bottomWordlist[0].word
......
...@@ -113,7 +113,7 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm ...@@ -113,7 +113,7 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
* 如果是第一次加载,则调用所有接口进行刷新,否则,只调用咨询和倾诉接口 * 如果是第一次加载,则调用所有接口进行刷新,否则,只调用咨询和倾诉接口
*/ */
private var isFromCreate: Boolean = true private var isFromCreate: Boolean = true
private lateinit var bottomWordlist: List<FunctionWordConsultBean> private lateinit var bottomWordlist: MutableList<FunctionWordConsultBean>
var bottomWordDisposable: Disposable? = null var bottomWordDisposable: Disposable? = null
override fun layoutResId(): Int { override fun layoutResId(): Int {
...@@ -238,25 +238,11 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm ...@@ -238,25 +238,11 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
} }
override fun startAnim() { override fun startAnim() {
// HomeAnimUtils.startAnim(mContext, rl_top, rl_search, home_service_call, home_tv)
// HomeAnimUtils.startSearchShow(
// ll_top_function,
// view_search_input_bg,
// home_tv,
// iv_search_icon,
// img_ad
// )
} }
override fun endAnim() { override fun endAnim() {
// HomeAnimUtils.endAnim(mContext, rl_top, rl_search, home_tv, home_service_call, this)
// HomeAnimUtils.startSearchHide(
// ll_top_function,
// view_search_input_bg,
// home_tv,
// iv_search_icon,
// img_ad
// )
} }
override fun getSearchContent(): String { override fun getSearchContent(): String {
...@@ -528,8 +514,8 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm ...@@ -528,8 +514,8 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
private fun getBottomWord() { private fun getBottomWord() {
ModularServiceManager.provide(IConsultantService::class.java) ModularServiceManager.provide(IConsultantService::class.java)
.getbottomWord(2, object : OnBottomWordListener { .getbottomWord(2, object : OnBottomWordListener {
override fun onBottomWord(wordList: List<FunctionWordConsultBean>) { override fun onBottomWord(wordList: MutableList<FunctionWordConsultBean>) {
bottomWordlist = wordList!! bottomWordlist = wordList
if (bottomWordlist.isNullOrEmpty()) return if (bottomWordlist.isNullOrEmpty()) return
if (bottomWordlist.size == 1) { if (bottomWordlist.size == 1) {
home_tv.text = bottomWordlist[0].word home_tv.text = bottomWordlist[0].word
......
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