Sign.ts 996 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /**
  2. * 签到界面
  3. * @author 薛鸿潇
  4. */
  5. const { ccclass, property } = cc._decorator;
  6. @ccclass
  7. export default class Sign extends cc.Component {
  8. @property({ type: cc.ScrollView, displayName: '滚动视图' })
  9. private scroll_view: cc.ScrollView = null!;
  10. onLoad() {
  11. }
  12. start() {
  13. g.sign.initListData();
  14. // 数据刷新测试
  15. // this.scheduleOnce(() => {
  16. // g.sign.c_sign[0].login_day = 666
  17. // g.sign.initListData();
  18. // }, 5)
  19. }
  20. /**
  21. * 初始化滚动视图
  22. */
  23. private initScollView() {
  24. let list_data = g.sign.list_data;
  25. this.scroll_view.node.emit('srollview-init', list_data)
  26. cc.log(list_data)
  27. }
  28. /**
  29. * 点击领取按钮
  30. */
  31. private clickReceiveReward() {
  32. }
  33. update(dt) {
  34. if (g.sign.init_data) {
  35. g.sign.init_data = false;
  36. this.initScollView();
  37. }
  38. }
  39. }