cc.Class({ extends: cc.Component, properties: { listItemAddress: { default: null, type: cc.Label, serializable: true, }, amount: { default: null, type: cc.Label, serializable: true, }, otherUserId: { default: '', visible: false } }, setInfo(context) { let { address, amount, otherUserId } = context; this.listItemAddress.string = address; this.amount.string = amount; this.otherUserId = otherUserId; }, /** * 进入其他用户的农场偷菜 */ onEnterOtherFarm() { if (this.otherUserId.length <= 0) { console.log('没有用户', this.otherUserId); } GlobalD.GameData.getOtherUserLandList(this.otherUserId); } });