Selaa lähdekoodia

提交人:jtm
提交内容:异常弹窗显示逻辑

江天明 1 vuosi sitten
vanhempi
commit
ffa5dd3a0c

+ 18 - 6
BusinessCommon/src/main/java/com/develop/common/ui/CommonBindingActivity.kt

@@ -268,15 +268,30 @@ abstract class CommonBindingActivity<T : ViewBinding> : BaseBindingActivity<T>()
 
     @Subscribe
     fun onCookDevMsgEvent(event: DevPromptEvent) {
-        Log.d("设备返回", "msg=>${event.msg}==action=>${event.action}==errorCode=>${CofarSDK.devInfo().errCode}")
+        Log.d(
+            "设备返回",
+            "msg=>${event.msg}==action=>${event.action}==errorCode=>${CofarSDK.devInfo().errCode}" +
+                    "==mode=>${CofarSDK.devInfo().mode.mode}"
+        )
         if (!this.equals(TopResumedAtyHolder.getCurrentActivity())) {
             return
         }
+        //当前errcode不是0,并且提示是程序完成的提示不需要显示
         if (CofarSDK.devInfo().errCode.toInt() != 0 && event.msg == "dev_end_of_run_tips") {
             return
         }
 
-        if("hide" == event.action){
+        //称重模式下,非电子称重异常的提示,都不用提示
+        if (CofarSDK.devInfo().isWeightStatus && event.msg != "dian_zi_cheng_tong_xin_yi_chan") {
+            return
+        }
+
+        //切碎模式下,电子称重异常不用提示
+        if (CofarSDK.devInfo().mode.mode == "TURBO" && event.msg == "dian_zi_cheng_tong_xin_yi_chan"){
+            return
+        }
+
+        if ("hide" == event.action) {
             lastMsg = "";
             cancelConfirmDialog.removeSelf()
             return
@@ -291,9 +306,6 @@ abstract class CommonBindingActivity<T : ViewBinding> : BaseBindingActivity<T>()
             return
         }
         lastMsg = event.msg
-        if (lastMsg == "dian_zi_cheng_tong_xin_yi_chan" && CofarSDK.devInfo().mode.mode  != "WEIGHT") {
-            return
-        }
 //        if (isWidget && lastMsg != "dian_zi_cheng_tong_xin_yi_chan") {
 //            return
 //        }
@@ -339,7 +351,7 @@ abstract class CommonBindingActivity<T : ViewBinding> : BaseBindingActivity<T>()
 
 
     @Subscribe
-    fun closeEvent(event: FullScreenTransparentDialog.CloseDialogEvent){
+    fun closeEvent(event: FullScreenTransparentDialog.CloseDialogEvent) {
         cancelConfirmDialog.onConfirmClick()
     }