This commit is contained in:
haomingming
2026-11-03 12:16:38 +08:00
parent 403ae65786
commit 24f53cce85
7 changed files with 240 additions and 111 deletions
@@ -378,115 +378,112 @@ public class LoginSetInfoActivity extends BaseActivity implements
}
}
// 获取审核状态值
Intent intent = getIntent();
// ( 1.待审核 2.审核中 3.需要补充修改资料 4.再次提交审核 5.拒绝
// 6.已通过)//修改,0,1,3,4,5需要提交资料,6是通过,2其他不允许提交
state = intent.getIntExtra("state", SharePrefUtil.getInt(ct, "state", 0));
// 获取审核状态值
Intent intent = getIntent();
// ( 1.待审核 2.审核中 3.需要补充修改资料 4.再次提交审核 5.拒绝
// 6.已通过)//修改,0,1,3,4,5需要提交资料,6是通过,2其他不允许提交
state = intent.getIntExtra("state", SharePrefUtil.getInt(ct, "state", 0));
String checkInfo = intent.getStringExtra("checkInfo");
if (TextUtils.isEmpty(checkInfo)) {
checkInfo = SharePrefUtil.getString(ct, "checkInfo", "");
}
userName = intent.getStringExtra("phone");
LogUtil.i("审核信息==" + state);
// 根据状态进行显示规则,与提示用户
if(11 == state||10 == state ||9 == state)//hcp登陆可编辑
{
tv_showCheckInfo.setVisibility(View.GONE);
tv_showCheckInfo.setText("请完善资料");
submit_myinfo.setVisibility(View.VISIBLE);
setInfoClick(true);
submit_myinfo.setVisibility(View.VISIBLE);
submit_myinfo.setEnabled(true);
}
else if (0 == state || 1 == state) {// 0,3,5需要提交资料
tv_showCheckInfo.setVisibility(View.GONE);
tv_showCheckInfo.setText("请完善资料");
submit_myinfo.setVisibility(View.VISIBLE);
setInfoClick(true);
submit_myinfo.setVisibility(View.VISIBLE);
submit_myinfo.setEnabled(true);
// 根据不同用户名获取相应的资料
String mobile = SharePrefUtil.getString(ct,
Constant.SP_IS_FIRST_NAME, Constant.mobile, "");// 登录的手机号
get(mobile);
} else if (3 == state || 4 == state || 5 == state) {// 3,5需要提交资料//7
tv_showCheckInfo.setVisibility(View.VISIBLE);
String text = "您的资料未通过审核,请修改完善后重新提交。";
if (!TextUtils.isEmpty(checkInfo)) {
text = checkInfo;
}
tv_showCheckInfo.setText(text);
showAlertTips(text);
setInfoClick(true);
submit_myinfo.setVisibility(View.VISIBLE);
submit_myinfo.setEnabled(true);
} else if (6 == state) {// 通过
tv_showCheckInfo.setVisibility(View.VISIBLE);
tv_showCheckInfo.setText("您的资料已经通过了审核,将会自动进入应用");
setInfoClick(false);
submit_myinfo.setVisibility(View.GONE);
submit_myinfo.setEnabled(false);
ToastUtil.showToast("您的资料已经通过了审核,将会自动进入应用");
try {
Thread.sleep(2000);
// 注册成功跳转
Intent i = new Intent();
// if(BigModule())
// {
// i.setClass(this, BigMainActivity.class);
//
// }
// else
// {
i.setClass(this, MainActivity.class);
// }
i.putExtra("launcher_from", 1);
startActivity(i);
// 保存登陆
SharePrefUtil.saveBoolean(ct, Constant.IS_LOGIN, true);
} catch (InterruptedException e) {
e.printStackTrace();
}
} else if (7 == state){//2018.12.21改,checkInfo = undefind继续追踪,暂不出现弹窗处理
setInfoClick(true);
submit_myinfo.setVisibility(View.VISIBLE);
submit_myinfo.setEnabled(true);
}else {
tv_showCheckInfo.setVisibility(View.VISIBLE);
tv_showCheckInfo.setText("肝胆相照将尽快对您的资料进行审核,请耐心等待。");
setInfoClick(false);
submit_myinfo.setVisibility(View.GONE);
submit_myinfo.setEnabled(false);
}
// showAlertTips(tv_showCheckInfo.getText().toString());
// 下面是获取列表
// getList(hospitalListUrl);// 获取医院列表
getList(officeListUrl);// 获取科室列表
getList(positionListUrl);// 获取职称列表
getList(diseaseUrl);// 获取专长
// 取出定位的数据
lon = SharePrefUtil.getString(ct, Constant.LON, "116.3");
lat = SharePrefUtil.getString(ct, Constant.LAT, "39.9");
String province = SharePrefUtil.getString(ct, Constant.PROVINCE, "北京市");
String city = SharePrefUtil.getString(ct, Constant.CITY, "北京市");
String district = SharePrefUtil.getString(ct, Constant.DISTRICT, "东城区");
LogUtil.i("lon=" + lon + "lat=" + lat + "province=" + province
+ "city=" + city + "district=" + district);
// 设置默认选中城市
setSelectedCity(province, city, district);
// 执行检出城市
new InitAreaTask().execute();
}
userName = intent.getStringExtra("phone");
LogUtil.i("审核信息==" + state);
applyStateUI(state, checkInfo);
// 向服务端同步最新审核状态(防止用户在已登录状态下后台已完成审核但本地 state 未更新)
UIUtils.refreshDoctorStateIfNeeded(ct, new UIUtils.OnDoctorStateRefreshListener() {
@Override
public void onStateRefreshed(int newState, String newCheckInfo) {
if (isFinishing() || newState <= 0 || newState == state) {
return;
}
state = newState;
applyStateUI(newState, newCheckInfo);
}
});
// showAlertTips(tv_showCheckInfo.getText().toString());
// 下面是获取列表
// getList(hospitalListUrl);// 获取医院列表
getList(officeListUrl);// 获取科室列表
getList(positionListUrl);// 获取职称列表
getList(diseaseUrl);// 获取专长
// 取出定位的数据
lon = SharePrefUtil.getString(ct, Constant.LON, "116.3");
lat = SharePrefUtil.getString(ct, Constant.LAT, "39.9");
String province = SharePrefUtil.getString(ct, Constant.PROVINCE, "北京市");
String city = SharePrefUtil.getString(ct, Constant.CITY, "北京市");
String district = SharePrefUtil.getString(ct, Constant.DISTRICT, "东城区");
LogUtil.i("lon=" + lon + "lat=" + lat + "province=" + province
+ "city=" + city + "district=" + district);
// 设置默认选中城市
setSelectedCity(province, city, district);
// 执行检出城市
new InitAreaTask().execute();
}
/**
* 根据审核状态更新界面展示与可编辑状态
*/
private void applyStateUI(int currentState, String checkInfo) {
if (11 == currentState || 10 == currentState || 9 == currentState) {// hcp登陆可编辑
tv_showCheckInfo.setVisibility(View.GONE);
tv_showCheckInfo.setText("请完善资料");
submit_myinfo.setVisibility(View.VISIBLE);
setInfoClick(true);
submit_myinfo.setVisibility(View.VISIBLE);
submit_myinfo.setEnabled(true);
} else if (0 == currentState || 1 == currentState) {// 0,3,5需要提交资料
tv_showCheckInfo.setVisibility(View.GONE);
tv_showCheckInfo.setText("请完善资料");
submit_myinfo.setVisibility(View.VISIBLE);
setInfoClick(true);
submit_myinfo.setVisibility(View.VISIBLE);
submit_myinfo.setEnabled(true);
// 根据不同用户名获取相应的资料
String mobile = SharePrefUtil.getString(ct,
Constant.SP_IS_FIRST_NAME, Constant.mobile, "");// 登录的手机号
get(mobile);
} else if (3 == currentState || 4 == currentState || 5 == currentState) {// 3,5需要提交资料//7
tv_showCheckInfo.setVisibility(View.VISIBLE);
String text = "您的资料未通过审核,请修改完善后重新提交。";
if (!TextUtils.isEmpty(checkInfo)) {
text = checkInfo;
}
tv_showCheckInfo.setText(text);
showAlertTips(text);
setInfoClick(true);
submit_myinfo.setVisibility(View.VISIBLE);
submit_myinfo.setEnabled(true);
} else if (6 == currentState) {// 通过
tv_showCheckInfo.setVisibility(View.VISIBLE);
tv_showCheckInfo.setText("您的资料已经通过了审核,将会自动进入应用");
setInfoClick(false);
submit_myinfo.setVisibility(View.GONE);
submit_myinfo.setEnabled(false);
SharePrefUtil.saveBoolean(ct, Constant.IS_LOGIN, true);
SharePrefUtil.saveInt(ct, "state", 6);
ToastUtil.showToast("您的资料已经通过了审核");
Intent i = new Intent(this, MainActivity.class);
i.putExtra("launcher_from", 1);
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(i);
finish();
} else if (7 == currentState) {// 2018.12.21改,checkInfo = undefind继续追踪,暂不出现弹窗处理
setInfoClick(true);
submit_myinfo.setVisibility(View.VISIBLE);
submit_myinfo.setEnabled(true);
} else {
tv_showCheckInfo.setVisibility(View.VISIBLE);
tv_showCheckInfo.setText("肝胆相照将尽快对您的资料进行审核,请耐心等待。");
setInfoClick(false);
submit_myinfo.setVisibility(View.GONE);
submit_myinfo.setEnabled(false);
}
}
/**
@@ -2141,6 +2141,7 @@ public class MainActivity extends BaseActivity implements
super.onResume();
ShowMagazine();
if (UIUtils.isLogined()) {
UIUtils.refreshDoctorStateIfNeeded(this, null);
isMaiLanExpert();
getIsAccount();
setPolvPlayViewerId();
@@ -963,8 +963,11 @@ public class MyDetailInfoActivity extends BaseActivity implements
// SharePrefUtil.saveInt(ct, "cityId", cityId);
// SharePrefUtil.saveInt(ct, "countyId", countyId);
// SharePrefUtil.saveInt(ct, "provId", provId);
SharePrefUtil.saveInt(ct, "sex", sex);
SharePrefUtil.saveString(ct, "isStar", isStar);
SharePrefUtil.saveInt(ct, "sex", sex);
SharePrefUtil.saveString(ct, "isStar", isStar);
if (data.state > 0) {
SharePrefUtil.saveInt(ct, "state", data.state);
}
LogUtil.i("data==" + data.toString());
@@ -32,8 +32,9 @@ public class ChangeMyInfoBean extends BaseBean {
public String certificate;//执业资格证
public String certificateImg;//执业资格证图片
public String qrcode;//二维码
public String isStar;//是否是肝胆名医 0否 1是
public int state;
public String isStar;//是否是肝胆名医 0否 1是
public int state;
public String checkInfo;
@Override
public String toString() {
return "InfoData [uuid=" + uuid + ", mobile=" + mobile
@@ -476,6 +476,14 @@ public class BigMyFragment extends BaseFragment implements View.OnClickListener,
super.onResume();
initData();
if (UIUtils.isLogined()) {
UIUtils.refreshDoctorStateIfNeeded(mActivity, new UIUtils.OnDoctorStateRefreshListener() {
@Override
public void onStateRefreshed(int state, String checkInfo) {
if (getActivity() != null && isAdded()) {
initData();
}
}
});
getMyData();
}
getNewPatientList();
@@ -410,6 +410,14 @@ public class MyNewFragment extends BaseFragment implements View.OnClickListener,
needreportPage("我的");
initData();
if (UIUtils.isLogined()) {
UIUtils.refreshDoctorStateIfNeeded(mActivity, new UIUtils.OnDoctorStateRefreshListener() {
@Override
public void onStateRefreshed(int state, String checkInfo) {
if (getActivity() != null && isAdded()) {
initData();
}
}
});
getMyData();
}
getNewPatientList();
@@ -15,8 +15,15 @@ import java.util.List;
import android.app.Activity;
import android.content.Intent;
import com.lidroid.xutils.exception.HttpException;
import com.lidroid.xutils.http.RequestParams;
import com.lidroid.xutils.http.ResponseInfo;
import com.lidroid.xutils.http.callback.RequestCallBack;
import com.lidroid.xutils.http.client.HttpRequest.HttpMethod;
import cn.shangyu.gdxzExpert.activity.LoginNewActivity;
import cn.shangyu.gdxzExpert.application.BaseApplication;
import cn.shangyu.gdxzExpert.application.BaseApplication;
import cn.shangyu.gdxzExpert.bean.ChangeMyInfoBean;
import cn.shangyu.gdxzExpert.http.HttpHelper;
/**
*
* UIUtils.java
@@ -192,6 +199,110 @@ public class UIUtils {
return isLogined() && SharePrefUtil.getInt(getContext(), "state", 0) == 6;
}
public interface OnDoctorStateRefreshListener {
void onStateRefreshed(int state, String checkInfo);
}
/**
* 将 getExpertByUuid 返回的专家详情及审核状态同步到本地 SharePrefUtil
*/
public static void syncExpertInfoToSp(Context context, ChangeMyInfoBean bean) {
if (bean == null || !"1".equals(bean.code) || bean.expert == null) {
return;
}
Context ctx = context != null ? context : getContext();
ChangeMyInfoBean.InfoData data = bean.expert;
if (data.state > 0) {
SharePrefUtil.saveInt(ctx, "state", data.state);
}
if (!StringUtil.isEmpty(data.checkInfo)) {
SharePrefUtil.saveString(ctx, "checkInfo", data.checkInfo);
}
if (!StringUtil.isEmpty(data.realName)) {
SharePrefUtil.saveString(ctx, Constant.realName, data.realName);
}
if (!StringUtil.isEmpty(data.photo)) {
SharePrefUtil.saveString(ctx, Constant.photo, data.photo);
}
if (!StringUtil.isEmpty(data.hospitalUuid)) {
SharePrefUtil.saveString(ctx, "hospitalUuid", data.hospitalUuid);
}
if (!StringUtil.isEmpty(data.hospitalName)) {
SharePrefUtil.saveString(ctx, "hospitalName", data.hospitalName);
}
if (!StringUtil.isEmpty(data.officeUuid)) {
SharePrefUtil.saveString(ctx, "officeUuid", data.officeUuid);
}
if (!StringUtil.isEmpty(data.officeName)) {
SharePrefUtil.saveString(ctx, "officeName", data.officeName);
}
if (!StringUtil.isEmpty(data.officePhone)) {
SharePrefUtil.saveString(ctx, "officePhone", data.officePhone);
}
if (!StringUtil.isEmpty(data.positionUuid)) {
SharePrefUtil.saveString(ctx, "positionUuid", data.positionUuid);
}
if (!StringUtil.isEmpty(data.positionName)) {
SharePrefUtil.saveString(ctx, "positionName", data.positionName);
}
if (!StringUtil.isEmpty(data.certificate)) {
SharePrefUtil.saveString(ctx, "certificate", data.certificate);
}
if (!StringUtil.isEmpty(data.certificateImg)) {
SharePrefUtil.saveString(ctx, "certificateImg", data.certificateImg);
}
if (!StringUtil.isEmpty(data.qrcode)) {
SharePrefUtil.saveString(ctx, "qrcode", data.qrcode);
}
if (!StringUtil.isEmpty(data.isStar)) {
SharePrefUtil.saveString(ctx, "isStar", data.isStar);
}
SharePrefUtil.saveInt(ctx, "sex", data.sex);
}
/**
* 当账号已登录但尚未认证通过(state != 6)时,静默向服务端拉取最新审核状态(state)并同步到本地
*/
public static void refreshDoctorStateIfNeeded(final Context context, final OnDoctorStateRefreshListener listener) {
if (!isLogined() || isDoctorVerified()) {
return;
}
final Context ctx = context != null ? context : getContext();
String uuid = SharePrefUtil.getString(ctx, Constant.uuid, "");
if (StringUtil.isEmpty(uuid)) {
return;
}
RequestParams params = new RequestParams();
params.addBodyParameter("uuid", uuid);
HttpHelper.loadData(HttpMethod.POST, Url.getExpertByUuid, params, new RequestCallBack<String>() {
@Override
public void onSuccess(ResponseInfo<String> info) {
if (info == null || StringUtil.isEmpty(info.result)) {
return;
}
try {
ChangeMyInfoBean bean = GsonTools.fromGsonToBean(info.result, ChangeMyInfoBean.class);
if (bean != null && "1".equals(bean.code) && bean.expert != null) {
SharePrefUtil.saveString(ctx, Url.getExpertByUuid, info.result);
syncExpertInfoToSp(ctx, bean);
if (listener != null) {
String checkInfo = !StringUtil.isEmpty(bean.expert.checkInfo)
? bean.expert.checkInfo
: SharePrefUtil.getString(ctx, "checkInfo", "");
listener.onStateRefreshed(bean.expert.state, checkInfo);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void onFailure(HttpException arg0, String arg1) {
}
});
}
/**
* 校验是否已通过医师资质审核(state == 6)
* - 未登录账号:跳 LoginNewActivity