add friendtip
This commit is contained in:
parent
107446bc42
commit
b6a040963c
File diff suppressed because it is too large
Load Diff
@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"ver": "1.0.1",
|
|
||||||
"uuid": "59fbd33f-7da6-4aa3-9870-43551228d049",
|
|
||||||
"asyncLoadAssets": false,
|
|
||||||
"autoReleaseAssets": false,
|
|
||||||
"subMetas": {}
|
|
||||||
}
|
|
1338
assets/resources/prefabs/tips/pb_blacklist.prefab
Normal file
1338
assets/resources/prefabs/tips/pb_blacklist.prefab
Normal file
File diff suppressed because it is too large
Load Diff
7
assets/resources/prefabs/tips/pb_blacklist.prefab.meta
Normal file
7
assets/resources/prefabs/tips/pb_blacklist.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"ver": "1.0.1",
|
||||||
|
"uuid": "d0aac2bd-3878-4c8d-9f5d-9c2588682654",
|
||||||
|
"optimizationPolicy": "AUTO",
|
||||||
|
"asyncLoadAssets": false,
|
||||||
|
"subMetas": {}
|
||||||
|
}
|
1338
assets/resources/prefabs/tips/pb_delete.prefab
Normal file
1338
assets/resources/prefabs/tips/pb_delete.prefab
Normal file
File diff suppressed because it is too large
Load Diff
7
assets/resources/prefabs/tips/pb_delete.prefab.meta
Normal file
7
assets/resources/prefabs/tips/pb_delete.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"ver": "1.0.1",
|
||||||
|
"uuid": "278d9839-9790-432b-afad-ebc8e6d90af1",
|
||||||
|
"optimizationPolicy": "AUTO",
|
||||||
|
"asyncLoadAssets": false,
|
||||||
|
"subMetas": {}
|
||||||
|
}
|
@ -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,
|
||||||
});
|
});
|
||||||
|
30
assets/scripts/tips/BlackListTips.ts
Normal file
30
assets/scripts/tips/BlackListTips.ts
Normal 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()
|
||||||
|
}
|
||||||
|
}
|
9
assets/scripts/tips/BlackListTips.ts.meta
Normal file
9
assets/scripts/tips/BlackListTips.ts.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"ver": "1.0.5",
|
||||||
|
"uuid": "a06a89ea-999e-4d7f-aeb6-1ac695bdf8b5",
|
||||||
|
"isPlugin": false,
|
||||||
|
"loadPluginInWeb": true,
|
||||||
|
"loadPluginInNative": true,
|
||||||
|
"loadPluginInEditor": false,
|
||||||
|
"subMetas": {}
|
||||||
|
}
|
31
assets/scripts/tips/DeleteFriendTips.ts
Normal file
31
assets/scripts/tips/DeleteFriendTips.ts
Normal 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()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
9
assets/scripts/tips/DeleteFriendTips.ts.meta
Normal file
9
assets/scripts/tips/DeleteFriendTips.ts.meta
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"ver": "1.0.5",
|
||||||
|
"uuid": "d05e5f0b-e7b1-4736-8340-01f6fd34eaf5",
|
||||||
|
"isPlugin": false,
|
||||||
|
"loadPluginInWeb": true,
|
||||||
|
"loadPluginInNative": true,
|
||||||
|
"loadPluginInEditor": false,
|
||||||
|
"subMetas": {}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user