Commit 27a8bddb by 霍志良

feat:修改代码

parent b276c2f0
......@@ -4,5 +4,5 @@ import com.yidianling.consultant.bean.FunctionWordConsultBean
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
}
}
override fun onFunctionWordFetched(wordBean: List<FunctionWordBean>?) {
override fun onFunctionWordFetched(wordBean: MutableList<FunctionWordBean>) {
//获取底纹词
bottomWordlist = wordBean!!
bottomWordlist = wordBean
if (bottomWordlist.isNullOrEmpty()) return
if (!searchWord.isNullOrEmpty()) {
tv_search_content.text = searchWord
......
......@@ -430,9 +430,9 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
}
@SuppressLint("CheckResult")
override fun onFunctionWordFetched(wordBean: List<FunctionWordBean>?) {
override fun onFunctionWordFetched(wordBean: MutableList<FunctionWordBean>) {
//获取底纹词
bottomWordlist = wordBean!!
bottomWordlist = wordBean
if (bottomWordlist.isNullOrEmpty()) return
if (bottomWordlist.size == 1) {
tv_search_content.text = bottomWordlist[0].word
......
......@@ -49,6 +49,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
private var mSearchContent: String = ""
private val CACHE_CONSULT_SEARCH_HISTORY_DATA = "cache_consult_search_history_data"
private val HOT_SEARCH_DOCTOR_NAME = "hot_search_doctor_name"
private val JUMP_WORD = "jump_word"
private var historyList: FixSizeLinkedList<String> = FixSizeLinkedList(15)
private val bannerList = ArrayList<String>()
......@@ -114,7 +115,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
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))
} else {
if (etSearch.text.toString().isNullOrEmpty()) {
......@@ -177,7 +178,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
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))
} else {
doSearch(
......@@ -255,7 +256,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
}
if (!searchWordsBean.search_suggests.isNullOrEmpty() && searchWordsBean.search_suggests?.get(
0
)?.suggest_types?.contains("jump_word")
)?.suggest_types?.contains(JUMP_WORD)
) {
//将数据增加到历史搜索中
if (!TextUtils.isEmpty(searchContent)) {
......@@ -320,7 +321,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
refreshBanner(hotSearchBean.focusList)
}
override fun searchHotWordData(wordList: List<FunctionWordBean>) {
override fun searchHotWordData(wordList: MutableList<FunctionWordBean>) {
//热门词搜索结果
if (null == wordList || wordList.isEmpty()) {
llHotSearch.visibility = View.GONE
......
......@@ -18,7 +18,7 @@ interface IExpertSearchView : IView {
fun localData()
fun onHeadFetched(headData: HeadData?)
fun onFunctionWordFetched(wordBean: List<FunctionWordBean>?)
fun onFunctionWordFetched(wordBean: MutableList<FunctionWordBean>)
fun onDoctorListFetched(data: MutableList<ExpertServiceItem>, extras: Extras?, curPage: Int)
fun fetchFailed(msg: String?)
fun fetchListFailed(msg: String?)
......
......@@ -28,7 +28,7 @@ class IHotSearchContract {
/**
* 搜索页请求热门词
*/
fun searchHotWordData(wordList: List<FunctionWordBean>)
fun searchHotWordData(wordList: MutableList<FunctionWordBean>)
/**
* 请求失败
......@@ -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 {
}
}
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)
}
......
......@@ -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 {
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)
}
}
\ No newline at end of file
......@@ -45,13 +45,13 @@ interface SearchApi {
//(1热门词,2底纹词,3跳转词)
@POST("function/word/queryList")
@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跳转词)
@POST("function/word/queryList")
@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 {
@SuppressLint("CheckResult")
override fun getbottomWord(type: Int, listener: OnBottomWordListener) {
val map = HashMap<String, Any>()
map["type"] = type
val map = hashMapOf("type" to type)
SearchApi.getSearchApi()
.searchFunctionWordApi(map)
.compose(RxUtils.resultJavaData())
......
......@@ -93,7 +93,7 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
private var isFromCreate: Boolean = true
var startTime = System.currentTimeMillis()
var endTime by Delegates.notNull<Long>()
private lateinit var bottomWordlist: List<FunctionWordConsultBean>
private lateinit var bottomWordlist: MutableList<FunctionWordConsultBean>
var bottomWordDisposable: Disposable? = null
override fun layoutResId(): Int {
return R.layout.home_fragment_home_module
......@@ -391,8 +391,8 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
private fun getBottomWord() {
ModularServiceManager.provide(IConsultantService::class.java)
.getbottomWord(2, object : OnBottomWordListener {
override fun onBottomWord(wordList: List<FunctionWordConsultBean>) {
bottomWordlist = wordList!!
override fun onBottomWord(wordList: MutableList<FunctionWordConsultBean>) {
bottomWordlist = wordList
if (bottomWordlist.isNullOrEmpty()) return
if (bottomWordlist.size == 1) {
etSearch.hint = bottomWordlist[0].word
......
......@@ -113,7 +113,7 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
* 如果是第一次加载,则调用所有接口进行刷新,否则,只调用咨询和倾诉接口
*/
private var isFromCreate: Boolean = true
private lateinit var bottomWordlist: List<FunctionWordConsultBean>
private lateinit var bottomWordlist: MutableList<FunctionWordConsultBean>
var bottomWordDisposable: Disposable? = null
override fun layoutResId(): Int {
......@@ -238,25 +238,11 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
}
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() {
// 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 {
......@@ -528,8 +514,8 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
private fun getBottomWord() {
ModularServiceManager.provide(IConsultantService::class.java)
.getbottomWord(2, object : OnBottomWordListener {
override fun onBottomWord(wordList: List<FunctionWordConsultBean>) {
bottomWordlist = wordList!!
override fun onBottomWord(wordList: MutableList<FunctionWordConsultBean>) {
bottomWordlist = wordList
if (bottomWordlist.isNullOrEmpty()) return
if (bottomWordlist.size == 1) {
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