#ifndef DIALOG_H
#define DIALOG_H

#include <QDialog>
#include <QJsonObject>
#include <QJsonArray>
#include <QJsonDocument>
#include "lc_my_line_edit.h"
#include "mysock.h"
#include <QMessageBox>
#include <QDateTime>
//#include "folatwidget.h"
#include "systray.h"
#include <QTimer>


class QFmClient;

namespace Ui {
class Dialog;
}

class Dialog : public QDialog
{
    Q_OBJECT

public:
    explicit Dialog(QWidget *parent = 0);
    ~Dialog();

    void initShow();
    void folatShow();
    //sys
    void slopenMain();
    void slExit();

protected:
    void keyPressEvent(QKeyEvent *);
public slots:
    void btn_num_click();
    void on_pushButton_2_clicked();
    void on_pushButton_3_clicked();
    void on_noline_clicked();
    void on_nook_clicked();
    void on_nodele_clicked();
    void on_ok_clicked();
    void on_ok2_clicked();
    void on_successjson_come(const mySock::RequstType type, const QJsonObject &json);

    void onShow();
private slots:
    void on_pushButton_clicked();
    //void floatraise();

    void on_pushButton_18_clicked();

    void on_pushButton_40_clicked();

private:
    void amountTextChange(const QString & text);

    void getRefundJson(QJsonObject &json, const QString &code, const int &amount);

    void getPayJson(QJsonObject &json, const QString &code, const int &amount);
    void btn_ok_click();
    void btn_cannel_click();
    void btn_clear_click();
    void btn_backspace_click();

    void txtFcous();

    void beginPay();

    Ui::Dialog *ui;
    LcMyLineEdit * curTxt;

    //FolatWidget *folatWidget;
    //SysTray tray;

    //QTimer *m_timer;
    //bool israise;
};

#endif // DIALOG_H
