소스 검색

1.B端简历去掉微信号
2.完成修改手机号功能

wsad5123 5 년 전
부모
커밋
c744654530

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

@@ -9,11 +9,15 @@ import android.widget.TextView;
 
 import com.tongyu.luck.happywork.AppCacheManager;
 import com.tongyu.luck.happywork.R;
+import com.tongyu.luck.happywork.baselibrary.EventConstant;
+import com.tongyu.luck.happywork.event.StringEvent;
 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;
 import com.tongyu.luck.happywork.ui.widget.dialog.SureDialog;
 
+import org.greenrobot.eventbus.Subscribe;
+
 import butterknife.BindView;
 import butterknife.OnClick;
 
@@ -73,4 +77,11 @@ public class AccountSafeActivity extends BaseActivity<AccountSafePresenter> impl
             tvSettingPhone.setText("");
         }
     }
+
+    @Subscribe
+    public void onEvent(StringEvent event) {
+        if (event.getData().equals(EventConstant.EVENT_USER_CHANGE)) {//当用户信息发生改变
+            mvpPresenter.getPhoneNum();
+        }
+    }
 }

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

@@ -169,7 +169,7 @@ public class EditPhoneNumActivity extends BaseActivity<EditPhoneNumPresenter> im
                 //回复原来初始状态
                 isCountDown = false;
                 tvCode.setEnabled(true);
-                tvCode.setText("重新获取验证码");
+                tvCode.setText(R.string.get_code2);
             }
         });
     }

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

@@ -4,14 +4,18 @@ import android.content.Context;
 import android.text.TextUtils;
 
 import com.tongyu.luck.happywork.AppCacheManager;
+import com.tongyu.luck.happywork.baselibrary.EventConstant;
 import com.tongyu.luck.happywork.bean.api.ApiNormalBean;
 import com.tongyu.luck.happywork.callback.MvpDataCallBack;
+import com.tongyu.luck.happywork.event.StringEvent;
 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;
 
+import org.greenrobot.eventbus.EventBus;
+
 public class EditPhoneNumModel extends BaseModel implements EditPhoneNumContacts.IEditPhoneNumModel {
     public EditPhoneNumModel(Context mContext) {
         super(mContext);
@@ -31,7 +35,7 @@ public class EditPhoneNumModel extends BaseModel implements EditPhoneNumContacts
      * @param code
      */
     @Override
-    public void httpEditPhoneNum(String phoneNum, String code, final MvpDataCallBack<Boolean> callBack) {
+    public void httpEditPhoneNum(final String phoneNum, final String code, final MvpDataCallBack<Boolean> callBack) {
         RetrofitHttpParams params = new RetrofitHttpParams(mContext);
         params.put("new_phone", phoneNum);
         if (TextUtils.isEmpty(code)) {
@@ -42,6 +46,11 @@ public class EditPhoneNumModel extends BaseModel implements EditPhoneNumContacts
         new LoginSubscribe(mContext).requestEditUserPhone(params.getRequestParams(), new ApiObserver<ApiNormalBean>(mContext, true) {
             @Override
             public void onSuccess(ApiNormalBean data) {
+                if (!TextUtils.isEmpty(code)) {//修改手机号
+                    AppCacheManager.getInstance().getMemberModel().setPhone(phoneNum + "");
+                    AppCacheManager.getInstance().setMemberModel(AppCacheManager.getInstance().getMemberModel());//刷新本地缓存数据更新状态
+                    EventBus.getDefault().post(new StringEvent(EventConstant.EVENT_USER_CHANGE));
+                }
                 callBack.onData(true);
             }
 

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

@@ -4,6 +4,7 @@ import android.text.TextUtils;
 import android.widget.Toast;
 
 import com.tongyu.luck.happywork.R;
+import com.tongyu.luck.happywork.baselibrary.utils.ToastUtils;
 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;
@@ -88,7 +89,8 @@ public class EditPhoneNumPresenter extends BasePresenter<EditPhoneNumActivity> i
                 mEditPhoneNumModel.httpEditPhoneNum(phoneNum, code, new MvpDataCallBack<Boolean>() {
                     @Override
                     public void onData(Boolean data) {
-
+                        ToastUtils.show(mvpReference.get(), R.string.mine_edit_success);
+                        mvpReference.get().finish();
                     }
                 });
             }

+ 2 - 0
app/src/main/res/layout/activity_resume_detail.xml

@@ -119,12 +119,14 @@
                     <View
                         android:layout_width="match_parent"
                         android:layout_height="1dp"
+                        android:visibility="gone"
                         android:background="@color/view_line_color_gray" />
 
                     <LinearLayout
                         android:layout_width="match_parent"
                         android:layout_height="56dp"
                         android:gravity="center_vertical"
+                        android:visibility="gone"
                         android:orientation="horizontal">
 
                         <TextView

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

@@ -735,6 +735,7 @@
     <string name="mine_salary_back_yes_tips">您将确认入职奖励正确无误,预计在您确认3个工作日内我们会将奖励发放至您的银行账户中。</string>
     <string name="mine_salary_query_tips">仅提供最近两个月的工资条信息,例如9月可以查看8月和7月的工资信息。</string>
     <string name="mine_salary_query_title">工资条仅作参考,实际以企业发放为准</string>
+    <string name="mine_edit_success">手机号修改已完成</string>
 
 
     <string name="me_no_authentication">未认证</string>