const NetManage = require('../manages/NetManage'); cc.Class({ extends: cc.Component, properties: { lb_cost: { default: null, type: cc.Label, }, }, init(data) { this.gooddata = data; this.lb_cost.string = data.cost; }, onClose() { this.node.destroy(); }, onOK() { NetManage.buyGood(1, this.gooddata.goods_id, 1, 10001, () => { this.node.destroy(); }); }, });