Commit de9bde93 by NitefullWind

1. roastery版,由POS扫码。

parent 216ee36f
......@@ -292,19 +292,16 @@ bool Control::HttpPost(QString url, QByteArray &outdata, const QByteArray &indat
QLOG_INFO() << "HttpPost url: " << url << " content: " << content << " accept: " << accept << " timeout: " << timeout;
QNetworkReply* reply = manger.post(request, indata);
QSharedPointer<QNetworkReply> reply = QSharedPointer<QNetworkReply>(manger.post(request, indata));
connect(&timer, &QTimer::timeout, &loop, &QEventLoop::quit);
connect(&manger, &QNetworkAccessManager::finished, &loop, &QEventLoop::quit);
connect(_widget, &HostWidget::Interrupt, &loop, &QEventLoop::quit);
connect(reply, static_cast<void (QNetworkReply::*)(QNetworkReply::NetworkError)>(&QNetworkReply::error), &loop, &QEventLoop::quit);
connect(reply.data(), static_cast<void (QNetworkReply::*)(QNetworkReply::NetworkError)>(&QNetworkReply::error), &loop, &QEventLoop::quit);
timer.start(timeout*1000);
loop.exec();
reply->deleteLater();
#ifdef FM_TEST
QEventLoop test_loop;
QTimer test_timer;
......
......@@ -406,6 +406,7 @@ void HostWidget::ShowWithRequest(POSType posType, QJsonObject requestObj)
QStringList list;
list.append(FMTool::GetJsonValue(requestObj, JSON_KEY_FMID).toString());
_runing = true;
ui->label_pay_title->setText(QString::fromLocal8Bit("支付宝退款中..."));
emit RequestWithType(refund, list);
......
......@@ -372,7 +372,7 @@ private:
QString filePath = dir.absolutePath();
if(!filePath.endsWith('/') && !filePath.endsWith('\\')) {
filePath.append('\\');
filePath.append('/');
}
filePath.append(printFileName);
response[JSON_KEY_PRINTPATH] = filePath;
......
......@@ -3,7 +3,7 @@
#define VER_MAJOR 0
#define VER_MINOR 2
#define VER_REVISION 4
#define VER_REVISION 6
#define VER_BUILD 0
......
......@@ -220,7 +220,7 @@ void TestSimphony::test_POSRequest_data()
"\"storeId\": \"1713\", "
"\"transAmount\": %3, "
"\"transId\": 301439 "
"\"code\": \"12312\" "
"\"code\": \"\" "
"}")
.arg(QDate::currentDate().toString("yyyyMMdd"))
.arg(CreatePartnerOrderId())
......
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