Commit 4a0521ab by 霍志良

feat:底纹词首页实现

parent 8ff37d5b
......@@ -6,7 +6,7 @@ ext {
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.50.42",
"m-consultant" : "0.0.60.70",
"m-consultant" : "0.0.60.77",
"m-fm" : "0.0.30.09",
"m-user" : "0.0.62.61",
"m-home" : "0.0.23.95",
......@@ -37,7 +37,7 @@ ext {
//-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.6",
"m-consultant-api": "0.0.5.63",
"m-consultant-api": "0.0.5.64",
"m-course-api" : "0.0.3.6",
"m-fm-api" : "0.0.3",
"m-muse-api" : "0.0.1",
......@@ -88,7 +88,7 @@ ext {
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.50.42",
"m-consultant" : "0.0.60.70",
"m-consultant" : "0.0.60.77",
"m-fm" : "0.0.30.09",
"m-user" : "0.0.62.61",
"m-home" : "0.0.23.95",
......@@ -123,7 +123,7 @@ ext {
//-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.6",
"m-confide-api" : "1.0.0",
"m-consultant-api": "0.0.5.63",
"m-consultant-api": "0.0.5.64",
"m-course-api" : "0.0.3.6",
"m-fm-api" : "0.0.3",
"m-muse-api" : "0.0.1",
......
......@@ -40,6 +40,7 @@ import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxImageTool
import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.adapter.ExpertSearchAdapter
import com.yidianling.consultant.bean.FunctionWordConsultBean
import com.yidianling.consultant.constants.ConsultBIConstants
import com.yidianling.consultant.constants.ConsultBIConstants.ConsultEvent.Companion.YDL_USER_CONSULT_SEARCH_CLICK
import com.yidianling.consultant.listener.OnCategoriesSelectedListener
......@@ -78,7 +79,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
}
override fun showImage(url: String?, imgView: ImageView, ops: SimpleImageOpConfiger) {
YDLImageCacheManager.showImage(ExpertSearchActivity@ this, url, imgView, ops)
YDLImageCacheManager.showImage(this, url, imgView, ops)
}
override fun showImage(
......
......@@ -41,6 +41,7 @@ import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxImageTool
import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.adapter.ExpertSearchAdapter
import com.yidianling.consultant.bean.FunctionWordConsultBean
import com.yidianling.consultant.constants.ConsultBIConstants
import com.yidianling.consultant.listener.OnCategoriesSelectedListener
import com.yidianling.consultant.listener.OnExpertClickListener
......
......@@ -3,6 +3,7 @@ package com.yidianling.consultant
import android.widget.ImageView
import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydlcommon.mvp.base.IView
import com.yidianling.consultant.bean.FunctionWordConsultBean
import com.yidianling.consultant.model.bean.ExpertServiceItem
import com.yidianling.consultant.model.bean.Extras
import com.yidianling.consultant.model.bean.FunctionWordBean
......
......@@ -6,10 +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.GuideBean
import com.yidianling.consultant.bean.HotSearchBean
import com.yidianling.consultant.bean.SearchWordsBean
import com.yidianling.consultant.bean.*
import com.yidianling.consultant.model.bean.ExpertBean
import com.yidianling.consultant.model.bean.FunctionWordBean
import com.yidianling.consultant.model.bean.HeadData
......@@ -50,6 +47,12 @@ interface SearchApi {
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun searchFunctionWord(@Body map: Map<String, @JvmSuppressWildcards Any>): Observable<BaseAPIResponse<List<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>>>
/**
* 新咨询师列表接口(包含搜索、筛选咨询师)
*/
......
......@@ -9,14 +9,17 @@ import android.text.TextUtils
import com.alibaba.android.arouter.facade.annotation.Route
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.yidianling.common.tools.LogUtil
import com.ydl.ydlcommon.utils.remind.HttpErrorUtils
import com.yidianling.consultant.ExpertSearchActivity
import com.yidianling.consultant.ExpertSearchFragment
import com.yidianling.consultant.api.IConsultantService
import com.yidianling.consultant.bean.GuideBean
import com.yidianling.consultant.bean.Keyworks
import com.yidianling.consultant.data.ConsultantDataManager
import com.yidianling.consultant.OnBottomWordListener
import com.yidianling.consultant.model.SearchApi
import com.yidianling.consultant.modular.singlton.ConsultAssistantDialogUtils
import com.yidianling.consultant.modular.utils.ConsultAssistantEntryUtils
......@@ -118,14 +121,35 @@ class ConsultantServiceImp : IConsultantService {
ConsultAssistantEntryUtils.jumpConsultAssistant(activity,location,null)
}
override fun dueToTypeJumpAutoOrGuide(activity: Activity, location: Int, doctorId: Int,url:String) {
ConsultAssistantEntryUtils.getTypeJump(activity,location,doctorId,url)
override fun dueToTypeJumpAutoOrGuide(
activity: Activity,
location: Int,
doctorId: Int,
url: String
) {
ConsultAssistantEntryUtils.getTypeJump(activity, location, doctorId, url)
}
override fun showConfideListDialog(activity: Activity) {
ConsultAssistantDialogUtils.INSTANCE.showFromConfideListHome(activity)
}
@SuppressLint("CheckResult")
override fun getbottomWord(type: Int, listener: OnBottomWordListener) {
val map = HashMap<String, Any>()
map["type"] = type
SearchApi.getSearchApi()
.searchFunctionWordApi(map)
.compose(RxUtils.resultJavaData())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ resp ->
listener.onBottomWord(resp)
}, { t ->
HttpErrorUtils.handleError(BaseApp.getApp(), t)
})
}
override fun resetConsultAssistantDialogStatus() {
ConsultAssistantDialogUtils.INSTANCE.resetStatus()
}
......
package com.yidianling.consultant
import com.yidianling.consultant.bean.FunctionWordConsultBean
interface OnBottomWordListener {
fun onBottomWord(wordList: List<FunctionWordConsultBean>)
}
\ No newline at end of file
......@@ -6,6 +6,7 @@ import androidx.fragment.app.Fragment
import com.alibaba.android.arouter.facade.template.IProvider
import com.yidianling.consultant.bean.GuideBean
import com.yidianling.consultant.bean.Keyworks
import com.yidianling.consultant.OnBottomWordListener
/**
* Created by xj on 2019/11/14.
......@@ -39,11 +40,15 @@ interface IConsultantService: IProvider {
fun requestGuideData()
fun jumpConsultAssistant(activity: Activity, location:Int)
fun jumpConsultAssistant(activity: Activity, location: Int)
//根据返回Type跳转自主或者导医
fun dueToTypeJumpAutoOrGuide(activity: Activity, location:Int,doctorId:Int,url:String)
fun dueToTypeJumpAutoOrGuide(activity: Activity, location: Int, doctorId: Int, url: String)
// 咨询列表页显示咨询助理弹框
fun showConfideListDialog(activity: Activity)
//获取底纹词
fun getbottomWord(type: Int, listener: OnBottomWordListener)
}
\ No newline at end of file
package com.yidianling.consultant.bean
data class FunctionWordConsultBean(
var id: Long?,
var word: String?,
var type: Int?,
var jumpUrl: String?
)
\ No newline at end of file
......@@ -26,7 +26,9 @@ import com.ydl.ydlcommon.base.BaseMvpFragment
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.utils.*
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.consultant.OnBottomWordListener
import com.yidianling.consultant.api.IConsultantService
import com.yidianling.consultant.bean.FunctionWordConsultBean
import com.yidianling.home.R
import com.yidianling.home.adapter.YdlHomeAdapter
import com.yidianling.home.constants.HomeBIConstants
......@@ -42,10 +44,15 @@ import com.yidianling.home.ui.view.CouponDialog
import com.yidianling.home.ui.view.HomeSpaceItemDecoration
import com.yidianling.home.utils.HomeAnimUtils
import com.yidianling.user.api.service.IUserService
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.ydl.home_fragment.*
import kotlinx.android.synthetic.ydl.home_fragment.tab_layout
import kotlinx.android.synthetic.ydl.home_muse_view.*
import kotlinx.android.synthetic.ydl.home_muse_view.view.*
import java.util.concurrent.TimeUnit
import kotlin.properties.Delegates
......@@ -99,13 +106,15 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
open var searchText: String = ""
open var doctorName: String = ""
var startTime =0L
var endTime =0L
var startTime = 0L
var endTime = 0L
/**
* 如果是第一次加载,则调用所有接口进行刷新,否则,只调用咨询和倾诉接口
*/
private var isFromCreate: Boolean = true
private lateinit var bottomWordlist: List<FunctionWordConsultBean>
var bottomWordDisposable: Disposable? = null
override fun layoutResId(): Int {
return R.layout.home_fragment
......@@ -122,6 +131,7 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
open fun initHomeEvent() {
homeEvent = HomeImpl(mActivity, this)
getBottomWord()
}
private fun initAdapter() {
......@@ -177,7 +187,7 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
searchText = doctorName
}
home_tv.setOnClickListener { homeEvent?.searchTvClick(searchText) }
home_tv.text = searchText
// home_tv.text = searchText
}
/**
......@@ -509,6 +519,35 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
.showConsultAssistantDialog(mActivity)
}
private fun getBottomWord() {
ModularServiceManager.provide(IConsultantService::class.java)
.getbottomWord(2, object : OnBottomWordListener {
override fun onBottomWord(wordList: List<FunctionWordConsultBean>) {
bottomWordlist = wordList!!
if (bottomWordlist.isNullOrEmpty()) return
if (bottomWordlist.size == 1) {
home_tv.text = bottomWordlist[0].word
} else {
if (bottomWordDisposable != null) {
bottomWordDisposable?.dispose()
} else {
bottomWordDisposable = Observable.interval(0, 5, TimeUnit.SECONDS)
.subscribeOn(Schedulers.computation())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({
home_tv.text =
bottomWordlist[(it % bottomWordlist.size).toInt()].word
}, {
}, {
})
}
}
}
})
}
private fun hideConsultAssistantDialog() {
ModularServiceManager.provide(IConsultantService::class.java).hideConsultAssistantDialog()
}
......@@ -656,5 +695,6 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
override fun onDestroyView() {
super.onDestroyView()
HomeAnimUtils.clear()
bottomWordDisposable?.dispose()
}
}
\ No newline at end of file
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