Commit 7048adc3 by NitefullWind

1. 管理界面中各个版本显示不同。

parent 645ae0cf
...@@ -76,6 +76,10 @@ void Control::Start(const char *indata, char *outdata) ...@@ -76,6 +76,10 @@ void Control::Start(const char *indata, char *outdata)
InitPOSReqJsonObj(indata); InitPOSReqJsonObj(indata);
connect(_widget, &HostWidget::Interrupt, this, [this](){
_isinterrupt = true;
});
connect(_widget, &HostWidget::RequestWithType, this, &Control::RequestWithType); connect(_widget, &HostWidget::RequestWithType, this, &Control::RequestWithType);
connect(_widget, &HostWidget::Exits, this, [&loop, &refundflag] () connect(_widget, &HostWidget::Exits, this, [&loop, &refundflag] ()
...@@ -176,9 +180,9 @@ void Control::InitModel() ...@@ -176,9 +180,9 @@ void Control::InitModel()
bool Control::SendMessageToServer(const QJsonObject &json, QByteArray &outdata, QString &error) bool Control::SendMessageToServer(const QJsonObject &json, QByteArray &outdata, QString &error)
{ {
QJsonObject tmpjson = json; QJsonObject tmpjson = json;
tmpjson[JSON_KEY_VER] = DEFAULT_JSON_VER_VALUE;
CretOperate::GetMAC(tmpjson); CretOperate::GetMAC(tmpjson);
CretOperate::GetSign(tmpjson); CretOperate::GetSign(tmpjson);
tmpjson[JSON_KEY_VER] = DEFAULT_JSON_VER_VALUE;
QLOG_INFO() << "send json to payment: " << tmpjson; QLOG_INFO() << "send json to payment: " << tmpjson;
...@@ -201,6 +205,25 @@ bool Control::SendMessageToPayMent(const QJsonObject &json, QByteArray &outdata, ...@@ -201,6 +205,25 @@ bool Control::SendMessageToPayMent(const QJsonObject &json, QByteArray &outdata,
QByteArray data = QJsonDocument(json).toJson(QJsonDocument::Compact); QByteArray data = QJsonDocument(json).toJson(QJsonDocument::Compact);
#ifdef MOCK
QEventLoop loop;
QFuture<void> future = QtConcurrent::run( [ this, &loop, json, &array]()
{
QLOG_DEBUG() << "=========================================== Read debug data. ========================================";
int type = FMTool::GetJsonValue(json, JSON_KEY_REQTYPE).toInt(sign);
QLOG_DEBUG() << "Test req type: " << type;
QFile f(qApp->applicationDirPath()+QString("/test_simphony/%1.txt").arg(type));
f.open(QIODevice::ReadOnly);
array = f.readAll();
Sleep(1000*10);
QLOG_DEBUG() << "=========================================== End read debug data. ====================================";
});
QFutureWatcher<void> watcher;
watcher.setFuture(future);
connect(&watcher, SIGNAL(finished()), &loop, SLOT(quit()));
loop.exec();
#else
if(!Control::HttpPost(url, array, data, "application/json;charset=utf-8", "application/json", error, 60)) if(!Control::HttpPost(url, array, data, "application/json;charset=utf-8", "application/json", error, 60))
{ {
if(json.contains(JSON_KEY_PARTORDERID) && !json[JSON_KEY_PARTORDERID].toString().isEmpty()) if(json.contains(JSON_KEY_PARTORDERID) && !json[JSON_KEY_PARTORDERID].toString().isEmpty())
...@@ -216,6 +239,7 @@ bool Control::SendMessageToPayMent(const QJsonObject &json, QByteArray &outdata, ...@@ -216,6 +239,7 @@ bool Control::SendMessageToPayMent(const QJsonObject &json, QByteArray &outdata,
return false; return false;
} }
#endif
outdata = array; outdata = array;
......
...@@ -60,6 +60,8 @@ HostWidget::HostWidget(QWidget *parent) : ...@@ -60,6 +60,8 @@ HostWidget::HostWidget(QWidget *parent) :
//ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); //ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
ui->tableWidget->verticalHeader()->setDefaultSectionSize(45); ui->tableWidget->verticalHeader()->setDefaultSectionSize(45);
ui->btn_mananger_print_shift->setVisible(false);
} }
void HostWidget::ShowWidget(QWidget *showwidget) void HostWidget::ShowWidget(QWidget *showwidget)
...@@ -324,6 +326,7 @@ void HostWidget::ShowWiteJson(bool flag, QJsonObject object, QString error) ...@@ -324,6 +326,7 @@ void HostWidget::ShowWiteJson(bool flag, QJsonObject object, QString error)
void HostWidget::ShowWithRequest(POSType posType, QJsonObject requestObj) void HostWidget::ShowWithRequest(POSType posType, QJsonObject requestObj)
{ {
_posType = posType; _posType = posType;
_type = (ReqType)FMTool::GetJsonValue(requestObj, JSON_KEY_REQTYPE).toInt(); _type = (ReqType)FMTool::GetJsonValue(requestObj, JSON_KEY_REQTYPE).toInt();
_posReqJsonObj = requestObj; _posReqJsonObj = requestObj;
...@@ -331,6 +334,18 @@ void HostWidget::ShowWithRequest(POSType posType, QJsonObject requestObj) ...@@ -331,6 +334,18 @@ void HostWidget::ShowWithRequest(POSType posType, QJsonObject requestObj)
switch (_type) { switch (_type) {
case manage: case manage:
{ {
int btnNums = 3;
if(_posType==SPCC) {
ui->btn_mananger_print_shift->setVisible(true);
btnNums = 4;
} else {
ui->btn_mananger_print_shift->setMaximumSize(0,0);
ui->btn_mananger_print_shift->setMinimumSize(0,0);
}
ui->horizontalLayout_manager->setSpacing(this->width()/(btnNums+2)-ui->btn_mananger_register->width());
ShowWidget(ui->Manager); ShowWidget(ui->Manager);
_curr_show_widget = ui->Manager; _curr_show_widget = ui->Manager;
break; break;
......
...@@ -1630,6 +1630,12 @@ QHeaderView::section{ ...@@ -1630,6 +1630,12 @@ QHeaderView::section{
</item> </item>
<item> <item>
<widget class="QWidget" name="Manager" native="true"> <widget class="QWidget" name="Manager" native="true">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">#Manager <string notr="true">#Manager
{ {
...@@ -1669,7 +1675,7 @@ QHeaderView::section{ ...@@ -1669,7 +1675,7 @@ QHeaderView::section{
</spacer> </spacer>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_manager">
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
...@@ -1678,10 +1684,13 @@ QHeaderView::section{ ...@@ -1678,10 +1684,13 @@ QHeaderView::section{
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>40</width> <width>0</width>
<height>20</height> <height>0</height>
</size> </size>
</property> </property>
</spacer> </spacer>
...@@ -1722,19 +1731,6 @@ QHeaderView::section{ ...@@ -1722,19 +1731,6 @@ QHeaderView::section{
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btn_mananger_check"> <widget class="QPushButton" name="btn_mananger_check">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
...@@ -1770,19 +1766,6 @@ QHeaderView::section{ ...@@ -1770,19 +1766,6 @@ QHeaderView::section{
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btn_mananger_print"> <widget class="QPushButton" name="btn_mananger_print">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed"> <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
...@@ -1818,19 +1801,6 @@ QHeaderView::section{ ...@@ -1818,19 +1801,6 @@ QHeaderView::section{
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer_32">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btn_mananger_print_shift"> <widget class="QPushButton" name="btn_mananger_print_shift">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
...@@ -1864,10 +1834,13 @@ QHeaderView::section{ ...@@ -1864,10 +1834,13 @@ QHeaderView::section{
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>40</width> <width>0</width>
<height>20</height> <height>0</height>
</size> </size>
</property> </property>
</spacer> </spacer>
......
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