userListInfoItem.js 993 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. otherUserItem: {
  15. default: null,
  16. serializable: false,
  17. },
  18. },
  19. setInfo(context) {
  20. let { item } = context;
  21. this.otherUserItem = item;
  22. this.listItemAddress.string = item.address;
  23. this.amount.string = 0;
  24. },
  25. /**
  26. * 进入其他用户的农场偷菜
  27. */
  28. onEnterOtherFarm() {
  29. GlobalD.GameData.OtherUserInfo = this.otherUserItem;
  30. if (GlobalD.GameData.OtherUserInfo.length <= 0) {
  31. console.log('没有用户', GlobalD.GameData.OtherUserInfo);
  32. }
  33. GlobalD.GameData.getOtherUserLandList(GlobalD.GameData.OtherUserInfo.userId);
  34. }
  35. });