add friendtip

This commit is contained in:
guoqing.zhu 2022-05-30 23:57:41 +08:00
parent 107446bc42
commit b6a040963c
11 changed files with 2785 additions and 2534 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +0,0 @@
{
"ver": "1.0.1",
"uuid": "59fbd33f-7da6-4aa3-9870-43551228d049",
"asyncLoadAssets": false,
"autoReleaseAssets": false,
"subMetas": {}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
{
"ver": "1.0.1",
"uuid": "d0aac2bd-3878-4c8d-9f5d-9c2588682654",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"subMetas": {}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
{
"ver": "1.0.1",
"uuid": "278d9839-9790-432b-afad-ebc8e6d90af1",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"subMetas": {}
}

View File

@ -1,5 +1,8 @@
var Utils = require('Utils'); var Utils = require('Utils');
var playerData = require('playerData'); var playerData = require('playerData');
const { uimanger } = require('../UIManger');
const { DeleteFriendTips } = require('../../tips/DeleteFriendTips');
const { BlackListTips } = require('../../tips/BlackListTips');
cc.Class({ cc.Class({
extends: cc.Component, extends: cc.Component,
@ -98,29 +101,32 @@ cc.Class({
// friendlist // friendlist
onAddToBlacklist() { onAddToBlacklist() {
cc.chatMgr.sendmsg('CMFriendAddBlack', { console.log("add black list")
user_info: JSON.parse(this.tmpData), //MFUserInfo
}); var data={
account:this.playerAccount,
name:this.playerName.getComponent(cc.Label).string,
user_info:this.tmpData
}
uimanger.showUI(BlackListTips.prefabPath,data)
}, },
onDelete() { onDelete() {
var data={
cc.chatMgr.sendmsg('CMFriendDelete', { account:this.playerAccount,
friend_id: this.playerAccount, name:this.playerName.getComponent(cc.Label).string
}); }
uimanger.showUI(DeleteFriendTips.prefabPath,data)
}, },
// applylist // applylist
onAgree() { onAgree() {
cc.chatMgr.sendmsg('CMFriendAgree', { cc.chatMgr.sendmsg('CMFriendAgree', {
apply: JSON.parse(this.tmpData), apply: JSON.parse(this.tmpData),
}); });
}, },
onRefuse() { onRefuse() {
cc.chatMgr.sendmsg('CMFriendRefuse', { cc.chatMgr.sendmsg('CMFriendRefuse', {
apply: JSON.parse(this.tmpData), apply: JSON.parse(this.tmpData),
}); });
@ -128,7 +134,6 @@ cc.Class({
// blacklist // blacklist
onAddToFriend() { onAddToFriend() {
cc.chatMgr.sendmsg('CMFriendDeleteBlack', { cc.chatMgr.sendmsg('CMFriendDeleteBlack', {
account_id: this.playerAccount, account_id: this.playerAccount,
}); });

View File

@ -0,0 +1,30 @@
import { UIBase } from "../UI/UIBase";
const {ccclass, property} = cc._decorator;
@ccclass
export class BlackListTips extends UIBase {
@property(cc.Label) friendName : cc.Label = null;
public static prefabPath = 'prefabs/tips/pb_blacklist';
private curremtData : any;
init(data: any) {
this.curremtData = data;
this.friendName.string = data.name;
}
onClose(){
this.node.destroy()
}
onOK(){
cc.chatMgr.sendmsg('CMFriendAddBlack', {
user_info: JSON.parse(this.curremtData.user_info)
});
this.node.destroy()
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "1.0.5",
"uuid": "a06a89ea-999e-4d7f-aeb6-1ac695bdf8b5",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

View File

@ -0,0 +1,31 @@
import { UIBase } from "../UI/UIBase";
const {ccclass, property} = cc._decorator;
@ccclass
export class DeleteFriendTips extends UIBase {
@property(cc.Label) friendName : cc.Label = null;
public static prefabPath = 'prefabs/tips/pb_delete';
private curremtData : any;
init(data: any) {
this.curremtData = data;
this.friendName.string = data.name;
}
onClose(){
this.node.destroy()
}
onOK(){
cc.chatMgr.sendmsg('CMFriendDelete', {
friend_id: this.curremtData.account
});
this.node.destroy()
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "1.0.5",
"uuid": "d05e5f0b-e7b1-4736-8340-01f6fd34eaf5",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}