Commit 4bc9694d by 刘鹏

Merge remote-tracking branch 'origin/4.2.60' into 4.2.60

# Conflicts:
#	config.gradle
parents c27adb13 114024fa
...@@ -9,9 +9,9 @@ ext { ...@@ -9,9 +9,9 @@ ext {
"m-consultant" : "0.0.59.89", "m-consultant" : "0.0.59.89",
"m-fm" : "0.0.30.03", "m-fm" : "0.0.30.03",
"m-user" : "0.0.61.37", "m-user" : "0.0.61.37",
"m-home" : "0.0.22.65", "m-home" : "0.0.22.67",
"m-im" : "0.0.19.28", "m-im" : "0.0.19.29",
"m-dynamic" : "0.0.7.22", "m-dynamic" : "0.0.7.24",
"m-article" : "0.0.0.10", "m-article" : "0.0.0.10",
"m-muse" : "0.0.28.24", "m-muse" : "0.0.28.24",
...@@ -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.11", "m-confide-api" : "0.0.2.11",
"m-consultant-api": "0.0.5.62", "m-consultant-api": "0.0.5.63",
"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",
...@@ -33,10 +33,10 @@ ext { ...@@ -33,10 +33,10 @@ ext {
//-------------- 功能组件 -------------- //-------------- 功能组件 --------------
//第一步 //第一步
"ydl-platform" : "0.0.40.13", "ydl-platform" : "0.0.40.15",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.38.46", "ydl-webview" : "0.0.38.47",
"ydl-media" : "0.0.21.9", "ydl-media" : "0.0.21.9",
"ydl-pay" : "0.0.18.19", "ydl-pay" : "0.0.18.19",
"m-audioim" : "0.0.49.29.37", "m-audioim" : "0.0.49.29.37",
...@@ -92,21 +92,18 @@ ext { ...@@ -92,21 +92,18 @@ ext {
"m-consultant" : "0.0.59.89", "m-consultant" : "0.0.59.89",
"m-fm" : "0.0.30.01", "m-fm" : "0.0.30.01",
"m-user" : "0.0.61.37", "m-user" : "0.0.61.37",
"m-home" : "0.0.22.65", "m-home" : "0.0.22.67",
"m-im" : "0.0.19.20", "m-im" : "0.0.19.29",
"m-dynamic" : "0.0.7.22", "m-dynamic" : "0.0.7.24",
"m-article" : "0.0.0.8", "m-article" : "0.0.0.8",
"m-muse" : "0.0.28.24", "m-muse" : "0.0.28.24",
"m-tests" : "0.0.24.14", "m-tests" : "0.0.24.14",
"m-course" : "0.0.42.62", "m-course" : "0.0.42.62",
"m-muse" : "0.0.28.23",
"m-tests" : "0.0.24.13",
"m-course" : "0.0.42.24",
//-------------- 业务模块 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.11",
"m-consultant-api": "0.0.5.62", "m-consultant-api": "0.0.5.63",
"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",
...@@ -118,10 +115,10 @@ ext { ...@@ -118,10 +115,10 @@ ext {
//-------------- 功能组件 -------------- //-------------- 功能组件 --------------
//第一步 //第一步
"ydl-platform" : "0.0.40.13", "ydl-platform" : "0.0.40.15",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.38.46", "ydl-webview" : "0.0.38.47",
"ydl-media" : "0.0.21.9", "ydl-media" : "0.0.21.9",
"ydl-pay" : "0.0.18.19", "ydl-pay" : "0.0.18.19",
"m-audioim" : "0.0.49.29.37", "m-audioim" : "0.0.49.29.37",
...@@ -136,7 +133,7 @@ ext { ...@@ -136,7 +133,7 @@ ext {
dependencies = [ dependencies = [
//support //support
"appcompat-v7" : 'androidx.appcompat:appcompat:1.2.0', "appcompat-v7" : 'androidx.appcompat:appcompat:1.2.0',
"design" : 'com.google.android.material:material:1.0.0', "design" : 'com.google.android.material:material:1.3.0',
"support-v4" : 'androidx.legacy:legacy-support-v4:1.0.0', "support-v4" : 'androidx.legacy:legacy-support-v4:1.0.0',
"cardview-v7" : 'androidx.cardview:cardview:1.0.0', "cardview-v7" : 'androidx.cardview:cardview:1.0.0',
"annotations" : "androidx.annotation:annotation:1.0.0", "annotations" : "androidx.annotation:annotation:1.0.0",
......
...@@ -6,10 +6,7 @@ import com.ydl.ydlcommon.base.config.YDL_DOMAIN ...@@ -6,10 +6,7 @@ import com.ydl.ydlcommon.base.config.YDL_DOMAIN
import com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA import com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA
import com.ydl.ydlcommon.data.http.BaseAPIResponse import com.ydl.ydlcommon.data.http.BaseAPIResponse
import io.reactivex.Observable import io.reactivex.Observable
import retrofit2.http.GET import retrofit2.http.*
import retrofit2.http.Headers
import retrofit2.http.QueryMap
import retrofit2.http.Url
/** /**
* @author yuanwai * @author yuanwai
...@@ -22,7 +19,7 @@ interface ConfideHomeApi{ ...@@ -22,7 +19,7 @@ interface ConfideHomeApi{
//倾诉首页 //倾诉首页
@Headers( YDL_DOMAIN + YDL_DOMAIN_JAVA,"Content-Type:application/json") @Headers( YDL_DOMAIN + YDL_DOMAIN_JAVA,"Content-Type:application/json")
@GET @GET
fun confideHome(@Url url: String): Observable<BaseAPIResponse<MutableList<ConfideHomeDataBean>>> fun confideHome(@Url url: String,@Query("cateSource") cateSource:Int): Observable<BaseAPIResponse<MutableList<ConfideHomeDataBean>>>
//每日精选 换一批 //每日精选 换一批
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA,"Content-Type:application/json") @Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA,"Content-Type:application/json")
......
...@@ -35,7 +35,7 @@ class ConfideHomeHttpImpl private constructor(): IConfideHomeHttp{ ...@@ -35,7 +35,7 @@ class ConfideHomeHttpImpl private constructor(): IConfideHomeHttp{
override fun confideHomeRequest(): Observable<BaseAPIResponse<MutableList<ConfideHomeDataBean>>> { override fun confideHomeRequest(): Observable<BaseAPIResponse<MutableList<ConfideHomeDataBean>>> {
return RxUtils.mapObservable(ConfideHomeParam(0)) return RxUtils.mapObservable(ConfideHomeParam(0))
.flatMap { .flatMap {
confideHomeApi.confideHome(HttpConfig.JAVA_BASE_URL+"auth/listen/home") confideHomeApi.confideHome(HttpConfig.JAVA_BASE_URL+"auth/listen/home",2)
} }
} }
......
...@@ -76,7 +76,13 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -76,7 +76,13 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
YDLImageCacheManager.showImage(ExpertSearchActivity@ this, url, imgView, ops) YDLImageCacheManager.showImage(ExpertSearchActivity@ this, url, imgView, ops)
} }
override fun showImage(url: String?, imgView: ImageView, width: Int, heigh: Int, ops: SimpleImageOpConfiger) { override fun showImage(
url: String?,
imgView: ImageView,
width: Int,
heigh: Int,
ops: SimpleImageOpConfiger
) {
YDLImageCacheManager.showImage(ExpertSearchActivity@ this, url, imgView, width, heigh, ops) YDLImageCacheManager.showImage(ExpertSearchActivity@ this, url, imgView, width, heigh, ops)
} }
...@@ -113,7 +119,12 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -113,7 +119,12 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
const val FROM_ONLINE_EXPERT = 2 const val FROM_ONLINE_EXPERT = 2
const val PAGE_SIZE = 15 const val PAGE_SIZE = 15
fun newIntent(activity: Activity, category: Int, showType: Int, isInitShowHot: Boolean): Intent { fun newIntent(
activity: Activity,
category: String,
showType: Int,
isInitShowHot: Boolean
): Intent {
val intent = Intent(activity, ExpertSearchActivity::class.java) val intent = Intent(activity, ExpertSearchActivity::class.java)
intent.putExtra(EXTRA_CATEGORY, category) intent.putExtra(EXTRA_CATEGORY, category)
intent.putExtra(EXTRA_SHOW_TYPE, showType) intent.putExtra(EXTRA_SHOW_TYPE, showType)
...@@ -121,13 +132,13 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -121,13 +132,13 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
return intent return intent
} }
fun start(context: Context, category: Int) { fun start(context: Context, category: String) {
val intent = Intent(context, ExpertSearchActivity::class.java) val intent = Intent(context, ExpertSearchActivity::class.java)
intent.putExtra(EXTRA_CATEGORY, category) intent.putExtra(EXTRA_CATEGORY, category)
context.startActivity(intent) context.startActivity(intent)
} }
fun start(context: Context, category: Int, categoryName: String, showType: Int) { fun start(context: Context, category: String, categoryName: String, showType: Int) {
val intent = Intent(context, ExpertSearchActivity::class.java) val intent = Intent(context, ExpertSearchActivity::class.java)
intent.putExtra(EXTRA_CATEGORY, category) intent.putExtra(EXTRA_CATEGORY, category)
intent.putExtra(EXTRA_CATEGORY_NAME, categoryName) intent.putExtra(EXTRA_CATEGORY_NAME, categoryName)
...@@ -135,13 +146,13 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -135,13 +146,13 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
context.startActivity(intent) context.startActivity(intent)
} }
fun start(context: Context, searchWord: String?) { fun startSearch(context: Context, searchWord: String?) {
val intent = Intent(context, ExpertSearchActivity::class.java) val intent = Intent(context, ExpertSearchActivity::class.java)
intent.putExtra(EXTRA_SEARCH_WORD, searchWord) intent.putExtra(EXTRA_SEARCH_WORD, searchWord)
context.startActivity(intent) context.startActivity(intent)
} }
fun start(context: Context, category: Int, showType: Int, isFromSplash: Boolean) { fun start(context: Context, category: String, showType: Int, isFromSplash: Boolean) {
val intent = Intent(context, ExpertSearchActivity::class.java) val intent = Intent(context, ExpertSearchActivity::class.java)
intent.putExtra(EXTRA_CATEGORY, category) intent.putExtra(EXTRA_CATEGORY, category)
intent.putExtra(EXTRA_SHOW_TYPE, showType) intent.putExtra(EXTRA_SHOW_TYPE, showType)
...@@ -168,7 +179,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -168,7 +179,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
private val doctorList = ArrayList<DoctorServiceItem>() private val doctorList = ArrayList<DoctorServiceItem>()
private val serviceList = ArrayList<DoctorServiceItem>() private val serviceList = ArrayList<DoctorServiceItem>()
private var hasMore = true private var hasMore = true
private var initCategory: Int = 0 private var initCategory = "0"
private var initShowType: Int = 1 private var initShowType: Int = 1
private lateinit var doctorAdapter: ExpertSearchAdapter private lateinit var doctorAdapter: ExpertSearchAdapter
private lateinit var onScrollListener: EndlessRecyclerViewScrollListener private lateinit var onScrollListener: EndlessRecyclerViewScrollListener
...@@ -200,7 +211,8 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -200,7 +211,8 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
srlContainer.setProgressViewOffset(false, 0, 200) srlContainer.setProgressViewOffset(false, 0, 200)
srlContainer.setOnRefreshListener(this) srlContainer.setOnRefreshListener(this)
recommendListView.addViewPagerScrollStateListener(object : RecommendListView.ViewPagerScrollStateCallback { recommendListView.addViewPagerScrollStateListener(object :
RecommendListView.ViewPagerScrollStateCallback {
override fun viewPagerScroll(isScrolling: Boolean) { override fun viewPagerScroll(isScrolling: Boolean) {
//如果viewpager正在滚动,则禁止下拉刷新 //如果viewpager正在滚动,则禁止下拉刷新
srlContainer.isEnabled = !isScrolling srlContainer.isEnabled = !isScrolling
...@@ -248,7 +260,11 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -248,7 +260,11 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
} }
} else if (newState == RecyclerView.SCROLL_STATE_IDLE) { } else if (newState == RecyclerView.SCROLL_STATE_IDLE) {
//没有滚动 //没有滚动
ConsultAssistantDialogUtils.INSTANCE.fitRequest(this@ExpertSearchActivity, "doctor_list", true) ConsultAssistantDialogUtils.INSTANCE.fitRequest(
this@ExpertSearchActivity,
"doctor_list",
true
)
if (sIsScrolling) { if (sIsScrolling) {
if (!this@ExpertSearchActivity.isFinishing) { if (!this@ExpertSearchActivity.isFinishing) {
// GlideApp.with(this@ExpertSearchActivity).resumeRequests() // GlideApp.with(this@ExpertSearchActivity).resumeRequests()
...@@ -365,7 +381,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -365,7 +381,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
if (null != intent && intent.hasExtra("routerParam")) { if (null != intent && intent.hasExtra("routerParam")) {
val params = intent.getStringExtra("routerParam") val params = intent.getStringExtra("routerParam")
val paramsJson = JSONObject(params) val paramsJson = JSONObject(params)
initCategory = paramsJson.getString("cateId").toInt() initCategory = paramsJson.getString("cateId")
keyWord = paramsJson.getString("cateTitle") keyWord = paramsJson.getString("cateTitle")
initShowType = paramsJson.getString("showType").toInt() initShowType = paramsJson.getString("showType").toInt()
} }
...@@ -373,7 +389,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -373,7 +389,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
private fun initData(mIntent: Intent) { private fun initData(mIntent: Intent) {
fromPageType = mIntent.getIntExtra(EXTRA_FROM_PAGE, -1) fromPageType = mIntent.getIntExtra(EXTRA_FROM_PAGE, -1)
initCategory = mIntent.getIntExtra(EXTRA_CATEGORY, 0) initCategory = mIntent.getStringExtra(EXTRA_CATEGORY)?:""
initShowType = mIntent.getIntExtra(EXTRA_SHOW_TYPE, 0) initShowType = mIntent.getIntExtra(EXTRA_SHOW_TYPE, 0)
tv_search_content.text = mIntent.getStringExtra(EXTRA_SEARCH_WORD) tv_search_content.text = mIntent.getStringExtra(EXTRA_SEARCH_WORD)
keyWord = mIntent.getStringExtra(EXTRA_CATEGORY_NAME) ?: "" keyWord = mIntent.getStringExtra(EXTRA_CATEGORY_NAME) ?: ""
...@@ -391,7 +407,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -391,7 +407,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
v_loading.visibility = View.VISIBLE v_loading.visibility = View.VISIBLE
v_loading.setViewType(LogoLoadingView.TYPE_LOADING, null) v_loading.setViewType(LogoLoadingView.TYPE_LOADING, null)
doctorAdapter.setEntrance( 1) doctorAdapter.setEntrance(1)
} }
override fun onNewIntent(intent: Intent?) { override fun onNewIntent(intent: Intent?) {
...@@ -426,7 +442,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -426,7 +442,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
override fun onHeadFetched(headData: HeadData?) { override fun onHeadFetched(headData: HeadData?) {
//头部数据获取到后初始化筛选数据 //头部数据获取到后初始化筛选数据
this.headData = headData this.headData = headData
if (initCategory != 0) { if (initCategory != "0") {
if (headData?.cates != null) { if (headData?.cates != null) {
for (cate in headData.cates) { for (cate in headData.cates) {
if (cate.cateId == initCategory) { if (cate.cateId == initCategory) {
...@@ -444,7 +460,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -444,7 +460,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
} }
} }
} }
initCategory = 0 initCategory = "0"
} else { } else {
allFilter.categories.clear() allFilter.categories.clear()
allFilter.categories.add(headData?.cates?.get(0) ?: CateItem()) allFilter.categories.add(headData?.cates?.get(0) ?: CateItem())
...@@ -514,7 +530,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -514,7 +530,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
for (bean in headData?.cates!!) { for (bean in headData?.cates!!) {
if (TextUtils.equals(hotData.id, bean.cateId.toString())) { if (TextUtils.equals(hotData.id, bean.cateId.toString())) {
if (isAdd) { if (isAdd) {
if (allFilter.categories.size == 1 && allFilter.categories[0].cateId == 0) { if (allFilter.categories.size == 1 && allFilter.categories[0].cateId == "0") {
allFilter.categories.clear() allFilter.categories.clear()
} }
allFilter.categories.add(bean) allFilter.categories.add(bean)
...@@ -712,7 +728,11 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -712,7 +728,11 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
bean.key = hotData.id bean.key = hotData.id
bean.value = hotData.value bean.value = hotData.value
for (headBean in headData!!.region) { for (headBean in headData!!.region) {
if (TextUtils.equals(headBean.key!!.substring(0, 2), bean.key!!.substring(0, 2))) { if (TextUtils.equals(
headBean.key!!.substring(0, 2),
bean.key!!.substring(0, 2)
)
) {
allFilter.region = headBean allFilter.region = headBean
break break
} }
...@@ -764,7 +784,11 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -764,7 +784,11 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
} }
//服务列表数据获取到后的回调 //服务列表数据获取到后的回调
override fun onServiceListFetched(data: MutableList<DoctorServiceItem>, page: Int, totalPage: Int) { override fun onServiceListFetched(
data: MutableList<DoctorServiceItem>,
page: Int,
totalPage: Int
) {
LogUtil.d("onServiceListFetched") LogUtil.d("onServiceListFetched")
// if (rvExperts.adapter != serviceAdapter) { // if (rvExperts.adapter != serviceAdapter) {
// rvExperts.adapter = serviceAdapter // rvExperts.adapter = serviceAdapter
...@@ -802,7 +826,11 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -802,7 +826,11 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
} }
//专家列表数据获取到后的回调 //专家列表数据获取到后的回调
override fun onDoctorListFetched(data: MutableList<DoctorServiceItem>, page: Int, totalPage: Int) { override fun onDoctorListFetched(
data: MutableList<DoctorServiceItem>,
page: Int,
totalPage: Int
) {
LogUtil.d("onDoctorListFetched") LogUtil.d("onDoctorListFetched")
if (rvExperts.adapter != doctorAdapter) { if (rvExperts.adapter != doctorAdapter) {
rvExperts.adapter = doctorAdapter rvExperts.adapter = doctorAdapter
...@@ -845,7 +873,10 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -845,7 +873,10 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
isRecommend = false isRecommend = false
if (curPage == 1) { if (curPage == 1) {
v_loading.setViewType(LogoLoadingView.TYPE_NET_LOSS, getString(R.string.consultant_reload_hint)) v_loading.setViewType(
LogoLoadingView.TYPE_NET_LOSS,
getString(R.string.consultant_reload_hint)
)
v_loading.visibility = View.VISIBLE v_loading.visibility = View.VISIBLE
ll_network_error.visibility = View.GONE ll_network_error.visibility = View.GONE
...@@ -876,7 +907,10 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -876,7 +907,10 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
if (msg != null) { if (msg != null) {
ToastUtil.toastShort(msg) ToastUtil.toastShort(msg)
} }
v_loading.setViewType(LogoLoadingView.TYPE_NET_LOSS, getString(R.string.consultant_reload_hint)) v_loading.setViewType(
LogoLoadingView.TYPE_NET_LOSS,
getString(R.string.consultant_reload_hint)
)
v_loading.visibility = View.VISIBLE v_loading.visibility = View.VISIBLE
ll_network_error.visibility = View.GONE ll_network_error.visibility = View.GONE
...@@ -976,6 +1010,9 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -976,6 +1010,9 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
tempFilter.ages.addAll(allFilter.ages) tempFilter.ages.addAll(allFilter.ages)
tempFilter.enquiries.clear() tempFilter.enquiries.clear()
tempFilter.enquiries.addAll(allFilter.enquiries) tempFilter.enquiries.addAll(allFilter.enquiries)
// 擅长人群添加数据
tempFilter.specialityCrowd.clear()
tempFilter.specialityCrowd.addAll(allFilter.specialityCrowd)
tempFilter.others.clear() tempFilter.others.clear()
tempFilter.others.addAll(allFilter.others) tempFilter.others.addAll(allFilter.others)
tempFilter.priceRanges = allFilter.priceRanges tempFilter.priceRanges = allFilter.priceRanges
...@@ -986,7 +1023,10 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -986,7 +1023,10 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
filterPopupWindow.setOnDismissListener { filterPopupWindow.setOnDismissListener {
// viewDim.visibility = View.INVISIBLE // viewDim.visibility = View.INVISIBLE
viewDim_filter.visibility = View.GONE viewDim_filter.visibility = View.GONE
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.title.size > 0 || !TextUtils.isEmpty(allFilter.priceRanges?.minPrice) || !TextUtils.isEmpty(allFilter.priceRanges?.maxPrice)) { if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.title.size > 0 || !TextUtils.isEmpty(
allFilter.priceRanges?.minPrice
) || !TextUtils.isEmpty(allFilter.priceRanges?.maxPrice)
) {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_FILTERED) updateFilterTextViewStatus(tvFilter, FILTER_STATUS_FILTERED)
} else { } else {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL) updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL)
...@@ -1009,8 +1049,15 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -1009,8 +1049,15 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
//筛选确认回调 //筛选确认回调
override fun onFilterConfirmed() { override fun onFilterConfirmed() {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_OPEN) updateFilterTextViewStatus(tvFilter, FILTER_STATUS_OPEN)
LogUtil.d("filter: " + tempFilter.showType.value + "," + tempFilter.enquiries.map { it.value }.joinToString(",") + "," + tempFilter.ages.map { it.value }.joinToString(",") + "," + tempFilter.others.map { it.value }.joinToString(",")) LogUtil.d("filter: " + tempFilter.showType.value + "," + tempFilter.enquiries.map { it.value }
props1.put("filtrate_second", tempFilter.showType.value + "," + tempFilter.enquiries.map { it.value }.joinToString(",") + "," + tempFilter.ages.map { it.value }.joinToString(",") + "," + tempFilter.others.map { it.value }.joinToString(",")) .joinToString(",") + "," + tempFilter.ages.map { it.value }
.joinToString(",") + "," + tempFilter.others.map { it.value }.joinToString(","))
props1.put(
"filtrate_second",
tempFilter.showType.value + "," + tempFilter.enquiries.map { it.value }
.joinToString(",") + "," + tempFilter.ages.map { it.value }
.joinToString(",") + "," + tempFilter.others.map { it.value }.joinToString(",")
)
BuryPointUtils.buryPoint("Filtrate", props1) BuryPointUtils.buryPoint("Filtrate", props1)
...@@ -1019,6 +1066,9 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -1019,6 +1066,9 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
allFilter.enquiries.addAll(tempFilter.enquiries) allFilter.enquiries.addAll(tempFilter.enquiries)
allFilter.ages.clear() allFilter.ages.clear()
allFilter.ages.addAll(tempFilter.ages) allFilter.ages.addAll(tempFilter.ages)
// 擅长人群
allFilter.specialityCrowd.clear()
allFilter.specialityCrowd.addAll(tempFilter.specialityCrowd)
allFilter.others.clear() allFilter.others.clear()
allFilter.others.addAll(tempFilter.others) allFilter.others.addAll(tempFilter.others)
allFilter.title.clear() allFilter.title.clear()
...@@ -1077,7 +1127,11 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -1077,7 +1127,11 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
textview.paint.isFakeBoldText = false textview.paint.isFakeBoldText = false
} }
for (bean in allFilter.others) { for (bean in allFilter.others) {
if (TextUtils.equals(bean.key.toString(), headData!!.highlighter[index].id)) { if (TextUtils.equals(
bean.key.toString(),
headData!!.highlighter[index].id
)
) {
this@ExpertSearchActivity.runOnUiThread { this@ExpertSearchActivity.runOnUiThread {
textview.isSelected = true textview.isSelected = true
textview.paint.isFakeBoldText = true textview.paint.isFakeBoldText = true
...@@ -1094,7 +1148,11 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -1094,7 +1148,11 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
textview.paint.isFakeBoldText = false textview.paint.isFakeBoldText = false
} }
for (bean in allFilter.title) { for (bean in allFilter.title) {
if (TextUtils.equals(bean.key.toString(), headData!!.highlighter[index].id)) { if (TextUtils.equals(
bean.key.toString(),
headData!!.highlighter[index].id
)
) {
this@ExpertSearchActivity.runOnUiThread { this@ExpertSearchActivity.runOnUiThread {
textview.isSelected = true textview.isSelected = true
textview.paint.isFakeBoldText = true textview.paint.isFakeBoldText = true
...@@ -1115,7 +1173,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -1115,7 +1173,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
//筛选标题显示处理 //筛选标题显示处理
private fun filterLabelSet() { private fun filterLabelSet() {
if ((allFilter.others.size + allFilter.ages.size + allFilter.enquiries.size + allFilter.title.size) == 1) { if ((allFilter.others.size + allFilter.ages.size + allFilter.enquiries.size + allFilter.title.size+allFilter.specialityCrowd.size) == 1) {
var text: String? = "" var text: String? = ""
if (allFilter.others.size == 1) { if (allFilter.others.size == 1) {
text = allFilter.others[0].value text = allFilter.others[0].value
...@@ -1125,6 +1183,8 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -1125,6 +1183,8 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
text = allFilter.enquiries[0].value text = allFilter.enquiries[0].value
} else if (allFilter.title.size == 1) { } else if (allFilter.title.size == 1) {
text = allFilter.title[0].value text = allFilter.title[0].value
}else if (allFilter.specialityCrowd.size==1){
text = allFilter.specialityCrowd[0].value
} else { } else {
text = "筛选" text = "筛选"
} }
...@@ -1168,8 +1228,10 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -1168,8 +1228,10 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
//排序选择回调 //排序选择回调
override fun onSortItemSelected(sortItem: ReorderItem) { override fun onSortItemSelected(sortItem: ReorderItem) {
ActionCountUtils.count(ConsultBIConstants.ConsultEvent.APP_CONSULT_LIST_SORT_CLICK, sortItem.value ActionCountUtils.count(
?: "") ConsultBIConstants.ConsultEvent.APP_CONSULT_LIST_SORT_CLICK, sortItem.value
?: ""
)
if (sortItem.value.equals("综合排序")) { if (sortItem.value.equals("综合排序")) {
tvSort.text = "排序" tvSort.text = "排序"
...@@ -1209,8 +1271,10 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -1209,8 +1271,10 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
//显示地区弹窗 //显示地区弹窗
private fun showAreaPopupWindow() { private fun showAreaPopupWindow() {
if (headData?.region != null) { if (headData?.region != null) {
val regionPopupWindow = AreaPopupWindow(this, headData?.region val regionPopupWindow = AreaPopupWindow(
?: ArrayList(), allFilter.region, allFilter.sub) this, headData?.region
?: ArrayList(), allFilter.region, allFilter.sub
)
regionPopupWindow.showAsDropDown(viewSep2) regionPopupWindow.showAsDropDown(viewSep2)
viewDim.visibility = View.VISIBLE viewDim.visibility = View.VISIBLE
updateFilterTextViewStatus(tvArea, FILTER_STATUS_OPEN) updateFilterTextViewStatus(tvArea, FILTER_STATUS_OPEN)
...@@ -1222,69 +1286,73 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -1222,69 +1286,73 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
updateFilterTextViewStatus(tvArea, FILTER_STATUS_NORMAL) updateFilterTextViewStatus(tvArea, FILTER_STATUS_NORMAL)
} }
} }
regionPopupWindow.onRegionSelectedListener = object : AreaPopupWindow.OnRegionSelectedListener { regionPopupWindow.onRegionSelectedListener =
override fun onRegionSelected(region: RegionItem, sub: SubItem) { object : AreaPopupWindow.OnRegionSelectedListener {
updateFilterTextViewStatus(tvArea, FILTER_STATUS_OPEN) override fun onRegionSelected(region: RegionItem, sub: SubItem) {
allFilter.region = region updateFilterTextViewStatus(tvArea, FILTER_STATUS_OPEN)
allFilter.sub = sub allFilter.region = region
if (region.key == null && sub.key == null) { allFilter.sub = sub
if (region.key == null && sub.key == null) {
// LogUtil.d("onRegionSelected: " + region.value) // LogUtil.d("onRegionSelected: " + region.value)
// props1.put("filtrate_second", region.value) // props1.put("filtrate_second", region.value)
// BuryPointUtils.buryPoint("Filtrate", props1) // BuryPointUtils.buryPoint("Filtrate", props1)
tvArea.text = "地区" tvArea.text = "地区"
} else if (region.key != null && sub.key == null) { } else if (region.key != null && sub.key == null) {
// LogUtil.d("onRegionSelected: " + region.value) // LogUtil.d("onRegionSelected: " + region.value)
// props1.put("filtrate_second", region.value) // props1.put("filtrate_second", region.value)
// BuryPointUtils.buryPoint("Filtrate", props1) // BuryPointUtils.buryPoint("Filtrate", props1)
if (region.value?.length ?: 0 > 4) { if (region.value?.length ?: 0 > 4) {
tvArea.text = region.value?.substring(0, 3) + "..." tvArea.text = region.value?.substring(0, 3) + "..."
} else {
tvArea.text = region.value
}
} else { } else {
tvArea.text = region.value
}
} else {
// LogUtil.d("onRegionSelected: " + sub.value) // LogUtil.d("onRegionSelected: " + sub.value)
// props1.put("filtrate_second", sub.value) // props1.put("filtrate_second", sub.value)
// BuryPointUtils.buryPoint("Filtrate", props1) // BuryPointUtils.buryPoint("Filtrate", props1)
if (sub.value?.length ?: 0 > 4) { if (sub.value?.length ?: 0 > 4) {
tvArea.text = sub.value?.substring(0, 3) + "..." tvArea.text = sub.value?.substring(0, 3) + "..."
} else { } else {
tvArea.text = sub.value tvArea.text = sub.value
}
} }
} ActionCountUtils.count(
ActionCountUtils.count(ConsultBIConstants.ConsultEvent.APP_CONSULT_LIST_AREA_CLICK, region.value + "|" + sub.value) ConsultBIConstants.ConsultEvent.APP_CONSULT_LIST_AREA_CLICK,
region.value + "|" + sub.value
//更新热门搜索显示状态 )
if (headData!!.highlighter.size > 0) {
for ((index, hot) in headData!!.highlighter!!.withIndex()) { //更新热门搜索显示状态
if (hot.type == "2" || hot.type == "8") { if (headData!!.highlighter.size > 0) {
var textview = lin_filter2.getChildAt(index) as TextView for ((index, hot) in headData!!.highlighter!!.withIndex()) {
//有选择城市 if (hot.type == "2" || hot.type == "8") {
if (!TextUtils.isEmpty(sub.key)) { var textview = lin_filter2.getChildAt(index) as TextView
if (TextUtils.equals(sub.key, hot.id)) { //有选择城市
textview.isSelected = true if (!TextUtils.isEmpty(sub.key)) {
textview.paint.isFakeBoldText = true if (TextUtils.equals(sub.key, hot.id)) {
hasSelectedArea = true textview.isSelected = true
} else { textview.paint.isFakeBoldText = true
textview.isSelected = false hasSelectedArea = true
textview.paint.isFakeBoldText = false } else {
} textview.isSelected = false
} else { textview.paint.isFakeBoldText = false
if (TextUtils.equals(region.key, hot.id)) { }
textview.isSelected = true
textview.paint.isFakeBoldText = true
hasSelectedArea = true
} else { } else {
textview.isSelected = false if (TextUtils.equals(region.key, hot.id)) {
textview.paint.isFakeBoldText = false textview.isSelected = true
textview.paint.isFakeBoldText = true
hasSelectedArea = true
} else {
textview.isSelected = false
textview.paint.isFakeBoldText = false
}
} }
} }
} }
} }
regionPopupWindow.dismiss()
refresh()
} }
regionPopupWindow.dismiss()
refresh()
} }
}
} else { } else {
ToastUtil.toastShort("数据初始化失败,请重试") ToastUtil.toastShort("数据初始化失败,请重试")
getPresenter().fetchListHead() getPresenter().fetchListHead()
...@@ -1324,7 +1392,10 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -1324,7 +1392,10 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
* 新增逻辑:当主题选择后,需要判断热门筛选中是否也有该主题,如果有,也需要同步更新选中状态 * 新增逻辑:当主题选择后,需要判断热门筛选中是否也有该主题,如果有,也需要同步更新选中状态
*/ */
override fun onCategoriesSelected(categories: ArrayList<CateItem>) { override fun onCategoriesSelected(categories: ArrayList<CateItem>) {
ActionCountUtils.count(ConsultBIConstants.ConsultEvent.APP_CONSULT_LIST_THEME_CLICK, categories.map { it.cateName }.joinToString("|")) ActionCountUtils.count(
ConsultBIConstants.ConsultEvent.APP_CONSULT_LIST_THEME_CLICK,
categories.map { it.cateName }.joinToString("|")
)
if (categories.size == 1 && "全部" != categories[0].cateName) { if (categories.size == 1 && "全部" != categories[0].cateName) {
//显示选中标题 //显示选中标题
tvSubject.text = categories[0].cateName tvSubject.text = categories[0].cateName
...@@ -1343,7 +1414,11 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -1343,7 +1414,11 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
textview.paint.isFakeBoldText = false textview.paint.isFakeBoldText = false
} }
for (bean in categories) { for (bean in categories) {
if (TextUtils.equals(bean.cateName, headData!!.highlighter[index].value)) { if (TextUtils.equals(
bean.cateName,
headData!!.highlighter[index].value
)
) {
this@ExpertSearchActivity.runOnUiThread { this@ExpertSearchActivity.runOnUiThread {
textview.isSelected = true textview.isSelected = true
textview.paint.isFakeBoldText = true textview.paint.isFakeBoldText = true
...@@ -1400,7 +1475,10 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -1400,7 +1475,10 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
// return // return
// } // }
ActionCountUtils.count(ConsultBIConstants.UserMainEvent.YDL_USER_SEARCH_CLICK, keyWord ?: "") ActionCountUtils.count(
ConsultBIConstants.UserMainEvent.YDL_USER_SEARCH_CLICK,
keyWord ?: ""
)
isDoSearch = true isDoSearch = true
resetFilter() resetFilter()
refresh() refresh()
...@@ -1436,12 +1514,22 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -1436,12 +1514,22 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
FILTER_STATUS_NORMAL -> { FILTER_STATUS_NORMAL -> {
tv.typeface = Typeface.defaultFromStyle(Typeface.NORMAL) tv.typeface = Typeface.defaultFromStyle(Typeface.NORMAL)
tv.setTextColor(ContextCompat.getColor(this, R.color.platform_colorTextDefault)) tv.setTextColor(ContextCompat.getColor(this, R.color.platform_colorTextDefault))
tv.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.platform_ic_arrow_drop_down_grey_500_18dp, 0) tv.setCompoundDrawablesWithIntrinsicBounds(
0,
0,
R.drawable.platform_ic_arrow_drop_down_grey_500_18dp,
0
)
} }
FILTER_STATUS_FILTERED -> { FILTER_STATUS_FILTERED -> {
tv.typeface = Typeface.DEFAULT_BOLD tv.typeface = Typeface.DEFAULT_BOLD
tv.setTextColor(ContextCompat.getColor(this, R.color.platform_main_theme)) tv.setTextColor(ContextCompat.getColor(this, R.color.platform_main_theme))
tv.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.platform_ic_arrow_drop_down_grey_500_18dp, 0) tv.setCompoundDrawablesWithIntrinsicBounds(
0,
0,
R.drawable.platform_ic_arrow_drop_down_grey_500_18dp,
0
)
} }
FILTER_STATUS_OPEN -> { FILTER_STATUS_OPEN -> {
tv.typeface = Typeface.DEFAULT_BOLD tv.typeface = Typeface.DEFAULT_BOLD
......
...@@ -48,7 +48,6 @@ import com.yidianling.consultant.listener.OnFilterConfirmListener ...@@ -48,7 +48,6 @@ import com.yidianling.consultant.listener.OnFilterConfirmListener
import com.yidianling.consultant.listener.OnSortItemSelectedListener import com.yidianling.consultant.listener.OnSortItemSelectedListener
import com.yidianling.consultant.model.bean.* import com.yidianling.consultant.model.bean.*
import com.yidianling.consultant.modular.singlton.ConsultAssistantDialogUtils import com.yidianling.consultant.modular.singlton.ConsultAssistantDialogUtils
import com.yidianling.consultant.modular.singlton.ConsultAssistantDialogUtils.Companion.REALATION_EDUCATION
import com.yidianling.consultant.router.ConsultantIn import com.yidianling.consultant.router.ConsultantIn
import com.yidianling.consultant.ui.view.AreaPopupWindow import com.yidianling.consultant.ui.view.AreaPopupWindow
import com.yidianling.consultant.ui.view.CategoryPopupWindow import com.yidianling.consultant.ui.view.CategoryPopupWindow
...@@ -70,8 +69,8 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -70,8 +69,8 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
View.OnClickListener, IExpertSearchView, View.OnClickListener, IExpertSearchView,
OnCategoriesSelectedListener, OnSortItemSelectedListener, OnFilterConfirmListener, OnCategoriesSelectedListener, OnSortItemSelectedListener, OnFilterConfirmListener,
SwipeRefreshLayout.OnRefreshListener { SwipeRefreshLayout.OnRefreshListener {
private lateinit var mContext:Context private lateinit var mContext: Context
private lateinit var mActivity:FragmentActivity private lateinit var mActivity: FragmentActivity
override fun layoutResId(): Int { override fun layoutResId(): Int {
return R.layout.consultant_activity_expert_search_list return R.layout.consultant_activity_expert_search_list
...@@ -154,7 +153,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -154,7 +153,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
private val doctorList = ArrayList<DoctorServiceItem>() private val doctorList = ArrayList<DoctorServiceItem>()
private val serviceList = ArrayList<DoctorServiceItem>() private val serviceList = ArrayList<DoctorServiceItem>()
private var hasMore = true private var hasMore = true
private var initCategory: Int = 0 private var initCategory = "0"
private var initShowType: Int = 0 private var initShowType: Int = 0
private lateinit var doctorAdapter: ExpertSearchAdapter private lateinit var doctorAdapter: ExpertSearchAdapter
private lateinit var onScrollListener: EndlessRecyclerViewScrollListener private lateinit var onScrollListener: EndlessRecyclerViewScrollListener
...@@ -181,7 +180,12 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -181,7 +180,12 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
btn_call.setOnClickListener(this) btn_call.setOnClickListener(this)
tv_guide.setOnClickListener(this) tv_guide.setOnClickListener(this)
rl_search.setOnClickListener(this) rl_search.setOnClickListener(this)
srlContainer.setColorSchemeColors(ContextCompat.getColor(mActivity, R.color.platform_main_theme)) srlContainer.setColorSchemeColors(
ContextCompat.getColor(
mActivity,
R.color.platform_main_theme
)
)
srlContainer.setProgressViewOffset(false, 0, 200) srlContainer.setProgressViewOffset(false, 0, 200)
srlContainer.setOnRefreshListener(this) srlContainer.setOnRefreshListener(this)
initNetLossView() initNetLossView()
...@@ -395,7 +399,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -395,7 +399,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
override fun onHeadFetched(headData: HeadData?) { override fun onHeadFetched(headData: HeadData?) {
//头部数据获取到后初始化筛选数据 //头部数据获取到后初始化筛选数据
this.headData = headData this.headData = headData
if (initCategory != 0) { if (initCategory != "0") {
if (headData?.cates != null) { if (headData?.cates != null) {
for (cate in headData.cates) { for (cate in headData.cates) {
if (cate.cateId == initCategory) { if (cate.cateId == initCategory) {
...@@ -413,7 +417,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -413,7 +417,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
} }
} }
} }
initCategory = 0 initCategory = "0"
} else { } else {
allFilter.categories.clear() allFilter.categories.clear()
allFilter.categories.add(headData?.cates?.get(0) ?: CateItem()) allFilter.categories.add(headData?.cates?.get(0) ?: CateItem())
...@@ -483,7 +487,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -483,7 +487,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
for (bean in headData?.cates!!) { for (bean in headData?.cates!!) {
if (TextUtils.equals(hotData.id, bean.cateId.toString())) { if (TextUtils.equals(hotData.id, bean.cateId.toString())) {
if (isAdd) { if (isAdd) {
if (allFilter.categories.size == 1 && allFilter.categories[0].cateId == 0) { if (allFilter.categories.size == 1 && allFilter.categories[0].cateId == "0") {
allFilter.categories.clear() allFilter.categories.clear()
} }
allFilter.categories.add(bean) allFilter.categories.add(bean)
...@@ -595,7 +599,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -595,7 +599,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
} }
} }
} }
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.title.size > 0) { if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.title.size+allFilter.specialityCrowd.size > 0) {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_FILTERED) updateFilterTextViewStatus(tvFilter, FILTER_STATUS_FILTERED)
} else { } else {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL) updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL)
...@@ -615,7 +619,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -615,7 +619,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
} }
} }
} }
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.title.size > 0) { if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.title.size+allFilter.specialityCrowd.size > 0) {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_FILTERED) updateFilterTextViewStatus(tvFilter, FILTER_STATUS_FILTERED)
} else { } else {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL) updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL)
...@@ -635,7 +639,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -635,7 +639,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
} }
} }
} }
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.title.size > 0) { if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.title.size+allFilter.specialityCrowd.size > 0) {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_FILTERED) updateFilterTextViewStatus(tvFilter, FILTER_STATUS_FILTERED)
} else { } else {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL) updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL)
...@@ -655,7 +659,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -655,7 +659,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
} }
} }
} }
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.title.size > 0) { if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.title.size+allFilter.specialityCrowd.size > 0) {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_FILTERED) updateFilterTextViewStatus(tvFilter, FILTER_STATUS_FILTERED)
} else { } else {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL) updateFilterTextViewStatus(tvFilter, FILTER_STATUS_NORMAL)
...@@ -958,6 +962,9 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -958,6 +962,9 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
tempFilter.ages.addAll(allFilter.ages) tempFilter.ages.addAll(allFilter.ages)
tempFilter.enquiries.clear() tempFilter.enquiries.clear()
tempFilter.enquiries.addAll(allFilter.enquiries) tempFilter.enquiries.addAll(allFilter.enquiries)
// 擅长人群添加数据
tempFilter.specialityCrowd.clear()
tempFilter.specialityCrowd.addAll(allFilter.specialityCrowd)
tempFilter.others.clear() tempFilter.others.clear()
tempFilter.others.addAll(allFilter.others) tempFilter.others.addAll(allFilter.others)
tempFilter.priceRanges = allFilter.priceRanges tempFilter.priceRanges = allFilter.priceRanges
...@@ -966,9 +973,9 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -966,9 +973,9 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
if (headData?.filters != null) { if (headData?.filters != null) {
val filterPopupWindow = FilterPopupWindow(mContext, headData?.filters!!, tempFilter) val filterPopupWindow = FilterPopupWindow(mContext, headData?.filters!!, tempFilter)
filterPopupWindow.setOnDismissListener { filterPopupWindow.setOnDismissListener {
// viewDim.visibility = View.INVISIBLE viewDim.visibility = View.INVISIBLE
viewDim_filter.visibility = View.GONE viewDim_filter.visibility = View.GONE
if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.title.size > 0 || !TextUtils.isEmpty( if (allFilter.others.size + allFilter.enquiries.size + allFilter.ages.size + allFilter.title.size+allFilter.specialityCrowd.size > 0 || !TextUtils.isEmpty(
allFilter.priceRanges?.minPrice allFilter.priceRanges?.minPrice
) || !TextUtils.isEmpty(allFilter.priceRanges?.maxPrice) ) || !TextUtils.isEmpty(allFilter.priceRanges?.maxPrice)
) { ) {
...@@ -979,12 +986,11 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -979,12 +986,11 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
showConsultAssistantDialog() showConsultAssistantDialog()
} }
filterPopupWindow.isClippingEnabled = false filterPopupWindow.isClippingEnabled = false
filterPopupWindow.showAtLocation(viewSep2.rootView, Gravity.TOP + Gravity.RIGHT, 0, 0) filterPopupWindow.showAsDropDown(viewSep2)
hideConsultAssistantDialog() hideConsultAssistantDialog()
filterPopupWindow.onFilterConfirmListener = this filterPopupWindow.onFilterConfirmListener = this
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_OPEN) updateFilterTextViewStatus(tvFilter, FILTER_STATUS_OPEN)
// viewDim.visibility = View.VISIBLE viewDim.visibility = View.VISIBLE
viewDim_filter.visibility = View.VISIBLE
} else { } else {
ToastUtil.toastShort("数据初始化失败,请重试") ToastUtil.toastShort("数据初始化失败,请重试")
getPresenter().fetchListHead() getPresenter().fetchListHead()
...@@ -995,15 +1001,18 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -995,15 +1001,18 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
override fun onFilterConfirmed() { override fun onFilterConfirmed() {
updateFilterTextViewStatus(tvFilter, FILTER_STATUS_OPEN) updateFilterTextViewStatus(tvFilter, FILTER_STATUS_OPEN)
LogUtil.d( LogUtil.d(
"filter: " + tempFilter.showType.value + "," + tempFilter.enquiries.map { it.value }.joinToString( "filter: " + tempFilter.showType.value + "," + tempFilter.enquiries.map { it.value }
"," .joinToString(
) + "," + tempFilter.ages.map { it.value }.joinToString(",") + "," + tempFilter.others.map { it.value }.joinToString( ","
) + "," + tempFilter.ages.map { it.value }
.joinToString(",") + "," + tempFilter.others.map { it.value }.joinToString(
"," ","
) )
) )
props1.put( props1.put(
"filtrate_second", "filtrate_second",
tempFilter.showType.value + "," + tempFilter.enquiries.map { it.value }.joinToString(",") + "," + tempFilter.ages.map { it.value }.joinToString( tempFilter.showType.value + "," + tempFilter.enquiries.map { it.value }
.joinToString(",") + "," + tempFilter.ages.map { it.value }.joinToString(
"," ","
) + "," + tempFilter.others.map { it.value }.joinToString(",") ) + "," + tempFilter.others.map { it.value }.joinToString(",")
) )
...@@ -1015,6 +1024,10 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -1015,6 +1024,10 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
allFilter.enquiries.addAll(tempFilter.enquiries) allFilter.enquiries.addAll(tempFilter.enquiries)
allFilter.ages.clear() allFilter.ages.clear()
allFilter.ages.addAll(tempFilter.ages) allFilter.ages.addAll(tempFilter.ages)
// 擅长人群
allFilter.specialityCrowd.clear()
allFilter.specialityCrowd.addAll(tempFilter.specialityCrowd)
// 其它
allFilter.others.clear() allFilter.others.clear()
allFilter.others.addAll(tempFilter.others) allFilter.others.addAll(tempFilter.others)
allFilter.title.clear() allFilter.title.clear()
...@@ -1119,18 +1132,27 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -1119,18 +1132,27 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
//筛选标题显示处理 //筛选标题显示处理
private fun filterLabelSet() { private fun filterLabelSet() {
if ((allFilter.others.size + allFilter.ages.size + allFilter.enquiries.size + allFilter.title.size) == 1) { if ((allFilter.others.size + allFilter.ages.size + allFilter.enquiries.size + allFilter.title.size+allFilter.specialityCrowd.size) == 1) {
var text: String? = "" var text: String? = ""
if (allFilter.others.size == 1) { when {
text = allFilter.others[0].value allFilter.others.size == 1 -> {
} else if (allFilter.ages.size == 1) { text = allFilter.others[0].value
text = allFilter.ages[0].value }
} else if (allFilter.enquiries.size == 1) { allFilter.ages.size == 1 -> {
text = allFilter.enquiries[0].value text = allFilter.ages[0].value
} else if (allFilter.title.size == 1) { }
text = allFilter.title[0].value allFilter.enquiries.size == 1 -> {
} else { text = allFilter.enquiries[0].value
text = "筛选" }
allFilter.title.size == 1 -> {
text = allFilter.title[0].value
}
allFilter.specialityCrowd.size==1 -> {
text = allFilter.specialityCrowd[0].value
}
else -> {
text = "筛选"
}
} }
if (text?.length ?: 0 > 4) { if (text?.length ?: 0 > 4) {
tvFilter.text = text?.substring(0, 3) + "..." tvFilter.text = text?.substring(0, 3) + "..."
...@@ -1350,7 +1372,6 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -1350,7 +1372,6 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
//如果是亲自教育类别----->点击咨询顾问---会跳转到一个只是亲自教育的导医队列中 //如果是亲自教育类别----->点击咨询顾问---会跳转到一个只是亲自教育的导医队列中
//判断主题选中,判断热门筛选中是否也有该主题 //判断主题选中,判断热门筛选中是否也有该主题
Executors.newCachedThreadPool().execute { Executors.newCachedThreadPool().execute {
if (headData!!.highlighter.size > 0) { if (headData!!.highlighter.size > 0) {
...@@ -1483,7 +1504,12 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -1483,7 +1504,12 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
FILTER_STATUS_OPEN -> { FILTER_STATUS_OPEN -> {
tv.typeface = Typeface.DEFAULT_BOLD tv.typeface = Typeface.DEFAULT_BOLD
tv.setTextColor(ContextCompat.getColor(mContext, R.color.platform_colorTextDefault)) tv.setTextColor(ContextCompat.getColor(mContext, R.color.platform_colorTextDefault))
tv.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.platform_arrow_drop_down_en, 0) tv.setCompoundDrawablesWithIntrinsicBounds(
0,
0,
R.drawable.platform_arrow_drop_down_en,
0
)
} }
} }
} }
......
...@@ -11,7 +11,6 @@ import com.ydl.ydlcommon.utils.RxLifecycleUtils ...@@ -11,7 +11,6 @@ import com.ydl.ydlcommon.utils.RxLifecycleUtils
import com.ydl.ydlcommon.utils.YDLAsyncUtils import com.ydl.ydlcommon.utils.YDLAsyncUtils
import com.ydl.ydlcommon.utils.YDLCacheUtils import com.ydl.ydlcommon.utils.YDLCacheUtils
import com.ydl.ydlcommon.utils.remind.HttpErrorUtils import com.ydl.ydlcommon.utils.remind.HttpErrorUtils
import com.yidianling.common.tools.LogUtil
import com.yidianling.consultant.http.ExpertSearchDataManager import com.yidianling.consultant.http.ExpertSearchDataManager
import com.yidianling.consultant.model.SearchApi import com.yidianling.consultant.model.SearchApi
import com.yidianling.consultant.model.bean.AllFilter import com.yidianling.consultant.model.bean.AllFilter
...@@ -29,8 +28,8 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() { ...@@ -29,8 +28,8 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
fun fetchListHead() { fun fetchListHead() {
SearchApi.getSearchApi() SearchApi.getSearchApi()
.searchConditions() .searchConditions(2)
.compose(RxLifecycleUtils.bindToLifecycle(mView!!))//使用 Rxlifecycle,使 Disposable 和 Activity 一起销毁 .compose(RxLifecycleUtils.bindToLifecycle(mView))//使用 Rxlifecycle,使 Disposable 和 Activity 一起销毁
.compose(RxUtils.resultJavaData()) .compose(RxUtils.resultJavaData())
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
...@@ -106,7 +105,7 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() { ...@@ -106,7 +105,7 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
fun fetchListData(allFilter: AllFilter, page: Int) { fun fetchListData(allFilter: AllFilter, page: Int) {
//是否亲子教育字段 //是否亲子教育字段
ConsultAssistantDialogUtils.REALATION_EDUCATION = allFilter.categories.size==1&&allFilter.categories[0].cateId==23 ConsultAssistantDialogUtils.REALATION_EDUCATION = allFilter.categories.size==1&&allFilter.categories[0].cateId=="23"
var showType = 0 var showType = 0
val sb = StringBuffer() val sb = StringBuffer()
...@@ -116,7 +115,7 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() { ...@@ -116,7 +115,7 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
if ("0" == categorys) { if ("0" == categorys) {
categorys = "" categorys = ""
} }
sb.append("&categories=").append(categorys) sb.append("&directionTags=").append(categorys)
} }
if (allFilter.sub.key != null) { if (allFilter.sub.key != null) {
sb.append("&city=").append(Integer.parseInt(allFilter.sub.key)) sb.append("&city=").append(Integer.parseInt(allFilter.sub.key))
...@@ -133,6 +132,10 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() { ...@@ -133,6 +132,10 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
if (allFilter.ages.isNotEmpty()) { if (allFilter.ages.isNotEmpty()) {
sb.append("&ages=").append(allFilter.ages.map { it.key }.joinToString(",")) sb.append("&ages=").append(allFilter.ages.map { it.key }.joinToString(","))
} }
// 擅长人群拼接
if (allFilter.specialityCrowd.isNotEmpty()){
sb.append("&crowdsTags=").append(allFilter.specialityCrowd.map { it.key }.joinToString(","))
}
if (allFilter.others.isNotEmpty()) { if (allFilter.others.isNotEmpty()) {
sb.append("&others=").append(allFilter.others.map { it.key }.joinToString(",")) sb.append("&others=").append(allFilter.others.map { it.key }.joinToString(","))
} }
...@@ -149,18 +152,18 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() { ...@@ -149,18 +152,18 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
} }
sb.append("&page=").append(page) sb.append("&page=").append(page)
ExpertSearchDataManager.getHttp().searchDoctor(sb.toString()) ExpertSearchDataManager.getHttp().searchDoctor(sb.toString())
.compose(RxLifecycleUtils.bindToLifecycle(mView!!)) .compose(RxLifecycleUtils.bindToLifecycle(mView))
.compose(RxUtils.resultJavaData()) .compose(RxUtils.resultJavaData())
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer { .subscribe(Consumer {
if (null != it.list && !it.list!!.isEmpty()) { if (null != it.list && it.list.isNotEmpty()) {
// if (showType == 0) { // if (showType == 0) {
// mView.onDoctorListFetched(it.list!!, page, it.pages) // mView.onDoctorListFetched(it.list!!, page, it.pages)
// } else { // } else {
// mView.onServiceListFetched(it.list!!, page, it.pages) // mView.onServiceListFetched(it.list!!, page, it.pages)
// } // }
mView.onDoctorListFetched(it.list!!, page, it.pages) mView.onDoctorListFetched(it.list, page, it.pages)
//更新缓存 只更新第一页的缓存 //更新缓存 只更新第一页的缓存
if (page == 1){ if (page == 1){
updateCache(showType,it) updateCache(showType,it)
......
...@@ -331,7 +331,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon ...@@ -331,7 +331,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
} }
ExpertSearchActivity.start(this, keyWord) ExpertSearchActivity.startSearch(this, keyWord)
this.finish() this.finish()
} }
......
...@@ -449,6 +449,7 @@ class ExpertSearchAdapter( ...@@ -449,6 +449,7 @@ class ExpertSearchAdapter(
if (!TextUtils.isEmpty(doctor.uid)) { if (!TextUtils.isEmpty(doctor.uid)) {
//跳转私聊 //跳转私聊
ConsultantIn.startP2PSession(context as AppCompatActivity, doctor.uid!!) ConsultantIn.startP2PSession(context as AppCompatActivity, doctor.uid!!)
ActionCountUtils.count(ConsultBIConstants.UserMainEvent.YDL_PRIVATE_CHAT_CLICK)
} else { } else {
ToastHelper.show("请联系客服,专家参数错误!") ToastHelper.show("请联系客服,专家参数错误!")
} }
......
...@@ -13,6 +13,7 @@ class ConsultBIConstants { ...@@ -13,6 +13,7 @@ class ConsultBIConstants {
const val POSITION_AVERAGE_SERVICE_INPUT = "average_service_input" //服务均价 const val POSITION_AVERAGE_SERVICE_INPUT = "average_service_input" //服务均价
const val POSITION_AGE_CHOICE_CLICK = "age_choice_click" //年龄选择 const val POSITION_AGE_CHOICE_CLICK = "age_choice_click" //年龄选择
const val POSITION_QUALIFICATION_CHOICE_CLICK = "qualification_choice_click" //资质选择 const val POSITION_QUALIFICATION_CHOICE_CLICK = "qualification_choice_click" //资质选择
const val POSITION_GOOD_AT_CLICK = "good_at_click" // 擅长人群
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位咨询师
...@@ -53,7 +54,8 @@ class ConsultBIConstants { ...@@ -53,7 +54,8 @@ class ConsultBIConstants {
private const val YDL_USER_MAIN_PAGE: String = "ydl_user_main_page|"//壹点灵用户版首页 partId private const val YDL_USER_MAIN_PAGE: String = "ydl_user_main_page|"//壹点灵用户版首页 partId
const val YDL_USER_SEARCH_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_search_click"//搜索栏 const val YDL_USER_SEARCH_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_search_click" //搜索栏
const val YDL_PRIVATE_CHAT_CLICK: String = YDL_USER_MAIN_PAGE + "private_chat_click" // 点击私聊按钮
} }
} }
......
...@@ -40,7 +40,7 @@ interface SearchApi { ...@@ -40,7 +40,7 @@ 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(@Query("cateSource") cateSource: Int): Observable<BaseAPIResponse<HeadData>>
//专家服务搜索 //专家服务搜索
@retrofit2.http.Headers("Content-Type:application/json") @retrofit2.http.Headers("Content-Type:application/json")
......
...@@ -21,5 +21,6 @@ data class AllFilter( ...@@ -21,5 +21,6 @@ data class AllFilter(
val ages: ArrayList<AgeItem> = ArrayList(), //年龄 val ages: ArrayList<AgeItem> = ArrayList(), //年龄
val others: ArrayList<OtherItem> = ArrayList(),//其他筛选 val others: ArrayList<OtherItem> = ArrayList(),//其他筛选
val title:ArrayList<ReorderItem> = ArrayList()//资质 val title:ArrayList<ReorderItem> = ArrayList(), //资质
val specialityCrowd:ArrayList<SpecialityCrowdBean> = ArrayList() // 擅长人群
) )
\ No newline at end of file
...@@ -6,29 +6,34 @@ import com.google.gson.annotations.SerializedName ...@@ -6,29 +6,34 @@ import com.google.gson.annotations.SerializedName
data class CateItem( data class CateItem(
@field:SerializedName("cate_name") @field:SerializedName("cate_name")
var cateName: String? = null, var cateName: String? = null,
@field:SerializedName("cate_id") @field:SerializedName("cate_id")
var cateId: Int? = null var cateId: String? = null
) : Parcelable { ) : Parcelable {
constructor(source: Parcel) : this( constructor(parcel: Parcel) : this(
source.readString(), parcel.readString(),
source.readValue(Int::class.java.classLoader) as Int? parcel.readString()
) ) {
}
override fun describeContents() = 0 override fun writeToParcel(parcel: Parcel, flags: Int) {
parcel.writeString(cateName)
parcel.writeString(cateId)
}
override fun writeToParcel(dest: Parcel, flags: Int) = with(dest) { override fun describeContents(): Int {
writeString(cateName) return 0
writeValue(cateId)
} }
companion object { companion object CREATOR : Parcelable.Creator<CateItem> {
@JvmField override fun createFromParcel(parcel: Parcel): CateItem {
val CREATOR: Parcelable.Creator<CateItem> = object : Parcelable.Creator<CateItem> { return CateItem(parcel)
override fun createFromParcel(source: Parcel): CateItem = CateItem(source) }
override fun newArray(size: Int): Array<CateItem?> = arrayOfNulls(size)
override fun newArray(size: Int): Array<CateItem?> {
return arrayOfNulls(size)
} }
} }
} }
\ No newline at end of file
...@@ -4,9 +4,12 @@ import com.google.gson.annotations.SerializedName ...@@ -4,9 +4,12 @@ import com.google.gson.annotations.SerializedName
data class EnquiryItem( data class EnquiryItem(
@field:SerializedName("value") @field:SerializedName("value")
val value: String? = null, val value: String? = null,
@field:SerializedName("key") @field:SerializedName("key")
val key: Int? = null val key: Int? = null,
val checkRrl: String?,
val unCheckUrl: String?
) )
\ No newline at end of file
...@@ -3,39 +3,52 @@ package com.yidianling.consultant.model.bean ...@@ -3,39 +3,52 @@ package com.yidianling.consultant.model.bean
import com.google.gson.annotations.SerializedName import com.google.gson.annotations.SerializedName
data class Filters( data class Filters(
/** /**
* 按服务或者按专家 * 按服务或者按专家
*/ */
@field:SerializedName("show_type") @field:SerializedName("show_type")
val showType: List<ShowTypeItem> = ArrayList(), val showType: List<ShowTypeItem> = ArrayList(),
/** /**
* 其他选择 * 其他选择
*/ */
@field:SerializedName("other") @field:SerializedName("other")
val other: List<OtherItem> = ArrayList(), val other: List<OtherItem> = ArrayList(),
/** /**
* 咨询方式 * 咨询方式
*/ */
@field:SerializedName("enquiry") @field:SerializedName("enquiry")
val enquiry: List<EnquiryItem> = ArrayList(), val enquiry: List<EnquiryItem> = ArrayList(),
/** /**
* 服务均价 * 服务均价
*/ */
@field:SerializedName("priceRanges") @field:SerializedName("priceRanges")
val priceRanges: List<PriceRangesItem> = ArrayList(), val priceRanges: List<PriceRangesItem> = ArrayList(),
/** /**
* 年龄选择 * 年龄选择
*/ */
@field:SerializedName("age") @field:SerializedName("age")
val age: List<AgeItem> = ArrayList(), val age: List<AgeItem> = ArrayList(),
/** /**
* 资质选择 * 资质选择
*/ */
@field:SerializedName("title") @field:SerializedName("title")
val title: List<ReorderItem> = ArrayList() //资质 val title: List<ReorderItem> = ArrayList(),
// /**
// * 擅长人群
// */
// @field:SerializedName("crowdsTags")
// val crowdsTags: List<AgeItem> = ArrayList()
/**
* 擅长人群
*/
@field:SerializedName("specialityCrowd")
val specialityCrowd: ArrayList<SpecialityCrowdBean> = ArrayList()
) )
\ No newline at end of file
...@@ -4,33 +4,33 @@ import com.google.gson.annotations.SerializedName ...@@ -4,33 +4,33 @@ import com.google.gson.annotations.SerializedName
data class HeadData( data class HeadData(
/** /**
* 主题 * 主题
*/ */
@field:SerializedName("cates") @field:SerializedName("cates")
val cates: ArrayList<CateItem> = ArrayList(), val cates: ArrayList<CateItem> = ArrayList(),
/** /**
* 排序 * 排序
*/ */
@field:SerializedName("reorder") @field:SerializedName("reorder")
val reorder: ArrayList<ReorderItem> = ArrayList(), val reorder: ArrayList<ReorderItem> = ArrayList(),
/** /**
* 筛选 * 筛选
*/ */
@field:SerializedName("filters") @field:SerializedName("filters")
val filters: Filters = Filters(), val filters: Filters = Filters(),
/** /**
* 热门 * 热门
*/ */
@field:SerializedName("highlighter") @field:SerializedName("highlighter")
val highlighter: ArrayList<HighlighterItem> = ArrayList(), val highlighter: ArrayList<HighlighterItem> = ArrayList(),
/** /**
* 地区 * 地区
*/ */
@field:SerializedName("region") @field:SerializedName("region")
val region: ArrayList<RegionItem> = ArrayList() val region: ArrayList<RegionItem> = ArrayList()
) )
\ No newline at end of file
package com.yidianling.consultant.model.bean
import com.google.gson.annotations.SerializedName
data class SpecialityCrowdBean(
@field:SerializedName("value")
var value: String? = null,
@field:SerializedName("key")
var key: String? = null
)
\ No newline at end of file
...@@ -36,7 +36,7 @@ class ConsultantServiceImp : IConsultantService { ...@@ -36,7 +36,7 @@ class ConsultantServiceImp : IConsultantService {
override fun expertSearchIntent( override fun expertSearchIntent(
activity: Activity, activity: Activity,
category: Int, category: String,
showType: Int, showType: Int,
isInitShowHot: Boolean isInitShowHot: Boolean
): Intent { ): Intent {
...@@ -72,14 +72,14 @@ class ConsultantServiceImp : IConsultantService { ...@@ -72,14 +72,14 @@ class ConsultantServiceImp : IConsultantService {
override fun startExpertSearchActivity( override fun startExpertSearchActivity(
mContext: Context, mContext: Context,
category: Int, category: String,
categoryName: String, categoryName: String,
showType: Int showType: Int
) { ) {
ExpertSearchActivity.start(mContext, category, categoryName, showType) ExpertSearchActivity.start(mContext, category, categoryName, showType)
} }
override fun startExpertSearchActivity(mContext: Context, category: Int) { override fun startExpertSearchActivity(mContext: Context, category: String) {
ExpertSearchActivity.start(mContext, category) ExpertSearchActivity.start(mContext, category)
} }
......
...@@ -9,13 +9,11 @@ import androidx.core.content.ContextCompat ...@@ -9,13 +9,11 @@ import androidx.core.content.ContextCompat
import android.text.* import android.text.*
import android.text.style.AbsoluteSizeSpan import android.text.style.AbsoluteSizeSpan
import android.util.Log import android.util.Log
import android.view.Gravity import android.view.*
import android.view.KeyEvent
import android.view.LayoutInflater
import android.view.View
import android.view.inputmethod.EditorInfo import android.view.inputmethod.EditorInfo
import android.view.inputmethod.InputMethodManager import android.view.inputmethod.InputMethodManager
import android.widget.* import android.widget.*
import com.bumptech.glide.Glide
import com.ydl.ydlcommon.data.http.RxUtils import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.remind.ToastHelper import com.ydl.ydlcommon.utils.remind.ToastHelper
...@@ -42,8 +40,11 @@ import kotlinx.android.synthetic.main.consultant_ui_filter_popup.view.* ...@@ -42,8 +40,11 @@ import kotlinx.android.synthetic.main.consultant_ui_filter_popup.view.*
* 筛选弹窗 * 筛选弹窗
* Created by zqk on 17-9-15. * Created by zqk on 17-9-15.
*/ */
class FilterPopupWindow(private val context: Context, private val filterData: Filters, private val tempFilter: AllFilter) class FilterPopupWindow(
: PopupWindow(context) { private val context: Context,
private val filterData: Filters,
private val tempFilter: AllFilter
) : PopupWindow(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) {
private val mDisposableList = CompositeDisposable() private val mDisposableList = CompositeDisposable()
...@@ -53,15 +54,18 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi ...@@ -53,15 +54,18 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
private val ageViews: ArrayList<View> = ArrayList() private val ageViews: ArrayList<View> = ArrayList()
private val otherViews: ArrayList<View> = ArrayList() private val otherViews: ArrayList<View> = ArrayList()
private val ziZhiViews: ArrayList<View> = ArrayList() private val ziZhiViews: ArrayList<View> = ArrayList()
private val goodAtViews: ArrayList<TextView> = ArrayList()
var onFilterConfirmListener: OnFilterConfirmListener? = null var onFilterConfirmListener: OnFilterConfirmListener? = null
/**筛选咨询方式一行数量*/
private val enquirySize = 4
private var dp5 = 0 private var dp5 = 0
private var dp10 = 0 private var dp10 = 0
private var dp36 = 0 private var dp36 = 0
private var dp46 = 0 private var dp46 = 0
// val pad = RxImageTool.dp2px(15f) private val popWidth = (RxDeviceTool.getScreenWidth(context))
private val popWidth = (RxDeviceTool.getScreenWidth(context) * 0.8).toInt()
var etMinPrice: EditText? = null var etMinPrice: EditText? = null
var etMaxPrice: EditText? = null var etMaxPrice: EditText? = null
...@@ -74,25 +78,23 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi ...@@ -74,25 +78,23 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
dp36 = RxImageTool.dip2px(36f) dp36 = RxImageTool.dip2px(36f)
dp46 = RxImageTool.dip2px(46f) dp46 = RxImageTool.dip2px(46f)
this.width = popWidth this.width = popWidth
this.height = RxDeviceTool.getAppHeight(context) + RxDeviceTool.getStatusBarHeight(context) this.height = (RxDeviceTool.getAppHeight(context) * 0.75).toInt()
contentView = view contentView = view
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
contentView.foregroundGravity = Gravity.RIGHT
}
this.isFocusable = true this.isFocusable = true
@Suppress("DEPRECATION") @Suppress("DEPRECATION")
this.setBackgroundDrawable(BitmapDrawable()) this.setBackgroundDrawable(BitmapDrawable())
this.isOutsideTouchable = true this.isOutsideTouchable = true
this.animationStyle = R.style.consultant_expert_service_popupwindow_filter_anim_style // this.animationStyle = R.style.consultant_expert_service_popupwindow_filter_anim_style
initShowTypeViews(view) initShowTypeViews(view)
initEnquiryViews(view) initEnquiryViews(view)
initPriceViews(view) initPriceViews(view)
initAgeViews(view) initAgeViews(view)
initOtherViews(view) initOtherViews(view)
initGoodAtCrowd(view)
initZiZhiViews(view) initZiZhiViews(view)
initKeyboardListener(view) initKeyboardListener(view)
...@@ -136,6 +138,8 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi ...@@ -136,6 +138,8 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
tempFilter.showType = filterData.showType[0] tempFilter.showType = filterData.showType[0]
tempFilter.ages.clear() tempFilter.ages.clear()
tempFilter.enquiries.clear() tempFilter.enquiries.clear()
// 擅长人群
tempFilter.specialityCrowd.clear()
tempFilter.others.clear() tempFilter.others.clear()
tempFilter.title.clear() tempFilter.title.clear()
tempFilter.priceRangesView = null tempFilter.priceRangesView = null
...@@ -162,6 +166,10 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi ...@@ -162,6 +166,10 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
v.paint.isFakeBoldText = false v.paint.isFakeBoldText = false
} }
} }
for (v in goodAtViews){
v.isSelected = false
v.paint.isFakeBoldText = false
}
for (v in otherViews) { for (v in otherViews) {
v.isSelected = false v.isSelected = false
if (v is TextView) { if (v is TextView) {
...@@ -192,13 +200,14 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi ...@@ -192,13 +200,14 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
val sb = StringBuffer() val sb = StringBuffer()
var biEventParams = "" var biEventParams = ""
sb.append("searchWord=").append(if (TextUtils.isEmpty(tempFilter.searchWord)) "" else tempFilter.searchWord) sb.append("searchWord=")
.append(if (TextUtils.isEmpty(tempFilter.searchWord)) "" else tempFilter.searchWord)
if (tempFilter.categories.isNotEmpty()) { if (tempFilter.categories.isNotEmpty()) {
var categorys = tempFilter.categories.map { it.cateId }.joinToString(",") var categorys = tempFilter.categories.map { it.cateId }.joinToString(",")
if ("0" == categorys) { if ("0" == categorys) {
categorys = "" categorys = ""
} }
sb.append("&categories=").append(categorys) sb.append("&directionTags=").append(categorys)
} }
if (tempFilter.sub.key != null) { if (tempFilter.sub.key != null) {
sb.append("&city=").append(Integer.parseInt(tempFilter.sub.key)) sb.append("&city=").append(Integer.parseInt(tempFilter.sub.key))
...@@ -221,6 +230,13 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi ...@@ -221,6 +230,13 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
biEventParams = tempFilter.ages.map { it.key }.joinToString(",") biEventParams = tempFilter.ages.map { it.key }.joinToString(",")
} }
} }
// 擅长人群拼接
if (tempFilter.specialityCrowd.isNotEmpty()){
sb.append("&crowdsTags=").append(tempFilter.specialityCrowd.map { it.key }.joinToString(","))
if (ConsultBIConstants.POSITION_GOOD_AT_CLICK==biEventName){
biEventParams = tempFilter.specialityCrowd.map { it.key }.joinToString(",")
}
}
if (tempFilter.others.isNotEmpty()) { if (tempFilter.others.isNotEmpty()) {
sb.append("&others=").append(tempFilter.others.map { it.key }.joinToString(",")) sb.append("&others=").append(tempFilter.others.map { it.key }.joinToString(","))
if (ConsultBIConstants.POSITION_OTHER_CHOICE_CLICK == biEventName) { if (ConsultBIConstants.POSITION_OTHER_CHOICE_CLICK == biEventName) {
...@@ -259,34 +275,49 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi ...@@ -259,34 +275,49 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
// sb.append("&page=").append(1) // sb.append("&page=").append(1)
ExpertSearchDataManager.getHttp().getFilterCount(sb.toString()) ExpertSearchDataManager.getHttp().getFilterCount(sb.toString())
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.compose(RxUtils.resultJavaData()) .compose(RxUtils.resultJavaData())
.map { it } .map { it }
.filter { it != null } .filter { it != null }
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe({ .subscribe({
contentView.btnConfirm.text = if (it > 0) "确定" else "暂无匹配咨询师" contentView.btnConfirm.text = if (it > 0) "确定" else "暂无匹配咨询师"
//按钮置灰/解除置灰 //按钮置灰/解除置灰
contentView.btnConfirm.isEnabled = it > 0 contentView.btnConfirm.isEnabled = it > 0
if (it > 0) { if (it > 0) {
contentView.btnConfirm.setTextColor(ContextCompat.getColor(context,R.color.platform_but_text_color)) contentView.btnConfirm.setTextColor(
contentView.btnConfirm.background = ContextCompat.getDrawable(context, R.drawable.consultant_bg_radius_5_dark) ContextCompat.getColor(
context,
R.color.platform_but_text_color
)
)
contentView.btnConfirm.background =
ContextCompat.getDrawable(context, R.drawable.consultant_bg_radius_5_dark)
// contentView.btnConfirm.setTextColor(ContextCompat.getColor(context,R.color.consultant_white)) // contentView.btnConfirm.setTextColor(ContextCompat.getColor(context,R.color.consultant_white))
} else { } else {
contentView.btnConfirm.setTextColor(ContextCompat.getColor(context,R.color.platform_text_light_color)) contentView.btnConfirm.setTextColor(
contentView.btnConfirm.background = ContextCompat.getDrawable(context, R.drawable.consultant_bg_radius_5_light) ContextCompat.getColor(
context,
R.color.platform_text_light_color
)
)
contentView.btnConfirm.background =
ContextCompat.getDrawable(context, R.drawable.consultant_bg_radius_5_light)
// contentView.btnConfirm.setTextColor(ContextCompat.getColor(context,R.color.color_999999)) // contentView.btnConfirm.setTextColor(ContextCompat.getColor(context,R.color.color_999999))
} }
}, { }, {
ToastHelper.show(it.message!!) ToastHelper.show(it.message!!)
}) })
} }
private fun biEvent(biEventName: String, biEventParams: String = "") { private fun biEvent(biEventName: String, biEventParams: String = "") {
if (!TextUtils.isEmpty(biEventName)) { if (!TextUtils.isEmpty(biEventName)) {
ActionCountUtils.count(ConsultBIConstants.PART_ID_CONSULT_FILTER_PAGE+"|"+biEventName, biEventParams) ActionCountUtils.count(
ConsultBIConstants.PART_ID_CONSULT_FILTER_PAGE + "|" + biEventName,
biEventParams
)
} }
} }
...@@ -295,20 +326,22 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi ...@@ -295,20 +326,22 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
} }
private fun initOtherViews(view: View) { private fun initOtherViews(view: View) {
val mWidth = (popWidth - RxImageTool.dp2px(52f)) / 3 val mWidth = (popWidth - RxImageTool.dp2px(52f)) / enquirySize
for ((index, other) in filterData!!.other!!.withIndex()) { for ((index, other) in filterData.other.withIndex()) {
val textView = View.inflate(context, R.layout.consultant_item_filter, null) as TextView val textView = View.inflate(context, R.layout.consultant_item_filter, null) as TextView
val params = FrameLayout.LayoutParams(mWidth, dp36) val params = FrameLayout.LayoutParams(mWidth, dp36)
val marginNum = dp5 val marginNum = dp5
params.setMargins(marginNum + (dp10 + mWidth) * (index % 3), params.setMargins(
RxImageTool.dp2px(46f) * (index / 3), marginNum + (dp10 + mWidth) * (index % enquirySize),
marginNum, RxImageTool.dp2px(46f) * (index / enquirySize),
0) marginNum,
0
)
textView.layoutParams = params textView.layoutParams = params
textView.text = other.value textView.text = other.value
otherViews.add(textView) otherViews.add(textView)
if (tempFilter!!.others!!.contains(other)) { if (tempFilter.others.contains(other)) {
textView.isSelected = true textView.isSelected = true
textView.paint.isFakeBoldText = true textView.paint.isFakeBoldText = true
} }
...@@ -316,11 +349,11 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi ...@@ -316,11 +349,11 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
textView.setOnClickListener { textView.setOnClickListener {
if (textView.isSelected) { if (textView.isSelected) {
tempFilter!!.others!!.remove(other) tempFilter.others.remove(other)
textView!!.isSelected = false textView.isSelected = false
textView.paint.isFakeBoldText = false textView.paint.isFakeBoldText = false
} else { } else {
tempFilter!!.others!!.add(other) tempFilter.others.add(other)
textView.isSelected = true textView.isSelected = true
textView.paint.isFakeBoldText = true textView.paint.isFakeBoldText = true
} }
...@@ -332,26 +365,15 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi ...@@ -332,26 +365,15 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
private fun initZiZhiViews(view: View) { private fun initZiZhiViews(view: View) {
val mWidth = (popWidth - RxImageTool.dp2px(40f)) / 2 val mWidth = (popWidth - RxImageTool.dp2px(40f)) / 2
var float = 46f for (other in filterData.title) {
for ((index, other) in filterData!!.title!!.withIndex()) {
val textView = View.inflate(context, R.layout.consultant_item_filter, null) as TextView val textView = View.inflate(context, R.layout.consultant_item_filter, null) as TextView
// val params = FrameLayout.LayoutParams(mWidth,FrameLayout.LayoutParams.WRAP_CONTENT)
val params = FrameLayout.LayoutParams(mWidth, dp36) val params = FrameLayout.LayoutParams(mWidth, dp36)
val marginNum = dp5
// params.setMargins(marginNum + (dp10 + mWidth) * (index % 2),
// RxImageTool.dp2px(float) * (index / 2),
// marginNum,
// 0)
params.setMargins(0, 0, RxImageTool.dp2px(10f), 0) params.setMargins(0, 0, RxImageTool.dp2px(10f), 0)
textView.layoutParams = params textView.layoutParams = params
textView.text = other.value textView.text = other.value
if (textView.lineCount > 1) {
}
ziZhiViews.add(textView) ziZhiViews.add(textView)
if (tempFilter!!.title!!.contains(other)) { if (tempFilter.title.contains(other)) {
textView.isSelected = true textView.isSelected = true
textView.paint.isFakeBoldText = true textView.paint.isFakeBoldText = true
} }
...@@ -359,11 +381,11 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi ...@@ -359,11 +381,11 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
textView.setOnClickListener { textView.setOnClickListener {
if (textView.isSelected) { if (textView.isSelected) {
tempFilter!!.title!!.remove(other) tempFilter.title.remove(other)
textView!!.isSelected = false textView.isSelected = false
textView.paint.isFakeBoldText = false textView.paint.isFakeBoldText = false
} else { } else {
tempFilter!!.title!!.add(other) tempFilter.title.add(other)
textView.isSelected = true textView.isSelected = true
textView.paint.isFakeBoldText = true textView.paint.isFakeBoldText = true
} }
...@@ -373,21 +395,84 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi ...@@ -373,21 +395,84 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
} }
} }
/**
* 擅长人群
*/
private fun initGoodAtCrowd(view: View) {
// 如果标标签数量大于20,取前20个默认展示
if (filterData.specialityCrowd.size > 20) {
view.ll_crowd_more.visibility = View.VISIBLE
view.ll_crowd_more.setOnClickListener {
val text = view.tv_crowd_open.text
if (text == "展开") {
view.tv_crowd_open.text = "收起"
view.iv_crowd_open.setImageResource(R.drawable.ic_crowd_close)
for (i in 20 until goodAtViews.size){
goodAtViews[i].visibility = View.VISIBLE
}
} else {
view.tv_crowd_open.text = "展开"
view.iv_crowd_open.setImageResource(R.drawable.ic_crowd_open)
for (i in 20 until goodAtViews.size){
goodAtViews[i].visibility = View.GONE
}
}
}
}
val mWidth = (popWidth - RxImageTool.dp2px(52f)) / enquirySize
val params = FrameLayout.LayoutParams(mWidth, RxImageTool.dp2px(36f))
val margin = RxImageTool.dp2px(9.5f)
filterData.specialityCrowd.forEachIndexed { index, item ->
val textView = View.inflate(context, R.layout.consultant_item_filter, null) as TextView
params.setMargins(0, 0, margin, 0)
textView.layoutParams = params
textView.text = item.value
if (tempFilter.specialityCrowd.contains(item)) {
textView.isSelected = true
textView.paint.isFakeBoldText = true
}
textView.tvFilterName.text = " " + item.value + " "
textView.setOnClickListener {
if (textView.isSelected) {
tempFilter.specialityCrowd.remove(item)
textView.isSelected = false
textView.paint.isFakeBoldText = false
} else {
tempFilter.specialityCrowd.add(item)
textView.isSelected = true
textView.paint.isFakeBoldText = true
}
updateCount(ConsultBIConstants.POSITION_GOOD_AT_CLICK)
}
if (index>19){
textView.visibility = View.GONE
}
goodAtViews.add(textView)
view.fl_crowd.addView(textView)
}
}
private fun initAgeViews(view: View) { private fun initAgeViews(view: View) {
val mWidth = (popWidth - RxImageTool.dp2px(52f)) / 3 val mWidth = (popWidth - RxImageTool.dp2px(52f)) / enquirySize
for ((index, age) in filterData!!.age!!.withIndex()) { for ((index, age) in filterData.age.withIndex()) {
val textView = View.inflate(context, R.layout.consultant_item_filter, null) as TextView val textView = View.inflate(context, R.layout.consultant_item_filter, null) as TextView
val params = FrameLayout.LayoutParams(mWidth, RxImageTool.dp2px(36f)) val params = FrameLayout.LayoutParams(mWidth, RxImageTool.dp2px(36f))
val marginNum = RxImageTool.dp2px(5f) val marginNum = RxImageTool.dp2px(5f)
params.setMargins(marginNum + (dp10 + mWidth) * (index % 3), params.setMargins(
dp46 * (index / 3), marginNum + (dp10 + mWidth) * (index % enquirySize),
marginNum, dp46 * (index / enquirySize),
0) marginNum,
0
)
textView.layoutParams = params textView.layoutParams = params
textView.text = age.value textView.text = age.value
ageViews.add(textView) ageViews.add(textView)
if (tempFilter!!.ages!!.contains(age)) { if (tempFilter.ages.contains(age)) {
textView.isSelected = true textView.isSelected = true
textView.paint.isFakeBoldText = true textView.paint.isFakeBoldText = true
} }
...@@ -395,11 +480,11 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi ...@@ -395,11 +480,11 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
textView.setOnClickListener { textView.setOnClickListener {
if (textView.isSelected) { if (textView.isSelected) {
tempFilter!!.ages!!.remove(age) tempFilter.ages.remove(age)
textView.isSelected = false textView.isSelected = false
textView.paint.isFakeBoldText = false textView.paint.isFakeBoldText = false
} else { } else {
tempFilter!!.ages!!.add(age) tempFilter.ages.add(age)
textView.isSelected = true textView.isSelected = true
textView.paint.isFakeBoldText = true textView.paint.isFakeBoldText = true
} }
...@@ -410,55 +495,72 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi ...@@ -410,55 +495,72 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
} }
private fun initEnquiryViews(view: View) { private fun initEnquiryViews(view: View) {
val mWidth = (popWidth - RxImageTool.dp2px(52f)) / 3 val mWidth = (popWidth - RxImageTool.dp2px(52f)) / enquirySize
for ((index, enquiry) in filterData!!.enquiry!!.withIndex()) { for ((index, enquiry) in filterData.enquiry.withIndex()) {
val textView = View.inflate(context, R.layout.consultant_item_filter, null) as TextView val llLayout = View.inflate(context, R.layout.consultant_method_item_filter, null)
val textView:TextView = llLayout.findViewById(R.id.tvFilterName)
val ivIcon:ImageView = llLayout.findViewById(R.id.iv_consultant_method)
val params = FrameLayout.LayoutParams(mWidth, RxImageTool.dp2px(36f)) val params = FrameLayout.LayoutParams(mWidth, RxImageTool.dp2px(36f))
val marginNum = RxImageTool.dp2px(5f) val marginNum = RxImageTool.dp2px(5f)
params.setMargins(marginNum + (RxImageTool.dp2px(10f) + mWidth) * (index % 3), params.setMargins(
RxImageTool.dp2px(46f) * (index / 3), marginNum + (RxImageTool.dp2px(10f) + mWidth) * (index % enquirySize),
marginNum, RxImageTool.dp2px(46f) * (index / enquirySize),
0) marginNum,
textView.layoutParams = params 0
)
llLayout.layoutParams = params
textView.text = enquiry.value textView.text = enquiry.value
Glide.with(context)
.load(enquiry.unCheckUrl)
.into(ivIcon)
enquiryViews.add(textView) enquiryViews.add(view)
if (tempFilter!!.enquiries!!.contains(enquiry)) { if (tempFilter.enquiries.contains(enquiry)) {
textView.isSelected = true llLayout.isSelected = true
textView.paint.isFakeBoldText = true textView.paint.isFakeBoldText = true
Glide.with(context)
.load(enquiry.checkRrl)
.into(ivIcon)
} }
textView.setOnClickListener { llLayout.setOnClickListener {
if (llLayout.isSelected) {
if (textView.isSelected) { tempFilter.enquiries.remove(enquiry)
tempFilter!!.enquiries!!.remove(enquiry) llLayout.isSelected = false
textView.isSelected = false
textView.paint.isFakeBoldText = false textView.paint.isFakeBoldText = false
Glide.with(context)
.load(enquiry.unCheckUrl)
.into(ivIcon)
} else { } else {
tempFilter!!.enquiries!!.add(enquiry) tempFilter.enquiries.add(enquiry)
textView.isSelected = true llLayout.isSelected = true
textView.paint.isFakeBoldText = true textView.paint.isFakeBoldText = true
Glide.with(context)
.load(enquiry.checkRrl)
.into(ivIcon)
} }
updateCount(ConsultBIConstants.POSITION_CONSULT_TYPE_CLICK) updateCount(ConsultBIConstants.POSITION_CONSULT_TYPE_CLICK)
} }
view.flEnquiryType.addView(textView) view.flEnquiryType.addView(llLayout)
} }
} }
private fun initPriceViews(view: View) { private fun initPriceViews(view: View) {
val priceRange = View.inflate(context, R.layout.consultant_item_price_range, null) as LinearLayout val priceRange =
etMinPrice = priceRange.findViewById<EditText>(R.id.etMinPrice); View.inflate(context, R.layout.consultant_item_price_range, null) as LinearLayout
etMaxPrice = priceRange.findViewById<EditText>(R.id.etMaxPrice); etMinPrice = priceRange.findViewById(R.id.etMinPrice);
etMaxPrice = priceRange.findViewById(R.id.etMaxPrice);
val imm = context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager val imm = context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
var listener: TextView.OnEditorActionListener = TextView.OnEditorActionListener { _, actionId, event -> var listener: TextView.OnEditorActionListener =
if (actionId == EditorInfo.IME_ACTION_DONE || event != null && event.keyCode == KeyEvent.KEYCODE_ENTER) { TextView.OnEditorActionListener { _, actionId, event ->
updatePriceFilter() if (actionId == EditorInfo.IME_ACTION_DONE || event != null && event.keyCode == KeyEvent.KEYCODE_ENTER) {
true updatePriceFilter()
} else { true
false } else {
false
}
} }
}
if (tempFilter.priceRanges != null) { if (tempFilter.priceRanges != null) {
etMinPrice?.setText(tempFilter.priceRanges?.minPrice) etMinPrice?.setText(tempFilter.priceRanges?.minPrice)
...@@ -497,22 +599,35 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi ...@@ -497,22 +599,35 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
} }
}) })
val mWidth = (popWidth - RxImageTool.dp2px(52f)) / 3 val mWidth = (popWidth - RxImageTool.dp2px(52f)) / enquirySize
for ((index, priceRangesItem) in filterData!!.priceRanges!!.withIndex()) { for ((index, priceRangesItem) in filterData.priceRanges.withIndex()) {
val textView = View.inflate(context, R.layout.consultant_item_filter, null) as TextView val textView = View.inflate(context, R.layout.consultant_item_filter, null) as TextView
val params = FrameLayout.LayoutParams(mWidth, RxImageTool.dp2px(48f)) val params = FrameLayout.LayoutParams(mWidth, RxImageTool.dp2px(48f))
val marginNum = RxImageTool.dp2px(2f) val marginNum = RxImageTool.dp2px(2f)
params.setMargins(marginNum + (RxImageTool.dp2px(10f) + mWidth) * (index % 3), params.setMargins(
RxImageTool.dp2px(58f) * (index / 3), marginNum + (RxImageTool.dp2px(10f) + mWidth) * (index % enquirySize),
marginNum, RxImageTool.dp2px(58f) * (index / 3),
0) marginNum,
0
)
textView.layoutParams = params textView.layoutParams = params
val maxPriceStr = if (TextUtils.isEmpty(priceRangesItem.maxPrice)) "+" else "-" + priceRangesItem.maxPrice val maxPriceStr =
val contentStr = String.format("%s%s\n%s", priceRangesItem.minPrice, maxPriceStr, priceRangesItem.recommendPercent) if (TextUtils.isEmpty(priceRangesItem.maxPrice)) "+" else "-" + priceRangesItem.maxPrice
val contentStr = String.format(
"%s%s\n%s",
priceRangesItem.minPrice,
maxPriceStr,
priceRangesItem.recommendPercent
)
val msp = SpannableString(contentStr) val msp = SpannableString(contentStr)
msp.setSpan(AbsoluteSizeSpan(10, true), contentStr.indexOf("\n"), contentStr.length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE) msp.setSpan(
AbsoluteSizeSpan(10, true),
contentStr.indexOf("\n"),
contentStr.length,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
textView.text = msp; textView.text = msp;
...@@ -540,7 +655,8 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi ...@@ -540,7 +655,8 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
etMaxPrice?.setText("") etMaxPrice?.setText("")
etMinPrice?.setText("") etMinPrice?.setText("")
} else { } else {
tempFilter.priceRanges = priceRangesItem.copy(priceRangesItem.minPrice, priceRangesItem.maxPrice) tempFilter.priceRanges =
priceRangesItem.copy(priceRangesItem.minPrice, priceRangesItem.maxPrice)
textView.isSelected = true textView.isSelected = true
textView.paint.isFakeBoldText = true textView.paint.isFakeBoldText = true
tempFilter.priceRangesView = textView tempFilter.priceRangesView = textView
...@@ -583,15 +699,17 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi ...@@ -583,15 +699,17 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
val marginNum = dp5 val marginNum = dp5
var textMarginLeft = marginNum + (dp10 + mWidth) * (index % 2) var textMarginLeft = marginNum + (dp10 + mWidth) * (index % 2)
Log.e("Tag", "----------left=$textMarginLeft") Log.e("Tag", "----------left=$textMarginLeft")
params.setMargins(textMarginLeft, params.setMargins(
0, textMarginLeft,
marginNum, 0,
marginNum) marginNum,
marginNum
)
textView.layoutParams = params textView.layoutParams = params
textView.text = showType.value textView.text = showType.value
showTypeViews.add(textView) showTypeViews.add(textView)
if (showType == tempFilter!!.showType) { if (showType == tempFilter.showType) {
textView.isSelected = true textView.isSelected = true
textView.paint.isFakeBoldText = true textView.paint.isFakeBoldText = true
} }
...@@ -604,7 +722,7 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi ...@@ -604,7 +722,7 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
} }
textView.isSelected = true textView.isSelected = true
textView.paint.isFakeBoldText = true textView.paint.isFakeBoldText = true
tempFilter!!.showType = showType tempFilter.showType = showType
} }
updateCount() updateCount()
} }
......
...@@ -23,11 +23,11 @@ interface IConsultantService: IProvider { ...@@ -23,11 +23,11 @@ interface IConsultantService: IProvider {
fun resetConsultAssistantDialogStatus() fun resetConsultAssistantDialogStatus()
fun expertSearchIntent(activity: android.app.Activity, category: kotlin.Int, showType: kotlin.Int, isInitShowHot: kotlin.Boolean): android.content.Intent fun expertSearchIntent(activity: android.app.Activity, category: String, showType: Int, isInitShowHot: kotlin.Boolean): android.content.Intent
fun startExpertSearchActivity(context: Context, category: Int, categoryName: String, showType: Int) fun startExpertSearchActivity(context: Context, category: String, categoryName: String, showType: Int)
fun startExpertSearchActivity(mContext: Context, category: Int) fun startExpertSearchActivity(mContext: Context, category: String)
fun getHotSearch(): kotlin.collections.MutableList<Keyworks> fun getHotSearch(): kotlin.collections.MutableList<Keyworks>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:background="@color/platform_white"
app:layout_behavior="@string/appbar_scrolling_view_behavior" android:orientation="vertical"
android:background="@color/platform_white" app:layout_behavior="@string/appbar_scrolling_view_behavior">
>
<com.yidianling.consultant.ui.view.DisInterceptNestedScrollView <com.yidianling.consultant.ui.view.DisInterceptNestedScrollView
android:id="@+id/scroll" android:id="@+id/scroll"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!--筛选框-->
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:background="@color/platform_white"
<!--筛选框--> android:orientation="horizontal">
<LinearLayout <com.ydl.ydlcommon.view.DrawableRightTextView
android:layout_width="match_parent" android:id="@+id/tvSubject"
android:layout_height="wrap_content" style="@style/consultant_FilterTextViewStyle"
android:background="@color/platform_white" android:layout_width="0dp"
android:orientation="horizontal"> android:layout_weight="1"
android:width="0dp"
<com.ydl.ydlcommon.view.DrawableRightTextView android:drawableEnd="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:id="@+id/tvSubject" android:drawableRight="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
style="@style/consultant_FilterTextViewStyle" android:text="@string/platform_theme"
android:layout_width="0dp" android:textColor="@color/platform_color_242424" />
android:layout_weight="1"
android:width="0dp" <com.ydl.ydlcommon.view.DrawableRightTextView
android:textColor="@color/platform_color_242424" android:id="@+id/tvArea"
android:drawableEnd="@drawable/platform_ic_arrow_drop_down_grey_500_18dp" style="@style/consultant_FilterTextViewStyle"
android:drawableRight="@drawable/platform_ic_arrow_drop_down_grey_500_18dp" android:layout_width="0dp"
android:text="@string/platform_theme"/> android:layout_weight="1"
android:width="0dp"
<com.ydl.ydlcommon.view.DrawableRightTextView android:drawableEnd="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:id="@+id/tvArea" android:drawableRight="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
style="@style/consultant_FilterTextViewStyle" android:text="@string/platform_area"
android:layout_width="0dp" android:textColor="@color/platform_color_242424" />
android:layout_weight="1"
android:width="0dp" <com.ydl.ydlcommon.view.DrawableRightTextView
android:textColor="@color/platform_color_242424" android:id="@+id/tvSort"
android:drawableEnd="@drawable/platform_ic_arrow_drop_down_grey_500_18dp" style="@style/consultant_FilterTextViewStyle"
android:drawableRight="@drawable/platform_ic_arrow_drop_down_grey_500_18dp" android:layout_width="0dp"
android:text="@string/platform_area"/> android:layout_weight="1"
android:width="0dp"
<com.ydl.ydlcommon.view.DrawableRightTextView android:drawableEnd="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:id="@+id/tvSort" android:drawableRight="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
style="@style/consultant_FilterTextViewStyle" android:text="@string/platform_sort"
android:layout_width="0dp" android:textColor="@color/platform_color_242424" />
android:layout_weight="1"
android:width="0dp" <com.ydl.ydlcommon.view.DrawableRightTextView
android:textColor="@color/platform_color_242424" android:id="@+id/tvFilter"
android:drawableEnd="@drawable/platform_ic_arrow_drop_down_grey_500_18dp" style="@style/consultant_FilterTextViewStyle"
android:drawableRight="@drawable/platform_ic_arrow_drop_down_grey_500_18dp" android:layout_width="0dp"
android:text="@string/platform_sort"/> android:layout_weight="1"
android:width="0dp"
<com.ydl.ydlcommon.view.DrawableRightTextView android:drawableEnd="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:id="@+id/tvFilter" android:drawableRight="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
style="@style/consultant_FilterTextViewStyle" android:text="@string/platform_filter"
android:layout_width="0dp" android:textColor="@color/platform_color_242424" />
android:layout_weight="1"
android:width="0dp"
android:textColor="@color/platform_color_242424"
android:drawableEnd="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:drawableRight="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:text="@string/platform_filter"/>
</LinearLayout>
<LinearLayout
android:id="@+id/lin_filter2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingBottom="10dp"
android:orientation="horizontal">
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="6dp"
android:background="@drawable/consult_fillter_bg"/>
</LinearLayout> </LinearLayout>
<LinearLayout
android:id="@+id/lin_filter2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="10dp"
android:paddingBottom="10dp"/>
<View
android:layout_width="match_parent"
android:layout_height="6dp"
android:background="@drawable/consult_fillter_bg" />
</LinearLayout>
</com.yidianling.consultant.ui.view.DisInterceptNestedScrollView> </com.yidianling.consultant.ui.view.DisInterceptNestedScrollView>
<RelativeLayout <RelativeLayout
...@@ -96,46 +94,43 @@ ...@@ -96,46 +94,43 @@
android:id="@+id/viewSep2" android:id="@+id/viewSep2"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:background="@color/transparent" android:background="@color/transparent" />
/>
<androidx.recyclerview.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView android:id="@+id/rvExperts"
android:id="@+id/rvExperts" android:layout_width="match_parent"
android:layout_width="match_parent" android:layout_height="match_parent"
android:layout_height="match_parent" android:background="@color/platform_white"
android:background="@color/platform_white" android:overScrollMode="never" />
android:overScrollMode="never"/>
<com.ydl.ydlcommon.ui.LogoLoadingView <com.ydl.ydlcommon.ui.LogoLoadingView
android:id="@+id/v_loading" android:id="@+id/v_loading"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:visibility="gone"/> android:visibility="gone" />
<LinearLayout <LinearLayout
android:id="@+id/ll_network_error" android:id="@+id/ll_network_error"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="400dp" android:layout_height="400dp"
android:orientation="vertical"
android:background="@color/platform_white" android:background="@color/platform_white"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:visibility="gone" android:orientation="vertical"
> android:visibility="gone">
<ImageView <ImageView
android:id="@+id/iv_exception" android:id="@+id/iv_exception"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:src="@drawable/consultant_img_netwrok_error"/> android:src="@drawable/consultant_img_netwrok_error" />
<TextView <TextView
android:id="@+id/tv_reload_hint" android:id="@+id/tv_reload_hint"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/consultant_reload_hint"/> android:text="@string/consultant_reload_hint" />
<TextView <TextView
android:id="@+id/tv_reload" android:id="@+id/tv_reload"
...@@ -148,7 +143,7 @@ ...@@ -148,7 +143,7 @@
android:paddingRight="@dimen/platform_dp_32" android:paddingRight="@dimen/platform_dp_32"
android:paddingBottom="@dimen/platform_dp_8" android:paddingBottom="@dimen/platform_dp_8"
android:text="重新加载" android:text="重新加载"
android:textColor="@color/platform_main_theme"/> android:textColor="@color/platform_main_theme" />
</LinearLayout> </LinearLayout>
<ImageButton <ImageButton
...@@ -162,14 +157,13 @@ ...@@ -162,14 +157,13 @@
android:background="@color/platform_transparent" android:background="@color/platform_transparent"
android:padding="0dp" android:padding="0dp"
android:src="@drawable/consultant_ico_totop" android:src="@drawable/consultant_ico_totop"
android:visibility="gone" android:visibility="gone" />
/>
<View <View
android:id="@+id/viewDim" android:id="@+id/viewDim"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="#40000000" android:background="#40000000"
android:visibility="invisible"/> android:visibility="invisible" />
</RelativeLayout> </RelativeLayout>
</LinearLayout> </LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:layout_marginBottom="4dp"
android:background="@drawable/consultant_bg_search_filter_selector"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_consultant_method"
android:layout_width="@dimen/platform_dp_18"
android:layout_height="@dimen/platform_dp_18" />
<TextView
android:id="@+id/tvFilterName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center"
android:maxLines="1"
android:orientation="vertical"
android:paddingTop="6dp"
android:paddingBottom="6dp"
android:layout_marginStart="@dimen/platform_dp_4"
android:textColor="@color/consultant_color_search_filter_selector"
android:textSize="13sp"
tools:text="当面" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" xmlns:tools="http://schemas.android.com/tools"
android:layout_height="match_parent" android:layout_width="match_parent"
android:background="@color/platform_white" android:layout_height="match_parent"
android:orientation="vertical"> android:background="@color/platform_white"
android:orientation="vertical">
<ScrollView
android:id="@+id/sv_filter" <ScrollView
android:layout_width="match_parent" android:id="@+id/sv_filter"
android:layout_height="wrap_content" android:layout_width="match_parent"
android:layout_weight="1" android:layout_height="0dp"
android:background="@color/platform_white" android:layout_weight="1"
android:overScrollMode="never"> android:background="@color/platform_white"
android:overScrollMode="never"
<LinearLayout android:scrollbars="none">
android:layout_width="match_parent"
android:layout_height="wrap_content" <LinearLayout
android:layout_marginLeft="11dp" android:layout_width="match_parent"
android:layout_marginTop="@dimen/platform_dp_20" android:layout_height="wrap_content"
android:orientation="vertical"> android:layout_marginStart="8dp"
android:orientation="vertical">
<TextView
android:layout_width="match_parent" <TextView
android:layout_height="wrap_content" android:layout_width="match_parent"
android:layout_marginLeft="@dimen/platform_dp_5" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/platform_dp_20" android:layout_marginLeft="@dimen/platform_dp_5"
android:text="显示方式" android:layout_marginTop="@dimen/platform_dp_20"
android:textColor="@color/platform_color_242424" android:text="显示方式"
android:textSize="@dimen/platform_dp_16" android:textColor="@color/platform_color_242424"
android:textStyle="bold" android:textSize="@dimen/platform_dp_16"
android:visibility="gone" /> android:textStyle="bold"
android:visibility="gone" />
<FrameLayout
android:id="@+id/flShowType" <FrameLayout
android:layout_width="match_parent" android:id="@+id/flShowType"
android:layout_height="wrap_content" android:layout_width="match_parent"
android:layout_marginTop="12dp" android:layout_height="wrap_content"
android:visibility="gone" /> android:layout_marginTop="12dp"
android:visibility="gone" />
<TextView
android:layout_width="match_parent" <TextView
android:layout_height="wrap_content" android:layout_width="match_parent"
android:layout_marginLeft="@dimen/platform_dp_5" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/platform_dp_28" android:layout_marginTop="@dimen/platform_dp_28"
android:text="咨询方式" android:text="咨询方式"
android:textColor="@color/platform_color_242424" android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_16" android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" /> android:textStyle="bold" />
<FrameLayout <FrameLayout
android:id="@+id/flEnquiryType" android:id="@+id/flEnquiryType"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="12dp" /> android:layout_marginTop="12dp" />
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/platform_dp_5" android:layout_marginTop="@dimen/platform_dp_28"
android:layout_marginTop="@dimen/platform_dp_28" android:text="服务均价"
android:text="服务均价" android:textColor="@color/platform_color_242424"
android:textColor="@color/platform_color_242424" android:textSize="@dimen/platform_dp_16"
android:textSize="@dimen/platform_dp_16" android:textStyle="bold" />
android:textStyle="bold" />
<FrameLayout
<FrameLayout android:id="@+id/flPriceRange"
android:id="@+id/flPriceRange" android:layout_width="match_parent"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:layout_marginTop="12dp" />
android:layout_marginTop="12dp" />
<TextView
<TextView android:layout_width="match_parent"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:layout_marginTop="@dimen/platform_dp_28"
android:layout_marginLeft="@dimen/platform_dp_5" android:text="年龄选择"
android:layout_marginTop="@dimen/platform_dp_28" android:textColor="@color/platform_color_242424"
android:text="年龄选择" android:textSize="@dimen/platform_dp_16"
android:textColor="@color/platform_color_242424" android:textStyle="bold" />
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" /> <FrameLayout
android:id="@+id/flAge"
<FrameLayout android:layout_width="match_parent"
android:id="@+id/flAge" android:layout_height="wrap_content"
android:layout_width="match_parent" android:layout_marginTop="12dp" />
android:layout_height="wrap_content"
android:layout_marginTop="12dp" /> <TextView
android:layout_width="match_parent"
<TextView android:layout_height="wrap_content"
android:layout_width="match_parent" android:layout_marginTop="@dimen/platform_dp_28"
android:layout_height="wrap_content" android:text="资质选择"
android:layout_marginLeft="@dimen/platform_dp_5" android:textColor="@color/platform_color_242424"
android:layout_marginTop="@dimen/platform_dp_28" android:textSize="@dimen/platform_dp_16"
android:text="资质选择" android:textStyle="bold" />
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_16" <cn.lankton.flowlayout.FlowLayout
android:textStyle="bold" /> android:id="@+id/flZhizi"
android:layout_width="match_parent"
<cn.lankton.flowlayout.FlowLayout android:layout_height="wrap_content"
android:id="@+id/flZhizi" android:layout_marginTop="12dp"
android:layout_width="match_parent" android:paddingLeft="5dp"
android:layout_height="wrap_content" app:lineSpacing="10dp" />
android:layout_marginTop="12dp"
android:paddingLeft="5dp" <TextView
app:lineSpacing="10dp" /> android:layout_width="match_parent"
android:layout_height="wrap_content"
<TextView android:layout_marginTop="28dp"
android:layout_width="match_parent" android:text="擅长人群"
android:layout_height="wrap_content" android:textColor="@color/platform_color_242424"
android:layout_marginLeft="@dimen/platform_dp_5" android:textSize="16sp"
android:layout_marginTop="@dimen/platform_dp_28" android:textStyle="bold" />
android:text="其他选择"
android:textColor="@color/platform_color_242424" <cn.lankton.flowlayout.FlowLayout
android:textSize="@dimen/platform_dp_16" android:id="@+id/fl_crowd"
android:textStyle="bold" /> android:layout_width="match_parent"
android:layout_height="wrap_content"
<FrameLayout android:layout_marginTop="12dp"
android:id="@+id/flOther" android:paddingLeft="5dp"
android:layout_width="match_parent" app:lineSpacing="10dp" />
android:layout_height="wrap_content"
android:layout_marginTop="12dp" <LinearLayout
android:layout_marginBottom="40dp" /> android:id="@+id/ll_crowd_more"
android:layout_width="match_parent"
android:layout_height="wrap_content"
</LinearLayout> android:layout_marginTop="24dp"
</ScrollView> android:gravity="center"
android:orientation="horizontal"
android:visibility="gone"
<LinearLayout tools:ignore="MissingConstraints"
android:layout_width="match_parent" tools:visibility="visible">
android:layout_height="wrap_content"
android:layout_marginLeft="15dp" <TextView
android:layout_marginRight="15dp" android:id="@+id/tv_crowd_open"
android:layout_marginBottom="15dp" android:layout_width="wrap_content"
android:layout_marginTop="10dp" android:layout_height="wrap_content"
android:background="@color/platform_white" android:text="展开"
android:orientation="horizontal"> android:textSize="12sp"
android:textColor="@color/platform_color_666666"
<TextView app:layout_constraintEnd_toEndOf="parent"
android:id="@+id/btnReset" app:layout_constraintStart_toStartOf="parent" />
android:layout_width="0dp"
android:layout_height="44dp" <ImageView
android:layout_weight="1" android:id="@+id/iv_crowd_open"
android:background="@drawable/consultant_bg_radius_gray_6" android:layout_width="wrap_content"
android:gravity="center" android:layout_height="wrap_content"
android:text="@string/platform_reset" android:src="@drawable/ic_crowd_open"
android:textColor="@color/platform_color_999999" />
android:textSize="16sp" />
</LinearLayout>
<TextView
android:id="@+id/btnConfirm" <TextView
android:layout_width="0dp" android:layout_width="match_parent"
android:layout_height="44dp" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:layout_marginTop="@dimen/platform_dp_28"
android:layout_marginLeft="10dp" android:text="其他选择"
android:layout_weight="2" android:textColor="@color/platform_color_242424"
android:background="@drawable/consultant_bg_radius_5_light" android:textSize="@dimen/platform_dp_16"
android:gravity="center" android:textStyle="bold" />
android:hint="暂无匹配咨询师"
android:textColorHint="@color/platform_color_E0E0E0" <FrameLayout
android:textColor="@color/platform_but_text_color" android:id="@+id/flOther"
android:textSize="16sp" /> android:layout_width="match_parent"
</LinearLayout> android:layout_height="wrap_content"
</LinearLayout> android:layout_marginTop="12dp"
android:layout_marginBottom="40dp" />
</LinearLayout>
</ScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginTop="10dp"
android:layout_marginRight="15dp"
android:layout_marginBottom="15dp"
android:background="@color/platform_white"
android:orientation="horizontal">
<TextView
android:id="@+id/btnReset"
android:layout_width="0dp"
android:layout_height="44dp"
android:layout_weight="1"
android:background="@drawable/consultant_bg_radius_gray_6"
android:gravity="center"
android:text="@string/platform_reset"
android:textColor="@color/platform_color_999999"
android:textSize="16sp" />
<TextView
android:id="@+id/btnConfirm"
android:layout_width="0dp"
android:layout_height="44dp"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:background="@drawable/consultant_bg_radius_5_light"
android:gravity="center"
android:hint="暂无匹配咨询师"
android:textColor="@color/platform_but_text_color"
android:textColorHint="@color/platform_color_E0E0E0"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
...@@ -78,7 +78,7 @@ object DynamicIn { ...@@ -78,7 +78,7 @@ object DynamicIn {
fun getUserInfo(): UserResponseBean.UserInfo? = getUserService().getUserInfo() fun getUserInfo(): UserResponseBean.UserInfo? = getUserService().getUserInfo()
fun loginWayIntent(activity: Activity): Intent? { fun loginWayIntent(activity: Activity): Intent {
return getUserService().loginWayIntent(activity) return getUserService().loginWayIntent(activity)
} }
...@@ -86,7 +86,7 @@ object DynamicIn { ...@@ -86,7 +86,7 @@ object DynamicIn {
getAppService().personalInfoIntent(activity) getAppService().personalInfoIntent(activity)
} }
fun inputPhoneIntent(activity: Activity, smsAction: String): Intent? { fun inputPhoneIntent(activity: Activity, smsAction: String): Intent {
return getUserService().inputPhoneIntent(activity, smsAction) return getUserService().inputPhoneIntent(activity, smsAction)
} }
...@@ -104,7 +104,7 @@ object DynamicIn { ...@@ -104,7 +104,7 @@ object DynamicIn {
showType: Int, showType: Int,
isInitShowHot: Boolean isInitShowHot: Boolean
): Intent? { ): Intent? {
return getConsultService().expertSearchIntent(activity, category, showType, isInitShowHot) return getConsultService().expertSearchIntent(activity, category.toString(), showType, isInitShowHot)
} }
fun testResultH5(testResultId: Int) { fun testResultH5(testResultId: Int) {
...@@ -115,11 +115,11 @@ object DynamicIn { ...@@ -115,11 +115,11 @@ object DynamicIn {
getTestsService().testDetailH5(testId.toString()); getTestsService().testDetailH5(testId.toString());
} }
fun phoneCallIntent(activity: Activity): Intent? { fun phoneCallIntent(activity: Activity): Intent {
return getConfideService().phoneCallIntent(activity) return getConfideService().phoneCallIntent(activity)
} }
fun fmDetailIntent(activity: Activity, fmId: Int): Intent? { fun fmDetailIntent(activity: Activity, fmId: Int): Intent {
return getFMService().fmDetailIntent(activity, fmId) return getFMService().fmDetailIntent(activity, fmId)
} }
...@@ -131,7 +131,7 @@ object DynamicIn { ...@@ -131,7 +131,7 @@ object DynamicIn {
getAppService().rechargeIntent(activity) getAppService().rechargeIntent(activity)
} }
fun phoneCallFragment(head: String, callId: String): DialogFragment? { fun phoneCallFragment(head: String, callId: String): DialogFragment {
return getConfideService().phoneCallFragment(head, callId) return getConfideService().phoneCallFragment(head, callId)
} }
...@@ -141,11 +141,11 @@ object DynamicIn { ...@@ -141,11 +141,11 @@ object DynamicIn {
} }
fun isFmPlaying(): Boolean { fun isFmPlaying(): Boolean {
return getFMService().isPlaying() ?: false return getFMService().isPlaying()
} }
fun isCoursePlaying(): Boolean { fun isCoursePlaying(): Boolean {
return getCourseService().isPlaying() ?: false return getCourseService().isPlaying()
} }
fun playCourse() { fun playCourse() {
......
...@@ -35,7 +35,7 @@ class HomeBIConstants { ...@@ -35,7 +35,7 @@ class HomeBIConstants {
const val YDL_USER_ARTICLE_MORE_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_article_more_click"//文章阅读更多 const val YDL_USER_ARTICLE_MORE_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_article_more_click"//文章阅读更多
const val YDL_USER_ARTICLE_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_article_click"//文章标题图区域 const val YDL_USER_ARTICLE_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_article_click"//文章标题图区域
const val YDL_USER_MAIN_PAGE_VISIT: String = YDL_USER_MAIN_PAGE + "ydl_user_main_page_visit "//首页浏览事件 const val YDL_USER_MAIN_PAGE_VISIT: String = YDL_USER_MAIN_PAGE + "ydl_user_main_page_visit "//首页浏览事件
const val YDL_PRIVATE_CHAT_CLICK: String = YDL_USER_MAIN_PAGE + "private_chat_click" // 首页咨询分类点击私聊按钮
} }
} }
\ No newline at end of file
...@@ -39,7 +39,7 @@ class HomeBaseHttp { ...@@ -39,7 +39,7 @@ class HomeBaseHttp {
//首页头部 分类&Banner 请求 //首页头部 分类&Banner 请求
fun newHomeHeaderRequest(): Observable<BaseAPIResponse<HomeHeaderBean>> { fun newHomeHeaderRequest(): Observable<BaseAPIResponse<HomeHeaderBean>> {
return getHomePagerApi().getHomeHeaderData() return getHomePagerApi().getHomeHeaderData(2)
} }
//首页倾述请求 //首页倾述请求
......
...@@ -25,7 +25,7 @@ interface HomeBasePagerApi { ...@@ -25,7 +25,7 @@ interface HomeBasePagerApi {
*/ */
@GET("home/index") @GET("home/index")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA) @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun getHomeHeaderData(): Observable<BaseAPIResponse<HomeHeaderBean>> fun getHomeHeaderData(@Query("cateSource") cateSource: Int): Observable<BaseAPIResponse<HomeHeaderBean>>
/** /**
* 首页咨询请求 * 首页咨询请求
...@@ -34,7 +34,7 @@ interface HomeBasePagerApi { ...@@ -34,7 +34,7 @@ interface HomeBasePagerApi {
@GET("doctor/nlist") @GET("doctor/nlist")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA) @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun getConsultData( fun getConsultData(
@Query("categories") category: String, @Query("directionTags") category: String,
@Query("limit") limit: String = "3", @Query("limit") limit: String = "3",
@Query("page") page: String = "1", @Query("page") page: String = "1",
@Query("uid") uid: String, @Query("uid") uid: String,
......
...@@ -122,6 +122,7 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent: ...@@ -122,6 +122,7 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
tv_consult_chat.setOnClickListener { tv_consult_chat.setOnClickListener {
homeEvent!!.consultChatClick(bodyBean.uid.toString()) homeEvent!!.consultChatClick(bodyBean.uid.toString())
ActionCountUtils.count(HomeBIConstants.YDL_PRIVATE_CHAT_CLICK)
} }
} }
} }
...@@ -134,18 +134,13 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent: ...@@ -134,18 +134,13 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
*/ */
private fun setConfideButton(bodyBean: HomeConsultBean.ListBean) { private fun setConfideButton(bodyBean: HomeConsultBean.ListBean) {
tv_consult_chat.setOnClickListener { tv_consult_chat.setOnClickListener {
// homeEvent!!.consultChatClick(bodyBean.uid.toString())
/*ModularServiceManager.provide(IConsultantService::class.java).jumpConsultAssistant(
mContext as Activity,
11
)*/
ModularServiceManager.provide(IConsultantService::class.java).dueToTypeJumpAutoOrGuide( ModularServiceManager.provide(IConsultantService::class.java).dueToTypeJumpAutoOrGuide(
mContext as Activity, mContext as Activity,
11, 11,
bodyBean.uid, bodyBean.uid,
"" ""
) )
ActionCountUtils.count(HomeBIConstants.YDL_PRIVATE_CHAT_CLICK)
} }
} }
......
...@@ -6,7 +6,8 @@ public class MultipleSelectedEvent ( ...@@ -6,7 +6,8 @@ public class MultipleSelectedEvent (
val strSelected:String?, val strSelected:String?,
var othersState:OthersState?, var othersState:OthersState?,
var multipleAnswerBean:MultipleAnswerBean?, var multipleAnswerBean:MultipleAnswerBean?,
var isFromInputPanel:Boolean var isFromInputPanel:Boolean,
var recoverInput:Boolean
) )
data class OthersState( data class OthersState(
var isOthers:Boolean, var isOthers:Boolean,
......
...@@ -193,7 +193,7 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen ...@@ -193,7 +193,7 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
//请求接口发送所选题目,通过发通知到YDLMessageFragment统一回答问题。 //请求接口发送所选题目,通过发通知到YDLMessageFragment统一回答问题。
EventBus.getDefault().post(new MultipleSelectedEvent(null, null, EventBus.getDefault().post(new MultipleSelectedEvent(null, null,
new MultipleAnswerBean(examId, questionPaperId, ImIn.INSTANCE.getUserInfo().getUid(), new MultipleAnswerBean(examId, questionPaperId, ImIn.INSTANCE.getUserInfo().getUid(),
questionId, answersItems,message.getFromAccount()),false)); questionId, answersItems,message.getFromAccount()),false,false));
}); });
multiple_choice_title.setText(customAttachLingxiWhichQuestion.name); multiple_choice_title.setText(customAttachLingxiWhichQuestion.name);
adapterLingxiMultipleChoice = new AdapterLingxiMultipleChoice(); adapterLingxiMultipleChoice = new AdapterLingxiMultipleChoice();
...@@ -221,6 +221,12 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen ...@@ -221,6 +221,12 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
@Override @Override
public void onItemClick(@NotNull QuestionItemBean itemBean, int position) { public void onItemClick(@NotNull QuestionItemBean itemBean, int position) {
/*
* 单选题:分其他选项和非其他选项
* 其他选项,唤起输入框
* 点击非其他选项直接发送答案
* */
if (isClickable) { if (isClickable) {
for (int i = 0; i < questionList.size(); i++) { for (int i = 0; i < questionList.size(); i++) {
if (questionList.get(i).isSelected()) { if (questionList.get(i).isSelected()) {
...@@ -229,21 +235,31 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen ...@@ -229,21 +235,31 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
isClickable = true; isClickable = true;
questionList.get(i).setSelected(false); questionList.get(i).setSelected(false);
selectedStr.remove(questionList.get(i).getName()); selectedStr.remove(questionList.get(i).getName());
break;
} }
} }
} else { } else {
if (i == position) { if (i == position) {
questionList.get(i).setSelected(true); questionList.get(i).setSelected(true);
selectedStr.add(questionList.get(i).getName()); selectedStr.add(questionList.get(i).getName());
}else{
questionList.get(i).setSelected(false);
if (questionList.get(i).getName().contains("其他")){
selectedStr.remove(questionList.get(i).getName());
}
} }
} }
questionList.get(i).setSelected(i == position); questionList.get(i).setSelected(i == position);
} }
adapterLingxiWhichQuestion.setTagData(questionList, isSingleChoice); adapterLingxiWhichQuestion.setTagData(questionList, isSingleChoice);
for (int i = 0; i < questionList.size(); i++) {
if (questionList.get(i).isSelected()){
answersItems.clear();
answersItems.add(new AnswersItem(questionList.get(position).getId(),
questionList.get(position).getName(), "", questionList.get(position).getRelates()));
break;
}
}
answersItems.add(new AnswersItem(questionList.get(position).getId(),
questionList.get(position).getName(), "", questionList.get(position).getRelates()));
stringBuffer.delete(2, stringBuffer.length()); stringBuffer.delete(2, stringBuffer.length());
for (int i = 0; i < selectedStr.size(); i++) { for (int i = 0; i < selectedStr.size(); i++) {
stringBuffer.append("#").append(selectedStr.get(i)); stringBuffer.append("#").append(selectedStr.get(i));
...@@ -255,9 +271,12 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen ...@@ -255,9 +271,12 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
answerLingxiQuestion(examId, questionPaperId, ImIn.INSTANCE.getUserInfo().getUid().toString(), questionId, answersItems); answerLingxiQuestion(examId, questionPaperId, ImIn.INSTANCE.getUserInfo().getUid().toString(), questionId, answersItems);
//更新本地消息 //更新本地消息
updateLocalMsg(position,null); updateLocalMsg(position,null);
//发通知取消隐藏输入框表情等符号
EventBus.getDefault().post(new MultipleSelectedEvent(stringBuffer.toString(), new OthersState(isOthers, questionList.get(position).isSelected()), new MultipleAnswerBean(examId, questionPaperId, ImIn.INSTANCE.getUserInfo().getUid(),
questionId, answersItems,message.getFromAccount()),false,true));
}else{ }else{
EventBus.getDefault().post(new MultipleSelectedEvent(stringBuffer.toString(), new OthersState(isOthers, questionList.get(position).isSelected()), new MultipleAnswerBean(examId, questionPaperId, ImIn.INSTANCE.getUserInfo().getUid(), EventBus.getDefault().post(new MultipleSelectedEvent(stringBuffer.toString(), new OthersState(isOthers, questionList.get(position).isSelected()), new MultipleAnswerBean(examId, questionPaperId, ImIn.INSTANCE.getUserInfo().getUid(),
questionId, answersItems,message.getFromAccount()),false)); questionId, answersItems,message.getFromAccount()),false,false));
} }
} }
} }
...@@ -325,7 +344,7 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen ...@@ -325,7 +344,7 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
} }
isOthers = questionList.get(position).getName().contains("其他"); isOthers = questionList.get(position).getName().contains("其他");
EventBus.getDefault().post(new MultipleSelectedEvent(stringBuffer.toString(), new OthersState(isOthers, questionList.get(position).isSelected()), new MultipleAnswerBean(examId, questionPaperId, ImIn.INSTANCE.getUserInfo().getUid(), EventBus.getDefault().post(new MultipleSelectedEvent(stringBuffer.toString(), new OthersState(isOthers, questionList.get(position).isSelected()), new MultipleAnswerBean(examId, questionPaperId, ImIn.INSTANCE.getUserInfo().getUid(),
questionId, answersItems,message.getFromAccount()),false)); questionId, answersItems,message.getFromAccount()),false,false));
adapterLingxiMultipleChoice.setTagData(questionList); adapterLingxiMultipleChoice.setTagData(questionList);
} }
} }
......
...@@ -56,6 +56,12 @@ public class MsgViewHolderModifyTime extends MsgViewHolderBase { ...@@ -56,6 +56,12 @@ public class MsgViewHolderModifyTime extends MsgViewHolderBase {
@Override @Override
protected void onItemClick() { protected void onItemClick() {
NewH5Activity.start(context, new H5Params(userUrl + "&dsmId=" + dsmId, "预约时间修改")); String url;
if (userUrl.endsWith("?")) {
url = userUrl + "dsmId=" + dsmId;
} else {
url = userUrl + "&dsmId=" + dsmId;
}
NewH5Activity.start(context, new H5Params(url, "预约时间修改"));
} }
} }
...@@ -287,7 +287,7 @@ class ChatFragment : BaseFragment(), XRecyclerView.LoadingListener { ...@@ -287,7 +287,7 @@ class ChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
ll_chat_unusual_view.setListener(object : ChatUnusualView.ChatUnusualListener { ll_chat_unusual_view.setListener(object : ChatUnusualView.ChatUnusualListener {
override fun onButtonClick() { override fun onButtonClick() {
startActivity( startActivity(
ImIn.getConsultService().expertSearchIntent(activity!!, 0, 0, false) ImIn.getConsultService().expertSearchIntent(activity!!, "0", 0, false)
) )
} }
}) })
......
...@@ -225,14 +225,18 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity { ...@@ -225,14 +225,18 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity {
JSONObject json = JSON.parseObject(content); JSONObject json = JSON.parseObject(content);
int id = json.getIntValue("id"); int id = json.getIntValue("id");
if (id == 1) { if (id == 1) {
//对方输入中
oldName= tb.getTitle(); oldName= tb.getTitle();
tb.setTitle("对方正在输入..."); tb.setTitle("对方正在输入...");
} else if (id==2){ } else if (id==2){
//对方结束输入
tb.setTitle(oldName);
}else{
tb.setTitle(oldName); tb.setTitle(oldName);
} }
} catch (Exception e) { } catch (Exception e) {
tb.setTitle(oldName);
} }
} }
......
...@@ -1055,6 +1055,10 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -1055,6 +1055,10 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
answersItems=event.getMultipleAnswerBean().getAnswersItems(); answersItems=event.getMultipleAnswerBean().getAnswersItems();
multipleAnswerBean=event.getMultipleAnswerBean(); multipleAnswerBean=event.getMultipleAnswerBean();
multipleAnswerBean.setAnswersItems(answersItems); multipleAnswerBean.setAnswersItems(answersItems);
if (event.getRecoverInput()){
inputPanel.onlyShowTextEnd();
return;
}
if (event.getOthersState().isOthers()){ if (event.getOthersState().isOthers()){
//用户点击了其他事件 //用户点击了其他事件
if (event.getOthersState().getOthersSelect()){ if (event.getOthersState().getOthersSelect()){
...@@ -1071,9 +1075,15 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -1071,9 +1075,15 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
isOthers=event.getOthersState().getOthersSelect(); isOthers=event.getOthersState().getOthersSelect();
inputPanel.onlyShowTextEnd(); inputPanel.onlyShowTextEnd();
} }
question_multiple.setText(event.getStrSelected()); if (event.getStrSelected().contains("其他")){
question_multiple.setVisibility(View.VISIBLE);
question_multiple.setText(event.getStrSelected());
}
}else{ }else{
question_multiple.setText(event.getStrSelected()); if (event.getStrSelected().contains("其他")){
question_multiple.setVisibility(View.VISIBLE);
question_multiple.setText(event.getStrSelected());
}
} }
}else if (event.isFromInputPanel()){ }else if (event.isFromInputPanel()){
for (int i=0;i<answersItems.size();i++){ for (int i=0;i<answersItems.size();i++){
...@@ -1133,6 +1143,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -1133,6 +1143,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
inputPanel.setInputContent(""); inputPanel.setInputContent("");
question_multiple.setText(""); question_multiple.setText("");
question_multiple.setVisibility(View.GONE);
inputPanel.onlyShowTextEnd(); inputPanel.onlyShowTextEnd();
answerLingxiQuestion(multipleAnswerBean.getExamId(),multipleAnswerBean.getQuestionPaperId(), answerLingxiQuestion(multipleAnswerBean.getExamId(),multipleAnswerBean.getQuestionPaperId(),
multipleAnswerBean.getUid(),multipleAnswerBean.getQuestionId(),multipleAnswerBean.getAnswersItems(), multipleAnswerBean.getUid(),multipleAnswerBean.getQuestionId(),multipleAnswerBean.getAnswersItems(),
......
...@@ -418,7 +418,7 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba ...@@ -418,7 +418,7 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
} else if (v == sendMessageButtonInInputBar) { } else if (v == sendMessageButtonInInputBar) {
if (onlyShowInputTest){ if (onlyShowInputTest){
EventBus.getDefault().post(new MultipleSelectedEvent(null, null, EventBus.getDefault().post(new MultipleSelectedEvent(null, null,
null,true)); null,true,false));
}else{ }else{
onTextMessageSendButtonPressed(); onTextMessageSendButtonPressed();
} }
......
...@@ -590,22 +590,25 @@ ...@@ -590,22 +590,25 @@
android:textStyle="bold" /> android:textStyle="bold" />
</RelativeLayout> </RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/im_sp_14"
android:textColor="@color/im_color_242424"
android:layout_gravity="bottom"
android:id="@+id/question_multiple"
tools:text="已选:#工作压力 #生活压力#其他"
android:layout_marginStart="@dimen/platform_dp_12"
android:layout_marginEnd="@dimen/platform_dp_12"
android:layout_marginBottom="@dimen/platform_dp_8"
>
</TextView>
</FrameLayout>
</FrameLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/im_sp_14"
android:maxHeight="@dimen/platform_dp_20"
android:textColor="@color/im_color_242424"
android:layout_gravity="bottom"
android:maxLines="3"
android:visibility="gone"
android:id="@+id/question_multiple"
tools:text="已选:#工作压力 #生活压力#其他"
android:layout_marginStart="@dimen/platform_dp_12"
android:layout_marginEnd="@dimen/platform_dp_12"
android:layout_marginBottom="@dimen/platform_dp_8"
>
</TextView>
<FrameLayout <FrameLayout
android:id="@+id/fl_question_content" android:id="@+id/fl_question_content"
android:layout_width="match_parent" android:layout_width="match_parent"
......
...@@ -101,7 +101,7 @@ class ApkInstallTool { ...@@ -101,7 +101,7 @@ class ApkInstallTool {
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
if (Build.VERSION.SDK_INT >= 24) { //判读版本是否在7.0以上 if (Build.VERSION.SDK_INT >= 24) { //判读版本是否在7.0以上
//参数1 上下文, 参数2 Provider主机地址 和配置文件中保持一致 参数3 共享的文件 //参数1 上下文, 参数2 Provider主机地址 和配置文件中保持一致 参数3 共享的文件
val apkUri = FileProvider.getUriForFile(context!!, "com.cxzapp.yidianling.fileprovider", file) val apkUri = context?.let { FileProvider.getUriForFile(it, "${it.applicationContext.packageName}.fileprovider", file) }
//添加这一句表示对目标应用临时授权该Uri所代表的文件 //添加这一句表示对目标应用临时授权该Uri所代表的文件
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
intent.setDataAndType(apkUri, "application/vnd.android.package-archive") intent.setDataAndType(apkUri, "application/vnd.android.package-archive")
......
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