3
This commit is contained in:
@@ -181,7 +181,45 @@ public class UIUtils {
|
||||
}
|
||||
|
||||
public static boolean isLogined() {
|
||||
return isAccountLogined() && SharePrefUtil.getInt(getContext(), "state", 0) == 6;
|
||||
return isAccountLogined();
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断当前用户是否已通过医师/专家资质审核(已登录账号 且 state == 6)
|
||||
* 仅用于【我的患者】模块与【随访服务】模块
|
||||
*/
|
||||
public static boolean isDoctorVerified() {
|
||||
return isLogined() && SharePrefUtil.getInt(getContext(), "state", 0) == 6;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验是否已通过医师资质审核(state == 6)
|
||||
* - 未登录账号:跳 LoginNewActivity
|
||||
* - 已登录账号但 state != 6:跳 LoginSetInfoActivity(完善个人资料/查看审核状态)
|
||||
*/
|
||||
public static boolean checkDoctorVerifiedAndJump(Context context) {
|
||||
if (isDoctorVerified()) {
|
||||
return true;
|
||||
}
|
||||
if (!isLogined()) {
|
||||
return checkLoginAndJump(context);
|
||||
}
|
||||
long now = System.currentTimeMillis();
|
||||
if (now - lastJumpLoginTime < 800) {
|
||||
return false;
|
||||
}
|
||||
lastJumpLoginTime = now;
|
||||
Context targetContext = context != null ? context : getContext();
|
||||
Intent intent = new Intent(targetContext, cn.shangyu.gdxzExpert.activity.LoginSetInfoActivity.class);
|
||||
intent.putExtra("state", SharePrefUtil.getInt(getContext(), "state", 0));
|
||||
intent.putExtra("checkInfo", SharePrefUtil.getString(getContext(), "checkInfo", ""));
|
||||
intent.putExtra("phone", SharePrefUtil.getString(getContext(), Constant.mobile, ""));
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
if (!(targetContext instanceof Activity)) {
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
}
|
||||
targetContext.startActivity(intent);
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean checkAccountLoginAndJump(Context context) {
|
||||
|
||||
Reference in New Issue
Block a user