Commit 5a3c5379 by 洪国微

新增咨询首页fragment

parent 5b521932
......@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
import android.text.TextUtils
import com.google.gson.Gson
import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.base.lifecycle.IActivityLifecycleable
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.mvp.base.SimplePresenter
......@@ -22,7 +23,6 @@ import io.reactivex.schedulers.Schedulers
/**
* 专家搜索页Presenter
* Created by zqk on 17-9-19.
*/
class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
......@@ -43,10 +43,12 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
}
@SuppressLint("CheckResult")
fun fetchBannerList() {
ExpertSearchDataManager.getHttp().getBannerList()
.subscribeOn(Schedulers.io())
.compose(RxLifecycleUtils.bindToLifecycle(mView!!)).compose(RxUtils.resultJavaData())
.compose(RxLifecycleUtils.bindToLifecycle(mView!!))
.compose(RxUtils.resultJavaData())
.map { it }
.filter { it != null }
.observeOn(AndroidSchedulers.mainThread())
......@@ -121,6 +123,7 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
}
}
@SuppressLint("CheckResult")
fun fetchListData(allFilter: AllFilter, page: Int) {
var showType = 0
......@@ -164,7 +167,8 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
}
sb.append("&page=").append(page)
ExpertSearchDataManager.getHttp().searchDoctor(sb.toString())
.compose(RxLifecycleUtils.bindToLifecycle(mView!!)).compose(RxUtils.resultJavaData())
.compose(RxLifecycleUtils.bindToLifecycle(mView!!))
.compose(RxUtils.resultJavaData())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer {
......
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