|
|
@@ -444,10 +444,12 @@ public class ViewUtil {
|
|
|
mdProcessDialog.cancel();
|
|
|
}
|
|
|
}, 1000);
|
|
|
- if (ct instanceof Activity) {
|
|
|
- if (((Activity) ct) instanceof MainActivity) {
|
|
|
- } else {
|
|
|
- ct.startActivity(new Intent(ct, DataDownloadActivity.class));
|
|
|
+ if (!hasErp){
|
|
|
+ if (ct instanceof Activity) {
|
|
|
+ if (((Activity) ct) instanceof MainActivity) {
|
|
|
+ } else {
|
|
|
+ ct.startActivity(new Intent(ct, DataDownloadActivity.class));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
sendBrodcast("B2B");
|
|
|
@@ -523,7 +525,6 @@ public class ViewUtil {
|
|
|
} else if (map.getPlatform().equals("B2B")) {
|
|
|
b2b_uu = map.getAccount();
|
|
|
erp_phone=phone;
|
|
|
- LoginB2BTask(phone, password);//登录B2B
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -541,6 +542,12 @@ public class ViewUtil {
|
|
|
} else if (erpEntities.size() > 1) {
|
|
|
loginERPItemDialog(phone, password);
|
|
|
}
|
|
|
+ if (erpEntities.size()>0) {
|
|
|
+ hasErp=true;
|
|
|
+ }else{
|
|
|
+ hasErp=false;
|
|
|
+ }
|
|
|
+ LoginB2BTask(phone, password);//登录B2B
|
|
|
} else {
|
|
|
mdProcessDialog.setContent("手机号或者密码失败!");
|
|
|
handler.postDelayed(new Runnable() {
|
|
|
@@ -550,10 +557,9 @@ public class ViewUtil {
|
|
|
}
|
|
|
}, 2000);
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- ;
|
|
|
+ };
|
|
|
|
|
|
+ private static boolean hasErp=true;//是否有erp
|
|
|
/**
|
|
|
* @author LiuJie
|
|
|
* @功能:比较两个日期大小
|
|
|
@@ -793,4 +799,17 @@ public class ViewUtil {
|
|
|
intent_web.putExtra("p", text);
|
|
|
ct.startActivity(intent_web);
|
|
|
}
|
|
|
+
|
|
|
+ public static void clearAccount(Context ct){
|
|
|
+ CommonUtil.clearSharedPreferences(ct, "erp_baseurl");
|
|
|
+ CommonUtil.clearSharedPreferences(ct, "erp_master");
|
|
|
+ CommonUtil.clearSharedPreferences(ct, "erp_commpany");
|
|
|
+ CommonUtil.clearSharedPreferences(ct, "erp_uu");
|
|
|
+ CommonUtil.clearSharedPreferences(ct, "erp_masterId");
|
|
|
+ CommonUtil.clearSharedPreferences(ct, "erp_login");
|
|
|
+ CommonUtil.clearSharedPreferences(ct, "b2b_login");
|
|
|
+ CommonUtil.clearSharedPreferences(ct, "b2b_uu");
|
|
|
+ CommonUtil.clearSharedPreferences(ct, "Master_ch");
|
|
|
+
|
|
|
+ }
|
|
|
}
|