Commit 8835dd27 by LIDINGDA\ldd

1.窗口一直置顶;2.支付退款超时时间设置为一分钟

parent 4bba0f62
......@@ -18,6 +18,7 @@ FMPePay::FMPePay(ctkPluginContext *context)
_operator_id(DEFAULT_EPAY_OPTID),
_store_id(DEFAULT_EPAY_STRID),
_station_id(DEFAULT_EPAY_STNID),
_time_out(60),
_ste_handler(new FMPStartEventHandler(_ctx, this)),
d_ptr(new FMPePayPrivate(this))
{
......
......@@ -39,6 +39,7 @@ private:
QString _station_id;
QString _operator_id;
QString _partner_id;
int _time_out;
//销售单保存时间
......
......@@ -51,6 +51,9 @@ INCLUDEPATH += $$PWD/../include/ctk \
#Library path
LIBS += -L$$PWD/../lib
win32 {
LIBS += -lws2_32 -luser32
}
CONFIG(debug, debug|release) {
#Linking library
......
......@@ -17,6 +17,7 @@
#define FMP_EPAY_TRANSTRACTION_AMOUNT "amount"
#define FMP_EPAY_TRANSTRACTION_CODE "code"
#define FMP_EPAY_ANIMATION "needanimation"
#define FMP_EPAY_TIMEOUT "timeout"
//支付返回
#define FMP_RPAY_PAY_RETURN_PAYID "pay_id"
......
......@@ -148,6 +148,9 @@ void FMPePayPrivate::Init()
q->_station_id = _setting->GetString(FMP_INIKEY_LOGINPOSID);
q->_operator_id = _setting->GetString(FMP_INIKEY_LOGINCASHIER);
q->_partner_id = _setting->GetString(FMP_INIKEY_LOGINPARTNERID);
q->_time_out = _setting->GetInt(FMP_INIKEY_EPAYTIMEOUT);
q->_time_out = (q->_time_out > 60 ? q->_time_out : 60);
hash[FMP_EPAY_ANIMATION] = _setting->GetBool(FMP_INIKEY_ANIMATION);
hash[FMP_EPAY_BUSINESSDATE] = q->_businessdate;
......@@ -155,6 +158,7 @@ void FMPePayPrivate::Init()
hash[FMP_EPAY_STATIONID] = q->_station_id;
hash[FMP_EPAY_OPERATORID] = q->_operator_id;
hash[FMP_EPAY_PARTNERID] = q->_partner_id;
hash[FMP_EPAY_TIMEOUT] = q->_time_out;
_payDialog = new FMPPayDialog(this, hash);
}
......@@ -210,7 +214,7 @@ void FMPePayPrivate::ControlPayJson(QString sum, QString code)
QString errors;
QJsonObject outjson;
if(!HttpPost(outjson, _current_json ,errors, 10))
if(!HttpPost(outjson, _current_json ,errors, q->_time_out))
{
emit error(errors);
}
......@@ -409,7 +413,7 @@ void FMPePayPrivate::ControlRefundJson(QString sum, QString code)
QString errors;
QJsonObject outjson;
if(!HttpPost(outjson, _current_json ,errors))
if(!HttpPost(outjson, _current_json ,errors, q->_time_out))
{
emit error(errors);
}
......
......@@ -11,6 +11,8 @@
#include <QSqlTableModel>
#include <QStyledItemDelegate>
#include <QMouseEvent>
#include <Windows.h>
#include <QDesktopWidget>
#include <QPropertyAnimation>
......@@ -151,6 +153,25 @@ FMPPayDialog::FMPPayDialog(FMPePayPrivate *control, QVariantHash basicinfo, QWid
}
void FMPPayDialog::show()
{
showNormal();
::SetForegroundWindow((HWND)effectiveWinId());
::SetWindowPos( (HWND)effectiveWinId(), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
showNormal();
::SetForegroundWindow((HWND)effectiveWinId());
QDesktopWidget w;
QRect rc = w.availableGeometry();
setGeometry((rc.width() - width()) / 2, (rc.height() - height()) / 2, width(), height());
return QDialog::show();
}
void FMPPayDialog::onWidgetChange()
{
QPushButton *tmpcur = _curt_btn;
......@@ -220,7 +241,7 @@ void FMPPayDialog::showErrorMsg(QString errormsg)
if(errormsg == "")
errormsg = QString("");
_wait->SetContent(FMPPayWait::ERROR, errormsg);
_wait->SetContent(FMPPayWait::ERRORS, errormsg);
if(_wait->isHidden())
_wait->show();
......@@ -543,7 +564,7 @@ void FMPPayDialog::onBtnConfirmClicked()
ui->lineedit_code->clear();
ui->lineedit_num_refund->clear();
ui->lineedit_code_refund->clear();
_wait->SetContent(FMPPayWait::ERROR, QString::fromLocal8Bit("金额或条码错误\n请重新输入"));
_wait->SetContent(FMPPayWait::ERRORS, QString::fromLocal8Bit("金额或条码错误\n请重新输入"));
_wait->show();
return;
}
......
......@@ -35,6 +35,9 @@ typedef enum
public:
explicit FMPPayDialog(FMPePayPrivate *control, QVariantHash basicinfo, QWidget *parent = 0);
void show();
~FMPPayDialog();
public slots:
......
......@@ -35,7 +35,7 @@ void FMPPayWait::SetContent(FMPPayWait::Type type, const QString &msg)
ui->btn_confirm->setVisible(true);
ui->label_logo->setStyleSheet("#label_logo {background: url(:/img/loading.png) center no-repeat;}");
break;
case FMPPayWait::ERROR:
case FMPPayWait::ERRORS:
ui->btn_confirm->setVisible(true);
ui->label_logo->setStyleSheet("#label_logo {background: url(:/img/fmclient-icon_payment_fail.png) center no-repeat;}");
break;
......
......@@ -19,7 +19,7 @@ public:
typedef enum
{
SUCCESS=0,
ERROR,
ERRORS,
LOADING
}Type;
......
......@@ -5,7 +5,7 @@
#define VER_MINOR 1
#define VER_REVISION 0
#define VER_BUILD 10
#define VER_BUILD 11
//! Convert version numbers to string
#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