import { _decorator, Button, Component, Node, RichText } from 'cc'; const { ccclass, property } = _decorator; @ccclass('FeedManager') export class FeedManager extends Component { //取消按钮 @property(Button) public cancelBtn: Button = null; //确认按钮 @property(Button) public confirmBtn: Button = null; //设置文本字体颜色为黑色 @property public textColor: string = '#000000'; public richText: RichText; @property(Node) public foodObj: Node = null; start() { //this.richText.string = ""+this.richText.string+""; //监听按钮事件 this.cancelBtn.node.on('click', this.cancel, this); this.confirmBtn.node.on('click', this.confirm, this); } //取消 public cancel() { this.node.active = false; console.log('取消'); } //确认 public confirm() { console.log('确认'); //隐藏当前界面 this.node.active = false; } update(deltaTime: number) { } }