فهرست منبع

增加老师端学生端注销账号流程

Pq 1 سال پیش
والد
کامیت
be23e68eb2
18فایلهای تغییر یافته به همراه680 افزوده شده و 2 حذف شده
  1. 12 2
      BaseLibrary/src/main/java/com/cooleshow/base/common/BaseConstant.java
  2. 1 0
      BaseLibrary/src/main/java/com/cooleshow/base/router/RouterPath.kt
  3. 5 0
      BaseLibrary/src/main/res/drawable/shape_6dp_border_eaeaea_1dp.xml
  4. 5 0
      BaseLibrary/src/main/res/drawable/shape_fe2451_point.xml
  5. 5 0
      student/src/main/java/com/cooleshow/student/ui/mine/SettingActivity.java
  6. 32 0
      student/src/main/res/layout/activity_setting.xml
  7. 5 0
      teacher/src/main/java/com/cooleshow/teacher/ui/mine/SettingActivity.java
  8. 31 0
      teacher/src/main/res/layout/activity_setting.xml
  9. 6 0
      usercenter/src/main/AndroidManifest.xml
  10. 3 0
      usercenter/src/main/java/com/cooleshow/usercenter/constants/UserConstants.java
  11. 22 0
      usercenter/src/main/java/com/cooleshow/usercenter/data/api/UserApi.kt
  12. 123 0
      usercenter/src/main/java/com/cooleshow/usercenter/presenter/SignOutAccountPresenter.java
  13. 24 0
      usercenter/src/main/java/com/cooleshow/usercenter/presenter/contract/SignOutAccountContract.java
  14. 205 0
      usercenter/src/main/java/com/cooleshow/usercenter/ui/activity/setting/SignOutAccountActivity.java
  15. BIN
      usercenter/src/main/res/drawable-xhdpi/icon_exclamation_mark_tip.png
  16. BIN
      usercenter/src/main/res/drawable-xxhdpi/icon_exclamation_mark_tip.png
  17. 197 0
      usercenter/src/main/res/layout/ac_sign_out_account_layout.xml
  18. 4 0
      usercenter/src/main/res/values/strings.xml

+ 12 - 2
BaseLibrary/src/main/java/com/cooleshow/base/common/BaseConstant.java

@@ -9,7 +9,9 @@ import com.tencent.open.im.IM;
 public class BaseConstant {
     public final static String SERVER_ADDRESS = BuildConfig.BASE_SERVER_URL;
     public final static String TEACHER_GROUP = "api-teacher/";
+    public final static String TEACHER_GROUP2 = "api-teacher";
     public final static String STUDENT_GROUP = "api-student/";
+    public final static String STUDENT_GROUP2 = "api-student";
     public final static String AUTH_GROUP = "api-auth/";
     public final static String ADMIN_GROUP = "api-admin/";
     public final static String MALL_ADMIN_SERVER = "api-mall-admin/";
@@ -25,12 +27,20 @@ public class BaseConstant {
 
     /**
      * 获取图片验证码地址
+     *
      * @return
      */
     public static String getImgCodeApiUrl() {
         if (BaseApplication.Companion.isTeacherClient()) {
-            return SERVER_ADDRESS+TEACHER_GROUP + IMAGE_VERIFY_CODE_API_URL;
+            return SERVER_ADDRESS + TEACHER_GROUP + IMAGE_VERIFY_CODE_API_URL;
         }
-        return SERVER_ADDRESS+STUDENT_GROUP + IMAGE_VERIFY_CODE_API_URL;
+        return SERVER_ADDRESS + STUDENT_GROUP + IMAGE_VERIFY_CODE_API_URL;
+    }
+
+    public static String getClientGroup() {
+        if (BaseApplication.Companion.isTeacherClient()) {
+            return TEACHER_GROUP2;
+        }
+        return STUDENT_GROUP2;
     }
 }

+ 1 - 0
BaseLibrary/src/main/java/com/cooleshow/base/router/RouterPath.kt

@@ -46,6 +46,7 @@ object RouterPath {
             const val PATH_VERIFY_INPUT = "/userCenter/verifyInput"
             const val PATH_BIND_PASSWORD = "/userCenter/bindPwd"
             const val COMMON_EMPTY_ACTIVITY = "/userCenter/CommEmptyActivity"
+            const val SIGN_OUT_ACCOUNT = "/userCenter/SignOutAccountActivity"
         }
     }
 

+ 5 - 0
BaseLibrary/src/main/res/drawable/shape_6dp_border_eaeaea_1dp.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <stroke android:color="#eaeaea" android:width="1dp"/>
+    <corners android:radius="6dp"/>
+</shape>

+ 5 - 0
BaseLibrary/src/main/res/drawable/shape_fe2451_point.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="oval">
+    <solid android:color="#FE2451"/>
+</shape>

+ 5 - 0
student/src/main/java/com/cooleshow/student/ui/mine/SettingActivity.java

@@ -75,6 +75,10 @@ public class SettingActivity extends BaseMVPActivity<ActivitySettingBinding, Set
                 ARouter.getInstance().build(RouterPath.MineCenter.MINE_FEEDBACK)
                         .navigation();
                 break;
+            case R.id.tv_sign_out_account:
+                ARouter.getInstance().build(RouterPath.UserCenter.SIGN_OUT_ACCOUNT)
+                        .navigation();
+                break;
         }
     }
 
@@ -96,6 +100,7 @@ public class SettingActivity extends BaseMVPActivity<ActivitySettingBinding, Set
         viewBinding.tvLoginOut.setOnClickListener(this);
         viewBinding.clFeedback.setOnClickListener(this);
         viewBinding.clUserPrivate.setOnClickListener(this);
+        viewBinding.tvSignOutAccount.setOnClickListener(this);
 
         is_detection = SPUtils.getInstance().getBoolean("IS_DETECTION");
         if (is_detection) {

+ 32 - 0
student/src/main/res/layout/activity_setting.xml

@@ -255,6 +255,38 @@
                 app:layout_constraintLeft_toLeftOf="parent"
                 app:layout_constraintTop_toBottomOf="@+id/cl_about" />
         </androidx.constraintlayout.widget.ConstraintLayout>
+
+
+        <androidx.constraintlayout.widget.ConstraintLayout
+            android:background="@drawable/bg_white_10dp"
+            android:layout_width="match_parent"
+            android:layout_marginTop="12dp"
+            android:layout_marginEnd="14dp"
+            android:layout_marginStart="14dp"
+            android:layout_height="wrap_content">
+            <TextView
+                android:id="@+id/tv_sign_out_account"
+                android:gravity="center_vertical"
+                android:layout_width="match_parent"
+                android:layout_height="50dp"
+                android:layout_marginLeft="12dp"
+                android:text="注销账号"
+                android:textColor="@color/color_1a1a1a"
+                android:textSize="@dimen/sp_16"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintLeft_toLeftOf="parent"
+                app:layout_constraintTop_toTopOf="parent" />
+
+
+            <ImageView
+                android:layout_width="@dimen/dp_6"
+                android:layout_height="@dimen/dp_11"
+                android:layout_marginRight="15dp"
+                android:background="@drawable/icon_next_right"
+                app:layout_constraintBottom_toBottomOf="@+id/tv_sign_out_account"
+                app:layout_constraintRight_toRightOf="@+id/tv_sign_out_account"
+                app:layout_constraintTop_toTopOf="@+id/tv_sign_out_account" />
+        </androidx.constraintlayout.widget.ConstraintLayout>
     </LinearLayout>
 
     <TextView

+ 5 - 0
teacher/src/main/java/com/cooleshow/teacher/ui/mine/SettingActivity.java

@@ -75,6 +75,10 @@ public class SettingActivity extends BaseMVPActivity<ActivitySettingBinding, Set
                 ARouter.getInstance().build(RouterPath.MineCenter.MINE_FEEDBACK)
                         .navigation();
                 break;
+            case R.id.tv_sign_out_account:
+                ARouter.getInstance().build(RouterPath.UserCenter.SIGN_OUT_ACCOUNT)
+                        .navigation();
+                break;
         }
     }
 
@@ -96,6 +100,7 @@ public class SettingActivity extends BaseMVPActivity<ActivitySettingBinding, Set
         viewBinding.tvLoginOut.setOnClickListener(this);
         viewBinding.clFeedback.setOnClickListener(this);
         viewBinding.clUserPrivate.setOnClickListener(this);
+        viewBinding.tvSignOutAccount.setOnClickListener(this);
 
         is_detection = SPUtils.getInstance().getBoolean("IS_DETECTION");
         if (is_detection) {

+ 31 - 0
teacher/src/main/res/layout/activity_setting.xml

@@ -255,6 +255,37 @@
                 app:layout_constraintLeft_toLeftOf="parent"
                 app:layout_constraintTop_toBottomOf="@+id/cl_about" />
         </androidx.constraintlayout.widget.ConstraintLayout>
+
+        <androidx.constraintlayout.widget.ConstraintLayout
+            android:background="@drawable/bg_white_10dp"
+            android:layout_width="match_parent"
+            android:layout_marginTop="12dp"
+            android:layout_marginEnd="14dp"
+            android:layout_marginStart="14dp"
+            android:layout_height="wrap_content">
+            <TextView
+                android:id="@+id/tv_sign_out_account"
+                android:gravity="center_vertical"
+                android:layout_width="match_parent"
+                android:layout_height="50dp"
+                android:layout_marginLeft="12dp"
+                android:text="注销账号"
+                android:textColor="@color/color_1a1a1a"
+                android:textSize="@dimen/sp_16"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintLeft_toLeftOf="parent"
+                app:layout_constraintTop_toTopOf="parent" />
+
+
+            <ImageView
+                android:layout_width="@dimen/dp_6"
+                android:layout_height="@dimen/dp_11"
+                android:layout_marginRight="15dp"
+                android:background="@drawable/icon_next_right"
+                app:layout_constraintBottom_toBottomOf="@+id/tv_sign_out_account"
+                app:layout_constraintRight_toRightOf="@+id/tv_sign_out_account"
+                app:layout_constraintTop_toTopOf="@+id/tv_sign_out_account" />
+        </androidx.constraintlayout.widget.ConstraintLayout>
     </LinearLayout>
 
     <TextView

+ 6 - 0
usercenter/src/main/AndroidManifest.xml

@@ -30,9 +30,15 @@
             android:name=".ui.activity.BindPasswordActivity"
             android:configChanges="orientation|screenSize|keyboardHidden"
             android:screenOrientation="portrait" />
+        <activity
+            android:name=".ui.activity.setting.SignOutAccountActivity"
+            android:configChanges="orientation|screenSize|keyboardHidden"
+            android:exported="false"
+            android:screenOrientation="portrait" />
 
         <activity
             android:name=".ui.activity.CommEmptyActivity"
+            android:configChanges="orientation|screenSize|keyboardHidden"
             android:exported="false"
             android:screenOrientation="portrait" />
     </application>

+ 3 - 0
usercenter/src/main/java/com/cooleshow/usercenter/constants/UserConstants.java

@@ -8,6 +8,7 @@ public class UserConstants {
     public static final String SEND_VERIFY_CODE_TYPE_LOGIN ="LOGIN";//发送验证码type-登录
     public static final String SEND_VERIFY_CODE_TYPE_REGISTER ="REGISTER";//发送验证码type-注册
     public static final String SEND_VERIFY_CODE_TYPE_BANK ="BANK";//发送验证码type-绑定银行卡
+    public static final String SEND_VERIFY_CODE_TYPE_LOGOFF  ="LOGOFF ";//发送验证码type-注销账号
     public static final String LOGIN_ITEM ="login_item";//发送验证码type-绑定银行卡
     public static final String PHONE_NUM_KEY="phone_num_key";
     public static final String TEMP_TOKEN="temp_token";
@@ -21,4 +22,6 @@ public class UserConstants {
 
     public static final String GENDER_TYPE_MALE = "1";//男
     public static final String GENDER_TYPE_FEMALE = "0";//女
+    public static final int VERIFY_CODE_COUNT_TIME = 60;//验证码计时一分钟
+
 }

+ 22 - 0
usercenter/src/main/java/com/cooleshow/usercenter/data/api/UserApi.kt

@@ -132,4 +132,26 @@ interface UserApi {
      */
     @GET(BaseConstant.STUDENT_GROUP + "sysConfig/queryByParamName")
     fun queryModifyNickConfig(@Query("paramName") last_username_month: String?): Observable<BaseResponse<QueryParamsConfigBean?>?>?
+
+
+    /**
+     * 校验图片验证码
+     *
+     *
+     * type:类型(PASSWD:修改密码,LOGIN:登录或注册,BANK:绑定银行卡,PHONE:修改手机号)
+     *
+     * @return
+     */
+    @FormUrlEncoded
+    @POST("{group_name}" + "/code/verifyImageCode")
+    fun verifyImgCode(
+        @FieldMap map: Map<String?, String?>?,
+        @Path("group_name") group_name: String
+    ): Observable<BaseResponse<Any?>?>?
+
+    /**
+     * 注销账号
+     */
+    @GET(BaseConstant.AUTH_GROUP + "user/logoff/{code}")
+    fun signOutAccount(@Path("code") code: String?): Observable<BaseResponse<Object>?>?
 }

+ 123 - 0
usercenter/src/main/java/com/cooleshow/usercenter/presenter/SignOutAccountPresenter.java

@@ -0,0 +1,123 @@
+package com.cooleshow.usercenter.presenter;
+
+import android.app.Activity;
+
+import com.cooleshow.base.common.BaseApplication;
+import com.cooleshow.base.common.BaseConstant;
+import com.cooleshow.base.data.net.ApiException;
+import com.cooleshow.base.presenter.BasePresenter;
+import com.cooleshow.base.rx.BaseObserver;
+import com.cooleshow.base.utils.ErrorParse;
+import com.cooleshow.base.utils.RequestBodyUtil;
+import com.cooleshow.base.utils.ToastUtil;
+import com.cooleshow.base.utils.ToastUtils;
+import com.cooleshow.usercenter.bean.SetDetailBean;
+import com.cooleshow.usercenter.constants.UserConstants;
+import com.cooleshow.usercenter.data.api.UserApi;
+import com.cooleshow.usercenter.presenter.contract.SignOutAccountContract;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 创建日期:2022/5/16 16:10
+ *
+ * @author Ryan
+ * 类说明:
+ */
+public class SignOutAccountPresenter extends BasePresenter<SignOutAccountContract.SignOutAccountView> implements SignOutAccountContract.Presenter {
+
+    public void sendSmsCode(String mobile) {
+        getView().showLoading();
+        if (BaseApplication.Companion.isTeacherClient()) {
+            sendVerifyCodeForTeacher(mobile);
+        } else {
+            sendVerifyCodeForStu(mobile);
+        }
+    }
+
+
+    /**
+     * 学生端发送验证码
+     *
+     * @param mobile
+     */
+    private void sendVerifyCodeForStu(String mobile) {
+        addSubscribe(create(UserApi.class).sendSmsCodeForStu(mobile, UserConstants.SEND_VERIFY_CODE_TYPE_LOGOFF), new BaseObserver<Object>(getView()) {
+            @Override
+            protected void onSuccess(Object data) {
+                if (getView() != null) {
+                    getView().sendVerifyCodeSuccess();
+                }
+            }
+
+            @Override
+            public void onError(Throwable e) {
+                super.onError(e);
+                if (getView() != null) {
+                    getView().sendVerifyCodeFail();
+                }
+            }
+        });
+    }
+
+    /**
+     * 老师端发送验证码
+     *
+     * @param mobile
+     */
+    private void sendVerifyCodeForTeacher(String mobile) {
+        addSubscribe(create(UserApi.class).sendSmsCode(mobile, UserConstants.SEND_VERIFY_CODE_TYPE_LOGOFF), new BaseObserver<Object>(getView()) {
+            @Override
+            protected void onSuccess(Object data) {
+                if (getView() != null) {
+                    getView().sendVerifyCodeSuccess();
+                }
+            }
+
+            @Override
+            public void onError(Throwable e) {
+                super.onError(e);
+                if (getView() != null) {
+                    getView().sendVerifyCodeFail();
+                }
+            }
+        });
+    }
+
+
+    /**
+     * 图片验证码验证
+     * @param phone
+     * @param imgCode
+     */
+    public void verifyImgCode(String phone, String imgCode) {
+        if (getView() != null) {
+            getView().showLoading();
+        }
+        Map<String, String> params = new HashMap<>();
+        params.put("code", imgCode);
+        params.put("phone", phone);
+        addSubscribe(create(UserApi.class).verifyImgCode(params, BaseConstant.getClientGroup()), new BaseObserver<Object>(getView()) {
+            @Override
+            protected void onSuccess(Object data) {
+                if (getView() != null) {
+                    getView().verifyImgCodeSuccess(phone);
+                }
+            }
+
+        });
+    }
+
+    public void signOutAccount(String code){
+        addSubscribe(create(UserApi.class).signOutAccount(code), new BaseObserver<Object>(getView()) {
+            @Override
+            protected void onSuccess(Object data) {
+                if (getView() != null) {
+                    getView().signOutAccountSuccess();
+                }
+            }
+        });
+    }
+}

+ 24 - 0
usercenter/src/main/java/com/cooleshow/usercenter/presenter/contract/SignOutAccountContract.java

@@ -0,0 +1,24 @@
+package com.cooleshow.usercenter.presenter.contract;
+
+import com.cooleshow.base.presenter.view.BaseView;
+
+/**
+ * 创建日期:2022/5/16 16:12
+ *
+ * @author Ryan
+ * 类说明:
+ */
+public interface SignOutAccountContract {
+    interface  SignOutAccountView extends BaseView {
+        void sendVerifyCodeSuccess();
+
+        void sendVerifyCodeFail();
+
+        void verifyImgCodeSuccess(String phone);
+
+        void signOutAccountSuccess();
+
+    }
+    interface Presenter {
+    }
+}

+ 205 - 0
usercenter/src/main/java/com/cooleshow/usercenter/ui/activity/setting/SignOutAccountActivity.java

@@ -0,0 +1,205 @@
+package com.cooleshow.usercenter.ui.activity.setting;
+
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Looper;
+import android.telephony.PhoneNumberUtils;
+import android.text.TextUtils;
+import android.view.View;
+
+import com.alibaba.android.arouter.facade.annotation.Route;
+import com.alibaba.android.arouter.launcher.ARouter;
+import com.cooleshow.base.router.RouterPath;
+import com.cooleshow.base.ui.activity.BaseMVPActivity;
+import com.cooleshow.base.utils.PhoneUtils;
+import com.cooleshow.base.utils.ToastUtil;
+import com.cooleshow.base.utils.helper.QMUIStatusBarHelper;
+import com.cooleshow.base.widgets.dialog.CommonConfirmDialog;
+import com.cooleshow.base.widgets.dialog.CommonDialog;
+import com.cooleshow.base.widgets.dialog.ImgVerifyCodeDialog;
+import com.cooleshow.usercenter.R;
+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 java.util.HashMap;
+import java.util.Map;
+
+import androidx.annotation.Nullable;
+
+/**
+ * Author by pq, Date on 2023/8/24.
+ */
+@Route(path = RouterPath.UserCenter.SIGN_OUT_ACCOUNT)
+public class SignOutAccountActivity extends BaseMVPActivity<AcSignOutAccountLayoutBinding, SignOutAccountPresenter> implements View.OnClickListener, SignOutAccountContract.SignOutAccountView {
+    private int countTimeValue = UserConstants.VERIFY_CODE_COUNT_TIME;
+    private ImgVerifyCodeDialog mImgVerifyCodeDialog;
+    private String mPhoneNum;
+    private Handler mHandler = new Handler(Looper.getMainLooper()) {
+
+    };
+    Runnable mRunnable = new Runnable() {
+        @Override
+        public void run() {
+            countTimeValue--;
+            viewBinding.tvSendVerifyCode.setText(countTimeValue + "s");
+            viewBinding.tvSendVerifyCode.setClickable(false);
+            if (countTimeValue < 0) {
+                viewBinding.tvSendVerifyCode.setClickable(true);
+                viewBinding.tvSendVerifyCode.setText("获取验证码");
+            } else {
+                mHandler.postDelayed(mRunnable, 1000);
+            }
+        }
+    };
+
+    @Override
+    protected void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        QMUIStatusBarHelper.setStatusBarLightMode(this);
+    }
+
+    @Override
+    protected void initView() {
+        initMidTitleToolBar(viewBinding.toolbarInclude.toolbar, "注销账号");
+    }
+
+    @Override
+    public void initData() {
+        super.initData();
+        mPhoneNum = UserHelper.getUserPhone();
+        if (TextUtils.isEmpty(mPhoneNum)) {
+            finish();
+            return;
+        }
+        try {
+            String cPhone = mPhoneNum.substring(0, 3) + "****" + mPhoneNum.substring(7, mPhoneNum.length());
+            viewBinding.tvTitle.setText(String.format("将%s所绑定的账号注销", cPhone));
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        initListener();
+    }
+
+    private void initListener() {
+        viewBinding.tvSendVerifyCode.setOnClickListener(this);
+        viewBinding.tvConfirm.setOnClickListener(this);
+    }
+
+    @Override
+    protected AcSignOutAccountLayoutBinding getLayoutView() {
+        return AcSignOutAccountLayoutBinding.inflate(getLayoutInflater());
+    }
+
+    @Override
+    protected SignOutAccountPresenter createPresenter() {
+        return new SignOutAccountPresenter();
+    }
+
+    @Override
+    public void onClick(View v) {
+        int id = v.getId();
+        if (id == R.id.tv_send_verify_code) {
+            showImgVerifyCodeDialog();
+            return;
+        }
+        if (id == R.id.tv_confirm) {
+            showConfirmDialog();
+            return;
+        }
+    }
+
+    private void showConfirmDialog() {
+        String authCode = viewBinding.etNum.getText().toString().trim();
+        if (TextUtils.isEmpty(authCode)) {
+            ToastUtil.getInstance().showShort("请输入验证码");
+            return;
+        }
+        CommonDialog commonConfirmDialog = new CommonDialog(this);
+        commonConfirmDialog.show();
+        commonConfirmDialog.setTitle("提示");
+        commonConfirmDialog.setContent("注销账号后您所有的留存信息将被清空且无法恢复,请谨慎操作");
+        commonConfirmDialog.setOnConfirmClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                presenter.signOutAccount(authCode);
+                commonConfirmDialog.dismiss();
+            }
+        });
+        commonConfirmDialog.setOnCancelClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                commonConfirmDialog.dismiss();
+            }
+        });
+    }
+
+    private void showImgVerifyCodeDialog() {
+        if (mImgVerifyCodeDialog == null) {
+            mImgVerifyCodeDialog = new ImgVerifyCodeDialog(SignOutAccountActivity.this);
+        }
+        if (!mImgVerifyCodeDialog.isShowing()) {
+            mImgVerifyCodeDialog.show();
+        }
+        mImgVerifyCodeDialog.setPhone(mPhoneNum);
+        mImgVerifyCodeDialog.setOnEventListener(new ImgVerifyCodeDialog.OnEventListener() {
+            @Override
+            public void onVerifyImgCode(String phone, String imgCode) {
+                if (presenter != null) {
+                    presenter.verifyImgCode(phone, imgCode);
+                }
+            }
+        });
+    }
+
+
+    @Override
+    public void sendVerifyCodeSuccess() {
+        ToastUtil.getInstance().showShort("验证码发送成功,请注意查收!");
+        startTimer();
+    }
+
+    private void startTimer() {
+        countTimeValue = UserConstants.VERIFY_CODE_COUNT_TIME;
+        mHandler.removeCallbacksAndMessages(null);
+        mHandler.postDelayed(mRunnable, 1000);
+    }
+
+
+    @Override
+    public void sendVerifyCodeFail() {
+        if (mHandler != null) {
+            mHandler.removeCallbacksAndMessages(null);
+        }
+    }
+
+    @Override
+    public void verifyImgCodeSuccess(String phone) {
+        if (isFinishing() || isDestroyed()) {
+            return;
+        }
+        if (mImgVerifyCodeDialog != null) {
+            mImgVerifyCodeDialog.dismiss();
+        }
+        presenter.sendSmsCode(mPhoneNum);
+    }
+
+    @Override
+    public void signOutAccountSuccess() {
+        ToastUtil.getInstance().showShort("注销成功,感谢您的使用");
+        UserHelper.saveUserToken("");
+        ARouter.getInstance().build(RouterPath.UserCenter.PATH_VERIFY_LOGIN)
+                .navigation();
+    }
+
+    @Override
+    public void onDestroy() {
+        super.onDestroy();
+        if (mHandler != null) {
+            mHandler.removeCallbacksAndMessages(null);
+        }
+    }
+}

BIN
usercenter/src/main/res/drawable-xhdpi/icon_exclamation_mark_tip.png


BIN
usercenter/src/main/res/drawable-xxhdpi/icon_exclamation_mark_tip.png


+ 197 - 0
usercenter/src/main/res/layout/ac_sign_out_account_layout.xml

@@ -0,0 +1,197 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools">
+    <include
+        android:id="@+id/toolbar_include"
+        layout="@layout/common_toolbar_layout"/>
+
+    <View
+        android:id="@+id/view_bg"
+        android:background="@drawable/bg_white_10dp"
+        android:layout_marginTop="12dp"
+        android:layout_marginEnd="13dp"
+        android:layout_marginStart="13dp"
+        android:layout_marginBottom="30dp"
+        app:layout_constraintBottom_toTopOf="@+id/tv_confirm"
+        app:layout_constraintTop_toBottomOf="@+id/toolbar_include"
+        android:layout_width="match_parent"
+        android:layout_height="0dp"/>
+
+    <ImageView
+        android:id="@+id/iv_tip"
+        android:layout_marginTop="32dp"
+        app:layout_constraintRight_toRightOf="@+id/view_bg"
+        app:layout_constraintLeft_toLeftOf="@+id/view_bg"
+        app:layout_constraintTop_toTopOf="@+id/view_bg"
+        android:src="@drawable/icon_exclamation_mark_tip"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"/>
+
+    <TextView
+        android:id="@+id/tv_title"
+        android:layout_marginTop="30dp"
+        app:layout_constraintRight_toRightOf="@+id/view_bg"
+        app:layout_constraintLeft_toLeftOf="@+id/view_bg"
+        app:layout_constraintTop_toBottomOf="@+id/iv_tip"
+        android:textSize="@dimen/sp_18"
+        android:textStyle="bold"
+        android:textColor="@color/color_333333"
+        tools:text="将155****4306所绑定的账号注销"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"/>
+
+    <TextView
+        android:id="@+id/tv_tip"
+        android:paddingEnd="20dp"
+        android:paddingStart="20dp"
+        android:layout_marginTop="29dp"
+        app:layout_constraintRight_toRightOf="@+id/view_bg"
+        app:layout_constraintLeft_toLeftOf="@+id/view_bg"
+        app:layout_constraintTop_toBottomOf="@+id/tv_title"
+        android:text="注销后,您在相关产品/服务留存的信息将被清空且无法找回,具体包括:"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"/>
+
+    <TextView
+        android:includeFontPadding="false"
+        android:id="@+id/tv_des1"
+        android:layout_marginEnd="34dp"
+        android:layout_marginStart="34dp"
+        android:layout_marginTop="16dp"
+        app:layout_constraintRight_toRightOf="@+id/view_bg"
+        app:layout_constraintLeft_toLeftOf="@+id/view_bg"
+        app:layout_constraintTop_toBottomOf="@+id/tv_tip"
+        android:text="@string/str_sign_out_account_des2"
+        android:textColor="@color/color_333333"
+        android:textSize="@dimen/sp_14"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"/>
+
+    <TextView
+        android:includeFontPadding="false"
+        android:id="@+id/tv_des2"
+        android:layout_marginEnd="34dp"
+        android:layout_marginStart="34dp"
+        android:layout_marginTop="16dp"
+        app:layout_constraintRight_toRightOf="@+id/view_bg"
+        app:layout_constraintLeft_toLeftOf="@+id/view_bg"
+        app:layout_constraintTop_toBottomOf="@+id/tv_des1"
+        android:text="@string/str_sign_out_account_des1"
+        android:textColor="@color/color_333333"
+        android:textSize="@dimen/sp_14"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"/>
+
+    <TextView
+        android:includeFontPadding="false"
+        android:id="@+id/tv_des3"
+        android:layout_marginEnd="34dp"
+        android:layout_marginStart="34dp"
+        android:layout_marginTop="16dp"
+        app:layout_constraintRight_toRightOf="@+id/view_bg"
+        app:layout_constraintLeft_toLeftOf="@+id/view_bg"
+        app:layout_constraintTop_toBottomOf="@+id/tv_des2"
+        android:text="@string/str_sign_out_account_des3"
+        android:textColor="@color/color_333333"
+        android:textSize="@dimen/sp_14"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"/>
+
+    <View
+        android:layout_marginStart="20dp"
+        app:layout_constraintLeft_toLeftOf="@+id/view_bg"
+        app:layout_constraintBottom_toBottomOf="@+id/tv_des1"
+        android:background="@drawable/shape_fe2451_point"
+        app:layout_constraintTop_toTopOf="@+id/tv_des1"
+        android:layout_width="6dp"
+        android:layout_height="6dp"/>
+
+    <View
+        android:layout_marginStart="20dp"
+        app:layout_constraintLeft_toLeftOf="@+id/view_bg"
+        app:layout_constraintBottom_toBottomOf="@+id/tv_des2"
+        android:background="@drawable/shape_fe2451_point"
+        app:layout_constraintTop_toTopOf="@+id/tv_des2"
+        android:layout_width="6dp"
+        android:layout_height="6dp"/>
+
+    <View
+        android:layout_marginStart="20dp"
+        app:layout_constraintLeft_toLeftOf="@+id/view_bg"
+        app:layout_constraintBottom_toBottomOf="@+id/tv_des3"
+        android:background="@drawable/shape_fe2451_point"
+        app:layout_constraintTop_toTopOf="@+id/tv_des3"
+        android:layout_width="6dp"
+        android:layout_height="6dp"/>
+
+    <View
+        android:id="@+id/view_verify_code_bg"
+        android:layout_marginEnd="12dp"
+        android:layout_marginTop="32dp"
+        android:layout_marginStart="12dp"
+        app:layout_constraintRight_toRightOf="@+id/view_bg"
+        app:layout_constraintLeft_toLeftOf="@+id/view_bg"
+        app:layout_constraintTop_toBottomOf="@+id/tv_des3"
+        android:background="@drawable/shape_6dp_border_eaeaea_1dp"
+        android:layout_width="0dp"
+        android:layout_height="54dp"/>
+
+
+    <TextView
+        android:id="@+id/tv_send_verify_code"
+        app:layout_constraintRight_toRightOf="@+id/view_verify_code_bg"
+        app:layout_constraintBottom_toBottomOf="@+id/view_verify_code_bg"
+        app:layout_constraintTop_toTopOf="@+id/view_verify_code_bg"
+        android:textColor="@color/color_ff2dc7aa"
+        android:textSize="@dimen/sp_14"
+        android:text="获取验证码"
+        android:gravity="center"
+        android:layout_width="94dp"
+        android:layout_height="wrap_content"/>
+    
+    <View
+        android:id="@+id/view_line"
+        app:layout_constraintRight_toLeftOf="@+id/tv_send_verify_code"
+        app:layout_constraintBottom_toBottomOf="@+id/tv_send_verify_code"
+        app:layout_constraintTop_toTopOf="@+id/tv_send_verify_code"
+        android:background="@color/color_ff2dc7aa"
+        android:layout_width="1dp"
+        android:layout_height="18dp"/>
+
+    <EditText
+        android:id="@+id/et_num"
+        android:maxLines="1"
+        android:inputType="number"
+        android:maxLength="6"
+        android:paddingStart="12dp"
+        android:hint="请输入短信验证码"
+        android:textColorHint="@color/color_666666"
+        android:textColor="@color/color_333333"
+        android:textSize="@dimen/sp_16"
+        android:background="@color/transparent"
+        app:layout_constraintRight_toLeftOf="@+id/view_line"
+        app:layout_constraintLeft_toLeftOf="@+id/view_verify_code_bg"
+        app:layout_constraintBottom_toBottomOf="@+id/view_verify_code_bg"
+        app:layout_constraintTop_toTopOf="@+id/view_verify_code_bg"
+        android:layout_width="0dp"
+        android:layout_height="0dp"/>
+    
+    <TextView
+        android:id="@+id/tv_confirm"
+        android:layout_marginEnd="25dp"
+        android:layout_marginStart="25dp"
+        android:background="@drawable/shape_login_bt_bg"
+        android:layout_marginBottom="56dp"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintBottom_toBottomOf="parent"
+        android:textColor="@color/white"
+        android:gravity="center"
+        android:textSize="@dimen/sp_18"
+        android:text="注销账号"
+        android:layout_width="match_parent"
+        android:layout_height="44dp"/>
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 4 - 0
usercenter/src/main/res/values/strings.xml

@@ -21,4 +21,8 @@
     <string name="login_privacy_tip">《用户注册协议》</string>
     <string name="login_privacy_tip2">《隐私政策》</string>
     <string name="nickname_fill_str">游客%1$s</string>
+
+    <string name="str_sign_out_account_des1">各产品/服务及权益信息</string>
+    <string name="str_sign_out_account_des3">您在使用各产品/服务时留存的其他信息</string>
+    <string name="str_sign_out_account_des2">个人资料,实名认证等身份信息</string>
 </resources>