userListInfoItem.js 878 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. cc.Class({
  2. extends: cc.Component,
  3. properties: {
  4. listItemAddress: {
  5. default: null,
  6. type: cc.Label,
  7. serializable: true,
  8. },
  9. amount: {
  10. default: null,
  11. type: cc.Label,
  12. serializable: true,
  13. },
  14. otherUserId: {
  15. default: '',
  16. visible: false
  17. }
  18. },
  19. setInfo(context) {
  20. let { address, amount, otherUserId } = context;
  21. this.listItemAddress.string = address;
  22. this.amount.string = amount;
  23. this.otherUserId = otherUserId;
  24. },
  25. /**
  26. * 进入其他用户的农场偷菜
  27. */
  28. onEnterOtherFarm() {
  29. if (this.otherUserId.length <= 0) {
  30. console.log('没有用户', this.otherUserId);
  31. }
  32. GlobalD.GameData.getOtherUserLandList(this.otherUserId);
  33. }
  34. });