2
This commit is contained in:
@@ -1199,6 +1199,20 @@ public class MainActivity extends BaseActivity implements
|
||||
|
||||
public void onCheckedChanged(RadioGroup group, int checkedId) {
|
||||
|
||||
if (!UIUtils.isLogined() && (checkedId == R.id.tab_rbn_kepu || checkedId == R.id.tab_rbn_donation)) {
|
||||
BaseApplication.auto_show_unimp = false;
|
||||
main_radiogroup.setOnCheckedChangeListener(null);
|
||||
if (checkedId == R.id.tab_rbn_donation) {
|
||||
mRb_meeting.setTextColor(getResources().getColor(R.color.tab_text_nor));
|
||||
mRb_meeting.setCompoundDrawablesWithIntrinsicBounds(null,
|
||||
getResources().getDrawable(R.drawable.home_my_meeting_nor), null, null);
|
||||
mRb_meeting.setChecked(false);
|
||||
}
|
||||
main_radiogroup.check(current_tab_id);
|
||||
main_radiogroup.setOnCheckedChangeListener(this);
|
||||
UIUtils.checkLoginAndJump(MainActivity.this);
|
||||
return;
|
||||
}
|
||||
BaseApplication.auto_show_unimp = true;
|
||||
|
||||
/** 改变文字的颜色 */
|
||||
@@ -1303,7 +1317,9 @@ public class MainActivity extends BaseActivity implements
|
||||
mRb_meeting.setCompoundDrawablesWithIntrinsicBounds(null,
|
||||
getResources().getDrawable(R.drawable.home_my_meeting_nor), null, null);
|
||||
|
||||
mRb_meeting.setChecked(false);
|
||||
main_radiogroup.setOnCheckedChangeListener(null);
|
||||
mRb_meeting.setChecked(false);
|
||||
main_radiogroup.setOnCheckedChangeListener(this);
|
||||
|
||||
// if(current_tab_id == R.id.tab_rbn_home){
|
||||
// mRb_home.setTextColor(getResources().getColor(R.color.tab_text_sel));
|
||||
@@ -2100,7 +2116,7 @@ public class MainActivity extends BaseActivity implements
|
||||
protected void onResume() {
|
||||
|
||||
LogUtil.i("onResume: ", current_tab_id+"");
|
||||
if((current_tab_id == R.id.tab_rbn_donation || current_tab_id == R.id.tab_rbn_kepu) && BaseApplication.auto_show_unimp){
|
||||
if(UIUtils.isLogined() && (current_tab_id == R.id.tab_rbn_donation || current_tab_id == R.id.tab_rbn_kepu) && BaseApplication.auto_show_unimp){
|
||||
long current_timestmp = System.currentTimeMillis();
|
||||
//防止无限循环打开
|
||||
if(current_timestmp - BaseApplication.auto_show_unimp_timestamp > 1.5 * 1000){
|
||||
|
||||
@@ -716,7 +716,10 @@ public class SettingAndHelpActivity extends BaseActivity implements OnCallBackFr
|
||||
SharePrefUtil.saveString(ctx, Constant.uuid, "");
|
||||
SharePrefUtil.saveString(ctx, Constant.USERID, "");
|
||||
SharePrefUtil.saveString(ctx, "access_token", "");
|
||||
SharePrefUtil.saveString(ctx, "refresh_token", "");
|
||||
SharePrefUtil.saveString(ctx, "refresh_token", "");
|
||||
SharePrefUtil.saveString(ctx, Constant.realName, "");
|
||||
SharePrefUtil.saveString(ctx, "hospitalName", "");
|
||||
SharePrefUtil.saveString(ctx, Constant.photo, "");
|
||||
addUMToken("");
|
||||
Intent intent = new Intent(ctx, LoginNewActivity.class);
|
||||
intent.putExtra("flag", true);
|
||||
|
||||
@@ -676,7 +676,14 @@ public class HomeNewFragment extends BaseFragment implements OnClickListener,OnC
|
||||
private void initBanner( List<HomeBean.NewsBean> datas)
|
||||
{
|
||||
List<CustomViewsInfo> data = new ArrayList<>();
|
||||
for (HomeBean.NewsBean bean:datas)
|
||||
final boolean showStudioSlide = UIUtils.isLogined();
|
||||
if (datas != null) {
|
||||
int startIndex = (showStudioSlide || datas.size() <= 1) ? 0 : 1;
|
||||
for (int i = startIndex; i < datas.size(); i++) {
|
||||
data.add(new CustomViewsInfo(datas.get(i)));
|
||||
}
|
||||
}
|
||||
if (false) for (HomeBean.NewsBean bean:datas)
|
||||
{
|
||||
data.add(new CustomViewsInfo(bean));
|
||||
}
|
||||
@@ -699,7 +706,7 @@ public class HomeNewFragment extends BaseFragment implements OnClickListener,OnC
|
||||
TextView mIv_name = view.findViewById(R.id.doctor_name);
|
||||
TextView mIv_positionName = view.findViewById(R.id.positionName);
|
||||
ImageView im_gg=view.findViewById(R.id.im_gg);
|
||||
if(position==0)
|
||||
if(showStudioSlide && position==0)
|
||||
{
|
||||
|
||||
// //得到AssetManager
|
||||
@@ -757,7 +764,7 @@ public class HomeNewFragment extends BaseFragment implements OnClickListener,OnC
|
||||
// startReport(reportBeans);
|
||||
|
||||
MobclickAgent.onEvent(mainActivity, EXPERT_HOME_SHUFFLING);
|
||||
if(position==0)
|
||||
if(showStudioSlide && position==0)
|
||||
{
|
||||
startActivity(new Intent(mActivity, MyDetailInfoActivity.class));
|
||||
needreportHome("首页",realName+"专家工作室");
|
||||
|
||||
@@ -187,12 +187,20 @@ public class UIUtils {
|
||||
* @param context 上下文
|
||||
* @return true 已登录;false 未登录(已跳转登录页)
|
||||
*/
|
||||
private static long lastJumpLoginTime = 0L;
|
||||
|
||||
public static boolean checkLoginAndJump(Context context) {
|
||||
if (isLogined()) {
|
||||
return true;
|
||||
}
|
||||
long now = System.currentTimeMillis();
|
||||
if (now - lastJumpLoginTime < 800) {
|
||||
return false;
|
||||
}
|
||||
lastJumpLoginTime = now;
|
||||
Context targetContext = context != null ? context : getContext();
|
||||
Intent intent = new Intent(targetContext, LoginNewActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
if (!(targetContext instanceof Activity)) {
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
}
|
||||
|
||||
@@ -75,6 +75,9 @@ public class UniappUtil {
|
||||
public static void showUniMp(Context context, String targetPath, com.alibaba.fastjson.JSONObject pageParams) {
|
||||
try {
|
||||
|
||||
if (!UIUtils.checkLoginAndJump(context)) {
|
||||
return;
|
||||
}
|
||||
checkWgt(context, targetPath, pageParams);
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
Reference in New Issue
Block a user