Commit 366e99b6 by 刘鹏

Merge branch 'd/v_sort' into 'd/v4.3.95'

D/v sort

See merge request app_android_lib/YDL-Component!139
parents f93dc397 54c2a611
......@@ -190,63 +190,34 @@ dependencies {
implementation(rootProject.ext.dependencies["okhttp3"])
implementation("androidx.fragment:fragment:1.2.4")
// TPNS SDK 主工程依赖包
// implementation 'com.tencent.liteav:LiteAVSDK_TRTC:latest.release'
if (true) {
//开发模式
implementation fileTree(dir: 'aars', include: ['*.aar'])
implementation project(':m-user')
implementation modularPublication('com.ydl:m-user-api')
implementation project(':m-confide')
implementation modularPublication('com.ydl:m-confide-api')
api project(':m-consultant')
implementation modularPublication('com.ydl:m-consultant-api')
api project(':m-tests')
api project(':m-home')
api project(':m-confide')
implementation project(':ydl-flutter-base')
api(project(':ydl-platform')) {
transitive = true
}
implementation project(':ydl-webview')
implementation project(':ydl-media')
implementation project(':m-muse')
implementation project(':m-im')
implementation modularPublication('com.ydl:m-im-api')
implementation project(':m-dynamic')
implementation project(':m-course')
//文章模块
implementation project(':m-article')
implementation project(':m-audioim')
implementation modularPublication('com.ydl:m-audioim-api')
implementation project(':m-fm')
implementation modularPublication('com.ydl:m-fm-api')
implementation project(':ydl-tuicore')
} else {
//发布模式
api 'com.ydl:m-user-module-ydl:0.0.6'
api rootProject.ext.dependencies["ydl-webview"]
api rootProject.ext.dependencies["ydl-m-user-api"]
api rootProject.ext.dependencies["ydl-m-fm-api"]
api rootProject.ext.dependencies["m-article"]
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
api(rootProject.ext.dependencies["ydl-tuicalling"]) {
transitive = true
}
implementation fileTree(dir: 'aars', include: ['*.aar'])
implementation project(':m-user')
implementation modularPublication('com.ydl:m-user-api')
implementation project(':m-confide')
implementation modularPublication('com.ydl:m-confide-api')
api project(':m-consultant')
implementation modularPublication('com.ydl:m-consultant-api')
api project(':m-tests')
api project(':m-home')
api project(':m-confide')
implementation project(':ydl-flutter-base')
api(project(':ydl-platform')) {
transitive = true
}
implementation project(':ydl-webview')
implementation project(':ydl-media')
implementation project(':m-muse')
implementation project(':m-im')
implementation modularPublication('com.ydl:m-im-api')
implementation project(':m-dynamic')
implementation project(':m-course')
implementation project(':m-article')
implementation project(':m-audioim')
implementation modularPublication('com.ydl:m-audioim-api')
implementation project(':m-fm')
implementation modularPublication('com.ydl:m-fm-api')
implementation project(':ydl-tuicore')
implementation rootProject.ext.dependencies["retrofit-url-manager"]
......
......@@ -21,9 +21,9 @@ import java.util.List;
public final class DemoGlobalConfig implements IConfigModule {
String APP_DOMAIN = "https://api.github.com/";
// public static String appEnv = YDLConstants.ENV_AUTO_TEST;
// public static String appEnv = YDLConstants.ENV_NEW_TEST;//配置未上传到maven库
// public static String appEnv = YDLConstants.ENV_TEST;
public static String appEnv = YDLConstants.ENV_PROD;
public static String appEnv = YDLConstants.ENV_TEST;
// public static String appEnv = YDLConstants.ENV_NEW_TEST;//配置未上传到maven库
// public static String appEnv = YDLConstants.ENV_PROD;
@Override
public void injectAppLifecycle(@NotNull Context context, @NotNull List<IAppLifecycles> lifecycles) {
lifecycles.add(new DemoAppLifecycles());
......
......@@ -6,7 +6,7 @@ ext {
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.50.19",
"m-consultant" : "0.0.60.27",
"m-consultant" : "0.0.60.61",
"m-fm" : "0.0.30.09",
"m-user" : "0.0.62.46",
"m-home" : "0.0.23.80",
......@@ -50,7 +50,7 @@ ext {
//以下 几乎不会动
"router" : "0.0.1",
"ydl-net" : "0.0.3.93",
"ydl-net" : "0.0.3.94",
"ydl-utils" : "0.0.3.8",
]
ydl_app = [
......@@ -95,7 +95,7 @@ ext {
//第三步 若干
"m-confide" : "0.0.50.19",
"m-consultant" : "0.0.60.27",
"m-consultant" : "0.0.60.61",
"m-fm" : "0.0.30.09",
"m-user" : "0.0.62.46",
"m-home" : "0.0.23.80",
......@@ -133,7 +133,7 @@ ext {
//以下 几乎不会动
"router" : "0.0.1",
"ydl-net" : "0.0.3.93",
"ydl-net" : "0.0.3.94",
"ydl-utils" : "0.0.3.8",
]
......
......@@ -68,7 +68,7 @@ dependencies {
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
kapt 'com.alibaba:arouter-compiler:1.2.2'
implementation rootProject.ext.dependencies["BaseRecyclerViewAdapterHelper"]
api rootProject.ext.dependencies["ydl-user-router"]
if (rootProject.ext.dev_mode){
//开发时使用
......
......@@ -3,23 +3,20 @@ package com.yidianling.consultant
import android.widget.ImageView
import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydlcommon.mvp.base.IView
import com.yidianling.consultant.model.bean.DoctorServiceItem
import com.yidianling.consultant.model.bean.ExpertBannerBean
import com.yidianling.consultant.model.bean.ExpertSearchBean
import com.yidianling.consultant.model.bean.ExpertServiceItem
import com.yidianling.consultant.model.bean.Extras
import com.yidianling.consultant.model.bean.HeadData
/**
* Created by zqk on 17-9-19.
*/
interface IExpertSearchView : IView {
fun onServiceListFetched(data: MutableList<DoctorServiceItem>, page: Int, totalPage: Int)
fun showRefreshLayout()
fun localData()
fun updateCache(showType: Int,searchBean: ExpertSearchBean)
fun onHeadFetched(headData: HeadData?)
fun onDoctorListFetched(data: MutableList<DoctorServiceItem>, page: Int,totalPage : Int)
fun onDoctorListFetched(data: MutableList<ExpertServiceItem>, extras: Extras?,curPage:Int)
fun fetchFailed(msg: String?)
fun fetchListFailed(msg: String?)
fun fetchListEmpty(msg: String?)
......
......@@ -32,7 +32,7 @@ class CategoryRecyclerViewAdapter(private val context: Context, private val cate
override fun getItemCount(): Int = categories.size
inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val tvSubjectName: TextView = itemView.tvSubjectName
val tvSubjectName: TextView = itemView.tv_sort_name
init {
itemView.setOnClickListener {
......
package com.yidianling.consultant.adapter
import android.text.SpannableString
import android.text.Spanned
import android.text.style.ForegroundColorSpan
import android.widget.TextView
import androidx.core.content.ContextCompat
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.yidianling.consultant.R
import com.yidianling.consultant.bean.SearchSuggestListBean
/**
* Created by Ykai on 2022/5/30.
*/
class SearchWordsAdapter(data: List<SearchSuggestListBean>) : BaseQuickAdapter<SearchSuggestListBean, BaseViewHolder>(R.layout.consultant_item_search_words,data) {
private var mSearchWord:String = ""
override fun convert(holder: BaseViewHolder, item: SearchSuggestListBean) {
val tvSearchWords = holder.getView<TextView>(R.id.tv_search_words)
tvSearchWords.text = setWordsStyle(item.suggest_content,mSearchWord)
}
fun notifyDataAndSetSearchWord(searchWord: String){
mSearchWord = searchWord
notifyDataSetChanged()
}
private fun setWordsStyle(words:String,searchWord:String):SpannableString{
val spannableString = SpannableString(words)
if (words.contains(searchWord)){
val startIndex = words.indexOf(searchWord)
val endIndex = startIndex+searchWord.length
spannableString.setSpan(ForegroundColorSpan(ContextCompat.getColor(mContext,R.color.platform_main_theme)), startIndex, endIndex, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
}
return spannableString
}
}
\ No newline at end of file
package com.yidianling.consultant.adapter
import android.widget.TextView
import androidx.core.content.ContextCompat
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.yidianling.consultant.R
import com.yidianling.consultant.model.bean.ChildrenBean
/**
* Created by Ykai on 2022/5/18.
*/
class SortAdapter(data: List<ChildrenBean>) : BaseMultiItemQuickAdapter<ChildrenBean, BaseViewHolder>(data) {
var isVisible = false
init {
addItemType(1, R.layout.consultant_item_sort1)
addItemType(2, R.layout.consultant_item_sort2)
}
override fun convert(holder: BaseViewHolder, item: ChildrenBean) {
when(holder.itemViewType){
1 ->{
holder.setGone(R.id.ll_sort_item,item.isVisible)
holder.setText(R.id.tv_sort_name, item.cate_name)
holder.getView<TextView>(R.id.tv_sort_name).isSelected = item.isSelected
if (item.isSelected){
holder.setTextColor(R.id.tv_sort_name,ContextCompat.getColor(mContext,R.color.platform_main_theme))
}else{
holder.setTextColor(R.id.tv_sort_name,ContextCompat.getColor(mContext,R.color.platform_color_242424))
}
}
2->{
holder.setGone(R.id.ll_sort_item,item.isVisible)
holder.setText(R.id.tv_sort_name, item.cate_name)
holder.getView<TextView>(R.id.tv_sort_name).isSelected = item.isSelected
if (item.isSelected){
holder.setTextColor(R.id.tv_sort_name,ContextCompat.getColor(mContext,R.color.platform_main_theme))
}else{
holder.setTextColor(R.id.tv_sort_name,ContextCompat.getColor(mContext,R.color.platform_color_242424))
}
}
}
}
/**
* 设置大于第12个之后的标签全部显示
*/
fun setAllVisible(){
mData.forEach { bean ->
bean.isVisible = true
}
notifyDataSetChanged()
isVisible = true
}
/**
* 设置大于第12个之后的标签全部隐藏
*/
fun setGone(){
mData.forEachIndexed { index, bean ->
if (index>12){
bean.isVisible = false
}
}
notifyDataSetChanged()
isVisible = false
}
}
\ No newline at end of file
......@@ -31,7 +31,7 @@ class SortRecyclerViewAdapter(private val context: Context,
val item = sortItems[position]
holder.tvSort.text = item.value
if (item.key == selectedSort.key) {
holder.tvSort.setTypeface(Typeface.DEFAULT_BOLD)
holder.tvSort.typeface = Typeface.DEFAULT_BOLD
holder.tvSort.setTextColor(ContextCompat.getColor(context, R.color.platform_main_theme))
// holder.ivCheck.visibility = View.VISIBLE
}
......
......@@ -11,8 +11,8 @@ data class ExpertSearchProductsBean(
/**
* 1.单次/2.套餐
*/
val isPackage : Int?,
val product_type: String?,
/**
* 套餐名称
*/
val name : String?)
\ No newline at end of file
val product_name : String?)
\ No newline at end of file
......@@ -11,16 +11,16 @@ data class ExpertSearchTagsIconBean(
/**
* 优质图标
*/
val abilityLevelIcon : String?,
val ability_level_icon : String?,
/**
* 公益图标
*/
val serviceFreeIcon : String?,
val service_free_icon : String?,
/**
* 新入驻图标
*/
val newEnterIcon : String?,
val new_enter_icon : String?,
/**
* 抗疫先锋图标地址
*/
var fightEpidemicIcon: String? = null)
\ No newline at end of file
var fight_epidemic_icon: String? = null)
\ No newline at end of file
package com.yidianling.consultant.bean
/**
* Created by Ykai on 2022/5/30.
*/
data class SearchWordsBean(
val search_suggests:ArrayList<SearchSuggestListBean>?
)
data class SearchSuggestListBean(
val id:String,
val score:String,
val suggest_content:String,
val suggest_relations:ArrayList<String>,
val search_count: Int,
val suggest_classify_types:ArrayList<String>,
val mapping_classify_type_exist:Boolean
)
\ No newline at end of file
......@@ -19,7 +19,12 @@ class ConsultBIConstants {
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_DAOYI_ADVERTISEMENT_CLICK="daoyi_advertisement_page|daoyi_advertisement_click"
const val POSITION_DAOYI_ADVERTISEMENT_VISIT="daoyi_advertisement_page|daoyi_advertisement_visit"
const val PART_ID_CONSULT_COUNSELOR_LIST_PAGE="consult_counselor_list_page" // 咨询师列表页面浏览part_id
const val PART_ID_YDL_USER_MAIN_PAGE="ydl_user_main_page" // 联想词part_id
const val POSITION_CONSULT_COUNSELOR_LIST_PAGE_VISIT="consult_counselor_list_page_visit" // 咨询师列表页面浏览position
const val POSITION_YDL_USER_ASSOCIATE_WORD_VISIT="ydl_user_associate_word_visit" // 联想词曝光position
const val POSITION_YDL_USER_ASSOCIATE_WORD_CLICK="ydl_user_associate_word_click" // 联想词点击position
}
//====================APP咨询列表页(app_consult_list_page)====================
......@@ -51,6 +56,10 @@ class ConsultBIConstants {
const val YDL_USER_CONSULT_TYPE_CLICK: String =
APP_CONSULT_LIST_PAGE + "ydl_user_consult_type_click"//咨询师顶部ICON 厌学专题、限时特惠、精神心理
const val POSITION_CONSULT_COUNSELOR_CARD_CLICK="consult_counselor_card_click" // 咨询师列表点击position
const val POSITION_CHOICE_FILTER_CLICK="choice_filter_click" // 热门点击项position
const val POSITION_TWO_CATEGORY_CLICK="two_category_click" // 八大类标签选择埋点
const val POSITION_GOODAT_CROWD_CLICK="goodat_crowd_click" // 擅长人群埋点
}
}
class ConsultSearchListEvent {
......@@ -69,8 +78,7 @@ class ConsultBIConstants {
class UserMainEvent {
companion object {
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" //搜索栏
......
......@@ -5,6 +5,7 @@ import com.ydl.ydlcommon.mvp.base.IModel
import com.ydl.ydlcommon.mvp.base.IPresenter
import com.ydl.ydlcommon.mvp.base.IView
import com.yidianling.consultant.bean.HotSearchBean
import com.yidianling.consultant.bean.SearchWordsBean
import io.reactivex.Observable
/**
......@@ -26,6 +27,11 @@ class IHotSearchContract {
* 请求失败
*/
fun requestFail()
/**
* 联想词请求成功结果
*/
fun getSearchWordsSuccess(searchWordsBean: SearchWordsBean,searchContent:String,isClickWords:Boolean)
}
interface Presenter : IPresenter<View> {
......@@ -38,6 +44,11 @@ class IHotSearchContract {
* 搜索页接口请求
*/
fun searchData()
/**
* 获取联想词
*/
fun getSearchWords(map:HashMap<String,Any>,searchContent:String,isClickWords:Boolean)
}
interface Model : IModel {
......@@ -45,5 +56,10 @@ class IHotSearchContract {
* 搜索页接口
*/
fun searchData(): Observable<HotSearchBean>
/**
* 获取到联想词
*/
fun getSearchWords(map:HashMap<String,Any>): Observable<SearchWordsBean>
}
}
\ No newline at end of file
......@@ -5,8 +5,7 @@ import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.consultant.bean.ExpertSearchTopShowBean
import com.yidianling.consultant.model.SearchApi
import com.yidianling.consultant.model.bean.ExpertBannerBean
import com.yidianling.consultant.model.bean.ExpertSearchBean
import com.yidianling.consultant.model.bean.ExpertBean
import io.reactivex.Observable
/**
......@@ -45,9 +44,13 @@ class ExpertSearchHttpImpl : IExpertSearchHttp {
return searchApi!!
}
override fun searchDoctor(params: String?): Observable<BaseAPIResponse<ExpertSearchBean>> {
return getSearchApi().searchDoctorService(HttpConfig.JAVA_BASE_URL+ "doctor/nlist?"+params)
// override fun searchDoctor(params: String?): Observable<BaseAPIResponse<ExpertSearchBean>> {
// return getSearchApi().searchDoctorService(HttpConfig.JAVA_BASE_URL+ "doctor/nlist?"+params)
//
// }
override fun getExpertList(map: Map<String, Any>): Observable<BaseAPIResponse<ExpertBean>> {
return getSearchApi().getExpertList(map)
}
override fun getBigShotData(): Observable<BaseAPIResponse<ExpertSearchTopShowBean>> {
......
......@@ -2,8 +2,8 @@ package com.yidianling.consultant.http
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.yidianling.consultant.bean.ExpertSearchTopShowBean
import com.yidianling.consultant.model.bean.ExpertBannerBean
import com.yidianling.consultant.model.bean.ExpertSearchBean
import com.yidianling.consultant.bean.SearchWordsBean
import com.yidianling.consultant.model.bean.ExpertBean
import io.reactivex.Observable
/**
......@@ -17,7 +17,17 @@ interface IExpertSearchHttp{
/**
* 专家搜索页请求
*/
fun searchDoctor(params : String?): Observable<BaseAPIResponse<ExpertSearchBean>>
// fun searchDoctor(params : String?): Observable<BaseAPIResponse<ExpertSearchBean>>
/**
* 获取搜索联想词
*/
// fun getSearchWords(map:Map<String,Any>): Observable<BaseAPIResponse<SearchWordsBean>>
/**
* 获取专家列表
*/
fun getExpertList(map:Map<String,Any>): Observable<BaseAPIResponse<ExpertBean>>
/**
* 获取当前筛选条件结果数
......
......@@ -4,6 +4,7 @@ import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.consultant.bean.HotSearchBean
import com.yidianling.consultant.bean.SearchWordsBean
import com.yidianling.consultant.http.ExpertSearchParam
import com.yidianling.consultant.model.SearchApi
import io.reactivex.Observable
......@@ -46,4 +47,8 @@ class HotSearchHttpImpl : IHotSearchHttp {
getSearchApi().searchPage()
}
}
override fun getSearchWords(map: HashMap<String, Any>): Observable<BaseAPIResponse<SearchWordsBean>> {
return getSearchApi().getSearchWords(map)
}
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ package com.yidianling.consultant.http.hotsearch
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.yidianling.consultant.bean.HotSearchBean
import com.yidianling.consultant.bean.SearchWordsBean
import io.reactivex.Observable
/**
......@@ -13,7 +14,12 @@ import io.reactivex.Observable
*/
interface IHotSearchHttp{
/**
* 测评首页请求
* 搜索页请求
*/
fun searchData(): Observable<BaseAPIResponse<HotSearchBean>>
/**
* 搜索联想词请求
*/
fun getSearchWords(map:HashMap<String,Any>): Observable<BaseAPIResponse<SearchWordsBean>>
}
\ No newline at end of file
package com.yidianling.consultant.listener
import com.yidianling.consultant.model.bean.CateItem
/**
* Created by zqk on 17-9-20.
*/
interface OnCategoriesSelectedListener {
fun onCategoriesSelected(categories: ArrayList<CateItem>)
fun onCategoriesSelected(signLit:ArrayList<String>)
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ package com.yidianling.consultant.model
import com.ydl.ydlcommon.data.http.RxUtils
import com.yidianling.consultant.bean.HotSearchBean
import com.yidianling.consultant.bean.SearchWordsBean
import com.yidianling.consultant.contract.IHotSearchContract
import com.yidianling.consultant.http.hotsearch.HotSearchDataManager
import io.reactivex.Observable
......@@ -17,4 +18,8 @@ class HotSearchModelImpl : IHotSearchContract.Model{
override fun searchData(): Observable<HotSearchBean> {
return HotSearchDataManager.getHttp().searchData().compose(RxUtils.resultJavaData())
}
override fun getSearchWords(map:HashMap<String,Any>): Observable<SearchWordsBean> {
return HotSearchDataManager.getHttp().getSearchWords(map).compose(RxUtils.resultJavaData())
}
}
\ No newline at end of file
......@@ -9,7 +9,8 @@ import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.consultant.bean.ExpertSearchTopShowBean
import com.yidianling.consultant.bean.GuideBean
import com.yidianling.consultant.bean.HotSearchBean
import com.yidianling.consultant.model.bean.ExpertSearchBean
import com.yidianling.consultant.bean.SearchWordsBean
import com.yidianling.consultant.model.bean.ExpertBean
import com.yidianling.consultant.model.bean.HeadData
import io.reactivex.Observable
import retrofit2.http.*
......@@ -38,14 +39,25 @@ interface SearchApi {
fun listHead(@FieldMap maps: Map<String, String>): Observable<BaseResponse<HeadData>>
//搜索条件
@GET("consult/search/v2/conditions")
@GET("consult/search/v3/conditions")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun searchConditions(@Query("cateSource") cateSource: Int): Observable<BaseAPIResponse<HeadData>>
//专家服务搜索
@retrofit2.http.Headers("Content-Type:application/json")
@GET
fun searchDoctorService(@Url url: String): Observable<BaseAPIResponse<ExpertSearchBean>>
/**
* 新咨询师列表接口(包含搜索、筛选咨询师)
*/
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA,"X-App-Id: plough_cloud")
@POST("smart-rank/v1/search")
fun getExpertList(@Body map: Map<String,@JvmSuppressWildcards Any>):Observable<BaseAPIResponse<ExpertBean>>
/**
* 获取搜索联想词
*/
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
@POST("dmp/v1/searchsuggest")
fun getSearchWords(@Body map: Map<String,@JvmSuppressWildcards Any>):Observable<BaseAPIResponse<SearchWordsBean>>
//搜索页面接口
@retrofit2.http.Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA, "Content-Type:application/json")
......
......@@ -7,5 +7,5 @@ data class AgeItem(
val value: String? = null,
@field:SerializedName("key")
val key: Int? = null
val key: Int
)
\ No newline at end of file
......@@ -23,5 +23,30 @@ data class AllFilter(
val others: ArrayList<OtherItem> = ArrayList(),//其他筛选
val title:ArrayList<ReorderItem> = ArrayList(), //资质
val specialityCrowd:ArrayList<SpecialityCrowdBean> = ArrayList() // 擅长人群
val specialityCrowd:ArrayList<SpecialityCrowdBean> = ArrayList(), // 擅长人群
// 八大类标签集合
val childList:ArrayList<ChildrenBean> = ArrayList(), // 亲子教育
val stressList:ArrayList<ChildrenBean> = ArrayList(), // 情绪压力
val loveEmotionList:ArrayList<ChildrenBean> = ArrayList(), // 恋爱情感
val marriedFamilyList:ArrayList<ChildrenBean> = ArrayList(), // 婚姻家庭
val personalGrowthList:ArrayList<ChildrenBean> = ArrayList(), // 个人成长
val interpersonalRelationshipList:ArrayList<ChildrenBean> = ArrayList(), // 人际关系
val careerDevelopmentList:ArrayList<ChildrenBean> = ArrayList(), // 职场发展
val mentalHealthList:ArrayList<ChildrenBean> = ArrayList(), // 心理健康
// 八大类已选中标签id集合
val categoryId2List:ArrayList<String> = ArrayList(), // 一级类目id集合
val categoryId3List:ArrayList<String> = ArrayList(), // 二级类目id集合
// 八大类选中下标集合,重置的时候可以减少循坏,提升性能
val chooseChildIndexList:ArrayList<Int> = ArrayList(),
val chooseStressIndexList:ArrayList<Int> = ArrayList(),
val chooseLoveEmotionIndexList:ArrayList<Int> = ArrayList(),
val chooseMarriedFamilyIndexList:ArrayList<Int> = ArrayList(),
val choosePersonalGrowthIndexList:ArrayList<Int> = ArrayList(),
val chooseInterpersonalRelationshipIndexList:ArrayList<Int> = ArrayList(),
val chooseCareerDevelopmentIndexList:ArrayList<Int> = ArrayList(),
val chooseMentalHealthIndexList:ArrayList<Int> = ArrayList()
)
\ No newline at end of file
package com.yidianling.consultant.model.bean
import android.os.Parcel
import android.os.Parcelable
import com.chad.library.adapter.base.entity.MultiItemEntity
import com.google.gson.annotations.SerializedName
data class CateItem(
......@@ -10,30 +9,23 @@ data class CateItem(
var cateName: String? = null,
@field:SerializedName("cate_id")
var cateId: String? = null
) : Parcelable {
constructor(parcel: Parcel) : this(
parcel.readString(),
parcel.readString()
) {
}
var cateId: String? = null,
override fun writeToParcel(parcel: Parcel, flags: Int) {
parcel.writeString(cateName)
parcel.writeString(cateId)
}
@field:SerializedName("children")
var children: ArrayList<ChildrenBean>?=null
)
override fun describeContents(): Int {
return 0
}
data class ChildrenBean(var cate_name: String,var cate_id:String,var isVisible: Boolean, var type: Int): MultiItemEntity {
// @field:SerializedName("cate_name")
// var cateName: String? = null,
// @field:SerializedName("cate_id")
// var cateId: String? = null,
companion object CREATOR : Parcelable.Creator<CateItem> {
override fun createFromParcel(parcel: Parcel): CateItem {
return CateItem(parcel)
}
// var isVisible: Boolean = false // 是否显示
var isSelected: Boolean = false // 是否选中
override fun newArray(size: Int): Array<CateItem?> {
return arrayOfNulls(size)
}
override fun getItemType(): Int {
return type
}
}
\ No newline at end of file
......@@ -8,7 +8,7 @@ data class EnquiryItem(
val value: String? = null,
@field:SerializedName("key")
val key: Int? = null,
val key: Int,
val checkRrl: String?,
val unCheckUrl: String?
......
package com.yidianling.consultant.model.bean
/**
* @author yuanWai
* @描述:专家搜索页数据bean
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/12/11
*/
data class ExpertBean(
val amount : Int = 0,
val skip : Int = 0,
val limit : Int = 0,
val size : Int = 10,
val objects : MutableList<ExpertServiceItem>,
// 分页需要
val extras: Extras?)
data class Extras(
val skips: HashMap<String, Int>
)
\ No newline at end of file
package com.yidianling.consultant.model.bean
/**
* @author yuanWai
* @描述:专家搜索页数据bean
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/12/11
*/
data class ExpertSearchBean(val endRow : Int = 0,
val hasNextPage : Boolean = false,
val hasPreviousPage : Boolean = false,
val isFirstPage : Boolean = false,
val isLastPage : Boolean = false,
/**
* 数据列表
*/
val list : MutableList<DoctorServiceItem>?,
val navigateFirstPage : Int = 0,
val navigateLastPage : Int = 0,
val navigatePages : Int = 0,
val navigatepageNums : MutableList<Int>?,
val nextPage : Int = 0,
val pageNum : Int = 0,
val pageSize : Int = 0,
/**
* 总页数
*/
val pages : Int = 0,
val prePage : Int = 0,
val size : Int = 0,
val startRow : Int = 0,
/**
* 数据总条数
*/
val total : Int = 0)
\ No newline at end of file
......@@ -10,11 +10,11 @@ import com.yidianling.consultant.bean.ExpertSearchTagsIconBean
* @Company 壹点灵
* @date 2018/12/11
*/
data class DoctorServiceItem(
data class ExpertServiceItem(
/**
* 专家ID
*/
val doctorId: String?,
val id: String,
/**
* 专家uid
*/
......@@ -22,11 +22,11 @@ data class DoctorServiceItem(
/**
* 专家名称
*/
val name: String?,
val doctor_name: String?,
/**
* 跳转路由地址(正常为专家主页地址)
*/
val linkUrl: String?,
val link_url: String?,
/**
* 专家头像地址
*/
......@@ -34,7 +34,7 @@ data class DoctorServiceItem(
/**
* 专家是否在线 1.在线
*/
val isOnline: Int?,
val chat_status: Int?,
/**
* 能力等级 1.实习 2.新手 3.精英
*/
......@@ -42,7 +42,7 @@ data class DoctorServiceItem(
/**
* 有免费咨询:1.有,2.无
*/
val hasServiceFree: Int?,
val has_servicefree_consult: Int?,
/**
* 活动图标
*/
......@@ -54,11 +54,11 @@ data class DoctorServiceItem(
/**
* 是否新入驻:true:是,false:否
*/
var isNewEnter: Boolean = false,
var is_new_enter: Boolean?,
/**
* 好评率(倾诉+咨询)
*/
var feedbackRate: Float = 0f,
var evaluation_average_score: Float = 0f,
/**
* 是否抗疫先锋图标
*/
......@@ -66,59 +66,62 @@ data class DoctorServiceItem(
/**
* 评价数(咨询订单数)
*/
var zixunOrderNum: Int = 0,
var evaluate_num: Int = 0,
/**
* 咨询最低价
*/
val minBookingPrice: String?,
val min_price: String?,
/**
* 资质材料
*/
val teamCertifications: String?,
/**
* 标签分类
*/
val tags: String?,
val title: String?,
/**
* 已帮助人数(咨询人数)
*/
val zixunOrderUser: String?,
val help_num: String?,
/**
* 月售时长
*/
var saleDurationForMonth: Float = 0f,
var p30d_sold_hour: Float = 0f,
/**
* 服务时长
*/
var allSaleDuration: Float = 0f,
var sum_service_time: Float = 0f,
/**
* 服务
*/
val products: MutableList<ExpertSearchProductsBean>?,
val doctor_products: MutableList<ExpertSearchProductsBean>?,
/**
* 标签图片
*/
val tagsIcon: ExpertSearchTagsIconBean?,
/**
* 今日是否可约
*/
val isTodayFree: Boolean?,
/**
* 是否咨询中
*/
var inConsult: Boolean = false,
/**
* 是否聆听中
*/
var isListening: Boolean = false,
val icons: ExpertSearchTagsIconBean?,
// /**
// * 今日是否可约
// */
// val booking_status: Int,
// /**
// * 咨询状态 1-待服务 2-服务中
// */
// var consult_status: Int,
// /**
// * 倾诉状态 1-待服务 2-服务中
// */
// var listen_status: Int,
var open_chat_agency:Int,
var service_status:Int,
var is_free_today:Int,
/**
* 私聊人数
*/
var chatNum: Int = 0,
var chat_num: Int = 0,
/**
* 个人铭言
*/
val famousRemark: String?,
val famous_remark: String?,
/**
* 省
*/
......@@ -130,15 +133,36 @@ data class DoctorServiceItem(
/**
* 私聊按钮的文案(如果不为空则取这个字段的值,如果为空 则默认为:“私聊”)
*/
val chatBtnText: String?,
val chat_btn_text: String?,
/**
* 新标签分类
*/
val tagList: ArrayList<TagBean>?
)
val feature_tags: ArrayList<FeatureTag>?,
/**
* 是否是头部headView
*/
val is_head_view:Boolean=false,
/**
* 搜索词
*/
val search_content:String,
/**
* 联想词
*/
val related_word:String
) {
constructor(is_head_view: Boolean,search_content: String,related_word:String) : this("","","","","",
1,1,1,"",false,true,
1f,false,0,"","","",1f,1f,
null,null,1,1,1,1,
"","","","",null,is_head_view,search_content,related_word)
}
data class TagBean(
val tagName:String?,
val isHigh:Int
data class FeatureTag(
val tag_id:String,
val tag_name:String,
val is_highlight:Boolean, // 是否高亮
val type:String // 标签类型
)
\ No newline at end of file
......@@ -45,12 +45,6 @@ data class Filters(
@field:SerializedName("title")
val title: List<ReorderItem> = ArrayList(),
// /**
// * 擅长人群
// */
// @field:SerializedName("crowdsTags")
// val crowdsTags: List<AgeItem> = ArrayList()
/**
* 擅长人群
......
......@@ -8,5 +8,11 @@ data class OtherItem(
val value: String? = null,
@field:SerializedName("key")
val key: Int? = null
val key: Int? = null,
@field:SerializedName("value1")
val value1: String,
@field:SerializedName("key1")
val key1: String
)
\ No newline at end of file
......@@ -8,5 +8,11 @@ data class ReorderItem(
var value: String? = null,
@field:SerializedName("key")
var key: String? = null
var key: String? = null,
@field:SerializedName("value1")
var value1: String="",
@field:SerializedName("key1")
var key1: String=""
)
\ No newline at end of file
//package com.yidianling.consultant.model.bean
//
//import com.google.gson.annotations.SerializedName
//
//data class ServiceItem(
//
// @field:SerializedName("doctor_uid")
// val doctorUid: Int = 0,
//
// @field:SerializedName("city")
// val city: String? = null,
//
// @field:SerializedName("product_name")
// val productName: String? = null,
//
// @field:SerializedName("tags")
// val tags: List<String?> = ArrayList(),
//
// @field:SerializedName("uid")
// val uid: Int? = null,
//
// @field:SerializedName("doctor_id")
// val doctorId: Int? = null,
//
// @field:SerializedName("feedback_rate")
// val feedbackRate: String? = null,
//
// @field:SerializedName("doctor_head")
// val doctorHead: String? = null,
//
// @field:SerializedName("province")
// val province: String? = null,
//
//
// @field:SerializedName("doctor_name")
// val doctorName: String? = null,
//
// @field:SerializedName("m_url")
// val mUrl: String? = null,
//
// @field:SerializedName("h_url")
// val hUrl: String? = null,
//
// @field:SerializedName("is_online")
// val isOnline: Int = 0 //1在线,2离线
//)
\ No newline at end of file
......@@ -418,7 +418,7 @@ class ConsultAssistantDialogUtils private constructor() {
.getSecondTaskActivity()?.finish()
activity.finish()
} else {
if (null != activity && !activity.isFinishing) {
if (!activity.isFinishing) {
activity.finish()
}
}
......@@ -432,10 +432,10 @@ class ConsultAssistantDialogUtils private constructor() {
ffrom
)
}
if (null != activity && activity is ConsultAssistantCenterActivity && !activity.isFinishing) activity.finish()
if (activity is ConsultAssistantCenterActivity && !activity.isFinishing) activity.finish()
}, object : ThrowableConsumer() {
override fun accept(msg: String) {
if (null != activity && activity is ConsultAssistantCenterActivity && !activity.isFinishing) activity.finish()
if (activity is ConsultAssistantCenterActivity && !activity.isFinishing) activity.finish()
}
}
)
......
......@@ -53,7 +53,7 @@ object TempH5RouteUtils {
if (!TextUtils.isEmpty(host) && host == "h5") {
//如果是h5,跳转至NewH5Activity
try {
var params = URLDecoder.decode(linkUri.getQueryParameter("params"),"UTF-8")
val params = URLDecoder.decode(linkUri.getQueryParameter("params"),"UTF-8")
ARouter.getInstance().build("/new_h5/h5").withSerializable("routerParam", params).navigation()
return
}catch (e : NullPointerException){
......
package com.yidianling.consultant.presenter
import android.annotation.SuppressLint
import android.content.Context
import android.text.TextUtils
import com.google.gson.Gson
......@@ -8,11 +9,14 @@ import com.ydl.ydlcommon.mvp.base.BasePresenter
import com.ydl.ydlcommon.utils.RxLifecycleUtils
import com.ydl.ydlcommon.utils.YDLAsyncUtils
import com.ydl.ydlcommon.utils.YDLCacheUtils
import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.bean.HotSearchBean
import com.yidianling.consultant.contract.IHotSearchContract
import com.yidianling.consultant.model.HotSearchModelImpl
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Consumer
import io.reactivex.schedulers.Schedulers
/**
* @author yuanwai
* @描述:搜索页面逻辑实现类
......@@ -20,8 +24,7 @@ import io.reactivex.functions.Consumer
* @Company 壹点灵
* @date 2019/3/19
*/
class HotSearchPresenterImpl () :
BasePresenter<IHotSearchContract.View, IHotSearchContract.Model>(), IHotSearchContract.Presenter{
class HotSearchPresenterImpl : BasePresenter<IHotSearchContract.View, IHotSearchContract.Model>(), IHotSearchContract.Presenter{
/**
* 实例化数据模型
......@@ -57,6 +60,7 @@ class HotSearchPresenterImpl () :
/**
* 搜索页接口
*/
@SuppressLint("CheckResult")
override fun searchData() {
mModel.searchData().map { it }
.filter { it != null }
......@@ -71,4 +75,20 @@ class HotSearchPresenterImpl () :
}
})
}
@SuppressLint("CheckResult")
override fun getSearchWords(map:HashMap<String,Any>,searchContent:String,isClickWords:Boolean) {
mModel.getSearchWords(map)
// .debounce(500L, TimeUnit.MILLISECONDS)
.compose(RxLifecycleUtils.bindToLifecycle(mView))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer {
mView.getSearchWordsSuccess(it,searchContent,isClickWords)
}, object : ThrowableConsumer() {
override fun accept(msg: String) {
ToastUtil.toastShort(msg)
}
})
}
}
\ No newline at end of file
......@@ -4,47 +4,40 @@ import android.annotation.SuppressLint
import android.app.Activity
import android.content.Context
import android.graphics.drawable.BitmapDrawable
import android.os.Build
import androidx.core.content.ContextCompat
import android.text.*
import android.text.style.AbsoluteSizeSpan
import android.util.Log
import android.view.*
import android.view.KeyEvent
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.inputmethod.EditorInfo
import android.view.inputmethod.InputMethodManager
import android.widget.*
import com.bumptech.glide.Glide
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.RxImageTool
import com.yidianling.common.tools.RxKeyboardTool
import com.yidianling.consultant.R
import com.yidianling.consultant.constants.ConsultBIConstants
import com.yidianling.consultant.http.ExpertSearchDataManager
import com.yidianling.consultant.listener.OnFilterConfirmListener
import com.yidianling.consultant.model.bean.AllFilter
import com.yidianling.consultant.model.bean.Filters
import com.yidianling.consultant.model.bean.PriceRangesItem
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.CompositeDisposable
import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.consultant_item_filter.view.*
import kotlinx.android.synthetic.main.consultant_item_price_range.view.*
import kotlinx.android.synthetic.main.consultant_ui_filter_popup.view.*
import kotlin.math.roundToInt
/**
* 筛选弹窗
* Created by zqk on 17-9-15.
*/
class FilterPopupWindow(
private val context: Context,
private val filterData: Filters,
private val tempFilter: AllFilter
) : PopupWindow(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) {
class FilterPopupWindow(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()
......@@ -121,7 +114,7 @@ class FilterPopupWindow(
@SuppressLint("ClickableViewAccessibility")
private fun initKeyboardListener(view: View) {
var svFilter = view.findViewById<ScrollView>(R.id.sv_filter)
val svFilter = view.findViewById<ScrollView>(R.id.sv_filter)
val imm = context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
svFilter.setOnTouchListener { _, _ ->
......@@ -246,13 +239,6 @@ class FilterPopupWindow(
biEventParams = tempFilter.doctorEdu.map { it.value }.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()) {
sb.append("&others=").append(tempFilter.others.map { it.key }.joinToString(","))
if (ConsultBIConstants.POSITION_OTHER_CHOICE_CLICK == biEventName) {
......@@ -282,50 +268,49 @@ class FilterPopupWindow(
account += tempFilter.priceRanges?.maxPrice?.toDouble()!!
}
biEventParams = (Math.round(account / 2)).toString()
biEventParams = ((account / 2).roundToInt()).toString()
}
}
//用户行为数据埋点
biEvent(biEventName, biEventParams)
// sb.append("&page=").append(1)
ExpertSearchDataManager.getHttp().getFilterCount(sb.toString())
.subscribeOn(Schedulers.io())
.compose(RxUtils.resultJavaData())
.map { it }
.filter { it != null }
.observeOn(AndroidSchedulers.mainThread())
.subscribe({
contentView.btnConfirm.text = if (it > 0) "确定" else "暂无匹配咨询师"
//按钮置灰/解除置灰
contentView.btnConfirm.isEnabled = it > 0
if (it > 0) {
contentView.btnConfirm.setTextColor(
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))
} else {
contentView.btnConfirm.setTextColor(
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))
}
}, {
ToastHelper.show(it.message!!)
})
// ExpertSearchDataManager.getHttp().getFilterCount(sb.toString())
// .subscribeOn(Schedulers.io())
// .compose(RxUtils.resultJavaData())
// .map { it }
// .filter { true }
// .observeOn(AndroidSchedulers.mainThread())
// .subscribe({
//
// contentView.btnConfirm.text = if (it > 0) "确定" else "暂无匹配咨询师"
// //按钮置灰/解除置灰
// contentView.btnConfirm.isEnabled = it > 0
// if (it > 0) {
// contentView.btnConfirm.setTextColor(
// 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))
// } else {
// contentView.btnConfirm.setTextColor(
// 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))
// }
//
// }, {
// ToastHelper.show(it.message!!)
// })
}
private fun biEvent(biEventName: String, biEventParams: String = "") {
......@@ -465,7 +450,6 @@ class FilterPopupWindow(
textView.isSelected = true
textView.paint.isFakeBoldText = true
}
updateCount(ConsultBIConstants.POSITION_GOOD_AT_CLICK)
}
if (index>19){
......
......@@ -16,7 +16,7 @@ import kotlinx.android.synthetic.main.consultant_ui_sort_popup_window.view.*
* 排序弹窗
* Created by zqk on 17-9-15.
*/
class SortPopupWindow(val context: Context, private val sortItems: ArrayList<ReorderItem>, var selectedSort: ReorderItem, private val onSortItemSelectedListener: OnSortItemSelectedListener)
class SortPopupWindow(val context: Context, sortItems: ArrayList<ReorderItem>, var selectedSort: ReorderItem, onSortItemSelectedListener: OnSortItemSelectedListener)
: PopupWindow(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) {
private var adapter: SortRecyclerViewAdapter
......@@ -31,12 +31,7 @@ class SortPopupWindow(val context: Context, private val sortItems: ArrayList<Reo
val rvSortItem = view.rvSortItem
adapter = SortRecyclerViewAdapter(context, sortItems, selectedSort, onSortItemSelectedListener)
rvSortItem.adapter = adapter
rvSortItem.layoutManager =
LinearLayoutManager(
context,
LinearLayoutManager.VERTICAL,
false
)
rvSortItem.layoutManager = LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
// rvSortItem.addItemDecoration(DividerItemDecoration(context, LinearLayoutManager.VERTICAL))
}
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="8dp" />
<solid android:color="@color/platform_main_theme" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="8dp" />
<stroke
android:width="1dp"
android:color="@color/platform_color_EBEBEB" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="4dp" />
<stroke
android:width="0.5dp"
android:color="@color/platform_color_EBEBEB" />
<solid android:color="#f9f9f9" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_search_words"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="19dp"
android:paddingEnd="19dp"
android:visibility="gone"
>
<TextView
android:id="@+id/tv_search_related_word"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/platform_color_242424"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:textSize="15sp"
android:fontFamily="sans-serif"
android:layout_marginTop="14dp"
android:includeFontPadding="false"
tools:text="根据匹配,为您推荐恋爱情感相关词" />
<TextView
android:id="@+id/tv_search_tips"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/tv_search_word"
app:layout_constraintBottom_toBottomOf="@id/tv_search_word"
android:textSize="15sp"
android:textColor="@color/platform_color_666666"
android:fontFamily="sans-serif"
android:includeFontPadding="false"
android:text="仍搜索" />
<TextView
android:id="@+id/tv_search_word"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toEndOf="@id/tv_search_tips"
app:layout_constraintTop_toBottomOf="@id/tv_search_related_word"
android:layout_marginTop="9dp"
android:layout_marginStart="6dp"
android:textSize="14sp"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:textColor="@color/platform_color_242424"
android:includeFontPadding="false"
android:background="@drawable/consultant_stroke_ebebeb_solid_f9f9f9_r_4"
tools:text="恋爱情感"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:src="http://schemas.android.com/tools"
android:paddingTop="12dp"
android:paddingBottom="12dp">
<ImageView
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_centerVertical="true"
android:src="@drawable/consultant_icon_input_search"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="16dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
/>
<TextView
android:id="@+id/tv_search_words"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
src:text="李哈哈"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:textColor="@color/platform_color_242424"
android:layout_marginStart="38dp" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?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:paddingStart="10dp"
android:paddingTop="12dp"
android:orientation="vertical"
android:id="@+id/ll_sort_item"
>
<TextView
android:id="@+id/tv_sort_name"
android:layout_width="75dp"
android:layout_height="34dp"
android:gravity="center"
android:textColor="@color/consultant_color_search_filter_selector"
android:orientation="vertical"
android:background="@drawable/consultant_bg_search_filter_selector"
android:textSize="14sp"
tools:text="恋爱婚姻" />
</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:paddingStart="10dp"
android:paddingTop="12dp"
android:orientation="vertical"
android:id="@+id/ll_sort_item"
>
<TextView
android:id="@+id/tv_sort_name"
android:layout_width="wrap_content"
android:layout_height="34dp"
android:gravity="center"
android:textColor="@color/consultant_color_search_filter_selector"
android:orientation="vertical"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:background="@drawable/consultant_bg_search_filter_selector"
android:textSize="14sp"
tools:text="恋爱婚姻" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/tvSubjectName"
android:layout_width="match_parent"
android:layout_height="36dp"
android:gravity="center"
android:textColor="@color/consultant_color_search_filter_selector"
android:orientation="vertical"
android:background="@drawable/consultant_bg_search_filter_selector"
android:textSize="14dp"
tools:text="恋爱婚姻" />
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/tv_sort_name"
android:layout_width="match_parent"
android:layout_height="36dp"
android:gravity="center"
android:textColor="@color/consultant_color_search_filter_selector"
android:orientation="vertical"
android:background="@drawable/consultant_bg_search_filter_selector"
android:textSize="14dp"
tools:text="恋爱婚姻" />
......@@ -3,6 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
android:background="@color/platform_white"
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
......
......@@ -211,12 +211,11 @@
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:background="@drawable/consultant_bg_radius_5_dark"
android:gravity="center"
android:hint="暂无匹配咨询师"
android:textColor="@color/platform_but_text_color"
android:hint="确定"
android:textColor="@color/white"
android:textColorHint="@color/platform_color_E0E0E0"
android:textSize="16sp" />
</LinearLayout>
......
......@@ -290,9 +290,7 @@ open class HomeBaseImpl : IHomeBaseEvent {
return
}
EventBus.getDefault().post(
HomeModuleTabEvent(
2
)
HomeModuleTabEvent(2,"11")
)
ActionCountUtils.count(HomeBIConstants.YDL_USER_CONSULT_CLICK)
}
......
......@@ -75,7 +75,7 @@ interface IHomeBaseEvent {
fun categoryClick(category: HomeHeaderBean.AskCategoryDataBean)
/**
* 预约专家点击事件
* 心理咨询点击事件
*/
fun reservationExpertsClick()
......
......@@ -3,6 +3,12 @@ package com.yidianling.home.api.event;
public class HomeModuleTabEvent {
private int tabIndex;
public String sign; // 用于埋点参数
public HomeModuleTabEvent(int index,String sign) {
tabIndex = index;
this.sign =sign;
}
public HomeModuleTabEvent(int index) {
tabIndex = index;
......
......@@ -120,10 +120,10 @@ class YdlHomeAdapter(private val mContext: Context,
}
override fun getItemViewType(position: Int): Int {
if (position < list.size) {
return list[position].type!!
return if (position < list.size) {
list[position].type!!
} else {
return -1
-1
}
}
......
......@@ -151,10 +151,9 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
private fun initView() {
if (HomeViewConfig.getOrder().bannerIndex == null || HomeViewConfig.getOrder().bannerIndex == -1) {
var marginTop = this.resources.getDimension(R.dimen.home_home_title_bar_height)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {//4.4以下不支持状态栏变色
val statusBarHeight = StatusBarUtils.getStatusBarHeight(mActivity)
marginTop += statusBarHeight
}
//4.4以下不支持状态栏变色
val statusBarHeight = StatusBarUtils.getStatusBarHeight(mActivity)
marginTop += statusBarHeight
val lp = home_swipe_refresh_layout.layoutParams as FrameLayout.LayoutParams
lp.topMargin = marginTop.toInt()
home_swipe_refresh_layout.layoutParams = lp
......@@ -185,17 +184,16 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
* 初始化状态栏位置
*/
private fun initStatus() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {//4.4以下不支持状态栏变色
val statusBarHeight = StatusBarUtils.getStatusBarHeight(mActivity)
var homeTitleBarHeight = resources.getDimension(R.dimen.home_home_title_bar_height)
val lp1 = view_rl_top_bg.layoutParams as RelativeLayout.LayoutParams
lp1.height = (homeTitleBarHeight + statusBarHeight).toInt()
view_rl_top_bg.layoutParams = lp1
//4.4以下不支持状态栏变色
val statusBarHeight = StatusBarUtils.getStatusBarHeight(mActivity)
val homeTitleBarHeight = resources.getDimension(R.dimen.home_home_title_bar_height)
val lp1 = view_rl_top_bg.layoutParams as RelativeLayout.LayoutParams
lp1.height = (homeTitleBarHeight + statusBarHeight).toInt()
view_rl_top_bg.layoutParams = lp1
val lp2 = rl_top.layoutParams as RelativeLayout.LayoutParams
lp2.topMargin = statusBarHeight
rl_top.layoutParams = lp2
}
val lp2 = rl_top.layoutParams as RelativeLayout.LayoutParams
lp2.topMargin = statusBarHeight
rl_top.layoutParams = lp2
}
override fun initDataAndEventLazy() {
......@@ -303,7 +301,7 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
val act = homeHeaderBean.activityResponse
if (act != null) {
if (!TextUtils.isEmpty(act!!.imageUrl)) {
if (!TextUtils.isEmpty(act.imageUrl)) {
img_ad.visibility = View.VISIBLE
ActionCountUtils.count(HomeBIConstants.YDL_HOME_SEARCH_TAG,act.title?:"1")
......
......@@ -68,9 +68,9 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
*/
private fun initButtonView() {
if (null == buttonParams) {
var screenWidth = RxDeviceTool.getScreenWidth(mContext)
var viewWidth = ((screenWidth - 2 * 9 * RxDeviceTool.getScreenDensity(mContext)) / 4).toInt()
var viewHeight = viewWidth * 78 / 80
val screenWidth = RxDeviceTool.getScreenWidth(mContext)
val viewWidth = ((screenWidth - 2 * 9 * RxDeviceTool.getScreenDensity(mContext)) / 4).toInt()
val viewHeight = viewWidth * 78 / 80
buttonParams = LinearLayout.LayoutParams(viewWidth, viewHeight)
buttonParamsFrame = FrameLayout.LayoutParams(viewWidth, viewHeight)
buttonParamsFrame2= FrameLayout.LayoutParams((viewWidth/2.0).toInt(), (viewHeight/2.3).toInt())
......
......@@ -2,9 +2,12 @@ package com.ydl.ydlnet.builder.interceptor.log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import android.text.TextUtils;
import com.ydl.ydlnet.utils.CharacterHandler;
import com.ydl.ydlnet.utils.NetLogUtils;
import okhttp3.MediaType;
import okhttp3.Request;
......@@ -48,17 +51,17 @@ public class DefaultFormatPrinter {
* @param request
* @param bodyString
*/
public void printJsonRequest(@NonNull Request request, @NonNull String bodyString) {
final String requestBody = LINE_SEPARATOR + BODY_TAG + LINE_SEPARATOR + bodyString;
final String tag = getTag(true);
if (!request.url().toString().contains("writeMaiDianData")){
NetLogUtils.debugInfo(tag, REQUEST_UP_LINE);
logLines(tag, new String[]{URL_TAG + request.url()}, false);
logLines(tag, getRequest(request), true);
logLines(tag, requestBody.split(LINE_SEPARATOR), true);
NetLogUtils.debugInfo(tag, END_LINE);
}
// if (!request.url().toString().contains("writeMaiDianData")){
NetLogUtils.debugInfo(tag, REQUEST_UP_LINE);
logLines(tag, new String[]{URL_TAG + request.url()}, false);
logLines(tag, getRequest(request), true);
logLines(tag, requestBody.split(LINE_SEPARATOR), true);
NetLogUtils.debugInfo(tag, END_LINE);
// }
}
......@@ -67,16 +70,16 @@ public class DefaultFormatPrinter {
*
* @param request
*/
public void printFileRequest(@NonNull Request request) {
final String tag = getTag(true);
if (!request.url().toString().contains("writeMaiDianData")){
NetLogUtils.debugInfo(tag, REQUEST_UP_LINE);
logLines(tag, new String[]{URL_TAG + request.url()}, false);
logLines(tag, getRequest(request), true);
logLines(tag, OMITTED_REQUEST, true);
NetLogUtils.debugInfo(tag, END_LINE);
}
// if (!request.url().toString().contains("writeMaiDianData")){
NetLogUtils.debugInfo(tag, REQUEST_UP_LINE);
logLines(tag, new String[]{URL_TAG + request.url()}, false);
logLines(tag, getRequest(request), true);
logLines(tag, OMITTED_REQUEST, true);
NetLogUtils.debugInfo(tag, END_LINE);
// }
}
......@@ -93,7 +96,7 @@ public class DefaultFormatPrinter {
* @param message 响应信息
* @param responseUrl 请求地址
*/
public void printJsonResponse(long chainMs, boolean isSuccessful, int code, @NonNull String headers, @Nullable MediaType contentType,
@Nullable String bodyString, @NonNull List<String> segments, @NonNull String message, @NonNull final String responseUrl) {
bodyString = RequestLogInterceptor.isJson(contentType) ? CharacterHandler.jsonFormat(bodyString)
......@@ -102,13 +105,13 @@ public class DefaultFormatPrinter {
final String responseBody = LINE_SEPARATOR + BODY_TAG + LINE_SEPARATOR + bodyString;
final String tag = getTag(false);
final String[] urlLine = {URL_TAG + responseUrl, N};
if (!responseUrl.contains("writeMaiDianData")){
// if (!responseUrl.contains("writeMaiDianData")) {
NetLogUtils.debugInfo(tag, RESPONSE_UP_LINE);
logLines(tag, urlLine, true);
logLines(tag, getResponse(headers, chainMs, code, isSuccessful, segments, message), true);
logLines(tag, responseBody.split(LINE_SEPARATOR), true);
NetLogUtils.debugInfo(tag, END_LINE);
}
// }
}
/**
......@@ -122,18 +125,18 @@ public class DefaultFormatPrinter {
* @param message 响应信息
* @param responseUrl 请求地址
*/
public void printFileResponse(long chainMs, boolean isSuccessful, int code, @NonNull String headers,
@NonNull List<String> segments, @NonNull String message, @NonNull final String responseUrl) {
final String tag = getTag(false);
final String[] urlLine = {URL_TAG + responseUrl, N};
if (!responseUrl.contains("writeMaiDianData")){
// if (!responseUrl.contains("writeMaiDianData")) {
NetLogUtils.debugInfo(tag, RESPONSE_UP_LINE);
logLines(tag, urlLine, true);
logLines(tag, getResponse(headers, chainMs, code, isSuccessful, segments, message), true);
logLines(tag, OMITTED_RESPONSE, true);
NetLogUtils.debugInfo(tag, END_LINE);
}
// }
}
/**
......@@ -157,7 +160,7 @@ public class DefaultFormatPrinter {
}
private static ThreadLocal<Integer> last = new ThreadLocal<Integer>() {
protected Integer initialValue() {
return 0;
}
......
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