marineparkclient/assets/script/ui/UIShowFashingLayer.ts
2023-08-15 11:09:12 +08:00

84 lines
2.2 KiB
TypeScript

// Learn TypeScript:
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
import { PanelType } from "../../common/ui/config/SysDefine";
import UIBaseEv from "../../common/ui/uiEv/UIBaseEv";
import DataManager from "../Model/data/DataManager";
import { fishCathOnline } from "../Model/ProxyClientDataMgr";
const {ccclass, property} = cc._decorator;
@ccclass
export default class UIShowFashingLayer extends UIBaseEv {
panelType: PanelType = PanelType.PopUp;
@property(cc.Label)
nameLabel: cc.Label = null;
@property(cc.Sprite)
fishSpr: cc.Sprite = null;
@property(cc.Button)
cancleBtn: cc.Button = null;
fishData:fishCathOnline = null
// LIFE-CYCLE CALLBACKS:
twnAction = null;
// onLoad () {}
onClickEvent(event,customEventData)
{
switch (+customEventData) {
case 0:
this.closePanel();
break;
default:
break;
}
}
onShow(catchedData:fishCathOnline)
{
// let callFunc:Function = function (event?) {
// let customEventData = ""+0;
// this.onClickEvent(event,customEventData);
// }
// this.node.on(cc.Node.EventType.TOUCH_END,callFunc,this);
this.fishData = catchedData;
this.initUI();
}
initUI()
{
let objFish = DataManager.ins().getObjCfgById(this.fishData.id);
this.nameLabel.string = objFish._name;
// this.twnAction = cc.tween(this.node)
// .delay(10)
// .call(this.closePanel)
// .start
}
closePanel()
{
// let callFunc:Function = function (event?) {
// let customEventData = ""+0;
// this.onClickEvent(event,customEventData);
// }
// this.node.off(cc.Node.EventType.TOUCH_END,callFunc,this);
//this.twnAction.stop();
this.closeUIPanel();
}
start () {
}
// update (dt) {}
}