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
9a2f791e
Commit
9a2f791e
authored
Feb 21, 2020
by
严久程
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代运营页面显示专家信息
parent
8cfe99cb
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
191 additions
and
64 deletions
+191
-64
build.gradle
app/build.gradle
+2
-2
MainActivity.kt
app/src/main/java/com/ydl/component/MainActivity.kt
+4
-4
FragmentContainerActivity.kt
app/src/main/java/com/ydl/component/music/FragmentContainerActivity.kt
+4
-4
config.gradle
config.gradle
+1
-1
YDLMessageFragment.java
m-im/src/main/java/com/yidianling/uikit/business/session/fragment/YDLMessageFragment.java
+69
-6
ServiceApi.kt
m-im/src/main/java/com/yidianling/uikit/custom/http/ServiceApi.kt
+15
-3
ServiceImpl.kt
m-im/src/main/java/com/yidianling/uikit/custom/http/ServiceImpl.kt
+10
-0
SourceDoctorInfoBean.java
m-im/src/main/java/com/yidianling/uikit/custom/http/response/SourceDoctorInfoBean.java
+14
-0
im_background_chat_assistant_to_doctor_name.xml
m-im/src/main/res_uikit/drawable/im_background_chat_assistant_to_doctor_name.xml
+11
-0
im_ydl_nim_message_fragment.xml
m-im/src/main/res_uikit/layout/im_ydl_nim_message_fragment.xml
+61
-44
No files found.
app/build.gradle
View file @
9a2f791e
...
...
@@ -181,13 +181,13 @@ dependencies {
implementation
project
(
':m-user'
)
implementation
modularPublication
(
'com.ydl:m-user-api'
)
api
project
(
':m-tests'
)
api
project
(
':m-consultant'
)
//
api project(':m-consultant')
implementation
modularPublication
(
'com.ydl:m-consultant-api'
)
// implementation project(':m-confide')
api
project
(
':m-home'
)
api
project
(
':m-confide'
)
//
api project(':m-confide')
// api "com.ydl:m-consultant-api:0.0.2"
// api 'com.ydl:m-consultant-module-ydl:0.0.18@aar'
...
...
app/src/main/java/com/ydl/component/MainActivity.kt
View file @
9a2f791e
...
...
@@ -18,7 +18,7 @@ import com.umeng.analytics.MobclickAgent
import
com.ydl.component.music.FragmentContainerActivity
import
com.ydl.component.mvp.DemoContract
import
com.ydl.component.mvp.DemoPresenter
import
com.ydl.confide.home.ConfideHomeActivity
//
import com.ydl.confide.home.ConfideHomeActivity
import
com.ydl.media.audio.PlayService
import
com.ydl.ydl_router.manager.YDLRouterManager
import
com.ydl.ydl_router.manager.YDLRouterParams
...
...
@@ -110,7 +110,7 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
}
bt_to_confide
.
setOnClickListener
{
// YDLavManager.instances.login("1193016")
startActivity
(
Intent
(
this
,
ConfideHomeActivity
::
class
.
java
))
//
startActivity(Intent(this, ConfideHomeActivity::class.java))
}
bt_to_muse
.
setOnClickListener
{
...
...
@@ -231,8 +231,8 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
super
.
onResume
()
MobclickAgent
.
onResume
(
this
)
ModularServiceManager
.
provide
(
IConsultantService
::
class
.
java
)
.
showConsultAssistantDialog
(
this
)
//
ModularServiceManager.provide(IConsultantService::class.java)
//
.showConsultAssistantDialog(this)
}
override
fun
onPause
()
{
...
...
app/src/main/java/com/ydl/component/music/FragmentContainerActivity.kt
View file @
9a2f791e
...
...
@@ -7,7 +7,7 @@ import com.ydl.component.mvp.DemoContract
import
com.ydl.component.mvp.DemoPresenter
import
com.ydl.ydlcommon.bean.StatusBarOptions
import
com.ydl.ydlcommon.mvp.lce.BaseLceActivity
import
com.yidianling.consultant.ExpertSearchFragment
//
import com.yidianling.consultant.ExpertSearchFragment
import
com.yidianling.dynamic.trendsHome.TrendsHomeFragment
import
com.yidianling.home.ui.fragment.YdlHomeFragment
//import com.yidianling.dynamic.trendsHome.TrendsHomeFragment
...
...
@@ -70,9 +70,9 @@ class FragmentContainerActivity : BaseLceActivity<DemoContract.View, DemoContra
if
(
"YdlHomeFragment"
==
fragmentName
)
{
return
YdlHomeFragment
()
}
if
(
"ExpertSearchFragment"
==
fragmentName
)
{
return
ExpertSearchFragment
()
}
//
if ("ExpertSearchFragment" == fragmentName) {
//
return ExpertSearchFragment()
//
}
return
PlayFragment
()
}
}
config.gradle
View file @
9a2f791e
ext
{
kotlin_version
=
"1.3.21"
dev_mode
=
fals
e
dev_mode
=
tru
e
ydl_app
=
[
appName
:
"心理咨询壹点灵"
,
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/fragment/YDLMessageFragment.java
View file @
9a2f791e
package
com
.
yidianling
.
uikit
.
business
.
session
.
fragment
;
import
android.animation.Animator
;
import
android.animation.ObjectAnimator
;
import
android.animation.ValueAnimator
;
import
android.annotation.SuppressLint
;
import
android.content.Intent
;
...
...
@@ -82,8 +83,6 @@ import com.yidianling.user.api.service.IUserService;
import
org.jetbrains.annotations.NotNull
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.List
;
...
...
@@ -113,6 +112,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
//快捷菜单
protected
RelativeLayout
lin_actions
;
protected
RelativeLayout
rl_doctor_name
;
private
LinearLayout
ll_actions_yi
;
...
...
@@ -159,13 +159,17 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
private
ImRedStarGradeView
good_num_icons
;
private
TextView
im_focus_btn
;
private
TextView
tv_from
;
private
TextView
tv_doctor_name
;
private
LinearLayout
top_view_container
;
private
LinearLayout
constraint_ll
;
private
LinearLayout
ll_info_detail
;
private
RelativeLayout
rela_zixun
;
private
ValueAnimator
anim_out
;
private
ObjectAnimator
sourceLayoutAnim
;
private
ValueAnimator
anim_in
;
private
Boolean
expertInfoViewIsIn
=
true
;
private
Boolean
expertInfoViewIsAnimating
=
false
;
...
...
@@ -219,6 +223,10 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
im_focus_btn
=
rootView
.
findViewById
(
R
.
id
.
im_focus_btn
);
good_num_icons
=
rootView
.
findViewById
(
R
.
id
.
good_num_icons
);
rela_zixun
=
rootView
.
findViewById
(
R
.
id
.
rela_zixun
);
rl_doctor_name
=
rootView
.
findViewById
(
R
.
id
.
rl_doctor_name
);
tv_from
=
rootView
.
findViewById
(
R
.
id
.
tv_from
);
ll_info_detail
=
rootView
.
findViewById
(
R
.
id
.
ll_info_detail
);
tv_doctor_name
=
rootView
.
findViewById
(
R
.
id
.
tv_doctor_name
);
//和助理私聊时的常用语逻辑
rl_common_question_enter
=
rootView
.
findViewById
(
R
.
id
.
rl_common_question
);
...
...
@@ -239,7 +247,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
}
else
{
try
{
YdlBuryPointUtil
.
sendPv
(
"common_question_pager"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
}
getCommonQuestionListData
();
...
...
@@ -268,14 +276,13 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
if
(!
getActivity
().
isFinishing
())
{
try
{
YdlBuryPointUtil
.
sendPv
(
"user_collect_pager"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
}
collectInfoPopupWindow
.
show
(
top_expert_info_cl
);
}
}
ChatStatusCacheHelper
.
clearDataByKey
(
"collectEvent"
);
}
...
...
@@ -359,6 +366,22 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
}
},
throwable
->
{
});
if
(
ActionHandlerStorage
.
getL
(
sessionId
)
!=
null
&&
ActionHandlerStorage
.
getL
(
sessionId
).
getUserType
()
==
3
)
{
ServiceImpl
.
Companion
.
getInstance
().
getSourceDoctor
(
ModularServiceManager
.
INSTANCE
.
provide
(
IUserService
.
class
).
getUserInfo
().
getUid
(),
ActionHandlerStorage
.
getL
(
sessionId
).
getInfo
().
toUid
)
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
(
res
->
{
if
(
TextUtils
.
equals
(
res
.
code
,
"200"
)
&&
res
.
data
!=
null
&&
!
TextUtils
.
isEmpty
(
res
.
data
.
name
))
{
addSourceLayoutScrollListener
();
rl_doctor_name
.
setVisibility
(
View
.
VISIBLE
);
tv_doctor_name
.
setText
(
res
.
data
.
name
);
}
else
{
rl_doctor_name
.
setVisibility
(
View
.
GONE
);
}
},
throwable
->
{
rl_doctor_name
.
setVisibility
(
View
.
GONE
);
});
}
}
private
void
addScrollListener
()
{
...
...
@@ -372,7 +395,6 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
public
void
onScrolled
(
RecyclerView
recyclerView
,
int
dx
,
int
dy
)
{
super
.
onScrolled
(
recyclerView
,
dx
,
dy
);
if
(
dy
<
0
&&
Math
.
abs
(
dy
)
>
15
)
{
hasUpScroll
=
true
;
// 下滑
...
...
@@ -393,6 +415,26 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
});
}
private
void
addSourceLayoutScrollListener
()
{
messageListView
.
addOnScrollListener
(
new
RecyclerView
.
OnScrollListener
()
{
@Override
public
void
onScrollStateChanged
(
RecyclerView
recyclerView
,
int
newState
)
{
super
.
onScrollStateChanged
(
recyclerView
,
newState
);
if
(
newState
==
RecyclerView
.
SCROLL_STATE_IDLE
)
{
sourceDoctorLayoutIn
();
}
else
{
sourceDoctorLayoutOut
();
}
}
@Override
public
void
onScrolled
(
RecyclerView
recyclerView
,
int
dx
,
int
dy
)
{
super
.
onScrolled
(
recyclerView
,
dx
,
dy
);
}
});
}
private
void
initTopViewHeight
()
{
top_expert_info_ll
.
getViewTreeObserver
().
addOnGlobalLayoutListener
(()
->
expertInfoViewHeight
=
top_expert_info_ll
.
getHeight
());
...
...
@@ -473,6 +515,27 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
return
anim
;
}
private
void
sourceDoctorLayoutIn
()
{
if
(
rl_doctor_name
.
getVisibility
()
==
View
.
VISIBLE
)
{
if
(
sourceLayoutAnim
==
null
)
{
sourceLayoutAnim
=
ObjectAnimator
.
ofFloat
(
ll_info_detail
,
"translationX"
,
0.0f
,
-
tv_from
.
getMeasuredWidth
());
sourceLayoutAnim
.
setDuration
(
250
);
}
sourceLayoutAnim
.
reverse
();
}
}
private
void
sourceDoctorLayoutOut
()
{
if
(
rl_doctor_name
.
getVisibility
()
==
View
.
VISIBLE
)
{
if
(
sourceLayoutAnim
==
null
)
{
sourceLayoutAnim
=
ObjectAnimator
.
ofFloat
(
ll_info_detail
,
"translationX"
,
0.0f
,
-
tv_from
.
getMeasuredWidth
());
sourceLayoutAnim
.
setDuration
(
250
);
}
sourceLayoutAnim
.
start
();
}
}
/**
* 初始化顶部专家信息栏
*/
...
...
m-im/src/main/java/com/yidianling/uikit/custom/http/ServiceApi.kt
View file @
9a2f791e
...
...
@@ -3,7 +3,6 @@ package com.yidianling.uikit.custom.http
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.ydl.ydlcommon.data.http.BaseResponse
import
com.yidianling.uikit.custom.http.response.*
import
io.reactivex.Observable
import
okhttp3.RequestBody
...
...
@@ -12,7 +11,7 @@ import retrofit2.http.*
/**
* Created by xj on 2019/6/26.
*/
interface
ServiceApi
{
interface
ServiceApi
{
//获取专家状态信息
@GET
(
"chat/status"
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
...
...
@@ -27,7 +26,11 @@ interface ServiceApi{
//获取推荐专家列表信息
@GET
(
"doctor/recommendSimilarListeners"
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
fun
getRecommendExpertList
(
@Query
(
"doctorUid"
)
doctorUid
:
Long
,
@Query
(
"catName"
)
catName
:
String
,
@Query
(
"limit"
)
limit
:
Int
):
Observable
<
BaseAPIResponse
<
ArrayList
<
RecommendExpertBean
>>>
fun
getRecommendExpertList
(
@Query
(
"doctorUid"
)
doctorUid
:
Long
,
@Query
(
"catName"
)
catName
:
String
,
@Query
(
"limit"
)
limit
:
Int
):
Observable
<
BaseAPIResponse
<
ArrayList
<
RecommendExpertBean
>>>
//获取常用语
@POST
(
"phrase/list"
)
...
...
@@ -64,4 +67,12 @@ interface ServiceApi{
@GET
(
"systemconfig/get-chat-view-config"
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
fun
getChatViewConfig
():
Observable
<
BaseAPIResponse
<
SystemInfoBean
>>
//获取代运营关联的专家的信息
@GET
(
"chat/get-source-doctor"
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
//注意:这个接口返回的还有很多字段,但是暂时不需要,就先取这两个字段
fun
getSourceDoctor
(
@Query
(
"scene"
)
scene
:
Int
,
@Query
(
"uid"
)
uid
:
String
,
@Query
(
"assistantUid"
)
assistantUid
:
String
):
Observable
<
BaseAPIResponse
<
SourceDoctorInfoBean
>>
}
\ No newline at end of file
m-im/src/main/java/com/yidianling/uikit/custom/http/ServiceImpl.kt
View file @
9a2f791e
...
...
@@ -94,4 +94,13 @@ class ServiceImpl private constructor() {
fun
getChatViewConfig
():
Observable
<
BaseAPIResponse
<
SystemInfoBean
>>
{
return
YDLHttpUtils
.
obtainApi
(
ServiceApi
::
class
.
java
).
getChatViewConfig
()
}
/**
* 获取代运营关联的专家的信息
*/
fun
getSourceDoctor
(
uid
:
String
,
assistantUid
:
String
):
Observable
<
BaseAPIResponse
<
SourceDoctorInfoBean
>>
{
return
YDLHttpUtils
.
obtainApi
(
ServiceApi
::
class
.
java
).
getSourceDoctor
(
1
,
uid
,
assistantUid
)
}
}
\ No newline at end of file
m-im/src/main/java/com/yidianling/uikit/custom/http/response/SourceDoctorInfoBean.java
0 → 100644
View file @
9a2f791e
package
com
.
yidianling
.
uikit
.
custom
.
http
.
response
;
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2020/2/21
*/
public
class
SourceDoctorInfoBean
{
//注意:这个接口返回的还有很多字段,但是暂时不需要,就先取这两个字段
public
String
name
;
//专家name
public
String
uid
;
//专家uid
}
m-im/src/main/res_uikit/drawable/im_background_chat_assistant_to_doctor_name.xml
0 → 100644
View file @
9a2f791e
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:exitFadeDuration=
"@android:integer/config_shortAnimTime"
>
<corners
android:bottomRightRadius=
"17dp"
android:topRightRadius=
"17dp"
/>
<solid
android:color=
"@color/white"
/>
</shape>
\ No newline at end of file
m-im/src/main/res_uikit/layout/im_ydl_nim_message_fragment.xml
View file @
9a2f791e
...
...
@@ -154,8 +154,8 @@
android:id=
"@+id/good_num_icons"
android:layout_width=
"wrap_content"
android:layout_height=
"11dp"
android:layout_
marginBottom=
"1.5dp
"
android:layout_
alignParentBottom=
"true
"
/>
android:layout_
alignParentBottom=
"true
"
android:layout_
marginBottom=
"1.5dp
"
/>
<ImageView
android:layout_width=
"10dp"
...
...
@@ -248,19 +248,19 @@
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:lines=
"1"
android:text=
"评价"
android:textColor=
"#1DA1F2"
android:textSize=
"12dp"
android:text=
"评价"
/>
android:textSize=
"12dp"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginBottom=
"1dp"
android:lines=
"1"
android:text=
"("
android:textColor=
"#1DA1F2"
android:textSize=
"12dp"
android:layout_marginBottom=
"1dp"
android:text=
"("
/>
android:textSize=
"12dp"
/>
<TextView
android:id=
"@+id/tv_all_comment_desc"
...
...
@@ -276,11 +276,11 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginBottom=
"1dp"
android:lines=
"1"
android:text=
")"
android:textColor=
"#1DA1F2"
android:textSize=
"12dp"
android:layout_marginBottom=
"1dp"
android:text=
")"
/>
android:textSize=
"12dp"
/>
<ImageView
android:id=
"@+id/tv_all_comment_go"
...
...
@@ -406,9 +406,7 @@
android:id=
"@+id/rl_contain"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
tools:layout_height=
"50dp"
>
</RelativeLayout>
tools:layout_height=
"50dp"
/>
<android.support.v7.widget.RecyclerView
android:id=
"@+id/messageListView"
...
...
@@ -433,37 +431,6 @@
android:layout_marginTop=
"14dp"
android:visibility=
"visible"
>
<!-- <RelativeLayout-->
<!-- android:id="@+id/rela_qingsu"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="36dp"-->
<!-- android:background="@drawable/im_bg_im_confide_action"-->
<!-- android:gravity="center"-->
<!-- android:paddingLeft="14dp"-->
<!-- android:paddingRight="17dp">-->
<!-- <ImageView-->
<!-- android:id="@+id/action_qingshu_img"-->
<!-- android:layout_width="12dp"-->
<!-- android:layout_height="12dp"-->
<!-- android:layout_centerVertical="true"-->
<!-- android:src="@mipmap/im_chat_ico_call" />-->
<!-- <TextView-->
<!-- android:id="@+id/action_qingshu"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="match_parent"-->
<!-- android:layout_toRightOf="@+id/action_qingshu_img"-->
<!-- android:gravity="center"-->
<!-- android:paddingLeft="5dp"-->
<!-- android:text="即时倾诉"-->
<!-- android:textColor="@color/platform_google_blue"-->
<!-- android:textSize="12dp"-->
<!-- android:textStyle="bold" />-->
<!-- </RelativeLayout>-->
<RelativeLayout
android:id=
"@+id/rela_zixun"
android:layout_width=
"wrap_content"
...
...
@@ -488,6 +455,56 @@
</RelativeLayout>
<!--和助理聊天时,显示关联的咨询师的信息-->
<RelativeLayout
android:id=
"@+id/rl_doctor_name"
android:layout_width=
"wrap_content"
android:layout_height=
"34dp"
android:layout_marginTop=
"15dp"
android:gravity=
"center_vertical"
android:visibility=
"visible"
tools:visibility=
"visible"
>
<LinearLayout
android:id=
"@+id/ll_info_detail"
android:layout_width=
"wrap_content"
android:layout_height=
"34dp"
android:layout_toRightOf=
"@+id/view_empty"
android:background=
"@drawable/im_background_chat_assistant_to_doctor_name"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:paddingRight=
"12dp"
>
<TextView
android:id=
"@+id/tv_from"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:paddingRight=
"3dp"
android:text=
"来自"
android:textColor=
"@color/platform_color_242424"
android:textSize=
"12sp"
/>
<TextView
android:id=
"@+id/tv_doctor_name"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:textColor=
"@color/im_main_theme"
android:textSize=
"12sp"
tools:text=
"雷水寿"
/>
</LinearLayout>
<View
android:id=
"@+id/view_empty"
android:layout_width=
"12dp"
android:layout_height=
"34dp"
android:background=
"@color/white"
/>
</RelativeLayout>
</RelativeLayout>
...
...
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