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
c02301ce
Commit
c02301ce
authored
Aug 08, 2022
by
霍志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:BUG修改
parent
f150bf14
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
67 additions
and
39 deletions
+67
-39
build.gradle
build.gradle
+1
-1
ExpertSearchActivity.kt
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchActivity.kt
+14
-10
ExpertSearchFragment.kt
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchFragment.kt
+3
-2
AreaPopupWindow.kt
m-consultant/src/main/java/com/yidianling/consultant/ui/view/AreaPopupWindow.kt
+32
-16
PricePopupWindow.kt
m-consultant/src/main/java/com/yidianling/consultant/ui/view/PricePopupWindow.kt
+8
-7
consultant_item_consult_type.xml
m-consultant/src/main/res/layout/consultant_item_consult_type.xml
+4
-1
consultant_item_filter.xml
m-consultant/src/main/res/layout/consultant_item_filter.xml
+1
-1
consultant_item_region.xml
m-consultant/src/main/res/layout/consultant_item_region.xml
+4
-1
No files found.
build.gradle
View file @
c02301ce
...
...
@@ -14,7 +14,7 @@ buildscript {
ydlrouter_version
=
'1.2.3'
constrait_support_version
=
'1.0.2'
componentVersion
=
"0.3.0.
17
-SNAPSHOT"
componentVersion
=
"0.3.0.
20
-SNAPSHOT"
}
repositories
{
mavenCentral
()
...
...
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchActivity.kt
View file @
c02301ce
...
...
@@ -21,7 +21,6 @@ import androidx.core.content.ContextCompat
import
androidx.recyclerview.widget.LinearLayoutManager
import
androidx.recyclerview.widget.RecyclerView
import
androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import
com.alibaba.android.arouter.facade.annotation.Autowired
import
com.alibaba.android.arouter.facade.annotation.Route
import
com.alibaba.android.arouter.launcher.ARouter
import
com.google.android.material.appbar.AppBarLayout
...
...
@@ -126,6 +125,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
private
const
val
FILTER_STATUS_NORMAL
=
0
//默认筛选状态
private
const
val
FILTER_STATUS_FILTERED
=
1
//非默认筛选状态
private
const
val
FILTER_STATUS_OPEN
=
2
//筛选窗打开状态
private
const
val
CONST_CITY
=
"城市"
const
val
FROM_ONLINE_EXPERT
=
2
fun
newIntent
(
...
...
@@ -397,11 +397,14 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
initCategory
=
mIntent
.
getStringExtra
(
EXTRA_CATEGORY
)
?:
""
initShowType
=
mIntent
.
getIntExtra
(
EXTRA_SHOW_TYPE
,
0
)
//首页金刚位传递过来的动态Map参数
mapFilter
=
mIntent
.
getSerializableExtra
(
GO_CRITERIA
)
as
HashMap
<
String
,
Any
>
initCategory
=
mIntent
.
getStringExtra
(
"cateId"
)
cateName
=
mIntent
.
getStringExtra
(
"cateTitle"
)
mSign2
=
cateName
!!
initShowType
=
mIntent
.
getStringExtra
(
"showType"
).
toInt
()
if
(
mIntent
.
getSerializableExtra
(
GO_CRITERIA
)
!=
null
)
{
mapFilter
=
mIntent
.
getSerializableExtra
(
GO_CRITERIA
)
as
HashMap
<
String
,
Any
>
}
initCategory
=
mIntent
.
getStringExtra
(
"cateId"
)
?:
""
if
(
mIntent
.
getStringExtra
(
"cateTitle"
)
!=
null
)
{
cateName
=
mIntent
.
getStringExtra
(
"cateTitle"
)
}
mSign2
=
cateName
.
toString
()
val
relatedWord
=
mIntent
.
getStringExtra
(
EXTRA_RELATED_WORD
)
// 搜索内容的联想词
searchWord
=
mIntent
.
getStringExtra
(
EXTRA_SEARCH_WORD
)
val
isRecommendWords
=
mIntent
.
getBooleanExtra
(
EXTRA_IS_RECCOMMEND_WORD
,
false
)
...
...
@@ -1427,7 +1430,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
updateFilterTextViewStatus
(
tvArea
,
FILTER_STATUS_OPEN
)
regionPopupWindow
.
setOnDismissListener
{
viewDim
.
visibility
=
View
.
INVISIBLE
if
(
tvArea
.
text
!=
"城市"
)
{
if
(
tvArea
.
text
!=
CONST_CITY
)
{
updateFilterTextViewStatus
(
tvArea
,
FILTER_STATUS_FILTERED
)
}
else
{
updateFilterTextViewStatus
(
tvArea
,
FILTER_STATUS_NORMAL
)
...
...
@@ -1440,7 +1443,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
allFilter
.
region
=
region
allFilter
.
sub
=
sub
if
(
TextUtils
.
isEmpty
(
region
.
code
)
&&
TextUtils
.
isEmpty
(
sub
.
code
))
{
tvArea
.
text
=
"城市"
tvArea
.
text
=
CONST_CITY
}
else
if
(!
TextUtils
.
isEmpty
(
region
.
code
)
&&
!
TextUtils
.
isEmpty
(
sub
.
code
))
{
if
(
region
.
value
?.
length
?:
0
>
4
)
{
tvArea
.
text
=
region
.
value
?.
substring
(
0
,
3
)
+
"..."
...
...
@@ -1601,7 +1604,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
tv
.
setCompoundDrawablesWithIntrinsicBounds
(
0
,
0
,
R
.
drawable
.
platform_
ic_arrow_drop_down_grey_500_18dp
,
R
.
drawable
.
platform_
arrow_drop_down_en
,
0
)
}
...
...
@@ -1678,7 +1681,8 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
override
fun
onPriceItemSelected
(
priceRangesItem
:
PriceRangesItem
)
{
//价格筛选回调
updateFilterTextViewStatus
(
tvSort
,
FILTER_STATUS_FILTERED
)
allFilter
.
priceRanges
=
priceRangesItem
getPresenter
().
fetchListData
(
allFilter
,
getPresenter
().
mExtras
,
mapFilter
)
refresh
(
false
)
}
}
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchFragment.kt
View file @
c02301ce
...
...
@@ -1500,7 +1500,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
tv
.
setCompoundDrawablesWithIntrinsicBounds
(
0
,
0
,
R
.
drawable
.
platform_
ic_arrow_drop_down_grey_500_18dp
,
R
.
drawable
.
platform_
arrow_drop_down_en
,
0
)
}
...
...
@@ -1599,7 +1599,8 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
override
fun
onPriceItemSelected
(
priceRange
:
PriceRangesItem
)
{
//价格筛选回调
updateFilterTextViewStatus
(
tvSort
,
FILTER_STATUS_FILTERED
)
allFilter
.
priceRanges
=
priceRange
getPresenter
().
fetchListData
(
allFilter
,
getPresenter
().
mExtras
,
null
)
refresh
(
false
)
}
}
m-consultant/src/main/java/com/yidianling/consultant/ui/view/AreaPopupWindow.kt
View file @
c02301ce
...
...
@@ -2,6 +2,7 @@ package com.yidianling.consultant.ui.view
import
android.annotation.SuppressLint
import
android.content.Context
import
android.graphics.Region
import
android.graphics.drawable.BitmapDrawable
import
androidx.recyclerview.widget.LinearLayoutManager
import
android.view.LayoutInflater
...
...
@@ -46,6 +47,8 @@ class AreaPopupWindow(
private
var
locationHistoryList
:
ArrayList
<
RegionItem
>?
=
arrayListOf
()
private
val
locationCode
=
"-1"
private
val
recentCityCode
=
"0"
private
var
locationRegionItem
:
RegionItem
?
=
null
private
var
locationList
:
ArrayList
<
SubItem
>?
=
arrayListOf
()
init
{
val
view
=
...
...
@@ -58,12 +61,11 @@ class AreaPopupWindow(
this
.
height
=
((
RxDeviceTool
.
getScreenHeight
(
context
)
-
RxImageTool
.
dp2px
(
90f
))
*
0.618
).
toInt
()
//设置高度为屏幕的80%
//根据IP获取当前城市
getRegionByIp
(
isAgree
,
fals
e
)
getRegionByIp
(
isAgree
,
tru
e
)
recentCityBean
=
MMKV
.
defaultMMKV
().
decodeParcelable
(
RECENT_CITY
,
ConsultantRecentCity
::
class
.
java
)
if
(
recentCityBean
==
null
)
recentCityBean
=
ConsultantRecentCity
(
arrayListOf
())
var
locationList
:
ArrayList
<
SubItem
>?
=
arrayListOf
()
locationHistoryList
?.
add
(
...
...
@@ -74,17 +76,10 @@ class AreaPopupWindow(
code
=
recentCityCode
)
)
subLocationItem
?.
let
{
locationList
?.
add
(
it
)
}
locationList
?.
let
{
RegionItem
(
it
,
value
=
"定位"
,
key
=
locationCode
,
code
=
locationCode
)
}
?.
let
{
locationHistoryList
?.
add
(
0
,
it
)
}
locationHistoryList
?.
addAll
(
regionList
)
regionAdapter
.
regionList
=
locationHistoryList
!!
if
(
selectedRegion
.
sub
.
isNotEmpty
())
{
subList
.
addAll
(
selectedRegion
.
sub
)
}
else
{
subList
.
addAll
(
regionList
[
0
].
sub
)
}
subAdapter
=
SubRecyclerViewAdapter
(
context
,
subList
,
selectedSub
,
locationCode
)
subAdapter
.
setOnAuthClickLister
(
object
:
SubRecyclerViewAdapter
.
OnAuthClickLister
{
...
...
@@ -119,10 +114,10 @@ class AreaPopupWindow(
view
.
rvSub
.
scrollToPosition
(
0
)
}
view
.
rvRegion
.
adapter
=
regionAdapter
val
i
=
locationHistoryList
!!
.
takeWhile
{
it
.
key
!=
selectedRegion
.
key
}
.
count
()
view
.
rvRegion
.
scrollToPosition
(
i
)
//
val i = locationHistoryList!!
//
.takeWhile { it.key != selectedRegion.key }
//
.count()
//
view.rvRegion.scrollToPosition(i)
view
.
rvSub
.
layoutManager
=
...
...
@@ -168,9 +163,28 @@ class AreaPopupWindow(
subLocationItem
?.
key
=
it
.
data
.
city_code
subLocationItem
?.
value
=
it
.
data
.
city_name
subLocationItem
?.
locationCode
=
locationCode
if
(
refreshAdapter
)
{
subAdapter
.
notifyDataSetChanged
()
subLocationItem
?.
let
{
locationList
?.
add
(
it
)
}
locationRegionItem
=
locationList
?.
let
{
RegionItem
(
it
,
value
=
"定位"
,
key
=
locationCode
,
code
=
locationCode
)
}
locationRegionItem
?.
let
{
locationHistoryList
?.
add
(
0
,
it
)
}
if
(
locationRegionItem
!=
null
)
{
selectedRegion
=
locationRegionItem
!!
regionAdapter
.
selectedRegion
=
selectedRegion
}
if
(
selectedRegion
.
sub
.
isNotEmpty
())
{
subList
.
addAll
(
selectedRegion
.
sub
)
}
subAdapter
.
notifyDataSetChanged
()
regionAdapter
.
notifyDataSetChanged
()
}
},
{})
}
else
{
...
...
@@ -178,6 +192,8 @@ class AreaPopupWindow(
subLocationItem
?.
key
=
null
subLocationItem
?.
value
=
"开启授权,获得定位城市"
subLocationItem
?.
locationCode
=
"NotAuth"
subAdapter
.
notifyDataSetChanged
()
regionAdapter
.
notifyDataSetChanged
()
}
}
...
...
m-consultant/src/main/java/com/yidianling/consultant/ui/view/PricePopupWindow.kt
View file @
c02301ce
...
...
@@ -11,6 +11,7 @@ import android.view.ViewGroup
import
android.widget.FrameLayout
import
android.widget.PopupWindow
import
android.widget.TextView
import
com.yidianling.common.tools.LogUtil
import
com.yidianling.common.tools.RxDeviceTool
import
com.yidianling.common.tools.RxImageTool
import
com.yidianling.consultant.R
...
...
@@ -45,6 +46,7 @@ class PricePopupWindow(
private
var
SeekBarLeftValue
=
0f
private
var
SeekBarRightValue
=
0f
private
val
maxPriceValue
=
600
private
val
infiniteText
=
"无限"
init
{
val
view
=
...
...
@@ -56,8 +58,7 @@ class PricePopupWindow(
this
.
isOutsideTouchable
=
true
initPriceTag
()
contentView
.
price_Confirm
.
setOnClickListener
{
// tempFilter.priceRanges?.min_price=min_Price
// tempFilter.priceRanges?.max_price=max_Price
if
(
max_Price
==
infiniteText
)
max_Price
=
""
var
priceRangesItem
=
PriceRangesItem
(
min_Price
,
max_Price
)
onPriceItemSelectedListener
.
onPriceItemSelected
(
priceRangesItem
)
dismiss
()
...
...
@@ -71,7 +72,7 @@ class PricePopupWindow(
)
{
var
maxPrice
=
((
rightValue
/
100
)
*
maxPriceValue
).
toInt
().
toString
()
if
(
rightValue
>
93
)
{
maxPrice
=
"无限"
maxPrice
=
infiniteText
}
contentView
.
tv_start_end_price
.
text
=
((
leftValue
/
100
)
*
maxPriceValue
).
toInt
().
toString
()
+
"-"
+
maxPrice
...
...
@@ -91,7 +92,7 @@ class PricePopupWindow(
val
mWidth
=
(
popWidth
-
RxImageTool
.
dp2px
(
52f
))
/
enquirySize
for
((
index
,
priceRangesItem
)
in
filterData
.
priceRanges
.
withIndex
())
{
val
textView
=
View
.
inflate
(
context
,
R
.
layout
.
consultant_item_filter
,
null
)
as
TextView
val
params
=
FrameLayout
.
LayoutParams
(
mWidth
,
RxImageTool
.
dp2px
(
48
f
))
val
params
=
FrameLayout
.
LayoutParams
(
mWidth
,
RxImageTool
.
dp2px
(
50
f
))
val
marginNum
=
RxImageTool
.
dp2px
(
2f
)
params
.
setMargins
(
marginNum
+
(
RxImageTool
.
dp2px
(
10f
)
+
mWidth
)
*
(
index
%
enquirySize
),
...
...
@@ -140,7 +141,7 @@ class PricePopupWindow(
textView
.
isSelected
=
false
textView
.
paint
.
isFakeBoldText
=
false
tempFilter
.
priceRangesView
=
null
contentView
.
tv_start_end_price
.
text
=
"0-
无限
"
contentView
.
tv_start_end_price
.
text
=
"0-
$infiniteText
"
}
else
{
textView
.
background
=
context
.
getDrawable
(
R
.
drawable
.
consult_price_expert_selected
)
...
...
@@ -160,14 +161,14 @@ class PricePopupWindow(
(
priceRangesItem
.
min_price
.
toString
().
toFloat
()
/
maxPriceValue
)
*
100f
}
if
(
priceRangesItem
.
max_price
.
isNullOrEmpty
())
{
max_Price
=
"无限"
max_Price
=
infiniteText
SeekBarRightValue
=
100f
}
else
{
max_Price
=
priceRangesItem
.
max_price
.
toString
()
SeekBarRightValue
=
(
priceRangesItem
.
max_price
.
toString
().
toFloat
()
/
maxPriceValue
)
*
100f
}
if
(
SeekBarRightValue
>
100f
)
SeekBarRightValue
=
100f
contentView
.
range_price_seekbar
.
setProgress
(
SeekBarLeftValue
,
SeekBarRightValue
)
contentView
.
tv_start_end_price
.
text
=
"$min_Price-$max_Price"
}
...
...
m-consultant/src/main/res/layout/consultant_item_consult_type.xml
View file @
c02301ce
...
...
@@ -2,9 +2,11 @@
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"
40dp
"
android:layout_height=
"
wrap_content
"
android:background=
"@color/white"
android:gravity=
"center_vertical"
android:paddingTop=
"@dimen/platform_dp_15"
android:paddingBottom=
"@dimen/platform_dp_15"
android:orientation=
"horizontal"
android:paddingLeft=
"16dp"
android:paddingRight=
"16dp"
>
...
...
@@ -23,6 +25,7 @@
android:layout_weight=
"1"
android:textColor=
"@color/platform_color_black_333333"
android:textSize=
"14sp"
android:includeFontPadding=
"false"
tools:text=
"咨询方式"
/>
<TextView
...
...
m-consultant/src/main/res/layout/consultant_item_filter.xml
View file @
c02301ce
...
...
@@ -14,5 +14,5 @@
android:paddingTop=
"6dp"
android:paddingBottom=
"6dp"
android:textColor=
"@color/consultant_color_search_filter_selector"
android:textSize=
"1
3d
p"
android:textSize=
"1
4s
p"
tools:text=
"按专家显示"
/>
m-consultant/src/main/res/layout/consultant_item_region.xml
View file @
c02301ce
...
...
@@ -16,7 +16,10 @@
<TextView
android:id=
"@+id/tvRegionName"
android:layout_width=
"match_parent"
android:layout_height=
"40dp"
android:layout_height=
"wrap_content"
android:includeFontPadding=
"false"
android:paddingTop=
"@dimen/platform_dp_15"
android:paddingBottom=
"@dimen/platform_dp_15"
android:gravity=
"center"
android:text=
"地区"
android:textColor=
"@color/platform_default_text_color"
...
...
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