LargeScreen/Modules/tunnel_panel.gd

32 lines
1003 B
GDScript3
Raw Normal View History

2024-12-19 19:13:12 +08:00
extends Control
signal search_click(str:String)
signal request_hide()
func get_input()->String:
return $TextureRect2/TextureRext/LineEdit.text
func _on_terminal_search_button_pressed() -> void:
search_click.emit(get_input())
2025-01-13 14:39:58 +08:00
$HTTPRequest.request("https://pixconsole.pixmoving.city/api/device/car_list?imsi=" + %LineEdit.text )
2024-12-19 19:13:12 +08:00
2025-01-13 14:39:58 +08:00
request_hide.emit()
pass # Replace with function body.
2024-12-19 19:13:12 +08:00
func _on_tunnel_close_pressed() -> void:
request_hide.emit()
pass # Replace with function body.
2025-01-13 14:39:58 +08:00
func _on_http_request_request_completed(result: int, response_code: int, headers: PackedStringArray, body: PackedByteArray) -> void:
Global.urlArr = []
var response = str_to_var(body.get_string_from_utf8())
if response.data.items.size() > 0:
var advert = str_to_var(response.data.items[0].advert)
for url in advert:
Global.urlArr.append(url.url)
# 将打印 HTTPRequest 节点使用的用户代理字符串(由 httpbin.org 识别)。
print(Global.urlArr)
pass # Replace with function body.