d
This commit is contained in:
@@ -21,7 +21,8 @@ public class CommentActivity extends BaseActivity {
|
||||
mTitleBar = findViewById(R.id.title_bar);
|
||||
initNormalBack();
|
||||
String num = getIntent().getStringExtra("num");
|
||||
String aweme_id = getIntent().getStringExtra("aweme_id");
|
||||
mTitleBar.setTitle("新评论"+"("+num+")");
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.container,new CommentFragment()).commit();
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.container,new CommentFragment(aweme_id)).commit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,19 +2,23 @@ package com.fenghoo.seven.main.find.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.chad.library.adapter.base.BaseViewHolder;
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.main.find.entity.CommentBean;
|
||||
import com.fenghoo.seven.main.kehu.Bean.CustomerListBean;
|
||||
import com.fenghoo.seven.utils.GlideTools;
|
||||
import com.fenghoo.seven.utils.WidgetTools;
|
||||
import com.fenghoo.seven.widget.CircleImageView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class CommentAdapter extends BaseQuickAdapter<CustomerListBean.ResultBean.DataBean, BaseViewHolder> {
|
||||
public class CommentAdapter extends BaseQuickAdapter<CommentBean.ResultBean.DataBean, BaseViewHolder> {
|
||||
Context mcontext;
|
||||
OnViewClickListener onViewClickListener;
|
||||
|
||||
@@ -24,8 +28,12 @@ public class CommentAdapter extends BaseQuickAdapter<CustomerListBean.ResultBean
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(final BaseViewHolder helper, final CustomerListBean.ResultBean.DataBean item) {
|
||||
WidgetTools.setTextfive((TextView) helper.getView(R.id.tv_dea_name), "", item.getName());
|
||||
protected void convert(final BaseViewHolder helper, final CommentBean.ResultBean.DataBean item) {
|
||||
WidgetTools.setTextfive((TextView) helper.getView(R.id.tv_dea_name), "", item.getNick_name());
|
||||
WidgetTools.setTextfive((TextView) helper.getView(R.id.tv_content), "", item.getContent());
|
||||
WidgetTools.setTextfive((TextView) helper.getView(R.id.tv_comment_time), "", item.getComment_time());
|
||||
CircleImageView iv_dea_avatar = helper.getView(R.id.iv_dea_avatar);
|
||||
GlideTools.init(mContext).displaypic(iv_dea_avatar, item.getNick_img(), R.mipmap.icon_default_head);
|
||||
|
||||
TextView tv_cuslist_caozuo = (TextView)helper.getView(R.id.tv_cuslist_caozuo);
|
||||
tv_cuslist_caozuo.setOnClickListener(new View.OnClickListener() {
|
||||
@@ -34,14 +42,6 @@ public class CommentAdapter extends BaseQuickAdapter<CustomerListBean.ResultBean
|
||||
onViewClickListener.reply(item);
|
||||
}
|
||||
});
|
||||
RelativeLayout yichengjhiao_rv = (RelativeLayout)helper.getView(R.id.yichengjhiao_rv);
|
||||
yichengjhiao_rv.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
onViewClickListener.enterCusDetail(item);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void operationListenner(OnViewClickListener onViewClickListener){
|
||||
@@ -54,10 +54,7 @@ public class CommentAdapter extends BaseQuickAdapter<CustomerListBean.ResultBean
|
||||
* 回复
|
||||
* @param item
|
||||
*/
|
||||
void reply(CustomerListBean.ResultBean.DataBean item);
|
||||
|
||||
|
||||
void enterCusDetail(CustomerListBean.ResultBean.DataBean item);
|
||||
void reply(CommentBean.ResultBean.DataBean item);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
package com.fenghoo.seven.main.find.entity;
|
||||
|
||||
import com.fenghoo.seven.test.BaseModel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Time: 2020/8/31
|
||||
* Author: jianbo
|
||||
* Description:
|
||||
*/
|
||||
public class CommentBean extends BaseModel {
|
||||
|
||||
/**
|
||||
* result : {"msg":"成功","data":[{"comment_time":"2020-08-27 18:38:00","if_read":"0","nick_name":"装**","nick_img":"https://p3-dy-ipv6.byteimg.com/aweme/720x720/3175a000b17fe75a7379b.webp?from=2956013662","comment_id":"6865611188630503435","content":"[赞][赞][赞]"}],"success":0}
|
||||
* status : 0
|
||||
*/
|
||||
|
||||
private ResultBean result;
|
||||
private int status;
|
||||
|
||||
public ResultBean getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(ResultBean result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public static class ResultBean {
|
||||
/**
|
||||
* msg : 成功
|
||||
* data : [{"comment_time":"2020-08-27 18:38:00","if_read":"0","nick_name":"装**","nick_img":"https://p3-dy-ipv6.byteimg.com/aweme/720x720/3175a000b17fe75a7379b.webp?from=2956013662","comment_id":"6865611188630503435","content":"[赞][赞][赞]"}]
|
||||
* success : 0
|
||||
*/
|
||||
|
||||
private String msg;
|
||||
private int success;
|
||||
private List<DataBean> data;
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public int getSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(int success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public List<DataBean> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(List<DataBean> data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public static class DataBean {
|
||||
/**
|
||||
* comment_time : 2020-08-27 18:38:00
|
||||
* if_read : 0
|
||||
* nick_name : 装**
|
||||
* nick_img : https://p3-dy-ipv6.byteimg.com/aweme/720x720/3175a000b17fe75a7379b.webp?from=2956013662
|
||||
* comment_id : 6865611188630503435
|
||||
* content : [赞][赞][赞]
|
||||
*/
|
||||
|
||||
private String comment_time;
|
||||
private String if_read;
|
||||
private String nick_name;
|
||||
private String nick_img;
|
||||
private String comment_id;
|
||||
private String content;
|
||||
|
||||
public String getComment_time() {
|
||||
return comment_time;
|
||||
}
|
||||
|
||||
public void setComment_time(String comment_time) {
|
||||
this.comment_time = comment_time;
|
||||
}
|
||||
|
||||
public String getIf_read() {
|
||||
return if_read;
|
||||
}
|
||||
|
||||
public void setIf_read(String if_read) {
|
||||
this.if_read = if_read;
|
||||
}
|
||||
|
||||
public String getNick_name() {
|
||||
return nick_name;
|
||||
}
|
||||
|
||||
public void setNick_name(String nick_name) {
|
||||
this.nick_name = nick_name;
|
||||
}
|
||||
|
||||
public String getNick_img() {
|
||||
return nick_img;
|
||||
}
|
||||
|
||||
public void setNick_img(String nick_img) {
|
||||
this.nick_img = nick_img;
|
||||
}
|
||||
|
||||
public String getComment_id() {
|
||||
return comment_id;
|
||||
}
|
||||
|
||||
public void setComment_id(String comment_id) {
|
||||
this.comment_id = comment_id;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,17 @@
|
||||
package com.fenghoo.seven.main.find.ui;
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||
import com.fenghoo.seven.JsonUtils;
|
||||
import com.fenghoo.seven.R;
|
||||
import com.fenghoo.seven.base.BaseBean;
|
||||
import com.fenghoo.seven.main.find.adapter.CommentAdapter;
|
||||
import com.fenghoo.seven.main.kehu.Bean.CustomerListBean;
|
||||
import com.fenghoo.seven.main.find.entity.CommentBean;
|
||||
import com.fenghoo.seven.main.kehu.Dialog.RreplyDialog;
|
||||
import com.fenghoo.seven.main.kehu.fragment.MobanFragment;
|
||||
import com.fenghoo.seven.main.kehu.activity.ShowAty;
|
||||
import com.fenghoo.seven.okgonet.HttpConstants;
|
||||
import com.fenghoo.seven.okgonet.NetApi;
|
||||
import com.fenghoo.seven.okgonet.Observer;
|
||||
import com.fenghoo.seven.utils.ToastUtils;
|
||||
import com.fenghoo.seven.utils.checkVersionsUtils.ProfileSpUtils;
|
||||
import com.lzy.okgo.model.HttpParams;
|
||||
import com.lzy.okgo.model.Response;
|
||||
@@ -20,35 +22,61 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
|
||||
public class CommentFragment extends MobanFragment {
|
||||
String aweme_id;
|
||||
|
||||
|
||||
public CommentFragment() {
|
||||
public CommentFragment( String aweme_id) {
|
||||
super();
|
||||
this.aweme_id=aweme_id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initAdapter() {
|
||||
mMarkingFragmentRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
CommentAdapter markingtwoAdapter = new CommentAdapter(mContext, null);
|
||||
markingtwoAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
|
||||
@Override
|
||||
public void onLoadMoreRequested() {
|
||||
loadMore();
|
||||
}
|
||||
});
|
||||
getAdpter(markingtwoAdapter);
|
||||
mMarkingFragmentRecyclerView.setAdapter(markingtwoAdapter);
|
||||
markingtwoAdapter.operationListenner(new CommentAdapter.OnViewClickListener() {
|
||||
@Override
|
||||
public void reply(CustomerListBean.ResultBean.DataBean item) {
|
||||
public void reply(final CommentBean.ResultBean.DataBean item) {
|
||||
new RreplyDialog(getActivity(), R.style.dialog, new RreplyDialog.OnCloseListener() {
|
||||
//回复
|
||||
@Override
|
||||
public void uploadAvatar() {
|
||||
|
||||
public void reply(String content) {
|
||||
replyComment(item.getComment_id(),content);
|
||||
}
|
||||
|
||||
}).show();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
private void replyComment(String comment_id,String content){
|
||||
final HttpParams paramsPost = new HttpParams();
|
||||
paramsPost.put("uid", ProfileSpUtils.getInstance().getUserProfie().getData().getUuid());
|
||||
paramsPost.put("comment_id", comment_id);
|
||||
paramsPost.put("content", content);
|
||||
new NetApi().getPostData(paramsPost, HttpConstants.URi_device_AppDouyin_replyComment).subscribe(new Observer<Response>() {
|
||||
@Override
|
||||
public void enterCusDetail(CustomerListBean.ResultBean.DataBean item) {
|
||||
//进入查看评论
|
||||
ShowAty.CustomerDetailActivity(getActivity(),item);
|
||||
public void onNext(Response response) {
|
||||
String body = (String) response.body();
|
||||
BaseBean.ResultBean result = JsonUtils.fromJson(body, BaseBean.class).getResult();
|
||||
if(result.getSuccess()==0){
|
||||
IS_LOADED=false;
|
||||
sendMessage();
|
||||
}else {
|
||||
ToastUtils.showToast(getActivity(),result.getMsg());
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onError(Exception e) {
|
||||
e.printStackTrace();
|
||||
markingtwoAdapter.setEmptyView(errorView);
|
||||
mSwl.setRefreshing(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -57,21 +85,21 @@ public class CommentFragment extends MobanFragment {
|
||||
public void requestData() {
|
||||
final HttpParams paramsPost = new HttpParams();
|
||||
paramsPost.put("uid", ProfileSpUtils.getInstance().getUserProfie().getData().getUuid());
|
||||
paramsPost.put("search", "");
|
||||
new NetApi().getPostData(paramsPost, HttpConstants.URi_device_AppCustomer_fpList).subscribe(new Observer<Response>() {
|
||||
paramsPost.put("aweme_id", aweme_id);
|
||||
paramsPost.put("page", mNextRequestPage);
|
||||
new NetApi().getPostData(paramsPost, HttpConstants.URi_device_AppDouyin_comment).subscribe(new Observer<Response>() {
|
||||
@Override
|
||||
public void onNext(Response response) {
|
||||
String body = (String) response.body();
|
||||
CustomerListBean.ResultBean result = JsonUtils.fromJson(body, CustomerListBean.class).getResult();
|
||||
CommentBean.ResultBean result = JsonUtils.fromJson(body, CommentBean.class).getResult();
|
||||
mSwl.setRefreshing(false);
|
||||
if (result != null && String.valueOf(result.getSuccess()).equals("0")) {
|
||||
|
||||
List<CustomerListBean.ResultBean.DataBean> data = result.getData();
|
||||
List<CommentBean.ResultBean.DataBean> data = result.getData();
|
||||
if (mNextRequestPage == 1) {
|
||||
if (data.size() == 0) {
|
||||
markingtwoAdapter.setEmptyView(notDataView);
|
||||
return;
|
||||
}
|
||||
if (mNextRequestPage == 1) {
|
||||
setData(true, data);
|
||||
} else {
|
||||
setData(false, data);
|
||||
|
||||
@@ -48,7 +48,7 @@ public class PrivateletterFragment extends MobanFragment {
|
||||
@Override
|
||||
public void enterCusDetail(awemeBean.ResultBean.DataBean item) {
|
||||
//进入查看评论
|
||||
ShowAty.CommentActivity(getActivity(),20);
|
||||
ShowAty.CommentActivity(getActivity(),item.getComment_num(),item.getAweme_id());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
@@ -43,6 +44,7 @@ public class RreplyDialog extends Dialog implements View.OnClickListener {
|
||||
private EditText reply_etSearchh;
|
||||
private RecyclerView reply_rcey;
|
||||
private boolean flag=false;
|
||||
private Button btn_send;
|
||||
|
||||
public RreplyDialog(Context context) {
|
||||
super(context);
|
||||
@@ -74,6 +76,8 @@ public class RreplyDialog extends Dialog implements View.OnClickListener {
|
||||
private void initView() {
|
||||
rl_tv_uploadAvatar = (RelativeLayout) findViewById(R.id.rl_tv_uploadAvatar);
|
||||
rl_tv_uploadAvatar.setOnClickListener(this);
|
||||
btn_send = (Button) findViewById(R.id.btn_send);
|
||||
btn_send.setOnClickListener(this);
|
||||
reply_ima = (ImageView) findViewById(R.id.reply_ima);
|
||||
reply_ima.setOnClickListener(this);
|
||||
reply_etSearchh = (EditText) findViewById(R.id.reply_etSearchh);
|
||||
@@ -129,9 +133,9 @@ public class RreplyDialog extends Dialog implements View.OnClickListener {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
switch (view.getId()) {
|
||||
case R.id.rl_tv_uploadAvatar://上传头像
|
||||
case R.id.btn_send://上传头像
|
||||
if (listener != null) {
|
||||
listener.uploadAvatar();
|
||||
listener.reply(reply_etSearchh.getText().toString());
|
||||
}
|
||||
dismiss();
|
||||
break;
|
||||
@@ -151,7 +155,12 @@ public class RreplyDialog extends Dialog implements View.OnClickListener {
|
||||
|
||||
public interface OnCloseListener {
|
||||
|
||||
void uploadAvatar();
|
||||
/**
|
||||
* @description 回复消息
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
void reply(String content);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public class FpOrderInfoActivitytwo extends MoActivity {
|
||||
new RreplyDialog(FpOrderInfoActivitytwo.this, R.style.dialog, new RreplyDialog.OnCloseListener() {
|
||||
//回复
|
||||
@Override
|
||||
public void uploadAvatar() {
|
||||
public void reply(String content) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -61,9 +61,10 @@ public class ShowAty {
|
||||
i.putExtra("customer_id",item.getCustomer_id());
|
||||
ctx.startActivity(i);
|
||||
}
|
||||
public static void CommentActivity(Context ctx,int num) {
|
||||
public static void CommentActivity(Context ctx,String num,String aweme_id) {
|
||||
Intent i = new Intent(ctx, CommentActivity.class);
|
||||
i.putExtra("num",num+"");
|
||||
i.putExtra("num",num);
|
||||
i.putExtra("aweme_id",aweme_id);
|
||||
ctx.startActivity(i);
|
||||
}
|
||||
|
||||
|
||||
@@ -94,6 +94,15 @@ public class HttpConstants {
|
||||
*/
|
||||
public static String URi_device_AppDouyin_commonWords = URiBase + "/device/AppDouyin/commonWords";
|
||||
|
||||
/**
|
||||
* 评论
|
||||
*/
|
||||
public static String URi_device_AppDouyin_comment = URiBase + "/device/AppDouyin/comment";
|
||||
|
||||
/**
|
||||
* 回复评论
|
||||
*/
|
||||
public static String URi_device_AppDouyin_replyComment = URiBase + "/device/AppDouyin/replyComment";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="33dp"
|
||||
android:text="此处显示视频标题/此处显示视频标题/此处显示视
|
||||
@@ -49,6 +50,7 @@
|
||||
android:layout_toRightOf="@+id/iv_dea_avatar"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/tv_comment_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="15dp"
|
||||
android:text="2020-07-01 "
|
||||
|
||||
@@ -26,14 +26,14 @@
|
||||
/>
|
||||
<RelativeLayout
|
||||
android:id="@+id/flSearch"
|
||||
android:layout_width="300dp"
|
||||
android:layout_width="260dp"
|
||||
android:layout_height="39dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:background="@drawable/shape_reply"
|
||||
android:paddingLeft="@dimen/spacing_10">
|
||||
<EditText
|
||||
android:id="@+id/reply_etSearchh"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="260dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_centerVertical="true"
|
||||
@@ -48,6 +48,16 @@
|
||||
android:singleLine="true"
|
||||
android:text="" />
|
||||
</RelativeLayout>
|
||||
<Button
|
||||
android:id="@+id/btn_send"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_toRightOf="@+id/flSearch"
|
||||
android:background="@drawable/selector_btn_green_bg"
|
||||
android:text="发 送"
|
||||
android:textColor="@color/colorWhile"
|
||||
android:textSize="13sp"/>
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user