Commit 400731da authored by 小费同学阿's avatar 小费同学阿 💬 Committed by 杨秀秀

诉求编辑备注

parent 0fc8d6fd
......@@ -40,16 +40,18 @@ public class AppealEditActivity extends BaseActivity<ActivityAppealEditBinding,
viewModel.getAppealDetailById(getIntent().getStringExtra("appealId"));
// 调用ViewModel的方法来刷新昵称
viewModel.refreshNickName();
if (viewModel.remark != null) {
binding.rejectReasonTip.setVisibility(View.VISIBLE);
viewModel.showRejectionDialog.observe(this, show -> {
String rejectionReason = StringUtils.isEmpty(viewModel.remark) ? "" : viewModel.remark;
RejectionDialog rejectionDialog = new RejectionDialog(this, rejectionReason);
rejectionDialog.show();
});
} else {
binding.rejectReasonTip.setVisibility(View.GONE);
}
viewModel.showRejectionDialog.observe(this, show -> {
String rejectionReason = StringUtils.isEmpty(viewModel.remark.getValue()) ? "" : viewModel.remark.getValue();
RejectionDialog rejectionDialog = new RejectionDialog(this, rejectionReason);
rejectionDialog.show();
});
// 如果有驳回原因则显示控件
viewModel.remark.observe(this, remark -> {
if (remark != null) {
binding.rejectReasonTip.setVisibility(View.VISIBLE);
}
});
/*上传图片*/
......
......@@ -69,7 +69,7 @@ public class AppealEditViewModel extends BaseViewModel<AppealRequest> {
List<FileBean> fList = new ArrayList<>();
/*驳回原因*/
public String remark = "";
public MutableLiveData<String> remark = new MutableLiveData<>(null);
public AppealEditViewModel(@NonNull Application application) {
super(application);
......@@ -115,8 +115,9 @@ public class AppealEditViewModel extends BaseViewModel<AppealRequest> {
dictSort = String.valueOf(resultBean.getAppAppealType());
/*驳回原因赋值*/
if (!resultBean.getOperations().isEmpty()) {
Log.v("resultBean.getOperations().size()", String.valueOf(resultBean.getOperations().size()));
/*取操作日志最新的一条的remark*/
remark = resultBean.getOperations().get(resultBean.getOperations().size() - 1).getRemark();
remark.setValue(resultBean.getOperations().get(resultBean.getOperations().size() - 1).getRemark());
}
/*上传图片*/
appealPicsAdapter.mList.clear();
......@@ -192,7 +193,7 @@ public class AppealEditViewModel extends BaseViewModel<AppealRequest> {
/*查看原因的弹窗*/
public void openReason(View view) {
boolean deFlag = true;
RejectionBean rejectionBean = new RejectionBean(deFlag, StringUtils.isEmpty(remark) ? "" : remark);
RejectionBean rejectionBean = new RejectionBean(deFlag, StringUtils.isEmpty(remark.getValue()) ? "" : remark.getValue());
showRejectionDialog.postValue(rejectionBean);
} /*上传图片*/
public void openPhoto(AddImgAdapter type, int position) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment