fix:1、bug修复。

Signed-off-by: barry <barry@gmail.com>
This commit is contained in:
2026-07-14 09:28:01 +08:00
parent 7deaa15511
commit 4187297e82
24 changed files with 343 additions and 296 deletions
@@ -17,7 +17,7 @@ namespace RedHotRoast
{
private RecordViewUICtrl ctrl;
private RecordViewModel model;
private FGUI.bkg_jilu.com_jilu ui;
private com_jilu ui;
public RecordViewUI(RecordViewUICtrl ctrl) : base(ctrl)
{
@@ -43,8 +43,6 @@ namespace RedHotRoast
protected override void OnClose()
{
WebviewManager.Instance.SetDarkThough(true);
if (coroutine != null)
{
CrazyAsyKit.StopCoroutine(coroutine);
@@ -53,14 +51,11 @@ namespace RedHotRoast
protected override void OnBind()
{
ui = baseUI as FGUI.bkg_jilu.com_jilu;
ui = baseUI as com_jilu;
}
protected override void OnOpenBefore(object args)
{
WebviewManager.Instance.SetDarkThough(false);
InitView();
ui.btn_close.onClick.Add(() =>
@@ -93,7 +88,7 @@ namespace RedHotRoast
}
#endregion
private bool isroll = false;
private bool isroll;
private List<GObject> list_panel = new List<GObject>();
@@ -109,7 +104,7 @@ namespace RedHotRoast
UpdateRecord();
}
private Coroutine coroutine = null;
private Coroutine coroutine;
public void UpdateRecord()
{
if (ctrl.model == null || ctrl.model.recordList.Count == 0) return;
@@ -129,35 +124,17 @@ namespace RedHotRoast
coroutine = CrazyAsyKit.StartCoroutine(ScrollRoutine());
}
}
private (string key, int value) GetVipLevelFromName(string name)
{
switch (name)
{
case "Gold":
return ("G.VIP", 1);
case "Platinum":
return ("P.VIP", 2);
case "Diamond":
return ("D.VIP", 3);
default:
return (string.Empty, 0);
}
}
private void setRecord(int index, GObject obj)
{
com_record_item item = (com_record_item)obj;
string[] values = ctrl.model.recordList[index].Split('#');
string[] values = ctrl.model.recordList[index].Split('-');
item.name.text = values[0];
var (key, value) = GetVipLevelFromName(values[1]);
item.num.text = key; // 假设 money 是显示金额的字段
item.num.text = GameHelper.getChString(decimal.Parse(values[1]));
string[] parts = values[2].Split(" ");
item.time.text = parts[0];
item.icon_loader.url = $"ui://LG_Common/vip_{value}";
item.lab_claim.text = GameHelper.getDesByKey("ww");
}
private IEnumerator ScrollRoutine()
@@ -165,12 +142,12 @@ namespace RedHotRoast
while (true)
{
int panelCount = list_panel.Count; // 缓存 list_panel 的长度
for (int i = 0; i < panelCount; i++)
{
for (int i = 0; i < panelCount; i++)
{
if (i < list_panel.Count) // 再次检查索引是否有效
{
float targetY = list_panel[i].y - 129;
GObjectMoveFunc.MoveTween(list_panel[i], targetY);
float targetY = list_panel[i].y - 110;
list_panel[i].MoveTween(targetY);
}
}