Commit 3bcd9b8b by 刘鹏

Merge branch 'dev_information_collection_card' into 最新Dev

# Conflicts:
#	config.gradle
#	m-im/src/main/java/com/yidianling/im/ui/activity/CmsExamQuestionPaperActivity.kt
parents c5d56965 32347109
...@@ -10,7 +10,7 @@ ext { ...@@ -10,7 +10,7 @@ ext {
"m-fm" : "0.0.30.04", "m-fm" : "0.0.30.04",
"m-user" : "0.0.61.94", "m-user" : "0.0.61.94",
"m-home" : "0.0.22.92", "m-home" : "0.0.22.92",
"m-im" : "0.0.21.02", "m-im" : "0.0.21.11",
"m-dynamic" : "0.0.7.35", "m-dynamic" : "0.0.7.35",
"m-article" : "0.0.0.10", "m-article" : "0.0.0.10",
...@@ -93,7 +93,7 @@ ext { ...@@ -93,7 +93,7 @@ ext {
"m-fm" : "0.0.30.07", "m-fm" : "0.0.30.07",
"m-user" : "0.0.61.94", "m-user" : "0.0.61.94",
"m-home" : "0.0.22.92", "m-home" : "0.0.22.92",
"m-im" : "0.0.21.02", "m-im" : "0.0.21.11",
"m-dynamic" : "0.0.7.35", "m-dynamic" : "0.0.7.35",
"m-article" : "0.0.0.8", "m-article" : "0.0.0.8",
......
...@@ -29,7 +29,6 @@ import com.ydl.ydl_image.listener.YDLImageRecyclerOnScrollListener ...@@ -29,7 +29,6 @@ import com.ydl.ydl_image.listener.YDLImageRecyclerOnScrollListener
import com.ydl.ydlcommon.modular.ModularServiceManager import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.mvp.lce.BaseLceActivity import com.ydl.ydlcommon.mvp.lce.BaseLceActivity
import com.ydl.ydlcommon.utils.StatusBarUtils import com.ydl.ydlcommon.utils.StatusBarUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.remind.ToastHelper import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.ydl.ydlcommon.view.DrawableRightTextView import com.ydl.ydlcommon.view.DrawableRightTextView
import com.ydl.ydlcommon.view.WrapContentLinearLayoutManager import com.ydl.ydlcommon.view.WrapContentLinearLayoutManager
......
...@@ -156,6 +156,8 @@ interface ImRetrofitApi { ...@@ -156,6 +156,8 @@ interface ImRetrofitApi {
fun getConsultAssistantUidRequest( fun getConsultAssistantUidRequest(
@Query("location") location: Int, @Query("location") location: Int,
@Query("ffrom_2") ffrom: String?, @Query("ffrom_2") ffrom: String?,
@Query("naviType") naviType: String = "1" @Query("naviType") naviType: String = "1",
@Query("examId") examId: String = "",
@Query("questionPaperId") questionPaperId: String = ""
): Observable<BaseAPIResponse<Long>> ): Observable<BaseAPIResponse<Long>>
} }
\ No newline at end of file
package com.yidianling.im.ui.activity package com.yidianling.im.ui.activity
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.app.Activity
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.os.Handler import android.os.Handler
...@@ -86,6 +87,8 @@ class CmsExamQuestionPaperActivity : BaseActivity() { ...@@ -86,6 +87,8 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
private var location: Int = 0 private var location: Int = 0
private var ffrom2: String? = null private var ffrom2: String? = null
/**单选类型*/
private const val RADIO_KEY="radio"
@JvmStatic @JvmStatic
fun start(context: Context, toUid: String, expertInfo: IMExpertBuild, isFromQingShu: Int) { fun start(context: Context, toUid: String, expertInfo: IMExpertBuild, isFromQingShu: Int) {
...@@ -94,6 +97,8 @@ class CmsExamQuestionPaperActivity : BaseActivity() { ...@@ -94,6 +97,8 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
this.toUid = toUid this.toUid = toUid
this.isFromQingShu = isFromQingShu this.isFromQingShu = isFromQingShu
context.startActivity(starter) context.startActivity(starter)
val activity = context as Activity
activity.overridePendingTransition(R.anim.platform_activity_anim_in,R.anim.platform_activity_anim_in)
} }
@JvmStatic @JvmStatic
...@@ -203,7 +208,10 @@ class CmsExamQuestionPaperActivity : BaseActivity() { ...@@ -203,7 +208,10 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
/**添加view事件*/ /**添加view事件*/
private fun addVIewListener() { private fun addVIewListener() {
left_back_btn.setOnClickListener { finish() } left_back_btn.setOnClickListener {
ActionCountUtils.count("daoyi_consult_assess_page|return_click")
finish()
}
tv_skip.setOnClickListener { tv_skip.setOnClickListener {
if (Utils.isFastClick()) { if (Utils.isFastClick()) {
//防止连击 //防止连击
...@@ -216,29 +224,11 @@ class CmsExamQuestionPaperActivity : BaseActivity() { ...@@ -216,29 +224,11 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
ActionCountUtils.count("daoyi_consult_assess_page|go_communication_click") ActionCountUtils.count("daoyi_consult_assess_page|go_communication_click")
skipToIm() skipToIm()
} }
//发送按钮
tv_send.setOnClickListener { tv_send.setOnClickListener {
if (noMore) { if (noMore) {
//最后一题 点击发送 //最后一题 点击发送
lastAnswer = et_input_problem.text.toString() lastAnswerSend()
if (mType71RequestList.size > 0) {
addType71Request(
et_input_problem.text.toString(),
mType71RequestList[0].data.cateId
)
} else {
addType71Request(et_input_problem.text.toString(), "")
}
tv_finish.visibility = View.VISIBLE
mackType2(lastAnswer, "")
setFirstAndLatQuestion(mQuestionBean!!.questions[2].question)
//滑动到底部
recycle.scrollToPosition(mData.size - 1)
mData.forEachIndexed { index, _ ->
mData[index].type5CanClick = false
}
} else { } else {
//答题过程中点击 其他的弹窗 //答题过程中点击 其他的弹窗
...@@ -251,33 +241,37 @@ class CmsExamQuestionPaperActivity : BaseActivity() { ...@@ -251,33 +241,37 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
} }
hideInputAndKeyboark() hideInputAndKeyboark()
} }
//当前问题
tv_cur_problem.setOnClickListener { tv_cur_problem.setOnClickListener {
problemContent = et_input_problem.text.toString() problemContent = et_input_problem.text.toString()
if (!TextUtils.isEmpty(problemContent)){ if (!TextUtils.isEmpty(problemContent)) {
problemContent = "$problemContent\n\n" problemContent = "$problemContent\n\n"
} }
et_input_problem.setText("$problemContent${tv_cur_problem.text}:") et_input_problem.setText("$problemContent${tv_cur_problem.text}:")
et_input_problem.setSelection(et_input_problem.text.toString().length) et_input_problem.setSelection(et_input_problem.text.toString().length)
recycle.smoothScrollToPosition(mData.size - 1) recycle.smoothScrollToPosition(mData.size - 1)
} }
//持续时间
tv_duration.setOnClickListener { tv_duration.setOnClickListener {
problemContent = et_input_problem.text.toString() problemContent = et_input_problem.text.toString()
if (!TextUtils.isEmpty(problemContent)){ if (!TextUtils.isEmpty(problemContent)) {
problemContent = "$problemContent\n\n" problemContent = "$problemContent\n\n"
} }
et_input_problem.setText("$problemContent${tv_duration.text}:") et_input_problem.setText("$problemContent${tv_duration.text}:")
et_input_problem.setSelection(et_input_problem.text.toString().length) et_input_problem.setSelection(et_input_problem.text.toString().length)
recycle.smoothScrollToPosition(mData.size - 1) recycle.smoothScrollToPosition(mData.size - 1)
} }
//问题影响
tv_problem_impact.setOnClickListener { tv_problem_impact.setOnClickListener {
problemContent = et_input_problem.text.toString() problemContent = et_input_problem.text.toString()
if (!TextUtils.isEmpty(problemContent)){ if (!TextUtils.isEmpty(problemContent)) {
problemContent = "$problemContent\n\n" problemContent = "$problemContent\n\n"
} }
et_input_problem.setText("$problemContent${tv_problem_impact.text}:") et_input_problem.setText("$problemContent${tv_problem_impact.text}:")
et_input_problem.setSelection(et_input_problem.text.toString().length) et_input_problem.setSelection(et_input_problem.text.toString().length)
recycle.smoothScrollToPosition(mData.size - 1) recycle.smoothScrollToPosition(mData.size - 1)
} }
//请简单描述遇到的问题 输入框
et_input_problem.addTextChangedListener(object : TextWatcher { et_input_problem.addTextChangedListener(object : TextWatcher {
override fun afterTextChanged(p0: Editable?) { override fun afterTextChanged(p0: Editable?) {
// 动态监听输入行数大于等于4行,滚动列表到底部 // 动态监听输入行数大于等于4行,滚动列表到底部
...@@ -331,7 +325,35 @@ class CmsExamQuestionPaperActivity : BaseActivity() { ...@@ -331,7 +325,35 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
} }
} }
} }
/**
* 最后一题
* */
private fun lastAnswerSend() {
lastAnswer = et_input_problem.text.toString()
if (mType71RequestList.size > 0) {
addType71Request(
et_input_problem.text.toString(),
mType71RequestList[0].data.cateId
)
} else {
addType71Request(et_input_problem.text.toString(), "")
}
//最后一题答玩展示立即前往按钮,隐藏跳过按钮
tv_finish.visibility = View.VISIBLE
tv_skip.visibility = View.GONE
mackType2(lastAnswer, "")
setFirstAndLatQuestion(mQuestionBean!!.questions[2].question)
//滑动到底部
recycle.scrollToPosition(mData.size - 1)
mData.forEachIndexed { index, _ ->
mData[index].type5CanClick = false
}
}
/**
* 隐藏输入框
* */
private fun hideInputAndKeyboark() { private fun hideInputAndKeyboark() {
et_input_problem.setText("") et_input_problem.setText("")
hideInputMethod(et_input_problem) hideInputMethod(et_input_problem)
...@@ -385,8 +407,13 @@ class CmsExamQuestionPaperActivity : BaseActivity() { ...@@ -385,8 +407,13 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
if (questionsBean != null) { if (questionsBean != null) {
//还有下一题 //还有下一题
questionMultiItem2.questionsBean = questionsBean questionMultiItem2.questionsBean = questionsBean
if ("radio" == questionsBean.type) { if (RADIO_KEY == questionsBean.type) {
questionMultiItem2.viewType = 3 if (!questionsBean.image.isNullOrEmpty() || !questionsBean.url.isNullOrEmpty()) {
tv_skip.visibility = View.GONE
questionMultiItem2.viewType = 7
} else {
questionMultiItem2.viewType = 3
}
} else { } else {
questionMultiItem2.viewType = 4 questionMultiItem2.viewType = 4
questionMultiItem2.type4CanClick = true questionMultiItem2.type4CanClick = true
...@@ -394,7 +421,9 @@ class CmsExamQuestionPaperActivity : BaseActivity() { ...@@ -394,7 +421,9 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
mData.add(questionMultiItem2) mData.add(questionMultiItem2)
} else { } else {
//没有下一题了,跳转按钮展示 //没有下一题了,跳转按钮展示
setFirstAndLatQuestion(mQuestionBean!!.questions[2].question)
tv_finish.visibility = View.VISIBLE tv_finish.visibility = View.VISIBLE
tv_skip.visibility = View.GONE
} }
mQuestionAdapter.notifyDataSetChanged() mQuestionAdapter.notifyDataSetChanged()
recycle.scrollToPosition(mData.size - 1) recycle.scrollToPosition(mData.size - 1)
...@@ -563,8 +592,13 @@ class CmsExamQuestionPaperActivity : BaseActivity() { ...@@ -563,8 +592,13 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
) { ) {
val questionsBean = mQuestionBean!!.questionPaper.questions[questionChain.questionId] val questionsBean = mQuestionBean!!.questionPaper.questions[questionChain.questionId]
questionMultiItem2.questionsBean = questionsBean questionMultiItem2.questionsBean = questionsBean
if ("radio" == questionsBean?.type) { if (RADIO_KEY == questionsBean?.type) {
questionMultiItem2.viewType = 3 if(!questionsBean.image.isNullOrEmpty()||!questionsBean.url.isNullOrEmpty()){
tv_skip.visibility = View.GONE
questionMultiItem2.viewType = 7
}else{
questionMultiItem2.viewType = 3
}
} else { } else {
questionMultiItem2.viewType = 4 questionMultiItem2.viewType = 4
questionMultiItem2.type4CanClick = true questionMultiItem2.type4CanClick = true
...@@ -742,8 +776,11 @@ class CmsExamQuestionPaperActivity : BaseActivity() { ...@@ -742,8 +776,11 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
}, 1000L) }, 1000L)
} else { } else {
//代表是导医进来的 导医进来的需要获取导医后再发送消息 //代表是导医进来的 导医进来的需要获取导医后再发送消息
var questionPaperId = ""
mQuestionBean?.questionPaper?.id?.let { questionPaperId = it }
ImRetrofitApi.getImJavaApi() ImRetrofitApi.getImJavaApi()
.getConsultAssistantUidRequest(location, ffrom2) .getConsultAssistantUidRequest(location, ffrom2, answerQuestionId, questionPaperId)
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe({ uidBean -> .subscribe({ uidBean ->
...@@ -860,4 +897,9 @@ class CmsExamQuestionPaperActivity : BaseActivity() { ...@@ -860,4 +897,9 @@ class CmsExamQuestionPaperActivity : BaseActivity() {
return false return false
} }
override fun finish() {
super.finish()
overridePendingTransition(R.anim.platform_activity_anim_in,R.anim.platform_activity_anim_in)
}
} }
\ No newline at end of file
...@@ -3,6 +3,7 @@ package com.yidianling.uikit.custom.http.response.question; ...@@ -3,6 +3,7 @@ package com.yidianling.uikit.custom.http.response.question;
import java.util.Map; import java.util.Map;
public class QuestionPaperBean { public class QuestionPaperBean {
//试卷id
public String id; public String id;
public String createTime; public String createTime;
public String updateTime; public String updateTime;
......
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/platform_color_1DA1F2" /> <solid android:color="@color/platform_color_1DA1F2" />
<corners android:radius="18dp" /> <corners android:radius="20dp" />
</shape> </shape>
\ No newline at end of file
...@@ -44,32 +44,42 @@ ...@@ -44,32 +44,42 @@
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
tools:text="请问是发生" /> tools:text="请问是发生" />
<ImageView <androidx.cardview.widget.CardView
android:id="@+id/image"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="12dp" /> android:layout_marginTop="12dp"
android:elevation="0dp"
app:cardCornerRadius="8dp"
app:cardElevation="0dp">
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</androidx.cardview.widget.CardView>
<LinearLayout <LinearLayout
android:layout_marginTop="12dp"
android:id="@+id/jump_url" android:id="@+id/jump_url"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="32dp" android:layout_height="40dp"
android:layout_marginTop="12dp"
android:background="@drawable/bg_shape_1da1f2_r18" android:background="@drawable/bg_shape_1da1f2_r18"
android:gravity="center" android:gravity="center"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:layout_marginBottom="1px"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
android:text="点击前往" android:text="点击前往"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="14sp" /> android:textSize="16sp" />
<ImageView <ImageView
android:layout_width="12dp" android:layout_marginTop="1px"
android:layout_height="12dp" android:layout_width="14dp"
android:layout_height="14dp"
android:layout_marginLeft="4dp" android:layout_marginLeft="4dp"
android:src="@drawable/ic_arrow_right" /> android:src="@drawable/ic_arrow_right" />
</LinearLayout> </LinearLayout>
......
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