RedBagCode.ts 1016 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. const { ccclass, property } = cc._decorator;
  2. /**
  3. * 红包码列表
  4. * @author 薛鸿潇
  5. */
  6. @ccclass
  7. export default class RedBagCode extends cc.Component {
  8. @property({ type: cc.ScrollView, displayName: '滚动视图' })
  9. private scroll_view: cc.ScrollView = null!;
  10. @property({ displayName: 'lbl暂无提现', type: cc.Label })
  11. private lbl_none: cc.Label = null;
  12. // onLoad () {}
  13. start() {
  14. this.initList();
  15. }
  16. /**
  17. * 初始化滚动列表
  18. */
  19. private initList() {
  20. let list_data = gData.cashNormal.getListDataHavCode();
  21. this.scroll_view.node.emit('srollview-init', list_data)
  22. this.initNoneItem(list_data);
  23. }
  24. /**
  25. * 初始化无条目时的提示
  26. */
  27. private initNoneItem(list_data) {
  28. const count = list_data.length;
  29. if (count) {
  30. this.lbl_none.node.active = false;
  31. } else {
  32. this.lbl_none.node.active = true;
  33. }
  34. }
  35. }