Browse Source

错误提交 报废

SpringBoots 8 years ago
parent
commit
0f133b0cd3

+ 13 - 45
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/net/ViewUtil.java

@@ -308,7 +308,7 @@ public class ViewUtil {
                     Bundle bundle = new Bundle();
                     Message message = new Message();
                     bundle.putString("result", "{\n" +
-                            "\"exception\":\"网络未连接!\"\n" +
+                            "\"exception\":\""+MyApplication.getInstance().getString(R.string.common_notlinknet)+"!\"\n" +
                             "}");
                     message.setData(bundle);
                     message.what = Constants.APP_SOCKETIMEOUTEXCEPTION;
@@ -351,7 +351,7 @@ public class ViewUtil {
                 } else {
                     Bundle bundle = new Bundle();
                     Message message = new Message();
-                    bundle.putString("result", "{\"exception\":\"网络未连接\"}");
+                    bundle.putString("result", "{\"exception\":\""+MyApplication.getInstance().getString(R.string.common_notlinknet)+"\"}");
                     message.setData(bundle);
                     message.what = what;
                     handler.sendMessage(message);
@@ -367,7 +367,7 @@ public class ViewUtil {
         ViewUtil.ct = ct;
         mdProcessDialog = new MaterialDialog.Builder(ct).title(
                 MyApplication.getInstance().getString(R.string.app_dialog_title))
-                .content("登录验证中,请稍等...")
+                .content(MyApplication.getInstance().getString(R.string.login_progress_erp))
                 .progress(true, 0)
                 .progressIndeterminateStyle(false)
                 .build();
@@ -394,20 +394,6 @@ public class ViewUtil {
 
     }
 
-/*    public static void LoginTaskERP(String user_phone, String user_password, Context ct) {
-        ViewUtil.ct = ct;
-        String url = Constants.BASE_URL_LOGIN;
-        Map<String, String> params = new HashMap<String, String>();
-        params.put("user", user_phone);
-        params.put("password", user_password);
-        Message message = new Message();
-        Bundle bundle = new Bundle();
-        bundle.putString("phone", user_phone);
-        bundle.putString("password", user_password);
-        startNetThread(url, params, handler, Constants.SUCCESS_LOGIN, message,
-                bundle, "get");
-    }*/
-
     public static void showDialogB2B(final String phone, final String password, final List<LoginEntity.Spaces> models) {
         String[] items = new String[models.size()];
 //        int select = 0;
@@ -418,7 +404,7 @@ public class ViewUtil {
 //            return;
 //        } else {
         new MaterialDialog.Builder(ct)
-                .title("选择公司")
+                .title(MyApplication.getInstance().getString(R.string.login_company_select))
                 .items(items)
                 .itemsCallbackSingleChoice(0,
                         new MaterialDialog.ListCallbackSingleChoice() {
@@ -435,14 +421,14 @@ public class ViewUtil {
                                 }
                                 return true;
                             }
-                        }).positiveText("确定").show();
+                        }).positiveText(MyApplication.getInstance().getString(R.string.common_sure)).show();
 //        }
 
     }
 
     // 登录B2B
     public static void LoginB2BTask(String phone, String password, Integer spaceId) {
-        mdProcessDialog.setContent("正在验证B2B...");
+        mdProcessDialog.setContent(MyApplication.getInstance().getString(R.string.login_progress_b2b));
         String url = ApiConfig.getInstance(ApiUtils.getApiModel()).getmApiBase().login;
         Map<String, String> params = new HashMap<String, String>();
         params.put("appId", "b2b");
@@ -484,7 +470,7 @@ public class ViewUtil {
                         }
                     } catch (Exception e) {
                         e.printStackTrace();
-                        ToastMessage(ct, "登录失败,请重新登录!", Style.holoRedLight, 3000);
+                        ToastMessage(ct, MyApplication.getInstance().getString(R.string.login_error_erp), Style.holoRedLight, 3000);
                     }
                     break;
                 case Constants.SUCCESS_B2B:
@@ -523,12 +509,11 @@ public class ViewUtil {
 
     public static void ChangeStatusERP(String result, boolean isBrodcast) {
         if (mdProcessDialog != null) {
-            mdProcessDialog.setContent("UAS验证成功!");
+            mdProcessDialog.setContent(MyApplication.getInstance().getString(R.string.login_success_erp));
         }
         if (ct == null) ct = MyApplication.getInstance();
         Map<String, Object> dataMap = FlexJsonUtil.fromJson(result);
         try {
-            Log.i("Arison", "ChangeStatusERP:" + dataMap.get("sessionId").toString());
             CommonUtil.setSharedPreferences(ct, "sessionId",
                     dataMap.get("sessionId").toString());
             CommonUtil.setSharedPreferences(ct, "erp_username",
@@ -547,8 +532,6 @@ public class ViewUtil {
             CommonUtil.setSharedPreferences(ct, "erp_emname", String.valueOf(dataMap.get("emname")));
         }
         if (erp_phone != null) {
-            Log.i("login_status", "ChangeStatusERP:" + erp_phone);
-            Log.i("login_status", "ChangeStatusERP:" + erp_password);
             CommonUtil.setSharedPreferences(ct, "user_phone", erp_phone);
             CommonUtil.setSharedPreferences(ct, "user_password", erp_password);
         }
@@ -574,7 +557,7 @@ public class ViewUtil {
         if (!new JsonValidator().validate(result)) return;
         if (JSON.parseObject(result).getBoolean("success") == null) {
             if (mdProcessDialog == null) return;
-            mdProcessDialog.setContent("平台登录失败!");
+            mdProcessDialog.setContent(MyApplication.getInstance().getString(R.string.login_error_b2b));
             mdProcessDialog.show();
             handler.postDelayed(new Runnable() {
                 @Override
@@ -584,17 +567,14 @@ public class ViewUtil {
             }, 1500);
             return;
         }
-        LogUtil.d("b2b login:" + result);
         if (erp_phone != null) {
-            Log.i("login_status", "ChangeStatusB2B:" + erp_phone);
-            Log.i("login_status", "ChangeStatusB2B:" + erp_password);
             CommonUtil.setSharedPreferences(ct, "user_phone", erp_phone);
             CommonUtil.setSharedPreferences(ct, "user_password", erp_password);
         }
         if (ct == null) ct = MyApplication.getInstance();
         CommonUtil.setSharedPreferences(ct, "b2b_login", true);
         CommonUtil.setSharedPreferences(ct, "b2b_uu", b2b_uu);
-        mdProcessDialog.setContent("验证B2B成功!");
+        mdProcessDialog.setContent(MyApplication.getInstance().getString(R.string.login_success_b2b));
         handler.postDelayed(new Runnable() {
             @Override
             public void run() {
@@ -777,7 +757,7 @@ public class ViewUtil {
             }
 
         } else {
-            mdProcessDialog.setContent("手机号或者密码失败!");
+            mdProcessDialog.setContent(MyApplication.getInstance().getString(R.string.login_error_info));
             handler.postDelayed(new Runnable() {
                 @Override
                 public void run() {
@@ -1021,7 +1001,7 @@ public class ViewUtil {
                     Bundle bundle = new Bundle();
                     Message message = new Message();
                     bundle.putString("result", "{\n" +
-                            "\"exception\":\"网络未连接!\"\n" +
+                            "\"exception\":\""+MyApplication.getInstance().getString(R.string.common_notlinknet)+"\"\n" +
                             "}");
                     message.setData(bundle);
                     message.what = Constants.APP_SOCKETIMEOUTEXCEPTION;
@@ -1035,7 +1015,7 @@ public class ViewUtil {
     // 登录ERP
     public static void LoginERPTask(String url, String master, String username,
                                     String password) {
-        mdProcessDialog.setContent("正在验证ERP...");
+        mdProcessDialog.setContent(MyApplication.getInstance().getString(R.string.login_progress_erp));
         url = url + "mobile/login.action";
         Map<String, String> params = new HashMap<String, String>();
         params.put("username", username);
@@ -1058,18 +1038,6 @@ public class ViewUtil {
         ct.startActivity(intent_web);
     }
 
-    /**
-     * @注释:跳转嵌入网页页面
-     * @param: url 经过登录验证之后的URL路径跳转
-     * text 客户端嵌入网页页面动态显示文字
-     */
-//    public static void webLinks(Context ct, String url, String text, boolean isCookie) {
-//        Intent intent_web = new Intent(ct, WebViewCommActivity.class);
-//        intent_web.putExtra("url", url);
-//        intent_web.putExtra("p", text);
-//        intent_web.putExtra("cookie", isCookie);
-//        ct.startActivity(intent_web);
-//    }
 
     /**
      * @desc:清楚登录信息

+ 10 - 0
WeiChat/src/main/res/values-en/strings.xml

@@ -1385,4 +1385,14 @@
 
     <string name="my_data">My data</string>
     <string name="clear_completed">Clear Completed</string>
+
+    <!--login-->
+    <string name="login_success_erp">UAS validation successful!</string>
+    <string name="login_success_b2b">B2B validation successful!</string>
+    <string name="login_error_b2b">B2B validation failed!</string>
+    <string name="login_error_erp">UAS validation failed!</string>
+    <string name="login_error_info">Mobile phone number or password error!</string>
+    <string name="login_progress_b2b">Validating B2B...</string>
+    <string name="login_progress_erp">Validating UAS...</string>
+    <string name="login_company_select">Select company</string>
 </resources>

+ 10 - 0
WeiChat/src/main/res/values-zh-rCN/strings.xml

@@ -1486,4 +1486,14 @@
     <string name="currency">币种</string>
     <string name="my_data">我的资料</string>
     <string name="clear_completed">清除完毕</string>
+
+    <!--login-->
+    <string name="login_success_erp">UAS验证成功!</string>
+    <string name="login_success_b2b">验证B2B成功!</string>
+    <string name="login_error_b2b">平台登录失败!</string>
+    <string name="login_error_erp">UAS验证失败!</string>
+    <string name="login_error_info">手机号或者密码错误!</string>
+    <string name="login_progress_b2b">正在验证B2B...</string>
+    <string name="login_progress_erp">正在验证UAS...</string>
+    <string name="login_company_select">选择公司</string>
 </resources>

+ 10 - 0
WeiChat/src/main/res/values-zh-rTW/strings.xml

@@ -1482,4 +1482,14 @@
 
     <string name="my_data">我的資料</string>
     <string name="clear_completed">清除完畢</string>
+
+    <!--login-->
+    <string name="login_success_erp">UAS驗證成功!</string>
+    <string name="login_success_b2b">B2B驗證成功!</string>
+    <string name="login_error_b2b">B2B登录失敗!</string>
+    <string name="login_error_erp">UAS驗證失敗!</string>
+    <string name="login_error_info">手机号或者密码错误!</string>
+    <string name="login_progress_b2b">正在驗證B2B...</string>
+    <string name="login_progress_erp">正在驗證UAS...</string>
+    <string name="login_company_select">選擇公司</string>
 </resources>

+ 11 - 0
WeiChat/src/main/res/values/strings.xml

@@ -1768,4 +1768,15 @@
     <string name="c_point">·</string>
     <string name="c_equal">完成</string>
 
+    
+    <!--login-->
+    <string name="login_success_erp">UAS验证成功!</string>
+    <string name="login_success_b2b">验证B2B成功!</string>
+    <string name="login_error_b2b">平台登录失败!</string>
+    <string name="login_error_erp">UAS验证失败!</string>
+    <string name="login_error_info">手机号或者密码错误!</string>
+    <string name="login_progress_b2b">正在验证B2B...</string>
+    <string name="login_progress_erp">正在验证UAS...</string>
+    <string name="login_company_select">选择公司</string>
+    
 </resources>