
const { ccclass, property } = cc._decorator;

/**
 * 到账通知样式
 * @author 薛鸿潇
 */
@ccclass
export default class ReceiptNotice extends cc.Component {

    @property({ displayName: 'lbl收款金额', type: cc.Label })
    private lbl_receipt_rmb: cc.Label = null!;
    @property({ displayName: 'lbl累计提现', type: cc.Label })
    private lbl_rmb_total: cc.Label = null!;
    @property({ displayName: 'lbl用户名', type: cc.Label })
    private lbl_user_name: cc.Label = null!;


    // onLoad() {

    // }

    start() {
        mk.audio.playEffect("receiptNotice");
    }

    update(dt) {
        if (gData.receiptNotice.init_style) {
            gData.receiptNotice.init_style = false;
            this.initStyle();
        }
    }

    /**
     * 初始化样式
     */
    private initStyle() {
        this.lbl_receipt_rmb.string = '￥' + Math.floor(gData.receiptNotice.receip_rmb / 100) + '元';
        this.lbl_rmb_total.string = '￥' + Math.floor(gData.cashNormal.receip_total_rmb / 100) + '元';
        this.lbl_user_name.string = gData.wechatData.nickName || '';
    }
}
