Commit 3dfd0c2c by han xu

身份验证增加更新功能

parent a5528917
......@@ -10,6 +10,7 @@ import com.dayu.base.api.BaseApiFactory;
import com.dayu.base.ui.activity.BaseActivity;
import com.dayu.base.ui.presenter.SImplePresenter;
import com.dayu.common.Constants;
import com.dayu.event.UserInfo;
import com.dayu.provider.event.CertificationEvent;
import com.dayu.provider.event.RefreshEvent;
import com.dayu.provider.router.RouterPath;
......@@ -175,6 +176,11 @@ public class CertificationUpdateActivity extends BaseActivity<SImplePresenter, A
}
showDialog();
if (!TextUtils.isEmpty(identityUrl) && !TextUtils.isEmpty(identityBackUrl)){
uploadImageCount = 0;
save();
}else {
if (TextUtils.isEmpty(identityUrl)) {
uploadImageCount++;
BaseApiFactory.uploadPhotoNew(BaseApiFactory.packPhoto(identityPath), Constants.PHOTO + "/privacy/idcard", "yyMM")
......@@ -196,6 +202,9 @@ public class CertificationUpdateActivity extends BaseActivity<SImplePresenter, A
}
}
}
private void save() {
if (uploadImageCount != 0){
return;
......@@ -204,12 +213,23 @@ public class CertificationUpdateActivity extends BaseActivity<SImplePresenter, A
ServiceSaveBean1.AccountIdCardExt accountExt = new ServiceSaveBean1.AccountIdCardExt( mUserId, identityUrl, identityBackUrl);
Api.getService(UserService2.class).commitCertificationUpdate(accountExt).compose(Api.applySchedulers())
.subscribe(mPresenter.baseObserver(bool -> {
//更新信息
Api.getService(com.dayu.base.api.APIService.class).getDetectStatus(mUserId).compose(Api.applySchedulers())
.subscribe(mPresenter.baseObserver(integer -> {
UserInfo user = UserManager.getInstance().getUser();
user.setDetectStatus(integer);
UserManager.getInstance().saveUser(user);
ToastUtils.showShortToast(bool ? R.string.save_success : R.string.save_fail);
CommonUtils.hideSoftInput(mActivity);
EventBus.getDefault().post(new CertificationEvent(1));
EventBus.getDefault().post(new RefreshEvent());
finish();
}));
}));
}
......
......@@ -227,6 +227,12 @@ public class RegisterActivity extends BaseActivity<SImplePresenter, ActivityRegi
}
showDialog();
if (!TextUtils.isEmpty(identityUrl) && !TextUtils.isEmpty(identityUrl) && !TextUtils.isEmpty(identityBackUrl)){
uploadImageCount = 0;
save();
}else {
if (TextUtils.isEmpty(identityUrl)) {
uploadImageCount++;
BaseApiFactory.uploadPhotoNew(BaseApiFactory.packPhoto(identityPath), Constants.PHOTO + "/privacy/idcard", "yyMM")
......@@ -258,6 +264,7 @@ public class RegisterActivity extends BaseActivity<SImplePresenter, ActivityRegi
}));
}
}
}
private void save() {
if (uploadImageCount != 0){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment