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
cfc16170
Commit
cfc16170
authored
Jun 21, 2022
by
fengquan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: Code Review代码调整
parent
2e1cb369
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
38 deletions
+60
-38
ConfideBottomSheetDialogFragment.kt
m-confide/src/main/java/com/ydl/confide/home/ConfideBottomSheetDialogFragment.kt
+54
-32
ConfideHomeActivity.kt
m-confide/src/main/java/com/ydl/confide/home/ConfideHomeActivity.kt
+1
-1
ConfideHomeRecommendExpertItemView.kt
m-confide/src/main/java/com/ydl/confide/home/widget/ConfideHomeRecommendExpertItemView.kt
+1
-1
ConfideHomeRecommendView.kt
m-confide/src/main/java/com/ydl/confide/home/widget/ConfideHomeRecommendView.kt
+2
-2
ItemIntroHolder.kt
m-confide/src/main/java/com/ydl/confide/intro/ItemIntroHolder.kt
+2
-2
No files found.
m-confide/src/main/java/com/ydl/confide/home/ConfideBottomSheetDialogFragment.kt
View file @
cfc16170
...
...
@@ -84,18 +84,18 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
lateinit
var
layout_change_text
:
View
lateinit
var
layoutBottom
:
View
lateinit
var
itemView
:
View
var
lineStatus
:
Int
=
0
var
bottomSheet
:
FrameLayout
?=
null
var
mJtoJHandle
:
IJavascriptHandler
?=
null
var
lineStatus
:
Int
=
0
var
bottomSheet
:
FrameLayout
?
=
null
var
mJtoJHandle
:
IJavascriptHandler
?
=
null
private
var
behavior
:
BottomSheetBehavior
<*>?
=
null
var
isLogin
:
Boolean
=
false
var
isLogin
:
Boolean
=
false
lateinit
var
jumpUrl
:
String
lateinit
var
doctorId
:
String
lateinit
var
expertUrl
:
String
lateinit
var
expertUrl
:
String
var
shouldShow
:
Boolean
?
=
false
var
uid
:
String
?
=
null
var
listen_free
:
Boolean
=
false
var
listen_free
:
Boolean
=
false
fun
showBottomSheetDialog
(
activity
:
FragmentActivity
,
jumpUrl
:
String
,
...
...
@@ -103,15 +103,15 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
shouldShow
:
Boolean
=
false
,
uid
:
String
?
=
null
,
listenFree
:
Boolean
=
false
,
expertUrl
:
String
=
""
expertUrl
:
String
=
""
)
{
arguments
=
Bundle
().
apply
{
putString
(
KEY_JUMP_URL
,
jumpUrl
)
putString
(
KEY_DOCTOR_ID
,
doctorId
)
putBoolean
(
KEY_SHOULD_SHOW
,
shouldShow
)
putBoolean
(
KEY_LISTEN_FREE
,
listenFree
)
putBoolean
(
KEY_LISTEN_FREE
,
listenFree
)
uid
?.
let
{
putString
(
KEY_UID
,
it
)
}
putString
(
EXPERT_URL
,
expertUrl
)
putString
(
EXPERT_URL
,
expertUrl
)
}
show
(
activity
.
supportFragmentManager
,
"confide_bottom_showdialog"
)
}
...
...
@@ -134,10 +134,13 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
override
fun
onViewCreated
(
view
:
View
,
savedInstanceState
:
Bundle
?)
{
super
.
onViewCreated
(
view
,
savedInstanceState
)
ActionCountUtils
.
record
(
"ydl_experts_detail_popupwindows_page"
,
"ydl_experts_detail_popupwindows_page_visit"
)
ActionCountUtils
.
record
(
"ydl_experts_detail_popupwindows_page"
,
"ydl_experts_detail_popupwindows_page_visit"
)
jumpUrl
=
arguments
?.
getString
(
KEY_JUMP_URL
)
?:
""
doctorId
=
arguments
?.
getString
(
KEY_DOCTOR_ID
)
?:
""
expertUrl
=
arguments
?.
getString
(
EXPERT_URL
)
?:
""
expertUrl
=
arguments
?.
getString
(
EXPERT_URL
)
?:
""
shouldShow
=
arguments
?.
getBoolean
(
KEY_SHOULD_SHOW
)
?:
false
uid
=
arguments
?.
getString
(
KEY_UID
)
listen_free
=
arguments
?.
getBoolean
(
KEY_LISTEN_FREE
)
?:
false
...
...
@@ -198,7 +201,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
first_order
.
visibility
=
if
(
isLogin
)
View
.
GONE
else
View
.
VISIBLE
val
controller
:
DraweeController
=
Fresco
.
newDraweeControllerBuilder
()
.
setUri
(
Uri
.
parse
(
"res://drawable/"
+
R
.
drawable
.
confide_first_order
))
.
setUri
(
Uri
.
parse
(
"res://drawable/"
+
R
.
drawable
.
confide_first_order
))
.
setOldController
(
first_order
.
controller
)
.
setAutoPlayAnimations
(
true
)
// 是否自动播放Gif动画
.
build
()
...
...
@@ -227,12 +230,12 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
return
@setOnClickListener
}
when
(
lineStatus
)
{
1
,
4
->
{
when
(
lineStatus
)
{
1
,
4
->
{
callJsFun
(
wv_content
,
"listenCallClick()"
)
}
3
,
6
->
{
3
,
6
->
{
if
(!
uid
.
isNullOrBlank
())
{
activity
?.
let
{
it1
->
ARouter
.
getInstance
().
navigation
(
IImService
::
class
.
java
)
...
...
@@ -241,21 +244,25 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
}
}
5
->
{
if
(!
TextUtils
.
isEmpty
(
expertUrl
)){
5
->
{
if
(!
TextUtils
.
isEmpty
(
expertUrl
))
{
val
linkUri
=
Uri
.
parse
(
expertUrl
)
if
(
linkUri
!=
null
)
{
val
host
=
linkUri
.
host
if
(!
TextUtils
.
isEmpty
(
host
)
&&
host
==
"h5"
)
{
//如果是h5,跳转至NewH5Activity
try
{
var
params
=
URLDecoder
.
decode
(
linkUri
.
getQueryParameter
(
"params"
),
"UTF-8"
)
ARouter
.
getInstance
().
build
(
"/new_h5/h5"
).
withSerializable
(
"routerParam"
,
params
).
navigation
()
}
catch
(
e
:
NullPointerException
){
var
params
=
URLDecoder
.
decode
(
linkUri
.
getQueryParameter
(
"params"
),
"UTF-8"
)
ARouter
.
getInstance
().
build
(
"/new_h5/h5"
)
.
withSerializable
(
"routerParam"
,
params
).
navigation
()
}
catch
(
e
:
NullPointerException
)
{
LogUtil
.
e
(
"params参数为空"
)
}
catch
(
e
:
UnsupportedEncodingException
)
{
}
catch
(
e
:
UnsupportedEncodingException
)
{
LogUtil
.
e
(
"解码错误"
)
}
catch
(
e
:
UnsupportedOperationException
)
{
}
catch
(
e
:
UnsupportedOperationException
)
{
LogUtil
.
e
(
"这不是一个uri格式的地址"
)
}
}
...
...
@@ -272,6 +279,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
}
}
override
fun
onCreateDialog
(
savedInstanceState
:
Bundle
?):
Dialog
{
val
dialog
=
super
.
onCreateDialog
(
savedInstanceState
)
as
BottomSheetDialog
onShowReady
()
...
...
@@ -291,12 +299,12 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
behavior
=
BottomSheetBehavior
.
from
(
bottomSheet
!!
)
behavior
?.
peekHeight
=
(
resources
.
displayMetrics
.
heightPixels
*
0.7F
).
roundToInt
()
if
(
jumpUrl
?.
contains
(
"payPage=1"
)){
if
(
jumpUrl
?.
contains
(
"payPage=1"
))
{
//支付高度
setMaxHeight
(
RxImageTool
.
dp2px
(
450f
))
behavior
?.
isHideable
=
false
rl_title
.
visibility
=
View
.
GONE
}
else
{
}
else
{
setMaxHeight
(
resources
.
displayMetrics
.
heightPixels
)
}
//true是跳过peekHeight,直接滑下去,false是可以滑动到顶部还可以保持peekHeight在滑下去
...
...
@@ -307,7 +315,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
BottomSheetBehavior
.
STATE_EXPANDED
->
{
bottomSheet
.
background
=
ColorDrawable
(
Color
.
WHITE
)
if
(!
jumpUrl
?.
contains
(
"payPage=1"
)){
if
(!
jumpUrl
?.
contains
(
"payPage=1"
))
{
rl_title
.
visibility
=
View
.
VISIBLE
text_title
.
visibility
=
View
.
VISIBLE
close_webview_Icon
.
visibility
=
View
.
VISIBLE
...
...
@@ -337,10 +345,12 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
}
return
dialog
}
private
fun
setMaxHeight
(
height
:
Int
){
private
fun
setMaxHeight
(
height
:
Int
)
{
bottomSheet
?.
layoutParams
?.
height
=
height
bottomSheet
?.
requestLayout
()
}
private
fun
callJsFun
(
wv_content
:
ProgressWebView
,
funcName
:
String
)
{
val
sb
=
StringBuffer
(
"javascript:"
)
sb
.
append
(
funcName
)
...
...
@@ -383,7 +393,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
this
.
doctorId
=
doctorId
onLoadDialStatus
(
doctorId
)
val
confideHomeActivity
=
activity
as
ConfideHomeActivity
expertUrl
=
confideHomeActivity
.
searchLinkUrlByUid
(
uid
)
expertUrl
=
confideHomeActivity
?.
searchLinkUrlByUid
(
uid
)
?:
""
callJsFun
(
wv_content
,
"setUnRead(${getUnReadByUid(uid = uid)})"
)
}
...
...
@@ -571,15 +581,15 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
layoutCall
.
visibility
=
View
.
VISIBLE
lineStatus
=
resp
.
data
?.
confideLine
?:
2
if
(
isLogin
&&
listen_free
){
if
(
isLogin
&&
listen_free
)
{
free
.
visibility
=
View
.
VISIBLE
val
controller
:
DraweeController
=
Fresco
.
newDraweeControllerBuilder
()
.
setUri
(
Uri
.
parse
(
"res://drawable/"
+
R
.
drawable
.
confide_free
))
.
setUri
(
Uri
.
parse
(
"res://drawable/"
+
R
.
drawable
.
confide_free
))
.
setOldController
(
free
.
controller
)
.
setAutoPlayAnimations
(
true
)
// 是否自动播放Gif动画
.
build
()
free
.
controller
=
controller
}
else
{
}
else
{
free
.
visibility
=
View
.
GONE
}
/*
...
...
@@ -602,7 +612,12 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
context
?.
getDrawable
(
R
.
drawable
.
confide_line_bg_2
)
if
(
showTip
)
{
if
(!
uid
.
isNullOrBlank
())
{
findRouteService
(
IImService
::
class
.
java
).
startChat
(
requireActivity
(),
uid
!!
,
0
,
0
)
findRouteService
(
IImService
::
class
.
java
).
startChat
(
requireActivity
(),
uid
!!
,
0
,
0
)
}
}
}
...
...
@@ -616,7 +631,12 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
if
(
showTip
)
{
ToastUtil
.
toastShort
(
"对方正在通话中,请稍后拨打"
)
if
(!
uid
.
isNullOrBlank
())
{
findRouteService
(
IImService
::
class
.
java
).
startChat
(
requireActivity
(),
uid
!!
,
0
,
0
)
findRouteService
(
IImService
::
class
.
java
).
startChat
(
requireActivity
(),
uid
!!
,
0
,
0
)
}
}
}
...
...
@@ -661,10 +681,12 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
wv_content
.
destroy
()
EventBus
.
getDefault
().
unregister
(
this
)
}
//登录成功
fun
onEvent
(
event
:
UserLoginEvent
)
{
loadUrl
()
}
//绑定成功
fun
onEvent
(
event
:
UserBindPhoneEvent
)
{
loadUrl
()
...
...
m-confide/src/main/java/com/ydl/confide/home/ConfideHomeActivity.kt
View file @
cfc16170
...
...
@@ -666,7 +666,7 @@ class ConfideHomeActivity :
super
.
onBackPressed
()
}
public
fun
searchLinkUrlByUid
(
uid
:
String
):
String
{
fun
searchLinkUrlByUid
(
uid
:
String
):
String
{
cacheList
?.
forEach
{
confideHomeDataBean
->
confideHomeDataBean
.
body
?.
forEach
{
confideHomeBodyBean
->
if
(
uid
==
confideHomeBodyBean
.
uid
.
toString
()){
...
...
m-confide/src/main/java/com/ydl/confide/home/widget/ConfideHomeRecommendExpertItemView.kt
View file @
cfc16170
...
...
@@ -243,7 +243,7 @@ class ConfideHomeRecommendExpertItemView(mContext: Context, private var confideH
private
fun
click
(
bodyBean
:
ConfideHomeBodyBean
)
{
when
(
bodyBean
.
confideLine
)
{
//1在线 2离线 3通话中
1
,
3
,
4
->
{
confideHomeEvent
.
consultantClick
(
bodyBean
.
doctorId
,
bodyBean
.
confidedId
,
bodyBean
.
uid
?.
toString
(),
bodyBean
.
listenFree
)
confideHomeEvent
.
consultantClick
(
bodyBean
.
doctorId
,
bodyBean
.
confidedId
,
bodyBean
.
uid
?.
toString
(),
bodyBean
.
listenFree
)
}
2
->
{
//跳转私聊 并发送自定义消息
...
...
m-confide/src/main/java/com/ydl/confide/home/widget/ConfideHomeRecommendView.kt
View file @
cfc16170
...
...
@@ -94,7 +94,7 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
"1"
)
confideHomeEvent
.
consultantClick
(
bodyBean
.
doctorId
,
bodyBean
.
confidedId
,
bodyBean
.
uid
?.
toString
(),
bodyBean
.
listenFree
,
bodyBean
.
linkUrl
)
confideHomeEvent
.
consultantClick
(
bodyBean
.
doctorId
,
bodyBean
.
confidedId
,
bodyBean
.
uid
?.
toString
(),
bodyBean
.
listenFree
,
bodyBean
.
linkUrl
)
}
img_head
.
setOnClickListener
{
...
...
@@ -345,7 +345,7 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
if
(
bodyBean
.
confideLine
==
3
)
{
}
confideHomeEvent
.
consultantClick
(
bodyBean
.
doctorId
,
bodyBean
.
confidedId
,
bodyBean
.
uid
?.
toString
(),
bodyBean
.
listenFree
)
confideHomeEvent
.
consultantClick
(
bodyBean
.
doctorId
,
bodyBean
.
confidedId
,
bodyBean
.
uid
?.
toString
(),
bodyBean
.
listenFree
)
}
2
->
{
//跳转私聊 并发送自定义消息
...
...
m-confide/src/main/java/com/ydl/confide/intro/ItemIntroHolder.kt
View file @
cfc16170
...
...
@@ -430,9 +430,9 @@ internal fun VideoViewModel.mapOf(bean: ConfideHomeBodyBean): VideoViewModel {
uid
=
bean
.
uid
?.
toString
()
doctorId
=
bean
.
doctorId
confideId
=
bean
.
confidedId
if
(
bean
.
listenFree
==
null
){
if
(
bean
.
listenFree
==
null
)
{
listenFree
.
set
(
false
)
}
else
{
}
else
{
listenFree
.
set
(
bean
.
listenFree
!!
)
}
return
this
...
...
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