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
d3d0e5ec
Commit
d3d0e5ec
authored
Jun 29, 2021
by
霍志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:im-灵犀2.0-添加首问语卡片
parent
f15e59c0
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
110 additions
and
1 deletions
+110
-1
SessionHelper.java
m-im/src/main/java/com/yidianling/im/session/SessionHelper.java
+4
-0
CustomAttachLingxiFirstQuestion.java
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachLingxiFirstQuestion.java
+37
-0
CustomAttachParser.java
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachParser.java
+3
-0
CustomAttachmentType.java
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachmentType.java
+1
-0
MsgViewHolderLingxiFirstQuestion.java
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderLingxiFirstQuestion.java
+55
-0
MsgViewHolderLingxiWhichQuestion.java
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderLingxiWhichQuestion.java
+0
-1
im_nim_lingxi_first_question.xml
m-im/src/main/res/layout/im_nim_lingxi_first_question.xml
+10
-0
No files found.
m-im/src/main/java/com/yidianling/im/session/SessionHelper.java
View file @
d3d0e5ec
...
...
@@ -45,6 +45,7 @@ import com.yidianling.im.session.extension.CustomAttachConsultCallStatus;
import
com.yidianling.im.session.extension.CustomAttachConsultPerfectData
;
import
com.yidianling.im.session.extension.CustomAttachConsultSubScript
;
import
com.yidianling.im.session.extension.CustomAttachLingxiAnswerQuestion
;
import
com.yidianling.im.session.extension.CustomAttachLingxiFirstQuestion
;
import
com.yidianling.im.session.extension.CustomAttachLingxiWhichQuestion
;
import
com.yidianling.im.session.extension.CustomAttachModifyTime
;
import
com.yidianling.im.session.extension.CustomAttachParser
;
...
...
@@ -89,6 +90,7 @@ import com.yidianling.im.session.viewholder.MsgViewHolderDefCustom;
import
com.yidianling.im.session.viewholder.MsgViewHolderEvaluate
;
import
com.yidianling.im.session.viewholder.MsgViewHolderJumpToDaoYi
;
import
com.yidianling.im.session.viewholder.MsgViewHolderLingxiAnswerQuestion
;
import
com.yidianling.im.session.viewholder.MsgViewHolderLingxiFirstQuestion
;
import
com.yidianling.im.session.viewholder.MsgViewHolderLingxiWhichQuestion
;
import
com.yidianling.im.session.viewholder.MsgViewHolderModifyTime
;
import
com.yidianling.im.session.viewholder.MsgViewHolderOrderAlreadyDone
;
...
...
@@ -471,6 +473,8 @@ public class SessionHelper {
NimUIKit
.
registerMsgItemViewHolder
(
CustomAttachmentOrderAlreadyDone
.
class
,
MsgViewHolderOrderAlreadyDone
.
class
);
//已完成订单消息类型39
NimUIKit
.
registerMsgItemViewHolder
(
CustomAttachLingxiWhichQuestion
.
class
,
MsgViewHolderLingxiWhichQuestion
.
class
);
//灵犀2.0-您想要咨询下列哪些问题
NimUIKit
.
registerMsgItemViewHolder
(
CustomAttachLingxiAnswerQuestion
.
class
,
MsgViewHolderLingxiAnswerQuestion
.
class
);
//灵犀2.0-回答问题
NimUIKit
.
registerMsgItemViewHolder
(
CustomAttachLingxiFirstQuestion
.
class
,
MsgViewHolderLingxiFirstQuestion
.
class
);
//灵犀2.0-首问语
}
...
...
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachLingxiFirstQuestion.java
0 → 100644
View file @
d3d0e5ec
package
com
.
yidianling
.
im
.
session
.
extension
;
import
com.alibaba.fastjson.JSONObject
;
public
class
CustomAttachLingxiFirstQuestion
extends
CustomAttachment
{
private
final
String
GREETIMAGE
=
"greetImage"
;
//图片
private
final
String
GREETVIDEO
=
"greetVideo"
;
//视频
private
final
String
GREETURL
=
"greetUrl"
;
//url链接
public
String
greetImage
;
public
String
greetVideo
;
public
String
greetUrl
;
public
CustomAttachLingxiFirstQuestion
()
{
super
(
CustomAttachmentType
.
TYPE_LINGXI_FIRST_QUESTION
);
}
@Override
protected
void
parseData
(
JSONObject
data
)
{
this
.
greetImage
=
data
.
getString
(
GREETIMAGE
);
this
.
greetVideo
=
data
.
getString
(
GREETVIDEO
);
this
.
greetUrl
=
data
.
getString
(
GREETURL
);
}
@Override
protected
JSONObject
packData
()
{
JSONObject
data
=
new
JSONObject
();
data
.
put
(
GREETIMAGE
,
greetImage
);
data
.
put
(
GREETVIDEO
,
greetVideo
);
data
.
put
(
GREETURL
,
GREETURL
);
return
data
;
}
}
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachParser.java
View file @
d3d0e5ec
...
...
@@ -151,6 +151,9 @@ public class CustomAttachParser implements MsgAttachmentParser {
case
CustomAttachmentType
.
TYPE_LINGXI_JUMP_CONFIDE_LIST
:
// 跳转倾诉列表
attachment
=
new
CustomAttachLingXiJumpConfideList
();
break
;
case
CustomAttachmentType
.
TYPE_LINGXI_FIRST_QUESTION
:
//首问语
attachment
=
new
CustomAttachLingxiFirstQuestion
();
break
;
default
:
attachment
=
new
DefaultCustomAttachment
();
break
;
...
...
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachmentType.java
View file @
d3d0e5ec
...
...
@@ -44,6 +44,7 @@ public interface CustomAttachmentType {
int
TYPE_ORDER_ALREADY_DONE
=
39
;
//已完成订单
//灵犀2.0问诊数据
int
TYPE_LINGXI_FIRST_QUESTION
=
50
;
//首问语
int
TYPE_LINGXI_WHICH_QUESTION
=
55
;
//试卷消息
int
TYPE_LINGXI_ANSWER_QUESTION
=
56
;
//回答消息
int
TYPE_LINGXI_TEST_QUESTION
=
60
;
//测评结果
...
...
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderLingxiFirstQuestion.java
0 → 100644
View file @
d3d0e5ec
package
com
.
yidianling
.
im
.
session
.
viewholder
;
import
android.widget.ImageView
;
import
com.ydl.webview.H5Params
;
import
com.ydl.webview.NewH5Activity
;
import
com.ydl.ydl_image.module.GlideApp
;
import
com.yidianling.im.R
;
import
com.yidianling.im.session.extension.CustomAttachLingxiFirstQuestion
;
import
com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter
;
import
com.yidianling.uikit.business.session.activity.WatchVideoActivity
;
import
com.yidianling.uikit.business.session.viewholder.MsgViewHolderBase
;
public
class
MsgViewHolderLingxiFirstQuestion
extends
MsgViewHolderBase
{
private
ImageView
imageView
;
private
String
jumpUrl
;
private
String
jumpVideo
;
private
String
imageUrl
;
public
MsgViewHolderLingxiFirstQuestion
(
BaseMultiItemFetchLoadAdapter
adapter
)
{
super
(
adapter
);
}
@Override
protected
int
getContentResId
()
{
return
R
.
layout
.
im_nim_lingxi_first_question
;
}
@Override
protected
void
inflateContentView
()
{
imageView
=
findViewById
(
R
.
id
.
first_question
);
}
@Override
protected
void
bindContentView
()
{
jumpUrl
=((
CustomAttachLingxiFirstQuestion
)
message
.
getAttachment
()).
greetUrl
;
jumpVideo
=((
CustomAttachLingxiFirstQuestion
)
message
.
getAttachment
()).
greetVideo
;
imageUrl
=((
CustomAttachLingxiFirstQuestion
)
message
.
getAttachment
()).
greetImage
;
GlideApp
.
with
(
context
)
.
load
(
imageUrl
)
.
into
(
imageView
);
}
@Override
protected
void
onItemClick
()
{
super
.
onItemClick
();
if
(
jumpUrl
.
length
()>
0
&&
jumpUrl
!=
null
){
//跳转URL
NewH5Activity
.
start
(
context
,
new
H5Params
(
jumpUrl
,
null
));
}
/* else if (jumpVideo!=null&&!jumpVideo.isEmpty()){
//播放视频
NewH5Activity.start(context,new H5Params(jumpVideo,null));
}*/
}
}
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderLingxiWhichQuestion.java
View file @
d3d0e5ec
...
...
@@ -122,7 +122,6 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
break
;
}
}
questionList
.
get
(
0
).
setName
(
"其他"
);
if
(
customAttachLingxiWhichQuestion
.
type
!=
null
){
switch
(
customAttachLingxiWhichQuestion
.
type
){
case
"radio"
:
//您想要咨询下列哪类的问题?(单选)
...
...
m-im/src/main/res/layout/im_nim_lingxi_first_question.xml
0 → 100644
View file @
d3d0e5ec
<?xml version="1.0" encoding="utf-8"?>
<ImageView
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"260dp"
android:layout_height=
"260dp"
android:scaleType=
"fitXY"
android:id=
"@+id/first_question"
>
</ImageView>
\ No newline at end of file
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