修复无法提交实名信息问题

This commit is contained in:
kehaoyuan
2018-06-14 17:40:04 +08:00
parent cd891d4378
commit 240d97cdd5
3 changed files with 4 additions and 3 deletions

View File

@ -29,6 +29,7 @@ class UserInfoEntity {
var contact: String? = null
@SerializedName("id_card")
@TypeConverters(IdCardTypeConverter::class)
var idCard: IdCardEntity? = null
}

View File

@ -300,8 +300,7 @@ class UserRepository {
break;
case UserViewModel.TYPE_ID_CARD:
mCacheUserInfoEntity.setIdCard(GsonUtils.Companion.getInstance().fromJsonBean(content, IdCardEntity.class));
default:
return;
break;
}
userInfoHandle(mCacheUserInfoEntity, true);

View File

@ -179,6 +179,7 @@ public class UserInfoEditFragment extends NormalFragment {
mIdCardNameEt.setEnabled(false);
mIdCardEt.setText(idCard.getId());
mIdCardEt.setEnabled(false);
if (mSaveMenuItem != null) mSaveMenuItem.setVisible(false);
} else {
if (mSaveMenuItem != null) mSaveMenuItem.setVisible(true);
}
@ -230,7 +231,7 @@ public class UserInfoEditFragment extends NormalFragment {
toast("必须使用18位的身份证号码");
return;
}
String regIdCard = "^\\d{15}$|^\\d{17}[0-9Xx]$";
String regIdCard = "^[1-9]\\d{5}([1-9]\\d{3})(0\\d|1[0-2])([0-2]\\d|3[0-1])\\d{3}[\\dXx]$";
if (!idCard.matches(regIdCard)) {
toast("身份证无效,请重新输入");
return;