Parcourir la source

1.完善账号手机修改

wsad5123 il y a 5 ans
Parent
commit
e76bb072c2
24 fichiers modifiés avec 608 ajouts et 5 suppressions
  1. 3 0
      app/src/main/AndroidManifest.xml
  2. 5 0
      app/src/main/java/com/tongyu/luck/happywork/http/Api.java
  3. 13 0
      app/src/main/java/com/tongyu/luck/happywork/http/subscribe/LoginSubscribe.java
  4. 17 3
      app/src/main/java/com/tongyu/luck/happywork/ui/activity/cclient/mine/AccountSafeActivity.java
  5. 186 0
      app/src/main/java/com/tongyu/luck/happywork/ui/activity/cclient/mine/EditPhoneNumActivity.java
  6. 6 0
      app/src/main/java/com/tongyu/luck/happywork/ui/mvp/cclient/contacts/AccountSafeContacts.java
  7. 33 0
      app/src/main/java/com/tongyu/luck/happywork/ui/mvp/cclient/contacts/EditPhoneNumContacts.java
  8. 9 0
      app/src/main/java/com/tongyu/luck/happywork/ui/mvp/cclient/model/AccountSafeModel.java
  9. 53 0
      app/src/main/java/com/tongyu/luck/happywork/ui/mvp/cclient/model/EditPhoneNumModel.java
  10. 7 0
      app/src/main/java/com/tongyu/luck/happywork/ui/mvp/cclient/presenter/AccountSafePresenter.java
  11. 98 0
      app/src/main/java/com/tongyu/luck/happywork/ui/mvp/cclient/presenter/EditPhoneNumPresenter.java
  12. 1 1
      app/src/main/res/drawable/circle_gray.xml
  13. 5 0
      app/src/main/res/drawable/corners_stroke_blue_00.xml
  14. 164 0
      app/src/main/res/layout/activity_edit_phone_num.xml
  15. BIN
      app/src/main/res/mipmap-hdpi/ic_et_delete.png
  16. BIN
      app/src/main/res/mipmap-hdpi/ic_phone_num_edit.png
  17. BIN
      app/src/main/res/mipmap-xhdpi/ic_et_delete.png
  18. BIN
      app/src/main/res/mipmap-xhdpi/ic_phone_num_edit.png
  19. BIN
      app/src/main/res/mipmap-xxhdpi/ic_et_delete.png
  20. BIN
      app/src/main/res/mipmap-xxhdpi/ic_phone_num_edit.png
  21. BIN
      app/src/main/res/mipmap-xxxhdpi/ic_et_delete.png
  22. BIN
      app/src/main/res/mipmap-xxxhdpi/ic_phone_num_edit.png
  23. 1 1
      app/src/main/res/values/colors.xml
  24. 7 0
      app/src/main/res/values/strings.xml

+ 3 - 0
app/src/main/AndroidManifest.xml

@@ -254,6 +254,9 @@
             android:name=".ui.activity.cclient.mine.AccountSafeActivity"
             android:screenOrientation="portrait" />
         <activity
+            android:name=".ui.activity.cclient.mine.EditPhoneNumActivity"
+            android:screenOrientation="portrait" />
+        <activity
             android:name=".ui.activity.MsgVerifyActivity"
             android:screenOrientation="portrait" />
         <activity

+ 5 - 0
app/src/main/java/com/tongyu/luck/happywork/http/Api.java

@@ -115,6 +115,11 @@ public class Api {
         //注销登录
         @POST("f/api/login/logout_new")
         Observable<ApiResultBean<ApiNormalBean>> logoutNew(@Body Map<String, Object> args);
+
+        //修改手机号
+        @POST("f/api/login/editUserPhone")
+        Observable<ApiResultBean<ApiNormalBean>> editUserPhone(@Body Map<String, Object> args);
+
     }
 
     public interface PositionInterface {

+ 13 - 0
app/src/main/java/com/tongyu/luck/happywork/http/subscribe/LoginSubscribe.java

@@ -133,4 +133,17 @@ public class LoginSubscribe extends BaseSubscribe {
         Observable<ApiResultBean<ApiNormalBean>> observable = apiService.logoutNew(params);
         subscribe(observable, mObservable);
     }
+
+    /**
+     * 修改用户手机号
+     *
+     * @param mObservable
+     */
+    public void requestEditUserPhone(Map<String, Object> params, ApiObserver<ApiNormalBean> mObservable) {
+        Api.LoginInterface apiService = ServiceGenerator.createService(Api.LoginInterface.class);
+        Observable<ApiResultBean<ApiNormalBean>> observable = apiService.editUserPhone(params);
+        subscribe(observable, mObservable);
+    }
+
+
 }

+ 17 - 3
app/src/main/java/com/tongyu/luck/happywork/ui/activity/cclient/mine/AccountSafeActivity.java

@@ -2,14 +2,13 @@ package com.tongyu.luck.happywork.ui.activity.cclient.mine;
 
 import android.content.Intent;
 import android.os.Bundle;
+import android.text.TextUtils;
 import android.view.View;
 import android.widget.LinearLayout;
 import android.widget.TextView;
 
-import com.tongyu.luck.happywork.MyApplication;
+import com.tongyu.luck.happywork.AppCacheManager;
 import com.tongyu.luck.happywork.R;
-import com.tongyu.luck.happywork.baselibrary.IntentConstant;
-import com.tongyu.luck.happywork.ui.activity.cclient.CMainActivity;
 import com.tongyu.luck.happywork.ui.base.BaseActivity;
 import com.tongyu.luck.happywork.ui.mvp.cclient.contacts.AccountSafeContacts;
 import com.tongyu.luck.happywork.ui.mvp.cclient.presenter.AccountSafePresenter;
@@ -40,6 +39,7 @@ public class AccountSafeActivity extends BaseActivity<AccountSafePresenter> impl
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setTitle(R.string.mine_account_safe);
+        mvpPresenter.getPhoneNum();
     }
 
     @OnClick({R.id.ll_cancellation_account, R.id.ll_phone})
@@ -56,7 +56,21 @@ public class AccountSafeActivity extends BaseActivity<AccountSafePresenter> impl
                 }).show();
                 break;
             case R.id.ll_phone:
+                startActivity(new Intent(mContext, EditPhoneNumActivity.class));
                 break;
         }
     }
+
+    @Override
+    public void onPhoneNum(String phoneNum) {
+        if (!TextUtils.isEmpty(AppCacheManager.getInstance().getMemberModel().getPhone())) {
+            if (AppCacheManager.getInstance().getMemberModel().getPhone().length() > 7) {
+                tvSettingPhone.setText(AppCacheManager.getInstance().getMemberModel().getPhone().substring(0, 3) + " " + AppCacheManager.getInstance().getMemberModel().getPhone().substring(3, 7) + " " + AppCacheManager.getInstance().getMemberModel().getPhone().substring(7));
+            } else {
+                tvSettingPhone.setText(AppCacheManager.getInstance().getMemberModel().getPhone());
+            }
+        } else {
+            tvSettingPhone.setText("");
+        }
+    }
 }

+ 186 - 0
app/src/main/java/com/tongyu/luck/happywork/ui/activity/cclient/mine/EditPhoneNumActivity.java

@@ -0,0 +1,186 @@
+package com.tongyu.luck.happywork.ui.activity.cclient.mine;
+
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.text.TextUtils;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+import com.tongyu.luck.happywork.AppCacheManager;
+import com.tongyu.luck.happywork.R;
+import com.tongyu.luck.happywork.baselibrary.utils.InputManagerUtils;
+import com.tongyu.luck.happywork.ui.base.BaseActivity;
+import com.tongyu.luck.happywork.ui.mvp.cclient.contacts.EditPhoneNumContacts;
+import com.tongyu.luck.happywork.ui.mvp.cclient.presenter.EditPhoneNumPresenter;
+import com.tongyu.luck.happywork.ui.widget.dialog.WebVerifyDialog;
+
+import java.util.concurrent.TimeUnit;
+
+import butterknife.BindView;
+import butterknife.OnClick;
+import butterknife.OnFocusChange;
+import butterknife.OnTextChanged;
+import io.reactivex.Observable;
+import io.reactivex.Observer;
+import io.reactivex.android.schedulers.AndroidSchedulers;
+import io.reactivex.disposables.Disposable;
+import io.reactivex.functions.Consumer;
+import io.reactivex.functions.Function;
+
+public class EditPhoneNumActivity extends BaseActivity<EditPhoneNumPresenter> implements EditPhoneNumContacts.IEditPhoneNumView {
+    @BindView(R.id.tv_phone_num_now)
+    TextView tvPhoneNumNow;
+    @BindView(R.id.et_phone_num)
+    EditText etPhoneNum;
+    @BindView(R.id.et_code)
+    EditText etCode;
+    @BindView(R.id.tv_code)
+    TextView tvCode;
+    @BindView(R.id.btn_change)
+    Button btnChange;
+    @BindView(R.id.rl_delete)
+    RelativeLayout rlDelete;
+
+    WebVerifyDialog dialog;
+    boolean isCountDown;
+
+    @Override
+    public int getLayoutId() {
+        return R.layout.activity_edit_phone_num;
+    }
+
+    @Override
+    public EditPhoneNumPresenter bindPresenter() {
+        return new EditPhoneNumPresenter(this);
+    }
+
+    @Override
+    protected void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setTitle(R.string.mine_edit_phone_num);
+        mvpPresenter.init();
+    }
+
+    @OnTextChanged({R.id.et_phone_num, R.id.et_code})
+    public void onTextChanged(CharSequence s, int start, int before, int count) {
+        if (mvpPresenter.isPhone(etPhoneNum.getText().toString(), false) && mvpPresenter.isCode(etCode.getText().toString(), false)) {
+            btnChange.setEnabled(true);
+        } else {
+            btnChange.setEnabled(false);
+        }
+    }
+
+    @OnClick({R.id.rl_delete, R.id.tv_code, R.id.btn_change})
+    public void onClick(View view) {
+        switch (view.getId()) {
+            case R.id.rl_delete:
+                etPhoneNum.setText("");
+                break;
+            case R.id.btn_change:
+                mvpPresenter.editPhoneNum(etPhoneNum.getText().toString(), etCode.getText().toString());
+                break;
+            case R.id.tv_code:
+                mvpPresenter.getCode(etPhoneNum.getText().toString());
+                break;
+        }
+    }
+
+    @OnFocusChange(R.id.et_phone_num)
+    public void onFocusChange(View v, boolean hasFocus) {
+        if (hasFocus) {
+            rlDelete.setVisibility(View.VISIBLE);
+        } else {
+            rlDelete.setVisibility(View.GONE);
+        }
+    }
+
+    @Override
+    public void onWebDialog(String phoneNum) {
+        if (dialog == null) {
+            dialog = new WebVerifyDialog(mContext, phoneNum);
+            dialog.setOnVerifyListener(onVerifyListener);
+        }
+        dialog.initData(phoneNum);
+        dialog.show();
+    }
+
+    /**
+     * 显示当前手机号
+     *
+     * @param phoneNum
+     */
+    @Override
+    public void onPhoneNumNow(String phoneNum) {
+        if (!TextUtils.isEmpty(AppCacheManager.getInstance().getMemberModel().getPhone())) {
+            if (AppCacheManager.getInstance().getMemberModel().getPhone().length() > 7) {
+                tvPhoneNumNow.setText(AppCacheManager.getInstance().getMemberModel().getPhone().substring(0, 3) + " **** " + AppCacheManager.getInstance().getMemberModel().getPhone().substring(7));
+            } else {
+                tvPhoneNumNow.setText(AppCacheManager.getInstance().getMemberModel().getPhone());
+            }
+        } else {
+            tvPhoneNumNow.setText("");
+        }
+    }
+
+    /**
+     * 验证码倒计时
+     */
+    @Override
+    public void countDown() {
+        final int count = 60;
+        Observable.interval(0, 1, TimeUnit.SECONDS)
+                .take(count)
+                .map(new Function<Long, Long>() {
+                    @Override
+                    public Long apply(Long aLong) throws Exception {
+                        return count - aLong;
+                    }
+                })
+                .subscribeOn(AndroidSchedulers.mainThread())
+                .observeOn(AndroidSchedulers.mainThread())//ui线程中进行控件更新
+                .doOnSubscribe(new Consumer<Disposable>() {
+                    @Override
+                    public void accept(Disposable disposable) throws Exception {
+                        InputManagerUtils.showInput(EditPhoneNumActivity.this, etCode);
+                        tvCode.setEnabled(false);
+                        isCountDown = true;
+                    }
+                }).subscribe(new Observer<Long>() {
+            @Override
+            public void onSubscribe(Disposable d) {
+
+            }
+
+            @Override
+            public void onNext(Long num) {
+                tvCode.setText(num + "s");
+            }
+
+            @Override
+            public void onError(Throwable e) {
+
+            }
+
+            @Override
+            public void onComplete() {
+                //回复原来初始状态
+                isCountDown = false;
+                tvCode.setEnabled(true);
+                tvCode.setText("重新获取验证码");
+            }
+        });
+    }
+
+    /**
+     * 人工验证回调
+     */
+    WebVerifyDialog.OnVerifyListener onVerifyListener = new WebVerifyDialog.OnVerifyListener() {
+        @Override
+        public void onSuccess() {
+            countDown();
+        }
+    };
+}

+ 6 - 0
app/src/main/java/com/tongyu/luck/happywork/ui/mvp/cclient/contacts/AccountSafeContacts.java

@@ -6,13 +6,19 @@ import com.tongyu.luck.happywork.ui.base.IView;
 
 public class AccountSafeContacts {
     public interface IAccountSafeView extends IView {
+
+        void onPhoneNum(String phoneNum);
     }
 
     public interface IAccountSafePresenter extends IPresenter {
         void logoutNew();
+
+        void getPhoneNum();
     }
 
     public interface IAccountSafeModel {
         void httpLogoutNew(MvpDataCallBack<Boolean> callBack);
+
+        String getPhoneNum();
     }
 }

+ 33 - 0
app/src/main/java/com/tongyu/luck/happywork/ui/mvp/cclient/contacts/EditPhoneNumContacts.java

@@ -0,0 +1,33 @@
+package com.tongyu.luck.happywork.ui.mvp.cclient.contacts;
+
+import com.tongyu.luck.happywork.callback.MvpDataCallBack;
+import com.tongyu.luck.happywork.ui.base.IPresenter;
+import com.tongyu.luck.happywork.ui.base.IView;
+
+public class EditPhoneNumContacts {
+    public interface IEditPhoneNumView extends IView {
+        void countDown();
+
+        void onWebDialog(String phoneNum);
+
+        void onPhoneNumNow(String phoneNum);
+    }
+
+    public interface IEditPhoneNumPresenter extends IPresenter {
+        void init();
+
+        boolean isPhone(String phoneNum, boolean isToast);
+
+        boolean isCode(String code, boolean isToast);
+
+        void getCode(String phoneNum);
+
+        void editPhoneNum(String phoneNum, String code);
+    }
+
+    public interface IEditPhoneNumModel {
+        String getPhoneNum();
+
+        void httpEditPhoneNum(String phoneNum, String code, MvpDataCallBack<Boolean> callBack);
+    }
+}

+ 9 - 0
app/src/main/java/com/tongyu/luck/happywork/ui/mvp/cclient/model/AccountSafeModel.java

@@ -1,7 +1,9 @@
 package com.tongyu.luck.happywork.ui.mvp.cclient.model;
 
 import android.content.Context;
+import android.text.TextUtils;
 
+import com.tongyu.luck.happywork.AppCacheManager;
 import com.tongyu.luck.happywork.bean.api.ApiNormalBean;
 import com.tongyu.luck.happywork.callback.MvpDataCallBack;
 import com.tongyu.luck.happywork.http.ApiObserver;
@@ -36,4 +38,11 @@ public class AccountSafeModel extends BaseModel implements AccountSafeContacts.I
             }
         });
     }
+
+    @Override
+    public String getPhoneNum() {
+        if (AppCacheManager.getInstance().getMemberModel() != null && !TextUtils.isEmpty(AppCacheManager.getInstance().getMemberModel().getPhone()))
+            return AppCacheManager.getInstance().getMemberModel().getPhone();
+        return "";
+    }
 }

+ 53 - 0
app/src/main/java/com/tongyu/luck/happywork/ui/mvp/cclient/model/EditPhoneNumModel.java

@@ -0,0 +1,53 @@
+package com.tongyu.luck.happywork.ui.mvp.cclient.model;
+
+import android.content.Context;
+import android.text.TextUtils;
+
+import com.tongyu.luck.happywork.AppCacheManager;
+import com.tongyu.luck.happywork.bean.api.ApiNormalBean;
+import com.tongyu.luck.happywork.callback.MvpDataCallBack;
+import com.tongyu.luck.happywork.http.ApiObserver;
+import com.tongyu.luck.happywork.http.RetrofitHttpParams;
+import com.tongyu.luck.happywork.http.subscribe.LoginSubscribe;
+import com.tongyu.luck.happywork.ui.base.BaseModel;
+import com.tongyu.luck.happywork.ui.mvp.cclient.contacts.EditPhoneNumContacts;
+
+public class EditPhoneNumModel extends BaseModel implements EditPhoneNumContacts.IEditPhoneNumModel {
+    public EditPhoneNumModel(Context mContext) {
+        super(mContext);
+    }
+
+    @Override
+    public String getPhoneNum() {
+        if (AppCacheManager.getInstance().getMemberModel() != null && !TextUtils.isEmpty(AppCacheManager.getInstance().getMemberModel().getPhone()))
+            return AppCacheManager.getInstance().getMemberModel().getPhone();
+        return "";
+    }
+
+    /**
+     * 修改
+     *
+     * @param phoneNum
+     * @param code
+     */
+    @Override
+    public void httpEditPhoneNum(String phoneNum, String code, final MvpDataCallBack<Boolean> callBack) {
+        RetrofitHttpParams params = new RetrofitHttpParams(mContext);
+        params.put("new_phone", phoneNum);
+        if (TextUtils.isEmpty(code)) {
+            params.put("type", "check_phone");
+        } else {
+            params.put("code", code);
+        }
+        new LoginSubscribe(mContext).requestEditUserPhone(params.getRequestParams(), new ApiObserver<ApiNormalBean>(mContext, true) {
+            @Override
+            public void onSuccess(ApiNormalBean data) {
+                callBack.onData(true);
+            }
+
+            @Override
+            public void onFinish() {
+            }
+        });
+    }
+}

+ 7 - 0
app/src/main/java/com/tongyu/luck/happywork/ui/mvp/cclient/presenter/AccountSafePresenter.java

@@ -33,9 +33,16 @@ public class AccountSafePresenter extends BasePresenter<AccountSafeActivity> imp
                         Intent intent = new Intent(mvpReference.get(), CMainActivity.class);
                         intent.putExtra(IntentConstant.BOOLEAN, true);//表示直接打开登录页面
                         mvpReference.get().startActivity(intent);
+                        mvpReference.get().finish();
                     }
                 }
             });
         }
     }
+
+    @Override
+    public void getPhoneNum() {
+        if (isViewAttach())
+            mvpReference.get().onPhoneNum(mAccountSafeModel.getPhoneNum());
+    }
 }

+ 98 - 0
app/src/main/java/com/tongyu/luck/happywork/ui/mvp/cclient/presenter/EditPhoneNumPresenter.java

@@ -0,0 +1,98 @@
+package com.tongyu.luck.happywork.ui.mvp.cclient.presenter;
+
+import android.text.TextUtils;
+import android.widget.Toast;
+
+import com.tongyu.luck.happywork.R;
+import com.tongyu.luck.happywork.callback.MvpDataCallBack;
+import com.tongyu.luck.happywork.ui.activity.cclient.mine.EditPhoneNumActivity;
+import com.tongyu.luck.happywork.ui.base.BasePresenter;
+import com.tongyu.luck.happywork.ui.mvp.cclient.contacts.EditPhoneNumContacts;
+import com.tongyu.luck.happywork.ui.mvp.cclient.model.EditPhoneNumModel;
+
+public class EditPhoneNumPresenter extends BasePresenter<EditPhoneNumActivity> implements EditPhoneNumContacts.IEditPhoneNumPresenter {
+    private EditPhoneNumModel mEditPhoneNumModel;
+
+    public EditPhoneNumPresenter(EditPhoneNumActivity view) {
+        super(view);
+        this.mEditPhoneNumModel = new EditPhoneNumModel(mvpReference.get());
+    }
+
+    @Override
+    public void init() {
+        if (isViewAttach())
+            mvpReference.get().onPhoneNumNow(mEditPhoneNumModel.getPhoneNum());
+    }
+
+    /**
+     * 判断手机号合法性
+     *
+     * @param phoneNum
+     * @return
+     */
+    @Override
+    public boolean isPhone(String phoneNum, boolean isToast) {
+        if (isViewAttach()) {
+            if (!TextUtils.isEmpty(phoneNum) && phoneNum.length() == 11) {
+                return true;
+            }
+            if (isToast)
+                Toast.makeText(mvpReference.get(), R.string.please_input_phone_num, Toast.LENGTH_SHORT).show();
+        }
+        return false;
+    }
+
+    /**
+     * 判断验证码的合法性
+     *
+     * @param code
+     * @return
+     */
+    @Override
+    public boolean isCode(String code, boolean isToast) {
+        if (isViewAttach()) {
+            if (!TextUtils.isEmpty(code)) {
+                return true;
+            }
+            if (isToast)
+                Toast.makeText(mvpReference.get(), R.string.please_input_code, Toast.LENGTH_SHORT).show();
+        }
+        return false;
+    }
+
+    /**
+     * 获取验证码
+     *
+     * @param phoneNum
+     */
+    @Override
+    public void getCode(final String phoneNum) {
+        if (isViewAttach() && isPhone(phoneNum, true)) {
+            mEditPhoneNumModel.httpEditPhoneNum(phoneNum, null, new MvpDataCallBack<Boolean>() {
+                @Override
+                public void onData(Boolean data) {
+                    mvpReference.get().onWebDialog(phoneNum);
+                }
+            });
+        }
+    }
+
+    /**
+     * @param phoneNum
+     * @param code
+     */
+    @Override
+    public void editPhoneNum(String phoneNum, String code) {
+        if (isViewAttach()) {
+            if (isViewAttach() && isPhone(phoneNum, true) && isCode(code, true)) {
+                mEditPhoneNumModel.httpEditPhoneNum(phoneNum, code, new MvpDataCallBack<Boolean>() {
+                    @Override
+                    public void onData(Boolean data) {
+
+                    }
+                });
+            }
+        }
+    }
+
+}

+ 1 - 1
app/src/main/res/drawable/circle_gray.xml

@@ -2,6 +2,6 @@
 <shape xmlns:android="http://schemas.android.com/apk/res/android"
     android:shape="oval">
         
-    <solid android:color="@color/red" />
+    <solid android:color="@color/text_gray_cc" />
 
 </shape>

+ 5 - 0
app/src/main/res/drawable/corners_stroke_blue_00.xml

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

+ 164 - 0
app/src/main/res/layout/activity_edit_phone_num.xml

@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@color/gray_bg"
+    android:orientation="vertical">
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="42dp"
+        android:layout_marginTop="44dp"
+        android:gravity="center"
+        android:orientation="vertical">
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/now_binding_account"
+            android:textColor="@color/black"
+            android:textSize="@dimen/px39_13sp" />
+
+        <TextView
+            android:id="@+id/tv_phone_num_now"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="181 *** 8872"
+            android:textColor="@color/black"
+            android:textSize="@dimen/px54_18sp"
+            android:textStyle="bold" />
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="48dp"
+        android:layout_marginLeft="29dp"
+        android:layout_marginTop="43dp"
+        android:layout_marginRight="29dp"
+        android:background="@drawable/corners_white_5dp"
+        android:gravity="center_vertical"
+        android:orientation="horizontal">
+
+        <TextView
+            android:layout_width="48dp"
+            android:layout_height="match_parent"
+            android:gravity="center"
+            android:text="+86"
+            android:textColor="@color/black"
+            android:textSize="@dimen/px39_13sp" />
+
+        <View
+            android:layout_width="1dp"
+            android:layout_height="20dp"
+            android:background="@color/text_gray_cc" />
+
+        <EditText
+            android:id="@+id/et_phone_num"
+            android:layout_width="0dp"
+            android:layout_weight="1"
+            android:layout_height="match_parent"
+            android:layout_marginLeft="12dp"
+            android:background="@color/transparent"
+            android:hint="@string/please_input_new_phone_num"
+            android:inputType="number"
+            android:maxLength="11"
+            android:textColor="@color/black"
+            android:textColorHint="@color/text_gray_aa"
+            android:textSize="@dimen/px45_15sp" />
+
+        <RelativeLayout
+            android:id="@+id/rl_delete"
+            android:layout_width="32dp"
+            android:layout_height="match_parent">
+            <View
+                android:layout_centerInParent="true"
+                android:layout_width="12dp"
+                android:layout_height="12dp"
+                android:background="@mipmap/ic_et_delete"/>
+        </RelativeLayout>
+
+
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="48dp"
+        android:layout_marginLeft="29dp"
+        android:layout_marginTop="19dp"
+        android:layout_marginRight="29dp"
+        android:background="@drawable/corners_white_5dp"
+        android:gravity="center_vertical"
+        android:orientation="horizontal">
+
+        <View
+            android:layout_width="13dp"
+            android:layout_height="17dp"
+            android:layout_marginLeft="18dp"
+            android:layout_marginRight="17dp"
+            android:background="@mipmap/ic_phone_num_edit" />
+
+        <View
+            android:layout_width="1dp"
+            android:layout_height="20dp"
+            android:background="@color/text_gray_cc" />
+
+        <EditText
+            android:id="@+id/et_code"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:layout_marginLeft="12dp"
+            android:layout_weight="1"
+            android:background="@color/transparent"
+            android:hint="@string/please_input_code"
+            android:inputType="number"
+            android:maxLength="11"
+            android:textColor="@color/black"
+            android:textColorHint="@color/text_gray_aa"
+            android:textSize="@dimen/px45_15sp" />
+
+        <TextView
+            android:id="@+id/tv_code"
+            android:layout_width="68dp"
+            android:layout_height="20dp"
+            android:layout_marginRight="10dp"
+            android:background="@drawable/corners_stroke_blue_00"
+            android:gravity="center"
+            android:text="@string/get_code2"
+            android:textColor="@color/blue_00"
+            android:textSize="@dimen/px36_12sp" />
+
+    </LinearLayout>
+
+    <TextView
+        android:layout_width="match_parent"
+        android:layout_height="16dp"
+        android:layout_marginTop="14dp"
+        android:gravity="center"
+        android:text="@string/get_code_tips"
+        android:textColor="@color/text_dark_gray"
+        android:textSize="@dimen/px36_12sp" />
+
+    <Button
+        android:id="@+id/btn_change"
+        android:layout_width="match_parent"
+        android:layout_height="42dp"
+        android:layout_gravity="center_horizontal"
+        android:layout_marginLeft="14dp"
+        android:layout_marginTop="38dp"
+        android:layout_marginRight="14dp"
+        android:background="@drawable/corners_blue_btn_5dp"
+        android:enabled="false"
+        android:text="@string/sure_change_phone_num"
+        android:textColor="@color/white"
+        android:textSize="@dimen/px48_16sp" />
+
+    <TextView
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="14dp"
+        android:gravity="center"
+        android:lineSpacingExtra="3dp"
+        android:text="@string/edit_phone_num_tips"
+        android:textColor="@color/text_dark_gray"
+        android:textSize="@dimen/px36_12sp" />
+</LinearLayout>

BIN
app/src/main/res/mipmap-hdpi/ic_et_delete.png


BIN
app/src/main/res/mipmap-hdpi/ic_phone_num_edit.png


BIN
app/src/main/res/mipmap-xhdpi/ic_et_delete.png


BIN
app/src/main/res/mipmap-xhdpi/ic_phone_num_edit.png


BIN
app/src/main/res/mipmap-xxhdpi/ic_et_delete.png


BIN
app/src/main/res/mipmap-xxhdpi/ic_phone_num_edit.png


BIN
app/src/main/res/mipmap-xxxhdpi/ic_et_delete.png


BIN
app/src/main/res/mipmap-xxxhdpi/ic_phone_num_edit.png


+ 1 - 1
app/src/main/res/values/colors.xml

@@ -62,7 +62,7 @@
     <color name="gray_dark">#BBBBBB</color>
     <color name="gray_light">#FAFAFA</color>
     <color name="gray_bg">#f5f5f5</color>
-    <color name="red">#cccccc</color>
+    <color name="text_gray_cc">#cccccc</color>
     <color name="view_line_color">#dddddd</color>
     <color name="view_line_color_gray">#eeeeee</color>
     <color name="main_tab_bg">#FAFAFA</color>

+ 7 - 0
app/src/main/res/values/strings.xml

@@ -148,6 +148,12 @@
     <string name="no_wx_app">尚未安装微信客户端,请下载安装</string>
     <string name="no_sd_card">无sd卡</string>
     <string name="get_code">获取短信验证码</string>
+    <string name="get_code2">获取验证码</string>
+    <string name="edit_phone_num_tips">修改手机号后,可以使用新手机号登录开心工作\n使用原有手机号则作为新用户登录</string>
+    <string name="sure_change_phone_num">确认更改手机号码</string>
+    <string name="now_binding_account">当前绑定账号</string>
+    <string name="get_code_tips">长时间收不到验证码,可尝试再次获取验证码</string>
+    <string name="please_input_new_phone_num">请输入新手机号码</string>
     <string name="please_choose_province">请选择省</string>
     <string name="please_choose_city">请选择城市</string>
     <string name="please_choose_area">请选择地区</string>
@@ -598,6 +604,7 @@
     <string name="mine_privacy_tips">隐私协议</string>
     <string name="mine_cancellation_account">注销账户</string>
     <string name="mine_account_safe">账户与安全</string>
+    <string name="mine_edit_phone_num">修改手机号</string>
     <string name="mine_business_cooperation">商务合作</string>
     <string name="mine_setting_get_new_msg">接收新消息通知</string>
     <string name="mine_setting_clear_cache">清除缓存</string>