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
bdf39390
Commit
bdf39390
authored
Feb 06, 2018
by
NitefullWind
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 实现退款后弹窗提示。
parent
00bdc4d5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
29 deletions
+48
-29
fmp_epay_p.cpp
+14
-10
fmp_epayview_dialog.cpp
+30
-18
fmp_epayview_dialog.h
+3
-0
version.h
+1
-1
No files found.
fmp_epay_p.cpp
View file @
bdf39390
...
@@ -176,14 +176,14 @@ void FMPePayPrivate::Init()
...
@@ -176,14 +176,14 @@ void FMPePayPrivate::Init()
hash
[
"amount"
]
=
(
int
)(
trans
[
"refund_amount"
].
toDouble
()
+
0.005
);
hash
[
"amount"
]
=
(
int
)(
trans
[
"refund_amount"
].
toDouble
()
+
0.005
);
hash
[
FMP_JKEY_FM_ORDERID
]
=
trans
[
FMP_JKEY_FM_ORDERID
].
toVariant
();
hash
[
FMP_JKEY_FM_ORDERID
]
=
trans
[
FMP_JKEY_FM_ORDERID
].
toVariant
();
if
(
trans
.
contains
(
"refund_amount"
)
&&
(
int
)(
trans
[
"refund_amount"
].
toDouble
()
+
0.005
)
!=
0
// if (trans.contains("refund_amount") && trans["refund_amount"].toInt(
) != 0
&&
trans
.
contains
(
FMP_JKEY_FM_ORDERID
)
&&
!
trans
[
FMP_JKEY_FM_ORDERID
].
toString
().
isEmpty
()
//
&& trans.contains(FMP_JKEY_FM_ORDERID) && !trans[FMP_JKEY_FM_ORDERID].toString().isEmpty()
||
trans
.
contains
(
FMP_JKEY_PAY_TRANSID
)
&&
!
trans
[
FMP_JKEY_PAY_TRANSID
].
toString
().
isEmpty
())
{
//
|| trans.contains(FMP_JKEY_PAY_TRANSID) && !trans[FMP_JKEY_PAY_TRANSID].toString().isEmpty()) {
connect
(
this
,
&
FMPePayPrivate
::
finished
,
this
,
&
FMPePayPrivate
::
confirmClicked
);
//
connect(this, &FMPePayPrivate::finished, this, &FMPePayPrivate::confirmClicked);
connect
(
this
,
&
FMPePayPrivate
::
error
,
this
,
&
FMPePayPrivate
::
confirmClicked
);
//
connect(this, &FMPePayPrivate::error, this, &FMPePayPrivate::confirmClicked);
ControlRefundJson
(
trans
);
//
ControlRefundJson(trans);
return
;
//
return;
}
//
}
}
}
QJsonArray
pos_products
=
_origin_request
[
"products"
].
toArray
();
QJsonArray
pos_products
=
_origin_request
[
"products"
].
toArray
();
QJsonArray
products
;
QJsonArray
products
;
...
@@ -204,6 +204,10 @@ void FMPePayPrivate::Init()
...
@@ -204,6 +204,10 @@ void FMPePayPrivate::Init()
}
}
_payDialog
->
show
();
_payDialog
->
show
();
if
(
_origin_request
[
"fm_cmd"
].
toInt
()
==
10041
&&
!
hash
[
FMP_JKEY_FM_ORDERID
].
toString
().
isEmpty
())
{
_payDialog
->
confirmRefund
();
}
}
}
void
FMPePayPrivate
::
clearorder
()
void
FMPePayPrivate
::
clearorder
()
...
@@ -681,8 +685,8 @@ void FMPePayPrivate::ControlRefundJson(const QJsonObject &trans)
...
@@ -681,8 +685,8 @@ void FMPePayPrivate::ControlRefundJson(const QJsonObject &trans)
emit
apiError
();
emit
apiError
();
}
}
disconnect
(
this
,
&
FMPePayPrivate
::
finished
,
this
,
&
FMPePayPrivate
::
confirmClicked
);
//
disconnect(this, &FMPePayPrivate::finished, this, &FMPePayPrivate::confirmClicked);
connect
(
this
,
&
FMPePayPrivate
::
error
,
this
,
&
FMPePayPrivate
::
confirmClicked
);
//
connect(this, &FMPePayPrivate::error, this, &FMPePayPrivate::confirmClicked);
});
});
}
}
...
...
fmp_epayview_dialog.cpp
View file @
bdf39390
...
@@ -20,7 +20,8 @@
...
@@ -20,7 +20,8 @@
FMPPayDialog
::
FMPPayDialog
(
FMPePayPrivate
*
control
,
QVariantHash
basicinfo
,
QWidget
*
parent
)
:
FMPPayDialog
::
FMPPayDialog
(
FMPePayPrivate
*
control
,
QVariantHash
basicinfo
,
QWidget
*
parent
)
:
_control
(
control
),
_control
(
control
),
QDialog
(
parent
),
QDialog
(
parent
),
ui
(
new
Ui
::
FMPPayDialog
)
ui
(
new
Ui
::
FMPPayDialog
),
_isConfirmRefund
(
false
)
{
{
ui
->
setupUi
(
this
);
ui
->
setupUi
(
this
);
...
@@ -166,6 +167,7 @@ FMPPayDialog::FMPPayDialog(FMPePayPrivate *control, QVariantHash basicinfo, QWid
...
@@ -166,6 +167,7 @@ FMPPayDialog::FMPPayDialog(FMPePayPrivate *control, QVariantHash basicinfo, QWid
ui
->
lineedit_code_refund
->
setFocus
();
ui
->
lineedit_code_refund
->
setFocus
();
ui
->
lineedit_num_refund
->
setText
(
QString
::
number
(
basicinfo
[
"amount"
].
toDouble
()
/
100
));
ui
->
lineedit_num_refund
->
setText
(
QString
::
number
(
basicinfo
[
"amount"
].
toDouble
()
/
100
));
ui
->
lineedit_num_refund
->
setEnabled
(
false
);
ui
->
lineedit_num_refund
->
setEnabled
(
false
);
ui
->
lineedit_code_refund
->
setText
(
basicinfo
[
FMP_JKEY_FM_ORDERID
].
toString
());
}
}
if
(
basicinfo
[
"fm_cmd"
].
toInt
()
==
10031
||
basicinfo
[
"fm_cmd"
].
toInt
()
==
10041
)
{
if
(
basicinfo
[
"fm_cmd"
].
toInt
()
==
10031
||
basicinfo
[
"fm_cmd"
].
toInt
()
==
10041
)
{
...
@@ -185,6 +187,12 @@ int FMPPayDialog::getPayAmount() const
...
@@ -185,6 +187,12 @@ int FMPPayDialog::getPayAmount() const
return
amount
;
return
amount
;
}
}
void
FMPPayDialog
::
confirmRefund
()
{
_isConfirmRefund
=
true
;
onBtnConfirmClicked
();
}
void
FMPPayDialog
::
show
()
void
FMPPayDialog
::
show
()
{
{
...
@@ -422,6 +430,7 @@ void FMPPayDialog::setRefundSuccessView(QJsonObject json)
...
@@ -422,6 +430,7 @@ void FMPPayDialog::setRefundSuccessView(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
::
setPayView
()
void
FMPPayDialog
::
setPayView
()
...
@@ -613,23 +622,26 @@ void FMPPayDialog::onBtnConfirmClicked()
...
@@ -613,23 +622,26 @@ void FMPPayDialog::onBtnConfirmClicked()
_wait
->
setFocus
();
_wait
->
setFocus
();
}
}
if
(
_isConfirmRefund
)
{
if
((
ui
->
lineedit_num
->
text
()
==
""
&&
ui
->
lineedit_num_refund
->
text
()
==
""
)
||
_isConfirmRefund
=
false
;
(
ui
->
lineedit_num
->
text
().
toDouble
()
<
0.01
&&
ui
->
lineedit_num_refund
->
text
().
toDouble
()
<
0.01
)
||
}
else
{
(
ui
->
lineedit_code
->
text
()
==
""
&&
ui
->
lineedit_code_refund
->
text
()
==
""
)
||
if
((
ui
->
lineedit_num
->
text
()
==
""
&&
ui
->
lineedit_num_refund
->
text
()
==
""
)
||
(
ui
->
lineedit_code
->
text
().
size
()
<
15
&&
ui
->
lineedit_code_refund
->
text
().
size
()
<
15
)
(
ui
->
lineedit_num
->
text
().
toDouble
()
<
0.01
&&
ui
->
lineedit_num_refund
->
text
().
toDouble
()
<
0.01
)
||
)
(
ui
->
lineedit_code
->
text
()
==
""
&&
ui
->
lineedit_code_refund
->
text
()
==
""
)
||
{
(
ui
->
lineedit_code
->
text
().
size
()
<
15
&&
ui
->
lineedit_code_refund
->
text
().
size
()
<
15
)
// if (!_is_api) {
)
// ui->lineedit_num->clear();
{
// ui->lineedit_num_refund->clear();
// if (!_is_api) {
// }
// ui->lineedit_num->clear();
ui
->
lineedit_code
->
clear
();
// ui->lineedit_num_refund->clear();
ui
->
lineedit_code_refund
->
clear
();
// }
_wait
->
SetContent
(
FMPPayWait
::
ERRORS
,
QString
::
fromLocal8Bit
(
"金额或条码错误
\n
请重新输入"
));
ui
->
lineedit_code
->
clear
();
_wait
->
show
();
ui
->
lineedit_code_refund
->
clear
();
_current_LineEdit
->
setFocus
();
_wait
->
SetContent
(
FMPPayWait
::
ERRORS
,
QString
::
fromLocal8Bit
(
"金额或条码错误
\n
请重新输入"
));
return
;
_wait
->
show
();
_current_LineEdit
->
setFocus
();
return
;
}
}
}
...
...
fmp_epayview_dialog.h
View file @
bdf39390
...
@@ -42,6 +42,8 @@ public:
...
@@ -42,6 +42,8 @@ public:
int
getPayAmount
()
const
;
int
getPayAmount
()
const
;
void
confirmRefund
();
public
slots
:
public
slots
:
void
showErrorMsg
(
QString
errormsg
);
void
showErrorMsg
(
QString
errormsg
);
...
@@ -128,6 +130,7 @@ private:
...
@@ -128,6 +130,7 @@ private:
QPoint
_mMovePosition
;
QPoint
_mMovePosition
;
QTimer
*
_wnd_close_timer
;
QTimer
*
_wnd_close_timer
;
int
_seconds
;
int
_seconds
;
bool
_isConfirmRefund
;
};
};
#endif // DIALOG_H
#endif // DIALOG_H
version.h
View file @
bdf39390
...
@@ -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
5
#define VER_BUILD 2
7
//! 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