Commit 8de7acb0 by 刘鹏

信息收集部分逻辑优化

parent a50a6fe1
...@@ -10,7 +10,7 @@ ext { ...@@ -10,7 +10,7 @@ ext {
"m-fm" : "0.0.30.03", "m-fm" : "0.0.30.03",
"m-user" : "0.0.61.37", "m-user" : "0.0.61.37",
"m-home" : "0.0.22.65", "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-dynamic" : "0.0.7.22",
"m-article" : "0.0.0.10", "m-article" : "0.0.0.10",
......
...@@ -71,6 +71,7 @@ ...@@ -71,6 +71,7 @@
<activity <activity
android:name=".ui.activity.CmsExamQuestionPaperActivity" android:name=".ui.activity.CmsExamQuestionPaperActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:launchMode="singleTask"
android:theme="@style/platform_NoTitleTheme" /> android:theme="@style/platform_NoTitleTheme" />
<!-- 云信 集成配置 --> <!-- 云信 集成配置 -->
......
...@@ -105,7 +105,7 @@ object IMChatUtil { ...@@ -105,7 +105,7 @@ object IMChatUtil {
.subscribe({ res: BaseResponse<UserTypeBean> -> .subscribe({ res: BaseResponse<UserTypeBean> ->
if (res.code == 200 && res.data != null) { 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( prepareAssistantChatData(
context, context,
...@@ -209,7 +209,7 @@ object IMChatUtil { ...@@ -209,7 +209,7 @@ object IMChatUtil {
}) { t: Throwable? -> }) { t: Throwable? ->
handleError(context, t!!) 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 { prepareAssistantChatData(context, toUid, object : ChatDataRequestListener {
override fun onSuccess(expertInfo: IMExpertBuild) { //新前置信息收集入口 override fun onSuccess(expertInfo: IMExpertBuild) { //新前置信息收集入口
CmsExamQuestionPaperActivity.start( CmsExamQuestionPaperActivity.start(
......
...@@ -46,6 +46,8 @@ public class QuestionAdapter extends BaseMultiItemQuickAdapter<QuestionMultiItem ...@@ -46,6 +46,8 @@ public class QuestionAdapter extends BaseMultiItemQuickAdapter<QuestionMultiItem
addItemType(4, R.layout.item_left_more_check_layout); addItemType(4, R.layout.item_left_more_check_layout);
//左----描述题 //左----描述题
addItemType(5, R.layout.item_left_describe_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 ...@@ -77,46 +79,88 @@ public class QuestionAdapter extends BaseMultiItemQuickAdapter<QuestionMultiItem
case 4: case 4:
//多选 //多选
convertType4(helper, item); convertType4(helper, item);
break; break;
case 5: case 5:
helper.setText(R.id.multiple_choice_title, item.type5Bean.question); convertType5(helper, item);
helper.setText(R.id.example, item.type5Bean.example); break;
SpannableString spannableString = new SpannableString(mContext.getResources().getString(R.string.question_notes)); case 6:
spannableString.setSpan(new ForegroundColorSpan(Color.parseColor("#1DA1F2")), 28, spannableString.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); convertType6(helper, item);
helper.setText(R.id.tv_notes, spannableString); 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); private void convertType5(BaseViewHolder helper, QuestionMultiItem item) {
TextView example = helper.getView(R.id.example); 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) { View type5_line = helper.getView(R.id.type5_line);
type5_line.setVisibility(View.VISIBLE); TextView example = helper.getView(R.id.example);
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();
}
});
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; helper.addOnClickListener(R.id.tv_notes);
default:
break;
} }
} }
......
...@@ -14,7 +14,7 @@ public class QuestionMultiItem implements MultiItemEntity { ...@@ -14,7 +14,7 @@ public class QuestionMultiItem implements MultiItemEntity {
public String type1Text; public String type1Text;
public String type2Text; public String type2Text;
/***type 3 单选 type 4 多选 */ /***type 3 单选 type 4 多选 type 6 */
public QuestionsBean questionsBean; public QuestionsBean questionsBean;
public boolean type4CanClick; public boolean type4CanClick;
...@@ -26,6 +26,8 @@ public class QuestionMultiItem implements MultiItemEntity { ...@@ -26,6 +26,8 @@ public class QuestionMultiItem implements MultiItemEntity {
/***type5 展开or 收起*/ /***type5 展开or 收起*/
public boolean type5Open = true; public boolean type5Open = true;
public int type6Position;
@Override @Override
public int getItemType() { public int getItemType() {
return viewType; return viewType;
......
...@@ -21,4 +21,10 @@ interface QuestionOneCheckListener { ...@@ -21,4 +21,10 @@ interface QuestionOneCheckListener {
* 隐藏其他 * 隐藏其他
*/ */
fun hideOtherEdit() 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; ...@@ -3,6 +3,9 @@ package com.yidianling.uikit.custom.http.response.question;
import java.io.Serializable; import java.io.Serializable;
import java.util.List; import java.util.List;
/**
* @author liupeng
*/
public class QuestionsBean implements Serializable { public class QuestionsBean implements Serializable {
/** /**
......
...@@ -27,6 +27,7 @@ public class QuestionsInfoBean { ...@@ -27,6 +27,7 @@ public class QuestionsInfoBean {
*/ */
public QuestionPaperBean questionPaper; public QuestionPaperBean questionPaper;
public List<QuestionsBeanExample> questions; public List<QuestionsBeanExample> questions;
//无数据的默认题
public List<QuestionsBean> extraQuestions;
} }
...@@ -64,11 +64,12 @@ ...@@ -64,11 +64,12 @@
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_input" android:id="@+id/cl_input"
android:layout_width="match_parent" android:layout_width="match_parent"
app:layout_constraintBottom_toTopOf="@id/tv_finish"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:visibility="gone" android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
tools:visibility="visible"> tools:visibility="gone">
<TextView <TextView
android:id="@+id/tv_problem" android:id="@+id/tv_problem"
...@@ -199,7 +200,7 @@ ...@@ -199,7 +200,7 @@
android:textSize="16sp" android:textSize="16sp"
android:visibility="gone" android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
tools:visibility="gone" /> tools:visibility="visible" />
</androidx.constraintlayout.widget.ConstraintLayout> </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