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
dc73f7fd
Commit
dc73f7fd
authored
Jun 20, 2022
by
fengquan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 倾诉师介绍层离线按钮需求
parent
077b56ca
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
138 additions
and
10 deletions
+138
-10
ConfideBottomSheetDialogFragment.kt
m-confide/src/main/java/com/ydl/confide/home/ConfideBottomSheetDialogFragment.kt
+66
-3
ConfideHomeActivity.kt
m-confide/src/main/java/com/ydl/confide/home/ConfideHomeActivity.kt
+12
-0
ConfideHomeEventImpl.kt
m-confide/src/main/java/com/ydl/confide/home/event/ConfideHomeEventImpl.kt
+2
-2
IConfideHomeEvent.kt
m-confide/src/main/java/com/ydl/confide/home/event/IConfideHomeEvent.kt
+1
-1
ConfideHomeApi.kt
m-confide/src/main/java/com/ydl/confide/home/http/ConfideHomeApi.kt
+1
-1
ConfideLineBindingAdapter.kt
m-confide/src/main/java/com/ydl/confide/home/util/ConfideLineBindingAdapter.kt
+6
-0
ConfideHomeRecommendView.kt
m-confide/src/main/java/com/ydl/confide/home/widget/ConfideHomeRecommendView.kt
+1
-1
ItemIntroHolder.kt
m-confide/src/main/java/com/ydl/confide/intro/ItemIntroHolder.kt
+36
-0
confide_offline_book_bg.xml
m-confide/src/main/res/drawable/confide_offline_book_bg.xml
+11
-0
item_expert_intro.xml
m-confide/src/main/res/layout/item_expert_intro.xml
+1
-1
ErrorMessageConverter.java
ydl-tuicore/src/main/java/com/tencent/qcloud/tuicore/util/ErrorMessageConverter.java
+1
-1
No files found.
m-confide/src/main/java/com/ydl/confide/home/ConfideBottomSheetDialogFragment.kt
View file @
dc73f7fd
...
...
@@ -8,6 +8,7 @@ import android.graphics.drawable.ColorDrawable
import
android.net.Uri
import
android.os.Build
import
android.os.Bundle
import
android.text.TextUtils
import
android.view.Gravity
import
android.view.LayoutInflater
import
android.view.View
...
...
@@ -40,6 +41,7 @@ import com.ydl.ydlcommon.utils.TimeUtil
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.ydl.ydlcommon.view.dialog.CommonDialog
import
com.ydl.ydlnet.YDLHttpUtils
import
com.yidianling.common.tools.LogUtil
import
com.yidianling.common.tools.RxImageTool
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.im.api.service.IImService
...
...
@@ -49,6 +51,8 @@ import com.yidianling.user.api.service.IUserService
import
de.greenrobot.event.EventBus
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.schedulers.Schedulers
import
java.io.UnsupportedEncodingException
import
java.net.URLDecoder
import
java.util.*
import
kotlin.math.roundToInt
...
...
@@ -59,6 +63,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
private
const
val
KEY_SHOULD_SHOW
=
"should_show"
private
const
val
KEY_LISTEN_FREE
=
"listen_free"
private
const
val
KEY_UID
=
"uid"
private
const
val
EXPERT_URL
=
"expert_url"
}
private
var
firstVisitWXH5PayUrl
=
true
...
...
@@ -79,6 +84,7 @@ 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
...
...
@@ -86,6 +92,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
var
isLogin
:
Boolean
=
false
lateinit
var
jumpUrl
:
String
lateinit
var
doctorId
:
String
lateinit
var
expertUrl
:
String
var
shouldShow
:
Boolean
?
=
false
var
uid
:
String
?
=
null
var
listen_free
:
Boolean
=
false
...
...
@@ -95,7 +102,8 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
doctorId
:
String
,
shouldShow
:
Boolean
=
false
,
uid
:
String
?
=
null
,
listenFree
:
Boolean
=
false
listenFree
:
Boolean
=
false
,
expertUrl
:
String
=
""
)
{
arguments
=
Bundle
().
apply
{
putString
(
KEY_JUMP_URL
,
jumpUrl
)
...
...
@@ -103,6 +111,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
putBoolean
(
KEY_SHOULD_SHOW
,
shouldShow
)
putBoolean
(
KEY_LISTEN_FREE
,
listenFree
)
uid
?.
let
{
putString
(
KEY_UID
,
it
)
}
putString
(
EXPERT_URL
,
expertUrl
)
}
show
(
activity
.
supportFragmentManager
,
"confide_bottom_showdialog"
)
}
...
...
@@ -128,6 +137,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
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
)
?:
""
shouldShow
=
arguments
?.
getBoolean
(
KEY_SHOULD_SHOW
)
?:
false
uid
=
arguments
?.
getString
(
KEY_UID
)
listen_free
=
arguments
?.
getBoolean
(
KEY_LISTEN_FREE
)
?:
false
...
...
@@ -216,7 +226,44 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
.
show
()
return
@setOnClickListener
}
callJsFun
(
wv_content
,
"listenCallClick()"
)
when
(
lineStatus
){
1
,
4
->{
callJsFun
(
wv_content
,
"listenCallClick()"
)
}
3
,
6
->{
if
(!
uid
.
isNullOrBlank
())
{
activity
?.
let
{
it1
->
ARouter
.
getInstance
().
navigation
(
IImService
::
class
.
java
)
?.
startChatBySessionId
(
it1
,
uid
!!
)
}
}
}
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
){
LogUtil
.
e
(
"params参数为空"
)
}
catch
(
e
:
UnsupportedEncodingException
){
LogUtil
.
e
(
"解码错误"
)
}
catch
(
e
:
UnsupportedOperationException
){
LogUtil
.
e
(
"这不是一个uri格式的地址"
)
}
}
}
}
}
}
}
layoutChange
.
setOnClickListener
{
layout_change_text
.
visibility
=
View
.
GONE
...
...
@@ -335,6 +382,8 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
layout_change_text
.
visibility
=
View
.
VISIBLE
this
.
doctorId
=
doctorId
onLoadDialStatus
(
doctorId
)
val
confideHomeActivity
=
activity
as
ConfideHomeActivity
expertUrl
=
confideHomeActivity
.
searchLinkUrlByUid
(
uid
)
callJsFun
(
wv_content
,
"setUnRead(${getUnReadByUid(uid = uid)})"
)
}
...
...
@@ -520,7 +569,7 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
.
subscribe
({
resp
->
if
(
resp
.
code
==
"200"
)
{
layoutCall
.
visibility
=
View
.
VISIBLE
val
lineStatus
=
resp
.
data
?.
confideLine
?:
2
lineStatus
=
resp
.
data
?.
confideLine
?:
2
if
(
isLogin
&&
listen_free
){
free
.
visibility
=
View
.
VISIBLE
...
...
@@ -584,6 +633,20 @@ class ConfideBottomSheetDialogFragment : BottomSheetDialogFragment() {
}
}
5
->
{
tvCall
.
text
=
"已离线,可预约"
tvTime
.
visibility
=
View
.
GONE
ivCall
.
visibility
=
View
.
GONE
layoutCall
.
background
=
context
?.
getDrawable
(
R
.
drawable
.
confide_offline_book_bg
)
}
6
->
{
tvCall
.
text
=
"已离线,可留言"
tvTime
.
visibility
=
View
.
GONE
ivCall
.
visibility
=
View
.
GONE
layoutCall
.
background
=
context
?.
getDrawable
(
R
.
drawable
.
confide_offline_book_bg
)
}
}
}
else
{
if
(!
resp
.
msg
.
isNullOrEmpty
())
{
...
...
m-confide/src/main/java/com/ydl/confide/home/ConfideHomeActivity.kt
View file @
dc73f7fd
...
...
@@ -665,4 +665,15 @@ class ConfideHomeActivity :
}
super
.
onBackPressed
()
}
public
fun
searchLinkUrlByUid
(
uid
:
String
):
String
{
cacheList
?.
forEach
{
confideHomeDataBean
->
confideHomeDataBean
.
body
?.
forEach
{
confideHomeBodyBean
->
if
(
uid
==
confideHomeBodyBean
.
uid
.
toString
()){
return
confideHomeBodyBean
.
linkUrl
?:
""
}
}
}
return
""
}
}
\ No newline at end of file
m-confide/src/main/java/com/ydl/confide/home/event/ConfideHomeEventImpl.kt
View file @
dc73f7fd
...
...
@@ -132,13 +132,13 @@ class ConfideHomeEventImpl(context: Context, var confideHomeView: IConfideHomeCo
* 最佳倾诉榜单--点我倾诉
* @param linkUrl 跳转地址
*/
override
fun
consultantClick
(
doctorId
:
String
?,
confideId
:
String
?,
uid
:
String
?,
listenFree
:
Boolean
?)
{
override
fun
consultantClick
(
doctorId
:
String
?,
confideId
:
String
?,
uid
:
String
?,
listenFree
:
Boolean
?
,
expertUrl
:
String
?
)
{
confideId
?.
let
{
ConfideBottomSheetDialogFragment
()
.
showBottomSheetDialog
(
mContext
as
FragmentActivity
,
HttpConfig
.
MH5_URL
+
ConfideRoute
.
h5ConfideIntro
(
it
),
doctorId
!!
,
uid
=
uid
,
listenFree
=
listenFree
?:
false
doctorId
!!
,
uid
=
uid
,
listenFree
=
listenFree
?:
false
,
expertUrl
=
expertUrl
?:
""
)
}
}
...
...
m-confide/src/main/java/com/ydl/confide/home/event/IConfideHomeEvent.kt
View file @
dc73f7fd
...
...
@@ -73,7 +73,7 @@ interface IConfideHomeEvent {
* 咨询师推荐--点我倾诉
* @param linkUrl 跳转地址
*/
fun
consultantClick
(
doctorId
:
String
?,
confideId
:
String
?,
uid
:
String
?,
listenFree
:
Boolean
?=
false
)
fun
consultantClick
(
doctorId
:
String
?,
confideId
:
String
?,
uid
:
String
?,
listenFree
:
Boolean
?=
false
,
expertUrl
:
String
?=
""
)
fun
videoShowClick
(
index
:
Int
,
data
:
List
<
ConfideHomeBodyBean
>?)
...
...
m-confide/src/main/java/com/ydl/confide/home/http/ConfideHomeApi.kt
View file @
dc73f7fd
...
...
@@ -38,7 +38,7 @@ interface ConfideHomeApi {
// 1=在线 3-通话中 2-离线
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
@GET
(
"auth/listen/dialchangestatus"
)
fun
getDialStatus
(
@Query
(
"doctorId"
)
doctorId
:
String
):
Observable
<
BaseAPIResponse
<
DialStatus
>>
fun
getDialStatus
(
@Query
(
"doctorId"
)
doctorId
:
String
,
@Query
(
"listenVersion"
)
listenVersion
:
String
=
"2.1"
):
Observable
<
BaseAPIResponse
<
DialStatus
>>
@GET
fun
recommendDoctor
(
...
...
m-confide/src/main/java/com/ydl/confide/home/util/ConfideLineBindingAdapter.kt
View file @
dc73f7fd
...
...
@@ -19,6 +19,12 @@ fun TextView.confideLineText(line: Int) {
4
->{
text
=
"继续倾诉"
}
5
->{
text
=
"已离线,可预约"
}
6
->{
text
=
"已离线,可留言"
}
}
}
...
...
m-confide/src/main/java/com/ydl/confide/home/widget/ConfideHomeRecommendView.kt
View file @
dc73f7fd
...
...
@@ -94,7 +94,7 @@ class ConfideHomeRecommendView(var view: IConfideHomeContract.View, context: Con
"1"
)
confideHomeEvent
.
consultantClick
(
bodyBean
.
doctorId
,
bodyBean
.
confidedId
,
bodyBean
.
uid
?.
toString
(),
bodyBean
.
listenFree
)
confideHomeEvent
.
consultantClick
(
bodyBean
.
doctorId
,
bodyBean
.
confidedId
,
bodyBean
.
uid
?.
toString
(),
bodyBean
.
listenFree
,
bodyBean
.
linkUrl
)
}
img_head
.
setOnClickListener
{
...
...
m-confide/src/main/java/com/ydl/confide/intro/ItemIntroHolder.kt
View file @
dc73f7fd
...
...
@@ -2,6 +2,7 @@ package com.ydl.confide.intro
import
android.app.Activity
import
android.net.Uri
import
android.text.TextUtils
import
android.util.Log
import
android.view.View
import
android.widget.SeekBar
...
...
@@ -11,6 +12,7 @@ import androidx.databinding.ObservableInt
import
androidx.databinding.ViewDataBinding
import
androidx.fragment.app.FragmentActivity
import
androidx.recyclerview.widget.RecyclerView
import
com.alibaba.android.arouter.launcher.ARouter
import
com.dou361.ijkplayer.widget.IjkVideoView
import
com.facebook.drawee.backends.pipeline.Fresco
import
com.facebook.drawee.interfaces.DraweeController
...
...
@@ -35,6 +37,8 @@ import io.reactivex.disposables.Disposable
import
io.reactivex.schedulers.Schedulers
import
kotlinx.android.synthetic.main.confide_home_activity.*
import
tv.danmaku.ijk.media.player.IjkMediaPlayer
import
java.io.UnsupportedEncodingException
import
java.net.URLDecoder
import
java.net.URLEncoder
import
java.util.concurrent.TimeUnit
...
...
@@ -77,6 +81,36 @@ internal class ItemIntroHolder(binding: ItemExpertIntroBinding) :
)
val
status
=
item
.
lineStatus
.
get
()
when
(
status
)
{
5
->
{
if
(!
TextUtils
.
isEmpty
(
item
.
linkedUrl
.
get
())){
val
linkUri
=
Uri
.
parse
(
item
.
linkedUrl
.
get
())
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
){
com
.
yidianling
.
common
.
tools
.
LogUtil
.
e
(
"params参数为空"
)
}
catch
(
e
:
UnsupportedEncodingException
){
com
.
yidianling
.
common
.
tools
.
LogUtil
.
e
(
"解码错误"
)
}
catch
(
e
:
UnsupportedOperationException
){
com
.
yidianling
.
common
.
tools
.
LogUtil
.
e
(
"这不是一个uri格式的地址"
)
}
}
}
}
}
6
->
{
if
(!
item
.
uid
.
isNullOrBlank
())
{
(
itemView
.
context
as
?
Activity
)
?.
let
{
it1
->
ARouter
.
getInstance
().
navigation
(
IImService
::
class
.
java
)
?.
startChatBySessionId
(
it1
,
item
.
uid
!!
)
}
}
}
2
,
3
->
{
//离线,通话中
(
itemView
.
context
as
?
Activity
)
?.
let
{
aty
->
findRouteService
(
IImService
::
class
.
java
).
startChat
(
aty
,
item
.
uid
!!
,
0
,
0
)
...
...
@@ -360,6 +394,7 @@ class VideoViewModel {
var
doctorId
:
String
?
=
null
var
confideId
:
String
?
=
null
var
listenFree
=
ObservableBoolean
(
false
)
var
linkedUrl
=
ObservableField
<
String
>(
""
)
}
private
fun
genMinProgramPath
(
url
:
String
):
String
{
...
...
@@ -371,6 +406,7 @@ private fun genMinProgramPath(url: String): String {
internal
fun
VideoViewModel
.
mapOf
(
bean
:
ConfideHomeBodyBean
):
VideoViewModel
{
name
.
set
(
bean
.
confidedName
)
avatar
.
set
(
bean
.
confidedIcon
)
linkedUrl
.
set
(
bean
.
linkUrl
)
val
num
=
bean
.
confideNum
?.
replace
(
"人"
,
""
)
?:
"0"
count
.
set
(
"倾诉人次 $num"
)
intro
.
set
(
bean
.
confideContent
)
...
...
m-confide/src/main/res/drawable/confide_offline_book_bg.xml
0 → 100644
View file @
dc73f7fd
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<corners
android:radius=
"26dp"
/>
<gradient
android:endColor=
"#FE745B"
android:startColor=
"#FF8772"
/>
<stroke
android:width=
"1dp"
android:color=
"#69FFFFFF"
/>
</shape>
\ No newline at end of file
m-confide/src/main/res/layout/item_expert_intro.xml
View file @
dc73f7fd
...
...
@@ -100,7 +100,7 @@
android:layout_width=
"160dp"
android:layout_height=
"47dp"
android:layout_marginBottom=
"28dp"
android:background=
"@{item.lineStatus==3?@drawable/confide_line_bg_3:(item.lineStatus==2?@drawable/confide_line_bg_2:@drawable/confide_line_bg_1)}"
android:background=
"@{
(item.lineStatus == 5 || item.lineStatus == 6) ? @drawable/confide_offline_book_bg :
item.lineStatus==3?@drawable/confide_line_bg_3:(item.lineStatus==2?@drawable/confide_line_bg_2:@drawable/confide_line_bg_1)}"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
...
...
ydl-tuicore/src/main/java/com/tencent/qcloud/tuicore/util/ErrorMessageConverter.java
View file @
dc73f7fd
...
...
@@ -690,7 +690,7 @@ public class ErrorMessageConverter {
return
getLocalizedString
(
R
.
string
.
TUIKitErrorSVRNoSuccessResult
);
// @"批量操作无成功结果";
case
BaseConstants
.
ERR_TO_USER_INVALID
:
return
getLocalizedString
(
R
.
string
.
TUIKitErrorSVRToUserInvalid
);
// @"IM: 无效接收方";
case
BaseConstants
.
ERR_REQUEST_TIMEOUT
:
case
BaseConstants
.
ERR_REQUEST_TIME
_
OUT
:
return
getLocalizedString
(
R
.
string
.
TUIKitErrorSVRRequestTimeout
);
// @"请求超时";
case
BaseConstants
.
ERR_INIT_CORE_FAIL
:
return
getLocalizedString
(
R
.
string
.
TUIKitErrorSVRInitCoreFail
);
// @"INIT CORE模块失败";
...
...
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