清泛IT社区App Inventor 2 中文社区

搜索

扫码访问移动社区 移动社区,您的掌上技术专家

关注我,精彩不错过! 关注我,精彩不错过!

扫码安装最新版AI伴侣 最新版AI伴侣v2.76

Aia StoreApp上架指南 .aia 源码一站式解决方案 发布日志AI2连接测试ai2Starter模拟器

AppInventor2离线版中文教育版接入DeepSeek VIP会员 享专有教程,免费赠送基础版*技术支持服务! AI2入门必读中文文档AI2拓展IoT专题

查看: 1929|回复: 23
打印 上一主题 下一主题

[解决中] AI助手重构版问题记录

  • TA的每日心情
    开心
    16 小时前
  • 签到天数: 794 天

    [LV.10]以坛为家III

    1119

    主题

    1877

    帖子

    5万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    53225

    AI2中文网VIP弹球达人接水果达人撸猫达人

    跳转到指定楼层
    楼主
    发表于 2026-03-06 21:20:51 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
    组件 WeatherWeb(Web) 没有事件 "WebError",已拒绝添加
    [
      {
        "action": "ADD_BLOCK_INTENT",
        "intent": [
          {
            "event": "QueryButton.Click",
            "do": [
              {
                "call": "Notifier1.ShowAlert",
                "args": {
                  "notice": "正在查询天气..."
                }
              },
              {
                "call": "WeatherWeb.Get",
                "args": {
                  "url": {
                    "join": [
                      "https://api.weatherapi.com/v1/current.json?key=demo&q=",
                      {
                        "get_prop": "CityTextBox.Text"
                      },
                      "&lang=zh"

                  }
                }
              }

          },
          {
            "event": "WeatherWeb.GotText",
            "do": [
              {
                "local_var": "response",
                "value": {
                  "call": "WeatherWeb.JsonTextDecodeWithDictionaries",
                  "args": {
                    "jsonText": {
                      "get_var": "responseContent"
                    }
                  }
                },
                "do": [
                  {
                    "set_prop": "TempValueLabel.Text",
                    "value": {
                      "join": [
                        {
                          "dict_lookup": {
                            "key": "temp_c",
                            "dict": {
                              "dict_lookup": {
                                "key": "current",
                                "dict": {
                                  "get_var": "response"
                                },
                                "default_val": {
                                  "dict": []
                                }
                              }
                            },
                            "default_val": "--"
                          }
                        },
                        "°C"

                    }
                  },
                  {
                    "set_prop": "WeatherValueLabel.Text",
                    "value": {
                      "dict_lookup": {
                        "key": "condition",
                        "dict": {
                          "dict_lookup": {
                            "key": "current",
                            "dict": {
                              "get_var": "response"
                            },
                            "default_val": {
                              "dict": []
                            }
                          }
                        },
                        "default_val": "--"
                      }
                    }
                  },
                  {
                    "set_prop": "HumidityValueLabel.Text",
                    "value": {
                      "join": [
                        {
                          "dict_lookup": {
                            "key": "humidity",
                            "dict": {
                              "dict_lookup": {
                                "key": "current",
                                "dict": {
                                  "get_var": "response"
                                },
                                "default_val": {
                                  "dict": []
                                }
                              }
                            },
                            "default_val": "--"
                          }
                        },
                        "%"

                    }
                  }

              }

          },
          {
            "event": "WeatherWeb.GotFile",
            "do": [
              {
                "call": "Notifier1.ShowAlert",
                "args": {
                  "notice": "天气数据获取成功"
                }
              }

          },
          {
            "event": "WeatherWeb.TimedOut",
            "do": [
              {
                "call": "Notifier1.ShowAlert",
                "args": {
                  "notice": "请求超时,请检查网络"
                }
              }

          },
          {
            "event": "WeatherWeb.WebError",
            "do": [
              {
                "call": "Notifier1.ShowAlert",
                "args": {
                  "notice": {
                    "join": [
                      "网络错误: ",
                      {
                        "get_var": "errorMessage"
                      }

                  }
                }
              }

          }

      },
      {
        "action": "CLEANUP_BLOCKS"
      }



    App Inventor 2 中文网 - MIT同步更新的中文本土化平台!v2.76 支持Android 15 & iOS 更新日志
  • TA的每日心情
    开心
    16 小时前
  • 签到天数: 794 天

    [LV.10]以坛为家III

    1119

    主题

    1877

    帖子

    5万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    53225

    AI2中文网VIP弹球达人接水果达人撸猫达人

    24#
    发表于 2026-03-08 20:55:21 | 只看该作者
    我来修正代码块,将ListView的Clear方法替换为正确的Elements属性设置。

    [ai-commands 块1,已执行]

    [ai-commands 块1,已执行] 是个什么鬼
    抱歉,这是我的回复格式问题。我来重新生成正确的代码块部分。

    [ai-commands 块1,已执行]

    还是一样
    我来重新生成代码块部分,修正ListView的Clear方法问题。

    [ai-commands 块1,已执行]
    App Inventor 2 中文网 - MIT同步更新的中文本土化平台!v2.76 支持Android 15 & iOS 更新日志
  • TA的每日心情
    开心
    16 小时前
  • 签到天数: 794 天

    [LV.10]以坛为家III

    1119

    主题

    1877

    帖子

    5万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    53225

    AI2中文网VIP弹球达人接水果达人撸猫达人

    23#
    发表于 2026-03-07 23:31:03 | 只看该作者
    ode-0.js:168944 getBuiltinDrawerNames: drawerName = Procedures
    wlog @ ode-0.js:168944
    ode-0.js:223644 Sat Mar 07 23:30:45 GMT+800 2026 com.google.appinventor.client.Ode
    INFO: Locking Screens
    ode-0.js:10332 Saving fileId src/appinventor/ai_admin/bb/Screen5.scm for projectId 4868637487792128
    ode-0.js:223644 Sat Mar 07 23:30:45 GMT+800 2026 com.google.appinventor.client.Ode
    INFO: Unlocking Screens
    ode-3.js:15752 [AI] JSON 修复全部失败(含 eval 兜底)
    $jsRepairAndNormalizeJson @ ode-3.js:15752
    ode-3.js:15753 [AI] 原文长度: 4235 字符
    $jsRepairAndNormalizeJson @ ode-3.js:15753
    ode-3.js:15754 [AI] 原文前500字符: [{"action":"ADD_BLOCK_INTENT","intent":[{"var":"currentNumber","init":"0"},{"var":"previousNumber","init":"0"},{"var":"operator","init":""},{"var":"waitingForNewNumber","init":false},{"event":"Btn0.Click","do":[{"call":"HandleNumberInput","args":{"digit":"0"}}]},{"event":"Btn1.Click","do":[{"call":"HandleNumberInput","args":{"digit":"1"}}]},{"event":"Btn2.Click","do":[{"call":"HandleNumberInput","args":{"digit":"2"}}]},{"event":"Btn3.Click","do":[{"call":"HandleNumberInput","args":{"digit":"3"}}
    $jsRepairAndNormalizeJson @ ode-3.js:15754
    ode-3.js:15755 [AI] 原文后200字符: r":"global currentNumber","value":{"get_var":"local result"}},{"set_prop":"Display.Text","value":{"get_var":"local result"}},{"set_var":"global operator","value":""}]}]}]},{"action":"CLEANUP_BLOCKS"}]
    $jsRepairAndNormalizeJson @ ode-3.js:15755
    ode-3.js:15764 [AI] 直接 eval 救援也失败: Unexpected token ')'
    $jsRepairAndNormalizeJson @ ode-3.js:15764
    ode-0.js:223644 Sat Mar 07 23:31:25 GMT+800 2026 com.google.appinventor.client.editor.youngandroid.AIController
    WARNING: AI 生成的 JSON 修复失败。原文长度: 4235, 前200字符: [{"action":"ADD_BLOCK_INTENT","intent":[{"var":"currentNumber","init":"0"},{"var":"previousNumber","init":"0"},{"var":"operator","init":""},{"var":"waitingForNewNumber","init":false},{"event":"Btn0.Cl
    publish @ ode-0.js:223644
    ode-3.js:11250 [AI] 流式接收完成,共 1062 个数据块,总内容 7758 字符
    App Inventor 2 中文网 - MIT同步更新的中文本土化平台!v2.76 支持Android 15 & iOS 更新日志
  • TA的每日心情
    开心
    16 小时前
  • 签到天数: 794 天

    [LV.10]以坛为家III

    1119

    主题

    1877

    帖子

    5万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    53225

    AI2中文网VIP弹球达人接水果达人撸猫达人

    22#
    发表于 2026-03-07 23:24:21 | 只看该作者
    com.google.appinventor.client.Ode
    INFO: Locking Screens
    ode-0.js:10332 Saving fileId src/appinventor/ai_admin/bb/Screen4.scm for projectId 4868637487792128
    ode-0.js:223644 Sat Mar 07 23:23:35 GMT+800 2026 com.google.appinventor.client.Ode
    INFO: Unlocking Screens
    ode-3.js:15571 [AI] 检测到中间数据损坏(位置 944):{"if"
    detectAndFixMiddleCorruption @ ode-3.js:15571
    ode-3.js:15571 [AI] 检测到中间数据损坏(位置 1085):,true
    detectAndFixMiddleCorruption @ ode-3.js:15571
    ode-3.js:15740 [AI] JSON 修复全部失败(含 eval 兜底)
    $jsRepairAndNormalizeJson @ ode-3.js:15740
    ode-3.js:15741 [AI] 原文长度: 4728 字符
    $jsRepairAndNormalizeJson @ ode-3.js:15741
    ode-3.js:15742 [AI] 原文前500字符: [{"action":"ADD_BLOCK_INTENT","intent":[{"var":"currentInput","init":"0"},{"var":"previousInput","init":""},{"var":"currentOperator","init":""},{"var":"resetDisplay","init":false},{"event":"Btn0.Click","do":[{"call":"AppendNumber","args":{"num":"0"}}]},{"event":"Btn1.Click","do":[{"call":"AppendNumber","args":{"num":"1"}}]},{"event":"Btn2.Click","do":[{"call":"AppendNumber","args":{"num":"2"}}]},{"event":"Btn3.Click","do":[{"call":"AppendNumber","args":{"num":"3"}}]},{"event":"Btn4.Click","do":[
    $jsRepairAndNormalizeJson @ ode-3.js:15742
    ode-3.js:15743 [AI] 原文后200字符: _do":[{"set_var":"result","value":"错误"}]}]},{"set_var":"global currentInput","value":{"get_var":"result"}},{"set_prop":"Display.Text","value":{"get_var":"result"}}]}]}]}]},{"action":"CLEANUP_BLOCKS"}]
    $jsRepairAndNormalizeJson @ ode-3.js:15743
    ode-3.js:15752 [AI] 直接 eval 救援也失败: Unexpected token ')'
    $jsRepairAndNormalizeJson @ ode-3.js:15752
    ode-0.js:223644 Sat Mar 07 23:24:24 GMT+800 2026 com.google.appinventor.client.editor.youngandroid.AIController
    WARNING: AI 生成的 JSON 修复失败。原文长度: 4728, 前200字符: [{"action":"ADD_BLOCK_INTENT","intent":[{"var":"currentInput","init":"0"},{"var":"previousInput","init":""},{"var":"currentOperator","init":""},{"var":"resetDisplay","init":false},{"event":"Btn0.Click
    publish @ ode-0.js:223644
    ode-3.js:11250 [AI] 流式接收完成,共 1144 个数据块,总内容 8360 字符
    ode-3.js:11254 [AI] 检测到内容可能已损坏(模式匹配),这可能是API或网络问题
    App Inventor 2 中文网 - MIT同步更新的中文本土化平台!v2.76 支持Android 15 & iOS 更新日志
  • TA的每日心情
    开心
    16 小时前
  • 签到天数: 794 天

    [LV.10]以坛为家III

    1119

    主题

    1877

    帖子

    5万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    53225

    AI2中文网VIP弹球达人接水果达人撸猫达人

    21#
    发表于 2026-03-07 23:11:02 | 只看该作者
    t Mar 07 23:10:32 GMT+800 2026 com.google.appinventor.client.Ode
    INFO: Locking Screens
    ode-0.js:10332 Saving fileId src/appinventor/ai_admin/bb/Screen3.scm for projectId 4868637487792128
    ode-0.js:223644 Sat Mar 07 23:10:32 GMT+800 2026 com.google.appinventor.client.Ode
    INFO: Unlocking Screens
    ode-3.js:15662 [AI] JSON 修复全部失败(含 eval 兜底)
    $jsRepairAndNormalizeJson @ ode-3.js:15662
    ode-3.js:15663 [AI] 原文长度: 3400 字符
    $jsRepairAndNormalizeJson @ ode-3.js:15663
    ode-3.js:15664 [AI] 原文前500字符: [{"action":"ADD_BLOCK_INTENT","intent":[{"var":"connectedDevice","init":""},{"var":"connectedDeviceName","init":""},{"event":"ScanButton.Click","do":[{"call":"BluetoothLE1.StartScanning","args":{}},{"set_prop":"StatusLabel.Text","value":"正在扫描设备..."},{"set_prop":"DeviceList.Elements","value":{"list":[]}}]},{"event":"StopScanButton.Click","do":[{"call":"BluetoothLE1.StopScanning","args":{}},{"set_prop":"StatusLabel.Text","value":"扫描已停止"}]},{"event":"BluetoothLE1.DeviceFound","do":[{"list_add":{"li
    $jsRepairAndNormalizeJson @ ode-3.js:15664
    ode-3.js:15665 [AI] 原文后200字符: alse},{"set_prop":"SendButton.Enabled","value":false}],"else_do":[{"set_prop":"DisconnectButton.Enabled","value":true},{"set_prop":"SendButton.Enabled","value":true}]}]}]},{"action":"CLEANUP_BLOCKS"}]
    $jsRepairAndNormalizeJson @ ode-3.js:15665
    ode-3.js:15674 [AI] 直接 eval 救援也失败: Unexpected token ']'
    App Inventor 2 中文网 - MIT同步更新的中文本土化平台!v2.76 支持Android 15 & iOS 更新日志
  • TA的每日心情
    开心
    16 小时前
  • 签到天数: 794 天

    [LV.10]以坛为家III

    1119

    主题

    1877

    帖子

    5万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    53225

    AI2中文网VIP弹球达人接水果达人撸猫达人

    20#
    发表于 2026-03-07 22:24:18 | 只看该作者
    AI伴侣出现错误: The operation TextAlignment cannot accept the arguments: , ["Right"]
    AI伴侣出现错误: The operation AlignHorizontal cannot accept the arguments: , ["Center"]

    我检查了组件元数据,发现Label组件没有TextAlignment属性。我需要移除这个属性设置,只设置其他属性。
    AI助手生成的代码,设置不存在的属性,一定要禁止这种,否则可能破坏项目                    
       我检查了组件元数据,发现Label组件没有TextAlignment属性  属性设置前要探测好


    App Inventor 2 中文网 - MIT同步更新的中文本土化平台!v2.76 支持Android 15 & iOS 更新日志
  • TA的每日心情
    开心
    16 小时前
  • 签到天数: 794 天

    [LV.10]以坛为家III

    1119

    主题

    1877

    帖子

    5万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    53225

    AI2中文网VIP弹球达人接水果达人撸猫达人

    19#
    发表于 2026-03-07 22:14:42 | 只看该作者
    ❌ 失败 1 项:
    • AI 生成的 JSON 格式有误(可能括号/引号不匹配),请重新发送需求让 AI 重新生成

    [{"action": "ADD_BLOCK_INTENT","intent":[{"var": "currentInput","init": "0"},{"var": "previousInput","init": ""},{"var": "currentOperator","init": ""},{"var": "waitingForNewInput","init":false},{"event": "Btn0.Click","do":[{"call": "AppendNumber","args":{"num": "0"}}]},{"event": "Btn1.Click","do":[{"call": "AppendNumber","args":{"num": "1"}}]},{"event": "Btn2.Click","do":[{"call": "AppendNumber","args":{"num": "2"}}]},{"event": "Btn3.Click","do":[{"call": "AppendNumber","args":{"num": "3"}}]},{"event": "Btn4.Click","do":[{"call": "AppendNumber","args":{"num": "4"}}]},{"event": "Btn5.Click","do":[{"call": "AppendNumber","args":{"num": "5"}}]},{"event": "Btn6.Click","do":[{"call": "AppendNumber","args":{"num": "6"}}]},{"event": "Btn7.Click","do":[{"call": "AppendNumber","args":{"num": "7"}}]},{"event": "Btn8.Click","do":[{"call": "AppendNumber","args":{"num": "8"}}]},{"event": "Btn9.Click","do":[{"call": "AppendNumber","args":{"num": "9"}}]},{"event": "BtnDecimal.Click","do":[{"if":{"not":{"text_contains":{"text":{"get_var": "global currentInput"},"piece": "."}}},"then":[{"if":{"eq":[{"get_var": "global waitingForNewInput"},true]},"then":[{"set_var": "global currentInput","value": "0."},{"set_var": "global waitingForNewInput","value":false}],"else_do":[{"set_var": "global currentInput","value":{"join":[{"get_var": "global currentInput"},"."]}}]},{"set_prop": "DisplayLabel.Text","value":{"get_var": "global currentInput"}}]}]},{"event": "BtnAdd.Click","do":[{"call": "SetOperator","args":{"op": "+"}}]},{"event": "BtnSubtract.Click","do":[{"call": "SetOperator","args":{"op": "-"}}]},{"event": "BtnMultiply.Click","do":[{"call": "SetOperator","args":{"op": "×"}}]},{"event": "BtnDivide.Click","do":[{"call": "SetOperator","args":{"op": "÷"}}]},{"event": "BtnEquals.Click","do":[{"call": "CalculateResult","args":{}}]},{"event": "BtnClear.Click","do":[{"set_var": "global currentInput","value": "0"},{"set_var": "global previousInput","value": ""},{"set_var": "global currentOperator","value": ""},{"set_var": "global waitingForNewInput","value":false},{"set_prop": "DisplayLabel.Text","value": "0"}]},{"event": "BtnBackspace.Click","do":[{"if":{"and":[{"neq":[{"get_var": "global currentInput"},"0"]},{"gt":[{"text_length":{"get_var": "global currentInput"}},1]}]},"then":[{"set_var": "global currentInput","value":{"text_segment":{"text":{"get_var": "global currentInput"},"start": 1,"length":{"subtract":[{"text_length":{"get_var": "global currentInput"}},1]}}}},{"set_prop": "DisplayLabel.Text","value":{"get_var": "global currentInput"}}],"else_do":[{"set_var": "global currentInput","value": "0"},{"set_prop": "DisplayLabel.Text","value": "0"}]}]},{"procedure": "AppendNumber","params":["num"],"do":[{"if":{"eq":[{"get_var": "global waitingForNewInput"},true]},"then":[{"set_var": "global currentInput","value":{"get": "num"}},{"set_var": "global waitingForNewInput","value":false}],"else_do":[{"if":{"eq":[{"get_var": "global currentInput"},"0"]},"then":[{"set_var": "global currentInput","value":{"get": "num"}}],"else_do":[{"set_var": "global currentInput","value":{"join":[{"get_var": "global currentInput"},{"get": "num"}]}}]}]},{"set_prop": "DisplayLabel.Text","value":{"get_var": "global currentInput"}}]},{"procedure": "SetOperator","params":["op"],"do":[{"if":{"and":[{"neq":[{"get_var": "global previousInput"},""]},{"neq":[{"get_var": "global currentOperator"},""]}]},"then":[{"call": "CalculateResult","args":{}}]},{"set_var": "global previousInput","value":{"get_var": "global currentInput"}},{"set_var": "global currentOperator","value":{"get": "op"}},{"set_var": "global waitingForNewInput","value":true}]},{"procedure": "CalculateResult","do":[{"if":{"and":[{"neq":[{"get_var": "global previousInput"},""]},{"neq":[{"get_var": "global currentOperator"},""]}]},"then":[{"local_var": "result","value": 0,"do":[{"if":{"eq":[{"get_var": "global currentOperator"},"+"]},"then":[{"set_var": "local result","value":{"add":[{"get_var": "global previousInput"},{"get_var": "global currentInput"}]}}]},{"if":{"eq":[{"get_var": "global currentOperator"},"-"]},"then":[{"set_var": "local result","value":{"subtract":[{"get_var": "global previousInput"},{"get_var": "global currentInput"}]}}]},{"if":{"eq":[{"get_var": "global currentOperator"},"×"]},"then":[{"set_var": "local result","value":{"multiply":[{"get_var": "global previousInput"},{"get_var": "global currentInput"}]}}]},{"if":{"eq":[{"get_var": "global currentOperator"},"÷"]},"then":[{"if":{"eq":[{"get_var": "global currentInput"},0]},"then":[{"set_var": "local result","value": "错误:除零"}],"else_do":[{"set_var": "local result","value":{"divide":[{"get_var": "global previousInput"},{"get_var": "global currentInput"}]}}]}]},{"set_var": "global currentInput","value":{"get_var": "local result"}},{"set_prop": "DisplayLabel.Text","value":{"get_var": "local result"}},{"set_var": "global previousInput","value": ""},{"set_var": "global currentOperator","value": ""},{"set_var": "global waitingForNewInput","value":true}]}]}]},{"action": "CLEANUP_BLOCKS"}]
    App Inventor 2 中文网 - MIT同步更新的中文本土化平台!v2.76 支持Android 15 & iOS 更新日志
  • TA的每日心情
    开心
    16 小时前
  • 签到天数: 794 天

    [LV.10]以坛为家III

    1119

    主题

    1877

    帖子

    5万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    53225

    AI2中文网VIP弹球达人接水果达人撸猫达人

    18#
    发表于 2026-03-07 21:38:53 | 只看该作者
    ❌ 失败 1 项:
    • 代码块添加失败,工作区已恢复: 块 component_event: Connection checks failed.

    [{"action": "ADD_BLOCK_INTENT","intent":[{"var": "temperatureData","init":{"list":[{"list":["08: 00",22]},{"list":["10: 00",23]},{"list":["12: 00",24]},{"list":["14: 00",25]},{"list":["16: 00",24]},{"list":["18: 00",23]},{"list":["20: 00",22]}]}},{"var": "currentTemp","init": 22},{"event": "Screen8.Initialize","do":[{"call": "TemperatureChart.Init","args":{"layout": "{\"title\":{\"text\":\"温度变化曲线\"},\"tooltip\":{},\"xAxis\":{\"type\":\"category\"},\"yAxis\":{\"type\":\"value\"},\"series\":[{\"name\":\"温度\",\"type\":\"line\",\"data\":[]}]}"}},{"call_proc": "UpdateTemperatureChart"}]},{"procedure": "UpdateTemperatureChart","do":[{"set_var": "global labels","value":{"list":[]}},{"set_var": "global temps","value":{"list":[]}},{"foreach":{"var": "item","in":{"get_var": "global temperatureData"},"do":[{"list_add":{"list":{"get_var": "global labels"},"item":{"select_item":{"list":{"get_var": "item"},"index": 0}}}},{"list_add":{"list":{"get_var": "global temps"},"item":{"select_item":{"list":{"get_var": "item"},"index": 1}}}}]}},{"call": "TemperatureChart.Line","args":{"title": "室内温度","legends": "温度","labels":{"get_var": "global labels"},"datas":{"get_var": "global temps"},"smooth":true}}]},{"event": "LightSwitch1.Changed","do":[{"if":{"get_prop": "LightSwitch1.On"},"then":[{"call": "MainNotifier.ShowAlert","args":{"notice": "客厅主灯已打开"}}],"else_do":[{"call": "MainNotifier.ShowAlert","args":{"notice": "客厅主灯已关闭"}}]}]},{"event": "ACSwitch.Changed","do":[{"if":{"get_prop": "ACSwitch.On"},"then":[{"call": "MainNotifier.ShowAlert","args":{"notice": "卧室空调已开启"}}],"else_do":[{"call": "MainNotifier.ShowAlert","args":{"notice": "卧室空调已关闭"}}]}]},{"event": "MainClock.Timer","do":[{"set_var": "global currentTemp","value":{"add":[{"get_var": "global currentTemp"},{"choose":{"test":{"eq":[{"random_int":{"from": 0,"to": 1}},0]},"then": 0.1,"else": -0.1}}]}},{"list_add":{"list":{"get_var": "global temperatureData"},"item":{"list":[{"call": "MainClock.FormatTime","args":{"instant":{"call": "MainClock.Now"}}},{"get_var": "global currentTemp"}]}}},{"if":{"gt":[{"list_length":{"get_var": "global temperatureData"}},10]},"then":[{"list_remove":{"list":{"get_var": "global temperatureData"},"index": 0}}]},{"call_proc": "UpdateTemperatureChart"}]},{"event": "HomeBtn.Click","do":[{"call": "MainNotifier.ShowMessageDialog","args":{"message": "您已在主页","title": "提示","buttonText": "确定"}}]},{"event": "DevicesBtn.Click","do":[{"call": "MainNotifier.ShowMessageDialog","args":{"message": "设备管理功能开发中","title": "提示","buttonText": "确定"}}]},{"event": "SettingsBtn.Click","do":[{"call": "MainNotifier.ShowMessageDialog","args":{"message": "设置功能开发中","title": "提示","buttonText": "确定"}}]}]},{"action": "CLEANUP_BLOCKS"}]
    App Inventor 2 中文网 - MIT同步更新的中文本土化平台!v2.76 支持Android 15 & iOS 更新日志
  • TA的每日心情
    开心
    16 小时前
  • 签到天数: 794 天

    [LV.10]以坛为家III

    1119

    主题

    1877

    帖子

    5万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    53225

    AI2中文网VIP弹球达人接水果达人撸猫达人

    17#
    发表于 2026-03-07 21:09:56 | 只看该作者
    ❌ 失败 1 项:
    • 代码块添加失败,工作区已恢复: 块 component_event: Assertion failed: Next statement does not exist.

    [
      {"action": "ADD_BLOCK_INTENT","intent":[
        {"var": "客厅灯状态","init":false},
        {"var": "卧室灯状态","init":false},
        {"var": "走廊灯状态","init":false},
        {"var": "室内温度","init": 25},
        {"var": "室内湿度","init": 60},
        {"var": "安防状态","init": "已关闭"},
       
        {"event": "Screen6.Initialize","do":[
          {"call": "HomeClock.Now","args":{}},
          {"set_prop": "TimeLabel.Text","value":{"join":["时间:",{"call": "HomeClock.FormatTime","args":{"instant":{"call": "HomeClock.Now","args":{}}}}]}},
          {"set_prop": "DateLabel.Text","value":{"join":["日期:",{"call": "HomeClock.FormatDate","args":{"instant":{"call": "HomeClock.Now","args":{}},"pattern": "yyyy-MM-dd"}}]}}
        ]},
       
        {"event": "HomeClock.Timer","do":[
          {"set_prop": "TimeLabel.Text","value":{"join":["时间:",{"call": "HomeClock.FormatTime","args":{"instant":{"call": "HomeClock.Now","args":{}}}}]}}
        ]},
       
        {"event": "Light1Switch.Changed","do":[
          {"set_var": "global 客厅灯状态","value":{"get_prop": "Light1Switch.On"}},
          {"set_prop": "Light1Label.Text","value":{"choose":{"test":{"get_var": "global 客厅灯状态"},"then": "客厅主灯:开","else": "客厅主灯:关"}}}
        ]},
       
        {"event": "Light2Switch.Changed","do":[
          {"set_var": "global 卧室灯状态","value":{"get_prop": "Light2Switch.On"}},
          {"set_prop": "Light2Label.Text","value":{"choose":{"test":{"get_var": "global 卧室灯状态"},"then": "卧室灯:开","else": "卧室灯:关"}}}
        ]},
       
        {"event": "Light3Switch.Changed","do":[
          {"set_var": "global 走廊灯状态","value":{"get_prop": "Light3Switch.On"}},
          {"set_prop": "Light3Label.Text","value":{"choose":{"test":{"get_var": "global 走廊灯状态"},"then": "走廊灯:开","else": "走廊灯:关"}}}
        ]},
       
        {"event": "RefreshButton.Click","do":[
          {"set_prop": "TempValueLabel.Text","value":{"join":[{"get_var": "global 室内温度"},"°C"]}},
          {"set_prop": "HumidityValueLabel.Text","value":{"join":[{"get_var": "global 室内湿度"},"%"]}},
          {"set_prop": "SecurityStatusLabel.Text","value":{"get_var": "global 安防状态"}},
          {"set_prop": "SecurityStatusLabel.TextColor","value":{"choose":{"test":{"eq":[{"get_var": "global 安防状态"},"已关闭"]},"then": "&HFF4CAF50","else": "&HFFF44336"}}},
          {"call": "HomeClock.Now","args":{}},
          {"set_prop": "DateLabel.Text","value":{"join":["日期:",{"call": "HomeClock.FormatDate","args":{"instant":{"call": "HomeClock.Now","args":{}},"pattern": "yyyy-MM-dd"}}]}}
        ]},
       
        {"event": "AllLightsOnButton.Click","do":[
          {"set_prop": "Light1Switch.On","value":true},
          {"set_prop": "Light2Switch.On","value":true},
          {"set_prop": "Light3Switch.On","value":true},
          {"set_var": "global 客厅灯状态","value":true},
          {"set_var": "global 卧室灯状态","value":true},
          {"set_var": "global 走廊灯状态","value":true},
          {"set_prop": "Light1Label.Text","value": "客厅主灯:开"},
          {"set_prop": "Light2Label.Text","value": "卧室灯:开"},
          {"set_prop": "Light3Label.Text","value": "走廊灯:开"}
        ]},
       
        {"event": "AllLightsOffButton.Click","do":[
          {"set_prop": "Light1Switch.On","value":false},
          {"set_prop": "Light2Switch.On","value":false},
          {"set_prop": "Light3Switch.On","value":false},
          {"set_var": "global 客厅灯状态","value":false},
          {"set_var": "global 卧室灯状态","value":false},
          {"set_var": "global 走廊灯状态","value":false},
          {"set_prop": "Light1Label.Text","value": "客厅主灯:关"},
          {"set_prop": "Light2Label.Text","value": "卧室灯:关"},
          {"set_prop": "Light3Label.Text","value": "走廊灯:关"}
        ]}
      ]},
      {"action": "CLEANUP_BLOCKS"}
    ]
    App Inventor 2 中文网 - MIT同步更新的中文本土化平台!v2.76 支持Android 15 & iOS 更新日志
  • TA的每日心情
    开心
    16 小时前
  • 签到天数: 794 天

    [LV.10]以坛为家III

    1119

    主题

    1877

    帖子

    5万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    53225

    AI2中文网VIP弹球达人接水果达人撸猫达人

    16#
    发表于 2026-03-07 20:51:25 | 只看该作者
    代码块添加失败,工作区已恢复: 块 component_event: Connection checks failed.

    [{"action": "ADD_BLOCK_INTENT","intent":[{"event": "DrawingCanvas.Dragged","do":[{"call": "DrawingCanvas.DrawLine","args":{"x1":{"get_var": "prevX"},"y1":{"get_var": "prevY"},"x2":{"get_var": "currentX"},"y2":{"get_var": "currentY"}}}]},{"event": "ClearButton.Click","do":[{"call": "DrawingCanvas.Clear","args":{}}]},{"event": "BlackButton.Click","do":[{"set_prop": "DrawingCanvas.PaintColor","value": "&HFF000000"}]},{"event": "RedButton.Click","do":[{"set_prop": "DrawingCanvas.PaintColor","value": "&HFFFF0000"}]},{"event": "BlueButton.Click","do":[{"set_prop": "DrawingCanvas.PaintColor","value": "&HFF0000FF"}]},{"event": "GreenButton.Click","do":[{"set_prop": "DrawingCanvas.PaintColor","value": "&HFF00FF00"}]},{"event": "EraserButton.Click","do":[{"set_prop": "DrawingCanvas.PaintColor","value": "&HFFFFFFFF"}]}]},{"action": "CLEANUP_BLOCKS"}]
    App Inventor 2 中文网 - MIT同步更新的中文本土化平台!v2.76 支持Android 15 & iOS 更新日志
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    © 2026 tsingfun.com, Inc.  沪ICP备2020034476号-1  沪公网安备31011702000040号

    GMT+8, 2026-04-28 23:02 , Processed in 0.025362 second(s), 40 queries .