Commit 26425661 by NitefullWind

1. 认证和支付界面添加虚拟键盘。

parent 5ed20300
...@@ -14,5 +14,6 @@ ...@@ -14,5 +14,6 @@
<file>img/tip_error.png</file> <file>img/tip_error.png</file>
<file>img/tip_ok.png</file> <file>img/tip_ok.png</file>
<file>img/tip_warning.png</file> <file>img/tip_warning.png</file>
<file>img/num_del.png</file>
</qresource> </qresource>
</RCC> </RCC>
...@@ -117,7 +117,7 @@ bool FMTask::sendToServer(bool isShowMsg) ...@@ -117,7 +117,7 @@ bool FMTask::sendToServer(bool isShowMsg)
QByteArray data = json.toJson(QJsonDocument::Compact); QByteArray data = json.toJson(QJsonDocument::Compact);
#ifdef FMTEST #ifdef FMTEST
url = "http://115.159.124.30:8732/pos/member/" + ReqUrl.at(FM_Type()); url = "http://127.0.0.1:5000/vip/" + ReqUrl.at(FM_Type());
#else #else
url = FMPVipSettings::instance()->getServerUrl() + "/" + ReqUrl.at(FM_Type()); url = FMPVipSettings::instance()->getServerUrl() + "/" + ReqUrl.at(FM_Type());
#endif #endif
...@@ -276,9 +276,10 @@ QString FMTask::Sign(const QJsonObject &signJsonObj) ...@@ -276,9 +276,10 @@ QString FMTask::Sign(const QJsonObject &signJsonObj)
bool FMTask::checkReqJson() bool FMTask::checkReqJson()
{ {
bool isOk = false; bool isOk = false;
QFile jsonFile("FMCMDKeys.json"); QString filePath = qApp->applicationDirPath()+"/FMCMDKeys.json";
QFile jsonFile(filePath);
if(!jsonFile.open(QFile::ReadOnly)) { if(!jsonFile.open(QFile::ReadOnly)) {
setError(FM_API_BADJSON, QString::fromLocal8Bit("读取FMCMDKeys.json失败(%1)").arg(jsonFile.errorString())); setError(FM_API_BADJSON, QString::fromLocal8Bit("读取%1失败(%2).").arg(filePath).arg(jsonFile.errorString()));
} else { } else {
QByteArray jsonArray = jsonFile.readAll(); QByteArray jsonArray = jsonFile.readAll();
QJsonParseError error; QJsonParseError error;
......
#include "fmnumpad.h" #include "fmnumpad.h"
#include "ui_fmnumpad.h" #include "ui_fmnumpad.h"
#include <QDebug>
FMNumPad::FMNumPad(QDialog *parent) : FMNumPad::FMNumPad(QDialog *parent) :
FMVipWnd(parent), FMVipWnd(parent),
...@@ -20,18 +21,22 @@ bool FMNumPad::initWnd(Session *session) ...@@ -20,18 +21,22 @@ bool FMNumPad::initWnd(Session *session)
{ {
Q_UNUSED(session) Q_UNUSED(session)
ui->setupUi(this); ui->setupUi(this);
connect(ui->no0, &QPushButton::clicked, this, &FMNumPad::on_digit_clicked);
connect(ui->no1, &QPushButton::clicked, this, &FMNumPad::on_digit_clicked); setWindowFlags(windowFlags() | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
connect(ui->no2, &QPushButton::clicked, this, &FMNumPad::on_digit_clicked);
connect(ui->no3, &QPushButton::clicked, this, &FMNumPad::on_digit_clicked); _btnGroup.addButton(ui->no0);
connect(ui->no4, &QPushButton::clicked, this, &FMNumPad::on_digit_clicked); _btnGroup.addButton(ui->no1);
connect(ui->no5, &QPushButton::clicked, this, &FMNumPad::on_digit_clicked); _btnGroup.addButton(ui->no2);
connect(ui->no6, &QPushButton::clicked, this, &FMNumPad::on_digit_clicked); _btnGroup.addButton(ui->no3);
connect(ui->no7, &QPushButton::clicked, this, &FMNumPad::on_digit_clicked); _btnGroup.addButton(ui->no4);
connect(ui->no8, &QPushButton::clicked, this, &FMNumPad::on_digit_clicked); _btnGroup.addButton(ui->no5);
connect(ui->no9, &QPushButton::clicked, this, &FMNumPad::on_digit_clicked); _btnGroup.addButton(ui->no6);
connect(ui->dot, &QPushButton::clicked, this, &FMNumPad::on_digit_clicked); _btnGroup.addButton(ui->no7);
setFocusPolicy(Qt::NoFocus); _btnGroup.addButton(ui->no8);
_btnGroup.addButton(ui->no9);
_btnGroup.addButton(ui->dot);
connect(&_btnGroup, static_cast<void(QButtonGroup::*)(QAbstractButton *)>(&QButtonGroup::buttonClicked), this, &FMNumPad::onDigitClicked);
return true; return true;
} }
...@@ -40,12 +45,20 @@ FMNumPad::~FMNumPad() ...@@ -40,12 +45,20 @@ FMNumPad::~FMNumPad()
delete ui; delete ui;
} }
void FMNumPad::on_digit_clicked() void FMNumPad::setLineEdit(QLineEdit *lineEidt)
{ {
QString num_str = qobject_cast<QPushButton*>(sender())->text(); Q_ASSERT(lineEidt!=nullptr);
this->_lineEdit = lineEidt;
}
void FMNumPad::onDigitClicked(QAbstractButton *button)
{
QString num_str = button->text();
emit digit_click(num_str); emit digit_click(num_str);
if(_lineEdit != nullptr) { if(_lineEdit != nullptr) {
_lineEdit->insert(num_str); _lineEdit->insert(num_str);
_lineEdit->setFocus();
} }
} }
...@@ -54,6 +67,7 @@ void FMNumPad::on_backspace_btn_clicked() ...@@ -54,6 +67,7 @@ void FMNumPad::on_backspace_btn_clicked()
emit digit_delete(); emit digit_delete();
if(_lineEdit != nullptr) { if(_lineEdit != nullptr) {
_lineEdit->backspace(); _lineEdit->backspace();
_lineEdit->setFocus();
} }
} }
...@@ -62,10 +76,14 @@ void FMNumPad::on_clear_btn_clicked() ...@@ -62,10 +76,14 @@ void FMNumPad::on_clear_btn_clicked()
emit digit_clear(); emit digit_clear();
if(_lineEdit != nullptr) { if(_lineEdit != nullptr) {
_lineEdit->clear(); _lineEdit->clear();
_lineEdit->setFocus();
} }
} }
void FMNumPad::on_confirm_btn_clicked() void FMNumPad::on_confirm_btn_clicked()
{ {
emit digit_confirm(); emit digit_confirm();
if(_lineEdit != nullptr) {
_lineEdit->setFocus();
}
} }
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include "fmvipwnd.h" #include "fmvipwnd.h"
#include <QLineEdit> #include <QLineEdit>
#include <QButtonGroup>
namespace Ui { namespace Ui {
class FMNumPad; class FMNumPad;
...@@ -18,6 +19,8 @@ public: ...@@ -18,6 +19,8 @@ public:
~FMNumPad(); ~FMNumPad();
void setLineEdit(QLineEdit *lineEidt);
private: private:
bool initWnd(Session *session); bool initWnd(Session *session);
...@@ -28,7 +31,7 @@ signals: ...@@ -28,7 +31,7 @@ signals:
void digit_confirm(); void digit_confirm();
private slots: private slots:
void on_digit_clicked(); void onDigitClicked(QAbstractButton *button);
void on_backspace_btn_clicked(); void on_backspace_btn_clicked();
...@@ -40,6 +43,7 @@ private: ...@@ -40,6 +43,7 @@ private:
Ui::FMNumPad *ui; Ui::FMNumPad *ui;
QLineEdit *_lineEdit; QLineEdit *_lineEdit;
QButtonGroup _btnGroup;
}; };
#endif // FMNUMPAD_H #endif // FMNUMPAD_H
...@@ -4,17 +4,27 @@ ...@@ -4,17 +4,27 @@
#include <QFile> #include <QFile>
#include <QMutex> #include <QMutex>
#include "fmloading.h" #include "fmloading.h"
#include "fmnumpad.h"
FMVipLogin::FMVipLogin(QDialog *parent) : FMVipLogin::FMVipLogin(QDialog *parent) :
FMVipWnd(parent), FMVipWnd(parent),
ui(new Ui::FMVipLogin) ui(new Ui::FMVipLogin)
{ {
ui->setupUi(this); ui->setupUi(this);
_numpad = new FMNumPad(ui->login_edit, this);
connect(this, &FMVipLogin::rejected, [=](){
_numpad->close();
});
connect(this, &FMVipLogin::accepted, [=](){
_numpad->close();
});
} }
FMVipLogin::~FMVipLogin() FMVipLogin::~FMVipLogin()
{ {
delete ui; delete ui;
delete _numpad;
} }
bool FMVipLogin::initWnd(Session *session) bool FMVipLogin::initWnd(Session *session)
...@@ -68,3 +78,12 @@ void FMVipLogin::resetWnd() ...@@ -68,3 +78,12 @@ void FMVipLogin::resetWnd()
ui->login_edit->clear(); ui->login_edit->clear();
ui->login_edit->setFocus(); ui->login_edit->setFocus();
} }
void FMVipLogin::on_login_key_clicked()
{
if(_numpad->isVisible()) {
_numpad->hide();
} else {
_numpad->exec();
}
}
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "fmvipwnd.h" #include "fmvipwnd.h"
class QNetworkReply; class QNetworkReply;
class FMNumPad;
namespace Ui { namespace Ui {
class FMVipLogin; class FMVipLogin;
...@@ -26,8 +27,13 @@ signals: ...@@ -26,8 +27,13 @@ signals:
void login(); void login();
public slots: public slots:
void on_login_btn_clicked(); void on_login_btn_clicked();
private slots:
void on_login_key_clicked();
private: private:
Ui::FMVipLogin *ui; Ui::FMVipLogin *ui;
FMNumPad *_numpad;
}; };
#endif // FMVIPLOGIN_H #endif // FMVIPLOGIN_H
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include "ui_fmviporder.h" #include "ui_fmviporder.h"
#include "itemdelegate.h" #include "itemdelegate.h"
#include "couponmodel.h" #include "couponmodel.h"
#include "fmnumpad.h"
#include <QScrollBar> #include <QScrollBar>
#include <QItemSelectionModel> #include <QItemSelectionModel>
...@@ -11,12 +12,22 @@ FMVipOrder::FMVipOrder(QDialog *parent) : ...@@ -11,12 +12,22 @@ FMVipOrder::FMVipOrder(QDialog *parent) :
ui(new Ui::FMVipOrder) ui(new Ui::FMVipOrder)
{ {
ui->setupUi(this); ui->setupUi(this);
_numpad = new FMNumPad(ui->pay_edit, this);
connect(this, &FMVipOrder::rejected, [=](){
_numpad->close();
});
connect(this, &FMVipOrder::accepted, [=](){
_numpad->close();
});
} }
FMVipOrder::~FMVipOrder() FMVipOrder::~FMVipOrder()
{ {
del_p(orderInfo); del_p(orderInfo);
delete ui; delete ui;
delete _numpad;
} }
bool FMVipOrder::initWnd(Session *session) bool FMVipOrder::initWnd(Session *session)
...@@ -217,3 +228,12 @@ void FMVipOrder::on_score_edit_textChanged(const QString &scoreStr) ...@@ -217,3 +228,12 @@ void FMVipOrder::on_score_edit_textChanged(const QString &scoreStr)
oldPayText = DOUBLE_STR(orderInfo->getMaxWillPay()); oldPayText = DOUBLE_STR(orderInfo->getMaxWillPay());
setWillPayText(); setWillPayText();
} }
void FMVipOrder::on_pay_key_clicked()
{
if(_numpad->isVisible()) {
_numpad->hide();
} else {
_numpad->exec();
}
}
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
class CouponModel; class CouponModel;
class QItemSelectionModel; class QItemSelectionModel;
class FMNumPad;
#define MIN(a,b) ((a<b) ? a : b) #define MIN(a,b) ((a<b) ? a : b)
#define MAX(a,b) ((a<b) ? b : a) #define MAX(a,b) ((a<b) ? b : a)
...@@ -46,6 +47,8 @@ private slots: ...@@ -46,6 +47,8 @@ private slots:
void on_score_edit_textChanged(const QString &scoreStr); void on_score_edit_textChanged(const QString &scoreStr);
void on_pay_key_clicked();
private: private:
class OrderInfo class OrderInfo
{ {
...@@ -191,6 +194,8 @@ private: ...@@ -191,6 +194,8 @@ private:
QItemSelectionModel *selectionModel; QItemSelectionModel *selectionModel;
CouponModel *couponModel; CouponModel *couponModel;
QModelIndex selectedIndex; QModelIndex selectedIndex;
FMNumPad *_numpad;
}; };
#endif // FMVIPORDER_H #endif // FMVIPORDER_H
...@@ -13,7 +13,7 @@ FMVipWnd::FMVipWnd(QDialog *parent) : ...@@ -13,7 +13,7 @@ FMVipWnd::FMVipWnd(QDialog *parent) :
QDialog(parent), QDialog(parent),
loadingWindow(new FMLoading(this)) loadingWindow(new FMLoading(this))
{ {
setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint); setWindowFlags(this->windowFlags() | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
setAttribute(Qt::WA_QuitOnClose, false); setAttribute(Qt::WA_QuitOnClose, false);
setAttribute(Qt::WA_DeleteOnClose, false); setAttribute(Qt::WA_DeleteOnClose, false);
setIsBusy(false); setIsBusy(false);
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<string>Form</string> <string>Form</string>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">QWidget { <string notr="true"> QWidget {
font: normal 22px &quot;Microsoft YaHei&quot;; font: normal 22px &quot;Microsoft YaHei&quot;;
color: rgb(90,90,90); color: rgb(90,90,90);
} }
...@@ -41,8 +41,13 @@ ...@@ -41,8 +41,13 @@
min-width: 32;max-width: 32; min-width: 32;max-width: 32;
min-height: 32;max-height: 32; min-height: 32;max-height: 32;
image: url(&quot;:/img/btn_close.png&quot;); image: url(&quot;:/img/btn_close.png&quot;);
background: rgb(56, 56, 64);
border: 0 solid silver; border: 0 solid silver;
border-top: 1 solid silver;
border-right: 1 solid silver;
border-radius: 0;
}
#close_btn:hover {
background: rgb(56, 56, 64);
padding: 0; padding: 0;
} }
...@@ -56,14 +61,15 @@ QPushButton { ...@@ -56,14 +61,15 @@ QPushButton {
} }
QPushButton:hover { QPushButton:hover {
background: #7aad65;
color: white;
padding: 2 0 0 2; padding: 2 0 0 2;
background: rgb(85, 255, 127);
} }
#no0 { #no0 {
min-width: 106px; min-width: 106px;
max-width: 106px;} max-width: 106px;
}
#backspace_btn, #clear_btn { #backspace_btn, #clear_btn {
font: normal 16px &quot;Microsoft YaHei&quot;; font: normal 16px &quot;Microsoft YaHei&quot;;
} }
...@@ -142,14 +148,14 @@ QPushButton:hover { ...@@ -142,14 +148,14 @@ QPushButton:hover {
<widget class="QPushButton" name="close_btn"> <widget class="QPushButton" name="close_btn">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>32</width> <width>33</width>
<height>32</height> <height>33</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>32</width> <width>33</width>
<height>32</height> <height>33</height>
</size> </size>
</property> </property>
<property name="cursor"> <property name="cursor">
......
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
color: rgb(50,50,50); color: rgb(50,50,50);
background: white; background: white;
border: 1 solid silver; border: 1 solid silver;
border-left: 0; border-width: 1 0;
} }
#login_btn { #login_btn {
...@@ -241,6 +241,35 @@ ...@@ -241,6 +241,35 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QPushButton" name="login_key">
<property name="minimumSize">
<size>
<width>51</width>
<height>51</height>
</size>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true">#login_key {
border: 1 solid silver;
border-left: 0px;
color: rgb(130,130,130);
background-color: rgb(255, 255, 255);
font: 13px &quot;微软雅黑&quot;;
}
#login_key:hover {
color: rgb(37, 176, 246);
}</string>
</property>
<property name="text">
<string>键盘</string>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
<item> <item>
......
...@@ -179,9 +179,10 @@ ...@@ -179,9 +179,10 @@
color: red; color: red;
} }
#pay_edit { #pay_edit, #score_edit {
min-height: 45px; min-height: 45px;
border: 1 solid silver; border: 1 solid silver;
border-width: 1 0 1 1;
text-align: center; text-align: center;
font: 500 30px blod &quot;Microsoft YaHei&quot;; font: 500 30px blod &quot;Microsoft YaHei&quot;;
color: rgb(50,50,50); color: rgb(50,50,50);
...@@ -736,13 +737,13 @@ ...@@ -736,13 +737,13 @@
<number>60</number> <number>60</number>
</property> </property>
<property name="topMargin"> <property name="topMargin">
<number>10</number> <number>0</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>60</number> <number>60</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>5</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QLabel" name="pay_max"> <widget class="QLabel" name="pay_max">
...@@ -755,6 +756,11 @@ ...@@ -755,6 +756,11 @@
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QLineEdit" name="pay_edit"> <widget class="QLineEdit" name="pay_edit">
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
...@@ -774,6 +780,37 @@ ...@@ -774,6 +780,37 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="pay_key">
<property name="minimumSize">
<size>
<width>40</width>
<height>47</height>
</size>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true">#pay_key {
border: 1 solid silver;
border-left: 0px;
color: rgb(130,130,130);
background-color: rgb(255, 255, 255);
font: 13px &quot;微软雅黑&quot;;
}
#pay_key:hover {
color: rgb(37, 176, 246);
}</string>
</property>
<property name="text">
<string>键盘</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="standard_label"> <widget class="QLabel" name="standard_label">
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
...@@ -790,11 +827,16 @@ ...@@ -790,11 +827,16 @@
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QLineEdit" name="score_edit"> <widget class="QLineEdit" name="score_edit">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>0</height> <height>47</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
...@@ -812,6 +854,43 @@ ...@@ -812,6 +854,43 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="score_key">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="styleSheet">
<string notr="true">#score_key {
border: 1 solid silver;
border-left: 0px;
color: rgb(130,130,130);
background-color: rgb(255, 255, 255);
font: 13px &quot;微软雅黑&quot;;
}
#score_key:hover {
color: rgb(37, 176, 246);
}</string>
</property>
<property name="text">
<string>键盘</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="score_label"> <widget class="QLabel" name="score_label">
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
......
...@@ -18,20 +18,19 @@ private: ...@@ -18,20 +18,19 @@ private:
FMVipDispatcher fmvip; FMVipDispatcher fmvip;
private slots: private slots:
private:
void initTestCase(); void initTestCase();
void cleanupTestCase(); void cleanupTestCase();
void test_dotask_data(); void test_Sign_data();
void test_dotask(); void test_Sign();
void test_JsonObjToMap_data(); void test_JsonObjToMap_data();
void test_JsonObjToMap(); void test_JsonObjToMap();
void test_Sign_data(); private slots:
void test_Sign(); void test_dotask_data();
void test_dotask();
void test_numpad_data();
void test_numpad();
}; };
TestPlugin::TestPlugin() TestPlugin::TestPlugin()
...@@ -58,13 +57,13 @@ void TestPlugin::test_dotask_data() ...@@ -58,13 +57,13 @@ void TestPlugin::test_dotask_data()
{ {
QTest::addColumn<QByteArray>("reqData"); QTest::addColumn<QByteArray>("reqData");
QTest::newRow("Refund") << QByteArray("{\"fm_cmd\": 1004,\"order_id\": \"20171018003\"}"); // QTest::newRow("Refund") << QByteArray("{\"fm_cmd\": 1004,\"order_id\": \"20171018003\"}");
QTest::newRow("Refund not") << QByteArray("{\"fm_cmd\": 1004,\"order_id\": \"12345\"}"); // QTest::newRow("Refund not") << QByteArray("{\"fm_cmd\": 1004,\"order_id\": \"12345\"}");
QTest::newRow("SetStoreInfo") << QByteArray("{\"fm_cmd\": 1000,\"store_id\": \"99999\",\"pos_id\": \"1\",\"business_date\": \"20171016\",\"operator_id\": \"001\"}"); // QTest::newRow("SetStoreInfo") << QByteArray("{\"fm_cmd\": 1000,\"store_id\": \"99999\",\"pos_id\": \"1\",\"business_date\": \"20171016\",\"operator_id\": \"001\"}");
QTest::newRow("SetStoreInfo_need_posId") << QByteArray("{\"fm_cmd\": 1000,\"store_id\": \"fm9999\",\"pos_id\": \"\",\"business_date\": \"20171016\",\"operator_id\": \"001\"}"); // QTest::newRow("SetStoreInfo_need_posId") << QByteArray("{\"fm_cmd\": 1000,\"store_id\": \"fm9999\",\"pos_id\": \"\",\"business_date\": \"20171016\",\"operator_id\": \"001\"}");
QTest::newRow("SetStoreInfo_notnull_posId") << QByteArray("{\"fm_cmd\": 1000,\"store_id\": \"fm9999\",\"business_date\": \"20171016\",\"operator_id\": \"001\"}"); // QTest::newRow("SetStoreInfo_notnull_posId") << QByteArray("{\"fm_cmd\": 1000,\"store_id\": \"fm9999\",\"business_date\": \"20171016\",\"operator_id\": \"001\"}");
QTest::newRow("SetStoreInfo_error_type") << QByteArray("{\"fm_cmd\": 1000,\"store_id\": \"fm9999\",\"pos_id\": 1,\"business_date\": \"20171016\",\"operator_id\": \"001\"}"); // QTest::newRow("SetStoreInfo_error_type") << QByteArray("{\"fm_cmd\": 1000,\"store_id\": \"fm9999\",\"pos_id\": 1,\"business_date\": \"20171016\",\"operator_id\": \"001\"}");
QTest::newRow("Login") << QByteArray("{\"fm_cmd\": 1001}"); // QTest::newRow("Login") << QByteArray("{\"fm_cmd\": 1001}");
QTest::newRow("Pay") << QByteArray("{" QTest::newRow("Pay") << QByteArray("{"
" \"fm_cmd\": 1003," " \"fm_cmd\": 1003,"
" \"order_amount\":900," " \"order_amount\":900,"
...@@ -87,9 +86,9 @@ void TestPlugin::test_dotask_data() ...@@ -87,9 +86,9 @@ void TestPlugin::test_dotask_data()
" }" " }"
" ]" " ]"
"}"); "}");
QTest::newRow("Order") << QByteArray("{\"fm_cmd\": 1007,\"order_id\": \"20171018003\"}"); // QTest::newRow("Order") << QByteArray("{\"fm_cmd\": 1007,\"order_id\": \"20171018003\"}");
QTest::newRow("Fund") << QByteArray("{\"fm_cmd\": 1002,\"order_id\": \"20171018001\"}"); // QTest::newRow("Fund") << QByteArray("{\"fm_cmd\": 1002,\"order_id\": \"20171018001\"}");
QTest::newRow("CouponPay") << QByteArray("{\"fm_cmd\": 10032}"); // QTest::newRow("CouponPay") << QByteArray("{\"fm_cmd\": 10032}");
} }
void TestPlugin::test_dotask() void TestPlugin::test_dotask()
...@@ -152,20 +151,6 @@ void TestPlugin::test_Sign() ...@@ -152,20 +151,6 @@ void TestPlugin::test_Sign()
QCOMPARE(FMTask::Sign(jsonObj1), SignStr); QCOMPARE(FMTask::Sign(jsonObj1), SignStr);
} }
void TestPlugin::test_numpad_data()
{
}
void TestPlugin::test_numpad()
{
QLineEdit *edit = new QLineEdit();
FMNumPad pad(edit);
pad.show();
edit->show();
QTest::qWait(1000 * 60 *2);
}
QTEST_MAIN(TestPlugin) QTEST_MAIN(TestPlugin)
#include "tst_testplugin.moc" #include "tst_testplugin.moc"
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#define VER_MINOR 1 #define VER_MINOR 1
#define VER_REVISION 0 #define VER_REVISION 0
#define VER_BUILD 29 #define VER_BUILD 30
//! Convert version numbers to string //! Convert version numbers to string
#define _STR(S) #S #define _STR(S) #S
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment