EquipStrong.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import { _decorator, Label, Node, tween, UIOpacity } from 'cc';
  2. import { BaseView } from '../../../framework/layer/BaseView';
  3. import { StringUtil } from '../../../framework/util/StringUtil';
  4. import { CommonItem } from '../common/CommonItem';
  5. const { ccclass, property } = _decorator;
  6. @ccclass('EquipStrong')
  7. export class EquipStrong extends BaseView {
  8. @property({ type: Label, tooltip: "关闭提示" })
  9. closeTips: Label = null;
  10. @property({ type: Label, tooltip: "标题" })
  11. titieTx: Label = null;
  12. protected onLoad() {
  13. super.onLoad();
  14. this.closeTips.string = StringUtil.getLanguageData('点击空白关闭');
  15. this.titieTx.string = StringUtil.getLanguageData('装备选择');
  16. this.closeTips.node.getComponent(UIOpacity).opacity = 0;
  17. }
  18. protected onDestroy() {
  19. }
  20. //UI开打时会调用,如果有初始化代码应该放到此函数
  21. onOpen() {
  22. tween(this.closeTips.node.getComponent(UIOpacity))
  23. .to(1, { opacity: 255 })
  24. .to(1.2, { opacity: 10 })
  25. .union()
  26. .repeatForever()
  27. .start()
  28. }
  29. //UI关闭时会调用,该函数在onDestroy前调用
  30. onClose() {
  31. }
  32. //框架管理UI层级时会调用,可根据UI情况修改
  33. onShow() {
  34. super.onShow();
  35. }
  36. //框架管理UI层级时会调用,可根据UI情况修改
  37. onHide() {
  38. super.onHide();
  39. }
  40. //UI事件处理
  41. private onTouchButton(event: Event) {
  42. //Framework.audio.playEffect(AudioID.Click);
  43. let target: any = event.target;
  44. }
  45. onEventList(item, idx) {
  46. item.getComponent(CommonItem).refreshItem();
  47. }
  48. }