From 98343a21776c9449dec74dbd5c0bb80f0f551dcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E7=9A=AE?= <14840170+lao-pi123@user.noreply.gitee.com> Date: Sat, 28 Sep 2024 18:29:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BE=E6=8A=A5=E9=80=9A=E7=9F=A5=E5=BC=80?= =?UTF-8?q?=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunbao/common/bean/ReportInfoBean.java | 37 ++++++++++ .../yunbao/common/http/LiveHttpConsts.java | 2 + .../com/yunbao/common/http/LiveHttpUtil.java | 30 ++++++++ .../com/yunbao/common/utils/RouteUtil.java | 7 ++ .../live/activity/ReportSecondActivity.java | 69 ++++++++++--------- .../live/adapter/SystemMessageNewAdapter.java | 31 ++++++--- .../yunbao/live/bean/SystemMessageBean.java | 27 ++++++++ .../res/layout/activity_report_second.xml | 4 +- live/src/main/res/values-zh/strings.xml | 3 + live/src/main/res/values/strings.xml | 3 + 10 files changed, 172 insertions(+), 41 deletions(-) create mode 100644 common/src/main/java/com/yunbao/common/bean/ReportInfoBean.java diff --git a/common/src/main/java/com/yunbao/common/bean/ReportInfoBean.java b/common/src/main/java/com/yunbao/common/bean/ReportInfoBean.java new file mode 100644 index 000000000..b43e93ca9 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/ReportInfoBean.java @@ -0,0 +1,37 @@ +package com.yunbao.common.bean; + +public class ReportInfoBean { + /* { + "touid": 99455, + "user_nicename": "小盒主播2", + "avatar": "https://downs.yaoulive.com/20240516102555_cf329486d39121125b182a779bbc3278?imageView2/2/w/600/h/600" + }*/ + + private String touid; + private String user_nicename; + private String avatar; + + public String getTouid() { + return touid; + } + + public void setTouid(String touid) { + this.touid = touid; + } + + public String getUser_nicename() { + return user_nicename; + } + + public void setUser_nicename(String user_nicename) { + this.user_nicename = user_nicename; + } + + public String getAvatar() { + return avatar; + } + + public void setAvatar(String avatar) { + this.avatar = avatar; + } +} diff --git a/common/src/main/java/com/yunbao/common/http/LiveHttpConsts.java b/common/src/main/java/com/yunbao/common/http/LiveHttpConsts.java index 920661a17..d619892cf 100644 --- a/common/src/main/java/com/yunbao/common/http/LiveHttpConsts.java +++ b/common/src/main/java/com/yunbao/common/http/LiveHttpConsts.java @@ -68,5 +68,7 @@ public class LiveHttpConsts { public static final String ISHOTCARD = "isHotCard"; public static final String USEHOTCARDUSERLIST = "useHotCardUserList"; public static final String SETINSTRUCTORREMARK = "getInstructorRemark"; + public static final String SETREPORTREPLENISHMENT = "setReportReplenishment"; + public static final String GETREPORTINFO = "getReportInfo"; } diff --git a/common/src/main/java/com/yunbao/common/http/LiveHttpUtil.java b/common/src/main/java/com/yunbao/common/http/LiveHttpUtil.java index 9a37aac84..1dbb4c10c 100644 --- a/common/src/main/java/com/yunbao/common/http/LiveHttpUtil.java +++ b/common/src/main/java/com/yunbao/common/http/LiveHttpUtil.java @@ -264,6 +264,36 @@ public class LiveHttpUtil { request.execute(callback); } + + /** + * 举报用户 + 图片 二次补充证据 + */ + public static void setReportToSecondReport(int report_id, String content, File file1, File file2, File file3, HttpCallback callback) { + PostRequest request = HttpClient.getInstance().post("Live.setReportReplenishment", LiveHttpConsts.SETREPORTREPLENISHMENT) + .isMultipart(true) + .params("report_id", report_id) + .params("content", content); + if (file1 != null) { + request.params("file1", file1); + } + if (file2 != null) { + request.params("file2", file2); + } + if (file3 != null) { + request.params("file3", file3); + } + request.execute(callback); + } + + /** + * 获取被举报人的名字 + */ + public static void getReportName(int report_id, HttpCallback callback) { + HttpClient.getInstance().get("Live.getReportInfo", LiveHttpConsts.GETREPORTINFO) + .params("report_id", report_id) + .execute(callback); + } + /** * 直播间点击聊天列表和头像出现的弹窗 */ diff --git a/common/src/main/java/com/yunbao/common/utils/RouteUtil.java b/common/src/main/java/com/yunbao/common/utils/RouteUtil.java index 424935060..3c0e277a5 100644 --- a/common/src/main/java/com/yunbao/common/utils/RouteUtil.java +++ b/common/src/main/java/com/yunbao/common/utils/RouteUtil.java @@ -57,6 +57,7 @@ public class RouteUtil { public static final String PATH_FEEDBACK_ACTIVITY = "/main/FeedbackActivity"; public static final String PATH_FEEDBACK_EDIT_ACTIVITY = "/main/FeedbackEditActivity"; public static final String PATH_LIVE_PUNISHACTIVITY = "/live/PunishActivity"; + public static final String PATH_LIVE_REPORT_SECOND = "/live/ReportSecondActivity"; public static void forwardCommunityActivity() { @@ -178,6 +179,12 @@ public class RouteUtil { .navigation(); } + public static void forwardLiveSecondReportActivity(int users_report_id) { + ARouter.getInstance().build(PATH_LIVE_REPORT_SECOND) + .withInt("users_report_id", users_report_id) + .navigation(); + } + /** * 跳转到装扮 diff --git a/live/src/main/java/com/yunbao/live/activity/ReportSecondActivity.java b/live/src/main/java/com/yunbao/live/activity/ReportSecondActivity.java index c43e8a3b9..6b6051880 100644 --- a/live/src/main/java/com/yunbao/live/activity/ReportSecondActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/ReportSecondActivity.java @@ -12,17 +12,26 @@ import android.widget.EditText; import android.widget.ImageView; import android.widget.TextView; +import com.alibaba.android.arouter.facade.annotation.Route; +import com.alibaba.fastjson.JSON; import com.yunbao.common.BuildConfig; import com.yunbao.common.activity.AbsActivity; +import com.yunbao.common.bean.ReportInfoBean; import com.yunbao.common.glide.ImgLoader; +import com.yunbao.common.http.HttpCallback; +import com.yunbao.common.http.LiveHttpUtil; import com.yunbao.common.interfaces.ImageResultCallback; import com.yunbao.common.utils.ProcessImageUtil; +import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.ToastUtil; import com.yunbao.live.R; +import com.yunbao.live.bean.LiveReportBean; import java.io.File; +import java.util.Arrays; +import java.util.List; import java.util.Locale; - +@Route(path = RouteUtil.PATH_LIVE_REPORT_SECOND) public class ReportSecondActivity extends AbsActivity implements View.OnClickListener { private TextView info_textView; private EditText edit; @@ -33,6 +42,7 @@ public class ReportSecondActivity extends AbsActivity implements View.OnClickLis private File mFile1, mFile2, mFile3; private int uploadImageCount; private String inputText; + private int users_report_id; @Override @@ -63,6 +73,7 @@ public class ReportSecondActivity extends AbsActivity implements View.OnClickLis image_3 .setOnClickListener(this); cancel_1.setOnClickListener(this); cancel_2.setOnClickListener(this); + cancel_3.setOnClickListener(this); edit.addTextChangedListener(new TextWatcher() { @@ -82,6 +93,20 @@ public class ReportSecondActivity extends AbsActivity implements View.OnClickLis setButtonStatus(); } }); + + users_report_id = getIntent().getIntExtra("users_report_id",0); + + LiveHttpUtil.getReportName(users_report_id, new HttpCallback() { + @Override + public void onSuccess(int code, String msg, String[] info) { + if (code == 0) { + List list = JSON.parseArray(Arrays.toString(info), ReportInfoBean.class); + if (list != null && !list.isEmpty()) { + setInfoText(list.get(0).getUser_nicename()); + } + } + } + }); } private void setButtonStatus(){ @@ -122,7 +147,7 @@ If you have any supplementary information or proof, you can click to enter the d SpannableString spannableString = new SpannableString(stringBuilder.toString()); - spannableString.setSpan(new ForegroundColorSpan(Color.parseColor("#FF870F")), startIndex, endIndex, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + spannableString.setSpan(new ForegroundColorSpan(Color.parseColor("#FF870F")), startIndex-1, endIndex+1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); info_textView.setText(spannableString); } @@ -172,41 +197,23 @@ If you have any supplementary information or proof, you can click to enter the d } private void reportSecond() { - /* - * - * if (mIntoIndex == 0) { - LiveHttpUtil.setReport(mToUid, bean.getName(),text, file1, file2, file3, mVideoId, new HttpCallback() { - @Override - public void onSuccess(int code, String msg, String[] info) { - if (code == 0) { - ToastUtil.show(mContext.getString(R.string.video_report_tip_4)); - onBackPressed(); - } else { - ToastUtil.show(msg); - } + LiveHttpUtil.setReportToSecondReport(users_report_id, inputText, mFile1, mFile2, mFile3, new HttpCallback() { + @Override + public void onSuccess(int code, String msg, String[] info) { + if (code == 0) { + ToastUtil.show(mContext.getString(R.string.report_second_7)); + finish(); + } else { + ToastUtil.show(msg); } - }); - } else { - CommonHttpUtil.setCommunityReport(community_type, comment_id, mToUid, text, file1, file2, file3, bean.getId(), new HttpCallback() { - @Override - public void onSuccess(int code, String msg, String[] info) { - if (code == 0) { - ToastUtil.show(mContext.getString(R.string.video_report_tip_4)); - onBackPressed(); - } else { - ToastUtil.show(msg); - } - } - }); - } - * */ - finish(); + } + }); } private void imageUtilInit() { - mImageUtil = new ProcessImageUtil((LiveReportActivity)mContext); + mImageUtil = new ProcessImageUtil((ReportSecondActivity)mContext); mImageUtil.setImageResultCallback(new ImageResultCallback() { @Override public void beforeCamera() { diff --git a/live/src/main/java/com/yunbao/live/adapter/SystemMessageNewAdapter.java b/live/src/main/java/com/yunbao/live/adapter/SystemMessageNewAdapter.java index 533b2221e..e196ab41a 100644 --- a/live/src/main/java/com/yunbao/live/adapter/SystemMessageNewAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/SystemMessageNewAdapter.java @@ -20,6 +20,7 @@ import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.utils.RouteUtil; +import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.live.R; import com.yunbao.live.activity.ZhuangBanActivity; @@ -119,17 +120,29 @@ public class SystemMessageNewAdapter extends RefreshAdapter { itemLayout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - //普通消息 - if (bean.getSystem_message_type() == 1) { - if (bean.getLink() != null && !bean.getLink().equals("")) { - IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo(); - StringBuffer urlBuffer = new StringBuffer(); - urlBuffer.append(bean.getLink()).append("&uid=").append(userInfo.getId()).append("&token=").append(userInfo.getToken()).append("&isZh=").append(WordUtil.isNewZh() ? "1" : 0); - mContext.startActivity(new Intent(mContext, ZhuangBanActivity.class).putExtra("url", urlBuffer.toString())); + if (bean.getIs_report() == 1) { + // 举报消息 + if (bean.getIs_replenishment() == 1) { + // 已经提交过 + ToastUtil.show(R.string.report_second_6); + }else { + // 跳转到补充举报信息界面 + RouteUtil.forwardLiveSecondReportActivity(bean.getUsers_report_id()); + } + } else{ + //普通消息 + if (bean.getSystem_message_type() == 1) { + if (bean.getLink() != null && !bean.getLink().equals("")) { + IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo(); + StringBuffer urlBuffer = new StringBuffer(); + urlBuffer.append(bean.getLink()).append("&uid=").append(userInfo.getId()).append("&token=").append(userInfo.getToken()).append("&isZh=").append(WordUtil.isNewZh() ? "1" : 0); + mContext.startActivity(new Intent(mContext, ZhuangBanActivity.class).putExtra("url", urlBuffer.toString())); + } + } else { + RouteUtil.forwardLiveCompensateActivity(mContext, String.valueOf(bean.getId()), bean.getImgBanner(), bean.getTitle(), bean.getContent(), bean.getAddtime(), bean.getLink(), bean.getGet_status() == 2); } - } else { - RouteUtil.forwardLiveCompensateActivity(mContext, String.valueOf(bean.getId()), bean.getImgBanner(), bean.getTitle(), bean.getContent(), bean.getAddtime(), bean.getLink(), bean.getGet_status() == 2); } + //未读才调用 if (bean.getRead_status() == 2) { ImHttpUtil.readMsg(bean.getId(), new HttpCallback() { diff --git a/live/src/main/java/com/yunbao/live/bean/SystemMessageBean.java b/live/src/main/java/com/yunbao/live/bean/SystemMessageBean.java index fc9ea313d..10422d6f6 100644 --- a/live/src/main/java/com/yunbao/live/bean/SystemMessageBean.java +++ b/live/src/main/java/com/yunbao/live/bean/SystemMessageBean.java @@ -18,6 +18,9 @@ public class SystemMessageBean { private String avatar; private String showImg; private String imgBanner; + private int is_replenishment;// 是否提交过举报补充信息 0.未提交 1.已提交 + private int users_report_id;// 举报表id,非举报反馈消息值等于0 + private int is_report;//是否是举报信息 0.不是 1.是 private int system_message_type; //1 普通消息 2 礼包消息 @@ -25,6 +28,30 @@ public class SystemMessageBean { private int read_status; // 1 已读 2 未读 + public int getIs_report() { + return is_report; + } + + public void setIs_report(int is_report) { + this.is_report = is_report; + } + + public int getIs_replenishment() { + return is_replenishment; + } + + public void setIs_replenishment(int is_replenishment) { + this.is_replenishment = is_replenishment; + } + + public int getUsers_report_id() { + return users_report_id; + } + + public void setUsers_report_id(int users_report_id) { + this.users_report_id = users_report_id; + } + public int getRead_status() { return read_status; } diff --git a/live/src/main/res/layout/activity_report_second.xml b/live/src/main/res/layout/activity_report_second.xml index 7b191a948..08dca1070 100644 --- a/live/src/main/res/layout/activity_report_second.xml +++ b/live/src/main/res/layout/activity_report_second.xml @@ -57,7 +57,7 @@ diff --git a/live/src/main/res/values-zh/strings.xml b/live/src/main/res/values-zh/strings.xml index da3a41777..d29cba97b 100644 --- a/live/src/main/res/values-zh/strings.xml +++ b/live/src/main/res/values-zh/strings.xml @@ -151,4 +151,7 @@ 上傳圖片 舉報內容補充 若您有其它補充信息,請在說明框中描述~ + 已收到您的補充信息,我們正在加急處理中 + 提交成功 + diff --git a/live/src/main/res/values/strings.xml b/live/src/main/res/values/strings.xml index 521ce941c..2c98bde5a 100644 --- a/live/src/main/res/values/strings.xml +++ b/live/src/main/res/values/strings.xml @@ -154,4 +154,7 @@ Upload pictures Report content supplement If you have additional information, please describe it in the description box + Your supplementary information has been received. We are handling it urgently + Submitted successfully + \ No newline at end of file