Commit a3541e56 by ydl

Merge branch 'feature/daoyi_kuoliu' into 咨询加声网

# Conflicts:
#	config.gradle
parents 36040170 b1ede74c
......@@ -45,7 +45,7 @@ ext {
"m-confide" : "0.0.48.7.24",
"m-consultant" : "0.0.58.5",
"m-fm" : "0.0.29.3",
"m-user" : "0.0.60.1",
"m-user" : "0.0.60.4",
"m-home" : "0.0.19.1",
"m-im" : "0.0.17.8",
"m-dynamic" : "0.0.7.5",
......
......@@ -189,6 +189,12 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
private String server_num;// 服务时长
private String good_num;// 好评率
private int userInfoDialogAge = 0;
private String userInfoDialogSex = "";
private String userInfoDialogConsultType = "";
private String userInfoDialogQuestionDes = "";
private String userInfoDialogSourceFrom = "";
private UserInfoDialog userInfoDialog = null;
@SuppressLint("HandlerLeak")
......@@ -434,32 +440,27 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
// 如果对方是用户,自己是助理,则展示标题文本右侧icon,并设置点击事件,展示用户信息弹窗
if (ActionHandlerStorage.getL(sessionId).getUserType() == 1 && ModularServiceManager.INSTANCE.provide(IUserService.class).getUserInfo().getUser_type() == 3) {
if (null == userInfoDialog) {
int age = 0;
String sex = "";
String consultType = "";
String questionDes = "";
for (UserQuestInfoBean bean : hasCollectedInResp.data) {
if (TextUtils.equals(bean.getUserInfoType(), "age")) {
try {
String year = bean.getContent();
age = Calendar.getInstance().get(Calendar.YEAR) - Integer.valueOf(year);
userInfoDialogAge = Calendar.getInstance().get(Calendar.YEAR) - Integer.valueOf(year);
} catch (Exception e) { }
} else if (TextUtils.equals(bean.getUserInfoType(), "gener")) {
try {
sex = bean.getContent();
userInfoDialogSex = bean.getContent();
} catch (Exception e) { }
}else if (TextUtils.equals(bean.getUserInfoType(), "questionType")) {
try {
consultType = bean.getContent();
userInfoDialogConsultType = bean.getContent();
} catch (Exception e) { }
}else if (TextUtils.equals(bean.getUserInfoType(), "questionContent")) {
try {
questionDes = bean.getContent();
userInfoDialogQuestionDes = bean.getContent();
} catch (Exception e) { }
}
}
userInfoDialog = new UserInfoDialog(getActivity(), String.valueOf(age), sex, consultType, questionDes);
getSourceFrom();
}
}
......@@ -478,15 +479,18 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(res -> {
if (null != userInfoDialog && !TextUtils.isEmpty(res.data)) {
userInfoDialog.setSourceFrom(res.data);
if (!TextUtils.isEmpty(res.data)) {
userInfoDialogSourceFrom = res.data;
}
});
}
public void showUserInfoDialog() {
if (null != userInfoDialog)
userInfoDialog.show();
if (userInfoDialog != null) {
userInfoDialog.dismiss();
}
userInfoDialog = new UserInfoDialog(getActivity(), userInfoDialogSourceFrom, String.valueOf(userInfoDialogAge), userInfoDialogSex, userInfoDialogConsultType, userInfoDialogQuestionDes);
userInfoDialog.show();
}
private void addScrollListener() {
......
......@@ -3,6 +3,7 @@ package com.yidianling.uikit.custom.widget
import android.app.Dialog
import android.content.Context
import android.os.Bundle
import android.text.TextUtils
import android.view.Gravity
import android.view.View
import android.view.WindowManager
......@@ -15,6 +16,7 @@ import kotlinx.android.synthetic.main.im_user_info_dialog_layout.*
*/
class UserInfoDialog(
private val mContext: Context,
private val sourceFrom: String, //来源
private val age: String, //年龄
private val sex: String, //性别
private val consultType: String, //咨询类型
......@@ -32,6 +34,11 @@ class UserInfoDialog(
window.setGravity(Gravity.CENTER)
window.attributes = params
if (!TextUtils.isEmpty(sourceFrom)) {
user_info_dialog_sourceFrom.visibility = View.VISIBLE
user_info_dialog_sourceFrom_tv.text = sourceFrom
}
user_info_dialog_age_tv.text = age
user_info_dialog_sex_tv.text = sex
user_info_dialog_consultType_tv.text = consultType
......@@ -43,12 +50,4 @@ class UserInfoDialog(
}
}
}
/**
* 设置来源
*/
fun setSourceFrom(txt: String) {
user_info_dialog_sourceFrom.visibility = View.VISIBLE
user_info_dialog_sourceFrom_tv.text = txt
}
}
\ No newline at end of file
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