// Learn TypeScript:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html

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

const {ccclass, property} = cc._decorator;

@ccclass
export default class ChaDianScript extends cc.Component {


    // LIFE-CYCLE CALLBACKS:

    // onLoad () {}

    start () {

    }

    setChadianIconData(data_){
        this.refreshView(data_)
    }   

    refreshView(data_){
         let labName = this.node.getChildByName('labName')
         labName.getComponent(cc.Label).string = data_.name


         let icon = this.node.getChildByName('icon')
         Common5.getSpriteFrameFromBundle(data_.bandleName, data_.url, icon.getComponent(cc.Sprite));
    }

    
}