pubgv3/assets/scripts/tips/PurchaseTip.ts
guoqing.zhu 067c712f62 udpate
2022-06-14 13:51:53 +08:00

29 lines
561 B
TypeScript

import { UIBase } from '../UI/UIBase';
const NetManage = require('../../manages/NetManage');
const { ccclass, property } = cc._decorator;
@ccclass
export class PurchaseTip extends UIBase {
public static prefabPath: string = 'prefabs/tips/pb_purchase';
@property(cc.Label) lb_cost: cc.Label = null;
private gooddata: any;
init(data: any) {
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();
});
}
}