Commit 36040170 by ydl

Merge remote-tracking branch 'origin/feature/daoyi_kuoliu' into 咨询加声网

# Conflicts:
#	config.gradle
parents 823d66fb a5a3c6a2
......@@ -43,7 +43,7 @@ ext {
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.48.7.24",
"m-consultant" : "0.0.57.4",
"m-consultant" : "0.0.58.5",
"m-fm" : "0.0.29.3",
"m-user" : "0.0.60.1",
"m-home" : "0.0.19.1",
......
......@@ -87,6 +87,8 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
initViews()
initData(intent)
ActionCountUtils.count("main_page|app_consult_list_page_visit|app_consult_list_page_visit")
}
override fun getStatusViewOptions(): StatusBarOptions {
......
......@@ -73,6 +73,8 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
title_layout.setPadding(DisplayUtils.dp2px(context,15),0,0,0)
initViews()
initData()
ActionCountUtils.count("main_page|app_consult_list_page_visit|app_consult_list_page_visit")
}
override fun initDataAndEventLazy() {
......
......@@ -8,6 +8,7 @@ import android.text.TextUtils
import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.ydl.ydlcommon.utils.YdlBuryPointUtil
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.ConsultAssistantCenterActivity
......@@ -104,6 +105,7 @@ class ConsultAssistantDialogUtils private constructor() {
object : ConsultAssistantDialog.OnConsultAssistantClickListener {
override fun onClickAction() {
//获取用户uid
ActionCountUtils.count("main_page|main_daoyi_entry_click")
YdlBuryPointUtil.sendClick("home_page_assistant_click")
getConsultAssistantUid(activity)
}
......@@ -157,6 +159,7 @@ class ConsultAssistantDialogUtils private constructor() {
activity,
object : ConsultAssistantDialog.OnConsultAssistantClickListener {
override fun onClickAction() {
ActionCountUtils.count("app_consult_list_page|app_consult_list_daoyi_entry_click")
YdlBuryPointUtil.sendClick("assistant_list_click")
// 咨询师列表页面且未登录情况下,跳转登录页面
if (!ConsultantIn.isLogin()) {
......@@ -178,6 +181,7 @@ class ConsultAssistantDialogUtils private constructor() {
activity,
object : ConsultAssistantDialog.OnConsultAssistantClickListener {
override fun onClickAction() {
ActionCountUtils.count("app_consult_list_page|app_consult_list_daoyi_entry_click")
YdlBuryPointUtil.sendClick("assistant_list_click")
// 咨询师列表页面且未登录情况下,跳转登录页面
if (!ConsultantIn.isLogin()) {
......
......@@ -43,7 +43,7 @@ interface ImRetrofitApi {
fun getUserType(@Query("targetUid") uid: String): Observable<BaseResponse<UserTypeBean>>
//根据专家uid获取私聊的目标uid(有可能是专家uid,有可能是助理uid)
@GET("doctor/chat-user")
@GET("consult/assistant/chat-user")
@Headers(YDL_DOMAIN+ YDL_DOMAIN_JAVA)
fun getChatUid(@Query("doctorUid") uid: String): Observable<BaseAPIResponse<DoctorAssistantRespDtoBean>>
......
......@@ -12,6 +12,7 @@ import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import com.ydl.ydlcommon.data.http.RxUtils;
import com.ydl.ydlcommon.modular.ModularServiceManager;
import com.yidianling.common.tools.LogUtil;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.R;
......@@ -25,6 +26,7 @@ import com.yidianling.uikit.custom.bridge.ActionHandlerStorage;
import com.yidianling.uikit.custom.bridge.IP2PCustomActionHandler;
import com.yidianling.uikit.custom.http.ServiceImpl;
import com.yidianling.uikit.custom.widget.TitleBarBottom;
import com.yidianling.user.api.service.IUserService;
import java.net.URLEncoder;
import java.util.List;
......@@ -140,6 +142,14 @@ public abstract class YDLBaseMessageActivity extends UI {
//小壹客服 不显示是否在线
tb.setmMinTitleVisiable(View.GONE);
} else {
//对方是用户,自己是助理
if (ActionHandlerStorage.getL(sessionId).getUserType() == 1 && ModularServiceManager.INSTANCE.provide(IUserService.class).getUserInfo().getUser_type() == 3) {
tb.setTitleTextRightIcon(R.drawable.user_info_icon, v -> {
if (null != messageFragment) {
messageFragment.showUserInfoDialog();
}
});
}
if (ActionHandlerStorage.getL(sessionId).getUserType() == 2) {
// 专家
......
package com.yidianling.uikit.business.session.view;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ScrollView;
import com.yidianling.im.R;
public class MaxHeightScrollView extends ScrollView {
private int mMaxHeight;
public MaxHeightScrollView(Context context) {
super(context);
}
public MaxHeightScrollView(Context context, AttributeSet attrs) {
super(context, attrs);
initialize(context, attrs);
}
public MaxHeightScrollView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
initialize(context, attrs);
}
private void initialize(Context context, AttributeSet attrs) {
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.MaxHeightScrollView);
mMaxHeight = typedArray.getLayoutDimension(R.styleable.MaxHeightScrollView_maxHeight, mMaxHeight);
typedArray.recycle();
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
if (mMaxHeight > 0) {
heightMeasureSpec = View.MeasureSpec.makeMeasureSpec(mMaxHeight, View.MeasureSpec.AT_MOST);
}
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
}
......@@ -52,7 +52,12 @@ interface ServiceApi {
//获取新用户收集的信息
@POST("user/getNewUserMes")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun getNewUserMes(): Observable<BaseAPIResponse<List<UserQuestInfoBean>>>
fun getNewUserMes(@Body body: RequestBody): Observable<BaseAPIResponse<List<UserQuestInfoBean>>>
//获取用户来源的信息
@GET("user/getExChannel")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun getUserSource(@Query("uid") uid: String): Observable<BaseAPIResponse<String>>
//信息采集的问题
@POST("user/collect/submit")
......
package com.yidianling.uikit.custom.http
import com.alibaba.fastjson.JSON
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.uikit.custom.http.response.*
......@@ -66,8 +67,20 @@ class ServiceImpl private constructor() {
/**
* 获取新用户收集的信息
*/
fun getNewUserMes(): Observable<BaseAPIResponse<List<UserQuestInfoBean>>> {
return YDLHttpUtils.obtainApi(ServiceApi::class.java).getNewUserMes()
fun getNewUserMes(bean: NewUserMesBean): Observable<BaseAPIResponse<List<UserQuestInfoBean>>> {
val beanStr = JSON.toJSONString(bean)
val body = RequestBody.create(
MediaType.parse("application/json; charset=utf-8"),
beanStr
) as RequestBody
return YDLHttpUtils.obtainApi(ServiceApi::class.java).getNewUserMes(body)
}
/**
* 获取用户来源
*/
fun getUserSourceFrom(uid: String): Observable<BaseAPIResponse<String>> {
return YDLHttpUtils.obtainApi(ServiceApi::class.java).getUserSource(uid)
}
/**
......
package com.yidianling.uikit.custom.http.response
class NewUserMesBean(val targetUid: String)
\ No newline at end of file
......@@ -21,7 +21,7 @@ import com.yidianling.im.R;
public class TitleBarBottom extends RelativeLayout {
TextView tv_left_text, tv_center_title, tv_bottom_title, tv_right_text;
ImageView iv_title_divide, image, rightImage;
ImageView iv_title_divide, image, rightImage, title_tv_right_btn;
private View root;
......@@ -59,10 +59,20 @@ public class TitleBarBottom extends RelativeLayout {
iv_title_divide = (ImageView) root.findViewById(R.id.iv_title_divide);
image = (ImageView) root.findViewById(R.id.image);
rightImage = (ImageView) root.findViewById(R.id.iv_right);
title_tv_right_btn = (ImageView) root.findViewById(R.id.title_tv_right_btn);
setupView();
}
/**
* 设置标题文本右侧icon
*/
public void setTitleTextRightIcon(int resId, OnClickListener onClickListener) {
title_tv_right_btn.setImageResource(resId);
title_tv_right_btn.setVisibility(View.VISIBLE);
title_tv_right_btn.setOnClickListener(onClickListener);
}
/**
* 左侧文字点击事件
*/
public void setOnLeftTextClick(OnTitleBarTextClick leftTextClick) {
......
package com.yidianling.uikit.custom.widget
import android.app.Dialog
import android.content.Context
import android.os.Bundle
import android.view.Gravity
import android.view.View
import android.view.WindowManager
import com.yidianling.im.R
import kotlinx.android.synthetic.main.im_user_info_dialog_layout.*
/**
* 用户信息弹窗
* Created by xj on 2020/3/25.
*/
class UserInfoDialog(
private val mContext: Context,
private val age: String, //年龄
private val sex: String, //性别
private val consultType: String, //咨询类型
private val questionDes: String //问题描述
) : Dialog(mContext, R.style.dialog_default_style) {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.im_user_info_dialog_layout)
val params = window.attributes
params.width = WindowManager.LayoutParams.MATCH_PARENT
params.height = WindowManager.LayoutParams.WRAP_CONTENT
window.setGravity(Gravity.CENTER)
window.attributes = params
user_info_dialog_age_tv.text = age
user_info_dialog_sex_tv.text = sex
user_info_dialog_consultType_tv.text = consultType
user_info_dialog_questionDes_tv.text = questionDes
user_info_dialog_close.setOnClickListener {
if (null != mContext) {
dismiss()
}
}
}
/**
* 设置来源
*/
fun setSourceFrom(txt: String) {
user_info_dialog_sourceFrom.visibility = View.VISIBLE
user_info_dialog_sourceFrom_tv.text = txt
}
}
\ No newline at end of file
......@@ -134,5 +134,9 @@
<!-- 指定消失的动画xml -->
</style>
<declare-styleable name="MaxHeightScrollView">
<attr name="maxHeight" format="dimension" />
</declare-styleable>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="4dp" />
<solid android:color="@color/platform_white"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:background="?android:attr/selectableItemBackground"
android:contentDescription="@null"
android:gravity="center_vertical" />
<TextView
android:id="@+id/tv_left_text"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_toEndOf="@id/image"
android:layout_toRightOf="@id/image"
android:background="?android:attr/selectableItemBackground"
android:drawablePadding="8dp"
android:gravity="center_vertical"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:textColor="@android:color/white"
android:textSize="@dimen/platform_default_text_size_big"
tools:text="关闭"
tools:textColor="@color/platform_black" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:layout_marginTop="4dp"
android:layout_marginBottom="3dp"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
android:id="@+id/tv_center_title"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_weight="2"
android:ellipsize="end"
android:gravity="center"
android:maxEms="12"
android:maxLength="12"
android:textColor="@color/im_color_242424"
android:textSize="17dp"
tools:text="现现现现现现在在现在在在在现在在" />
<TextView
android:id="@+id/tv_bottom_title"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:drawablePadding="4dp"
android:ellipsize="end"
android:gravity="center"
android:maxEms="12"
android:maxLength="8"
android:textColor="@color/platform_color_666666"
android:textSize="10dp"
tools:drawableLeft="@drawable/im_background_chat_top_status_online"
tools:text="现在" />
</LinearLayout>
<ImageView
android:id="@+id/iv_right"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:background="?android:attr/selectableItemBackground"
android:contentDescription="@null"
android:gravity="center_vertical"
tools:src="@drawable/platform_more_green"/>
<TextView
android:id="@+id/tv_right_text"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_toLeftOf="@id/iv_right"
android:layout_toStartOf="@id/iv_right"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:textColor="@color/platform_default_button_bg"
android:textSize="@dimen/platform_default_text_size_big"
android:drawablePadding="5dp"
tools:drawableLeft="@drawable/platform_share"
tools:ignore="RelativeOverlap" />
<ImageView
android:id="@+id/iv_title_divide"
android:layout_width="match_parent"
android:layout_height="@dimen/im_divide_line_stroke_width"
android:layout_alignParentBottom="true"
android:background="@color/im_divide_color" />
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:background="?android:attr/selectableItemBackground"
android:contentDescription="@null"
android:gravity="center_vertical" />
<TextView
android:id="@+id/tv_left_text"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_toEndOf="@id/image"
android:layout_toRightOf="@id/image"
android:background="?android:attr/selectableItemBackground"
android:drawablePadding="8dp"
android:gravity="center_vertical"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:textColor="@android:color/white"
android:textSize="@dimen/platform_default_text_size_big"
tools:text="关闭"
tools:textColor="@color/platform_black" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_centerHorizontal="true">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginTop="4dp"
android:layout_marginBottom="3dp"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
android:id="@+id/tv_center_title"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_weight="2"
android:ellipsize="end"
android:gravity="center"
android:maxEms="12"
android:maxLength="12"
android:textColor="@color/im_color_242424"
android:textSize="17dp"
tools:text="现现现现现现在在现在在在在现在在" />
<TextView
android:id="@+id/tv_bottom_title"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:drawablePadding="4dp"
android:ellipsize="end"
android:gravity="center"
android:maxEms="12"
android:maxLength="8"
android:textColor="@color/platform_color_666666"
android:textSize="10dp"
tools:drawableLeft="@drawable/im_background_chat_top_status_online"
tools:text="现在" />
</LinearLayout>
<ImageView
android:id="@+id/title_tv_right_btn"
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_marginTop="4dp"
android:layout_marginBottom="3dp"
android:src="@drawable/im_star_red"
android:layout_marginLeft="4dp"
android:layout_gravity="center"
android:visibility="gone"/>
</LinearLayout>
<ImageView
android:id="@+id/iv_right"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:background="?android:attr/selectableItemBackground"
android:contentDescription="@null"
android:gravity="center_vertical"
tools:src="@drawable/platform_more_green" />
<TextView
android:id="@+id/tv_right_text"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_toStartOf="@id/iv_right"
android:layout_toLeftOf="@id/iv_right"
android:background="?android:attr/selectableItemBackground"
android:drawablePadding="5dp"
android:gravity="center_vertical"
android:textColor="@color/platform_default_button_bg"
android:textSize="@dimen/platform_default_text_size_big"
tools:drawableLeft="@drawable/platform_share"
tools:ignore="RelativeOverlap" />
<ImageView
android:id="@+id/iv_title_divide"
android:layout_width="match_parent"
android:layout_height="@dimen/im_divide_line_stroke_width"
android:layout_alignParentBottom="true"
android:background="@color/im_divide_color" />
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp">
<LinearLayout
android:id="@+id/dialog_user_detail_bg"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/im_user_info_dialog_bg"
android:orientation="vertical"
android:paddingLeft="20dp"
android:paddingTop="30dp"
android:paddingRight="20dp"
android:paddingBottom="21dp">
<RelativeLayout
android:id="@+id/user_info_dialog_sourceFrom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="31dp"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="推广来源"
android:textSize="15dp"
android:textColor="@color/platform_color_666666"/>
<TextView
android:id="@+id/user_info_dialog_sourceFrom_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="SEM"
android:layout_alignParentRight="true"
android:textSize="15dp"
android:textColor="@color/platform_color_242424"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="31dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="年龄"
android:textSize="15dp"
android:textColor="@color/platform_color_666666"/>
<TextView
android:id="@+id/user_info_dialog_age_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="18"
android:layout_alignParentRight="true"
android:textSize="15dp"
android:textColor="@color/platform_color_242424"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="31dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="性别"
android:textSize="15dp"
android:textColor="@color/platform_color_666666"/>
<TextView
android:id="@+id/user_info_dialog_sex_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="男"
android:layout_alignParentRight="true"
android:textSize="15dp"
android:textColor="@color/platform_color_242424"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="31dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="咨询类型"
android:textSize="15dp"
android:textColor="@color/platform_color_666666"/>
<TextView
android:id="@+id/user_info_dialog_consultType_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="恋爱情感"
android:layout_alignParentRight="true"
android:textSize="15dp"
android:textColor="@color/platform_color_242424"/>
</RelativeLayout>
<RelativeLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="30dp">
<TextView
android:id="@+id/user_info_dialog_questionDes_left_tv"
android:layout_width="64dp"
android:layout_height="wrap_content"
android:text="问题描述"
android:maxLines="1"
android:textSize="15dp"
android:textColor="@color/platform_color_666666"/>
<com.yidianling.uikit.business.session.view.MaxHeightScrollView
android:layout_marginLeft="80dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
app:maxHeight="150dp">
<TextView
android:gravity="left"
android:id="@+id/user_info_dialog_questionDes_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="我是描述"
android:textSize="15dp"
android:textColor="@color/platform_color_242424"/>
</com.yidianling.uikit.business.session.view.MaxHeightScrollView>
</RelativeLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textColor="@color/im_main_theme"
android:text="*涉及用户隐私,请谨慎使用上述信息*"
android:textSize="12dp"/>
</LinearLayout>
<ImageView
android:id="@+id/user_info_dialog_close"
android:layout_width="28dp"
android:layout_height="28dp"
android:layout_below="@+id/dialog_user_detail_bg"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp"
android:src="@drawable/im_expert_info_dialog_close_icon" />
</RelativeLayout>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment