Bladeren bron

更改扭橙

zhangshenjie 11 maanden geleden
bovenliggende
commit
99470c9f1c

+ 9 - 0
BusinessAirFryer/src/main/assets/config_000.json

@@ -89,6 +89,15 @@
       "devMode": "SOUP",
       "listShow": true
     },
+    {
+      "type": "CITRUS_JUICER",
+      "name": "citrus_juicer",
+      "bg": "ic_mode_citrus_juicer",
+      "icon": "ic_grid_citrus_juicer",
+      "devMode": "SOUP",
+      "listShow": true
+    },
+
     {
       "type": "AF_DIY",
       "name": "af_diy",

+ 205 - 0
BusinessAirFryer/src/main/assets/config_000_5067.json

@@ -0,0 +1,205 @@
+{
+  "baseQrUrl": "https://icook.cofarcn.com/h5/index.html",
+  "workModes": [
+    {
+      "type": "ADAPTED_COOKING",
+      "name": "adapted_cooking",
+      "bg": "ic_mode_diy",
+      "icon": "ic_grid_adapted_cooking",
+      "devMode": "SOUP",
+      "listShow": true
+    },
+    {
+      "type": "COOK_EGGS",
+      "name": "cook_eggs",
+      "bg": "cm_icon_cook_eggs_bg",
+      "icon": "cm_icon_cook_eggs",
+      "devMode": "SOUP",
+      "listShow": false
+    },
+    {
+      "type": "WIGHT",
+      "name": "wight",
+      "bg": "ic_mode_weight",
+      "icon": "ic_grid_weight",
+      "devMode": "SOUP",
+      "listShow": true
+    },
+    {
+      "type": "BOIL_WATER",
+      "name": "boil_water",
+      "bg": "ic_mode_boil_water",
+      "icon": "ic_grid_boil_water",
+      "devMode": "SOUP",
+      "listShow": true
+    },
+    {
+      "type": "CHOP",
+      "name": "chop",
+      "bg": "ic_mode_chop",
+      "icon": "ic_grid_chop",
+      "devMode": "SOUP",
+      "listShow": true
+    },
+    {
+      "type": "SLOW_COOK",
+      "name": "slow_cook",
+      "bg": "ic_mode_slow_cook",
+      "icon": "ic_grid_slow_cook",
+      "devMode": "SOUP",
+      "listShow": true
+    },
+    {
+      "type": "ROAST",
+      "name": "roast",
+      "bg": "cm_icon_roast",
+      "icon": "cm_icon_roast",
+      "devMode": "SOUP",
+      "listShow": false
+    },
+    {
+      "type": "KNEAD_TOUGH",
+      "name": "knead_dough",
+      "bg": "ic_mode_knead_dough",
+      "icon": "ic_grid_knead_dough",
+      "devMode": "SOUP",
+      "listShow": true
+    },
+    {
+      "type": "STEAM",
+      "name": "steam",
+      "bg": "ic_mode_steam",
+      "icon": "ic_grid_steam",
+      "devMode": "SOUP",
+      "listShow": true
+    },
+    {
+      "type": "FOOD_PROCESSOR",
+      "name": "food_processor",
+      "bg": "ic_mode_food_processor",
+      "icon": "ic_grid_food_processor",
+      "devMode": "SOUP",
+      "listShow": true
+    },
+    {
+      "type": "TURBO",
+      "name": "turbo",
+      "bg": "ic_mode_turbo",
+      "icon": "ic_grid_turbo",
+      "devMode": "SOUP",
+      "listShow": true
+    },
+    {
+      "type": "AF_DIY",
+      "name": "af_diy",
+      "bg": "af_diy_bg",
+      "icon": "af_diy",
+      "devMode": "AIR_FRYER",
+      "listShow": false
+    },
+    {
+      "type": "AF_AIR_FRYER",
+      "name": "af_air_fryer",
+       "bg": "af_air_fryer_bg",
+      "icon": "af_air_fryer",
+      "devMode": "AIR_FRYER",
+      "listShow": true
+    },
+    {
+      "type": "WIGHT",
+      "name": "wight",
+      "bg": "ic_mode_weight",
+      "icon": "ic_grid_weight",
+      "devMode": "AIR_FRYER",
+      "listShow": true
+    },
+    {
+      "type": "AF_BAKE",
+      "name": "af_bake",
+      "bg": "af_bake_bg",
+      "icon": "af_bake",
+      "devMode": "AIR_FRYER",
+      "listShow": true
+    },
+    {
+      "type": "AF_DRUMSTICKS",
+      "name": "af_drumsticks",
+      "bg": "af_drumsticks_bg",
+      "icon": "af_drumsticks",
+      "devMode": "AIR_FRYER",
+      "listShow": true
+    },
+    {
+      "type": "AF_EGG_TART",
+      "name": "af_egg_tart",
+      "bg": "af_egg_tart_bg",
+      "icon": "af_egg_tart",
+      "devMode": "AIR_FRYER",
+      "listShow": true
+    },
+    {
+      "type": "AF_PIZZA",
+      "name": "af_pizza",
+      "bg": "af_pizza_bg",
+      "icon": "af_pizza",
+      "devMode": "AIR_FRYER",
+      "listShow": true
+    },
+    {
+      "type": "AF_DEHYDRATE",
+      "name": "af_dehydrate",
+      "bg": "af_dehydrate_bg",
+      "icon": "af_dehydrate",
+      "devMode": "AIR_FRYER",
+      "listShow": true
+    },
+    {
+      "type": "AF_REHEAT",
+      "name": "af_reheat",
+      "bg": "af_reheat_bg",
+      "icon": "af_reheat",
+      "devMode": "AIR_FRYER",
+      "listShow": true
+    },
+    {
+      "type": "AF_CHICKEN_WING",
+      "name": "af_chicken_wing",
+      "bg": "af_chicken_wing_bg",
+      "icon": "af_chicken_wing",
+      "devMode": "AIR_FRYER",
+      "listShow": true
+    },
+    {
+      "type": "AF_STEAK",
+      "name": "af_steak",
+      "bg": "af_steak_bg",
+      "icon": "af_steak",
+      "devMode": "AIR_FRYER",
+      "listShow": true
+    },
+    {
+      "type": "AF_SEA_FOOD",
+      "name": "af_sea_food",
+      "bg": "af_sea_food_bg",
+      "icon": "af_sea_food",
+      "devMode": "AIR_FRYER",
+      "listShow": true
+    },
+    {
+      "type": "AF_VEGETABLE",
+      "name": "af_vegetable",
+      "bg": "af_vegetable_bg",
+      "icon": "af_vegetable",
+      "devMode": "AIR_FRYER",
+      "listShow": true
+    },
+    {
+      "type": "AF_MUTTON_CHOP",
+      "name": "af_mutton_chop",
+      "bg": "af_mutton_chop_bg",
+      "icon": "af_mutton_chop",
+      "devMode": "AIR_FRYER",
+      "listShow": true
+    }
+  ]
+}

+ 30 - 0
BusinessCommon/src/main/java/com/develop/common/ui/CommonBindingActivity.kt

@@ -520,4 +520,34 @@ abstract class CommonBindingActivity<T : ViewBinding> : BaseBindingActivity<T>()
     private fun confirmChange() {
 
     }
+    fun  showMsgDialog(msg :String){
+        lastMsg = msg
+        cancelConfirmDialog.showCancel = false
+        cancelConfirmDialog.showConfirm = true
+
+        cancelConfirmDialog.confirmStr = resources.getString(
+            resources.getIdentifier(
+                "pmpt_confirm", "string", this.packageName
+            )
+        )
+        cancelConfirmDialog.title =lastMsg
+//            resources.getString(resources.getIdentifier("pmpt_msg", "string", this.packageName))
+
+        cancelConfirmDialog.showDialog(supportFragmentManager, "confirmCancelDialog")
+
+        cancelConfirmDialog.onDialogClickListener =
+            object : CancelConfirmDialog.OnDialogClickListener {
+                override fun onConfirm() {
+
+                    cancelConfirmDialog.removeSelf();
+                    lastMsg = "";
+                }
+
+                override fun onCancel() {
+                    cancelConfirmDialog.removeSelf();
+                    lastMsg = "";
+                }
+
+            }
+    }
 }

BIN
BusinessCommon/src/main/res/drawable-xxxhdpi/ic_grid_citrus_juicer.png


BIN
BusinessCommon/src/main/res/drawable-xxxhdpi/ic_mode_citrus_juicer.png


+ 3 - 0
BusinessCommon/src/main/res/values-en/strings.xml

@@ -48,6 +48,7 @@ Nanfang plus client is an online information platform developed and operated by
     <string name="steam">STEAM</string>
     <string name="food_processor">FOOD PROCESSOR</string>
     <string name="turbo">TURBO</string>
+    <string name="citrus_juicer">CITRUS_JUICER</string>
     <string name="language">LANGUAGE</string>
     <string name="sound">SOUND</string>
     <string name="brightness">BRIGHTNESS</string>
@@ -142,6 +143,7 @@ Nanfang plus client is an online information platform developed and operated by
     <string name="pmpt_cancel">Cancel</string>
     <string name="pmpt_msg">Tips</string>
     <string name="dev_end_of_run_tips">Finish!</string>
+    <string name="dev_not_orange_parts">Please install the Twisted Orange accessory to start the Twisted Orange program。</string>
     <string name="hight_temp_warning_tips">The current temperature exceeds 60, and the motor speed exceeds the third gear. Are you sure to continue?</string>
     <string name="hight_temp_turbo_tips">The current temperature exceeds 60, turbo function cannot be operated</string>
     <string name="update_msg">System updating, please wait~</string>
@@ -207,6 +209,7 @@ Nanfang plus client is an online information platform developed and operated by
     <string name="update_recipe_title">Recipe update</string>
     <string name="restore_confirm_tips">Are you sure to restore to the factory settings?</string>
     <string name="change_lang_tips">The program is running, please close the program to perform this operation again!</string>
+    <string name="recipe_not_language">The recipe language does not match, please switch languages</string>
     <string name="exit_weight_align">Exit calibration</string>
     <string name="weight_aligning">Calibrating..</string>
     <string name="weight_one_kg_tips">Please put on weight 1 KGS</string>

+ 3 - 0
BusinessCommon/src/main/res/values/strings.xml

@@ -53,6 +53,7 @@ Nanfang plus client is an online information platform developed and operated by
     <string name="steam">STEAM</string>
     <string name="food_processor">FOOD PROCESSOR</string>
     <string name="turbo">TURBO</string>
+    <string name="citrus_juicer">CITRUS_JUICER</string>
     <string name="language">LANGUAGE</string>
     <string name="sound">SOUND</string>
     <string name="brightness">BRIGHTNESS</string>
@@ -145,6 +146,7 @@ Nanfang plus client is an online information platform developed and operated by
     <string name="pmpt_cancel">Cancel</string>
     <string name="pmpt_msg">Tips</string>
     <string name="dev_end_of_run_tips">Finish!</string>
+    <string name="dev_not_orange_parts">Please install the Twisted Orange accessory to start the Twisted Orange program。</string>
     <string name="hight_temp_warning_tips">The current temperature exceeds 60, and the motor speed exceeds the third gear. Are you sure to continue?</string>
     <string name="hight_temp_turbo_tips">The current temperature exceeds 60, turbo function cannot be operated</string>
     <string name="update_msg">System updating, please wait~</string>
@@ -215,6 +217,7 @@ Nanfang plus client is an online information platform developed and operated by
     <string name="update_recipe_title">Recipe update</string>
     <string name="restore_confirm_tips">Are you sure to restore to the factory settings?</string>
     <string name="change_lang_tips">The program is running, please close the program to perform this operation again!</string>
+    <string name="recipe_not_language">The recipe language does not match, please switch languages</string>
     <string name="exit_weight_align">Exit calibration</string>
     <string name="weight_aligning">Calibrating..</string>
     <string name="weight_one_kg_tips">Please put on weight 1 KGS</string>

+ 4 - 7
BusinessSetting/src/main/java/com/develop/setting/ui/SettingMainActivity.kt

@@ -217,7 +217,6 @@ class SettingMainActivity : CommonBindingActivity<ActivitySettingMainBinding>()
     }
 
     private fun getDevNetwork(num: Int) {
-        println("TAG 涂鸦请求 : $num")
         //处理wifi点击回来
         if (getNetwork()) {
             //连接上wifi就调用涂鸦接口
@@ -239,10 +238,9 @@ class SettingMainActivity : CommonBindingActivity<ActivitySettingMainBinding>()
     fun tuyaList(num: Int) {
         //代码重连
         if (num > 3) {
-
+            getAppTuya(true)
             return
         }
-        println("TAG 涂鸦请求1111111111111")
         this.apply {
             scopeNetLife {
                 val result = Post<DevInfoResult>(Api.DEV_INFO) {
@@ -251,7 +249,6 @@ class SettingMainActivity : CommonBindingActivity<ActivitySettingMainBinding>()
                 getInitTuya(result)
             }.catch {
                 var nums = num + 1
-                println("TAG 涂鸦请求5555555555555")
                 Handler().postDelayed({ tuyaList(nums) }, 1000)
 
             }
@@ -259,7 +256,6 @@ class SettingMainActivity : CommonBindingActivity<ActivitySettingMainBinding>()
     }
 
     fun getInitTuya(result: DevInfoResult) {
-        println("TAG 涂鸦请求成功")
         if (result.tuyaLicense != null) {
             result.tuyaLicense?.let {
                 TuyaUtils.mAk = it.ak
@@ -272,9 +268,7 @@ class SettingMainActivity : CommonBindingActivity<ActivitySettingMainBinding>()
                 tuyaEvent()
             }
         } else {
-            println("TAG 本地配置")
             getAppTuya(true)
-            tuyaEvent()
         }
     }
 
@@ -292,6 +286,9 @@ class SettingMainActivity : CommonBindingActivity<ActivitySettingMainBinding>()
             MMkvUtils.save(ISTUYA, false)
         }
 
+        tuyaEvent()
+
+
     }
 
     @SuppressLint("NotifyDataSetChanged")

+ 63 - 23
BusinessStep/src/main/java/com/develop/step/ui/ModesDetailActivity.kt

@@ -224,7 +224,7 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
         isModelNum = getModelNum()
         if (!isNightTheme()) {
             var color =
-                if (is062) com.develop.common.R.color.white else if(is011) com.develop.common.R.color.view_change_011 else com.develop.common.R.color.view_change
+                if (is062) com.develop.common.R.color.white else if (is011) com.develop.common.R.color.view_change_011 else com.develop.common.R.color.view_change
             binding.ivBack.drawable?.apply {
                 DrawableCompat.setTint(
                     this,
@@ -251,6 +251,15 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
         modeType = lastModeType
         workMode = ConfigUtils.getMode(modeType)
         sdkDevMode = CofarSDK.devInfo().devMode
+
+        /**
+         * 需求:扭橙模式一打开,如果没有扭橙汁配件时需要提示
+         * CofarSDK.devInfo().resetZero.toInt()==1 代表已经是扭橙汁配件
+         * */
+        if (modeType==WorkModes.CITRUS_JUICER&&CofarSDK.devInfo().resetZero.toInt()!=1){
+            showMsgDialog(resources.getString(com.develop.common.R.string.dev_not_orange_parts))
+        }
+
         if (!isNightTheme()) {
             if (workMode == null) {
                 binding.ivBanner.setImageResource(com.develop.common.R.drawable.ic_mode_diy)
@@ -476,7 +485,7 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
         } else if (mRunningState == DevStatus.RUNNING.toInt() || currDevInfo.status == DevStatus.PAUSE.toInt()) {
             stopClick()
         } else if (mRunningState == DevStatus.STOP.toInt()) {
-            setResult(50, Intent().putExtra("type",true))
+            setResult(50, Intent().putExtra("type", true))
             finish()
 //            startClick()
         }
@@ -710,37 +719,54 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
             }
         }
 
-        ////devInfo.potStatus 0是有锅  1是没锅
-        //处理换锅问题
-        if (isModelNum == "5037" && event.devInfo.potStatus.toInt() == 1) {
-            // isDevModes 避免重复刷新
+
+        //处理扭橙问题 扭橙 resetZero ==1 //普通 resetZero ==0
+        if (event.devInfo.resetZero.toInt() == 1) {
+            navigateTo(Screens.Cook.COOK_MODES) {
+                val bundle = Bundle()
+                bundle.putString(MODE_TYPE, WorkModes.CITRUS_JUICER)
+                bundle.putString(
+                    "mode_name",
+                    resources.getString(com.develop.common.R.string.citrus_juicer)
+                )
+                with(bundle)
+            }
+            finish()
+        } else {
+            ////devInfo.potStatus 0是有锅  1是没锅
+            //处理换锅问题
+            if (isModelNum == "5037" && event.devInfo.potStatus.toInt() == 1) {
+                // isDevModes 避免重复刷新
 //            if (isDevModes && workMode?.devMode!=DevModes.SOUP) {
 //                isDevModes = false
 //                CofarSDK.changeDevModeFocus(DevModes.SOUP)
 //                return
 //            }
-        } else if (isModelNum == "5037" && event.devInfo.potStatus.toInt() == 0 && workMode?.type != "WIGHT") {
-            /**
-             * 由于客户无锅状态下是默认汤锅列表,但是在一进来是空炸锅,拿出来(无锅的时候已经换了汤锅模式),
-             * 但重新放空炸锅,onDevModeChange 是不会回调的,固需要用potCoverType 锅盖协议来判断是否需要重新换模式
-             * */
-            //potCoverType 0 是汤锅 1是空炸
-            if (event.devInfo.potCloverType.toInt() == 1 && devMode == DevModes.SOUP) {
-                CofarSDK.changeDevModeFocus(DevModes.AIR_FRYER)
-                return
-            } else if (event.devInfo.potCloverType.toInt() == 0 && devMode == DevModes.AIR_FRYER) {
-                CofarSDK.changeDevModeFocus(DevModes.SOUP)
-                return
+            } else if (isModelNum == "5037" && event.devInfo.potStatus.toInt() == 0 && workMode?.type != "WIGHT") {
+                /**
+                 * 由于客户无锅状态下是默认汤锅列表,但是在一进来是空炸锅,拿出来(无锅的时候已经换了汤锅模式),
+                 * 但重新放空炸锅,onDevModeChange 是不会回调的,固需要用potCoverType 锅盖协议来判断是否需要重新换模式
+                 * */
+                //potCoverType 0 是汤锅 1是空炸
+                if (event.devInfo.potCloverType.toInt() == 1 && devMode == DevModes.SOUP) {
+                    CofarSDK.changeDevModeFocus(DevModes.AIR_FRYER)
+                    return
+                } else if (event.devInfo.potCloverType.toInt() == 0 && devMode == DevModes.AIR_FRYER) {
+                    CofarSDK.changeDevModeFocus(DevModes.SOUP)
+                    return
+                }
+                isDevModes = true
+
             }
-            isDevModes = true
 
+
+            //处理中途换换锅问题
+            if (sdkDevMode != event.devInfo.devMode) {
+                return
+            }
         }
 
 
-        //处理中途换换锅问题
-        if (sdkDevMode != event.devInfo.devMode) {
-            return
-        }
 
         ThreadUtils.runOnMainThread {
             currDevInfo = event.devInfo
@@ -1922,6 +1948,15 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
 //            if (CofarSDK.devInfo().potCloverStatus.toInt() == 1) {
 //                showPotCloverDialog()
 //            }
+            /**
+             * 需求:扭橙模式一打开,如果没有扭橙汁配件时需要提示
+             * CofarSDK.devInfo().resetZero.toInt()==1 代表已经是扭橙汁配件
+             * */
+            if (modeType==WorkModes.CITRUS_JUICER&&CofarSDK.devInfo().resetZero.toInt()!=1){
+                showMsgDialog(resources.getString(com.develop.common.R.string.dev_not_orange_parts))
+                return
+            }
+
             if (CofarSDK.devInfo().potStatus.toInt() == 1) {
                 showErrMsgDialog("mei_fang_guo_yi_chan")
             } else if (CofarSDK.devInfo().potStatus.toInt() == 0 && CofarSDK.devInfo().potCloverStatus.toInt() == 1) {
@@ -2426,5 +2461,10 @@ class ModesDetailActivity : CommonBVMActivity<ActivityModeDetailBinding, ModesVi
         }
     }
 
+    override fun onNewIntent(intent: Intent?) {
+        super.onNewIntent(intent)
+
+    }
+
 
 }

+ 1 - 1
BusinessStep/src/main/java/com/develop/step/ui/recipes_detail/CookDetailActivity.kt

@@ -139,7 +139,7 @@ class CookDetailActivity : CommonBVMActivity<ActivityCookDetailBinding, CookDeta
                 recipeNumber = number
                 var appLanger  = MMkvUtils.getString(CURRENT_LANGUAGE)
                 if (!appLanger.equals(language)){
-                    ToastUtils.showShort("Please switch to the corresponding language to open this recipe")
+                    ToastUtils.showShort(resources.getString(com.develop.common.R.string.recipe_not_language))
                     finish()
                 }
             }

+ 8 - 8
app/build.gradle

@@ -13,7 +13,7 @@ ext {
     versionCode = Integer.parseInt(new SimpleDateFormat("yyMMddHH").format(new Date()) + 1)
 //    versionCode=230617180
 //    brandCode="033F"
-    brandCode = "032D"
+    brandCode = "000A"
     model = "1039"
 
 }
@@ -366,7 +366,7 @@ android {
 
              resValue("string", "app_theme", "@style/SplashTheme")
             buildConfigField("String", "UpdatePlatform", "\"normal\"")
-            buildConfigField("String", "model", "\"5037\"")
+            buildConfigField("String", "model", "\"1039\"")
             buildConfigField("String", "brandCode", "\"000A\"")
             //appCode 1.01 指向bug修复,2.01指向功能变更
             buildConfigField("String", "appCode", "\"1.01\"")
@@ -409,12 +409,12 @@ android {
 //            //appCode 1.01 指向bug修复,2.01指向功能变更
 //            buildConfigField("String", "appCode", "\"1.01\"")
 
-            buildConfigField("String", "UpdatePlatform", "\"normal\"")
-            resValue("string", "app_theme", "@style/SplashTheme")
-            buildConfigField("String", "model", "\"1039\"")
-            buildConfigField("String", "brandCode", "\"030A\"")
-            //appCode 1.01 指向bug修复,2.01指向功能变更
-            buildConfigField("String", "appCode", "\"1.01\"")
+//            buildConfigField("String", "UpdatePlatform", "\"normal\"")
+//            resValue("string", "app_theme", "@style/SplashTheme")
+//            buildConfigField("String", "model", "\"1039\"")
+//            buildConfigField("String", "brandCode", "\"030A\"")
+//            //appCode 1.01 指向bug修复,2.01指向功能变更
+//            buildConfigField("String", "appCode", "\"1.01\"")
 
 
 

+ 2 - 2
libBase/src/main/java/com/develop/base/ext/GlobaExt.kt

@@ -208,7 +208,7 @@ fun getSN(): String {
 //        return "045A21030020123010190001"
 //    return "000A30150020123010190001"
 //     return "002A30150020123010190001"
-//     return "000A10390020123010190001"
+     return "000A10390020123010190001"
 //        return "000A50370020123010190005"/
 //    return "010D10390020123010190001"
 //        return "011A10390020123010190001"
@@ -217,7 +217,7 @@ fun getSN(): String {
 //        return "011A50370020123010190004"
 //    return "007D20020020123010190001"
 //        return "036I21060020123010190007"
-        return "030A10390020123010190004"
+//        return "030A10390020123010190004"
 //    return  "017A20060020123010190001"
 //        return  "017A10390020123010190001"
 //    return "010D10390020123010190001"

BIN
libThirdPart/libs/cofar-cooking-device-sdk-0.0.1-SNAPSHOT.jar