userListInfoItem.js 982 B

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