HeroAttrShow.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import { _decorator, Label, Node } from 'cc';
  2. import { BaseView } from '../../../framework/layer/BaseView';
  3. import List from '../../../framework/list/List';
  4. import { HeroAttrShowItem } from './HeroAttrShowItem';
  5. import { Framework } from '../../../framework/Framework';
  6. const { ccclass, property } = _decorator;
  7. @ccclass('HeroAttrShow')
  8. export class HeroAttrShow extends BaseView {
  9. @property({ type: Label, tooltip: "关闭提示" })
  10. closeTips: Label = null;
  11. @property({ type: Label, tooltip: "标题" })
  12. titleTx: Label = null;
  13. @property({ type: List, tooltip: "图标节点" })
  14. attrList: List = null;
  15. private _data: {};
  16. protected onLoad() {
  17. super.onLoad();
  18. }
  19. protected onDestroy() {
  20. }
  21. //UI开打时会调用,如果有初始化代码应该放到此函数
  22. onOpen() {
  23. }
  24. //UI关闭时会调用,该函数在onDestroy前调用
  25. onClose() {
  26. }
  27. //框架管理UI层级时会调用,可根据UI情况修改
  28. onShow() {
  29. super.onShow();
  30. }
  31. //框架管理UI层级时会调用,可根据UI情况修改
  32. onHide() {
  33. super.onHide();
  34. }
  35. //UI事件处理
  36. private onTouchButton(event: Event) {
  37. //Framework.audio.playEffect(AudioID.Click);
  38. let target: any = event.target;
  39. if (target.name == 'mask') {
  40. Framework.layer.close(this);
  41. }
  42. }
  43. onEventList(item, idx) {
  44. item.getComponent(HeroAttrShowItem).refreshItem(this._data[idx]);
  45. }
  46. }