EquipUpdate.ts 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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('EquipUpdate')
  7. export class EquipUpdate extends BaseView {
  8. @property({ type: Label, tooltip: "关闭提示" })
  9. closeTips: Label = null;
  10. @property({ type: Label, tooltip: "标题" })
  11. titieTx: Label = null;
  12. // @property({ type: Label, tooltip: "装备名" })
  13. // titieTx: Label = null;
  14. // @property({ type: Label, tooltip: "装备节点" })
  15. // titieTx: Label = null;
  16. // @property({ type: Label, tooltip: "当前等级" })
  17. // titieTx: Label = null;
  18. // @property({ type: Label, tooltip: "目标等级" })
  19. // titieTx: Label = null;
  20. // @property({ type: Label, tooltip: "当前属性" })
  21. // titieTx: Label = null;
  22. // @property({ type: Label, tooltip: "目标属性" })
  23. // titieTx: Label = null;
  24. // @property({ type: Label, tooltip: "等级箭头" })
  25. // titieTx: Label = null;
  26. // @property({ type: Label, tooltip: "属性箭头" })
  27. // titieTx: Label = null;
  28. // @property({ type: Label, tooltip: "经验值标题" })
  29. // titieTx: Label = null;
  30. // @property({ type: Label, tooltip: "经验值进度" })
  31. // titieTx: Label = null;
  32. // @property({ type: Label, tooltip: "经验值文字" })
  33. // titieTx: Label = null;
  34. // @property({ type: Label, tooltip: "标题" })
  35. // titieTx: Label = null;
  36. // @property({ type: Label, tooltip: "标题" })
  37. // titieTx: Label = null;
  38. protected onLoad() {
  39. super.onLoad();
  40. this.closeTips.string = StringUtil.getLanguageData('点击空白关闭');
  41. this.titieTx.string = StringUtil.getLanguageData('装备升级');
  42. this.closeTips.node.getComponent(UIOpacity).opacity = 0;
  43. }
  44. protected onDestroy() {
  45. }
  46. //UI开打时会调用,如果有初始化代码应该放到此函数
  47. onOpen(data) {
  48. tween(this.closeTips.node.getComponent(UIOpacity))
  49. .to(1, { opacity: 255 })
  50. .to(1.2, { opacity: 10 })
  51. .union()
  52. .repeatForever()
  53. .start()
  54. }
  55. //UI关闭时会调用,该函数在onDestroy前调用
  56. onClose() {
  57. }
  58. //框架管理UI层级时会调用,可根据UI情况修改
  59. onShow() {
  60. super.onShow();
  61. }
  62. //框架管理UI层级时会调用,可根据UI情况修改
  63. onHide() {
  64. super.onHide();
  65. }
  66. //UI事件处理
  67. private onTouchButton(event: Event) {
  68. //Framework.audio.playEffect(AudioID.Click);
  69. let target: any = event.target;
  70. }
  71. onEventList(item, idx) {
  72. item.getComponent(CommonItem).refreshItem();
  73. }
  74. }