Commit 8de7acb0 by 刘鹏

信息收集部分逻辑优化

parent a50a6fe1
......@@ -10,7 +10,7 @@ ext {
"m-fm" : "0.0.30.03",
"m-user" : "0.0.61.37",
"m-home" : "0.0.22.65",
"m-im" : "0.0.19.20",
"m-im" : "0.0.19.25",
"m-dynamic" : "0.0.7.22",
"m-article" : "0.0.0.10",
......
......@@ -71,6 +71,7 @@
<activity
android:name=".ui.activity.CmsExamQuestionPaperActivity"
android:screenOrientation="portrait"
android:launchMode="singleTask"
android:theme="@style/platform_NoTitleTheme" />
<!-- 云信 集成配置 -->
......
......@@ -105,7 +105,7 @@ object IMChatUtil {
.subscribe({ res: BaseResponse<UserTypeBean> ->
if (res.code == 200 && res.data != null) {
if (res.data!!.collectEvent &&TextUtils.equals(res.data!!.userType, USER_TYPE_ASSISTANT.toString()) && res.data!!.collectEvent) {
if (res.data!!.collectEvent &&TextUtils.equals(res.data!!.userType, USER_TYPE_ASSISTANT.toString())) {
//和助理私聊需要打开信息采集弹窗
prepareAssistantChatData(
context,
......@@ -209,7 +209,7 @@ object IMChatUtil {
}) { t: Throwable? ->
handleError(context, t!!)
}
} else if (TextUtils.equals(res.data!!.userType, USER_TYPE_ASSISTANT.toString()) && res.data!!.collectEvent) {//助理
} else if (TextUtils.equals(res.data!!.userType, USER_TYPE_ASSISTANT.toString())) {//助理
prepareAssistantChatData(context, toUid, object : ChatDataRequestListener {
override fun onSuccess(expertInfo: IMExpertBuild) { //新前置信息收集入口
CmsExamQuestionPaperActivity.start(
......
......@@ -46,6 +46,8 @@ public class QuestionAdapter extends BaseMultiItemQuickAdapter<QuestionMultiItem
addItemType(4, R.layout.item_left_more_check_layout);
//左----描述题
addItemType(5, R.layout.item_left_describe_layout);
//主诉----单选
addItemType(6, R.layout.item_left_one_check_layout);
}
......@@ -77,46 +79,88 @@ public class QuestionAdapter extends BaseMultiItemQuickAdapter<QuestionMultiItem
case 4:
//多选
convertType4(helper, item);
break;
case 5:
helper.setText(R.id.multiple_choice_title, item.type5Bean.question);
helper.setText(R.id.example, item.type5Bean.example);
SpannableString spannableString = new SpannableString(mContext.getResources().getString(R.string.question_notes));
spannableString.setSpan(new ForegroundColorSpan(Color.parseColor("#1DA1F2")), 28, spannableString.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
helper.setText(R.id.tv_notes, spannableString);
convertType5(helper, item);
break;
case 6:
convertType6(helper, item);
break;
default:
break;
}
}
/**
* 主诉消息
* */
private void convertType6(BaseViewHolder helper, QuestionMultiItem item) {
RecyclerView OneRecycle = helper.getView(R.id.tv_one_list);
TextView oneTitle = helper.getView(R.id.multiple_choice_title);
oneTitle.setText(item.questionsBean.name);
int oneMaxSize = 0;
for (OptionsBean option : item.questionsBean.options) {
int length = option.name.length();
if (length > mTextMaxSize) {
oneMaxSize = length;
break;
} else if (oneMaxSize < length) {
oneMaxSize = option.name.length();
}
}
GridLayoutManager gridLayoutManager = new GridLayoutManager(AVChatKit.getContext(), oneMaxSize > mTextMaxSize ? 1 : 2);
OneRecycle.setLayoutManager(gridLayoutManager);
QuestionOneCheckAdapter oneCheckAdapter = new QuestionOneCheckAdapter(item.questionsBean.options);
OneRecycle.setAdapter(oneCheckAdapter);
oneCheckAdapter.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
List<OptionsBean> data = oneCheckAdapter.getData();
for (OptionsBean datum : data) {
if (datum.check) {
//如果已有选项被选择,择不触发后续事件
return;
}
}
oneCheckAdapter.getData().get(position).check = true;
oneCheckAdapter.notifyDataSetChanged();
mOneCheckListener.zsItemClick(data.get(position).name, item.type6Position);
}
});
}
View type5_line = helper.getView(R.id.type5_line);
TextView example = helper.getView(R.id.example);
private void convertType5(BaseViewHolder helper, QuestionMultiItem item) {
helper.setText(R.id.multiple_choice_title, item.type5Bean.question);
helper.setText(R.id.example, item.type5Bean.example);
SpannableString spannableString = new SpannableString(mContext.getResources().getString(R.string.question_notes));
spannableString.setSpan(new ForegroundColorSpan(Color.parseColor("#1DA1F2")), 28, spannableString.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
helper.setText(R.id.tv_notes, spannableString);
if (example.getVisibility() == View.GONE) {
type5_line.setVisibility(View.VISIBLE);
example.setVisibility(View.VISIBLE);
} else {
type5_line.setVisibility(View.GONE);
example.setVisibility(View.GONE);
}
if (item.type5Open) {
type5_line.setVisibility(View.VISIBLE);
example.setVisibility(View.VISIBLE);
} else {
type5_line.setVisibility(View.GONE);
example.setVisibility(View.GONE);
}
if (item.type5CanClick){
helper.getView(R.id.type5_parent).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mOneCheckListener.showKeyboard();
}
});
View type5_line = helper.getView(R.id.type5_line);
TextView example = helper.getView(R.id.example);
helper.addOnClickListener(R.id.tv_notes);
if (example.getVisibility() == View.GONE) {
type5_line.setVisibility(View.VISIBLE);
example.setVisibility(View.VISIBLE);
} else {
type5_line.setVisibility(View.GONE);
example.setVisibility(View.GONE);
}
if (item.type5Open) {
type5_line.setVisibility(View.VISIBLE);
example.setVisibility(View.VISIBLE);
} else {
type5_line.setVisibility(View.GONE);
example.setVisibility(View.GONE);
}
if (item.type5CanClick) {
helper.getView(R.id.type5_parent).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mOneCheckListener.showKeyboard();
}
});
break;
default:
break;
helper.addOnClickListener(R.id.tv_notes);
}
}
......
......@@ -14,7 +14,7 @@ public class QuestionMultiItem implements MultiItemEntity {
public String type1Text;
public String type2Text;
/***type 3 单选 type 4 多选 */
/***type 3 单选 type 4 多选 type 6 */
public QuestionsBean questionsBean;
public boolean type4CanClick;
......@@ -26,6 +26,8 @@ public class QuestionMultiItem implements MultiItemEntity {
/***type5 展开or 收起*/
public boolean type5Open = true;
public int type6Position;
@Override
public int getItemType() {
return viewType;
......
......@@ -21,4 +21,10 @@ interface QuestionOneCheckListener {
* 隐藏其他
*/
fun hideOtherEdit()
/**
* 主诉单选点击 多选确定按钮点击获取item信息
*/
fun zsItemClick(answer: String, postion: Int)
}
\ No newline at end of file
......@@ -3,6 +3,9 @@ package com.yidianling.uikit.custom.http.response.question;
import java.io.Serializable;
import java.util.List;
/**
* @author liupeng
*/
public class QuestionsBean implements Serializable {
/**
......
......@@ -27,6 +27,7 @@ public class QuestionsInfoBean {
*/
public QuestionPaperBean questionPaper;
public List<QuestionsBeanExample> questions;
//无数据的默认题
public List<QuestionsBean> extraQuestions;
}
......@@ -64,11 +64,12 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_input"
android:layout_width="match_parent"
app:layout_constraintBottom_toTopOf="@id/tv_finish"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
tools:visibility="visible">
tools:visibility="gone">
<TextView
android:id="@+id/tv_problem"
......@@ -199,7 +200,7 @@
android:textSize="16sp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
tools:visibility="gone" />
tools:visibility="visible" />
</androidx.constraintlayout.widget.ConstraintLayout>
......
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