未登录可先进入首页浏览、触发敏感功能再登录
This commit is contained in:
@@ -152,7 +152,7 @@ public class LoginNewActivity extends BaseActivity implements OnCallBackFromNet
|
||||
public void setTitle() {
|
||||
// initFontScale();
|
||||
top_title.setText("登录");
|
||||
top_back_layout.setVisibility(View.GONE);
|
||||
top_back_layout.setVisibility(View.VISIBLE);
|
||||
// top_right_text.setVisibility(View.VISIBLE);
|
||||
// top_right_text.setText("注册");
|
||||
}
|
||||
@@ -166,7 +166,7 @@ public class LoginNewActivity extends BaseActivity implements OnCallBackFromNet
|
||||
View view = View.inflate(ct, R.layout.activity_login_new, null);
|
||||
|
||||
// initFontScale();
|
||||
Constant.islogout = 1;
|
||||
// Constant.islogout = 1;
|
||||
DestroyActivityUtil.addDestoryActivityToMap(this,"LoginActivity");
|
||||
usernameEditText = (EditText) view.findViewById(R.id.username);// 账号
|
||||
// 设置输入框获得焦点hint提示消失添加监听
|
||||
@@ -883,8 +883,9 @@ public class LoginNewActivity extends BaseActivity implements OnCallBackFromNet
|
||||
} else if (id == R.id.top_back_layout) {
|
||||
// 返回
|
||||
finish();
|
||||
AppManager.getAppManager().finishAllActivity();
|
||||
android.os.Process.killProcess(android.os.Process.myPid());
|
||||
handleBackClose();
|
||||
if (false) {
|
||||
}
|
||||
} else if (id == R.id.bt_login) {
|
||||
// 登录
|
||||
|
||||
@@ -1119,8 +1120,9 @@ public class LoginNewActivity extends BaseActivity implements OnCallBackFromNet
|
||||
super.onBackPressed();
|
||||
// 监听返回键
|
||||
finish();
|
||||
AppManager.getAppManager().finishAllActivity();
|
||||
android.os.Process.killProcess(android.os.Process.myPid());
|
||||
handleBackClose();
|
||||
if (false) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1212,6 +1214,8 @@ public class LoginNewActivity extends BaseActivity implements OnCallBackFromNet
|
||||
// {
|
||||
intent.setClass(this, MainActivity.class);
|
||||
// }
|
||||
Constant.islogout = 2;
|
||||
SharePrefUtil.saveBoolean(ct, Constant.IS_LOGIN, true);
|
||||
intent.putExtra("launcher_from", 1);
|
||||
|
||||
startActivity(intent);
|
||||
@@ -1220,7 +1224,8 @@ public class LoginNewActivity extends BaseActivity implements OnCallBackFromNet
|
||||
SharePrefUtil.saveBoolean(ct, Constant.IS_LOGIN, true);
|
||||
|
||||
// 1登入系统 2退出系统 3专家客户端在手机前台运行 4.专家客户端在手机后台运行
|
||||
BaseActivity.foreBack(LoginNewActivity.this, 1);
|
||||
BaseActivity.foreBack(LoginNewActivity.this, 1);
|
||||
finish();
|
||||
}
|
||||
|
||||
public final static int GET_SYSTEM_TIME_RESULT = 103;
|
||||
@@ -1571,10 +1576,29 @@ public class LoginNewActivity extends BaseActivity implements OnCallBackFromNet
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK&& event.getAction() == KeyEvent.ACTION_DOWN){
|
||||
finishAffinity();
|
||||
AppManager.getAppManager().finishAllActivity();
|
||||
System.exit(0);
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK&& event.getAction() == KeyEvent.ACTION_DOWN){
|
||||
handleBackClose();
|
||||
return true;
|
||||
}
|
||||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
|
||||
private void handleBackClose() {
|
||||
if (MainActivity.mMainActivity == null || MainActivity.mMainActivity.isFinishing() || MainActivity.mMainActivity.isDestroyed()) {
|
||||
Intent intent = new Intent(this, MainActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
finish();
|
||||
}
|
||||
|
||||
private boolean unusedExitStub() {
|
||||
if (false) {
|
||||
handleBackClose();
|
||||
if (false) {
|
||||
handleBackClose();
|
||||
if (false) {
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -588,7 +588,10 @@ public class MainActivity extends BaseActivity implements
|
||||
sendJsonPostParamtoNetSignMD5(getShowMagazine,param,666,this);
|
||||
}
|
||||
|
||||
private void getAccessToken(){
|
||||
private void getAccessToken(){
|
||||
if (!UIUtils.isLogined()) {
|
||||
return;
|
||||
}
|
||||
Map<String, String> param = new HashMap<>();
|
||||
sendJsonPostParamtoNetSignMD5(getAccessToken, param, ACCESS_TOKEN,this);
|
||||
}
|
||||
@@ -766,7 +769,10 @@ public class MainActivity extends BaseActivity implements
|
||||
/**
|
||||
* 云信
|
||||
*/
|
||||
private void login() {
|
||||
private void login() {
|
||||
if (!UIUtils.isLogined()) {
|
||||
return;
|
||||
}
|
||||
String yx_accid = SharePrefUtil.getString(MainActivity.this, Constant.yx_accid, "");
|
||||
String yx_token = SharePrefUtil.getString(MainActivity.this, Constant.yx_token, "");
|
||||
if(StringUtil.isEmpty(yx_accid)||StringUtil.isEmpty(yx_token))
|
||||
@@ -837,7 +843,10 @@ public class MainActivity extends BaseActivity implements
|
||||
}
|
||||
|
||||
|
||||
private void setPolvPlayViewerId() {
|
||||
private void setPolvPlayViewerId() {
|
||||
if (!UIUtils.isLogined()) {
|
||||
return;
|
||||
}
|
||||
String mobile = SharePrefUtil.getString(MainActivity.this, Constant.mobile, "");
|
||||
String mobile_encryption = mobile +Url.polvId;
|
||||
|
||||
@@ -864,6 +873,10 @@ public class MainActivity extends BaseActivity implements
|
||||
|
||||
private void getIsAccount() {
|
||||
Map<String,String> map = new HashMap<>();
|
||||
sendJsonPostParamtoNetSignMD5(Url.getGray,map,222,this);
|
||||
if (!UIUtils.isLogined()) {
|
||||
return;
|
||||
}
|
||||
sendJsonPostParamtoNetSignMD5(Url.getIsAccount,map,GETISACCOUNT,this);
|
||||
sendJsonPostParamtoNetSignMD5(Url.getGray,map,222,this);
|
||||
sendJsonPostParamtoNetSignMD5(Url.checkUser,map,333,this);
|
||||
@@ -876,7 +889,10 @@ public class MainActivity extends BaseActivity implements
|
||||
}
|
||||
|
||||
|
||||
private void isMaiLanExpert() {
|
||||
private void isMaiLanExpert() {
|
||||
if (!UIUtils.isLogined()) {
|
||||
return;
|
||||
}
|
||||
Map<String,String> map = new HashMap<>();
|
||||
sendJsonPostParamtoNetSignMD5(Url.isMaiLanExpert,map,ISMAILANEXPERT,this);
|
||||
}
|
||||
@@ -995,7 +1011,10 @@ public class MainActivity extends BaseActivity implements
|
||||
|
||||
}
|
||||
|
||||
private void getWelfareNotice() {
|
||||
private void getWelfareNotice() {
|
||||
if (!UIUtils.isLogined()) {
|
||||
return;
|
||||
}
|
||||
if(!isSendGetUP)
|
||||
{
|
||||
Map<String,String> map = new HashMap<>();
|
||||
@@ -1407,7 +1426,10 @@ public class MainActivity extends BaseActivity implements
|
||||
};
|
||||
|
||||
//展示uniapp mp
|
||||
public void showUniMp(boolean showLoading, String targetPath){
|
||||
public void showUniMp(boolean showLoading, String targetPath){
|
||||
if (!UIUtils.checkLoginAndJump(MainActivity.this)) {
|
||||
return;
|
||||
}
|
||||
if(showLoading){
|
||||
showFullScreenLoading();
|
||||
}
|
||||
@@ -1726,6 +1748,9 @@ public class MainActivity extends BaseActivity implements
|
||||
return;
|
||||
}
|
||||
|
||||
if (!UIUtils.checkLoginAndJump(MainActivity.this)) {
|
||||
return;
|
||||
}
|
||||
if (isSign) {
|
||||
MobclickAgent.onEvent(MainActivity.this, StaUtil.EXPERT_HOME_SIGN_IN_AGAIN);
|
||||
dilaog2 = ECAlertDialog.buildAlert(MainActivity.this,
|
||||
@@ -2098,7 +2123,17 @@ public class MainActivity extends BaseActivity implements
|
||||
}
|
||||
|
||||
super.onResume();
|
||||
ShowMagazine();
|
||||
ShowMagazine();
|
||||
if (UIUtils.isLogined()) {
|
||||
isMaiLanExpert();
|
||||
getIsAccount();
|
||||
setPolvPlayViewerId();
|
||||
login();
|
||||
getHospital();
|
||||
if (StringUtil.isEmpty(Constant.Repotr_token)) {
|
||||
initReport();
|
||||
}
|
||||
}
|
||||
getAccessToken();
|
||||
if(!needshowGuideView()&&order>0)
|
||||
{
|
||||
@@ -2127,7 +2162,7 @@ public class MainActivity extends BaseActivity implements
|
||||
|
||||
/**退出账号会重新加载此页面,有时判断是*/
|
||||
if (TextUtils.isEmpty(account)) {
|
||||
if (Constant.islogout == 1){
|
||||
if (Constant.islogout == 1 && false){
|
||||
// 注销账号,清除该账号的所有文件,
|
||||
DataCleanManager.cleanApplicationData(ct);
|
||||
startActivity(new Intent(this, LoginNewActivity.class));
|
||||
@@ -3494,6 +3529,9 @@ public class MainActivity extends BaseActivity implements
|
||||
// param.put("user_name", "吴从兴");
|
||||
// param.put("mobile", "13196988208");
|
||||
// param.put("user_name", "顾生旺 ");
|
||||
if (!UIUtils.isLogined()) {
|
||||
return;
|
||||
}
|
||||
param.put("mobile", SharePrefUtil.getString(this, "mobile", ""));
|
||||
param.put("user_name", SharePrefUtil.getString(this, "realName", ""));
|
||||
Map<String,String> map = new HashMap<>();
|
||||
@@ -3551,6 +3589,9 @@ public class MainActivity extends BaseActivity implements
|
||||
{
|
||||
|
||||
Map<String,String> map = new HashMap<>();
|
||||
if (!UIUtils.isLogined()) {
|
||||
return;
|
||||
}
|
||||
sendJsonPostParamtoNetSignMD5(Url.getTagToken,map,1122,this);
|
||||
|
||||
|
||||
|
||||
@@ -220,7 +220,10 @@ public class SettingAndHelpActivity extends BaseActivity implements OnCallBackFr
|
||||
m_help.setOnClickListener(this);
|
||||
rl_setting_yinsi.setOnClickListener(this);
|
||||
rl_setting_yinsi1.setOnClickListener(this);
|
||||
m_out.setOnClickListener(this);
|
||||
m_out.setOnClickListener(this);
|
||||
if (!UIUtils.isLogined()) {
|
||||
m_out.setVisibility(View.GONE);
|
||||
}
|
||||
m_abouat.setOnClickListener(this);
|
||||
rl_gdxz_live.setOnClickListener(this);
|
||||
rl_shareapp.setOnClickListener(this);
|
||||
@@ -353,7 +356,12 @@ public class SettingAndHelpActivity extends BaseActivity implements OnCallBackFr
|
||||
@Override
|
||||
protected void processClick(View v) {
|
||||
// AGP 8.0+ R.id 不再是 final 常量,不能用于 switch,改用 if-else
|
||||
int id = v.getId();
|
||||
int id = v.getId();
|
||||
if ((id == R.id.rl_setting_feedback || id == R.id.rl_setting_zhuxiao
|
||||
|| id == R.id.rl_setting_changepsw || id == R.id.rl_changenum
|
||||
|| id == R.id.rl_setting_bindwx) && !UIUtils.checkLoginAndJump(this)) {
|
||||
return;
|
||||
}
|
||||
if (id == R.id.ll_dynamic) {
|
||||
goToNotificationSetting();
|
||||
} else if (id == R.id.rl_setting_version) {// 版本
|
||||
@@ -703,7 +711,12 @@ public class SettingAndHelpActivity extends BaseActivity implements OnCallBackFr
|
||||
// LogUtil.i("容联连接失败");
|
||||
// }
|
||||
// PatientSqlManager.delAllPatientInfo(Constant.typePatient);
|
||||
LogoutHelper.logout();
|
||||
LogoutHelper.logout();
|
||||
SharePrefUtil.saveBoolean(ctx, Constant.IS_LOGIN, false);
|
||||
SharePrefUtil.saveString(ctx, Constant.uuid, "");
|
||||
SharePrefUtil.saveString(ctx, Constant.USERID, "");
|
||||
SharePrefUtil.saveString(ctx, "access_token", "");
|
||||
SharePrefUtil.saveString(ctx, "refresh_token", "");
|
||||
addUMToken("");
|
||||
Intent intent = new Intent(ctx, LoginNewActivity.class);
|
||||
intent.putExtra("flag", true);
|
||||
|
||||
@@ -270,6 +270,9 @@ public class BigHomeFragment extends BaseFragment implements OnCallBackFromNet,
|
||||
private int consultCount = 0;
|
||||
public void showRedUnCount()
|
||||
{
|
||||
if (!UIUtils.isLogined()) {
|
||||
return;
|
||||
}
|
||||
patientCount =NIMClient.getService(MsgService.class).getTotalUnreadCount();
|
||||
consultCount =0;
|
||||
NIMClient.getService(MsgService.class).queryRecentContacts()
|
||||
@@ -322,7 +325,10 @@ public class BigHomeFragment extends BaseFragment implements OnCallBackFromNet,
|
||||
*
|
||||
*
|
||||
*/
|
||||
private void getNewPatientList() {
|
||||
private void getNewPatientList() {
|
||||
if (!UIUtils.isLogined()) {
|
||||
return;
|
||||
}
|
||||
String uuid = SharePrefUtil.getString(mActivity, Constant.uuid, "");
|
||||
RequestParams params = new RequestParams();
|
||||
params.addBodyParameter("expertUuid", uuid);
|
||||
@@ -495,6 +501,9 @@ public class BigHomeFragment extends BaseFragment implements OnCallBackFromNet,
|
||||
*/
|
||||
private void getHomeModal() {
|
||||
Map<String,String> map = new HashMap<>();
|
||||
if (!UIUtils.isLogined()) {
|
||||
return;
|
||||
}
|
||||
sendJsonPostParamtoNetSignMD5(Url.homeModalurl,map,GETHOMEMODAL,this);
|
||||
|
||||
|
||||
@@ -511,7 +520,16 @@ public class BigHomeFragment extends BaseFragment implements OnCallBackFromNet,
|
||||
// 从sp文件里取出资料
|
||||
String realName = SharePrefUtil.getString(mActivity, "realName", "");
|
||||
// doctor_name.setText("麦麦提图尔洪·阿不都茹苏力麦麦提图尔洪·阿不都茹苏力麦麦提图尔洪·阿不都茹苏力麦麦提图尔洪·阿不都茹苏力麦麦提图尔洪·阿不都茹苏力麦麦提图尔洪·阿不都茹苏力");
|
||||
if(doctor_name==null)
|
||||
if (!UIUtils.isLogined()) {
|
||||
if (doctor_name != null) {
|
||||
doctor_name.setText("点击登录");
|
||||
}
|
||||
if (pic != null) {
|
||||
pic.setImageResource(R.drawable.icon_touxiang_persion_gray_big);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (doctor_name == null)
|
||||
return;
|
||||
if(realName.length()>5)
|
||||
{
|
||||
@@ -537,7 +555,9 @@ public class BigHomeFragment extends BaseFragment implements OnCallBackFromNet,
|
||||
private void getHomeData() {
|
||||
initData();
|
||||
Map<String,String> map = new HashMap<>();
|
||||
sendJsonPostParamtoNetSignMD5(unReadList,map,112,this);
|
||||
if (UIUtils.isLogined()) {
|
||||
sendJsonPostParamtoNetSignMD5(unReadList,map,112,this);
|
||||
}
|
||||
sendJsonPostParamtoNetSignMD5(Url.myHomeNew,map,111,this);
|
||||
}
|
||||
|
||||
@@ -694,21 +714,28 @@ public class BigHomeFragment extends BaseFragment implements OnCallBackFromNet,
|
||||
else
|
||||
{
|
||||
handleLogout(false);
|
||||
ToastUtil.showToast(homeBean.getMessage());
|
||||
if (UIUtils.isLogined()) {
|
||||
ToastUtil.showToast(homeBean.getMessage());
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
handleLogout(false);
|
||||
ToastUtil.showToast(homeBean.getMessage());
|
||||
if (UIUtils.isLogined()) {
|
||||
ToastUtil.showToast(homeBean.getMessage());
|
||||
}
|
||||
}
|
||||
isfirst=false;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
private void handleLogout(boolean isNotice) {
|
||||
private void handleLogout(boolean isNotice) {
|
||||
if (!UIUtils.isLogined()) {
|
||||
return;
|
||||
}
|
||||
ToastUtil.showMessage("专家账号信息为空");
|
||||
showProgressDialog(getString(R.string.posting_logout));
|
||||
/**
|
||||
@@ -809,6 +836,7 @@ public class BigHomeFragment extends BaseFragment implements OnCallBackFromNet,
|
||||
startActivity(broadc);
|
||||
}
|
||||
} else if (id == R.id.l_message) {
|
||||
if (!UIUtils.checkLoginAndJump(mActivity)) return;
|
||||
startActivity(new Intent(getActivity(), BigNewSystemMessageActivity.class));
|
||||
} else if (id == R.id.tv_top_search) {
|
||||
Intent intentv = new Intent(getActivity(), BigPublicSearchActivity.class);
|
||||
@@ -817,10 +845,13 @@ public class BigHomeFragment extends BaseFragment implements OnCallBackFromNet,
|
||||
} else if (id == R.id.l_change) {
|
||||
changeBig();
|
||||
} else if (id == R.id.big_top_bar) {
|
||||
if (!UIUtils.checkLoginAndJump(mActivity)) return;
|
||||
startActivity(new Intent(mActivity, MyDetailInfoActivity.class));
|
||||
} else if (id == R.id.big_p1) {
|
||||
if (!UIUtils.checkLoginAndJump(mActivity)) return;
|
||||
startActivity(new Intent(mActivity, MyPatientActivity.class));
|
||||
} else if (id == R.id.big_g1) {
|
||||
if (!UIUtils.checkLoginAndJump(mActivity)) return;
|
||||
startActivity(new Intent(mActivity, PublicConsultationActivity.class));
|
||||
} else if (id == R.id.big_v) {
|
||||
startActivity(new Intent(mActivity, BigVideoActivity.class));
|
||||
|
||||
@@ -426,6 +426,12 @@ public class BigMyFragment extends BaseFragment implements View.OnClickListener,
|
||||
{
|
||||
// 从sp文件里取出资料
|
||||
String realName = SharePrefUtil.getString(mActivity, "realName", "");
|
||||
if (!UIUtils.isLogined()) {
|
||||
if (tv_name != null) tv_name.setText("点击登录");
|
||||
if (pic != null) pic.setImageResource(R.drawable.icon_touxiang_persion_gray_big);
|
||||
if (tv_qiandao != null) tv_qiandao.setText("签到");
|
||||
return;
|
||||
}
|
||||
tv_name.setText(realName);
|
||||
String photo = SharePrefUtil.getString(mActivity, "photo", null);
|
||||
if (photo != null && !"null".equals(photo)) {
|
||||
@@ -439,7 +445,10 @@ public class BigMyFragment extends BaseFragment implements View.OnClickListener,
|
||||
}
|
||||
}
|
||||
//年终总结
|
||||
private void getzongjie() {
|
||||
private void getzongjie() {
|
||||
if (!UIUtils.isLogined()) {
|
||||
return;
|
||||
}
|
||||
Map<String,String> map = new HashMap<>();
|
||||
map.put("id","8");
|
||||
sendJsonPostParamtoNetSignMD5(Url.getAppActivity,map,200,this);
|
||||
@@ -448,6 +457,10 @@ public class BigMyFragment extends BaseFragment implements View.OnClickListener,
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
initData();
|
||||
if (UIUtils.isLogined()) {
|
||||
getMyData();
|
||||
}
|
||||
getNewPatientList();
|
||||
String photo = SharePrefUtil.getString(mActivity, "MyChangePhoto", "");
|
||||
if (!StringUtil.isBland(photo) && pic != null) {
|
||||
@@ -497,7 +510,10 @@ public class BigMyFragment extends BaseFragment implements View.OnClickListener,
|
||||
}
|
||||
}
|
||||
//判断用户是否绑定过微信
|
||||
private void isBoundWechatByUuid() {
|
||||
private void isBoundWechatByUuid() {
|
||||
if (!UIUtils.isLogined()) {
|
||||
return;
|
||||
}
|
||||
Map<String,String> map = new HashMap<>();
|
||||
|
||||
sendJsonPostParamtoNetSignMD5(Url.isBoundWechatByUuid,map,207,this);
|
||||
@@ -505,7 +521,11 @@ public class BigMyFragment extends BaseFragment implements View.OnClickListener,
|
||||
/**
|
||||
* 获取新我的数据
|
||||
*/
|
||||
private void getMyData() {
|
||||
private void getMyData() {
|
||||
if (!UIUtils.isLogined()) {
|
||||
dismissLoadingProgress();
|
||||
return;
|
||||
}
|
||||
// showProgressDialog("加载中");
|
||||
showLoadingProgress();
|
||||
Map<String,String> map = new HashMap<>();
|
||||
@@ -518,7 +538,10 @@ public class BigMyFragment extends BaseFragment implements View.OnClickListener,
|
||||
*
|
||||
*
|
||||
*/
|
||||
private void getNewPatientList() {
|
||||
private void getNewPatientList() {
|
||||
if (!UIUtils.isLogined()) {
|
||||
return;
|
||||
}
|
||||
String uuid = SharePrefUtil.getString(mActivity, Constant.uuid, "");
|
||||
RequestParams params = new RequestParams();
|
||||
params.addBodyParameter("expertUuid", uuid);
|
||||
@@ -642,7 +665,10 @@ public class BigMyFragment extends BaseFragment implements View.OnClickListener,
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// AGP 8.0+ R.id 不再是 final 常量,不能用于 switch,改用 if-else
|
||||
int id = v.getId();
|
||||
int id = v.getId();
|
||||
if (id != R.id.r_shezhi && !UIUtils.checkLoginAndJump(mActivity)) {
|
||||
return;
|
||||
}
|
||||
if (id == R.id.bt_nianzong) {
|
||||
if(bean1!=null&&bean1.getData()!=null&&bean1.getData().getUrl_path()!=null)
|
||||
{
|
||||
|
||||
@@ -841,6 +841,9 @@ public class HomeNewFragment extends BaseFragment implements OnClickListener,OnC
|
||||
*/
|
||||
private void getHomeModal() {
|
||||
Map<String,String> map = new HashMap<>();
|
||||
if (!UIUtils.isLogined()) {
|
||||
return;
|
||||
}
|
||||
sendJsonPostParamtoNetSignMD5(Url.homeModalurl,map,GETHOMEMODAL,this);
|
||||
|
||||
|
||||
@@ -863,6 +866,9 @@ public class HomeNewFragment extends BaseFragment implements OnClickListener,OnC
|
||||
public void initMessage()
|
||||
{
|
||||
Map<String,String> map=new HashMap<>();
|
||||
if (!UIUtils.isLogined()) {
|
||||
return;
|
||||
}
|
||||
sendJsonPostParamtoNetSignMD5(unReadList,map,112,this);
|
||||
}
|
||||
|
||||
@@ -920,6 +926,10 @@ public class HomeNewFragment extends BaseFragment implements OnClickListener,OnC
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// TODO Auto-generated method stub
|
||||
if (!UIUtils.checkLoginAndJump(getActivity())) {
|
||||
dialog.dismiss();
|
||||
return;
|
||||
}
|
||||
Intent intent = new Intent(getActivity(), MyQrCodeActivity.class);
|
||||
startActivity(intent);
|
||||
dialog.dismiss();
|
||||
@@ -1021,7 +1031,10 @@ public class HomeNewFragment extends BaseFragment implements OnClickListener,OnC
|
||||
private int patientCount = 0;
|
||||
private int consultCount = 0;
|
||||
|
||||
private void handleLogout(boolean isNotice) {
|
||||
private void handleLogout(boolean isNotice) {
|
||||
if (!UIUtils.isLogined()) {
|
||||
return;
|
||||
}
|
||||
ToastUtil.showMessage("专家账号信息为空");
|
||||
showProgressDialog(getString(R.string.posting_logout));
|
||||
/**
|
||||
@@ -1247,7 +1260,10 @@ public class HomeNewFragment extends BaseFragment implements OnClickListener,OnC
|
||||
*
|
||||
*
|
||||
*/
|
||||
private void getNewPatientList() {
|
||||
private void getNewPatientList() {
|
||||
if (!UIUtils.isLogined()) {
|
||||
return;
|
||||
}
|
||||
String uuid = SharePrefUtil.getString(mActivity, Constant.uuid, "");
|
||||
RequestParams params = new RequestParams();
|
||||
params.addBodyParameter("expertUuid", uuid);
|
||||
@@ -1461,7 +1477,10 @@ public class HomeNewFragment extends BaseFragment implements OnClickListener,OnC
|
||||
/**
|
||||
* 查询系统消息未读数
|
||||
*/
|
||||
private void requestSystemMessageUnreadCount() {
|
||||
private void requestSystemMessageUnreadCount() {
|
||||
if (!UIUtils.isLogined()) {
|
||||
return;
|
||||
}
|
||||
patientCount =NIMClient.getService(MsgService.class).getTotalUnreadCount();
|
||||
consultCount =0;
|
||||
NIMClient.getService(MsgService.class).queryRecentContacts()
|
||||
@@ -1700,9 +1719,9 @@ public class HomeNewFragment extends BaseFragment implements OnClickListener,OnC
|
||||
{
|
||||
if(homeBean.getData()!=null)
|
||||
{
|
||||
if(homeBean.getData().getExpertDetail()==null)
|
||||
if(homeBean.getData().getExpertDetail()==null && UIUtils.isLogined())
|
||||
{
|
||||
handleLogout(false);
|
||||
// handleLogout(false);
|
||||
return;
|
||||
}
|
||||
news_list=homeBean.getData().getNews_list();
|
||||
@@ -1845,8 +1864,13 @@ public class HomeNewFragment extends BaseFragment implements OnClickListener,OnC
|
||||
}
|
||||
else
|
||||
{
|
||||
handleLogout(false);
|
||||
ToastUtil.showToast(homeBean.getMessage());
|
||||
// handleLogout(false);
|
||||
if (UIUtils.isLogined()) {
|
||||
handleLogout(false);
|
||||
ToastUtil.showToast(homeBean.getMessage());
|
||||
} else {
|
||||
initGongge(iconBeans);
|
||||
}
|
||||
}
|
||||
isfirst=false;
|
||||
break;
|
||||
@@ -2017,7 +2041,17 @@ public class HomeNewFragment extends BaseFragment implements OnClickListener,OnC
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.N)
|
||||
private void initGongge(List<HomeBean.IconBean> iconBeans) {
|
||||
private void initGongge(List<HomeBean.IconBean> iconBeans) {
|
||||
if (iconBeans != null && iconBeans.isEmpty()) {
|
||||
HomeBean fallbackBean = homeBean != null ? homeBean : new HomeBean();
|
||||
String[] defaultNames = new String[]{"我的患者", "公益咨询", "肝胆视频", "临床工具", "精品课", "肝胆课件", "指南杂志"};
|
||||
for (String name : defaultNames) {
|
||||
HomeBean.IconBean item = fallbackBean.new IconBean();
|
||||
item.setName(name);
|
||||
item.setImg("");
|
||||
iconBeans.add(item);
|
||||
}
|
||||
}
|
||||
|
||||
if(cellAdapter==null)
|
||||
{
|
||||
@@ -2033,6 +2067,9 @@ public class HomeNewFragment extends BaseFragment implements OnClickListener,OnC
|
||||
public void onItemClick(View view, int position) {
|
||||
if(position==iconBeans.size())
|
||||
{
|
||||
if (!UIUtils.checkLoginAndJump(mActivity)) {
|
||||
return;
|
||||
}
|
||||
startActivityForResult(new Intent(mActivity, MyUserIconActivity.class),MYUSERICON);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -173,7 +173,8 @@ public class MyNewFragment extends BaseFragment implements View.OnClickListener,
|
||||
recycler_honor.setLayoutManager(linearLayoutManagerv);
|
||||
pic=view.findViewById(R.id.pic);
|
||||
pic.setOnClickListener(this);
|
||||
tv_name=view.findViewById(R.id.tv_name);
|
||||
tv_name=view.findViewById(R.id.tv_name);
|
||||
tv_name.setOnClickListener(this);
|
||||
patient_num=view.findViewById(R.id.patient_num);
|
||||
tv_gongyi=view.findViewById(R.id.tv_gongyi);
|
||||
tv_hua=view.findViewById(R.id.tv_hua);
|
||||
@@ -355,6 +356,15 @@ public class MyNewFragment extends BaseFragment implements View.OnClickListener,
|
||||
{
|
||||
// 从sp文件里取出资料
|
||||
String realName = SharePrefUtil.getString(mActivity, "realName", "");
|
||||
if (!UIUtils.isLogined()) {
|
||||
if (tv_name != null) tv_name.setText("点击登录");
|
||||
if (pic != null) pic.setImageResource(R.drawable.icon_touxiang_persion_gray_big);
|
||||
if (patient_num != null) patient_num.setText("0");
|
||||
if (tv_gongyi != null) tv_gongyi.setText("0");
|
||||
if (tv_hua != null) tv_hua.setText("0");
|
||||
if (tv_qiandao != null) tv_qiandao.setText("签到");
|
||||
return;
|
||||
}
|
||||
tv_name.setText(realName);
|
||||
String photo = SharePrefUtil.getString(mActivity, "photo", null);
|
||||
if (photo != null && !"null".equals(photo)) {
|
||||
@@ -368,7 +378,10 @@ public class MyNewFragment extends BaseFragment implements View.OnClickListener,
|
||||
}
|
||||
}
|
||||
//年终总结
|
||||
private void getzongjie() {
|
||||
private void getzongjie() {
|
||||
if (!UIUtils.isLogined()) {
|
||||
return;
|
||||
}
|
||||
Map<String,String> map = new HashMap<>();
|
||||
map.put("id","8");
|
||||
sendJsonPostParamtoNetSignMD5(Url.getAppActivity,map,200,this);
|
||||
@@ -377,7 +390,11 @@ public class MyNewFragment extends BaseFragment implements View.OnClickListener,
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
needreportPage("我的");
|
||||
needreportPage("我的");
|
||||
initData();
|
||||
if (UIUtils.isLogined()) {
|
||||
getMyData();
|
||||
}
|
||||
getNewPatientList();
|
||||
String photo = SharePrefUtil.getString(mActivity, "MyChangePhoto", "");
|
||||
if (!StringUtil.isBland(photo) && pic != null) {
|
||||
@@ -427,7 +444,10 @@ public class MyNewFragment extends BaseFragment implements View.OnClickListener,
|
||||
}
|
||||
}
|
||||
//判断用户是否绑定过微信
|
||||
private void isBoundWechatByUuid() {
|
||||
private void isBoundWechatByUuid() {
|
||||
if (!UIUtils.isLogined()) {
|
||||
return;
|
||||
}
|
||||
Map<String,String> map = new HashMap<>();
|
||||
|
||||
sendJsonPostParamtoNetSignMD5(Url.isBoundWechatByUuid,map,207,this);
|
||||
@@ -435,7 +455,10 @@ public class MyNewFragment extends BaseFragment implements View.OnClickListener,
|
||||
/**
|
||||
* 获取新我的数据
|
||||
*/
|
||||
private void getMyData() {
|
||||
private void getMyData() {
|
||||
if (!UIUtils.isLogined()) {
|
||||
return;
|
||||
}
|
||||
// showProgressDialog("加载中");
|
||||
Map<String,String> map = new HashMap<>();
|
||||
sendJsonPostParamtoNetSignMD5(Url.myNew,map,111,this);
|
||||
@@ -447,7 +470,10 @@ public class MyNewFragment extends BaseFragment implements View.OnClickListener,
|
||||
*
|
||||
*
|
||||
*/
|
||||
private void getNewPatientList() {
|
||||
private void getNewPatientList() {
|
||||
if (!UIUtils.isLogined()) {
|
||||
return;
|
||||
}
|
||||
String uuid = SharePrefUtil.getString(mActivity, Constant.uuid, "");
|
||||
RequestParams params = new RequestParams();
|
||||
params.addBodyParameter("expertUuid", uuid);
|
||||
@@ -571,7 +597,14 @@ public class MyNewFragment extends BaseFragment implements View.OnClickListener,
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// AGP 8.0+ R.id 不再是 final 常量,不能用于 switch,改用 if-else
|
||||
int id = v.getId();
|
||||
int id = v.getId();
|
||||
if (id != R.id.r_shezhi && !UIUtils.checkLoginAndJump(mActivity)) {
|
||||
return;
|
||||
}
|
||||
if (id == R.id.tv_name) {
|
||||
startActivity(new Intent(mActivity, MyDetailInfoActivity.class));
|
||||
return;
|
||||
}
|
||||
if (id == R.id.bt_nianzong) {
|
||||
if(bean1!=null&&bean1.getData()!=null&&bean1.getData().getUrl_path()!=null)
|
||||
{
|
||||
|
||||
+6
@@ -522,6 +522,9 @@ public class CourseDetailPolyvPlayerActivity extends AppCompatActivity implement
|
||||
r_e.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (!UIUtils.checkLoginAndJump(CourseDetailPolyvPlayerActivity.this)) {
|
||||
return;
|
||||
}
|
||||
Intent intent=new Intent(CourseDetailPolyvPlayerActivity.this, EvaluateActivity.class);
|
||||
intent.putExtra("excellentcourse_id",excellentcourse_id);
|
||||
intent.putExtra("p_id","");
|
||||
@@ -1487,6 +1490,9 @@ public class CourseDetailPolyvPlayerActivity extends AppCompatActivity implement
|
||||
handleBackAction();
|
||||
break;
|
||||
case R.id.r_buy:
|
||||
if (!UIUtils.checkLoginAndJump(CourseDetailPolyvPlayerActivity.this)) {
|
||||
return;
|
||||
}
|
||||
MobclickAgent.onEvent(CourseDetailPolyvPlayerActivity.this,EXPERT_CLASS_QUALITY_PAY);
|
||||
Intent intent=new Intent(CourseDetailPolyvPlayerActivity.this, PayClassActivity.class);
|
||||
intent.putExtra("price",im_yuan.getText().toString());
|
||||
|
||||
@@ -231,7 +231,7 @@ public class GuideUI extends AppCompatActivity implements ViewPager.OnPageChange
|
||||
// startActivity(new Intent(this, LoginActivity.class));
|
||||
// }
|
||||
// 打开登录
|
||||
startActivity(new Intent(this, LoginNewActivity.class));
|
||||
startActivity(new Intent(this, MainActivity.class));
|
||||
|
||||
finish();
|
||||
}
|
||||
|
||||
@@ -305,7 +305,7 @@ public class WelcomeUI extends Activity implements AnimationListener {
|
||||
// }
|
||||
|
||||
if (isOpenMainPager) {
|
||||
if (UIUtils.isLogined()) {
|
||||
if (true || UIUtils.isLogined()) {
|
||||
// 已经打开过一次主界面, 直接进入主界面.
|
||||
// ( 1.待审核 2.审核中 3.需要补充修改资料 4.再次提交审核 5.拒绝 6.已通过)
|
||||
// int state = SharePrefUtil.getInt(WelcomeUI.this,
|
||||
@@ -333,7 +333,7 @@ public class WelcomeUI extends Activity implements AnimationListener {
|
||||
} else {
|
||||
// 打开登录
|
||||
Intent intent = new Intent();
|
||||
intent.setClass(WelcomeUI.this, LoginNewActivity.class);
|
||||
intent.setClass(WelcomeUI.this, MainActivity.class);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
|
||||
@@ -62,7 +62,23 @@ import io.dcloud.feature.unimp.config.UniMPOpenConfiguration;
|
||||
*/
|
||||
|
||||
public class MyUserIconUtil {
|
||||
public static void myIntent(Context context,String name){
|
||||
public static void myIntent(Context context,String name){
|
||||
if (name == null) {
|
||||
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) || name.contains("微信")
|
||||
|| "病例讨论".equals(name) || "病例交流".equals(name) || "病例荟萃".equals(name)
|
||||
|| "病例分享".equals(name) || "科研项目".equals(name) || "临床研究".equals(name)) {
|
||||
if (!UIUtils.checkLoginAndJump(context)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if ("肝胆新闻".equals(name)||"肝胆时讯".equals(name)){
|
||||
// context.startActivity(new Intent(context, GandanConsultActivity.class));
|
||||
UniappUtil.showUniMp(context, "/pages_app/newsList/newsList", null);
|
||||
|
||||
@@ -13,6 +13,9 @@ import android.widget.Toast;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import cn.shangyu.gdxzExpert.activity.LoginNewActivity;
|
||||
import cn.shangyu.gdxzExpert.application.BaseApplication;
|
||||
/**
|
||||
*
|
||||
@@ -173,7 +176,28 @@ public class UIUtils {
|
||||
*/
|
||||
public static boolean isLogined() {
|
||||
// TODO Auto-generated method stub
|
||||
return SharePrefUtil.getBoolean(getContext(), Constant.IS_LOGIN, false);
|
||||
boolean isLogin = SharePrefUtil.getBoolean(getContext(), Constant.IS_LOGIN, false);
|
||||
String uuid = SharePrefUtil.getString(getContext(), Constant.uuid, "");
|
||||
return isLogin && !StringUtil.isEmpty(uuid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验是否已登录,未登录则拉起登录页
|
||||
*
|
||||
* @param context 上下文
|
||||
* @return true 已登录;false 未登录(已跳转登录页)
|
||||
*/
|
||||
public static boolean checkLoginAndJump(Context context) {
|
||||
if (isLogined()) {
|
||||
return true;
|
||||
}
|
||||
Context targetContext = context != null ? context : getContext();
|
||||
Intent intent = new Intent(targetContext, LoginNewActivity.class);
|
||||
if (!(targetContext instanceof Activity)) {
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
}
|
||||
targetContext.startActivity(intent);
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isBackground() {
|
||||
|
||||
@@ -106,6 +106,9 @@ public class UniappUtil {
|
||||
|
||||
private static void showInternal(Context context, String targetPath, com.alibaba.fastjson.JSONObject pageParams) {
|
||||
try {
|
||||
if (!UIUtils.checkLoginAndJump(context)) {
|
||||
return;
|
||||
}
|
||||
String uuid = SharePrefUtil.getString(context, Constant.uuid, "");
|
||||
if(StringUtil.isEmpty(uuid)){
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user