This commit is contained in:
haomingming
2026-11-03 12:07:32 +08:00
parent 60f6781f6e
commit 403ae65786
8 changed files with 105 additions and 17 deletions
@@ -568,7 +568,7 @@ public class BaseApplication extends Application {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent); startActivity(intent);
}else if(event.equals("goPatientMsg")) { }else if(event.equals("goPatientMsg")) {
if (!UIUtils.checkLoginAndJump(currentActivity != null ? currentActivity : BaseApplication.this)) { if (!UIUtils.checkDoctorVerifiedAndJump(currentActivity != null ? currentActivity : BaseApplication.this)) {
return; return;
} }
Intent intent = null; Intent intent = null;
@@ -585,7 +585,7 @@ public class BaseApplication extends Application {
startActivity(intent); startActivity(intent);
} }
}else if(event.equals("goSendMsg")) { }else if(event.equals("goSendMsg")) {
if (!UIUtils.checkLoginAndJump(currentActivity != null ? currentActivity : BaseApplication.this)) { if (!UIUtils.checkDoctorVerifiedAndJump(currentActivity != null ? currentActivity : BaseApplication.this)) {
return; return;
} }
if (currentActivity != null) { if (currentActivity != null) {
@@ -630,7 +630,7 @@ public class BaseApplication extends Application {
startActivity(intent); startActivity(intent);
} }
}else if(event.equals("goGroupMessagePage")) { }else if(event.equals("goGroupMessagePage")) {
if (!UIUtils.checkLoginAndJump(currentActivity != null ? currentActivity : BaseApplication.this)) { if (!UIUtils.checkDoctorVerifiedAndJump(currentActivity != null ? currentActivity : BaseApplication.this)) {
return; return;
} }
Intent intent = null; Intent intent = null;
@@ -531,7 +531,12 @@ public class BigHomeFragment extends BaseFragment implements OnCallBackFromNet,
} }
if (doctor_name == null) if (doctor_name == null)
return; return;
if(realName.length()>5) if (!UIUtils.isDoctorVerified()) {
String mobile = SharePrefUtil.getString(mActivity, Constant.mobile, "");
String display = (!StringUtil.isEmpty(realName) && !"null".equals(realName)) ? realName : (!StringUtil.isEmpty(mobile) ? mobile : "已登录");
int st = SharePrefUtil.getInt(mActivity, "state", 0);
doctor_name.setText(display + (st == 2 ? "(审核中)" : "(去完善资料)"));
} else if(realName.length()>5)
{ {
doctor_name.setText(realName); doctor_name.setText(realName);
} }
@@ -733,7 +738,7 @@ public class BigHomeFragment extends BaseFragment implements OnCallBackFromNet,
} }
} }
private void handleLogout(boolean isNotice) { private void handleLogout(boolean isNotice) {
if (!UIUtils.isLogined()) { if (!UIUtils.isDoctorVerified()) {
return; return;
} }
ToastUtil.showMessage("专家账号信息为空"); ToastUtil.showMessage("专家账号信息为空");
@@ -845,13 +850,13 @@ public class BigHomeFragment extends BaseFragment implements OnCallBackFromNet,
} else if (id == R.id.l_change) { } else if (id == R.id.l_change) {
changeBig(); changeBig();
} else if (id == R.id.big_top_bar) { } else if (id == R.id.big_top_bar) {
if (!UIUtils.checkLoginAndJump(mActivity)) return; if (!UIUtils.checkDoctorVerifiedAndJump(mActivity)) return;
startActivity(new Intent(mActivity, MyDetailInfoActivity.class)); startActivity(new Intent(mActivity, MyDetailInfoActivity.class));
} else if (id == R.id.big_p1) { } else if (id == R.id.big_p1) {
if (!UIUtils.checkLoginAndJump(mActivity)) return; if (!UIUtils.checkDoctorVerifiedAndJump(mActivity)) return;
startActivity(new Intent(mActivity, MyPatientActivity.class)); startActivity(new Intent(mActivity, MyPatientActivity.class));
} else if (id == R.id.big_g1) { } else if (id == R.id.big_g1) {
if (!UIUtils.checkLoginAndJump(mActivity)) return; if (!UIUtils.checkDoctorVerifiedAndJump(mActivity)) return;
startActivity(new Intent(mActivity, PublicConsultationActivity.class)); startActivity(new Intent(mActivity, PublicConsultationActivity.class));
} else if (id == R.id.big_v) { } else if (id == R.id.big_v) {
startActivity(new Intent(mActivity, BigVideoActivity.class)); startActivity(new Intent(mActivity, BigVideoActivity.class));
@@ -442,7 +442,14 @@ public class BigMyFragment extends BaseFragment implements View.OnClickListener,
if (tv_qiandao != null) tv_qiandao.setText("签到"); if (tv_qiandao != null) tv_qiandao.setText("签到");
return; return;
} }
tv_name.setText(realName); if (!UIUtils.isDoctorVerified()) {
String mobile = SharePrefUtil.getString(mActivity, Constant.mobile, "");
String display = (!StringUtil.isEmpty(realName) && !"null".equals(realName)) ? realName : (!StringUtil.isEmpty(mobile) ? mobile : "已登录");
int st = SharePrefUtil.getInt(mActivity, "state", 0);
tv_name.setText(display + (st == 2 ? "(审核中)" : "(去完善资料)"));
} else {
tv_name.setText(realName);
}
String photo = SharePrefUtil.getString(mActivity, "photo", null); String photo = SharePrefUtil.getString(mActivity, "photo", null);
if (photo != null && !"null".equals(photo)) { if (photo != null && !"null".equals(photo)) {
ImageLoader ImageLoader
@@ -727,6 +734,7 @@ public class BigMyFragment extends BaseFragment implements View.OnClickListener,
} else if (id == R.id.l_h) { } else if (id == R.id.l_h) {
startActivity(new Intent(mActivity, MyFlowerActivity.class)); startActivity(new Intent(mActivity, MyFlowerActivity.class));
} else if (id == R.id.big_top_bar) { } else if (id == R.id.big_top_bar) {
if (!UIUtils.checkDoctorVerifiedAndJump(mActivity)) return;
startActivity(new Intent(mActivity, MyDetailInfoActivity.class)); startActivity(new Intent(mActivity, MyDetailInfoActivity.class));
} else if (id == R.id.r_banck) { } else if (id == R.id.r_banck) {
startActivity(new Intent(mActivity, MyBankCardActivity.class)); startActivity(new Intent(mActivity, MyBankCardActivity.class));
@@ -676,7 +676,7 @@ public class HomeNewFragment extends BaseFragment implements OnClickListener,OnC
private void initBanner( List<HomeBean.NewsBean> datas) private void initBanner( List<HomeBean.NewsBean> datas)
{ {
List<CustomViewsInfo> data = new ArrayList<>(); List<CustomViewsInfo> data = new ArrayList<>();
final boolean showStudioSlide = UIUtils.isLogined(); final boolean showStudioSlide = UIUtils.isDoctorVerified() && !StringUtil.isEmpty(SharePrefUtil.getString(mActivity, "realName", ""));
if (datas != null) { if (datas != null) {
int startIndex = (showStudioSlide || datas.size() <= 1) ? 0 : 1; int startIndex = (showStudioSlide || datas.size() <= 1) ? 0 : 1;
for (int i = startIndex; i < datas.size(); i++) { for (int i = startIndex; i < datas.size(); i++) {
@@ -933,7 +933,7 @@ public class HomeNewFragment extends BaseFragment implements OnClickListener,OnC
@Override @Override
public void onClick(View v) { public void onClick(View v) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
if (!UIUtils.checkLoginAndJump(getActivity())) { if (!UIUtils.checkDoctorVerifiedAndJump(getActivity())) {
dialog.dismiss(); dialog.dismiss();
return; return;
} }
@@ -1039,7 +1039,7 @@ public class HomeNewFragment extends BaseFragment implements OnClickListener,OnC
private int consultCount = 0; private int consultCount = 0;
private void handleLogout(boolean isNotice) { private void handleLogout(boolean isNotice) {
if (!UIUtils.isLogined()) { if (!UIUtils.isDoctorVerified()) {
return; return;
} }
ToastUtil.showMessage("专家账号信息为空"); ToastUtil.showMessage("专家账号信息为空");
@@ -1726,7 +1726,7 @@ public class HomeNewFragment extends BaseFragment implements OnClickListener,OnC
{ {
if(homeBean.getData()!=null) if(homeBean.getData()!=null)
{ {
if(homeBean.getData().getExpertDetail()==null && UIUtils.isLogined()) if(false && homeBean.getData().getExpertDetail()==null && UIUtils.isLogined())
{ {
// handleLogout(false); // handleLogout(false);
return; return;
@@ -375,7 +375,14 @@ public class MyNewFragment extends BaseFragment implements View.OnClickListener,
if (tv_qiandao != null) tv_qiandao.setText("签到"); if (tv_qiandao != null) tv_qiandao.setText("签到");
return; return;
} }
tv_name.setText(realName); if (!UIUtils.isDoctorVerified()) {
String mobile = SharePrefUtil.getString(mActivity, Constant.mobile, "");
String display = (!StringUtil.isEmpty(realName) && !"null".equals(realName)) ? realName : (!StringUtil.isEmpty(mobile) ? mobile : "已登录");
int st = SharePrefUtil.getInt(mActivity, "state", 0);
tv_name.setText(display + (st == 2 ? "(审核中)" : "(去完善资料)"));
} else {
tv_name.setText(realName);
}
String photo = SharePrefUtil.getString(mActivity, "photo", null); String photo = SharePrefUtil.getString(mActivity, "photo", null);
if (photo != null && !"null".equals(photo)) { if (photo != null && !"null".equals(photo)) {
ImageLoader ImageLoader
@@ -611,7 +618,10 @@ public class MyNewFragment extends BaseFragment implements View.OnClickListener,
if (id != R.id.r_shezhi && !UIUtils.checkLoginAndJump(mActivity)) { if (id != R.id.r_shezhi && !UIUtils.checkLoginAndJump(mActivity)) {
return; return;
} }
if (id == R.id.tv_name) { if (id == R.id.tv_name || id == R.id.pic) {
if (!UIUtils.checkDoctorVerifiedAndJump(mActivity)) {
return;
}
startActivity(new Intent(mActivity, MyDetailInfoActivity.class)); startActivity(new Intent(mActivity, MyDetailInfoActivity.class));
return; return;
} }
@@ -658,8 +668,10 @@ public class MyNewFragment extends BaseFragment implements View.OnClickListener,
qiandao(); qiandao();
} }
} else if (id == R.id.l_g) { } else if (id == R.id.l_g) {
if (!UIUtils.checkDoctorVerifiedAndJump(mActivity)) return;
startActivity(new Intent(mActivity, PublicConsultationActivity.class)); startActivity(new Intent(mActivity, PublicConsultationActivity.class));
} else if (id == R.id.l_p) { } else if (id == R.id.l_p) {
if (!UIUtils.checkDoctorVerifiedAndJump(mActivity)) return;
startActivity(new Intent(mActivity, MyPatientActivity.class)); startActivity(new Intent(mActivity, MyPatientActivity.class));
} else if (id == R.id.l_h) { } else if (id == R.id.l_h) {
startActivity(new Intent(mActivity, MyFlowerActivity.class)); startActivity(new Intent(mActivity, MyFlowerActivity.class));
@@ -73,7 +73,12 @@ public class MyUserIconUtil {
} }
if ("我的患者".equals(name) || "公益咨询".equals(name) || "患者审核".equals(name) if ("我的患者".equals(name) || "公益咨询".equals(name) || "患者审核".equals(name)
|| "患者分组".equals(name) || "群发消息".equals(name) || "随访二维码".equals(name) || "患者分组".equals(name) || "群发消息".equals(name) || "随访二维码".equals(name)
|| "出诊计划".equals(name) || "我的视频".equals(name) || "我的课程".equals(name) || "出诊计划".equals(name)) {
if (!UIUtils.checkDoctorVerifiedAndJump(context)) {
return;
}
}
if ("我的视频".equals(name) || "我的课程".equals(name)
|| "我的下载".equals(name) || "我的收藏".equals(name) || "我的账户".equals(name) || "我的下载".equals(name) || "我的收藏".equals(name) || "我的账户".equals(name)
|| "我的积分".equals(name) || "我的福利".equals(name) || "我的鲜花".equals(name) || "我的积分".equals(name) || "我的福利".equals(name) || "我的鲜花".equals(name)
|| "课件明细".equals(name) || "课程明细".equals(name) || "积分商城".equals(name) || "课件明细".equals(name) || "课程明细".equals(name) || "积分商城".equals(name)
@@ -181,7 +181,45 @@ public class UIUtils {
} }
public static boolean isLogined() { 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) { public static boolean checkAccountLoginAndJump(Context context) {
@@ -89,6 +89,20 @@ public class UniappUtil {
|| targetPath.startsWith("/pages_app/pptDetail/pptDetail"); || targetPath.startsWith("/pages_app/pptDetail/pptDetail");
} }
/**
* 判断目标路径是否属于【我的患者】或【随访服务】模块(需校验 state == 6)
*/
public static boolean isDoctorVerifiedRequiredPath(String targetPath) {
if (StringUtil.isEmpty(targetPath)) {
return false;
}
return targetPath.startsWith("/pages_app/myPatient")
|| targetPath.startsWith("/pages_app/patientGroup")
|| targetPath.startsWith("/pages_chat/groupMessage")
|| targetPath.startsWith("/pages_app/myCode")
|| targetPath.startsWith("/pages_chat/outPatient");
}
/** /**
* 展示uniapp mp - 公共方法 * 展示uniapp mp - 公共方法
* @param context 上下文 * @param context 上下文
@@ -97,6 +111,9 @@ public class UniappUtil {
public static void showUniMp(Context context, String targetPath, com.alibaba.fastjson.JSONObject pageParams) { public static void showUniMp(Context context, String targetPath, com.alibaba.fastjson.JSONObject pageParams) {
try { try {
if (isDoctorVerifiedRequiredPath(targetPath) && !UIUtils.checkDoctorVerifiedAndJump(context)) {
return;
}
if (!isGuestAllowedPath(targetPath) && !UIUtils.checkLoginAndJump(context)) { if (!isGuestAllowedPath(targetPath) && !UIUtils.checkLoginAndJump(context)) {
return; return;
} }
@@ -131,6 +148,9 @@ public class UniappUtil {
private static void showInternal(Context context, String targetPath, com.alibaba.fastjson.JSONObject pageParams) { private static void showInternal(Context context, String targetPath, com.alibaba.fastjson.JSONObject pageParams) {
try { try {
if (isDoctorVerifiedRequiredPath(targetPath) && !UIUtils.checkDoctorVerifiedAndJump(context)) {
return;
}
if (!isGuestAllowedPath(targetPath) && !UIUtils.checkLoginAndJump(context)) { if (!isGuestAllowedPath(targetPath) && !UIUtils.checkLoginAndJump(context)) {
return; return;
} }