import { _decorator, Component, Node } from 'cc';
import { JNGLayerBase } from '../../../components/JNComponent';
import { TbGEntity } from '../../../config/data/schema';
import JNScrollView from '../../../../../extensions/ngame/assets/ngame/util/components/scrollview/JNScrollView';
const { ccclass, property } = _decorator;

@ccclass('RewardClaimView')
export class RewardClaimView extends JNGLayerBase {

    //奖励页面
    @property(JNScrollView)
    views:JNScrollView;

    data:TbGEntity.TReward[] = [];

    onJNLoad(data?: TbGEntity.TReward[]): void {
        super.onJNLoad(data);
        this.data = data;
    }

    onJNLoadAnimEnd(): void {
        this.onUpdateView();
    }

    onUpdateView(){

        //逐个出现
        this.data.forEach((item,index) => {
            this.scheduleOnce(() => {
                this.views.addData(item);
            },.1 * index);
        })

    }

}


