
cc.Class({
    extends: cc.Component,

    properties: {

        listItemName: {
            default: null,
            type: cc.Label,
            serializable: true,
        },

        cntListItemName: {
            default: null,
            type: cc.Label,
            serializable: true,
        },

        listItemNameNode: {
            default: null,
            type: cc.Node,
            serializable: true,
        },

        cntListItemNameNode: {
            default: null,
            type: cc.Node,
            serializable: true,
        },
        listItemDate: {
            default: null,
            type: cc.Label,
            serializable: true,
        },
        remainderValue: {
            default: null,
            type: cc.Label,
            serializable: true,
        },
        amount: {
            default: null,
            type: cc.Label,
            serializable: true,
        },

        remainTip: {
            default: null,
            type: cc.Label,
            serializable: true,
        },
    },

    setInfo(context) {
        let { listItemName, listItemDate, remainder, amount } = context;
        this.listItemName.string = listItemName;
        this.listItemDate.string = listItemDate;
        this.remainderValue.string = remainder;
        this.amount.string = amount;
        this.listItemNameNode.active = true;
        this.cntListItemNameNode.active = false;
        this.remainTip.string = "剩余:"
    },

    setCntInfo(context) {
        let { listItemName, listItemDate, remainder, amount } = context;
        this.cntListItemName.string = listItemName;
        this.listItemDate.string = listItemDate;
        this.remainderValue.string = remainder;
        this.amount.string = amount;
        this.listItemNameNode.active = false;
        this.cntListItemNameNode.active = true;
        this.remainTip.string = "变动额:"
    },
});
