public void OnDeleteFriend(FriendMessageItemView friendItem) { YxMessageBox.Show("确定要删除该消息吗?", "", (box, btnName) => { if (btnName == YxMessageBox.BtnLeft) { var uinfo = friendItem.GetData <UserInfo>(); if (uinfo == null) { return; } FriendController.Instance.SendApplyUser(uinfo.Id, "4", msg => { if (!(msg is Dictionary <string, object>)) { return; } var parm = (Dictionary <string, object>)msg; if (!parm.ContainsKey("message")) { YxMessageBox.Show("已成功删除消息!"); } _items.Remove(friendItem); Destroy(friendItem.gameObject); _curItemParent.repositionNow = true; _curItemParent.Reposition(); UpdateFriendTip(); }); } }, true, YxMessageBox.LeftBtnStyle | YxMessageBox.RightBtnStyle); }
public void DeleteItem(FriendMessageItemView friendMessageItemView) { _items.Remove(friendMessageItemView); Destroy(friendMessageItemView.gameObject); Reposition(); UpdateFriendTip(); }