清泛IT社区

标题: AI助手重构版问题记录 [打印本页]

作者: App Inventor 2     时间: 昨天 21:20
标题: AI助手重构版问题记录
组件 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     时间: 昨天 21:21
❌ 失败 1 项:
• 代码块添加失败,工作区已恢复: 块 component_event: Assertion failed: Error: "dictionaries_make_dictionary" is an unknown language block.

[
  {
    "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": "请求超时,请检查网络"
            }
          }
        ]
      }
    ]
  },
  {
    "action": "CLEANUP_BLOCKS"
  }
]

作者: App Inventor 2     时间: 昨天 21:33
❌ 失败 1 项:
• 嵌套块验证失败:组件 CityTextBox(TextBox) 没有方法 "UriEncode",已拒绝添加

[{"action": "ADD_BLOCK_INTENT","intent":[{"event": "QueryButton.Click","do":[{"call": "Notifier1.ShowProgressDialog","args":{"message": "正在查询天气...","title": "请稍候"}},{"set_prop": "WeatherWeb.Url","value":{"join":["https://wttr.in/",{"call": "CityTextBox.UriEncode","args":{"text":{"get_prop": "CityTextBox.Text"}}},"?format=j1"]}},{"call": "WeatherWeb.Get","args":{}}]},{"event": "WeatherWeb.GotText","do":[{"call": "Notifier1.DismissProgressDialog","args":{}},{"local_var": "weatherData","value":{"call": "WeatherWeb.JsonTextDecodeWithDictionaries","args":{"jsonText":{"get_var": "responseContent"}}},"do":[{"set_prop": "TempValueLabel.Text","value":{"join":[{"dict_lookup":{"key": "temp_C","dict":{"select_item":{"list":{"dict_lookup":{"key": "current_condition","dict":{"get_var": "weatherData"},"default_val":{"list":[]}}},"index": 0}},"default_val": "--"}},"°C"]}},{"set_prop": "WeatherValueLabel.Text","value":{"dict_lookup":{"key": "weatherDesc","dict":{"select_item":{"list":{"dict_lookup":{"key": "current_condition","dict":{"get_var": "weatherData"},"default_val":{"list":[]}}},"index": 0}},"default_val": "--"}}},{"set_prop": "HumidityValueLabel.Text","value":{"join":[{"dict_lookup":{"key": "humidity","dict":{"select_item":{"list":{"dict_lookup":{"key": "current_condition","dict":{"get_var": "weatherData"},"default_val":{"list":[]}}},"index": 0}},"default_val": "--"}},"%"]}}]}]},{"event": "WeatherWeb.TimedOut","do":[{"call": "Notifier1.DismissProgressDialog","args":{}},{"call": "Notifier1.ShowAlert","args":{"notice": "网络请求超时,请检查网络连接或稍后重试。","title": "查询失败"}}]},{"event": "WeatherWeb.ErrorOccurred","do":[{"call": "Notifier1.DismissProgressDialog","args":{}},{"call": "Notifier1.ShowAlert","args":{"notice":{"join":["查询出错:",{"get_var": "message"}]},"title": "错误"}}]}]},{"action": "CLEANUP_BLOCKS"}]

作者: App Inventor 2     时间: 昨天 21:37
❌ 失败 1 项:
• 执行指令失败: Error parsing JSON: SyntaxError: Expected ':' after property name in JSON at position 1008 (line 1 column 1009)

[{"action": "ADD_BLOCK_INTENT","intent":[{"var": "apiKey","init": "YOUR_API_KEY_HERE"},{"var": "apiUrl","init": "https://api.openweathermap.org/data/2.5/weather"},{"event": "QueryButton.Click","do":[{"if":{"is_empty":{"get_prop": "CityTextBox.Text"}},"then":[{"call": "Notifier1.ShowAlert","args":{"notice": "请输入城市名称"}}],"else_do":[{"set_prop": "WeatherWeb.Url","value":{"join":[{"get_var": "global apiUrl"},"?q=",{"call": "WeatherWeb.UriEncode","args":{"text":{"get_prop": "CityTextBox.Text"}}},"&appid=",{"get_var": "global apiKey"},"&units=metric&lang=zh_cn"]}},{"call": "WeatherWeb.Get","args":{}}]}]},{"event": "WeatherWeb.GotText","do":[{"local_var": "response","value":{"call": "WeatherWeb.JsonTextDecodeWithDictionaries","args":{"jsonText":{"get_var": "responseContent"}}},"do":[{"if":{"eq":[{"get_var": "responseCode"},200]},"then":[{"set_prop": "TempValueLabel.Text","value":{"join":[{"dict_lookup":{"key": "temp","dict":{"dict_lookup":{"key": "main","dict":{"get_var": "response"},"default_val":{}},"default_val": 0}},"°C"]}},{"set_prop": "WeatherValueLabel.Text","value":{"dict_lookup":{"key": "description","dict":{"select_item":{"list":{"dict_lookup":{"key": "weather","dict":{"get_var": "response"},"default_val":{}}},"index": 0}},"default_val": "未知"}}},{"set_prop": "HumidityValueLabel.Text","value":{"join":[{"dict_lookup":{"key": "humidity","dict":{"dict_lookup":{"key": "main","dict":{"get_var": "response"},"default_val":{}},"default_val": 0}},"%"]}}],"else_do":[{"call": "Notifier1.ShowAlert","args":{"notice":{"join":["查询失败: ",{"dict_lookup":{"key": "message","dict":{"get_var": "response"},"default_val": "未知错误"}}]}}}]}]}]},{"event": "WeatherWeb.TimedOut","do":[{"call": "Notifier1.ShowAlert","args":{"notice": "网络请求超时,请检查网络连接"}}]}]}]

作者: App Inventor 2     时间: 昨天 21:46
❌ 失败 1 项:
• 组件 WeatherWeb(Web) 没有事件 "ErrorOccurred",已拒绝添加

[{"action": "ADD_BLOCK_INTENT","intent":[{"var": "apiKey","init": "YOUR_API_KEY_HERE"},{"var": "apiUrl","init": "https://api.openweathermap.org/data/2.5/weather"},{"event": "QueryButton.Click","do":[{"if":{"is_empty":{"get_prop": "CityTextBox.Text"}},"then":[{"call": "Notifier1.ShowAlert","args":{"notice": "请输入城市名称"}}],"else_do":[{"call": "Notifier1.ShowProgressDialog","args":{"message": "正在查询天气...","title": "请稍候"}},{"set_prop": "WeatherWeb.Url","value":{"join":[{"get_var": "global apiUrl"},"?q=",{"call": "WeatherWeb.UriEncode","args":{"text":{"get_prop": "CityTextBox.Text"}}},"&appid=",{"get_var": "global apiKey"},"&units=metric&lang=zh_cn"]}},{"call": "WeatherWeb.Get","args":{}}]}]},{"event": "WeatherWeb.GotText","do":[{"call": "Notifier1.DismissProgressDialog","args":{}},{"if":{"eq":[{"get_var": "responseCode"},200]}, "then":[{"local_var": "weatherData","value":{"call": "WeatherWeb.JsonTextDecodeWithDictionaries","args":{"jsonText":{"get_var": "responseContent"}}},"do":[{"set_prop": "TempValueLabel.Text","value":{"join":[{"dict_lookup":{"key": "temp","dict":{"dict_lookup":{"key": "main","dict":{"get_var": "weatherData"},"default_val":{}}},"default_val": "N/A"}},"°C"]}},{"set_prop": "WeatherValueLabel.Text","value":{"dict_lookup":{"key": "description","dict":{"dict_lookup":{"key": "0","dict":{"dict_lookup":{"key": "weather","dict":{"get_var": "weatherData"},"default_val":[{}]}},"default_val":{}}},"default_val": "未知"}}},{"set_prop": "HumidityValueLabel.Text","value":{"join":[{"dict_lookup":{"key": "humidity","dict":{"dict_lookup":{"key": "main","dict":{"get_var": "weatherData"},"default_val":{}}},"default_val": "N/A"}},"%"]}}]}],"else_do":[{"call": "Notifier1.ShowAlert","args":{"notice":{"join":["查询失败,错误码:",{"get_var": "responseCode"},"\n",{"get_var": "responseContent"}]}}}]}]},{"event": "WeatherWeb.TimedOut","do":[{"call": "Notifier1.DismissProgressDialog","args":{}},{"call": "Notifier1.ShowAlert","args":{"notice": "网络请求超时,请检查网络连接"}}]},{"event": "WeatherWeb.ErrorOccurred","do":[{"call": "Notifier1.DismissProgressDialog","args":{}},{"call": "Notifier1.ShowAlert","args":{"notice":{"join":["网络错误:",{"get_var": "message"}]}}}]}]}]


ErrorOccurred没有的话,请使用Screen1.ErrorOccurred
作者: App Inventor 2     时间: 昨天 21:55
❌ 失败 1 项:
• AI 生成的 JSON 格式有误(可能括号/引号不匹配),请重新发送需求让 AI 重新生成

[{"action": "ADD_BLOCK_INTENT","intent":[{"var": "apiKey","init": "YOUR_API_KEY_HERE"},{"var": "apiUrl","init": "https://api.openweathermap.org/data/2.5/weather"},{"event": "QueryButton.Click","do":[{"if":{"is_empty":{"get_prop": "CityTextBox.Text"}},"then":[{"call": "Notifier1.ShowAlert","args":{"notice": "请输入城市名称"}}],"else_do":[{"call": "Notifier1.ShowProgressDialog","args":{"message": "正在查询天气...","title": "请稍候"}},{"call": "WeatherWeb.Get","args":{"url":{"join":[{"get_var": "global apiUrl"},"?q=",{"call": "WeatherWeb.UriEncode","args":{"text":{"get_prop": "CityTextBox.Text"}}},"&appid=",{"get_var": "global apiKey"},"&units=metric","&lang=zh_cn"]}}}]}]},{"event": "WeatherWeb.GotText","do":[{"call": "Notifier1.DismissProgressDialog"},{"local_var": "responseDict","value":{"call": "WeatherWeb.JsonTextDecodeWithDictionaries","args":{"jsonText":{"get_var": "responseContent"}}},"do":[{"if":{"eq":[{"dict_lookup":{"key": "cod","dict":{"get_var": "responseDict"},"default_val": "200"}},"200"]},"then":[{"local_var": "mainData","value":{"dict_lookup":{"key": "main","dict":{"get_var": "responseDict"},"default_val":{"dict":[]}}},"do":[{"set_prop": "TempValueLabel.Text","value":{"join":[{"dict_lookup":{"key": "temp","dict":{"get_var": "mainData"},"default_val": "N/A"}},"°C"]}},{"set_prop": "HumidityValueLabel.Text","value":{"join":[{"dict_lookup":{"key": "humidity","dict":{"get_var": "mainData"},"default_val": "N/A"}},"%"]}}]},{"local_var": "weatherArray","value":{"dict_lookup":{"key": "weather","dict":{"get_var": "responseDict"},"default_val":{"list":[]}}},"do":[{"if":{"gt":[{"list_length":{"get_var": "weatherArray"}},0]},"then":[{"set_prop": "WeatherValueLabel.Text","value":{"dict_lookup":{"key": "description","dict":{"select_item":{"list":{"get_var": "weatherArray"},"index": 0}},"default_val": "未知"}}]}]}]}],"else_do":[{"call": "Notifier1.ShowAlert","args":{"notice":{"join":["查询失败: ",{"dict_lookup":{"key": "message","dict":{"get_var": "responseDict"},"default_val": "未知错误"}}]}}}]}]}]},{"event": "WeatherWeb.TimedOut","do":[{"call": "Notifier1.DismissProgressDialog"},{"call": "Notifier1.ShowAlert","args":{"notice": "网络请求超时,请检查网络连接"}}]},{"event": "Screen4.ErrorOccurred","do":[{"call": "Notifier1.DismissProgressDialog"},{"call": "Notifier1.ShowAlert","args":{"notice":{"join":["网络错误: ",{"get_var": "message"}]}}}]}]}]

作者: App Inventor 2     时间: 昨天 22:10
❌ 失败 1 项:
• AI 生成的 JSON 格式有误(可能括号/引号不匹配),请重新发送需求让 AI 重新生成

[{"action": "ADD_BLOCK_INTENT","intent":[{"var": "currentNumber","init": ""},{"var": "previousNumber","init": ""},{"var": "currentOperator","init": ""},{"var": "isNewCalculation","init":true},{"procedure": "updateDisplay","params":[],"do":[{"set_prop": "DisplayLabel.Text","value":{"choose":{"test":{"is_empty":{"get_var": "global currentNumber"}},"then": "0","else":{"get_var": "global currentNumber"}}}}]},{"procedure": "appendNumber","params":["num"],"do":[{"if":{"eq":[{"get_var": "global isNewCalculation"},true]},"then":[{"set_var": "global currentNumber","value": ""},{"set_var": "global isNewCalculation","value":false}]},{"set_var": "global currentNumber","value":{"join":[{"get_var": "global currentNumber"},{"get_var": "num"}]}},{"call_proc": "updateDisplay","args":{}}]},{"procedure": "setOperator","params":["op"],"do":[{"if":{"and":[{"neq":[{"get_var": "global currentNumber"},""]},{"neq":[{"get_var": "global previousNumber"},""]]}},"then":[{"call_proc": "calculate","args":{}}]},{"if":{"neq":[{"get_var": "global currentNumber"},""]},"then":[{"set_var": "global previousNumber","value":{"get_var": "global currentNumber"}},{"set_var": "global currentNumber","value": ""},{"set_var": "global currentOperator","value":{"get_var": "op"}}]}]},{"procedure": "calculate","params":[],"do":[{"if":{"and":[{"neq":[{"get_var": "global previousNumber"},""]},{"neq":[{"get_var": "global currentNumber"},""]},{"neq":[{"get_var": "global currentOperator"},""]]}},"then":[{"local_var": "result","value": 0,"do":[{"if":{"eq":[{"get_var": "global currentOperator"},"+"]},"then":[{"set_var": "result","value":{"add":[{"get_var": "global previousNumber"},{"get_var": "global currentNumber"}]}}]},{"if":{"eq":[{"get_var": "global currentOperator"},"-"]},"then":[{"set_var": "result","value":{"subtract":[{"get_var": "global previousNumber"},{"get_var": "global currentNumber"}]}}]},{"if":{"eq":[{"get_var": "global currentOperator"},"×"]},"then":[{"set_var": "result","value":{"multiply":[{"get_var": "global previousNumber"},{"get_var": "global currentNumber"}]}}]},{"if":{"eq":[{"get_var": "global currentOperator"},"÷"]},"then":[{"if":{"eq":[{"get_var": "global currentNumber"},0]},"then":[{"set_var": "result","value": "错误:除数为0"}]},{"if":{"neq":[{"get_var": "global currentNumber"},0]},"then":[{"set_var": "result","value":{"divide":[{"get_var": "global previousNumber"},{"get_var": "global currentNumber"}]}}]}]},{"set_var": "global currentNumber","value":{"get_var": "result"}},{"set_var": "global previousNumber","value": ""},{"set_var": "global currentOperator","value": ""},{"set_var": "global isNewCalculation","value":true},{"call_proc": "updateDisplay","args":{}}]}]},{"procedure": "clear","params":[],"do":[{"set_var": "global currentNumber","value": ""},{"call_proc": "updateDisplay","args":{}}]},{"procedure": "clearAll","params":[],"do":[{"set_var": "global currentNumber","value": ""},{"set_var": "global previousNumber","value": ""},{"set_var": "global currentOperator","value": ""},{"set_var": "global isNewCalculation","value":true},{"call_proc": "updateDisplay","args":{}}]},{"event": "Button0.Click","do":[{"call_proc": "appendNumber","args":{"num": "0"}}]},{"event": "Button1.Click","do":[{"call_proc": "appendNumber","args":{"num": "1"}}]},{"event": "Button2.Click","do":[{"call_proc": "appendNumber","args":{"num": "2"}}]},{"event": "Button3.Click","do":[{"call_proc": "appendNumber","args":{"num": "3"}}]},{"event": "Button4.Click","do":[{"call_proc": "appendNumber","args":{"num": "4"}}]},{"event": "Button5.Click","do":[{"call_proc": "appendNumber","args":{"num": "5"}}]},{"event": "Button6.Click","do":[{"call_proc": "appendNumber","args":{"num": "6"}}]},{"event": "Button7.Click","do":[{"call_proc": "appendNumber","args":{"num": "7"}}]},{"event": "Button8.Click","do":[{"call_proc": "appendNumber","args":{"num": "8"}}]},{"event": "Button9.Click","do":[{"call_proc": "appendNumber","args":{"num": "9"}}]},{"event": "ButtonDot.Click","do":[{"if":{"not":{"text_contains":{"text":{"get_var": "global currentNumber"},"piece": "."}}},"then":[{"call_proc": "appendNumber","args":{"num": "."}}]}]},{"event": "ButtonAdd.Click","do":[{"call_proc": "setOperator","args":{"op": "+"}}]},{"event": "ButtonSubtract.Click","do":[{"call_proc": "setOperator","args":{"op": "-"}}]},{"event": "ButtonMultiply.Click","do":[{"call_proc": "setOperator","args":{"op": "×"}}]},{"event": "ButtonDivide.Click","do":[{"call_proc": "setOperator","args":{"op": "÷"}}]},{"event": "ButtonEquals.Click","do":[{"call_proc": "calculate","args":{}}]},{"event": "ButtonClear.Click","do":[{"call_proc": "clear","args":{}}]},{"event": "ButtonClearAll.Click","do":[{"call_proc": "clearAll","args":{}}]}]},{"action": "CLEANUP_BLOCKS"}]

作者: App Inventor 2     时间: 昨天 22:13
❌ 失败 1 项:
• 嵌套块验证失败:组件 'BlueToothLE1' 不存在,请先在设计视图中添加该组件,已拒绝添加

已经添加的是 BluetoothLE1,请系统解决这个问题
作者: App Inventor 2     时间: 昨天 22:18
❌ 失败 1 项:
• AI 生成的 JSON 格式有误(可能括号/引号不匹配),请重新发送需求让 AI 重新生成

[{"action": "ADD_BLOCK_INTENT","intent":[{"var": "isConnected","init":false},{"event": "ConnectButton.Click","do":[{"call": "MQTT1.Connect","args":{"server":{"get_prop": "ServerTextBox.Text"},"port":{"get_prop": "PortTextBox.Text"}}},{"set_prop": "StatusLabel.Text","value": "正在连接..."},{"set_prop": "ConnectButton.Enabled","value":false}]},{"event": "MQTT1.Connected","do":[{"set_var": "global isConnected","value":true},{"set_prop": "StatusLabel.Text","value":{"join":["已连接到 ",{"get_prop": "ServerTextBox.Text"},": ",{"get_prop": "PortTextBox.Text"}]}},{"set_prop": "ConnectButton.Enabled","value":false},{"set_prop": "DisconnectButton.Enabled","value":true},{"set_prop": "SubscribeButton.Enabled","value":true},{"set_prop": "SendButton.Enabled","value":true},{"call": "Notifier1.ShowAlert","args":{"notice": "MQTT连接成功"}}]},{"event": "MQTT1.ConnectionLost","do":[{"set_var": "global isConnected","value":false},{"set_prop": "StatusLabel.Text","value": "连接已断开"},{"set_prop": "ConnectButton.Enabled","value":true},{"set_prop": "DisconnectButton.Enabled","value":false},{"set_prop": "SubscribeButton.Enabled","value":false},{"set_prop": "SendButton.Enabled","value":false},{"call": "Notifier1.ShowAlert","args":{"notice": "MQTT连接断开"}}]},{"event": "DisconnectButton.Click","do":[{"call": "MQTT1.Disconnect","args":{}},{"set_prop": "StatusLabel.Text","value": "正在断开连接..."}]},{"event": "SubscribeButton.Click","do":[{"call": "MQTT1.Subscribe","args":{"topic":{"get_prop": "TopicTextBox.Text"}}},{"call": "Notifier1.ShowAlert","args":{"notice":{"join":["已订阅主题: ",{"get_prop": "TopicTextBox.Text"}]}}}]},{"event": "MQTT1.MessageReceived","do":[{"set_prop": "MessageDisplay.Text","value":{"join":[{"get_prop": "MessageDisplay.Text"},"\n[",{"get_var": "timestamp"},"] ",{"get_var": "topic"},": ",{"get_var": "message"}]}},{"call": "Notifier1.ShowMessageDialog","args":{"message":{"join":["收到新消息:\n主题: ",{"get_var": "topic"},"\n内容: ",{"get_var": "message"}]},"title": "MQTT消息","buttonText": "确定"}}]},{"event": "SendButton.Click","do":[{"call": "MQTT1.Publish","args":{"topic":{"get_prop": "TopicTextBox.Text"},"message":{"get_prop": "MessageTextBox.Text"}}},{"set_prop": "MessageTextBox.Text","value": ""},{"call": "Notifier1.ShowAlert","args":{"notice": "消息已发送"}}]},{"event": "Clock1.Timer","do":[{"if":{"get_var": "global isConnected"},"then":[{"set_prop": "StatusLabel.Text","value":{"join":["已连接 ",{"get_prop": "ServerTextBox.Text"}," (心跳)"}]}}]}]},{"action": "CLEANUP_BLOCKS"}]


执行失败: Expected ',' or ']' after array element in JSON at position 2434 (line 1 column 2435)
作者: App Inventor 2     时间: 昨天 22:33
Technical Data to be Submitted:

notes = Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36
foundIn = v185a-1611-g41ebba11a-dirty
faultData = com.google.gwt.core.client.JavaScriptException: (TypeError) : Cannot read properties of undefined (reading 'type_1')
projectId = 6627856092233728


[{"action": "ADD_COMPONENT","type": "VerticalArrangement","name": "MainLayout","properties":{"Width": -2,"Height": -2}},{"action": "ADD_COMPONENT","type": "Label","name": "TitleLabel","parent": "MainLayout","properties":{"Text": "BLE蓝牙低功耗演示","FontSize": 24,"FontBold":true,"Width": -2,"TextAlignment": 1}},{"action": "ADD_COMPONENT","type": "HorizontalArrangement","name": "ScanButtonLayout","parent": "MainLayout","properties":{"Width": -2}},{"action": "ADD_COMPONENT","type": "Button","name": "ScanButton","parent": "ScanButtonLayout","properties":{"Text": "扫描设备","Width": -2,"Height": 50}},{"action": "ADD_COMPONENT","type": "Button","name": "StopScanButton","parent": "ScanButtonLayout","properties":{"Text": "停止扫描","Width": -2,"Height": 50}},{"action": "ADD_COMPONENT","type": "Label","name": "StatusLabel","parent": "MainLayout","properties":{"Text": "状态:准备就绪","Width": -2,"FontSize": 16}},{"action": "ADD_COMPONENT","type": "ListView","name": "DeviceList","parent": "MainLayout","properties":{"Width": -2,"Height": 200,"ElementsFromString": "暂无设备"}},{"action": "ADD_COMPONENT","type": "HorizontalArrangement","name": "ConnectButtonLayout","parent": "MainLayout","properties":{"Width": -2}},{"action": "ADD_COMPONENT","type": "Button","name": "ConnectButton","parent": "ConnectButtonLayout","properties":{"Text": "连接设备","Width": -2,"Height": 50}},{"action": "ADD_COMPONENT","type": "Button","name": "DisconnectButton","parent": "ConnectButtonLayout","properties":{"Text": "断开连接","Width": -2,"Height": 50}},{"action": "ADD_COMPONENT","type": "Label","name": "ConnectedDeviceLabel","parent": "MainLayout","properties":{"Text": "已连接设备:无","Width": -2,"FontSize": 16}},{"action": "ADD_COMPONENT","type": "HorizontalArrangement","name": "DataLayout","parent": "MainLayout","properties":{"Width": -2}},{"action": "ADD_COMPONENT","type": "TextBox","name": "DataInput","parent": "DataLayout","properties":{"Hint": "输入要发送的数据","Width": -2,"Height": 50}},{"action": "ADD_COMPONENT","type": "Button","name": "SendButton","parent": "DataLayout","properties":{"Text": "发送","Width": -2,"Height": 50}},{"action": "ADD_COMPONENT","type": "Label","name": "ReceivedDataLabel","parent": "MainLayout","properties":{"Text": "接收数据:","Width": -2,"FontSize": 16}},{"action": "ADD_COMPONENT","type": "Label","name": "DataDisplay","parent": "MainLayout","properties":{"Text": "等待数据...","Width": -2,"Height": 100,"BackgroundColor": "&HFFE0E0E0"}},{"action": "ADD_COMPONENT","type": "Notifier","name": "Notifier1"},{"action": "SET_PROPERTY","component": "DisconnectButton","property": "Enabled","value":false},{"action": "SET_PROPERTY","component": "ConnectButton","property": "Enabled","value":false},{"action": "SET_PROPERTY","component": "SendButton","property": "Enabled","value":false}]

作者: App Inventor 2     时间: 昨天 22:34
❌ 失败 1 项:
• 嵌套块验证失败:组件 BluetoothLE1(BluetoothLE) 没有方法 "WriteString",已拒绝添加

[{"action": "ADD_BLOCK_INTENT","intent":[{"var": "deviceList","init":{"list":[]}},{"var": "selectedDevice","init": ""},{"var": "connectedDevice","init": ""},{"event": "ScanButton.Click","do":[{"set_prop": "StatusLabel.Text","value": "状态:正在扫描设备..."},{"set_prop": "DeviceList.Elements","value":{"list":["扫描中..."]}},{"call": "BluetoothLE1.StartScanning","args":{}}]},{"event": "StopScanButton.Click","do":[{"call": "BluetoothLE1.StopScanning","args":{}},{"set_prop": "StatusLabel.Text","value": "状态:扫描已停止"}]},{"event": "BluetoothLE1.DeviceFound","do":[{"list_add":{"list":{"get_var": "deviceList"},"item":{"join":[{"get_var": "name"}," (",{"get_var": "address"},")"]}}},{"set_prop": "DeviceList.Elements","value":{"get_var": "deviceList"}},{"set_prop": "StatusLabel.Text","value":{"join":["状态:发现设备 ",{"get_var": "name"}]}}]},{"event": "DeviceList.AfterPicking","do":[{"set_var": "selectedDevice","value":{"select_item":{"list":{"get_prop": "DeviceList.Elements"},"index":{"get_prop": "DeviceList.SelectionIndex"}}}},{"set_prop": "StatusLabel.Text","value":{"join":["状态:已选择 ",{"get_var": "selectedDevice"}]}},{"set_prop": "ConnectButton.Enabled","value":true}]},{"event": "ConnectButton.Click","do":[{"call": "BluetoothLE1.Connect","args":{"address":{"text_split":{"text":{"get_var": "selectedDevice"},"at": "("}}}},{"set_prop": "StatusLabel.Text","value": "状态:正在连接..."}]},{"event": "BluetoothLE1.Connected","do":[{"set_var": "connectedDevice","value":{"get_var": "selectedDevice"}},{"set_prop": "ConnectedDeviceLabel.Text","value":{"join":["已连接设备:",{"get_var": "connectedDevice"}]}},{"set_prop": "DisconnectButton.Enabled","value":true},{"set_prop": "SendButton.Enabled","value":true},{"set_prop": "ConnectButton.Enabled","value":false},{"set_prop": "StatusLabel.Text","value": "状态:连接成功"}]},{"event": "DisconnectButton.Click","do":[{"call": "BluetoothLE1.Disconnect","args":{}},{"set_var": "connectedDevice","value": ""},{"set_prop": "ConnectedDeviceLabel.Text","value": "已连接设备:无"},{"set_prop": "DisconnectButton.Enabled","value":false},{"set_prop": "SendButton.Enabled","value":false},{"set_prop": "ConnectButton.Enabled","value":true},{"set_prop": "StatusLabel.Text","value": "状态:已断开连接"}]},{"event": "SendButton.Click","do":[{"call": "BluetoothLE1.WriteString","args":{"service": "0000ffe0-0000-1000-8000-00805f9b34fb","characteristic": "0000ffe1-0000-1000-8000-00805f9b34fb","text":{"get_prop": "DataInput.Text"}}},{"set_prop": "StatusLabel.Text","value": "状态:数据已发送"}]},{"event": "BluetoothLE1.StringReceived","do":[{"set_prop": "DataDisplay.Text","value":{"join":[{"get_prop": "DataDisplay.Text"},"\n",{"get_var": "text"}]}},{"set_prop": "StatusLabel.Text","value": "状态:收到数据"}]},{"event": "BluetoothLE1.ErrorOccurred","do":[{"call": "Notifier1.ShowAlert","args":{"message":{"join":["BLE错误:",{"get_var": "message"}]}}},{"set_prop": "StatusLabel.Text","value":{"join":["状态:错误 - ",{"get_var": "message"}]}}]}]},{"action": "CLEANUP_BLOCKS"}]

作者: App Inventor 2     时间: 昨天 22:43
❌ 失败 1 项:
• AI 生成的 JSON 格式有误(可能括号/引号不匹配),请重新发送需求让 AI 重新生成

[{"action": "ADD_BLOCK_INTENT","intent":[{"function": "计算水仙花数","params":[],"return":{"do_return":{"do":[{"local_var": "result","value":{"list":[]},"do":[{"for_range":{"var": "i","from": 100,"to": 999,"step": 1,"do":[{"local_var": "百位","value":{"divide":[{"get_var": "i"},100]},"do":[]},{"local_var": "十位","value":{"modulo":[{"divide":[{"get_var": "i"},10]},10]},"do":[]},{"local_var": "个位","value":{"modulo":[{"get_var": "i"},10]},"do":[]},{"local_var": "立方和","value":{"add":[{"power":[{"get_var": "百位"},3]},{"power":[{"get_var": "十位"},3]},{"power":[{"get_var": "个位"},3]}]},"do":[]},{"if":{"eq":[{"get_var": "立方和"},{"get_var": "i"}]},"then":[{"list_add":{"list":{"get_var": "result"},"item":{"get_var": "i"}}}]}]}]}],"value":{"get_var": "result"}}}}]},{"action": "CLEANUP_BLOCKS"}]

作者: App Inventor 2     时间: 昨天 22:45
❌ 失败 1 项:
• AI 生成的 JSON 格式有误(可能括号/引号不匹配),请重新发送需求让 AI 重新生成

[{"action": "ADD_BLOCK_INTENT","intent":[{"event": "SendButton.Click","do":[{"if":{"is_empty":{"get_prop": "MessageInput.Text"}},"then":[{"call": "Notifier1.ShowAlert","args":{"message": "请输入消息内容"}}],"else_do":[{"call_proc": "显示消息气泡","args":{"message":{"get_prop": "MessageInput.Text"},"isMine":true}},{"set_prop": "MessageInput.Text","value": ""}]}]},{"procedure": "显示消息气泡","params":["message","isMine"],"do":[{"local_var": "bubble","value":{"call": "VerticalArrangement1","args":{}},"do":[{"set_prop": "bubble.Width","value": -2},{"set_prop": "bubble.Height","value": -1},{"set_prop": "bubble.AlignHorizontal","value":{"choose":{"test":{"get_var": "isMine"},"then": 3,"else": 1}}},{"local_var": "bubbleContent","value":{"call": "HorizontalArrangement1","args":{}},"do":[{"set_prop": "bubbleContent.Width","value": -1},{"set_prop": "bubbleContent.Height","value": -1},{"set_prop": "bubbleContent.BackgroundColor","value":{"choose":{"test":{"get_var": "isMine"},"then": "&HFF2196F3","else": "&HFFFFFFFF"}}},{"set_prop": "bubbleContent.Shape","value": 1},{"set_prop": "bubbleContent.Margin","value": 5},{"local_var": "messageLabel","value":{"call": "Label1","args":{}},"do":[{"set_prop": "messageLabel.Width","value": -2},{"set_prop": "messageLabel.Height","value": -1},{"set_prop": "messageLabel.Text","value":{"get_var": "message"}},{"set_prop": "messageLabel.TextColor","value":{"choose":{"test":{"get_var": "isMine"},"then": "&HFFFFFFFF","else": "&HFF000000"}}},{"set_prop": "messageLabel.FontSize","value": 16},{"set_prop": "messageLabel.Margin","value": 10}]}]}]}]},{"action": "CLEANUP_BLOCKS"}]]

执行失败: Expected ',' or '}' after property value in JSON at position 1600 (line 1 column 1601)

作者: App Inventor 2     时间: 半小时前
❌ 失败 1 项:
• 代码块添加失败,工作区已恢复: 块 component_event: Connection checks failed.

[{"action": "ADD_BLOCK_INTENT","intent":[{"var": "chatHistory","init":{"list":[]}},{"var": "isThinking","init":false},{"event": "SendButton.Click","do":[{"if":{"and":[{"not":{"is_empty":{"get_prop": "InputTextBox.Text"}}},{"not":{"get_var": "global isThinking"}}]},"then":[{"set_var": "global isThinking","value":true},{"set_prop": "SendButton.Text","value": "思考中..."},{"set_prop": "SendButton.BackgroundColor","value": "&HFF9E9E9E"},{"local_var": "userMessage","value":{"get_prop": "InputTextBox.Text"},"do":[{"list_add":{"list":{"get_var": "global chatHistory"},"item":{"dict":[{"dict_pair":{"key": "role","value": "user"}},{"dict_pair":{"key": "content","value":{"get_var": "userMessage"}}}]}}},{"call": "ChatListView.AddItem","args":{"mainText":{"join":["用户: ",{"get_var": "userMessage"}]},"detailText": "","imageName": ""}},{"set_prop": "InputTextBox.Text","value": ""},{"call": "LLMAI2Ext1.Chat","args":{"content":{"get_var": "userMessage"}}}]}],"else_do":[{"if":{"get_var": "global isThinking"},"then":[{"call": "Notifier1.ShowAlert","args":{"notice": "正在思考中,请稍候..."}}],"else_do":[{"call": "Notifier1.ShowAlert","args":{"notice": "请输入问题内容"}}]}]}]},{"event": "LLMAI2Ext1.GotText","do":[{"call": "ChatListView.AddItem","args":{"mainText":{"join":["AI: ",{"text": "text"}]},"detailText": "","imageName": ""}},{"set_var": "global isThinking","value":false},{"set_prop": "SendButton.Text","value": "发送"},{"set_prop": "SendButton.BackgroundColor","value": "&HFF4CAF50"}]},{"event": "Screen6.ErrorOccurred","do":[{"call": "Notifier1.ShowAlert","args":{"notice":{"join":["请求失败: ",{"get_var": "message"}]}}},{"set_var": "global isThinking","value":false},{"set_prop": "SendButton.Text","value": "发送"},{"set_prop": "SendButton.BackgroundColor","value": "&HFF4CAF50"}]},{"event": "ClearButton.Click","do":[{"call": "ChatListView.AddItems","args":{"itemsList":{"list":[]}}},{"set_var": "global chatHistory","value":{"list":[]}},{"call": "Notifier1.ShowAlert","args":{"notice": "聊天记录已清空"}}]},{"event": "InputTextBox.GotFocus","do":[{"call": "InputTextBox.HideKeyboard"}]},{"event": "Screen6.Initialize","do":[{"call": "Notifier1.ShowAlert","args":{"notice": "请先设置DeepSeek API密钥\n在组件属性中配置APIKey"}}]}]},{"action": "CLEANUP_BLOCKS"}]





欢迎光临 清泛IT社区 (https://bbs.tsingfun.com/) Powered by Discuz! X3.3