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
7fb1dfd9
Commit
7fb1dfd9
authored
May 21, 2021
by
刘鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: IM模块 立即咨询,咨询服务好评率展示和隐藏优化
parent
900a21cd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
19 deletions
+38
-19
config.gradle
config.gradle
+2
-2
ServiceItemBean.java
m-im/src/main/java/com/yidianling/uikit/custom/http/response/ServiceItemBean.java
+2
-0
ExpertConsultServiceItemView.kt
m-im/src/main/java/com/yidianling/uikit/custom/widget/expertConsultService/view/ExpertConsultServiceItemView.kt
+33
-17
im_expert_consult_service_item_view.xml
m-im/src/main/res/layout/im_expert_consult_service_item_view.xml
+1
-0
No files found.
config.gradle
View file @
7fb1dfd9
...
...
@@ -10,7 +10,7 @@ ext {
"m-fm"
:
"0.0.30.03"
,
"m-user"
:
"0.0.61.31"
,
"m-home"
:
"0.0.22.61"
,
"m-im"
:
"0.0.19.0
3
"
,
"m-im"
:
"0.0.19.0
5
"
,
"m-dynamic"
:
"0.0.7.22"
,
"m-article"
:
"0.0.0.8"
,
...
...
@@ -93,7 +93,7 @@ ext {
"m-fm"
:
"0.0.30.01"
,
"m-user"
:
"0.0.61.31"
,
"m-home"
:
"0.0.22.61"
,
"m-im"
:
"0.0.19.0
3
"
,
"m-im"
:
"0.0.19.0
5
"
,
"m-dynamic"
:
"0.0.7.22"
,
"m-article"
:
"0.0.0.6"
,
...
...
m-im/src/main/java/com/yidianling/uikit/custom/http/response/ServiceItemBean.java
View file @
7fb1dfd9
...
...
@@ -154,6 +154,8 @@ public class ServiceItemBean {
private
String
aimEffect
;
private
String
advantage
;
private
String
extRemark
;
public
String
minOrderTime
;
public
String
saleAmount
;
public
long
getId
()
{
return
id
;
...
...
m-im/src/main/java/com/yidianling/uikit/custom/widget/expertConsultService/view/ExpertConsultServiceItemView.kt
View file @
7fb1dfd9
...
...
@@ -2,7 +2,6 @@ package com.yidianling.uikit.custom.widget.expertConsultService.view
import
android.annotation.SuppressLint
import
android.content.Context
import
android.util.AttributeSet
import
android.view.View
import
android.widget.LinearLayout
import
com.ydl.webview.H5Params
...
...
@@ -65,16 +64,18 @@ class ExpertConsultServiceItemView : LinearLayout {
//隐藏起售次数限制
service_item_low_buy_time
.
visibility
=
View
.
GONE
}
val
mCompare
:
Comparator
<
ServiceItemBean
.
ProductsBean
.
ProductSpecDtosBean
>
=
Comparator
{
o1
,
o2
->
val
res
=
o1
.
price
.
compareTo
(
o2
.
price
)
when
{
res
==
0
->
0
res
>
0
->
-
1
else
->
1
val
mCompare
:
Comparator
<
ServiceItemBean
.
ProductsBean
.
ProductSpecDtosBean
>
=
Comparator
{
o1
,
o2
->
val
res
=
o1
.
price
.
compareTo
(
o2
.
price
)
when
{
res
==
0
->
0
res
>
0
->
-
1
else
->
1
}
}
}
if
(
bean
.
productSpecDtos
!=
null
&&
bean
.
productSpecDtos
.
size
>
0
)
{
val
mBean
:
ServiceItemBean
.
ProductsBean
.
ProductSpecDtosBean
=
bean
.
productSpecDtos
.
sortedWith
(
mCompare
).
last
()
val
mBean
:
ServiceItemBean
.
ProductsBean
.
ProductSpecDtosBean
=
bean
.
productSpecDtos
.
sortedWith
(
mCompare
).
last
()
//价格,取productSpecDtos数组最小价格,不保留小数
service_item_price
.
text
=
String
.
format
(
"%.0f"
,
...
...
@@ -82,17 +83,26 @@ class ExpertConsultServiceItemView : LinearLayout {
)
//时间,取productSpecDtos数组最后一个的时间
service_item_time
.
text
=
"/${mBean.spec2}分钟"
service_item_time
.
text
=
"/${bean.productDto.minOrderTime}分钟"
}
if
(
bean
.
productDto
.
feedbackRate
>
0
)
{
//好评率,*20后 保留1位小数
service_item_feddbackrate
.
visibility
=
VISIBLE
tv_feedbackRate
.
visibility
=
VISIBLE
service_item_feddbackrate
.
text
=
String
.
format
(
"%.1f"
,
(
bean
.
productDto
.
feedbackRate
)
*
100f
)
+
"%"
}
else
{
service_item_feddbackrate
.
visibility
=
GONE
tv_feedbackRate
.
visibility
=
GONE
}
//好评率,*20后 保留1位小数
service_item_feddbackrate
.
text
=
String
.
format
(
"%.1f"
,
(
bean
.
productDto
.
feedbackRate
)
*
20f
)
+
"%"
//销量
service_item_saleout_num
.
text
=
"销量${bean.productDto.sale
out
Amount}"
service_item_saleout_num
.
text
=
"销量${bean.productDto.saleAmount}"
setOnClickListener
{
mListener
?.
onItemClick
(
bean
)
...
...
@@ -100,7 +110,13 @@ class ExpertConsultServiceItemView : LinearLayout {
im_expert_service_list_btn
.
setOnClickListener
{
NewH5Activity
.
start
(
mContext
,
H5Params
(
HttpConfig
.
MH5_URL
+
"consult/#/pages/jieyou/DownOrder?product_id="
+
bean
.
productDto
.
id
,
null
))
NewH5Activity
.
start
(
mContext
,
H5Params
(
HttpConfig
.
MH5_URL
+
"consult/#/pages/jieyou/DownOrder?product_id="
+
bean
.
productDto
.
id
,
null
)
)
}
}
...
...
m-im/src/main/res/layout/im_expert_consult_service_item_view.xml
View file @
7fb1dfd9
...
...
@@ -90,6 +90,7 @@
android:textSize=
"12dp"
/>
<TextView
android:id=
"@+id/tv_feedbackRate"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"好评率"
...
...
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