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
80e3afd0
Commit
80e3afd0
authored
Jun 21, 2022
by
刘鹏
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat/lancet/v4398' into 'd/v4.3.98'
Feat/lancet/v4398 See merge request app_android_lib/YDL-Component!169
parents
cdd04085
0f3b0868
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
635 additions
and
51 deletions
+635
-51
HomeConfideBean.kt
m-home/src/main/java/com/yidianling/home/model/bean/HomeConfideBean.kt
+1
-0
HomeConfideAdapter.kt
m-home/src/ydl/java/com/yidianling/home/adapter/HomeConfideAdapter.kt
+182
-0
HomeConfideExpertInfoView.kt
m-home/src/ydl/java/com/yidianling/home/ui/view/HomeConfideExpertInfoView.kt
+124
-40
home_confide__free.gif
m-home/src/ydl/res/drawable-xhdpi/home_confide__free.gif
+0
-0
home_confide_offline_bg.xml
m-home/src/ydl/res/drawable/home_confide_offline_bg.xml
+7
-0
home_confide_online_main.xml
m-home/src/ydl/res/drawable/home_confide_online_main.xml
+7
-0
home_confide_recommend_expert_line_bg.xml
m-home/src/ydl/res/drawable/home_confide_recommend_expert_line_bg.xml
+7
-0
home_confide_item_layout.xml
m-home/src/ydl/res/layout/home_confide_item_layout.xml
+228
-0
colors.xml
m-home/src/ydl/res/values/colors.xml
+4
-0
CanViewConsult.kt
m-im/src/main/java/com/yidianling/im/bean/CanViewConsult.kt
+5
-0
YDLMessageFragment.java
m-im/src/main/java/com/yidianling/uikit/business/session/fragment/YDLMessageFragment.java
+17
-6
ServiceApi.kt
m-im/src/main/java/com/yidianling/uikit/custom/http/ServiceApi.kt
+8
-0
ServiceImpl.kt
m-im/src/main/java/com/yidianling/uikit/custom/http/ServiceImpl.kt
+9
-0
ConfideOrderInfoView.java
m-im/src/main/java/com/yidianling/uikit/custom/widget/ConfideOrderInfoView.java
+32
-3
im_ydl_nim_message_fragment.xml
m-im/src/main/res_uikit/layout/im_ydl_nim_message_fragment.xml
+4
-2
No files found.
m-home/src/main/java/com/yidianling/home/model/bean/HomeConfideBean.kt
View file @
80e3afd0
...
...
@@ -38,6 +38,7 @@ class HomeConfideBean : HomeItemBaseBean {
var
confideLine
:
Int
=
0
var
confideAddress
:
String
?
=
null
var
confidePraise
:
String
?
=
null
var
confidePraiseScore
:
String
?=
null
/**
* 实际费用
*/
...
...
m-home/src/ydl/java/com/yidianling/home/adapter/HomeConfideAdapter.kt
0 → 100644
View file @
80e3afd0
package
com.yidianling.home.adapter
import
android.content.Context
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
android.widget.FrameLayout
import
android.widget.ImageView
import
android.widget.LinearLayout
import
android.widget.TextView
import
androidx.recyclerview.widget.RecyclerView
import
com.alibaba.android.arouter.launcher.ARouter
import
com.bumptech.glide.Glide
import
com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
import
com.ydl.webview.H5Params
import
com.ydl.webview.NewH5Activity
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.utils.Utils
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.yidianling.home.R
import
com.yidianling.home.constants.HomeBIConstants
import
com.yidianling.home.model.bean.MeditationModuleBean
import
com.yidianling.user.api.service.IUserService
import
kotlinx.android.synthetic.ydl.home_fragment.*
class
HomeConfideAdapter
(
private
val
context
:
Context
,
private
val
data
:
List
<
MeditationModuleBean
.
MeditationDetail
>?,
private
val
moreLink
:
String
?,
private
val
homeLink
:
String
?
=
null
,
private
val
cateId
:
Long
?
=
null
,
private
val
buried
:
String
?
=
null
,
private
val
mark
:
Int
?
=
null
,
private
val
meditationType
:
Int
?
=
null
)
:
RecyclerView
.
Adapter
<
RecyclerView
.
ViewHolder
>()
{
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
,
viewType
:
Int
):
RecyclerView
.
ViewHolder
{
return
when
(
viewType
)
{
CONTENT_TYPE
->
{
MeditationTypeViewHolder
(
LayoutInflater
.
from
(
context
)
.
inflate
(
R
.
layout
.
home_layout_meditation_item
,
parent
,
false
)
)
}
else
->
{
MeditationTypeMoreViewHolder
(
LayoutInflater
.
from
(
context
)
.
inflate
(
R
.
layout
.
home_layout_meditation_more_type
,
parent
,
false
)
)
}
}
}
override
fun
onBindViewHolder
(
holder
:
RecyclerView
.
ViewHolder
,
position
:
Int
)
{
when
(
holder
)
{
is
MeditationTypeViewHolder
->
{
holder
.
ivType
?.
let
{
Glide
.
with
(
context
)
.
load
(
data
?.
get
(
position
)
?.
coverImageUrl
)
.
thumbnail
(
0.1f
)
.
transition
(
DrawableTransitionOptions
.
withCrossFade
())
.
into
(
it
)
}
holder
.
tvName
?.
let
{
it
.
text
=
data
?.
get
(
position
)
?.
title
?:
""
}
holder
.
cvLayout
?.
setOnClickListener
{
ActionCountUtils
.
baiDuCountSign3
(
HomeBIConstants
.
YDL_USER_MAIN_PAGE_MUSE
,
HomeBIConstants
.
YDL_HOME_MEDITATION_CLICK
,
buried
?:
""
,
(
position
+
1
).
toString
(),
""
)
if
(
meditationType
==
0
)
{
if
(
Utils
.
isFastClick
())
{
//防止连击
return
@setOnClickListener
}
if
(!
ModularServiceManager
.
provide
(
IUserService
::
class
.
java
)
.
loginByOneKeyLogin
(
context
,
true
)
)
{
return
@setOnClickListener
}
if
(
data
==
null
)
{
return
@setOnClickListener
}
ARouter
.
getInstance
().
build
(
"/muse/play"
)
.
withLong
(
"MEDITATION_ID"
,
data
[
position
]
?.
meditationId
)
.
withInt
(
"MEDITATION_TYPE"
,
meditationType
)
.
withFloat
(
"MEDIA_DURATION"
,
data
[
position
].
duration
?:
0.0f
)
.
withString
(
"MEDIA_URL"
,
data
[
position
].
mediaIdCoverImageUrl
)
.
withString
(
"MEDIA_COVER_URL"
,
data
[
position
].
mediaIdCoverImageUrl
)
.
navigation
()
// YDLRouterManager.router(ROUTER_MUSE_PLAY,
// YDLRouterParams().putExtra("MEDITATION_ID" , data[position]?.meditationId.toString())
// .putExtra("MEDITATION_TYPE", meditationType.toString())
// .putExtra("MEDIA_DURATION", (data[position].duration?:0).toString())
// .putExtra("MEDIA_URL", data[position].mediaIdCoverImageUrl.toString())
// .putExtra("MEDIA_COVER_URL", data[position].mediaIdCoverImageUrl.toString()))
}
else
{
if
(
Utils
.
isFastClick
())
{
//防止连击
return
@setOnClickListener
}
if
(
data
==
null
)
{
return
@setOnClickListener
}
val
homeLink
=
"${homeLink}mark=$mark&cateId=$cateId&meditationId=${data[position]?.meditationId}"
if
(!
homeLink
.
isNullOrBlank
())
{
NewH5Activity
.
start
(
context
,
H5Params
(
homeLink
,
null
))
}
}
}
}
is
MeditationTypeMoreViewHolder
->
{
holder
.
llMoreLayout
?.
setOnClickListener
{
if
(
Utils
.
isFastClick
())
{
//防止连击
return
@setOnClickListener
}
//冥想助眠更多点击事件
ActionCountUtils
.
count
(
HomeBIConstants
.
YDL_HOME_MEDITATION_VOICE_MORE_CLICK
,
buried
?:
""
)
val
moreLink
=
"${moreLink}mark=$mark&cateId=$cateId"
if
(!
moreLink
.
isNullOrBlank
())
{
NewH5Activity
.
start
(
context
,
H5Params
(
moreLink
,
null
))
}
}
}
}
}
override
fun
getItemCount
():
Int
{
return
if
(
data
?.
isNotEmpty
()
==
true
)
{
data
.
size
+
1
}
else
{
0
}
}
override
fun
getItemId
(
position
:
Int
)
=
position
.
toLong
()
override
fun
getItemViewType
(
position
:
Int
):
Int
{
return
if
(
data
?.
isNotEmpty
()
==
true
&&
position
==
data
.
size
)
{
FOOTER_TYPE
}
else
{
CONTENT_TYPE
}
}
inner
class
MeditationTypeViewHolder
(
itemView
:
View
)
:
RecyclerView
.
ViewHolder
(
itemView
)
{
val
cvLayout
:
FrameLayout
?
=
itemView
.
findViewById
(
R
.
id
.
fl_layout
)
val
ivType
:
ImageView
?
=
itemView
.
findViewById
(
R
.
id
.
iv_meditation_type
)
val
tvName
:
TextView
?
=
itemView
.
findViewById
(
R
.
id
.
tv_meditation_type
)
}
inner
class
MeditationTypeMoreViewHolder
(
itemView
:
View
)
:
RecyclerView
.
ViewHolder
(
itemView
)
{
val
llMoreLayout
:
LinearLayout
?
=
itemView
.
findViewById
(
R
.
id
.
ll_more_type
)
}
companion
object
{
const
val
CONTENT_TYPE
=
0
const
val
FOOTER_TYPE
=
1
}
}
\ No newline at end of file
m-home/src/ydl/java/com/yidianling/home/ui/view/HomeConfideExpertInfoView.kt
View file @
80e3afd0
...
...
@@ -7,13 +7,17 @@ import android.text.TextUtils
import
android.view.View
import
android.view.ViewGroup
import
android.widget.FrameLayout
import
com.blankj.utilcode.util.SpanUtils
import
com.bumptech.glide.Glide
import
com.bumptech.glide.load.engine.DiskCacheStrategy
import
com.ydl.ydl_image.config.SimpleImageOpConfiger
import
com.ydl.ydl_image.manager.YDLImageCacheManager
import
com.ydl.ydl_image.module.GlideApp
import
com.yidianling.common.tools.RxImageTool
import
com.yidianling.home.R
import
com.yidianling.home.event.IHomeBaseEvent
import
com.yidianling.home.model.bean.HomeConfideBean
import
kotlinx.android.synthetic.ydl.home_confide_
expert_info_view
.view.*
import
kotlinx.android.synthetic.ydl.home_confide_
item_layout
.view.*
/**
* @author jiucheng
...
...
@@ -34,7 +38,7 @@ class HomeConfideExpertInfoView(private var mContext: Context, private var homeE
private
fun
initView
()
{
var
params
=
FrameLayout
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
)
layoutParams
=
params
View
.
inflate
(
context
,
R
.
layout
.
home_confide_
expert_info_view
,
this
)
View
.
inflate
(
context
,
R
.
layout
.
home_confide_
item_layout
,
this
)
}
fun
setData
(
bean
:
HomeConfideBean
.
BodyBean
?,
position
:
Int
,
isLast
:
Boolean
)
{
...
...
@@ -44,12 +48,19 @@ class HomeConfideExpertInfoView(private var mContext: Context, private var homeE
}
//设置头像
setHead
(
bean
)
setListenAndScore
(
bean
)
setConfideTag
(
bean
)
setLineStatus
(
bean
)
//设置名称
tv_name
.
text
=
bean
.
confidedName
//设置倾诉标签View的最大宽度
tag_view
.
setConfideWidth
()
//
tag_view.setConfideWidth()
//咨询师标签
tag_view
.
initData
(
bean
.
confidedTag
as
MutableList
<
String
>)
//
tag_view.initData(bean.confidedTag as MutableList<String>)
//设置向TA倾诉人数
setConfideNum
(
bean
)
//设置接通率文案
...
...
@@ -58,11 +69,15 @@ class HomeConfideExpertInfoView(private var mContext: Context, private var homeE
setConfideButton
(
bean
)
//设置红包、原价
setCoupon
(
bean
)
//设置咨询师简介
tv_content
.
text
=
bean
.
confideContent
//最后一项显示分割线
if
(
isLast
)
{
view_line
.
visibility
=
View
.
GONE
//
view_line.visibility = View.GONE
}
else
{
view_line
.
visibility
=
View
.
VISIBLE
//
view_line.visibility = View.VISIBLE
}
this
.
setOnClickListener
{
homeEvent
!!
.
confideClick
(
bean
.
linkUrl
,
bean
.
confidedId
.
toString
(),
bean
.
doctorId
,
bean
.
uid
.
toString
())
...
...
@@ -73,11 +88,22 @@ class HomeConfideExpertInfoView(private var mContext: Context, private var homeE
* 设置头像
*/
private
fun
setHead
(
bean
:
HomeConfideBean
.
BodyBean
)
{
val
op
=
SimpleImageOpConfiger
()
op
.
errorPic
=
R
.
drawable
.
platform_head_place_hold_pic
op
.
loadingPic
=
R
.
drawable
.
platform_head_place_hold_pic
op
.
transform
=
0
YDLImageCacheManager
.
showImage
(
mContext
,
bean
.
confidedIcon
,
img_head
,
op
)
// val op = SimpleImageOpConfiger()
// op.errorPic = R.drawable.platform_head_place_hold_pic
// op.loadingPic = R.drawable.platform_head_place_hold_pic
// op.transform = 0
// YDLImageCacheManager.showImage(mContext, bean.confidedIcon, img_head, op)
//这样处理 是防止 滑动过程中 反复去加载图片
if
(!
TextUtils
.
isEmpty
(
bean
.
confidedIcon
)
&&
img_head
.
getTag
(
R
.
id
.
img_head
)
!=
bean
.
confidedIcon
)
{
GlideApp
.
with
(
context
)
.
load
(
bean
.
confidedIcon
)
// .override(dp96, dp96)
.
into
(
img_head
)
img_head
.
setTag
(
R
.
id
.
img_head
,
bean
.
confidedIcon
)
}
}
/**
...
...
@@ -135,41 +161,99 @@ class HomeConfideExpertInfoView(private var mContext: Context, private var homeE
}
}
private
fun
setListenAndScore
(
bodyBean
:
HomeConfideBean
.
BodyBean
)
{
SpanUtils
.
with
(
price_content
).
append
(
bodyBean
.
confideFee
)
.
setForegroundColor
(
resources
.
getColor
(
R
.
color
.
home_confide_fe6040
)).
setFontSize
(
18
,
true
)
.
append
(
"元"
).
setForegroundColor
(
resources
.
getColor
(
R
.
color
.
home_confide_fe6040
))
.
setFontSize
(
11
,
true
)
.
append
(
"/25分钟"
).
setForegroundColor
(
resources
.
getColor
(
R
.
color
.
home_confide_aaaeba
))
.
setFontSize
(
11
,
true
)
.
create
()
tv_score
.
text
=
bodyBean
.
confidePraiseScore
if
(
bodyBean
.
confideFee
==
"0"
&&
bodyBean
.
confideLine
==
1
)
{
confide_free_logo
.
visibility
=
VISIBLE
Glide
.
with
(
context
)
.
load
(
R
.
drawable
.
home_confide__free
)
.
diskCacheStrategy
(
DiskCacheStrategy
.
RESOURCE
)
.
into
(
confide_free_logo
)
}
else
{
confide_free_logo
.
visibility
=
GONE
}
}
/**
* 设置
红包、原价
* 设置
在线状态
*/
@SuppressLint
(
"SetTextI18n"
)
private
fun
setCoupon
(
bodyBean
:
HomeConfideBean
.
BodyBean
)
{
private
fun
setLineStatus
(
bodyBean
:
HomeConfideBean
.
BodyBean
)
{
when
(
bodyBean
.
confideLine
)
{
//1在线 2离线 3通话中
1
,
4
->
{
tv_online
.
text
=
"在线"
tv_online
.
setBackgroundResource
(
R
.
drawable
.
home_confide_online_main
)
}
2
->
{
tv_online
.
text
=
"离线"
tv_online
.
setBackgroundResource
(
R
.
drawable
.
home_confide_offline_bg
)
}
3
->
{
tv_online
.
text
=
"通话中"
tv_online
.
setBackgroundResource
(
R
.
drawable
.
home_confide_online_main
)
}
}
}
if
(!
TextUtils
.
isEmpty
(
bodyBean
.
couponText
)){
tvCoupon
.
text
=
bodyBean
.
couponText
tvCoupon
.
visibility
=
View
.
VISIBLE
}
else
{
tvCoupon
.
visibility
=
View
.
GONE
private
fun
setConfideTag
(
bodyBean
:
HomeConfideBean
.
BodyBean
)
{
if
(
null
==
bodyBean
.
confidedTag
||
bodyBean
.
confidedTag
!!
.
isEmpty
())
{
return
}
if
(
TextUtils
.
isEmpty
(
bodyBean
.
confideFee
)
||
TextUtils
.
isEmpty
(
bodyBean
.
couponMoney
)
||
bodyBean
.
couponMoney
!!
.
toFloat
()
<=
0
){
tvOriginalPrice
.
visibility
=
View
.
GONE
}
else
{
tvOriginalPrice
.
visibility
=
View
.
VISIBLE
val
originalBuffer
=
StringBuffer
()
originalBuffer
.
append
(
bodyBean
.
confideFee
).
append
(
"元/次"
)
tvOriginalPrice
.
text
=
originalBuffer
.
toString
()
//添加删除线
tvOriginalPrice
.
paint
.
flags
=
Paint
.
STRIKE_THRU_TEXT_FLAG
var
i
=
0
val
sb
=
StringBuilder
()
for
(
tag
in
bodyBean
.
confidedTag
!!
)
{
if
(
i
>
4
)
break
sb
.
append
(
tag
).
append
(
" | "
)
i
++
}
try
{
val
couponMoney
=
bodyBean
.
couponMoney
!!
.
toFloat
().
toInt
()
val
confideFee
=
bodyBean
.
confideFee
!!
.
toFloat
().
toInt
()
if
(
couponMoney
>=
confideFee
){
tv_price
.
text
=
"¥0"
}
else
{
val
price
=
confideFee
-
couponMoney
tv_price
.
text
=
"¥"
+
price
.
toString
()
}
}
catch
(
e
:
Exception
){
//防止数据类型变化引起奔溃
if
(
sb
.
length
>
3
)
{
sb
.
setLength
(
sb
.
length
-
3
)
}
flowlayout_tag
.
text
=
sb
.
toString
()
}
/**
* 设置红包、原价
*/
@SuppressLint
(
"SetTextI18n"
)
private
fun
setCoupon
(
bodyBean
:
HomeConfideBean
.
BodyBean
)
{
// if(!TextUtils.isEmpty(bodyBean.couponText)){
// tvCoupon.text = bodyBean.couponText
// tvCoupon.visibility = View.VISIBLE
// }else{
// tvCoupon.visibility = View.GONE
// }
// if (TextUtils.isEmpty(bodyBean.confideFee) || TextUtils.isEmpty(bodyBean.couponMoney) || bodyBean.couponMoney!!.toFloat() <= 0){
// tvOriginalPrice.visibility = View.GONE
// }else{
// tvOriginalPrice.visibility = View.VISIBLE
// val originalBuffer = StringBuffer()
// originalBuffer.append(bodyBean.confideFee).append("元/次")
// tvOriginalPrice.text = originalBuffer.toString()
// //添加删除线
// tvOriginalPrice.paint.flags = Paint.STRIKE_THRU_TEXT_FLAG
// }
// try {
// val couponMoney = bodyBean.couponMoney!!.toFloat().toInt()
// val confideFee = bodyBean.confideFee!!.toFloat().toInt()
//
// if (couponMoney >= confideFee){
// tv_price.text = "¥0"
// }else{
// val price = confideFee - couponMoney
// tv_price.text = "¥"+price.toString()
// }
// }catch (e:Exception){
// //防止数据类型变化引起奔溃
// }
}
}
m-home/src/ydl/res/drawable-xhdpi/home_confide__free.gif
0 → 100644
View file @
80e3afd0
21.1 KB
m-home/src/ydl/res/drawable/home_confide_offline_bg.xml
0 → 100644
View file @
80e3afd0
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<corners
android:bottomRightRadius=
"6dp"
/>
<solid
android:color=
"#4d000000"
/>
</shape>
\ No newline at end of file
m-home/src/ydl/res/drawable/home_confide_online_main.xml
0 → 100644
View file @
80e3afd0
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<corners
android:bottomRightRadius=
"6dp"
/>
<solid
android:color=
"#4d000000"
/>
</shape>
\ No newline at end of file
m-home/src/ydl/res/drawable/home_confide_recommend_expert_line_bg.xml
0 → 100644
View file @
80e3afd0
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<corners
android:topRightRadius=
"100dp"
android:bottomRightRadius=
"100dp"
/>
<solid
android:color=
"#40FFFFFF"
/>
</shape>
\ No newline at end of file
m-home/src/ydl/res/layout/home_confide_item_layout.xml
0 → 100644
View file @
80e3afd0
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:background=
"@color/white"
tools:ignore=
"MissingDefaultResource"
>
<androidx.cardview.widget.CardView
android:id=
"@+id/card_view"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
app:cardElevation=
"0dp"
app:cardCornerRadius=
"6dp"
android:layout_marginTop=
"20dp"
android:layout_marginStart=
"15dp"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
>
<FrameLayout
android:layout_width=
"96dp"
android:layout_height=
"96dp"
>
<ImageView
android:id=
"@+id/img_head"
android:layout_width=
"96dp"
android:layout_height=
"96dp"
android:scaleType=
"fitXY"
/>
<TextView
android:id=
"@+id/tv_online"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:paddingLeft=
"9dp"
android:paddingRight=
"9dp"
android:paddingTop=
"1dp"
android:paddingBottom=
"1dp"
android:textSize=
"10sp"
android:textColor=
"@color/white"
android:background=
"@drawable/home_confide_recommend_expert_line_bg"
tools:text=
"在线"
/>
<ImageView
android:id=
"@+id/iv_play"
android:layout_width=
"24dp"
android:layout_height=
"24dp"
android:layout_gravity=
"bottom|right"
android:layout_marginBottom=
"8dp"
android:layout_marginEnd=
"8dp"
/>
</FrameLayout>
</androidx.cardview.widget.CardView>
<TextView
android:id=
"@+id/tv_name"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"12dp"
android:textColor=
"#333333"
android:textSize=
"16sp"
android:textStyle=
"bold"
app:layout_constraintStart_toEndOf=
"@id/card_view"
app:layout_constraintTop_toTopOf=
"@id/card_view"
tools:text=
"姚雨晴"
/>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:id=
"@+id/ll_confide_data"
app:layout_constraintTop_toBottomOf=
"@id/tv_name"
app:layout_constraintStart_toEndOf=
"@id/card_view"
android:layout_marginStart=
"12dp"
android:orientation=
"horizontal"
>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
android:gravity=
"center"
>
<TextView
android:id=
"@+id/tv_Connection"
android:layout_marginTop=
"12dp"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"14sp"
android:textColor=
"#555555"
android:textStyle=
"bold"
tools:text=
"83%"
/>
<TextView
android:id=
"@+id/tv_ConnectionContent"
android:layout_marginTop=
"3dp"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"12sp"
android:textColor=
"#69696A"
android:text=
"接通率"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
android:gravity=
"center"
android:layout_marginStart=
"25dp"
>
<TextView
android:id=
"@+id/tv_confideNum"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"@dimen/platform_sp_14"
android:textColor=
"#555555"
android:textStyle=
"bold"
android:layout_marginTop=
"12dp"
tools:text=
"8000人"
/>
<TextView
android:id=
"@+id/tv_tv_confideNumContent"
android:layout_marginTop=
"@dimen/platform_dp_3"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"@dimen/platform_sp_12"
android:textColor=
"#69696A"
android:text=
"倾诉人次"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
android:gravity=
"center"
android:layout_marginStart=
"25dp"
>
<TextView
android:id=
"@+id/tv_score"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"@dimen/platform_sp_14"
android:textColor=
"#555555"
android:textStyle=
"bold"
android:layout_marginTop=
"12dp"
tools:text=
"4.9"
/>
<TextView
android:id=
"@+id/tv_tv_ScoreContent"
android:layout_marginTop=
"@dimen/platform_dp_3"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"@dimen/platform_sp_12"
android:textColor=
"#69696A"
android:text=
"评分"
/>
</LinearLayout>
</LinearLayout>
<TextView
android:id=
"@+id/price_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"3dp"
android:layout_marginRight=
"16dp"
android:text=
"50元/25分钟"
android:textSize=
"@dimen/platform_sp_12"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/ll_confide_data"
/>
<TextView
android:id=
"@+id/flowlayout_tag"
android:layout_width=
"0dp"
android:layout_height=
"16dp"
android:layout_marginStart=
"12dp"
android:layout_marginEnd=
"12dp"
android:textColor=
"#9495A0"
android:maxLines=
"1"
android:ellipsize=
"end"
android:textSize=
"12sp"
app:layout_constraintBottom_toBottomOf=
"@+id/card_view"
app:layout_constraintEnd_toStartOf=
"@+id/price_content"
app:layout_constraintStart_toEndOf=
"@+id/card_view"
/>
<TextView
android:id=
"@+id/tv_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"13sp"
android:textColor=
"#919190"
android:maxLines=
"2"
android:ellipsize=
"end"
app:layout_constraintTop_toBottomOf=
"@id/card_view"
app:layout_constraintStart_toStartOf=
"@id/card_view"
android:layout_marginTop=
"@dimen/platform_dp_15"
tools:text=
"没有人一出生就是完美的,只有不断的相信自...己…才能成就自己的梦想。"
/>
<FrameLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"8dp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
>
<TextView
android:id=
"@+id/tv_confide"
android:layout_width=
"40dp"
android:layout_height=
"40dp"
android:layout_marginTop=
"@dimen/platform_dp_15"
android:layout_marginEnd=
"@dimen/platform_dp_15"
android:gravity=
"center"
/>
<ImageView
android:layout_width=
"42dp"
android:layout_height=
"21dp"
android:id=
"@+id/confide_free_logo"
android:layout_marginTop=
"@dimen/platform_dp_5"
android:layout_marginStart=
"@dimen/platform_dp_8"
/>
</FrameLayout>
<View
android:layout_width=
"match_parent"
android:layout_height=
"0.5dp"
app:layout_constraintTop_toBottomOf=
"@id/tv_content"
android:layout_marginTop=
"@dimen/platform_dp_12"
android:layout_marginLeft=
"15dp"
android:background=
"#F0F0F0"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
m-home/src/ydl/res/values/colors.xml
View file @
80e3afd0
...
...
@@ -4,5 +4,9 @@
<color
name=
"white_60"
>
#99FFFFFF
</color>
<color
name=
"white"
>
#FFFFFF
</color>
<color
name=
"home_confide_61CEAC"
>
#61CEAC
</color>
<color
name=
"home_confide_48CC95"
>
#48CC95
</color>
<color
name=
"home_confide_fe6040"
>
#fe6040
</color>
<color
name=
"home_confide_aaaeba"
>
#aaaeba
</color>
</resources>
m-im/src/main/java/com/yidianling/im/bean/CanViewConsult.kt
0 → 100644
View file @
80e3afd0
package
com.yidianling.im.bean
data class
CanViewConsult
(
val
canViewConsult
:
Boolean
=
false
)
m-im/src/main/java/com/yidianling/uikit/business/session/fragment/YDLMessageFragment.java
View file @
80e3afd0
...
...
@@ -280,11 +280,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
//做灵犀2.0 去掉常用语逻辑
//rl_common_question_enter.setVisibility(ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getUserType() == 3 ? View.VISIBLE : View.GONE);
if
(
null
!=
ActionHandlerStorage
.
getL
(
sessionId
)&&
ActionHandlerStorage
.
getL
(
sessionId
).
getUserType
()
!=
2
)
{
if
(
null
!=
getActivity
()
&&
null
!=
rela_zixun
)
{
rela_zixun
.
setVisibility
(
View
.
GONE
);
}
}
if
(
null
!=
ActionHandlerStorage
.
getL
(
sessionId
)&&
ActionHandlerStorage
.
getL
(
sessionId
).
isNotPrepare
())
{
IMChatUtil
.
INSTANCE
.
prepareChatData
((
AppCompatActivity
)
getActivity
(),
sessionId
,
(
expertInfo
)
->
{
String
toUid
=
expertInfo
.
shareData
.
toUid
;
...
...
@@ -305,7 +301,6 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
//如果是群聊
if
(
SessionTypeEnum
.
Team
==
sessionType
){
titleBar
.
setRightIcon
(
getContext
().
getDrawable
(
R
.
drawable
.
platform_common_more
));
rela_zixun
.
setVisibility
(
View
.
GONE
);
titleBar
.
setTitleRightDraw
(
null
);
}
}
...
...
@@ -328,6 +323,22 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
});
}
boolean
isExpert
=
null
!=
ActionHandlerStorage
.
getL
(
sessionId
)&&
ActionHandlerStorage
.
getL
(
sessionId
).
getUserType
()
==
2
;
ServiceImpl
.
Companion
.
getInstance
().
canViewConsult
(
""
)
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
response
->
{
if
(
response
.
code
.
equals
(
"200"
)){
if
(
response
.
data
!=
null
&&
response
.
data
.
getCanViewConsult
()){
if
(
isExpert
&&
sessionType
!=
SessionTypeEnum
.
Team
)
{
rela_zixun
.
setVisibility
(
View
.
VISIBLE
);
}
}
}
}
);
//有未完成订单或者有未评价订单时,显示订单布局
if
(
ActionHandlerStorage
.
getL
(
sessionId
)
!=
null
&&
ActionHandlerStorage
.
getL
(
sessionId
).
getInfo
()
!=
null
)
{
if
(
ActionHandlerStorage
.
getL
(
sessionId
).
getInfo
().
hasAvailableListenOrder
==
2
||
ActionHandlerStorage
.
getL
(
sessionId
).
getInfo
().
listenOrderCommentStatus
==
1
)
{
...
...
m-im/src/main/java/com/yidianling/uikit/custom/http/ServiceApi.kt
View file @
80e3afd0
...
...
@@ -4,6 +4,7 @@ import com.ydl.ydlcommon.base.config.YDL_DOMAIN
import
com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA
import
com.ydl.ydlcommon.data.http.BaseAPIResponse
import
com.yidianling.im.bean.BusyBean
import
com.yidianling.im.bean.CanViewConsult
import
com.yidianling.im.bean.FirstQuestionBean
import
com.yidianling.uikit.custom.http.response.*
import
com.yidianling.uikit.custom.http.response.question.QuestionsInfoBean
...
...
@@ -125,4 +126,10 @@ interface ServiceApi {
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
,
"X-App-Id: crm_cloud"
)
fun
getFirstQuestion
(
@Body
map
:
Map
<
String
,
@JvmSuppressWildcards
Any
>):
Observable
<
BaseAPIResponse
<
FirstQuestionBean
>>
//倾诉2.0迭代 是否显示立即咨询按钮
@GET
(
"consult/expert-page/canViewConsult"
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
fun
canViewConsult
(
@Query
(
"doctorId"
)
doctorId
:
String
):
Observable
<
BaseAPIResponse
<
CanViewConsult
>>
}
\ No newline at end of file
m-im/src/main/java/com/yidianling/uikit/custom/http/ServiceImpl.kt
View file @
80e3afd0
...
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON
import
com.ydl.ydlcommon.data.http.BaseAPIResponse
import
com.ydl.ydlnet.YDLHttpUtils
import
com.yidianling.im.bean.BusyBean
import
com.yidianling.im.bean.CanViewConsult
import
com.yidianling.im.bean.FirstQuestionBean
import
com.yidianling.im.http.ImRetrofitApi
import
com.yidianling.uikit.custom.http.response.*
...
...
@@ -200,4 +201,11 @@ class ServiceImpl private constructor() {
return
YDLHttpUtils
.
obtainApi
(
ServiceApi
::
class
.
java
).
getFirstQuestion
(
map
)
}
/**
* 是否显示立即咨询
*/
fun
canViewConsult
(
doctorId
:
String
):
Observable
<
BaseAPIResponse
<
CanViewConsult
>>{
return
YDLHttpUtils
.
obtainApi
(
ServiceApi
::
class
.
java
).
canViewConsult
(
doctorId
)
}
}
\ No newline at end of file
m-im/src/main/java/com/yidianling/uikit/custom/widget/ConfideOrderInfoView.java
View file @
80e3afd0
...
...
@@ -9,12 +9,18 @@ import android.widget.ImageView;
import
android.widget.RelativeLayout
;
import
android.widget.TextView
;
import
androidx.fragment.app.FragmentActivity
;
import
com.netease.nimlib.sdk.NIMClient
;
import
com.netease.nimlib.sdk.RequestCallback
;
import
com.netease.nimlib.sdk.msg.MessageBuilder
;
import
com.netease.nimlib.sdk.msg.MsgService
;
import
com.netease.nimlib.sdk.msg.constant.SessionTypeEnum
;
import
com.netease.nimlib.sdk.msg.model.IMMessage
;
import
com.ydl.confide.api.ConfideRoute
;
import
com.ydl.confide.api.IConfideService
;
import
com.ydl.ydlcommon.base.config.HttpConfig
;
import
com.ydl.ydlcommon.utils.Utils
;
import
com.yidianling.common.tools.RxImageTool
;
import
com.yidianling.common.tools.ToastUtil
;
import
com.yidianling.im.R
;
...
...
@@ -27,6 +33,10 @@ import com.ydl.ydlcommon.router.YdlCommonRouterManager;
import
com.ydl.ydlcommon.utils.StringUtils
;
import
com.ydl.ydlcommon.utils.YDLCacheUtils
;
import
static
com
.
ydl
.
ydlcommon
.
modular
.
ModularServiceManagerKt
.
findRouteService
;
/**
* Created by haorui on 2019/5/22.
* Des:
...
...
@@ -129,9 +139,28 @@ public class ConfideOrderInfoView extends RelativeLayout {
//点击整个view,跳转订单详情页面
setOnClickListener
(
view
->
{
if
(!
TextUtils
.
isEmpty
(
info
.
listenOrderUrl
))
{
//订单详情
H5Params
h5Params
=
new
H5Params
(
info
.
listenOrderUrl
,
"订单详情"
);
NewH5Activity
.
start
(
mContext
,
h5Params
);
if
(
Utils
.
isFastClick
()){
return
;
}
String
remainTime
=
ActionHandlerStorage
.
getL
(
mSessionId
).
getInfo
().
listenOrderRemainTime
;
if
(
TextUtils
.
isEmpty
(
remainTime
)){
if
(!
TextUtils
.
isEmpty
(
info
.
listenOrderUrl
))
{
//订单详情
H5Params
h5Params
=
new
H5Params
(
info
.
listenOrderUrl
,
"订单详情"
);
NewH5Activity
.
start
(
mContext
,
h5Params
);
}
}
else
{
if
(
info
!=
null
){
String
confideId
=
info
.
listenerId
;
findRouteService
(
IConfideService
.
class
)
.
showExpertDetailDialog
(
(
FragmentActivity
)
mContext
,
HttpConfig
.
Companion
.
getMH5_URL
()
+
ConfideRoute
.
INSTANCE
.
h5ConfideIntro
(
confideId
),
info
.
doctorId
,
info
.
toUid
);
}
}
});
}
...
...
m-im/src/main/res_uikit/layout/im_ydl_nim_message_fragment.xml
View file @
80e3afd0
...
...
@@ -487,12 +487,14 @@
android:background=
"@drawable/im_bg_im_consult_action"
android:gravity=
"center"
android:paddingLeft=
"17dp"
android:paddingRight=
"11dp"
>
android:paddingRight=
"11dp"
android:visibility=
"gone"
tools:visibility=
"visible"
>
<TextView
android:id=
"@+id/action_yuyue"
android:layout_width=
"wrap_content"
android:layout_height=
"
match_parent
"
android:layout_height=
"
36dp
"
android:gravity=
"center"
android:paddingLeft=
"5dp"
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