|
@@ -67,6 +67,9 @@ cc.Class({
|
|
|
|
|
|
this.allFriendNode.on(cc.Node.EventType.TOUCH_END, _.debounce(() => {
|
|
|
GameEvent.fire(Notikey.ShowFriendSystem);
|
|
|
+
|
|
|
+ this.updateFriendList();
|
|
|
+
|
|
|
GameModule.audioMng.playButton();
|
|
|
}, 1000, true), this);
|
|
|
|
|
@@ -74,20 +77,7 @@ cc.Class({
|
|
|
|
|
|
// 刷新好友列表
|
|
|
GameEvent.on(Notikey.RefreshFriendList, this, () => {
|
|
|
-
|
|
|
- this.loadFriendData().then((data) => {
|
|
|
- let _friendList = data.users || [];
|
|
|
- // 过滤好友申请项
|
|
|
- _friendList = _friendList.filter(n => {
|
|
|
- return n.isApplied != 1
|
|
|
- });
|
|
|
-
|
|
|
- Global.friendList = this.friends = _friendList;
|
|
|
-
|
|
|
- this.friendLayout();
|
|
|
- }).catch((err) => {
|
|
|
- console.log(err);
|
|
|
- });
|
|
|
+ this.updateFriendList();
|
|
|
});
|
|
|
|
|
|
// 刷新艺人列表
|
|
@@ -125,8 +115,12 @@ cc.Class({
|
|
|
},
|
|
|
|
|
|
init(game) {
|
|
|
- this.game = game
|
|
|
+ this.game = game;
|
|
|
+
|
|
|
+ this.updateFriendList();
|
|
|
+ },
|
|
|
|
|
|
+ updateFriendList () {
|
|
|
this.loadFriendData().then((data) => { // 好友数据回调
|
|
|
let _friendList = data.users || [];
|
|
|
// 过滤好友申请项
|