fix(home page): 修复加载弹窗显示时机不正确的问题
调整了加载弹窗的显示和隐藏位置,在初始化开始时显示加载弹窗,初始化完成后隐藏弹窗,优化页面加载体验
This commit is contained in:
parent
dccd851058
commit
ba5753a2ef
@ -822,6 +822,7 @@ namespace Kill.UI.Pages
|
|||||||
|
|
||||||
public async Task Init()
|
public async Task Init()
|
||||||
{
|
{
|
||||||
|
LoadingUI.Show();
|
||||||
if (DataManager.Instance.userInfo.device_count == 0)
|
if (DataManager.Instance.userInfo.device_count == 0)
|
||||||
{
|
{
|
||||||
noDevicePage.SetActive(true);
|
noDevicePage.SetActive(true);
|
||||||
@ -877,13 +878,13 @@ namespace Kill.UI.Pages
|
|||||||
Debug.Log("当前选中设备:" + DataManager.Instance.selectedDeviceMac);
|
Debug.Log("当前选中设备:" + DataManager.Instance.selectedDeviceMac);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
selectDeviceButton.GetComponentInChildren<Text>().text = selectedDevice.device_name;
|
||||||
|
selectDeviceButton.gameObject.SetActive(true);
|
||||||
hasWifi=await GetDeviceOnlineStatus();
|
hasWifi=await GetDeviceOnlineStatus();
|
||||||
DataManager.Instance.hasWifi=hasWifi;
|
DataManager.Instance.hasWifi=hasWifi;
|
||||||
|
|
||||||
hasBluetooth = BluetoothManager.Instance.ChangeAimMac(selectedDevice.ble_mac);
|
hasBluetooth = BluetoothManager.Instance.ChangeAimMac(selectedDevice.ble_mac);
|
||||||
DataManager.Instance.hasBluetooth=hasBluetooth;
|
DataManager.Instance.hasBluetooth=hasBluetooth;
|
||||||
selectDeviceButton.GetComponentInChildren<Text>().text = selectedDevice.device_name;
|
|
||||||
selectDeviceButton.gameObject.SetActive(true);
|
|
||||||
|
|
||||||
// 先初始化所有 UI 为未连接状态
|
// 先初始化所有 UI 为未连接状态
|
||||||
ResetAllDeviceUI();
|
ResetAllDeviceUI();
|
||||||
@ -928,6 +929,7 @@ namespace Kill.UI.Pages
|
|||||||
DataManager.Instance.selectedDevice = selectedDevice;
|
DataManager.Instance.selectedDevice = selectedDevice;
|
||||||
DataManager.Instance.OwnedDevices=OwnedDevices;
|
DataManager.Instance.OwnedDevices=OwnedDevices;
|
||||||
DataManager.Instance.SharedDevices=SharedDevices;
|
DataManager.Instance.SharedDevices=SharedDevices;
|
||||||
|
LoadingUI.Hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user