import Common5 from "../../../Platform/th/Common5";
import GameBase from "../../SCommon/GameBase";



const {ccclass, property} = cc._decorator;

@ccclass
export default class TouZiXieYiShu extends GameBase {

    @property(cc.Label)
    moneyStr:cc.Label = null

    @property(cc.Node)
    gaiZhang:cc.Node = null

    @property(cc.Sprite)
    heTong:cc.Sprite = null

    @property([cc.SpriteFrame])
    spFrameTab:cc.SpriteFrame[] = []

    
    
    callFunc = null

    onDestroy(){
        super.onDestroy()
    }

    onLoad () {
        super.onLoad()
    }

    initView(index,money,callFunc){
        this.scheduleOnce(()=>{
            this.gaiZhang.active = true
            this.gaiZhang.getComponent(sp.Skeleton).setAnimation(0,'盖章',false)
        },1)
        this.heTong.spriteFrame = this.spFrameTab[index]
        this.moneyStr.string = `${Common5.getNumberChangeHanzi(money,'1')}`
        this.callFunc = callFunc
    }
    onBtnSure(){
        this.node.removeFromParent()
        this.callFunc && this.callFunc()
    }
    
}