import { _decorator, Component, EditBox, game, instantiate, Label, Node, Prefab } from 'cc'; import { UtilsPanel } from '../../scene/script/UtilsPanel'; import { Generate } from '../../scene/script/components/Generate'; import { nav_info } from '../../scene/script/NavInfo'; const { ccclass, property } = _decorator; const Urls = [ "", "" ] const Urls_Test = [ "http://139.224.253.42:8089/livepay/getProducts?H5Extra=666888", "http://139.224.253.42:8089/livepay/payOrder" ]; @ccclass('Pay') export class Pay extends Component { private node_descid: Node = null; private node_buy: Node = null; private gene_items: Generate = null; private lb_money: Label = null; private edit_id: EditBox = null; private urls = null; private select_index = 0; protected onLoad(){ UtilsPanel.getAllNeedCom(this, this.node, false); UtilsPanel.addBtnEvent(this.node_buy, this.onBuy, this); // @ts-ignore game.on("select_item", this.onSelect, this); this.urls = nav_info.is_test ? Urls_Test : Urls; } protected start(): void { this.gene_items.initData(new Array(6)); } private onEditChange(){ this.node_descid.active = this.edit_id.string.length == 0; } private onSelect(index:number){ this.lb_money.string = index * 1000 + ""; } private onBuy(){ } }