|
@@ -41,6 +41,7 @@ import javax.inject.Inject;
|
|
|
import butterknife.BindView;
|
|
import butterknife.BindView;
|
|
|
import butterknife.OnClick;
|
|
import butterknife.OnClick;
|
|
|
import rx.android.schedulers.AndroidSchedulers;
|
|
import rx.android.schedulers.AndroidSchedulers;
|
|
|
|
|
+import rx.functions.Action1;
|
|
|
import rx.schedulers.Schedulers;
|
|
import rx.schedulers.Schedulers;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -151,6 +152,20 @@ public class RealNameAuthenAct extends BaseActivity implements RealNameAutherCon
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
EventBus.getDefault().post(change);
|
|
EventBus.getDefault().post(change);
|
|
|
|
|
+ updateUserInfo(new Action1<BaseMessage>(){
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void call(BaseMessage s) {
|
|
|
|
|
+ if(s != null)
|
|
|
|
|
+ if (whereFrom == 1) {
|
|
|
|
|
+ Jump2View.getInstance().goWithdrawal(RealNameAuthenAct.this, 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ finish();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private void updateUserInfo(final Action1<BaseMessage> action1) {
|
|
|
SheepApp.get(RealNameAuthenAct.this)
|
|
SheepApp.get(RealNameAuthenAct.this)
|
|
|
.getNetComponent()
|
|
.getNetComponent()
|
|
|
.getApiService()
|
|
.getApiService()
|
|
@@ -161,22 +176,24 @@ public class RealNameAuthenAct extends BaseActivity implements RealNameAutherCon
|
|
|
@Override
|
|
@Override
|
|
|
public void onError(BaseMessage baseMessage) {
|
|
public void onError(BaseMessage baseMessage) {
|
|
|
G.showToast(baseMessage.getMsg() + "");
|
|
G.showToast(baseMessage.getMsg() + "");
|
|
|
- finish();
|
|
|
|
|
|
|
+ if(action1 != null)
|
|
|
|
|
+ action1.call(null);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void onNext(BaseMessage baseMessage) {
|
|
public void onNext(BaseMessage baseMessage) {
|
|
|
UserEntity userEntity = JSON.parseObject(JSONObject.toJSONString(baseMessage.getData()), UserEntity.class);
|
|
UserEntity userEntity = JSON.parseObject(JSONObject.toJSONString(baseMessage.getData()), UserEntity.class);
|
|
|
- try {
|
|
|
|
|
- MyDbManager.getInstance().saveOrUpdateUser(userEntity);
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
- if (whereFrom == 1) {
|
|
|
|
|
- Jump2View.getInstance().goWithdrawal(RealNameAuthenAct.this, 1);
|
|
|
|
|
|
|
+ if(userEntity != null) {
|
|
|
|
|
+ mEntity = userEntity;
|
|
|
|
|
+ try {
|
|
|
|
|
+ MyDbManager.getInstance().saveOrUpdateUser(userEntity);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- finish();
|
|
|
|
|
|
|
+ if(action1 != null)
|
|
|
|
|
+ action1.call(baseMessage);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
@@ -184,6 +201,7 @@ public class RealNameAuthenAct extends BaseActivity implements RealNameAutherCon
|
|
|
@Override
|
|
@Override
|
|
|
public void NetError(int code, String errorMsg) {
|
|
public void NetError(int code, String errorMsg) {
|
|
|
hideProgress();
|
|
hideProgress();
|
|
|
|
|
+ updateUserInfo(null);
|
|
|
G.showToast(errorMsg);
|
|
G.showToast(errorMsg);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -215,15 +233,8 @@ public class RealNameAuthenAct extends BaseActivity implements RealNameAutherCon
|
|
|
G.showToast(R.string.unknown_error);
|
|
G.showToast(R.string.unknown_error);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- ViewUtil.showMsgDialog(this, new DialogConfig().setTitle("重要提示").setMsgMore(String.format(Locale.CHINA,"你已执行%d次实名认证操作",mEntity.getCertification_count()))
|
|
|
|
|
- .setMsg("实名认证首次免费。请务必确认您所提交的认证信息真实有效。若因信息填写错误造成认证失败。再次申请认证时需扣除您0.5元绵阳币作为认证费用,请务必谨慎填写认证信息。")
|
|
|
|
|
- .setBtnLeftText("返回修改").setBtnRightText("确认提交")
|
|
|
|
|
- .setBtnRightOnClickListener(new View.OnClickListener() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onClick(View view) {
|
|
|
|
|
- toNext();
|
|
|
|
|
- }
|
|
|
|
|
- }));
|
|
|
|
|
|
|
+ map.clear();
|
|
|
|
|
+ toNext();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void toNext() {
|
|
public void toNext() {
|
|
@@ -265,8 +276,16 @@ public class RealNameAuthenAct extends BaseActivity implements RealNameAutherCon
|
|
|
}
|
|
}
|
|
|
map.put("bank_card_mobile", bankCardMobile);
|
|
map.put("bank_card_mobile", bankCardMobile);
|
|
|
|
|
|
|
|
- presenter.getTask(map);
|
|
|
|
|
- UMConfigUtils.onEvent(UMConfigUtils.Event.USER_AUTHENTICATION);
|
|
|
|
|
|
|
+ ViewUtil.showMsgDialog(this, new DialogConfig().setTitle("重要提示").setMsgMore(String.format(Locale.CHINA,"你已执行%d次实名认证操作",mEntity.getCertification_count()))
|
|
|
|
|
+ .setMsg("实名认证首次免费。请务必确认您所提交的认证信息真实有效。若因信息填写错误造成认证失败。再次申请认证时需扣除您0.5元绵阳币作为认证费用,请务必谨慎填写认证信息。")
|
|
|
|
|
+ .setBtnLeftText("返回修改").setBtnRightText("确认提交")
|
|
|
|
|
+ .setBtnRightOnClickListener(new View.OnClickListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onClick(View view) {
|
|
|
|
|
+ presenter.getTask(map);
|
|
|
|
|
+ UMConfigUtils.onEvent(UMConfigUtils.Event.USER_AUTHENTICATION);
|
|
|
|
|
+ }
|
|
|
|
|
+ }));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|