瀏覽代碼

修改密码流程变更

Pq 1 年之前
父節點
當前提交
f841ed185f

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

@@ -169,4 +169,12 @@ interface UserApi {
      */
     @GET(BaseConstant.STUDENT_GROUP + "student/queryUserInfo")
     fun queryUserInfo(): Observable<BaseResponse<StudentUserInfo?>?>?
+
+    /**
+     * 查询学员基本信息
+     *
+     * @return
+     */
+    @GET(BaseConstant.AUTH_GROUP + "checkPassword")
+    fun checkOldPwd(): Observable<BaseResponse<StudentUserInfo?>?>?
 }

+ 33 - 0
usercenter/src/main/java/com/cooleshow/usercenter/presenter/UpdatePasswordPresenter.java

@@ -0,0 +1,33 @@
+package com.cooleshow.usercenter.presenter;
+
+import android.text.TextUtils;
+
+import com.cooleshow.base.bean.QueryParamsConfigBean;
+import com.cooleshow.base.common.BaseApplication;
+import com.cooleshow.base.presenter.BasePresenter;
+import com.cooleshow.base.rx.BaseObserver;
+import com.cooleshow.usercenter.data.api.UserApi;
+import com.cooleshow.usercenter.presenter.contract.BindPasswordContract;
+import com.cooleshow.usercenter.presenter.contract.UpdatePasswordContract;
+
+
+/**
+ * Author by pq, Date on 2022/4/19.
+ */
+public class UpdatePasswordPresenter extends BasePresenter<UpdatePasswordContract.View> implements UpdatePasswordContract.Presenter {
+
+
+    public void checkOldPwd() {
+        getView().showLoading();
+        addSubscribe(create(UserApi.class).checkOldPwd(), new BaseObserver<Object>(getView()) {
+            @Override
+            protected void onSuccess(Object data) {
+            }
+
+            @Override
+            public void onError(Throwable e) {
+                super.onError(e);
+            }
+        });
+    }
+}

+ 16 - 0
usercenter/src/main/java/com/cooleshow/usercenter/presenter/contract/UpdatePasswordContract.java

@@ -0,0 +1,16 @@
+package com.cooleshow.usercenter.presenter.contract;
+
+import com.cooleshow.base.bean.QueryParamsConfigBean;
+import com.cooleshow.base.presenter.view.BaseView;
+
+/**
+ * Author by pq, Date on 2022/4/20.
+ */
+public interface UpdatePasswordContract {
+
+    interface View extends BaseView {
+    }
+
+    interface Presenter {
+    }
+}

+ 81 - 0
usercenter/src/main/java/com/cooleshow/usercenter/ui/activity/UpdatePasswordActivity.java

@@ -0,0 +1,81 @@
+package com.cooleshow.usercenter.ui.activity;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.text.TextUtils;
+import android.view.View;
+import android.widget.TextView;
+
+import com.alibaba.android.arouter.facade.annotation.Route;
+import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
+import com.bigkoo.pickerview.view.OptionsPickerView;
+import com.cooleshow.base.bean.QueryParamsConfigBean;
+import com.cooleshow.base.common.BaseApplication;
+import com.cooleshow.base.router.RouterPath;
+import com.cooleshow.base.ui.activity.BaseMVPActivity;
+import com.cooleshow.base.utils.ToastUtil;
+import com.cooleshow.base.utils.helper.QMUIStatusBarHelper;
+import com.cooleshow.usercenter.R;
+import com.cooleshow.usercenter.constants.UserConstants;
+import com.cooleshow.usercenter.databinding.ActivityBindPwdLayoutBinding;
+import com.cooleshow.usercenter.databinding.ActivityUpdatePwdLayoutBinding;
+import com.cooleshow.usercenter.helper.PhoneCheckHelper;
+import com.cooleshow.usercenter.presenter.BindPasswordPresenter;
+import com.cooleshow.usercenter.presenter.contract.BindPasswordContract;
+
+import java.util.ArrayList;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
+/**
+ * Author by pq, Date on 2022/4/19.
+ */
+@Route(path = RouterPath.UserCenter.PATH_BIND_PASSWORD)
+public class UpdatePasswordActivity extends BaseMVPActivity<ActivityUpdatePwdLayoutBinding, BindPasswordPresenter> implements BindPasswordContract.BindPwdView, View.OnClickListener {
+    @Override
+    protected void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        QMUIStatusBarHelper.setStatusBarLightMode(this);
+    }
+
+    @NonNull
+    @Override
+    protected ActivityUpdatePwdLayoutBinding getLayoutView() {
+        return ActivityUpdatePwdLayoutBinding.inflate(getLayoutInflater());
+    }
+
+    @Override
+    protected void initView() {
+    }
+
+    @Override
+    public void initData() {
+        super.initData();
+        initListener();
+    }
+
+    private void initListener() {
+        viewBinding.tvForgetPwd.setOnClickListener(this);
+        viewBinding.tvConfirm.setOnClickListener(this);
+    }
+
+    @Override
+    public void onBindSuccess() {
+        ToastUtil.getInstance().showShort("设置成功");
+    }
+
+    @Override
+    public void queryModifyConfigSuccess(QueryParamsConfigBean bean) {
+    }
+
+    @Override
+    public void onClick(View v) {
+    }
+
+    @Override
+    protected BindPasswordPresenter createPresenter() {
+        return new BindPasswordPresenter();
+    }
+
+}

+ 81 - 0
usercenter/src/main/res/layout/activity_update_pwd_layout.xml

@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical"
+    tools:ignore="MissingDefaultResource">
+
+    <include
+        android:id="@+id/toolbar_include"
+        layout="@layout/common_toolbar_layout" />
+
+    <TextView
+        android:id="@+id/tv_phone"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="12dp"
+        android:layout_marginTop="15dp"
+        android:text="--"
+        android:textColor="@color/black"
+        android:textSize="20sp" />
+
+    <androidx.constraintlayout.widget.ConstraintLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="15dp"
+        android:layout_marginStart="13dp"
+        android:layout_marginEnd="13dp"
+        android:background="@drawable/bg_white_10dp">
+
+        <com.cooleshow.base.widgets.ClearEditText
+            android:theme="@style/MyEditText"
+            android:textCursorDrawable="@drawable/shape_2dc7aa_1dp"
+            android:id="@+id/et_password"
+            android:layout_width="match_parent"
+            android:layout_height="@dimen/dp_48"
+            android:background="@null"
+            android:gravity="center_vertical"
+            android:hint="请输入账号原密码"
+            android:inputType="textPassword"
+            android:paddingLeft="14dp"
+            android:paddingRight="14dp"
+            android:textColor="@color/color_1a1a1a"
+            android:textColorHint="@color/color_aaaaaa"
+            android:textSize="@dimen/sp_16"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintTop_toTopOf="parent" />
+
+
+
+    </androidx.constraintlayout.widget.ConstraintLayout>
+
+    <TextView
+        android:id="@+id/tv_confirm"
+        android:layout_width="match_parent"
+        android:layout_height="44dp"
+        android:layout_marginLeft="25dp"
+        android:layout_marginTop="30dp"
+        android:layout_marginRight="25dp"
+        android:background="?attr/klx_main_bt_background"
+        android:gravity="center"
+        android:text="确定"
+        android:textStyle="bold"
+        android:textColor="@color/white"
+        android:textSize="@dimen/sp_18" />
+
+    <TextView
+        android:id="@+id/tv_forget_pwd"
+        android:textSize="@dimen/sp_14"
+        android:gravity="center"
+        android:textColor="@color/color_666666"
+        android:text="忘记密码"
+        android:paddingBottom="16dp"
+        android:paddingTop="16dp"
+        android:layout_marginLeft="25dp"
+        android:layout_marginRight="25dp"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"/>
+
+</LinearLayout>