Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fmp_epay
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhenfei.zhang
fmp_epay
Commits
88e1b6e4
Commit
88e1b6e4
authored
Dec 05, 2017
by
guanghui.cui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支付成功后自动关闭(默认5s)增加配置文件字段:"Pay/AutoCloseSeconds"
parent
5813f406
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
3 deletions
+37
-3
fmp_epay_def.h
+1
-1
fmp_epay_p.cpp
+5
-1
fmp_epay_p.h
+1
-0
fmp_epayview_dialog.cpp
+26
-0
fmp_epayview_dialog.h
+3
-0
version.h
+1
-1
No files found.
fmp_epay_def.h
View file @
88e1b6e4
...
@@ -71,7 +71,7 @@
...
@@ -71,7 +71,7 @@
#define FMP_INIKEY_EPAYTIMEOUT "Pay/Timeout"
#define FMP_INIKEY_EPAYTIMEOUT "Pay/Timeout"
#define FMP_INIKEY_EPAYURL "Pay/Server"
#define FMP_INIKEY_EPAYURL "Pay/Server"
#define FMP_INIKEY_EPAYAUTOCLOSE "Pay/AutoCloseSeconds"
#endif // FMP_EPAY_DEF
#endif // FMP_EPAY_DEF
fmp_epay_p.cpp
View file @
88e1b6e4
...
@@ -38,7 +38,8 @@ FMPePayPrivate::FMPePayPrivate(FMPePay *parent)
...
@@ -38,7 +38,8 @@ FMPePayPrivate::FMPePayPrivate(FMPePay *parent)
_watcher
(
nullptr
),
_watcher
(
nullptr
),
_reverse_flag
(
false
),
_reverse_flag
(
false
),
_is_api
(
false
),
_is_api
(
false
),
_api_abort
(
false
)
_api_abort
(
false
),
auto_close_seconds
(
0
)
{
{
_watcher
=
new
QFutureWatcher
<
QByteArray
>
();
_watcher
=
new
QFutureWatcher
<
QByteArray
>
();
connect
(
_watcher
,
SIGNAL
(
finished
()
),
this
,
SLOT
(
witedata
()
)
);
connect
(
_watcher
,
SIGNAL
(
finished
()
),
this
,
SLOT
(
witedata
()
)
);
...
@@ -140,6 +141,9 @@ void FMPePayPrivate::Init()
...
@@ -140,6 +141,9 @@ void FMPePayPrivate::Init()
q
->
_time_out
=
_setting
->
GetInt
(
FMP_INIKEY_EPAYTIMEOUT
);
q
->
_time_out
=
_setting
->
GetInt
(
FMP_INIKEY_EPAYTIMEOUT
);
q
->
_time_out
=
(
q
->
_time_out
>
60
?
q
->
_time_out
:
60
);
q
->
_time_out
=
(
q
->
_time_out
>
60
?
q
->
_time_out
:
60
);
auto_close_seconds
=
_setting
->
GetInt
(
FMP_INIKEY_EPAYAUTOCLOSE
);
auto_close_seconds
=
auto_close_seconds
>
0
?
auto_close_seconds
:
5
;
hash
[
FMP_EPAY_PARTNERID
]
=
q
->
_partner_id
;
hash
[
FMP_EPAY_PARTNERID
]
=
q
->
_partner_id
;
hash
[
FMP_EPAY_TIMEOUT
]
=
q
->
_time_out
;
hash
[
FMP_EPAY_TIMEOUT
]
=
q
->
_time_out
;
...
...
fmp_epay_p.h
View file @
88e1b6e4
...
@@ -80,6 +80,7 @@ public:
...
@@ -80,6 +80,7 @@ public:
FMPSettingsInterface
*
_setting
;
FMPSettingsInterface
*
_setting
;
int
auto_close_seconds
;
//支付成功后自动关闭窗口秒数
private:
private:
QJsonObject
_origin_request
;
QJsonObject
_origin_request
;
QJsonObject
_docked_request
;
QJsonObject
_docked_request
;
...
...
fmp_epayview_dialog.cpp
View file @
88e1b6e4
...
@@ -173,6 +173,10 @@ FMPPayDialog::FMPPayDialog(FMPePayPrivate *control, QVariantHash basicinfo, QWid
...
@@ -173,6 +173,10 @@ FMPPayDialog::FMPPayDialog(FMPePayPrivate *control, QVariantHash basicinfo, QWid
ui
->
btn_refund
->
setEnabled
(
false
);
ui
->
btn_refund
->
setEnabled
(
false
);
ui
->
btn_pay
->
setEnabled
(
false
);
ui
->
btn_pay
->
setEnabled
(
false
);
}
}
_wnd_close_timer
=
new
QTimer
(
this
);
connect
(
_wnd_close_timer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
timerHandle
()));
_seconds
=
_control
->
auto_close_seconds
;
}
}
int
FMPPayDialog
::
getPayAmount
()
const
int
FMPPayDialog
::
getPayAmount
()
const
...
@@ -298,6 +302,13 @@ void FMPPayDialog::setBasicInfo(QVariantHash basicinfo)
...
@@ -298,6 +302,13 @@ void FMPPayDialog::setBasicInfo(QVariantHash basicinfo)
FMPPayDialog
::~
FMPPayDialog
()
FMPPayDialog
::~
FMPPayDialog
()
{
{
if
(
_wnd_close_timer
){
if
(
_wnd_close_timer
->
isActive
()){
_wnd_close_timer
->
stop
();
}
delete
_wnd_close_timer
;
}
if
(
_wait
!=
NULL
)
if
(
_wait
!=
NULL
)
{
{
delete
_wait
;
delete
_wait
;
...
@@ -383,6 +394,7 @@ void FMPPayDialog::setPaySuccessView(QJsonObject json)
...
@@ -383,6 +394,7 @@ void FMPPayDialog::setPaySuccessView(QJsonObject json)
PlayAnimation
(
findChild
<
QWidget
*>
(
_curt_btn
->
property
(
"pageName"
).
toString
()),
ui
->
wdg_success_main
,
RightToLeft
);
PlayAnimation
(
findChild
<
QWidget
*>
(
_curt_btn
->
property
(
"pageName"
).
toString
()),
ui
->
wdg_success_main
,
RightToLeft
);
ui
->
btn_success_confirm
->
setFocus
();
ui
->
btn_success_confirm
->
setFocus
();
_wnd_close_timer
->
start
(
1000
);
}
}
void
FMPPayDialog
::
setRefundSuccessView
(
QJsonObject
json
)
void
FMPPayDialog
::
setRefundSuccessView
(
QJsonObject
json
)
...
@@ -749,3 +761,17 @@ void FMPPayDialog::on_lineEdit_textChanged(const QString &arg1)
...
@@ -749,3 +761,17 @@ void FMPPayDialog::on_lineEdit_textChanged(const QString &arg1)
_control
->
GetCheckMode
(
arg1
);
_control
->
GetCheckMode
(
arg1
);
ui
->
pushButton_2
->
setEnabled
(
false
);
ui
->
pushButton_2
->
setEnabled
(
false
);
}
}
void
FMPPayDialog
::
timerHandle
()
{
QString
btnText
=
QString
::
fromLocal8Bit
(
"确定("
);
btnText
+=
QString
::
number
(
_seconds
);
btnText
+=
")"
;
ui
->
btn_success_confirm
->
setText
(
btnText
);
if
(
_seconds
<=
0
&&
_wnd_close_timer
->
isActive
()){
_wnd_close_timer
->
stop
();
on_btn_success_confirm_clicked
();
}
_seconds
--
;
}
fmp_epayview_dialog.h
View file @
88e1b6e4
...
@@ -51,6 +51,7 @@ public slots:
...
@@ -51,6 +51,7 @@ public slots:
void
setBasicInfo
(
QVariantHash
basicinfo
);
void
setBasicInfo
(
QVariantHash
basicinfo
);
void
timerHandle
();
//定时关闭支付成功窗口
protected:
protected:
void
keyPressEvent
(
QKeyEvent
*
);
void
keyPressEvent
(
QKeyEvent
*
);
...
@@ -125,6 +126,8 @@ private:
...
@@ -125,6 +126,8 @@ private:
bool
_b_mouse_pressed
;
bool
_b_mouse_pressed
;
bool
_is_api
;
bool
_is_api
;
QPoint
_mMovePosition
;
QPoint
_mMovePosition
;
QTimer
*
_wnd_close_timer
;
int
_seconds
;
};
};
#endif // DIALOG_H
#endif // DIALOG_H
version.h
View file @
88e1b6e4
...
@@ -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 2
1
#define VER_BUILD 2
2
//! Convert version numbers to string
//! Convert version numbers to string
#define _STR(S) #S
#define _STR(S) #S
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment