import { Item } from "../../../../ItemList/Item" ; import { Util } from "../../../../Common/Utils/Util" ; import { ResourceData } from "./AwardsData" ; const { ccclass , property } = cc . _decorator ; @ ccclass export default class ResourceItem extends Item < ResourceData > { private data_ : ResourceData ; @ property ( cc . Label ) public amount : cc . Label ; @ property ( cc . Sprite ) public bg : cc . Sprite ; @ property ( cc . Sprite ) public Resource : cc . Sprite ; getData ( ) { return this . data_ ; } showByData ( ) { window . appContext . Pool . setSpriteFrameByUrl ( this . data_ . resource , this . Resource ) ; window . appContext . Pool . setSpriteFrameByUrl ( "icon_bg_" + this . data_ . quality , this . bg ) ; this . amount . string = this . data_ . amount . toString ( ) ; } bindData ( currentIndex , data ) { if ( data == null ) { this . reset ( currentIndex ) ; return ; } this . data_ = data ; this . showByData ( ) ; } reset ( currentIndex ) { } select ( selected ) { if ( ! selected ) { return ; } } getClickButton ( ) { return this . getComponent ( cc . Button ) ; } }