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
5771fb70
Commit
5771fb70
authored
Apr 26, 2021
by
霍志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:消息类型-完成订单38
parent
8b48bff4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
201 additions
and
1 deletions
+201
-1
CustomAttachmentConfirmOrder.java
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachmentConfirmOrder.java
+42
-0
CustomAttachmentType.java
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachmentType.java
+2
-1
MsgViewHolderConfirmOrder.java
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderConfirmOrder.java
+79
-0
im_ui_message_custom_confirm_order.xml
m-im/src/main/res/layout/im_ui_message_custom_confirm_order.xml
+78
-0
No files found.
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachmentConfirmOrder.java
0 → 100644
View file @
5771fb70
package
com
.
yidianling
.
im
.
session
.
extension
;
import
com.alibaba.fastjson.JSONObject
;
public
class
CustomAttachmentConfirmOrder
extends
CustomAttachment
{
private
static
final
String
TITLE
=
"title"
;
//标题
private
static
final
String
STATUS
=
"status"
;
//状态,1代表已确认,0代表待确认
private
static
final
String
BOOKINGTIME
=
"bookingTime"
;
///咨询时间
private
static
final
String
SERVICETYPE
=
"serviceType"
;
//服务方式
private
static
final
String
ORDERID
=
"orderId"
;
//订单号
public
String
title
;
public
String
status
;
public
String
bookingtime
;
public
String
servicetype
;
public
Long
orderid
;
CustomAttachmentConfirmOrder
(
int
type
)
{
super
(
CustomAttachmentType
.
TYPE_CONFIRM_ORDER
);
}
@Override
protected
void
parseData
(
JSONObject
data
)
{
this
.
title
=
data
.
getString
(
TITLE
);
this
.
status
=
data
.
getString
(
STATUS
);
this
.
bookingtime
=
data
.
getString
(
BOOKINGTIME
);
this
.
servicetype
=
data
.
getString
(
SERVICETYPE
);
this
.
orderid
=
data
.
getLong
(
ORDERID
);
}
@Override
protected
JSONObject
packData
()
{
JSONObject
data
=
new
JSONObject
();
data
.
put
(
TITLE
,
title
);
data
.
put
(
STATUS
,
status
);
data
.
put
(
BOOKINGTIME
,
bookingtime
);
data
.
put
(
SERVICETYPE
,
servicetype
);
data
.
put
(
ORDERID
,
orderid
);
return
data
;
}
}
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachmentType.java
View file @
5771fb70
...
...
@@ -40,5 +40,6 @@ public interface CustomAttachmentType {
int
TYPE_SWITCH_KEFU_TIPS
=
40
;
//客服切换第一次提示语
int
TYPE_FILTER_41
=
41
;
//客服切换过滤41
int
TYPE_FILTER_42
=
42
;
//客服切换过滤42
int
TYPE_CONFIRM_ORDER
=
38
;
//确认订单
int
TYPE_ORDER_ALREADY_DONE
=
39
;
//已完成订单
}
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderConfirmOrder.java
0 → 100644
View file @
5771fb70
package
com
.
yidianling
.
im
.
session
.
viewholder
;
import
android.annotation.SuppressLint
;
import
android.text.TextUtils
;
import
android.view.View
;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
androidx.core.content.ContextCompat
;
import
com.netease.nimlib.sdk.msg.attachment.MsgAttachment
;
import
com.ydl.webview.H5Params
;
import
com.ydl.webview.NewH5Activity
;
import
com.yidianling.im.R
;
import
com.yidianling.im.session.extension.CustomAttachConsultSubScript
;
import
com.yidianling.im.session.extension.CustomAttachmentConfirmOrder
;
import
com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter
;
import
com.yidianling.uikit.business.session.viewholder.MsgViewHolderBase
;
public
class
MsgViewHolderConfirmOrder
extends
MsgViewHolderBase
{
private
TextView
tv_title
,
tv_date
,
tv_type
;
private
View
lin_root
;
private
ImageView
img_icon
;
public
String
url
;
//跳转url
public
int
flag
;
//0 未确认 1已确认
public
MsgViewHolderConfirmOrder
(
BaseMultiItemFetchLoadAdapter
adapter
)
{
super
(
adapter
);
}
@Override
protected
int
getContentResId
()
{
return
R
.
layout
.
im_ui_message_custom_confirm_order
;
}
@Override
protected
void
inflateContentView
()
{
tv_title
=
view
.
findViewById
(
R
.
id
.
tv_title
);
tv_date
=
view
.
findViewById
(
R
.
id
.
tv_date
);
tv_type
=
view
.
findViewById
(
R
.
id
.
tv_type
);
lin_root
=
view
.
findViewById
(
R
.
id
.
lin_root
);
img_icon
=
view
.
findViewById
(
R
.
id
.
img_icon
);
if
(
isReceivedMessage
()){
setAvatarRightInVisibity
();
lin_root
.
setBackgroundResource
(
R
.
drawable
.
im_bg_radius_no_topleft_white_8
);
}
else
{
setAvatarLeftInVisibity
();
lin_root
.
setBackgroundResource
(
R
.
drawable
.
im_bg_radius_no_topright_white_8
);
}
}
@SuppressLint
(
"SetTextI18n"
)
@Override
protected
void
bindContentView
()
{
if
(
isReceivedMessage
()){
setAvatarRightInVisibity
();
}
else
{
setAvatarLeftInVisibity
();
}
MsgAttachment
attachment
=
message
.
getAttachment
();
if
(
attachment
instanceof
CustomAttachmentConfirmOrder
)
{
tv_title
.
setText
(((
CustomAttachmentConfirmOrder
)
attachment
).
title
);
tv_date
.
setText
(
"咨询时间:"
+((
CustomAttachmentConfirmOrder
)
attachment
).
bookingtime
);
tv_type
.
setText
(
"服务方式:"
+((
CustomAttachmentConfirmOrder
)
attachment
).
servicetype
);
}
hideItemBg
();
}
@Override
protected
void
onItemClick
()
{
if
(
TextUtils
.
isEmpty
(
url
)){
return
;
}
NewH5Activity
.
start
(
context
,
new
H5Params
(
url
,
null
));
}
}
m-im/src/main/res/layout/im_ui_message_custom_confirm_order.xml
0 → 100644
View file @
5771fb70
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:id=
"@+id/lin_root"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
xmlns:tools=
"http://schemas.android.com/tools"
android:paddingLeft=
"12dp"
android:paddingRight=
"12dp"
android:paddingTop=
"8dp"
android:paddingBottom=
"12dp"
android:background=
"@drawable/im_bg_radius_no_topleft_white_8"
>
<ImageView
android:id=
"@+id/img_icon"
android:layout_width=
"14dp"
android:layout_height=
"14dp"
android:layout_marginRight=
"4dp"
android:layout_alignTop=
"@+id/tv_title"
android:layout_alignBottom=
"@+id/tv_title"
android:src=
"@mipmap/im_consult_data_sure"
android:visibility=
"gone"
tools:visibility=
"gone"
/>
<TextView
android:id=
"@+id/tv_title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"14dp"
android:textColor=
"@color/im_color_242424"
android:layout_toRightOf=
"@+id/img_icon"
tools:text=
"我已完成本次咨询,请确认"
/>
<RelativeLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:paddingLeft=
"12dp"
android:paddingRight=
"12dp"
android:paddingTop=
"8dp"
android:paddingBottom=
"8dp"
android:layout_below=
"@+id/tv_title"
android:layout_marginTop=
"8dp"
android:background=
"@drawable/im_bg_radius_f7_2"
>
<TextView
android:id=
"@+id/tv_package"
android:layout_width=
"24dp"
android:layout_height=
"14dp"
android:text=
"套餐"
android:layout_marginTop=
"3dp"
android:textSize=
"10dp"
android:textColor=
"@color/platform_color_FFFFFF"
android:gravity=
"center"
android:layout_marginRight=
"3dp"
android:visibility=
"gone"
android:background=
"@drawable/im_bg_radius_yellow_1"
/>
<TextView
android:id=
"@+id/tv_date"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textColor=
"@color/platform_color_999999"
android:textSize=
"10dp"
android:layout_marginTop=
"2dp"
android:layout_below=
"@+id/tv_package"
tools:text=
"咨询时间:2019-12-55 12:00:00"
/>
<TextView
android:id=
"@+id/tv_type"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textColor=
"@color/platform_color_999999"
android:textSize=
"10dp"
android:layout_marginTop=
"2dp"
android:layout_below=
"@+id/tv_date"
tools:text=
"服务方式:电话"
/>
</RelativeLayout>
</RelativeLayout>
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