mirror of
https://github.com/Leo501/CocosCreatorTutorial.git
synced 2026-06-05 02:37:16 +08:00
完善pomelo客户端
This commit is contained in:
26
PomeloClient/assets/Script/view/chat/ChatItem.js
Normal file
26
PomeloClient/assets/Script/view/chat/ChatItem.js
Normal file
@@ -0,0 +1,26 @@
|
||||
const timeUtil = require('TimeUtil');
|
||||
cc.Class({
|
||||
extends: cc.Component,
|
||||
|
||||
properties: {
|
||||
timeLabel: cc.Label,
|
||||
nameLabel: cc.Label,
|
||||
contextLabel: cc.Label
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
|
||||
init(data) {
|
||||
this.contextLabel.node.active = false;
|
||||
this.timeLabel.string = timeUtil.timeString(new Date());
|
||||
this.nameLabel.string = data.name + ' : ' + data.msg;
|
||||
}
|
||||
|
||||
// start () {
|
||||
|
||||
// },
|
||||
|
||||
// update (dt) {},
|
||||
});
|
||||
9
PomeloClient/assets/Script/view/chat/ChatItem.js.meta
Normal file
9
PomeloClient/assets/Script/view/chat/ChatItem.js.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.5",
|
||||
"uuid": "4fde3bae-aba9-4942-9679-3a8c5ac97448",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
28
PomeloClient/assets/Script/view/chat/ChatUi.js
Normal file
28
PomeloClient/assets/Script/view/chat/ChatUi.js
Normal file
@@ -0,0 +1,28 @@
|
||||
cc.Class({
|
||||
extends: cc.Component,
|
||||
|
||||
properties: {
|
||||
nodeContent: cc.Node,
|
||||
prefabItem: cc.Prefab,
|
||||
editBoxInput: cc.EditBox
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
this.nodeContent.removeAllChildren();
|
||||
},
|
||||
|
||||
createItem(data, componentName) {
|
||||
let node = cc.instantiate(this.prefabItem);
|
||||
node.script = node.getComponent(componentName);
|
||||
node.script.init();
|
||||
this.nodeContent.addChild(node);
|
||||
},
|
||||
|
||||
onEventClicked_send() {
|
||||
if (!this.editBoxInput.string) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// update (dt) {},
|
||||
});
|
||||
9
PomeloClient/assets/Script/view/chat/ChatUi.js.meta
Normal file
9
PomeloClient/assets/Script/view/chat/ChatUi.js.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.5",
|
||||
"uuid": "022bc4ef-5334-4a19-a38b-0238660ddabc",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
22
PomeloClient/assets/Script/view/chat/ChatUserItem.js
Normal file
22
PomeloClient/assets/Script/view/chat/ChatUserItem.js
Normal file
@@ -0,0 +1,22 @@
|
||||
cc.Class({
|
||||
extends: cc.Component,
|
||||
|
||||
properties: {
|
||||
labelName: cc.Label
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
|
||||
init(name) {
|
||||
|
||||
this.labelName.string = name;
|
||||
}
|
||||
|
||||
// start () {
|
||||
|
||||
// },
|
||||
|
||||
// update (dt) {},
|
||||
});
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.5",
|
||||
"uuid": "5ee70e85-f69b-4fcf-b209-e9d12a0ebeea",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
14
PomeloClient/assets/Script/view/chat/ChatUserUi.js
Normal file
14
PomeloClient/assets/Script/view/chat/ChatUserUi.js
Normal file
@@ -0,0 +1,14 @@
|
||||
cc.Class({
|
||||
extends: cc.Component,
|
||||
|
||||
properties: {
|
||||
nodeContext: cc.Node
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
this.nodeContext.removeAllChildren();
|
||||
},
|
||||
|
||||
|
||||
// update (dt) {},
|
||||
});
|
||||
9
PomeloClient/assets/Script/view/chat/ChatUserUi.js.meta
Normal file
9
PomeloClient/assets/Script/view/chat/ChatUserUi.js.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.0.5",
|
||||
"uuid": "2092b3d2-067d-47f5-93f0-033a06008068",
|
||||
"isPlugin": false,
|
||||
"loadPluginInWeb": true,
|
||||
"loadPluginInNative": true,
|
||||
"loadPluginInEditor": false,
|
||||
"subMetas": {}
|
||||
}
|
||||
Reference in New Issue
Block a user