CashNormal.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. const { ccclass, property } = cc._decorator;
  2. /**
  3. * 提现记录
  4. * @author 薛鸿潇
  5. */
  6. @ccclass
  7. export default class CashNormal extends cc.Component {
  8. @property({ displayName: '滚动视图', type: cc.ScrollView })
  9. private scroll_view: cc.ScrollView = null!;
  10. @property({ displayName: 'lbl累计提现', type: cc.Label })
  11. private lbl_rmb_total: cc.Label = null;
  12. @property({ displayName: 'lbl暂无提现', type: cc.Label })
  13. private lbl_none: cc.Label = null;
  14. // onLoad () {}
  15. start() {
  16. this.initTotal();
  17. this.initScrollView();
  18. this.initNoneItem();
  19. }
  20. // update (dt) {}
  21. /**
  22. * 初始化滚动视图
  23. */
  24. private initScrollView() {
  25. this.scroll_view.node.emit('srollview-init', gData.cashNormal.list_data);
  26. }
  27. /**
  28. * 初始化累计提现
  29. */
  30. private initTotal() {
  31. this.lbl_rmb_total.string = '¥' + (gData.cashNormal.receip_total_rmb / 100).toFixed(2) + '元';
  32. }
  33. /**
  34. * 初始化无条目时的提示
  35. */
  36. private initNoneItem() {
  37. const count = gData.cashNormal.list_data.length;
  38. if (count) {
  39. this.lbl_none.node.active = false;
  40. } else {
  41. this.lbl_none.node.active = true;
  42. }
  43. }
  44. }