Administrator 3 rokov pred
rodič
commit
6fb90b2414

+ 3 - 1
build/jsb-link/frameworks/runtime-src/proj.android-studio/app/src/com/zedu/cocos/congming/app/device/DeviceClientZedu.java

@@ -50,7 +50,9 @@ public class DeviceClientZedu extends OkgoTask implements DeviceClient {
                 if (code == ResponseCode.RES_SUCCESS) {
                     if (result.data != null) {
                         Logger.d("更新设备信息:%s", JSON.toJSONString(result.data));
-                        mBus.post(new com.zedu.cocos.congming.app.device.DeviceEvent(result.data));
+                        DeviceEvent deviceEvent = new DeviceEvent(result.data);
+                        mDevicePrefs.status().put(deviceEvent.device.status);
+                        mBus.post(deviceEvent);
                     }
                 }
             }

+ 2 - 0
build/jsb-link/frameworks/runtime-src/proj.android-studio/app/src/com/zedu/cocos/congming/page/device/DeviceActivity.java

@@ -9,6 +9,7 @@ import com.qmuiteam.qmui.widget.dialog.QMUIDialog;
 import com.qmuiteam.qmui.widget.grouplist.QMUICommonListItemView;
 import com.qmuiteam.qmui.widget.grouplist.QMUIGroupListView;
 import com.zedu.R;
+import com.zedu.cocos.congming.page.activate.ActivateActivity_;
 import com.zedu.core.global.ErrorEvent;
 import com.zedu.cocos.congming.app.base.ZeduFragmentActivity;
 import com.zedu.cocos.congming.app.device.DeviceEntity.DeviceRegisterEntity;
@@ -39,6 +40,7 @@ import cn.finalteam.toolsfinal.StringUtils;
 import static com.qmuiteam.qmui.widget.grouplist.QMUICommonListItemView.ACCESSORY_TYPE_CHEVRON;
 import static com.qmuiteam.qmui.widget.grouplist.QMUICommonListItemView.ACCESSORY_TYPE_NONE;
 import static com.qmuiteam.qmui.widget.grouplist.QMUICommonListItemView.HORIZONTAL;
+import static com.zedu.core.global.GlobalConfig.APP_COCOS_CMB_ID;
 
 @DataBound
 @EActivity(R.layout.widget_grouplist)

+ 2 - 30
build/jsb-link/frameworks/runtime-src/proj.android-studio/app/src/com/zedu/cocos/congming/page/launcher/LauncherActivity.java

@@ -81,7 +81,7 @@ public class LauncherActivity extends BaseFragmentActivity {
     @Bean(OrganClientZedu.class)
     OrganClient mOrganClient;
     public static String deviceId;
-    private boolean nextStartExit = false;
+    public static boolean nextStartExit = true;
 
     @Override
     protected void onCreate(@Nullable Bundle savedInstanceState) {
@@ -130,9 +130,6 @@ public class LauncherActivity extends BaseFragmentActivity {
     protected void onStart() {
         super.onStart();
         initPermission();
-        if(nextStartExit) {
-            finish();
-        }
     }
 
     public void gotoMain() {
@@ -218,31 +215,6 @@ public class LauncherActivity extends BaseFragmentActivity {
         }
     }
 
-
-    @Subscribe(threadMode = ThreadMode.MAIN)
-    public void initEvent(Object object) {
-        super.initEvent(object);
-        //此处验证设备是否被禁用
-        if (object instanceof DeviceEvent) {
-            DeviceEntity.DeviceRegisterEntity entity = ((DeviceEvent) object).device;
-            mDevicePrefs.status().put(entity.status);
-            if(entity.status == 1){
-                ActivateActivity_.intent(this).packageName(APP_COCOS_CMB_ID).start();
-                return;
-            }
-        }
-
-        //此处验证机构是否欠费
-        if (object instanceof ArrearsEvent) {
-            OrganEntity entity = ((ArrearsEvent) object).organ;
-            if (entity == null || entity.isArrears.equals(1)) {
-                arrears(((ArrearsEvent) object).message);
-            } else {
-                gotoMain();
-            }
-        }
-    }
-
     Dialog dialog;
 
     /**
@@ -267,7 +239,7 @@ public class LauncherActivity extends BaseFragmentActivity {
     public void startAppActivity() {
         Intent intent = new Intent(this, AppActivity.class);
         this.startActivity(intent);
-        nextStartExit = true;
+        finish();
     }
 
 }