Pay.ts 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. import { _decorator, Component, EditBox, game, instantiate, Label, Node, Prefab } from 'cc';
  2. import { UtilsPanel } from '../../scene/script/UtilsPanel';
  3. import { Generate } from '../../scene/script/components/Generate';
  4. const { ccclass, property } = _decorator;
  5. @ccclass('Pay')
  6. export class Pay extends Component {
  7. public static bundle_name = "pay";
  8. private node_descid: Node = null;
  9. private node_buy: Node = null;
  10. private gene_items: Generate = null;
  11. private lb_money: Label = null;
  12. private edit_id: EditBox = null;
  13. protected onLoad(){
  14. UtilsPanel.getAllNeedCom(this, this.node, false);
  15. UtilsPanel.addBtnEvent(this.node_buy, this.onBuy, this);
  16. //@ts-ignore
  17. game.on("select_item", this.onSelect, this);
  18. }
  19. protected start(): void {
  20. this.gene_items.initData(new Array(6));
  21. }
  22. private onEditChange(){
  23. this.node_descid.active = this.edit_id.string.length == 0;
  24. }
  25. private onSelect(index:number){
  26. this.lb_money.string = index * 1000 + "";
  27. }
  28. private onBuy(){
  29. }
  30. }