Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
1d79f603
Commit
1d79f603
authored
Jun 01, 2022
by
upwork.021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 代码提交
parent
0f00af89
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
397 additions
and
113 deletions
+397
-113
config.gradle
config.gradle
+5
-5
ExpertSearchActivity.kt
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchActivity.kt
+0
-0
ExpertSearchFragment.kt
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchFragment.kt
+18
-15
ExpertSearchPresenter.kt
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchPresenter.kt
+24
-10
HotSearchActivity.kt
m-consultant/src/main/java/com/yidianling/consultant/HotSearchActivity.kt
+71
-41
SearchWordsAdapter.kt
m-consultant/src/main/java/com/yidianling/consultant/adapter/SearchWordsAdapter.kt
+41
-0
SearchWordsBean.kt
m-consultant/src/main/java/com/yidianling/consultant/bean/SearchWordsBean.kt
+19
-0
ConsultBIConstants.kt
m-consultant/src/main/java/com/yidianling/consultant/constants/ConsultBIConstants.kt
+1
-0
IHotSearchContract.kt
m-consultant/src/main/java/com/yidianling/consultant/contract/IHotSearchContract.kt
+17
-0
IExpertSearchHttp.kt
m-consultant/src/main/java/com/yidianling/consultant/http/IExpertSearchHttp.kt
+6
-0
HotSearchHttpImpl.kt
m-consultant/src/main/java/com/yidianling/consultant/http/hotsearch/HotSearchHttpImpl.kt
+6
-0
IHotSearchHttp.kt
m-consultant/src/main/java/com/yidianling/consultant/http/hotsearch/IHotSearchHttp.kt
+8
-1
HotSearchModelImpl.kt
m-consultant/src/main/java/com/yidianling/consultant/model/HotSearchModelImpl.kt
+6
-0
SearchApi.kt
m-consultant/src/main/java/com/yidianling/consultant/model/SearchApi.kt
+8
-5
ExpertServiceItem.kt
m-consultant/src/main/java/com/yidianling/consultant/model/bean/ExpertServiceItem.kt
+2
-2
HotSearchPresenterImpl.kt
m-consultant/src/main/java/com/yidianling/consultant/presenter/HotSearchPresenterImpl.kt
+24
-2
CategoryPopupWindow.kt
m-consultant/src/main/java/com/yidianling/consultant/ui/view/CategoryPopupWindow.kt
+11
-0
FilterPopupWindow.kt
m-consultant/src/main/java/com/yidianling/consultant/ui/view/FilterPopupWindow.kt
+0
-8
consultant_stroke_ebebeb_solid_f9f9f9_r_4.xml
m-consultant/src/main/res/drawable/consultant_stroke_ebebeb_solid_f9f9f9_r_4.xml
+11
-0
consultant_activity_hot_search.xml
m-consultant/src/main/res/layout/consultant_activity_hot_search.xml
+0
-0
consultant_item_search_words.xml
m-consultant/src/main/res/layout/consultant_item_search_words.xml
+33
-0
consultant_layout_search_content.xml
m-consultant/src/main/res/layout/consultant_layout_search_content.xml
+60
-0
HomeBaseImpl.kt
m-home/src/main/java/com/yidianling/home/event/HomeBaseImpl.kt
+0
-1
DefaultFormatPrinter.java
ydl-net/src/main/java/com/ydl/ydlnet/builder/interceptor/log/DefaultFormatPrinter.java
+26
-23
No files found.
config.gradle
View file @
1d79f603
...
...
@@ -6,10 +6,10 @@ ext {
// -------------- 业务模块 --------------
//第三步 若干
"m-confide"
:
"0.0.49.72"
,
"m-consultant"
:
"0.0.60.3
1
"
,
"m-consultant"
:
"0.0.60.3
9
"
,
"m-fm"
:
"0.0.30.08"
,
"m-user"
:
"0.0.62.04"
,
"m-home"
:
"0.0.23.
44
"
,
"m-home"
:
"0.0.23.
80
"
,
"m-im"
:
"0.0.21.33"
,
"m-dynamic"
:
"0.0.7.37"
,
"m-article"
:
"0.0.0.10"
,
...
...
@@ -35,7 +35,7 @@ ext {
//mdt 组件
"ydl-tuicore"
:
"0.0.22"
,
//第一步
"ydl-platform"
:
"0.0.4
0.97
"
,
"ydl-platform"
:
"0.0.4
1.25
"
,
//第二步 若干
"ydl-webview"
:
"0.0.38.62"
,
...
...
@@ -46,7 +46,7 @@ ext {
//以下 几乎不会动
"router"
:
"0.0.1"
,
"ydl-net"
:
"0.0.3.9
3
"
,
"ydl-net"
:
"0.0.3.9
4
"
,
"ydl-utils"
:
"0.0.3.3"
,
]
ydl_app
=
[
...
...
@@ -130,7 +130,7 @@ ext {
//以下 几乎不会动
"router"
:
"0.0.1"
,
"ydl-net"
:
"0.0.3.9
3
"
,
"ydl-net"
:
"0.0.3.9
4
"
,
"ydl-utils"
:
"0.0.3.3"
,
]
...
...
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchActivity.kt
View file @
1d79f603
This diff is collapsed.
Click to expand it.
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchFragment.kt
View file @
1d79f603
...
...
@@ -69,6 +69,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
private
lateinit
var
mActivity
:
FragmentActivity
var
startTime
=
0L
var
endTime
=
0L
private
var
mIdssign1
:
String
=
""
// 列表埋点咨询师列表id拼接参数
override
fun
layoutResId
():
Int
{
return
R
.
layout
.
consultant_activity_expert_search_list
...
...
@@ -435,7 +436,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
}
filterLabelSet
()
//开始筛选数据
//
refresh()
refresh
()
}
view
.
addView
(
textView
)
}
...
...
@@ -753,8 +754,8 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
srlContainer
.
isRefreshing
=
false
// 埋点
val
sign1
=
data
.
map
{
it
.
id
}.
joinToString
{
"|"
}
ActionCountUtils
.
baiDuCountSign3
(
ConsultBIConstants
.
PART_ID_CONSULT_COUNSELOR_LIST_PAGE
,
ConsultBIConstants
.
POSITION_CONSULT_COUNSELOR_LIST_PAGE_VISIT
,
sign1
,
sign2
,
"app"
)
mIdssign1
=
data
.
joinToString
(
","
){
it
.
id
}
ActionCountUtils
.
baiDuCountSign3
(
ConsultBIConstants
.
PART_ID_CONSULT_COUNSELOR_LIST_PAGE
,
ConsultBIConstants
.
POSITION_CONSULT_COUNSELOR_LIST_PAGE_VISIT
,
mIds
sign1
,
sign2
,
"app"
)
}
override
fun
fetchListFailed
(
msg
:
String
?)
{
...
...
@@ -936,15 +937,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
//筛选确认回调
override
fun
onFilterConfirmed
()
{
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
(
","
)
)
props1
.
put
(
"filtrate_second"
,
tempFilter
.
showType
.
value
+
","
...
...
@@ -955,6 +948,12 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
)
BuryPointUtils
.
buryPoint
(
"Filtrate"
,
props1
)
// 埋点
if
(
tempFilter
.
specialityCrowd
.
size
>
0
){
val
sign1
=
tempFilter
.
specialityCrowd
.
joinToString
(
","
){
it
.
value
!!
}
ActionCountUtils
.
baiDuCountSign3
(
ConsultBIConstants
.
PART_ID_CONSULT_FILTER_PAGE
,
ConsultBIConstants
.
ConsultEvent
.
POSITION_GOODAT_CROWD_CLICK
,
sign1
,
"app"
,
""
)
}
allFilter
.
showType
=
tempFilter
.
showType
allFilter
.
enquiries
.
clear
()
...
...
@@ -1295,16 +1294,16 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
*/
override
fun
onCategoriesSelected
(
signLit
:
ArrayList
<
String
>)
{
if
(
signLit
.
isNotEmpty
()){
val
sign1
=
signLit
.
map
{
it
}.
joinToString
{
","
}
val
sign1
=
signLit
.
joinToString
(
","
){
it
}
ActionCountUtils
.
baiDuCountSign3
(
ConsultBIConstants
.
PART_ID_CONSULT_COUNSELOR_LIST_PAGE
,
ConsultBIConstants
.
ConsultEvent
.
POSITION_TWO_CATEGORY_CLICK
,
sign1
,
"app"
,
""
)
}
if
(
allFilter
.
categoryId2List
.
size
>
0
||
allFilter
.
categoryId3List
.
size
>
0
){
updateFilterTextViewStatus
(
tvSubject
,
FILTER_STATUS_FILTERED
)
refresh
()
}
else
{
updateFilterTextViewStatus
(
tvSubject
,
FILTER_STATUS_NORMAL
)
}
refresh
()
}
override
fun
onRefresh
()
{
...
...
@@ -1319,8 +1318,12 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
*/
private
var
sign2
=
""
fun
onEvent
(
event
:
HomeModuleTabEvent
)
{
if
(!
TextUtils
.
isEmpty
(
event
.
sign
)){
if
(!
TextUtils
.
isEmpty
(
event
.
sign
)){
sign2
=
event
.
sign
// 埋点
if
(!
TextUtils
.
isEmpty
(
mIdssign1
)){
ActionCountUtils
.
baiDuCountSign3
(
ConsultBIConstants
.
PART_ID_CONSULT_COUNSELOR_LIST_PAGE
,
ConsultBIConstants
.
POSITION_CONSULT_COUNSELOR_LIST_PAGE_VISIT
,
mIdssign1
,
sign2
,
"app"
)
}
}
}
...
...
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchPresenter.kt
View file @
1d79f603
...
...
@@ -10,6 +10,7 @@ import com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.mvp.base.SimplePresenter
import
com.ydl.ydlcommon.utils.RxLifecycleUtils
import
com.ydl.ydlcommon.utils.remind.HttpErrorUtils
import
com.yidianling.common.tools.LogUtil
import
com.yidianling.common.tools.RxAppTool
import
com.yidianling.consultant.http.ExpertSearchDataManager
import
com.yidianling.consultant.model.SearchApi
...
...
@@ -47,7 +48,7 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
@SuppressLint
(
"CheckResult"
)
fun
fetchListData
(
allFilter
:
AllFilter
,
extras
:
Extras
?)
{
//是否亲子教育字段
ConsultAssistantDialogUtils
.
REALATION_EDUCATION
=
allFilter
.
categories
.
size
==
1
&&
allFilter
.
categories
[
0
].
cateId
==
"23"
//
ConsultAssistantDialogUtils.REALATION_EDUCATION = allFilter.categories.size == 1 && allFilter.categories[0].cateId == "23"
val
map
=
HashMap
<
String
,
Any
>()
// filter
...
...
@@ -58,15 +59,15 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
}
val
categoryList
=
ArrayList
<
Any
>()
// 八大类一级标签
if
(
allFilter
.
categoryId2List
.
isNotEmpty
()
){
if
(
allFilter
.
categoryId2List
.
size
>
0
){
val
categoryMap2
=
HashMap
<
String
,
Any
>()
val
categoryIdMap2
=
HashMap
<
String
,
Any
>()
categoryIdMap2
[
"in"
]
=
allFilter
.
categoryId2List
categoryMap2
[
"product_cates.category_id
3
"
]
=
categoryIdMap2
categoryMap2
[
"product_cates.category_id
2
"
]
=
categoryIdMap2
categoryList
.
add
(
categoryMap2
)
}
// 八大类二级标签
if
(
allFilter
.
categoryId3List
.
isNotEmpty
()
){
if
(
allFilter
.
categoryId3List
.
size
>
0
){
val
categoryMap3
=
HashMap
<
String
,
Any
>()
val
categoryIdMap3
=
HashMap
<
String
,
Any
>()
categoryIdMap3
[
"in"
]
=
allFilter
.
categoryId3List
...
...
@@ -77,7 +78,7 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
filterMap
[
"__or"
]
=
categoryList
}
// 主题
if
(
allFilter
.
categories
.
isNotEmpty
()
)
{
if
(
allFilter
.
categories
.
size
>
0
)
{
val
categories
=
ArrayList
<
String
?>()
allFilter
.
categories
.
forEach
{
categories
.
add
(
it
.
cateId
)
...
...
@@ -157,18 +158,31 @@ class ExpertSearchPresenter : SimplePresenter<IExpertSearchView>() {
// 其它
if
(
allFilter
.
others
.
isNotEmpty
())
{
val
gender
=
ArrayList
<
String
?>()
val
bookIngStatusList
=
ArrayList
<
String
>()
allFilter
.
others
.
forEach
{
if
(
it
.
key1
==
"gender"
){
gender
.
add
(
it
.
value1
)
}
else
{
filterMap
[
it
.
key1
]
=
it
.
value1
when
(
it
.
key1
)
{
"gender"
->
{
gender
.
add
(
it
.
value1
)
}
"booking_status"
->
{
bookIngStatusList
.
add
(
"1"
)
bookIngStatusList
.
add
(
"2"
)
}
else
->
{
filterMap
[
it
.
key1
]
=
it
.
value1
}
}
}
val
genderMap
=
HashMap
<
String
,
Any
>()
if
(
gender
.
size
>
0
){
val
genderMap
=
HashMap
<
String
,
Any
>()
genderMap
[
"in"
]
=
gender
filterMap
[
"gender"
]
=
genderMap
}
if
(
bookIngStatusList
.
size
>
0
){
val
bookStatusMap
=
HashMap
<
String
,
Any
>()
bookStatusMap
[
"in"
]
=
bookIngStatusList
filterMap
[
"booking_status"
]
=
bookStatusMap
}
}
map
[
"filter"
]
=
filterMap
...
...
m-consultant/src/main/java/com/yidianling/consultant/HotSearchActivity.kt
View file @
1d79f603
...
...
@@ -11,43 +11,42 @@ import android.view.WindowManager
import
android.view.inputmethod.EditorInfo
import
android.view.inputmethod.InputMethodManager
import
android.widget.TextView
import
androidx.recyclerview.widget.LinearLayoutManager
import
com.alibaba.android.arouter.facade.annotation.Route
import
com.google.gson.Gson
import
com.google.gson.reflect.TypeToken
import
com.ydl.ydl_image.config.ISimpleImageOpConfig
import
com.ydl.ydl_image.config.SimpleImageOpConfiger
import
com.ydl.ydl_image.manager.YDLImageCacheManager
import
com.ydl.ydl_image.module.GlideApp
import
com.ydl.ydl_router.manager.YDLRouterParams
import
com.ydl.ydlcommon.base.BaseMvpActivity
import
com.ydl.ydlcommon.bean.StatusBarOptions
import
com.ydl.ydlcommon.data.http.RxUtils
import
com.ydl.ydlcommon.data.http.ThrowableConsumer
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.router.IYDLRouterConstant
import
com.ydl.ydlcommon.utils.FixSizeLinkedList
import
com.ydl.ydlcommon.utils.LogUtil
import
com.ydl.ydlcommon.utils.SharedPreferencesEditor
import
com.ydl.ydlcommon.utils.StatusBarUtils
import
com.ydl.ydlcommon.utils.*
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.ydl.ydlcommon.view.banner.GlideImageLoader
import
com.yidianling.common.tools.RxDeviceTool
import
com.yidianling.common.tools.RxImageTool
import
com.yidianling.consultant.adapter.SearchWordsAdapter
import
com.yidianling.consultant.api.IConsultantService
import
com.yidianling.consultant.bean.HotSearchBean
import
com.yidianling.consultant.bean.HotSearchFocusItemBean
import
com.yidianling.consultant.bean.HotSearchKeyWordDataBean
import
com.yidianling.consultant.bean.HotSearchPopularDoctorBean
import
com.yidianling.consultant.bean.*
import
com.yidianling.consultant.constants.ConsultBIConstants
import
com.yidianling.consultant.contract.IHotSearchContract
import
com.yidianling.consultant.http.ExpertSearchDataManager
import
com.yidianling.consultant.modular.utils.ConsultAssistantEntryUtils
import
com.yidianling.consultant.modular.utils.TempH5RouteUtils
import
com.yidianling.consultant.presenter.HotSearchPresenterImpl
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.schedulers.Schedulers
import
kotlinx.android.synthetic.main.consultant_activity_hot_search.*
import
kotlinx.android.synthetic.main.consultant_item_expert_hot_search.view.*
@Route
(
path
=
"/consult/hot_search"
)
class
HotSearchActivity
:
BaseMvpActivity
<
IHotSearchContract
.
View
,
IHotSearchContract
.
Presenter
>(),
IHotSearchContract
.
View
{
class
HotSearchActivity
:
BaseMvpActivity
<
IHotSearchContract
.
View
,
IHotSearchContract
.
Presenter
>(),
IHotSearchContract
.
View
{
private
lateinit
var
searchWordsAdapter
:
SearchWordsAdapter
private
val
searchSuggestList
:
ArrayList
<
SearchSuggestListBean
>
=
ArrayList
()
private
var
mSearchContent
:
String
=
""
private
val
CACHE_CONSULT_SEARCH_HISTORY_DATA
=
"cache_consult_search_history_data"
private
val
HOT_SEARCH_DOCTOR_NAME
=
"hot_search_doctor_name"
private
var
historyList
:
FixSizeLinkedList
<
String
>
=
FixSizeLinkedList
(
15
)
...
...
@@ -84,7 +83,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
}
private
fun
getDataFromIntent
()
{
va
r
doctorName
=
intent
.
getStringExtra
(
HOT_SEARCH_DOCTOR_NAME
)
va
l
doctorName
=
intent
.
getStringExtra
(
HOT_SEARCH_DOCTOR_NAME
)
if
(!
TextUtils
.
isEmpty
(
doctorName
))
{
etSearch
.
setText
(
doctorName
)
iv_delete_icon
.
visibility
=
View
.
VISIBLE
...
...
@@ -92,6 +91,10 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
}
private
fun
initViews
()
{
StatusBarUtils
.
statusBarLightMode
(
this
)
maxWidth
=
(
2
*
RxDeviceTool
.
getScreenWidth
(
this
@HotSearchActivity
))
-
RxImageTool
.
dip2px
(
60f
)
dp42
=
RxImageTool
.
dip2px
(
60f
)
iv_delete_icon
.
setOnClickListener
{
etSearch
.
setText
(
""
)
}
...
...
@@ -101,12 +104,6 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
}
true
}
etSearch
.
setOnEditorActionListener
{
_
,
actionId
,
_
->
if
(
actionId
==
EditorInfo
.
IME_ACTION_SEARCH
)
{
doSearch
()
}
true
}
tv_search_cancle
.
setOnClickListener
{
finish
()
}
...
...
@@ -126,18 +123,27 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
iv_daoyi_image
.
setOnClickListener
{
LogUtil
.
e
(
"跳转导医:location=${data?.get(0)!!.location},title=${data[0].title}"
)
ConsultAssistantEntryUtils
.
jumpConsultAssistant
(
this
,
data
?.
get
(
0
)
!!
.
location
.
toInt
(),
"learning"
)
ConsultAssistantEntryUtils
.
jumpConsultAssistant
(
this
,
data
[
0
]
.
location
.
toInt
(),
"learning"
)
}
}
searchWordsAdapter
=
SearchWordsAdapter
(
searchSuggestList
)
rv_search_words
.
layoutManager
=
LinearLayoutManager
(
this
)
rv_search_words
.
adapter
=
searchWordsAdapter
searchWordsAdapter
.
setOnItemClickListener
{
adapter
,
view
,
position
->
}
etSearch
.
addTextChangedListener
(
object
:
TextWatcher
{
override
fun
afterTextChanged
(
s
:
Editable
?)
{
if
(
TextUtils
.
isEmpty
(
s
))
{
iv_delete_icon
.
visibility
=
View
.
INVISIBLE
rv_search_words
.
visibility
=
View
.
GONE
getSearchWords
(
""
)
}
else
{
iv_delete_icon
.
visibility
=
View
.
VISIBLE
getSearchWords
(
s
.
toString
())
}
}
override
fun
beforeTextChanged
(
s
:
CharSequence
?,
start
:
Int
,
count
:
Int
,
after
:
Int
)
{}
...
...
@@ -147,10 +153,31 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
}
})
StatusBarUtils
.
statusBarLightMode
(
this
)
maxWidth
=
(
2
*
RxDeviceTool
.
getScreenWidth
(
this
@HotSearchActivity
))
-
RxImageTool
.
dip2px
(
60f
)
dp42
=
RxImageTool
.
dip2px
(
60f
)
}
/**
* 获取搜索联想词
*/
private
fun
getSearchWords
(
searchContent
:
String
){
if
(!
TextUtils
.
isEmpty
(
searchContent
)){
mSearchContent
=
searchContent
val
map
=
HashMap
<
String
,
Any
>()
map
[
"content"
]
=
searchContent
mPresenter
.
getSearchWords
(
map
)
}
else
{
rv_search_words
.
visibility
=
View
.
GONE
}
}
override
fun
getSearchWordsSuccess
(
searchWordsBean
:
SearchWordsBean
)
{
searchSuggestList
.
clear
()
if
(!
searchWordsBean
.
search_suggests
.
isNullOrEmpty
()){
rv_search_words
.
visibility
=
View
.
VISIBLE
searchSuggestList
.
addAll
(
searchWordsBean
.
search_suggests
)
searchWordsAdapter
.
notifyDataAndSetSearchWord
(
mSearchContent
)
}
else
{
rv_search_words
.
visibility
=
View
.
GONE
}
}
private
fun
initData
()
{
...
...
@@ -179,6 +206,7 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
refreshBanner
(
null
)
}
//刷新 热门搜索
private
fun
refreshHotSearchData
(
keywordData
:
MutableList
<
HotSearchKeyWordDataBean
>?)
{
if
(
null
==
keywordData
||
keywordData
.
isEmpty
())
{
...
...
@@ -308,32 +336,34 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
return
rect
.
width
()
//文字宽
}
//执行搜索
/**
* 搜索
*/
private
fun
doSearch
()
{
val
view
=
this
.
currentFocus
if
(
view
!=
null
)
{
val
imm
=
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
)
as
InputMethodManager
imm
.
hideSoftInputFromWindow
(
view
.
windowToken
,
0
)
}
val
keyWord
=
etSearch
.
text
.
toString
()
// if (TextUtils.isEmpty(keyWord.trim())) {
// ToastUtil.toastShort("请输入搜索内容")
// return
// }
ActionCountUtils
.
count
(
ConsultBIConstants
.
UserMainEvent
.
YDL_USER_SEARCH_CLICK
,
keyWord
)
if
(!
TextUtils
.
isEmpty
(
keyWord
))
{
historyList
.
remove
(
keyWord
)
historyList
.
add
(
keyWord
)
val
searchWords
=
etSearch
.
text
.
toString
()
ActionCountUtils
.
count
(
ConsultBIConstants
.
UserMainEvent
.
YDL_USER_SEARCH_CLICK
,
searchWords
)
if
(!
TextUtils
.
isEmpty
(
searchWords
))
{
historyList
.
remove
(
searchWords
)
historyList
.
add
(
searchWords
)
SharedPreferencesEditor
.
putString
(
CACHE_CONSULT_SEARCH_HISTORY_DATA
,
Gson
().
toJson
(
historyList
)
)
}
ExpertSearchActivity
.
startSearch
(
this
,
keyWord
,
"14"
)
this
.
finish
()
// 搜索的关联词
var
relatedWords
=
""
if
(
searchSuggestList
.
isNotEmpty
()){
searchSuggestList
[
0
].
suggest_relations
?.
let
{
relatedWords
=
it
[
0
]
}
}
ExpertSearchActivity
.
startSearch
(
this
,
searchWords
,
"14"
,
relatedWords
)
finish
()
}
override
fun
onDestroy
()
{
...
...
m-consultant/src/main/java/com/yidianling/consultant/adapter/SearchWordsAdapter.kt
0 → 100644
View file @
1d79f603
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
m-consultant/src/main/java/com/yidianling/consultant/bean/SearchWordsBean.kt
0 → 100644
View file @
1d79f603
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
m-consultant/src/main/java/com/yidianling/consultant/constants/ConsultBIConstants.kt
View file @
1d79f603
...
...
@@ -56,6 +56,7 @@ class ConsultBIConstants {
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
{
...
...
m-consultant/src/main/java/com/yidianling/consultant/contract/IHotSearchContract.kt
View file @
1d79f603
...
...
@@ -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
)
}
interface
Presenter
:
IPresenter
<
View
>
{
...
...
@@ -38,6 +44,11 @@ class IHotSearchContract {
* 搜索页接口请求
*/
fun
searchData
()
/**
* 获取联想词
*/
fun
getSearchWords
(
map
:
HashMap
<
String
,
Any
>)
}
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
m-consultant/src/main/java/com/yidianling/consultant/http/IExpertSearchHttp.kt
View file @
1d79f603
...
...
@@ -2,6 +2,7 @@ package com.yidianling.consultant.http
import
com.ydl.ydlcommon.data.http.BaseAPIResponse
import
com.yidianling.consultant.bean.ExpertSearchTopShowBean
import
com.yidianling.consultant.bean.SearchWordsBean
import
com.yidianling.consultant.model.bean.ExpertBean
import
io.reactivex.Observable
...
...
@@ -19,6 +20,11 @@ interface IExpertSearchHttp{
// 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
>>
...
...
m-consultant/src/main/java/com/yidianling/consultant/http/hotsearch/HotSearchHttpImpl.kt
View file @
1d79f603
...
...
@@ -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
m-consultant/src/main/java/com/yidianling/consultant/http/hotsearch/IHotSearchHttp.kt
View file @
1d79f603
...
...
@@ -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
m-consultant/src/main/java/com/yidianling/consultant/model/HotSearchModelImpl.kt
View file @
1d79f603
...
...
@@ -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
m-consultant/src/main/java/com/yidianling/consultant/model/SearchApi.kt
View file @
1d79f603
...
...
@@ -9,6 +9,7 @@ import com.ydl.ydlnet.YDLHttpUtils
import
com.yidianling.consultant.bean.ExpertSearchTopShowBean
import
com.yidianling.consultant.bean.GuideBean
import
com.yidianling.consultant.bean.HotSearchBean
import
com.yidianling.consultant.bean.SearchWordsBean
import
com.yidianling.consultant.model.bean.ExpertBean
import
com.yidianling.consultant.model.bean.HeadData
import
io.reactivex.Observable
...
...
@@ -42,11 +43,6 @@ interface SearchApi {
@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>>
/**
* 新咨询师列表接口(包含搜索、筛选咨询师)
...
...
@@ -55,6 +51,13 @@ interface SearchApi {
@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"
)
...
...
m-consultant/src/main/java/com/yidianling/consultant/model/bean/ExpertServiceItem.kt
View file @
1d79f603
...
...
@@ -14,7 +14,7 @@ data class ExpertServiceItem(
/**
* 专家ID
*/
val
id
:
String
?
,
val
id
:
String
,
/**
* 专家uid
*/
...
...
@@ -135,7 +135,7 @@ data class ExpertServiceItem(
)
data class
FeatureTag
(
val
tag_id
:
Int
,
val
tag_id
:
String
,
val
tag_name
:
String
,
val
is_highlight
:
Boolean
,
// 是否高亮
val
type
:
String
// 标签类型
...
...
m-consultant/src/main/java/com/yidianling/consultant/presenter/HotSearchPresenterImpl.kt
View file @
1d79f603
package
com.yidianling.consultant.presenter
import
android.annotation.SuppressLint
import
android.content.Context
import
android.text.TextUtils
import
com.google.gson.Gson
import
com.ydl.ydlcommon.data.http.RxUtils
import
com.ydl.ydlcommon.data.http.ThrowableConsumer
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
import
java.util.concurrent.TimeUnit
/**
* @author yuanwai
* @描述:搜索页面逻辑实现类
...
...
@@ -20,8 +26,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
{
/**
* 实例化数据模型
...
...
@@ -71,4 +76,20 @@ class HotSearchPresenterImpl () :
}
})
}
@SuppressLint
(
"CheckResult"
)
override
fun
getSearchWords
(
map
:
HashMap
<
String
,
Any
>)
{
mModel
.
getSearchWords
(
map
)
.
debounce
(
500L
,
TimeUnit
.
MILLISECONDS
)
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mView
))
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
Consumer
{
mView
.
getSearchWordsSuccess
(
it
)
},
object
:
ThrowableConsumer
()
{
override
fun
accept
(
msg
:
String
)
{
ToastUtil
.
toastShort
(
msg
)
}
})
}
}
\ No newline at end of file
m-consultant/src/main/java/com/yidianling/consultant/ui/view/CategoryPopupWindow.kt
View file @
1d79f603
...
...
@@ -124,6 +124,7 @@ class CategoryPopupWindow(context: Context,allFilter:AllFilter) : PopupWindow(Vi
}
mAllFilter
.
categoryId2List
.
clear
()
mAllFilter
.
categoryId3List
.
clear
()
signList
.
clear
()
}
// 确定
view
.
btnConfirm
.
setOnClickListener
{
...
...
@@ -160,6 +161,7 @@ class CategoryPopupWindow(context: Context,allFilter:AllFilter) : PopupWindow(Vi
if
(!
childList
[
position
].
isSelected
&&
childList
[
0
].
isSelected
){
childList
[
0
].
isSelected
=
false
mAllFilter
.
categoryId2List
.
remove
(
childList
[
0
].
cate_id
)
signList
.
remove
(
"亲子教育"
)
}
childList
[
position
].
isSelected
=
!
childList
[
position
].
isSelected
if
(
childList
[
position
].
isSelected
){
...
...
@@ -204,6 +206,7 @@ class CategoryPopupWindow(context: Context,allFilter:AllFilter) : PopupWindow(Vi
if
(!
stressList
[
position
].
isSelected
&&
stressList
[
0
].
isSelected
){
stressList
[
0
].
isSelected
=
false
mAllFilter
.
categoryId2List
.
remove
(
stressList
[
0
].
cate_id
)
signList
.
remove
(
"情绪压力"
)
}
stressList
[
position
].
isSelected
=
!
stressList
[
position
].
isSelected
if
(
stressList
[
position
].
isSelected
){
...
...
@@ -248,6 +251,7 @@ class CategoryPopupWindow(context: Context,allFilter:AllFilter) : PopupWindow(Vi
if
(!
loveEmotionList
[
position
].
isSelected
&&
loveEmotionList
[
0
].
isSelected
){
loveEmotionList
[
0
].
isSelected
=
false
mAllFilter
.
categoryId2List
.
remove
(
loveEmotionList
[
0
].
cate_id
)
signList
.
remove
(
"恋爱情感"
)
}
loveEmotionList
[
position
].
isSelected
=
!
loveEmotionList
[
position
].
isSelected
if
(
loveEmotionList
[
position
].
isSelected
){
...
...
@@ -292,6 +296,7 @@ class CategoryPopupWindow(context: Context,allFilter:AllFilter) : PopupWindow(Vi
if
(!
marriedFamilyList
[
position
].
isSelected
&&
marriedFamilyList
[
0
].
isSelected
){
marriedFamilyList
[
0
].
isSelected
=
false
mAllFilter
.
categoryId2List
.
remove
(
marriedFamilyList
[
0
].
cate_id
)
signList
.
remove
(
"婚姻家庭"
)
}
marriedFamilyList
[
position
].
isSelected
=
!
marriedFamilyList
[
position
].
isSelected
if
(
marriedFamilyList
[
position
].
isSelected
){
...
...
@@ -336,6 +341,7 @@ class CategoryPopupWindow(context: Context,allFilter:AllFilter) : PopupWindow(Vi
if
(!
personalGrowthList
[
position
].
isSelected
&&
personalGrowthList
[
0
].
isSelected
){
personalGrowthList
[
0
].
isSelected
=
false
mAllFilter
.
categoryId2List
.
remove
(
childList
[
0
].
cate_id
)
signList
.
remove
(
"个人成长"
)
}
personalGrowthList
[
position
].
isSelected
=
!
personalGrowthList
[
position
].
isSelected
if
(
personalGrowthList
[
position
].
isSelected
){
...
...
@@ -380,6 +386,7 @@ class CategoryPopupWindow(context: Context,allFilter:AllFilter) : PopupWindow(Vi
if
(!
interpersonalRelationshipList
[
position
].
isSelected
&&
interpersonalRelationshipList
[
0
].
isSelected
){
interpersonalRelationshipList
[
0
].
isSelected
=
false
mAllFilter
.
categoryId2List
.
remove
(
interpersonalRelationshipList
[
0
].
cate_id
)
signList
.
remove
(
"人际关系"
)
}
interpersonalRelationshipList
[
position
].
isSelected
=
!
interpersonalRelationshipList
[
position
].
isSelected
if
(
interpersonalRelationshipList
[
position
].
isSelected
){
...
...
@@ -423,6 +430,8 @@ class CategoryPopupWindow(context: Context,allFilter:AllFilter) : PopupWindow(Vi
}
else
{
if
(!
careerDevelopmentList
[
position
].
isSelected
&&
careerDevelopmentList
[
0
].
isSelected
){
careerDevelopmentList
[
0
].
isSelected
=
false
mAllFilter
.
categoryId2List
.
remove
(
careerDevelopmentList
[
0
].
cate_id
)
signList
.
remove
(
"职场发展"
)
}
careerDevelopmentList
[
position
].
isSelected
=
!
careerDevelopmentList
[
position
].
isSelected
if
(
careerDevelopmentList
[
position
].
isSelected
){
...
...
@@ -466,6 +475,8 @@ class CategoryPopupWindow(context: Context,allFilter:AllFilter) : PopupWindow(Vi
}
else
{
if
(!
mentalHealthList
[
position
].
isSelected
&&
mentalHealthList
[
0
].
isSelected
){
mentalHealthList
[
0
].
isSelected
=
false
mAllFilter
.
categoryId2List
.
remove
(
mentalHealthList
[
0
].
cate_id
)
signList
.
remove
(
"心理健康"
)
}
mentalHealthList
[
position
].
isSelected
=
!
mentalHealthList
[
position
].
isSelected
if
(
mentalHealthList
[
position
].
isSelected
){
...
...
m-consultant/src/main/java/com/yidianling/consultant/ui/view/FilterPopupWindow.kt
View file @
1d79f603
...
...
@@ -243,13 +243,6 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
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
)
{
...
...
@@ -461,7 +454,6 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
textView
.
isSelected
=
true
textView
.
paint
.
isFakeBoldText
=
true
}
updateCount
(
ConsultBIConstants
.
POSITION_GOOD_AT_CLICK
)
}
if
(
index
>
19
){
...
...
m-consultant/src/main/res/drawable/consultant_stroke_ebebeb_solid_f9f9f9_r_4.xml
0 → 100644
View file @
1d79f603
<?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
m-consultant/src/main/res/layout/consultant_activity_hot_search.xml
View file @
1d79f603
This diff is collapsed.
Click to expand it.
m-consultant/src/main/res/layout/consultant_item_search_words.xml
0 → 100644
View file @
1d79f603
<?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
m-consultant/src/main/res/layout/consultant_layout_search_content.xml
View file @
1d79f603
...
...
@@ -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"
>
...
...
@@ -81,6 +82,65 @@
android:layout_width=
"match_parent"
android:layout_height=
"6dp"
android:background=
"@drawable/consult_fillter_bg"
/>
<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>
<!-- <View-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="1dp"-->
<!-- android:background="@color/platform_color_EBEBEB" />-->
</LinearLayout>
...
...
m-home/src/main/java/com/yidianling/home/event/HomeBaseImpl.kt
View file @
1d79f603
...
...
@@ -23,7 +23,6 @@ import com.ydl.ydlcommon.base.config.HttpConfig
import
com.ydl.ydlcommon.bean.ShareData
import
com.ydl.ydlcommon.data.PlatformRamImpl
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.modular.ModularServiceManager.provide
import
com.ydl.ydlcommon.router.IYDLRouterConstant
import
com.ydl.ydlcommon.utils.LogUtil
import
com.ydl.ydlcommon.utils.Utils
...
...
ydl-net/src/main/java/com/ydl/ydlnet/builder/interceptor/log/DefaultFormatPrinter.java
View file @
1d79f603
...
...
@@ -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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment