SignInItem.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. cc.Class({
  2. extends: cc.Component,
  3. properties: {
  4. timeLabel: cc.Label,
  5. countRichText: cc.RichText,
  6. itemSprite: cc.Sprite,
  7. isSignedNode: cc.Node,
  8. awardNode: cc.Node,
  9. isSigned: {
  10. get: function() {
  11. if (!this._isSigned) {
  12. this._isSigned = false;
  13. }
  14. return this._isSigned;
  15. },
  16. set: function(value) {
  17. this._isSigned = value;
  18. if (this._isSigned) {
  19. this.isSignedNode.active = true;
  20. this.awardNode.active = false;
  21. } else {
  22. this.isSignedNode.active = false;
  23. this.awardNode.active = true;
  24. }
  25. }
  26. },
  27. },
  28. // LIFE-CYCLE CALLBACKS:
  29. // onLoad () {},
  30. start () {
  31. },
  32. configData(signInfo) {
  33. this.signInfo = signInfo;
  34. this.timeLabel.string = `${signInfo.signId}`;
  35. this.isSigned = signInfo.status == 0 ? false : true;
  36. this.countRichText.string = `<b><color=#934C31>${signInfo.diamond}</color></b>`;
  37. },
  38. // update (dt) {},
  39. });