Commit 62b8e2f5 authored by 王雪伟's avatar 王雪伟

加入合成上报

parent 73b5c30f
......@@ -6,18 +6,18 @@ using UnityEngine.UI;
public class MainPanel : BasePanel
{
<<<<<<< HEAD
protected override void Awake()
protected override void Awake()
{
base.Awake();
EventCenter.Getinstance().AddUpdateListener("RegisterPanel",()=> { UIMgr.Getinstance().RegisterPanel<MainPanel>(this); });
EventCenter.Getinstance().AddUpdateListener("RegisterPanel", () => { UIMgr.Getinstance().RegisterPanel<MainPanel>(this); });
}
=======
private string currentSongId = "0";
private int nextSongId = 0;
private List<string> notesList = null;
private int playNoteIndex = 0;
private bool IsSuccess = false;
>>>>>>> 0fa10fd520ad3cd02f948768758850a333bc8c2c
public override void OnHide(object data = null)
{
......@@ -64,9 +64,10 @@ public class MainPanel : BasePanel
if (playNoteIndex == notesList.Count)
{
GetNoteCompleted();
IsSuccess = true;
Debug.unityLogger.Log("合成音符红包");
UIMgr.Getinstance().ShowPanel<MusicRedBagPanel>(E_Layer.mid);
//UIMgr.Getinstance().ShowPanel<MusicRedBagPanel>(E_Layer.mid);
}
GetControl<Text>("ProgressTv").text = playNoteIndex + "/" + notesList.Count;
......@@ -99,6 +100,8 @@ public class MainPanel : BasePanel
paras.Add("song_id", song_id);
HttpTool.Instance._Get2("app/v1/watermelon/notes", paras, new Action<Response<List<string>>>((result) =>
{
currentSongId = result.result.song_id;
nextSongId = result.result.next_song_id;
IsSuccess = false;
playNoteIndex = 0;
notesList = result.result.data;
......@@ -109,7 +112,22 @@ public class MainPanel : BasePanel
{
Debug.unityLogger.Log("获取下一组生成的球 " + code + " msg " + msg);
}));
}
/// <summary>
/// 合成歌曲上报
/// </summary>
/// <param name="song_id"></param>
public void GetNoteCompleted()
{
Dictionary<string, object> paras = new Dictionary<string, object>();
paras.Add("song_id", currentSongId);
HttpTool.Instance._Get("app/v1/watermelon/note_completed", paras, new Action<EmptyBean>((result) =>
{
}), new Action<string, string>((code, msg) =>
{
Debug.unityLogger.Log("合成歌曲上报 " + code + " msg " + msg);
}));
}
}
......@@ -18,7 +18,7 @@ public class MusicPanel : BasePanel
#region 通过数据初始化面板
Dictionary<string, object> paras = new Dictionary<string, object>();
paras.Add("song_id", 0);
paras.Add("song_id", 1);
HttpTool.Instance._Get("app/v1/watermelon/songs_list", paras, new Action<SongBean>((result) =>
{
print(result);
......
......@@ -6,16 +6,16 @@ public class MusicRedBagPanel : BasePanel
{
public override void OnHide(object data = null)
{
throw new System.NotImplementedException();
//throw new System.NotImplementedException();
}
public override void OnInit(object data = null)
{
throw new System.NotImplementedException();
//throw new System.NotImplementedException();
}
public override void OnRefresh(object data = null)
{
throw new System.NotImplementedException();
//throw new System.NotImplementedException();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment