Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
android
/
dayu
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
718af5b9
authored
Dec 20, 2023
by
wukun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1220
parent
dbc16daf
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
169 additions
and
8 deletions
orderCenter/src/main/java/com/dayu/order/api/OrderApiFactory.java
orderCenter/src/main/java/com/dayu/order/api/OrderService.java
orderCenter/src/main/java/com/dayu/order/ui/fragment/MultiOrderDetailFragment.java
orderCenter/src/main/res/layout/fragment_multi_detail.xml
orderCenter/src/main/res/layout/fragment_operate_detail.xml
orderCenter/src/main/java/com/dayu/order/api/OrderApiFactory.java
View file @
718af5b9
...
@@ -198,6 +198,10 @@ public class OrderApiFactory {
...
@@ -198,6 +198,10 @@ public class OrderApiFactory {
return
Api
.
getService
(
OrderService
.
class
).
getComment
(
targetId
,
page
,
pageSize
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
OrderService
.
class
).
getComment
(
targetId
,
page
,
pageSize
).
compose
(
Api
.
applySchedulers
());
}
}
public
static
Observable
<
BasePageBean
<
CommentBean
>>
getCommentOrder
(
int
targetId
,
int
status
,
int
targetType
,
int
accountType
,
int
page
,
int
pageSize
)
{
return
Api
.
getService
(
OrderService
.
class
).
getCommentOrder
(
targetId
,
page
,
pageSize
).
compose
(
Api
.
applySchedulers
());
}
public
static
Observable
<
Boolean
>
addComment
(
CommentPostData
data
)
{
public
static
Observable
<
Boolean
>
addComment
(
CommentPostData
data
)
{
return
Api
.
getService
(
OrderService
.
class
).
addComment
(
data
).
compose
(
Api
.
applySchedulers
());
return
Api
.
getService
(
OrderService
.
class
).
addComment
(
data
).
compose
(
Api
.
applySchedulers
());
}
}
...
...
orderCenter/src/main/java/com/dayu/order/api/OrderService.java
View file @
718af5b9
...
@@ -453,15 +453,24 @@ public interface OrderService {
...
@@ -453,15 +453,24 @@ public interface OrderService {
@Query
(
"pageSize"
)
int
pageSize
);
@Query
(
"pageSize"
)
int
pageSize
);
/**
/**
* 获取留言
*
* @return
*/
@GET
(
Constants
.
API_7400
+
"/leaveMessage/order/engineer/orderId/{orderId}"
)
Observable
<
BaseResponse
<
BasePageBean
<
CommentBean
>>>
getCommentOrder
(
@Path
(
"orderId"
)
int
orderId
,
@Query
(
"page"
)
int
page
,
@Query
(
"pageSize"
)
int
pageSize
);
/**
* 留言
* 留言
*/
*/
@POST
(
Constants
.
API_7400
+
"/leaveMessage/
spu
/engineer"
)
@POST
(
Constants
.
API_7400
+
"/leaveMessage/
order
/engineer"
)
Observable
<
BaseResponse
<
Boolean
>>
addComment
(
@Body
CommentPostData
data
);
Observable
<
BaseResponse
<
Boolean
>>
addComment
(
@Body
CommentPostData
data
);
/**
/**
* 回复
* 回复
*/
*/
@POST
(
Constants
.
API_7400
+
"/leaveMessage/
spu
/engineer"
)
@POST
(
Constants
.
API_7400
+
"/leaveMessage/
order
/engineer"
)
Observable
<
BaseResponse
<
Boolean
>>
addCommentReply
(
@Body
CommentReplyData
data
);
Observable
<
BaseResponse
<
Boolean
>>
addCommentReply
(
@Body
CommentReplyData
data
);
/**
/**
...
...
orderCenter/src/main/java/com/dayu/order/ui/fragment/MultiOrderDetailFragment.java
View file @
718af5b9
...
@@ -15,7 +15,11 @@ import com.chad.library.adapter.base.BaseQuickAdapter;
...
@@ -15,7 +15,11 @@ import com.chad.library.adapter.base.BaseQuickAdapter;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
com.dayu.base.api.APIService
;
import
com.dayu.base.api.APIService
;
import
com.dayu.base.api.Api
;
import
com.dayu.base.api.Api
;
import
com.dayu.base.api.protocol.CommentBean
;
import
com.dayu.base.api.protocol.CommentPostData
;
import
com.dayu.base.api.protocol.CommentReplyData
;
import
com.dayu.base.ui.activity.ImgGalleryActivty
;
import
com.dayu.base.ui.activity.ImgGalleryActivty
;
import
com.dayu.base.ui.adapter.CommentAdapter
;
import
com.dayu.base.ui.adapter.CoreAdapter
;
import
com.dayu.base.ui.adapter.CoreAdapter
;
import
com.dayu.base.ui.fragment.BaseFragment
;
import
com.dayu.base.ui.fragment.BaseFragment
;
import
com.dayu.base.ui.presenter.SImplePresenter
;
import
com.dayu.base.ui.presenter.SImplePresenter
;
...
@@ -25,6 +29,7 @@ import com.dayu.location.base.LocationUtils;
...
@@ -25,6 +29,7 @@ import com.dayu.location.base.LocationUtils;
import
com.dayu.order.R
;
import
com.dayu.order.R
;
import
com.dayu.order.api.OrderApiFactory
;
import
com.dayu.order.api.OrderApiFactory
;
import
com.dayu.order.api.OrderService
;
import
com.dayu.order.api.OrderService
;
import
com.dayu.order.api.protocol.OperateInfo
;
import
com.dayu.order.api.protocol.OrderDetail
;
import
com.dayu.order.api.protocol.OrderDetail
;
import
com.dayu.order.api.protocol.Spu
;
import
com.dayu.order.api.protocol.Spu
;
import
com.dayu.order.api.protocol.bean.GreenPersionSiteInfo
;
import
com.dayu.order.api.protocol.bean.GreenPersionSiteInfo
;
...
@@ -41,6 +46,7 @@ import com.dayu.provider.event.TakeOrderSuccessEvent;
...
@@ -41,6 +46,7 @@ import com.dayu.provider.event.TakeOrderSuccessEvent;
import
com.dayu.provider.router.RouterPath
;
import
com.dayu.provider.router.RouterPath
;
import
com.dayu.utils.CommonUtils
;
import
com.dayu.utils.CommonUtils
;
import
com.dayu.utils.GlideImageLoader
;
import
com.dayu.utils.GlideImageLoader
;
import
com.dayu.utils.ProgressUtil
;
import
com.dayu.utils.ToastUtils
;
import
com.dayu.utils.ToastUtils
;
import
com.dayu.utils.UIUtils
;
import
com.dayu.utils.UIUtils
;
import
com.dayu.utils.UserManager
;
import
com.dayu.utils.UserManager
;
...
@@ -70,6 +76,12 @@ public class MultiOrderDetailFragment extends BaseFragment<SImplePresenter, Frag
...
@@ -70,6 +76,12 @@ public class MultiOrderDetailFragment extends BaseFragment<SImplePresenter, Frag
List
<
String
>
phones
=
new
ArrayList
<>();
List
<
String
>
phones
=
new
ArrayList
<>();
private
ArrayList
<
String
>
phoneNum
;
private
ArrayList
<
String
>
phoneNum
;
private
List
<
CommentBean
>
commentList
=
new
ArrayList
<>();
private
int
page
=
1
;
private
int
pageSize
=
200
;
private
CommentAdapter
mCommentAdapter
;
private
CommentBean
selectedItem
;
public
static
MultiOrderDetailFragment
newInstance
(
OrderDetail
detail
,
List
<
String
>
info
)
{
public
static
MultiOrderDetailFragment
newInstance
(
OrderDetail
detail
,
List
<
String
>
info
)
{
Bundle
args
=
new
Bundle
();
Bundle
args
=
new
Bundle
();
args
.
putSerializable
(
Constants
.
ORDER_DETAIL
,
detail
);
args
.
putSerializable
(
Constants
.
ORDER_DETAIL
,
detail
);
...
@@ -90,6 +102,7 @@ public class MultiOrderDetailFragment extends BaseFragment<SImplePresenter, Frag
...
@@ -90,6 +102,7 @@ public class MultiOrderDetailFragment extends BaseFragment<SImplePresenter, Frag
EventBus
.
getDefault
().
register
(
this
);
EventBus
.
getDefault
().
register
(
this
);
OrderDetail
detail
=
(
OrderDetail
)
getArguments
().
getSerializable
(
Constants
.
ORDER_DETAIL
);
OrderDetail
detail
=
(
OrderDetail
)
getArguments
().
getSerializable
(
Constants
.
ORDER_DETAIL
);
phoneNum
=
getArguments
().
getStringArrayList
(
Constants
.
OPERATE_DETAIL_PHONE
);
phoneNum
=
getArguments
().
getStringArrayList
(
Constants
.
OPERATE_DETAIL_PHONE
);
orderId
=
detail
.
getId
();
orderId
=
detail
.
getId
();
setListenter
();
setListenter
();
mBind
.
setItem
(
detail
);
mBind
.
setItem
(
detail
);
...
@@ -231,6 +244,87 @@ public class MultiOrderDetailFragment extends BaseFragment<SImplePresenter, Frag
...
@@ -231,6 +244,87 @@ public class MultiOrderDetailFragment extends BaseFragment<SImplePresenter, Frag
if
(!
TextUtils
.
isEmpty
(
detail
.
getTeamName
()))
{
if
(!
TextUtils
.
isEmpty
(
detail
.
getTeamName
()))
{
mBind
.
teamName
.
setText
(
"("
+
detail
.
getTeamName
()
+
"转派)"
);
mBind
.
teamName
.
setText
(
"("
+
detail
.
getTeamName
()
+
"转派)"
);
}
}
getCommentData
();
mCommentAdapter
=
new
CommentAdapter
(
false
);
mCommentAdapter
.
setData
(
commentList
);
mBind
.
rlComponent
.
setLayoutManager
(
new
LinearLayoutManager
(
mActivity
));
mBind
.
rlComponent
.
setAdapter
(
mCommentAdapter
);
//发送
mBind
.
btnSend
.
setOnClickListener
(
v
->
{
String
content
=
mBind
.
edtComment
.
getText
().
toString
();
if
(
TextUtils
.
isEmpty
(
content
))
return
;
ProgressUtil
.
startLoad
(
mActivity
);
if
(
selectedItem
!=
null
)
{
CommentReplyData
commentReplyData
=
new
CommentReplyData
(
mUserId
,
content
,
orderId
,
""
);
commentReplyData
.
beMessageId
=
selectedItem
.
getId
();
OrderApiFactory
.
addCommentReply
(
commentReplyData
).
subscribe
(
mPresenter
.
baseObserver
(
result
->
{
if
(
result
)
{
selectedItem
=
null
;
sendCommendSuccess
();
}
}));
}
else
{
CommentPostData
commentData
=
new
CommentPostData
(
mUserId
,
content
,
orderId
,
""
);
OrderApiFactory
.
addComment
(
commentData
).
subscribe
(
mPresenter
.
baseObserver
(
result
->
{
if
(
result
)
sendCommendSuccess
();
}));
}
CommonUtils
.
hideSoftInput
(
mActivity
,
mBind
.
edtComment
);
});
// mBind.btnComment.setOnClickListener(v -> {
// selectedItem = null;
// mBind.edtComment.setText("");
// mBind.edtComment.requestFocus();
// CommonUtils.ShowSoftInput(mActivity, mBind.edtComment);
// });
mCommentAdapter
.
setOnItemClickListener
((
item
,
bind
)
->
{
selectedItem
=
item
;
mBind
.
edtComment
.
setText
(
""
);
mBind
.
edtComment
.
requestFocus
();
CommonUtils
.
ShowSoftInput
(
mActivity
,
mBind
.
edtComment
);
});
}
private
void
sendCommendSuccess
()
{
page
=
1
;
mBind
.
edtComment
.
setText
(
""
);
getCommentData
();
}
private
void
getCommentData
()
{
ProgressUtil
.
startLoad
(
mActivity
);
OrderApiFactory
.
getCommentOrder
(
orderId
,
1
,
3
,
1
,
page
,
pageSize
)
.
subscribe
(
mPresenter
.
baseObserver
(
data
->
{
// mBind.refreshLayout.finishRefresh();
// mBind.refreshLayout.finishLoadMore();
if
(
page
==
1
)
{
commentList
.
clear
();
// mBind.refreshLayout.setEnableLoadMore(data.getData().size() > 0);
}
// commentList = transData(data.getData());
commentList
.
addAll
(
data
.
getData
());
mBind
.
tvComponent
.
setText
(
"留言. "
+
data
.
getTotalRows
());
mCommentAdapter
.
setData
(
commentList
);
// mBind.refreshLayout.setEnableLoadMore(page < data.getTotalPages());
page
+=
1
;
},
responeThrowable
->
{
// mBind.refreshLayout.finishRefresh();
// mBind.refreshLayout.finishLoadMore();
}));
OrderApiFactory
.
getCommentOrder
(
orderId
,
1
,
3
,
1
,
page
,
pageSize
)
.
subscribe
(
mPresenter
.
baseObserver
(
data
->
{
},
responeThrowable
->
{
}));
}
}
//小绿人相关信息
//小绿人相关信息
...
...
orderCenter/src/main/res/layout/fragment_multi_detail.xml
View file @
718af5b9
...
@@ -824,6 +824,63 @@
...
@@ -824,6 +824,63 @@
android:background=
"@color/white"
/>
android:background=
"@color/white"
/>
<TextView
<TextView
android:id=
"@+id/tv_component"
android:layout_width=
"match_parent"
android:layout_height=
"43dp"
android:background=
"@color/color_ee"
android:gravity=
"center_vertical"
android:paddingLeft=
"15dp"
android:text=
"沟通记录"
android:textColor=
"@color/cl_home_title_text_color"
android:textSize=
"14sp"
android:textStyle=
"bold"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:layout_margin=
"10dp"
android:background=
"@color/cl_white"
android:orientation=
"horizontal"
>
<ImageView
android:id=
"@+id/iv_avatar"
android:layout_width=
"35dp"
android:layout_height=
"35dp"
android:layout_marginRight=
"10dp"
/>
<EditText
android:id=
"@+id/edt_comment"
android:layout_width=
"0dp"
android:layout_height=
"35dp"
android:layout_weight=
"1"
android:background=
"#f5f5f5"
android:hint=
"@string/ask_detail"
android:padding=
"5dp"
android:paddingLeft=
"5dp"
android:singleLine=
"true"
android:textSize=
"13sp"
/>
<Button
android:id=
"@+id/btn_send"
android:layout_width=
"80dp"
android:layout_height=
"35dp"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:layout_gravity=
"center_vertical"
android:background=
"@color/cl_home_button"
android:gravity=
"center"
android:text=
"@string/send_str"
android:textColor=
"@color/cl_white"
android:textSize=
"13sp"
/>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rl_component"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<TextView
android:id=
"@+id/tv_contact_seller"
android:id=
"@+id/tv_contact_seller"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"35dp"
android:layout_height=
"35dp"
...
...
orderCenter/src/main/res/layout/fragment_operate_detail.xml
View file @
718af5b9
...
@@ -128,8 +128,7 @@
...
@@ -128,8 +128,7 @@
android:text=
"留言"
android:text=
"留言"
android:textColor=
"@color/cl_home_title_text_color"
android:textColor=
"@color/cl_home_title_text_color"
android:textSize=
"14sp"
android:textSize=
"14sp"
android:textStyle=
"bold"
android:textStyle=
"bold"
/>
android:visibility=
"gone"
/>
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
...
@@ -137,8 +136,7 @@
...
@@ -137,8 +136,7 @@
android:layout_alignParentBottom=
"true"
android:layout_alignParentBottom=
"true"
android:layout_margin=
"10dp"
android:layout_margin=
"10dp"
android:background=
"@color/cl_white"
android:background=
"@color/cl_white"
android:orientation=
"horizontal"
android:orientation=
"horizontal"
>
android:visibility=
"gone"
>
<ImageView
<ImageView
android:id=
"@+id/iv_avatar"
android:id=
"@+id/iv_avatar"
...
@@ -175,8 +173,7 @@
...
@@ -175,8 +173,7 @@
<androidx.recyclerview.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rl_component"
android:id=
"@+id/rl_component"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
/>
android:visibility=
"gone"
/>
</LinearLayout>
</LinearLayout>
...
...
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