86 lines
2.4 KiB
Plaintext
86 lines
2.4 KiB
Plaintext
import { _decorator, EditBox, instantiate, isValid, Label, Node, Prefab, Sprite } from 'cc';
|
|
import { GButton } from '../../Main/Common/GButton';
|
|
import AudioManager from '../../Main/Manager/AudioManager';
|
|
import Utils from '../../Main/Common/Utils';
|
|
import { ViewManager } from '../../Main/Manager/ViewManager';
|
|
import { InnerMsgCode } from '../../Main/Config/InnerMsgCode';
|
|
import li_BaseView from '../../Main/Common/li_BaseView';
|
|
import GameRootUI from '../../Main/Common/GameRootUI';
|
|
import ResManager from '../../Main/Manager/ResManager';
|
|
import HttpUnit from '../../Main/Common/HttpUnit';
|
|
import { SDKManager } from '../../Main/Channel/SDKManager';
|
|
import ScrollViewList from '../../Main/Common/ScrollViewList';
|
|
import SubManager from '../SubManager';
|
|
const { ccclass, property } = _decorator;
|
|
|
|
//聊天界面
|
|
@ccclass('Talk_UI')
|
|
export class Talk_UI extends li_BaseView {
|
|
|
|
private _nodeTab: any = {};
|
|
private _data;
|
|
|
|
private ebTalk: EditBox;
|
|
|
|
//----重写父类接口---------------------------------------
|
|
onLoadCT() {
|
|
this.registerListenner();
|
|
Utils.parseNode(this.node, this._nodeTab)
|
|
this.ebTalk = this._nodeTab.ebTalk.getComponent(EditBox);
|
|
}
|
|
openUIDataCT(data: any): void {
|
|
this._data = data
|
|
}
|
|
|
|
|
|
registerListenner() {
|
|
// Utils.addInnerEL(InnerMsgCode.GM_UI_Close, this, this.resiveGMClose)
|
|
}
|
|
|
|
|
|
start() {
|
|
GButton.BandClick(this._nodeTab.btnBack, this.onBackClick, this);
|
|
GButton.BandClick(this._nodeTab.btnSend, this.onSendClick, this);
|
|
GButton.BandClick(this._nodeTab.btnRecord, ()=>{
|
|
console.log("聊天记录")
|
|
}, this);
|
|
GButton.BandClick(this._nodeTab.btnTishi, ()=>{
|
|
ViewManager.I.openBundlesView("UI/StartUI/Tips_UI")
|
|
}, this);
|
|
GButton.BandClick(this._nodeTab.btnAD, ()=>{
|
|
console.log("观看广告")
|
|
}, this);
|
|
}
|
|
|
|
update(deltaTime: number) {
|
|
|
|
}
|
|
|
|
|
|
|
|
//切换关卡
|
|
changeLevel(idx:number, force:boolean = false) {
|
|
|
|
}
|
|
|
|
|
|
//退出聊天
|
|
onBackClick() {
|
|
this.doClose();
|
|
Utils.sendInnerMsg(InnerMsgCode.UI_Talk_Back, {})
|
|
}
|
|
|
|
//发送消息
|
|
onSendClick() {
|
|
let str = this.ebTalk.string;
|
|
if (str.length == 0) {
|
|
SubManager.ShowPrompt("请先输入内容")
|
|
return
|
|
}
|
|
SubManager.ShowPrompt("发送内容:" + str)
|
|
this.ebTalk.string = ""
|
|
}
|
|
}
|
|
|
|
|