userListInfoItem.js 798 B

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