import { Item } from "../../../../ItemList/Item" ; import { Util } from "../../../../Common/Utils/Util" ; import { TaskAwardData } from "./TaskAwardData" ; const { ccclass , property } = cc . _decorator ; @ ccclass export default class TaskAwardItem extends Item < TaskAwardData > { private _data : TaskAwardData ; @ property ( cc . Sprite ) public icon : cc . Sprite ; @ property ( cc . Sprite ) public icon_bg : cc . Sprite ; @ property ( cc . Sprite ) public icon_phase : cc . Sprite ; @ property ( cc . Label ) public amount : cc . Label ; getData ( ) { return this . _data ; } showByData ( char = "/" ) { this . amount . string = this . _data . amount . toString ( ) ; window . appContext . Pool . setSpriteFrameByUrl ( this . _data . item . icon , this . icon ) ; window . appContext . Pool . setSpriteFrameByUrl ( this . _data . item . icon_bg , this . icon_bg ) ; window . appContext . Pool . setSpriteFrameByUrl ( this . _data . item . icon_phase , this . icon_phase ) ; } 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 ) ; } }