Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
5a40b1e4
Commit
5a40b1e4
authored
Jun 24, 2021
by
刘鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 消息类型都完成
parent
08271c4a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
187 additions
and
36 deletions
+187
-36
question.json
m-im/src/main/assets/question.json
+0
-0
QuestionInformationView.kt
m-im/src/main/java/com/yidianling/uikit/business/session/view/QuestionInformationView.kt
+75
-14
QuestionAdapter.java
m-im/src/main/java/com/yidianling/uikit/business/session/view/question/QuestionAdapter.java
+0
-0
QuestionMultiItem.java
m-im/src/main/java/com/yidianling/uikit/business/session/view/question/QuestionMultiItem.java
+6
-2
QuestionOneCheckListener.kt
m-im/src/main/java/com/yidianling/uikit/business/session/view/question/QuestionOneCheckListener.kt
+4
-3
QuestionPaperBean.java
m-im/src/main/java/com/yidianling/uikit/custom/http/response/question/QuestionPaperBean.java
+19
-0
QuestionsBean.java
m-im/src/main/java/com/yidianling/uikit/custom/http/response/question/QuestionsBean.java
+1
-1
QuestionsBeanExample.java
m-im/src/main/java/com/yidianling/uikit/custom/http/response/question/QuestionsBeanExample.java
+7
-0
QuestionsInfoBean.java
m-im/src/main/java/com/yidianling/uikit/custom/http/response/question/QuestionsInfoBean.java
+2
-14
item_left_describe_layout.xml
m-im/src/main/res/layout/item_left_describe_layout.xml
+68
-0
item_left_more_check_layout.xml
m-im/src/main/res/layout/item_left_more_check_layout.xml
+2
-1
strings.xml
m-im/src/main/res/values/strings.xml
+1
-0
im_view_question_infomation.xml
m-im/src/main/res_uikit/layout/im_view_question_infomation.xml
+2
-1
No files found.
m-im/src/main/assets/question.json
View file @
5a40b1e4
This diff is collapsed.
Click to expand it.
m-im/src/main/java/com/yidianling/uikit/business/session/view/QuestionInformationView.kt
View file @
5a40b1e4
...
...
@@ -69,42 +69,105 @@ class QuestionInformationView(
recycle
.
adapter
=
mQuestionAdapter
mQuestionAdapter
.
setOneCheckListener
(
object
:
QuestionOneCheckListener
{
override
fun
itemClick
(
bean
:
OptionsBean
?,
questionId
:
String
)
{
val
questionMultiItem
=
QuestionMultiItem
()
questionMultiItem
.
type2Text
=
bean
?.
name
questionMultiItem
.
viewType
=
2
mData
.
add
(
questionMultiItem
)
mQuestionAdapter
.
notifyDataSetChanged
()
recycle
.
scrollToPosition
(
mData
.
size
-
1
)
val
questionMultiItem2
=
QuestionMultiItem
()
// 使用问题questionId 去questionChains取到选项配置
val
options
=
mQuestionBean
!!
.
questionChains
[
questionId
]
?.
options
val
options
=
mQuestionBean
!!
.
question
Paper
.
question
Chains
[
questionId
]
?.
options
//从配置里找到下一题id
val
nextQuestionId
=
options
?.
get
(
bean
?.
id
)
//使用下一题nextQuestionId 取到题
val
questionsBean
=
mQuestionBean
!!
.
questions
[
nextQuestionId
]
if
(
questionsBean
!=
null
)
{
val
questionsBean
=
mQuestionBean
!!
.
question
Paper
.
question
s
[
nextQuestionId
]
if
(
questionsBean
!=
null
)
{
//还有下一题
questionMultiItem2
.
questionsBean
=
questionsBean
if
(
"radio"
==
questionsBean
?.
type
)
{
questionMultiItem2
.
viewType
=
3
}
else
{
questionMultiItem2
.
viewType
=
4
questionMultiItem2
.
type4CanClick
=
true
}
mData
.
add
(
questionMultiItem2
)
}
else
{
//没有下一题了
}
else
{
//没有下一题了,展示描述=题
for
((
index
,
item
)
in
mData
.
withIndex
())
{
mData
[
index
].
type4CanClick
=
false
}
val
questionMultiItem5
=
QuestionMultiItem
()
questionMultiItem5
.
type5Bean
=
mQuestionBean
!!
.
questions
[
1
]
questionMultiItem5
.
viewType
=
5
mData
.
add
(
questionMultiItem5
)
// TODO: 6/24/21 展示描述弹窗
}
mQuestionAdapter
.
notifyDataSetChanged
()
recycle
.
scrollToPosition
(
mData
.
size
-
1
)
}
override
fun
moreDefineItemClick
(
list
:
List
<
OptionsBean
?>?)
{
override
fun
moreDefineItemClick
(
list
:
List
<
OptionsBean
?>?
,
questionId
:
String
)
{
//多选确定
var
anwserStr
=
""
list
?.
forEach
{
if
(
anwserStr
.
isNotEmpty
())
{
anwserStr
=
anwserStr
+
"、"
+
it
?.
name
}
else
{
anwserStr
+=
it
?.
name
}
}
val
bean
=
list
?.
get
(
0
)
val
questionMultiItem
=
QuestionMultiItem
()
questionMultiItem
.
type2Text
=
anwserStr
questionMultiItem
.
viewType
=
2
mData
.
add
(
questionMultiItem
)
mQuestionAdapter
.
notifyDataSetChanged
()
recycle
.
scrollToPosition
(
mData
.
size
-
1
)
val
questionMultiItem2
=
QuestionMultiItem
()
// 使用问题questionId 去questionChains取到选项配置
val
options
=
mQuestionBean
!!
.
questionPaper
.
questionChains
[
questionId
]
?.
options
//从配置里找到下一题id
val
nextQuestionId
=
options
?.
get
(
bean
?.
id
)
//使用下一题nextQuestionId 取到题
val
questionsBean
=
mQuestionBean
!!
.
questionPaper
.
questions
[
nextQuestionId
]
if
(
questionsBean
!=
null
)
{
//还有下一题
questionMultiItem2
.
questionsBean
=
questionsBean
if
(
"radio"
==
questionsBean
?.
type
)
{
questionMultiItem2
.
viewType
=
3
}
else
{
questionMultiItem2
.
viewType
=
4
questionMultiItem2
.
type4CanClick
=
true
}
mData
.
add
(
questionMultiItem2
)
}
else
{
//没有下一题了,展示描述=题
for
((
index
,
item
)
in
mData
.
withIndex
())
{
mData
[
index
].
type4CanClick
=
false
}
val
questionMultiItem5
=
QuestionMultiItem
()
questionMultiItem5
.
type5Bean
=
mQuestionBean
!!
.
questions
[
1
]
questionMultiItem5
.
viewType
=
5
mData
.
add
(
questionMultiItem5
)
// TODO: 6/24/21 展示描述弹窗
}
mQuestionAdapter
.
notifyDataSetChanged
()
recycle
.
scrollToPosition
(
mData
.
size
-
1
)
}
override
fun
showOtherEdit
(
list
:
List
<
OptionsBean
?>?)
{
override
fun
showOtherEdit
(
list
:
List
<
OptionsBean
?>?
,
questionId
:
String
)
{
//弹出输入框
ToastUtil
.
toastShort
(
"弹出输入框"
)
}
...
...
@@ -118,28 +181,26 @@ class QuestionInformationView(
mQuestionBean
=
questionInfo
mData
.
clear
()
val
questionMultiItem
=
QuestionMultiItem
()
questionMultiItem
.
type1Text
=
questionInfo
.
name
questionMultiItem
.
type1Text
=
questionInfo
.
questions
[
0
].
question
questionMultiItem
.
viewType
=
1
mData
.
add
(
questionMultiItem
)
val
questionMultiItem2
=
QuestionMultiItem
()
mQuestionBean
!!
.
questionChains
.
forEach
{
(
k
,
v
)
->
mQuestionBean
!!
.
question
Paper
.
question
Chains
.
forEach
{
(
k
,
v
)
->
if
(
v
.
head
)
{
// 代表第一题 ,使用questionId 去questions取到对应的提
val
questionsBean
=
mQuestionBean
!!
.
questions
[
v
.
questionId
]
val
questionsBean
=
mQuestionBean
!!
.
question
Paper
.
question
s
[
v
.
questionId
]
questionMultiItem2
.
questionsBean
=
questionsBean
if
(
"radio"
==
questionsBean
?.
type
)
{
questionMultiItem2
.
viewType
=
3
}
else
{
questionMultiItem2
.
viewType
=
4
questionMultiItem2
.
type4CanClick
=
true
}
mData
.
add
(
questionMultiItem2
)
return
@forEach
}
}
// mQuestionAdapter.notifyDataSetChanged()
}
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/view/question/QuestionAdapter.java
View file @
5a40b1e4
This diff is collapsed.
Click to expand it.
m-im/src/main/java/com/yidianling/uikit/business/session/view/question/QuestionMultiItem.java
View file @
5a40b1e4
...
...
@@ -2,11 +2,12 @@ package com.yidianling.uikit.business.session.view.question;
import
com.chad.library.adapter.base.entity.MultiItemEntity
;
import
com.yidianling.uikit.custom.http.response.question.QuestionsBean
;
import
com.yidianling.uikit.custom.http.response.question.QuestionsBeanExample
;
/**
*
Created by hzchenkang on 2017/6/21.
*
@author liupeng
*/
public
class
QuestionMultiItem
implements
MultiItemEntity
{
public
int
viewType
;
...
...
@@ -15,6 +16,9 @@ public class QuestionMultiItem implements MultiItemEntity {
public
String
type2Text
;
/***type 3 单选 type 4 多选 */
public
QuestionsBean
questionsBean
;
public
boolean
type4CanClick
;
public
QuestionsBeanExample
type5Bean
;
@Override
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/view/question/QuestionOneCheckListener.kt
View file @
5a40b1e4
...
...
@@ -6,15 +6,15 @@ interface QuestionOneCheckListener {
/**
* 单选点击获取item信息
*/
fun
itemClick
(
bean
:
OptionsBean
?,
questionId
:
String
)
fun
itemClick
(
bean
:
OptionsBean
?,
questionId
:
String
)
/**
* 多选确定按钮点击
*/
fun
moreDefineItemClick
(
list
:
List
<
OptionsBean
?>?)
fun
moreDefineItemClick
(
list
:
List
<
OptionsBean
?>?
,
questionId
:
String
)
/**
* 展示其他
*/
fun
showOtherEdit
(
list
:
List
<
OptionsBean
?>?)
fun
showOtherEdit
(
list
:
List
<
OptionsBean
?>?
,
questionId
:
String
)
}
\ No newline at end of file
m-im/src/main/java/com/yidianling/uikit/custom/http/response/question/QuestionPaperBean.java
0 → 100644
View file @
5a40b1e4
package
com
.
yidianling
.
uikit
.
custom
.
http
.
response
.
question
;
import
java.util.Map
;
public
class
QuestionPaperBean
{
public
String
id
;
public
String
createTime
;
public
String
updateTime
;
public
int
isDeleted
;
public
String
category
;
public
String
name
;
public
String
cateId
;
public
String
cateName
;
public
int
questionNum
;
public
int
status
;
public
String
remark
;
public
Map
<
String
,
QuestionChainsBean
>
questionChains
;
public
Map
<
String
,
QuestionsBean
>
questions
;
}
m-im/src/main/java/com/yidianling/uikit/custom/http/response/question/QuestionsBean.java
View file @
5a40b1e4
...
...
@@ -24,7 +24,7 @@ public class QuestionsBean {
public
int
isDeleted
;
public
String
questionPaperId
;
public
String
category
;
public
int
order
;
public
String
order
;
public
String
name
;
/***类型:
* radio(单选)
...
...
m-im/src/main/java/com/yidianling/uikit/custom/http/response/question/QuestionsBeanExample.java
0 → 100644
View file @
5a40b1e4
package
com
.
yidianling
.
uikit
.
custom
.
http
.
response
.
question
;
public
class
QuestionsBeanExample
{
public
String
question
;
public
String
example
;
}
m-im/src/main/java/com/yidianling/uikit/custom/http/response/question/QuestionsInfoBean.java
View file @
5a40b1e4
package
com
.
yidianling
.
uikit
.
custom
.
http
.
response
.
question
;
import
java.util.List
;
import
java.util.Map
;
public
class
QuestionsInfoBean
{
...
...
@@ -21,19 +20,8 @@ public class QuestionsInfoBean {
* question_chains : {"601128318581870592":{"id":"601145789934211072","create_time":"2021-06-12 17:39:50","update_time":"2021-06-12 17:41:31","question_paper_id":"601128023407726592","question_id":"601128318581870592","head":true,"options":{"601128318544121856":"601128931717812224"}}}
* questions : {"601128318581870592":{"id":"601128318581870592","create_time":"2021-06-12 16:30:25","update_time":"2021-06-12 16:30:25","is_deleted":0,"question_paper_id":"601128023407726592","category":"pre_diagnosis","order":1,"name":"服药历","type":"radio","remarks":["请问你有服药史么?"],"options":[{"id":"601128318544121856","name":"1~3 个月","relates":[{"category":"症状","name":"幻觉"}]},{"id":"601128318544121857","name":"4~6 个月","relates":[{"category":"症状","name":"幻觉"}]},{"id":"601128318544121858","name":"7~9 个月","relates":[{"category":"症状","name":"幻觉"}]},{"id":"601128318544121859","name":"10~12 个月","relates":[{"category":"症状","name":"幻觉"}]}]},"601128931717812224":{"id":"601128931717812224","create_time":"2021-06-12 16:32:51","update_time":"2021-06-12 16:32:51","is_deleted":0,"question_paper_id":"601128023407726592","category":"pre_diagnosis","order":2,"name":"晚上睡觉会醒几次","type":"radio","remarks":["晚上睡觉会醒几次?"],"options":[{"id":"601128931680063488","name":"1~3 次","relates":[{"category":"症状","name":"思绪混乱"}]},{"id":"601128931680063489","name":"4~6 次","relates":[{"category":"症状","name":"思绪混乱"}]},{"id":"601128931680063490","name":"7~9 次","relates":[{"category":"症状","name":"思绪混乱"}]},{"id":"601128931680063491","name":"10~12 次","relates":[{"category":"症状","name":"思绪混乱"}]}]},"601129312090853376":{"id":"601129312090853376","create_time":"2021-06-12 16:34:22","update_time":"2021-06-12 16:34:22","is_deleted":0,"question_paper_id":"601128023407726592","category":"pre_diagnosis","order":3,"name":"有逃离的想法么?","type":"radio","remarks":["有逃离的想法么?"],"options":[{"id":"601129312040521728","name":"有","relates":[{"category":"症状","name":"妄想症"}]},{"id":"601129312040521729","name":"无","relates":[{"category":"症状","name":"妄想症"}]},{"id":"601129312040521730","name":"其他"}]}}
*/
public
QuestionPaperBean
questionPaper
;
public
List
<
QuestionsBeanExample
>
questions
;
public
String
id
;
public
String
createTime
;
public
String
updateTime
;
public
int
isDeleted
;
public
String
category
;
public
String
name
;
public
long
cateId
;
public
String
cateName
;
public
int
questionNum
;
public
int
status
;
public
String
remark
;
public
Map
<
String
,
QuestionChainsBean
>
questionChains
;
public
Map
<
String
,
QuestionsBean
>
questions
;
}
m-im/src/main/res/layout/item_left_describe_layout.xml
0 → 100644
View file @
5a40b1e4
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<ImageView
android:id=
"@+id/iv_header"
android:layout_width=
"36dp"
android:layout_height=
"36dp"
android:layout_centerVertical=
"true"
android:src=
"@drawable/im_ico_default_avatar"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"8dp"
android:background=
"@drawable/im_custom_message_round_white_6dp_bg"
android:orientation=
"vertical"
android:padding=
"12dp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintLeft_toRightOf=
"@id/iv_header"
app:layout_constraintTop_toTopOf=
"parent"
>
<TextView
android:id=
"@+id/multiple_choice_title"
android:layout_width=
"239dp"
android:layout_height=
"wrap_content"
android:textColor=
"@color/im_color_242424"
android:textSize=
"@dimen/im_text_size_17"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
tools:text=
"请问是发生了什么事情导致的呢?(多选)?"
/>
<TextView
android:id=
"@+id/tv_notes"
android:layout_width=
"239dp"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"4dp"
android:text=
"@string/question_notes"
android:textColor=
"@color/color_grey_999999"
android:textSize=
"14sp"
/>
<View
android:id=
"@+id/line"
android:layout_width=
"239dp"
android:layout_height=
"@dimen/platform_dp_05"
android:layout_marginTop=
"8dp"
android:background=
"@color/im_color_EBEBEB"
android:visibility=
"gone"
/>
<TextView
android:id=
"@+id/example"
android:layout_width=
"239dp"
android:layout_height=
"wrap_content"
android:textColor=
"@color/im_color_242424"
android:textSize=
"@dimen/platform_dp_14"
android:visibility=
"gone"
tools:text=
"例:大学毕业后不知道该找什么工作,去年七月当过一次超市导购员,每天都要给顾客推荐这推荐那,感觉这不是我了,一想到上班后每天过着自己都排斥的日子我就越不敢继续找工作,就好像工作剥夺了我什么东西是的。"
/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
m-im/src/main/res/layout/item_left_more_check_layout.xml
View file @
5a40b1e4
...
...
@@ -53,12 +53,13 @@
android:layout_width=
"110dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"right"
android:textColor=
"@color/white"
android:layout_marginTop=
"8dp"
android:background=
"@drawable/im_background_18dp_ebebeb"
android:gravity=
"center"
android:paddingTop=
"@dimen/platform_dp_8"
android:paddingBottom=
"@dimen/platform_dp_8"
android:text=
"确定
(2)
"
android:text=
"确定"
android:textSize=
"@dimen/im_text_size_15"
>
</TextView>
...
...
m-im/src/main/res/values/strings.xml
View file @
5a40b1e4
...
...
@@ -245,5 +245,6 @@
<string
name=
"im_chat_private_title"
>
私聊须知
</string>
<string
name=
"im_chat_pivate_content"
>
如系统检测到涉黄、涉爆、涉政等信息,可能会封号处理并追究法律责任!
</string>
<string
name=
"im_video_play"
>
视频播放
</string>
<string
name=
"question_notes"
>
注:描述中请包涵问题持续时间、问题发生原因、当前的问题。如何描述?
</string>
</resources>
m-im/src/main/res_uikit/layout/im_view_question_infomation.xml
View file @
5a40b1e4
...
...
@@ -52,7 +52,8 @@
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"1"
android:background=
"@color/platform_color_F0F0F0"
>
android:background=
"@color/platform_color_F0F0F0"
android:paddingBottom=
"12dp"
>
</androidx.recyclerview.widget.RecyclerView>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment