Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sbkpay
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
sbkpay
Commits
dea23c24
Commit
dea23c24
authored
Nov 07, 2017
by
NitefullWind
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 流水查询区分支付宝和微信。 2. 修改部分提示语。
parent
216ee36f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
122 additions
and
11 deletions
+122
-11
sbkpay/control.cpp
+0
-2
sbkpay/hostwidget.cpp
+36
-6
sbkpay/hostwidget.h
+6
-0
sbkpay/hostwidget.ui
+79
-2
sbkpay/jsonfactory.h
+0
-0
sbkpay/version.h
+1
-1
No files found.
sbkpay/control.cpp
View file @
dea23c24
...
@@ -230,8 +230,6 @@ bool Control::SendMessageToPayMent(const QJsonObject &json, QByteArray &outdata,
...
@@ -230,8 +230,6 @@ bool Control::SendMessageToPayMent(const QJsonObject &json, QByteArray &outdata,
QString
url
=
_setting
.
GetValue
(
VALUE_URL
,
""
).
toString
();
QString
url
=
_setting
.
GetValue
(
VALUE_URL
,
""
).
toString
();
QLOG_INFO
()
<<
"send json to payment: "
<<
json
;
QByteArray
data
=
QJsonDocument
(
json
).
toJson
(
QJsonDocument
::
Compact
);
QByteArray
data
=
QJsonDocument
(
json
).
toJson
(
QJsonDocument
::
Compact
);
#ifdef MOCK_SIMPHONY
#ifdef MOCK_SIMPHONY
...
...
sbkpay/hostwidget.cpp
View file @
dea23c24
...
@@ -8,10 +8,12 @@
...
@@ -8,10 +8,12 @@
#include <QMovie>
#include <QMovie>
#include <QDateTime>
#include <QDateTime>
#include <QJsonArray>
#include <QJsonArray>
#include <QButtonGroup>
HostWidget
::
HostWidget
(
QWidget
*
parent
)
:
HostWidget
::
HostWidget
(
QWidget
*
parent
)
:
FMPWindow
(
parent
),
FMPWindow
(
parent
),
ui
(
new
Ui
::
HostWidget
)
ui
(
new
Ui
::
HostWidget
),
_paymentMethodBtns
(
new
QButtonGroup
(
this
))
{
{
ui
->
setupUi
(
this
);
ui
->
setupUi
(
this
);
...
@@ -62,6 +64,12 @@ HostWidget::HostWidget(QWidget *parent) :
...
@@ -62,6 +64,12 @@ HostWidget::HostWidget(QWidget *parent) :
ui
->
tableWidget
->
verticalHeader
()
->
setDefaultSectionSize
(
45
);
ui
->
tableWidget
->
verticalHeader
()
->
setDefaultSectionSize
(
45
);
ui
->
btn_mananger_print_shift
->
setVisible
(
false
);
ui
->
btn_mananger_print_shift
->
setVisible
(
false
);
_paymentMethodBtns
->
setExclusive
(
true
);
_paymentMethodBtns
->
addButton
(
ui
->
btn_payment_method_ali
,
0
);
_paymentMethodBtns
->
addButton
(
ui
->
btn_payment_method_wx
,
1
);
connect
(
_paymentMethodBtns
,
SIGNAL
(
buttonToggled
(
QAbstractButton
*
,
bool
)),
this
,
SLOT
(
onPaymentMethodBtnsToggled
(
QAbstractButton
*
,
bool
)));
}
}
void
HostWidget
::
ShowWidget
(
QWidget
*
showwidget
)
void
HostWidget
::
ShowWidget
(
QWidget
*
showwidget
)
...
@@ -115,6 +123,7 @@ HostWidget::~HostWidget()
...
@@ -115,6 +123,7 @@ HostWidget::~HostWidget()
delete
_label_pay_timer
;
delete
_label_pay_timer
;
_label_pay_timer
=
NULL
;
_label_pay_timer
=
NULL
;
}
}
delete
_paymentMethodBtns
;
}
}
void
HostWidget
::
keyPressEvent
(
QKeyEvent
*
ke
)
void
HostWidget
::
keyPressEvent
(
QKeyEvent
*
ke
)
...
@@ -152,7 +161,7 @@ void HostWidget::ShowPayWidget()
...
@@ -152,7 +161,7 @@ void HostWidget::ShowPayWidget()
}
}
else
else
{
{
// ui->label_pay_title->setText(QString::fromLocal8Bit("
支付宝
退款中..."));
// ui->label_pay_title->setText(QString::fromLocal8Bit("退款中..."));
// emit RequestWithType(refund, list);
// emit RequestWithType(refund, list);
}
}
...
@@ -178,7 +187,7 @@ void HostWidget::ShowWithRequest(AlipayRequest request)
...
@@ -178,7 +187,7 @@ void HostWidget::ShowWithRequest(AlipayRequest request)
ShowWidget
(
ui
->
pay
);
ShowWidget
(
ui
->
pay
);
_curr_show_widget
=
ui
->
pay
;
_curr_show_widget
=
ui
->
pay
;
double
Amount
=
FMTool
::
GetString
(
_data
.
Amount
,
12
).
toInt
()
/
100.0
;
double
Amount
=
FMTool
::
GetString
(
_data
.
Amount
,
12
).
toInt
()
/
100.0
;
ui
->
label_pay_title
->
setText
(
QString
::
fromLocal8Bit
(
"请扫描支付
宝
二维码"
));
ui
->
label_pay_title
->
setText
(
QString
::
fromLocal8Bit
(
"请扫描支付二维码"
));
ui
->
btn_pay_exit
->
setText
(
QString
::
fromLocal8Bit
(
"取消支付"
));
ui
->
btn_pay_exit
->
setText
(
QString
::
fromLocal8Bit
(
"取消支付"
));
ui
->
label_pay_money
->
setText
(
QString
::
fromLocal8Bit
(
"需收取 ¥ %1"
).
arg
(
Amount
));
ui
->
label_pay_money
->
setText
(
QString
::
fromLocal8Bit
(
"需收取 ¥ %1"
).
arg
(
Amount
));
}
}
...
@@ -203,7 +212,7 @@ void HostWidget::ShowWithRequest(AlipayRequest request)
...
@@ -203,7 +212,7 @@ void HostWidget::ShowWithRequest(AlipayRequest request)
list
.
append
(
FMTool
::
GetString
(
request
.
OriginTrace
,
64
));
list
.
append
(
FMTool
::
GetString
(
request
.
OriginTrace
,
64
));
ui
->
label_pay_title
->
setText
(
QString
::
fromLocal8Bit
(
"
支付宝
退款中..."
));
ui
->
label_pay_title
->
setText
(
QString
::
fromLocal8Bit
(
"退款中..."
));
emit
RequestWithType
(
refund
,
list
);
emit
RequestWithType
(
refund
,
list
);
}
}
...
@@ -348,6 +357,13 @@ void HostWidget::ShowWithRequest(POSType posType, QJsonObject requestObj)
...
@@ -348,6 +357,13 @@ void HostWidget::ShowWithRequest(POSType posType, QJsonObject requestObj)
ui
->
btn_mananger_print_shift
->
setMinimumSize
(
0
,
0
);
ui
->
btn_mananger_print_shift
->
setMinimumSize
(
0
,
0
);
}
}
if
(
_posType
==
SIMPHONY
)
{
btnNums
=
2
;
ui
->
btn_mananger_print
->
setVisible
(
false
);
ui
->
btn_mananger_print
->
setMaximumSize
(
0
,
0
);
ui
->
btn_mananger_print
->
setMinimumSize
(
0
,
0
);
}
int
spacing
=
(
qApp
->
desktop
()
->
availableGeometry
().
width
()
-
ui
->
btn_mananger_register
->
width
()
*
btnNums
)
/
(
btnNums
+
2
);
int
spacing
=
(
qApp
->
desktop
()
->
availableGeometry
().
width
()
-
ui
->
btn_mananger_register
->
width
()
*
btnNums
)
/
(
btnNums
+
2
);
ui
->
horizontalLayout_manager
->
setSpacing
(
spacing
);
ui
->
horizontalLayout_manager
->
setSpacing
(
spacing
);
...
@@ -368,7 +384,7 @@ void HostWidget::ShowWithRequest(POSType posType, QJsonObject requestObj)
...
@@ -368,7 +384,7 @@ void HostWidget::ShowWithRequest(POSType posType, QJsonObject requestObj)
QString
reqCode
=
requestObj
[
JSON_KEY_CODE
].
toString
(
""
);
QString
reqCode
=
requestObj
[
JSON_KEY_CODE
].
toString
(
""
);
if
(
reqCode
.
isEmpty
())
{
if
(
reqCode
.
isEmpty
())
{
double
Amount
=
FMTool
::
GetJsonValue
(
requestObj
,
JSON_KEY_TRANSAMOUNT
).
toInt
()
/
100.0
;
double
Amount
=
FMTool
::
GetJsonValue
(
requestObj
,
JSON_KEY_TRANSAMOUNT
).
toInt
()
/
100.0
;
ui
->
label_pay_title
->
setText
(
QString
::
fromLocal8Bit
(
"请扫描支付
宝
二维码"
));
ui
->
label_pay_title
->
setText
(
QString
::
fromLocal8Bit
(
"请扫描支付二维码"
));
ui
->
btn_pay_exit
->
setText
(
QString
::
fromLocal8Bit
(
"取消支付"
));
ui
->
btn_pay_exit
->
setText
(
QString
::
fromLocal8Bit
(
"取消支付"
));
ui
->
label_pay_money
->
setText
(
QString
::
fromLocal8Bit
(
"需收取 ¥ %1"
).
arg
(
Amount
));
ui
->
label_pay_money
->
setText
(
QString
::
fromLocal8Bit
(
"需收取 ¥ %1"
).
arg
(
Amount
));
}
else
{
}
else
{
...
@@ -407,7 +423,7 @@ void HostWidget::ShowWithRequest(POSType posType, QJsonObject requestObj)
...
@@ -407,7 +423,7 @@ void HostWidget::ShowWithRequest(POSType posType, QJsonObject requestObj)
list
.
append
(
FMTool
::
GetJsonValue
(
requestObj
,
JSON_KEY_FMID
).
toString
());
list
.
append
(
FMTool
::
GetJsonValue
(
requestObj
,
JSON_KEY_FMID
).
toString
());
ui
->
label_pay_title
->
setText
(
QString
::
fromLocal8Bit
(
"
支付宝
退款中..."
));
ui
->
label_pay_title
->
setText
(
QString
::
fromLocal8Bit
(
"退款中..."
));
emit
RequestWithType
(
refund
,
list
);
emit
RequestWithType
(
refund
,
list
);
break
;
break
;
}
}
...
@@ -749,6 +765,8 @@ void HostWidget::on_btn_find_check_clicked()
...
@@ -749,6 +765,8 @@ void HostWidget::on_btn_find_check_clicked()
list
.
append
(
ui
->
dateEdit_find_begin
->
text
().
replace
(
"/"
,
"-"
));
list
.
append
(
ui
->
dateEdit_find_begin
->
text
().
replace
(
"/"
,
"-"
));
list
.
append
(
ui
->
dateEdit_find_end
->
text
().
replace
(
"/"
,
"-"
));
list
.
append
(
ui
->
dateEdit_find_end
->
text
().
replace
(
"/"
,
"-"
));
list
.
append
(
ui
->
label_find_page
->
text
());
list
.
append
(
ui
->
label_find_page
->
text
());
list
.
append
(
_paymentMethodBtns
->
checkedButton
()
->
text
());
qDebug
()
<<
"Find list: "
<<
list
;
_label_find_timer
->
start
();
_label_find_timer
->
start
();
emit
RequestWithType
(
finds
,
list
);
emit
RequestWithType
(
finds
,
list
);
}
}
...
@@ -808,3 +826,15 @@ void HostWidget::StopPay()
...
@@ -808,3 +826,15 @@ void HostWidget::StopPay()
ui
->
btn_pay_exitint
->
hide
();
ui
->
btn_pay_exitint
->
hide
();
_label_pay_timer
->
start
(
60
,
QString
::
fromLocal8Bit
(
"%1 秒"
));
_label_pay_timer
->
start
(
60
,
QString
::
fromLocal8Bit
(
"%1 秒"
));
}
}
void
HostWidget
::
onPaymentMethodBtnsToggled
(
QAbstractButton
*
button
,
bool
checked
)
{
static
QString
style_checked
(
"#%1{border:0px;border-radius:2px;background-color:rgb(0,179,238);font:75 20px
\"
MicrosoftYaHeiUILight
\"
;max-height:35px;max-width:100px;min-height:35px;min-width:100px;}"
);
static
QString
style_unchecked
(
"#%2{border:0px;border-radius:2px;background-color:rgb(150, 150, 150);font:75 20px
\"
MicrosoftYaHeiUILight
\"
;max-height:35px;max-width:100px;min-height:35px;min-width:100px;}"
);
if
(
checked
)
{
button
->
setStyleSheet
(
style_checked
.
arg
(
button
->
objectName
()));
}
else
{
button
->
setStyleSheet
(
style_unchecked
.
arg
(
button
->
objectName
()));
}
}
sbkpay/hostwidget.h
View file @
dea23c24
...
@@ -11,6 +11,8 @@
...
@@ -11,6 +11,8 @@
class
LabelsTimer
;
class
LabelsTimer
;
class
QMovie
;
class
QMovie
;
class
QButtonGroup
;
class
QAbstractButton
;
namespace
Ui
{
namespace
Ui
{
class
HostWidget
;
class
HostWidget
;
...
@@ -86,6 +88,8 @@ private slots:
...
@@ -86,6 +88,8 @@ private slots:
void
on_btn_pay_exitint_clicked
();
void
on_btn_pay_exitint_clicked
();
void
onPaymentMethodBtnsToggled
(
QAbstractButton
*
,
bool
);
private
:
private
:
void
ShowWidget
(
QWidget
*
showwidget
);
void
ShowWidget
(
QWidget
*
showwidget
);
...
@@ -113,6 +117,8 @@ private:
...
@@ -113,6 +117,8 @@ private:
QMovie
*
_label_pay_movie
;
QMovie
*
_label_pay_movie
;
QButtonGroup
*
_paymentMethodBtns
;
int
_line
;
int
_line
;
bool
_need_exit
;
bool
_need_exit
;
...
...
sbkpay/hostwidget.ui
View file @
dea23c24
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<rect>
<rect>
<x>
0
</x>
<x>
0
</x>
<y>
0
</y>
<y>
0
</y>
<width>
2
511
</width>
<width>
2
977
</width>
<height>
839
</height>
<height>
839
</height>
</rect>
</rect>
</property>
</property>
...
@@ -552,6 +552,83 @@
...
@@ -552,6 +552,83 @@
</spacer>
</spacer>
</item>
</item>
<item>
<item>
<widget
class=
"QPushButton"
name=
"btn_payment_method_ali"
>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
#btn_payment_method_ali
{
border:0px;
border-radius:2px;
background-color: rgb(0, 179, 238);
font: 75 20px
"
Microsoft YaHei UI Light
"
;
max-height: 35px; max-width: 100px;
min-height: 35px; min-width: 100px;
}
</string>
</property>
<property
name=
"text"
>
<string>
支付宝
</string>
</property>
<property
name=
"checkable"
>
<bool>
true
</bool>
</property>
<property
name=
"checked"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item>
<spacer
name=
"horizontalSpacer_2"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeType"
>
<enum>
QSizePolicy::Maximum
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
<item>
<widget
class=
"QPushButton"
name=
"btn_payment_method_wx"
>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
#btn_payment_method_wx
{
border:0px;
border-radius:2px;
background-color: rgb(150, 150, 150);
font: 75 20px
"
Microsoft YaHei UI Light
"
;
max-height: 35px; max-width: 100px;
min-height: 35px; min-width: 100px;
}
</string>
</property>
<property
name=
"text"
>
<string>
微信支付
</string>
</property>
<property
name=
"checkable"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item>
<spacer
name=
"horizontalSpacer_4"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeType"
>
<enum>
QSizePolicy::Maximum
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
<item>
<widget
class=
"QLabel"
name=
"label_find_begin"
>
<widget
class=
"QLabel"
name=
"label_find_begin"
>
<property
name=
"styleSheet"
>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
#label_find_begin
<string
notr=
"true"
>
#label_find_begin
...
@@ -1254,7 +1331,7 @@ QHeaderView::section{
...
@@ -1254,7 +1331,7 @@ QHeaderView::section{
}
</string>
}
</string>
</property>
</property>
<property
name=
"text"
>
<property
name=
"text"
>
<string>
请扫描支付
宝
二维码
</string>
<string>
请扫描支付二维码
</string>
</property>
</property>
<property
name=
"alignment"
>
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
<set>
Qt::AlignCenter
</set>
...
...
sbkpay/jsonfactory.h
View file @
dea23c24
This diff is collapsed.
Click to expand it.
sbkpay/version.h
View file @
dea23c24
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
#define VER_MAJOR 0
#define VER_MAJOR 0
#define VER_MINOR 2
#define VER_MINOR 2
#define VER_REVISION
4
#define VER_REVISION
5
#define VER_BUILD 0
#define VER_BUILD 0
...
...
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