|
@@ -6,35 +6,45 @@ import android.os.Bundle;
|
|
|
import android.os.Handler;
|
|
|
import android.os.Looper;
|
|
|
import android.telephony.PhoneNumberUtils;
|
|
|
+import android.text.SpannableString;
|
|
|
import android.text.TextUtils;
|
|
|
+import android.view.Gravity;
|
|
|
import android.view.View;
|
|
|
|
|
|
import com.alibaba.android.arouter.facade.annotation.Route;
|
|
|
import com.alibaba.android.arouter.launcher.ARouter;
|
|
|
+import com.cooleshow.base.common.BaseConstant;
|
|
|
import com.cooleshow.base.constanst.StyleConfig;
|
|
|
import com.cooleshow.base.router.RouterPath;
|
|
|
import com.cooleshow.base.ui.activity.BaseMVPActivity;
|
|
|
+import com.cooleshow.base.utils.GsonUtils;
|
|
|
import com.cooleshow.base.utils.KeyboardUtils;
|
|
|
import com.cooleshow.base.utils.PhoneUtils;
|
|
|
import com.cooleshow.base.utils.SizeUtils;
|
|
|
import com.cooleshow.base.utils.ToastUtil;
|
|
|
+import com.cooleshow.base.utils.UiUtils;
|
|
|
import com.cooleshow.base.utils.helper.QMUIStatusBarHelper;
|
|
|
import com.cooleshow.base.widgets.dialog.CommonConfirmDialog;
|
|
|
import com.cooleshow.base.widgets.dialog.CommonConfirmDialog2;
|
|
|
import com.cooleshow.base.widgets.dialog.CommonDialog;
|
|
|
import com.cooleshow.base.widgets.dialog.ImgVerifyCodeDialog;
|
|
|
import com.cooleshow.usercenter.R;
|
|
|
+import com.cooleshow.usercenter.bean.SignOutFailTipBean;
|
|
|
import com.cooleshow.usercenter.constants.UserConstants;
|
|
|
import com.cooleshow.usercenter.databinding.AcSignOutAccountLayoutBinding;
|
|
|
import com.cooleshow.usercenter.helper.UserHelper;
|
|
|
import com.cooleshow.usercenter.presenter.SignOutAccountPresenter;
|
|
|
import com.cooleshow.usercenter.presenter.contract.SignOutAccountContract;
|
|
|
import com.cooleshow.usercenter.widget.SignOutFailTipDialog;
|
|
|
+import com.google.gson.reflect.TypeToken;
|
|
|
|
|
|
import org.json.JSONArray;
|
|
|
import org.json.JSONException;
|
|
|
|
|
|
+import java.lang.reflect.Type;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
import androidx.annotation.Nullable;
|
|
@@ -128,6 +138,7 @@ public class SignOutAccountActivity extends BaseMVPActivity<AcSignOutAccountLayo
|
|
|
}
|
|
|
|
|
|
private void showConfirmDialog() {
|
|
|
+ boolean isMultiAccountUser = UserHelper.isMultiAccountUser();
|
|
|
String authCode = viewBinding.etNum.getText().toString().trim();
|
|
|
if (TextUtils.isEmpty(authCode)) {
|
|
|
ToastUtil.getInstance().showShort("请输入验证码");
|
|
@@ -142,9 +153,14 @@ public class SignOutAccountActivity extends BaseMVPActivity<AcSignOutAccountLayo
|
|
|
commonConfirmDialog.setCancelText("确认");
|
|
|
commonConfirmDialog.setConfirmText("取消");
|
|
|
|
|
|
-
|
|
|
commonConfirmDialog.setTitle("注销账号");
|
|
|
- commonConfirmDialog.setContent("请确认是否要注销账号?");
|
|
|
+ commonConfirmDialog.setContentGravity(Gravity.LEFT);
|
|
|
+ SpannableString multiUserTip = UiUtils.diffColorStringAndBold("请确认是否注销该账号,确认后将同步注销", "酷乐秀/酷乐秀学院", "的账号", getResources().getColor(com.cooleshow.base.R.color.color_666666), getResources().getColor(com.cooleshow.base.R.color.color_f44541));
|
|
|
+ if (isMultiAccountUser) {
|
|
|
+ commonConfirmDialog.setContent(multiUserTip);
|
|
|
+ } else {
|
|
|
+ commonConfirmDialog.setContent("请确认是否要注销账号?");
|
|
|
+ }
|
|
|
commonConfirmDialog.setOnConfirmClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
@@ -233,25 +249,44 @@ public class SignOutAccountActivity extends BaseMVPActivity<AcSignOutAccountLayo
|
|
|
|
|
|
private void showErrorTipMsg(String errmsg) {
|
|
|
try {
|
|
|
- JSONArray jsonArray = new JSONArray(errmsg);
|
|
|
- StringBuilder tip = new StringBuilder();
|
|
|
- for (int i = 0; i < jsonArray.length(); i++) {
|
|
|
- String s = jsonArray.optString(i);
|
|
|
- //1、
|
|
|
- tip.append(i + 1).append("、");
|
|
|
- tip.append(s);
|
|
|
- if (i != jsonArray.length() - 1) {
|
|
|
- tip.append("\n");
|
|
|
+ Type listType = new TypeToken<ArrayList<SignOutFailTipBean>>() {
|
|
|
+ }.getType();
|
|
|
+ ArrayList<SignOutFailTipBean> tips = GsonUtils.fromJson(errmsg, listType);
|
|
|
+ if (tips != null && tips.size() > 0) {
|
|
|
+ for (int i = 0; i < tips.size(); i++) {
|
|
|
+ SignOutFailTipBean signOutFailTipBean = tips.get(i);
|
|
|
+ signOutFailTipBean.setShowTitle(true);
|
|
|
+ if (TextUtils.equals(signOutFailTipBean.getClient(), BaseConstant.STUDENT_CLIENT_TYPE)) {
|
|
|
+ signOutFailTipBean.setClient(getString(R.string.student_fail_tip_title));
|
|
|
+ }
|
|
|
+ if (TextUtils.equals(signOutFailTipBean.getClient(), BaseConstant.TEACHER_CLIENT_TYPE)) {
|
|
|
+ signOutFailTipBean.setClient(getString(R.string.teacher_fail_tip_title));
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+ SignOutFailTipDialog dialog = new SignOutFailTipDialog(this);
|
|
|
+ dialog.show();
|
|
|
+ dialog.setContent(tips);
|
|
|
}
|
|
|
- SignOutFailTipDialog dialog = new SignOutFailTipDialog(this);
|
|
|
- dialog.show();
|
|
|
- dialog.setContent(tip.toString());
|
|
|
- } catch (JSONException e) {
|
|
|
+
|
|
|
+
|
|
|
+// JSONArray jsonArray = new JSONArray(errmsg);
|
|
|
+// StringBuilder tip = new StringBuilder();
|
|
|
+// for (int i = 0; i < jsonArray.length(); i++) {
|
|
|
+// String s = jsonArray.optString(i);
|
|
|
+// //1、
|
|
|
+// tip.append(i + 1).append("、");
|
|
|
+// tip.append(s);
|
|
|
+// if (i != jsonArray.length() - 1) {
|
|
|
+// tip.append("\n");
|
|
|
+// }
|
|
|
+// }
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
private void resetBt() {
|
|
|
viewBinding.tvSendVerifyCode.setClickable(true);
|
|
|
viewBinding.tvSendVerifyCode.setText("获取验证码");
|