| 123456789101112131415161718192021222324252627282930 |
- import { _decorator, Component, game, Label, Node, Sprite } from 'cc';
- import { UtilsPanel } from '../../scene/script/UtilsPanel';
- import { ViewItemPro } from '../../scene/script/components/ViewItemPro';
- import { Pay } from './Pay';
- const { ccclass } = _decorator;
- @ccclass('ItemPay')
- export class ItemPay extends ViewItemPro {
- private sp_icon: Sprite = null;
- private lb_count: Label = null;
- private data = null;
- protected onLoad(){
- UtilsPanel.getAllNeedCom(this, this.node, false);
- UtilsPanel.addBtnEvent(this.node, this.onClick, this);
- }
- public init(data: any, index?: number, p?: any): void {
- if(index > 5)index = 5;
- this.data = index;
- this.lb_count.string = "" + index * 1000;
- UtilsPanel.setItemIcon(Pay.bundle_name, "texture/2"+index+"/spriteFrame", this.sp_icon);
- }
- public onClick(){
- game.emit("select_item", this.data);
- }
- }
|