Просмотр исходного кода

订阅1.订阅号闪退
2.任务不刷新
3.定时提醒签到
4.并代码

Bitliker 9 лет назад
Родитель
Сommit
516cc09044

+ 3 - 3
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/MyFriendActivity.java

@@ -95,7 +95,7 @@ public class MyFriendActivity extends BaseActivity {
         if (isPeculiar)
             getSupportActionBar().setTitle("常用联系人");
         else
-            getSupportActionBar().setTitle("我的好友");
+            getSupportActionBar().setTitle("UU好友");
         mSortFriends = new ArrayList<>();
         allFriends = new ArrayList<>();
         mBaseComparator = new BaseComparator<Friend>();
@@ -164,7 +164,7 @@ public class MyFriendActivity extends BaseActivity {
         mTextDialog = (TextView) findViewById(R.id.text_dialog);
         mSideBar = (SideBar) findViewById(R.id.sidebar);
         mSideBar.setTextView(mTextDialog);
-        mPullToRefreshListView.setEmptyView(R.layout.view_empty);
+//        mPullToRefreshListView.setEmptyView(R.layout.view_empty);
         mSideBar.setOnTouchingLetterChangedListener(new SideBar.OnTouchingLetterChangedListener() {
             @Override
             public void onTouchingLetterChanged(String s) {
@@ -221,7 +221,7 @@ public class MyFriendActivity extends BaseActivity {
                     intent.putExtra(AppConstant.EXTRA_NICK_CODE, friend.getPhone());
                     intent.putExtra("friend", friend);
                 }
-                startActivity(intent);
+                startActivityForResult(intent,0x20);
             }
         });
         mPullToRefreshListView.getRefreshableView().setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {

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

@@ -92,18 +92,20 @@ public class ViewUtil {
 
     private static String oldMsg;
     private static long time;
+
     /**
      * 弹出Toast消息
      * 间隔时间不超过三秒的重复信息不会反复弹出
+     *
      * @param msg
      */
     public static void ToastMessage(Context cont, String msg) {
         if (cont instanceof Activity) {
-            if (!msg.equals(oldMsg)){
+            if (!msg.equals(oldMsg)) {
                 Crouton.makeText((Activity) cont, msg, cont.getResources().getColor(R.color.light_green), 3000).show();
                 time = System.currentTimeMillis();
             } else {
-                if ((System.currentTimeMillis() - time) > 3000){
+                if ((System.currentTimeMillis() - time) > 3000) {
                     Crouton.makeText((Activity) cont, msg, cont.getResources().getColor(R.color.light_green), 3000).show();
                     time = System.currentTimeMillis();
                 }
@@ -156,8 +158,8 @@ public class ViewUtil {
                 result = hClient.sendPostRequest(url, params);
             }
         } catch (Exception e) {
-            CommonUtil.getExceptionStack(ct,e,true);
-            Log.i("HttpResquest", "getDataFromServer"+CommonUtil.getExceptionStack(ct,e,true));
+            CommonUtil.getExceptionStack(ct, e, true);
+            Log.i("HttpResquest", "getDataFromServer" + CommonUtil.getExceptionStack(ct, e, true));
             handler.sendEmptyMessage(Constants.SocketTimeoutException);
         }
         return result;
@@ -358,7 +360,11 @@ public class ViewUtil {
                         ToastMessage(MyApplication.getInstance(),
                                 JSON.parseObject(msg.getData().getString("result")).getString("exception"));
                     } else {
-                        ToastMessage(MyApplication.getInstance(), "系统内部错误!");
+                        boolean isNetHas = CommonUtil.isNetWorkConnected(ct);
+                        if (isNetHas)
+                            ToastMessage(MyApplication.getInstance(), "系统内部错误!");
+                        else
+                            ToastMessage(MyApplication.getInstance(), MyApplication.getInstance().getResources().getString(R.string.networks_out));
                     }
                     break;
                 default:
@@ -395,7 +401,7 @@ public class ViewUtil {
             CommonUtil.setSharedPreferences(ct, "erp_uu", String.valueOf(dataMap.get("uu")));
             CommonUtil.setSharedPreferences(ct, "erp_masterId", erp_masterId);
             CommonUtil.setSharedPreferences(ct, "erp_login", true);
-            CommonUtil.setSharedPreferences(ct,"erp_emname",String.valueOf(dataMap.get("emname")));
+            CommonUtil.setSharedPreferences(ct, "erp_emname", String.valueOf(dataMap.get("emname")));
         }
         if (erp_phone != null) {
             Log.i("login_status", "ChangeStatusERP:" + erp_phone);
@@ -461,17 +467,17 @@ public class ViewUtil {
     private static void loginERPItemDialog(final String phone,
                                            final String password) {
         String[] items = new String[erpEntities.size()];
-        int select=0;
+        int select = 0;
         for (int j = 0; j < erpEntities.size(); j++) {
             items[j] = erpEntities.get(j).getName();
         }
         if (CommonUtil.isDialogShowing(loginERPDialog)) {
             return;
         } else {
-            if (loginERPDialog!=null) {
-             select= loginERPDialog.getSelectedIndex();
+            if (loginERPDialog != null) {
+                select = loginERPDialog.getSelectedIndex();
             }
-         
+
             loginERPDialog = new MaterialDialog.Builder(ct)
                     .title("选择登录的UAS账套")
                     .items(items)
@@ -480,28 +486,28 @@ public class ViewUtil {
                                 @Override
                                 public boolean onSelection(MaterialDialog dialog,
                                                            View view, int which, CharSequence text) {
-                                    LogUtil.d("onSelection:"+which);
+                                    LogUtil.d("onSelection:" + which);
                                     if (!StringUtils.isEmpty(text.toString())) {
 //                                        for (int j2 = 0; j2 < erpEntities.size(); j2++) {
 //                                            if (text.toString().equals(
 //                                                    erpEntities.get(j2).getName())) {
-                                             
-                                                LoginEntity entity = erpEntities
-                                                        .get(which);
-                                                erp_phone = phone;
-                                                erp_password = password;
-                                                erp_username = entity.getAccount();
-                                                erp_master = entity.getMaster();
-                                                erp_baseurl = entity.getWebsite();
-                                                erp_company = entity.getName();
-                                                erp_uu = String.valueOf(entity
-                                                        .getEnuu());
-                                                erp_masterId = String.valueOf(entity.getMasterId());
-                                                LoginERPTask(entity.getWebsite(),
-                                                        entity.getMaster(), phone, password);
-                                                //清除账套列表缓存
-                                                CommonUtil.clearSharedPreferences(ct, "erp_masterlist");
-                                                
+
+                                        LoginEntity entity = erpEntities
+                                                .get(which);
+                                        erp_phone = phone;
+                                        erp_password = password;
+                                        erp_username = entity.getAccount();
+                                        erp_master = entity.getMaster();
+                                        erp_baseurl = entity.getWebsite();
+                                        erp_company = entity.getName();
+                                        erp_uu = String.valueOf(entity
+                                                .getEnuu());
+                                        erp_masterId = String.valueOf(entity.getMasterId());
+                                        LoginERPTask(entity.getWebsite(),
+                                                entity.getMaster(), phone, password);
+                                        //清除账套列表缓存
+                                        CommonUtil.clearSharedPreferences(ct, "erp_masterlist");
+
 //                                            }
 //                                        }
                                     }
@@ -523,12 +529,12 @@ public class ViewUtil {
         String phone = msg.getData().getString("phone");
         String password = msg.getData().getString("password");
         Log.i("Login", "login sucess:" + json);
-        if(new JsonValidator().validate(json)){
+        if (new JsonValidator().validate(json)) {
             showDialogCompany(json, phone, password);
-        }else{
-            ToastMessage(ct,"接口数据非法!");
+        } else {
+            ToastMessage(ct, "接口数据非法!");
         }
-        
+
     }
 
     private static void showDialogCompany(String json, String phone, String password) {

+ 2 - 2
WeiChat/src/main/res/layout/activity_oa_alarma.xml

@@ -62,7 +62,7 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_centerVertical="true"
-            android:text="上班时间提醒"
+            android:text="上班打卡提醒"
             android:textSize="@dimen/text_main" />
 
         <!--<ImageView-->
@@ -97,7 +97,7 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_centerVertical="true"
-            android:text="下班时间提醒"
+            android:text="下班打卡提醒"
             android:textSize="@dimen/text_main" />
 
         <!--<ImageView-->