29 lines
561 B
TypeScript
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();
|
|
});
|
|
}
|
|
}
|