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
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
133 additions
and
14 deletions
+133
-14
sbkpay/control.cpp
+0
-2
sbkpay/hostwidget.cpp
+36
-6
sbkpay/hostwidget.h
+6
-0
sbkpay/hostwidget.ui
+79
-2
sbkpay/jsonfactory.h
+11
-3
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,
QString
url
=
_setting
.
GetValue
(
VALUE_URL
,
""
).
toString
();
QLOG_INFO
()
<<
"send json to payment: "
<<
json
;
QByteArray
data
=
QJsonDocument
(
json
).
toJson
(
QJsonDocument
::
Compact
);
#ifdef MOCK_SIMPHONY
...
...
sbkpay/hostwidget.cpp
View file @
dea23c24
...
...
@@ -8,10 +8,12 @@
#include <QMovie>
#include <QDateTime>
#include <QJsonArray>
#include <QButtonGroup>
HostWidget
::
HostWidget
(
QWidget
*
parent
)
:
FMPWindow
(
parent
),
ui
(
new
Ui
::
HostWidget
)
ui
(
new
Ui
::
HostWidget
),
_paymentMethodBtns
(
new
QButtonGroup
(
this
))
{
ui
->
setupUi
(
this
);
...
...
@@ -62,6 +64,12 @@ HostWidget::HostWidget(QWidget *parent) :
ui
->
tableWidget
->
verticalHeader
()
->
setDefaultSectionSize
(
45
);
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
)
...
...
@@ -115,6 +123,7 @@ HostWidget::~HostWidget()
delete
_label_pay_timer
;
_label_pay_timer
=
NULL
;
}
delete
_paymentMethodBtns
;
}
void
HostWidget
::
keyPressEvent
(
QKeyEvent
*
ke
)
...
...
@@ -152,7 +161,7 @@ void HostWidget::ShowPayWidget()
}
else
{
// ui->label_pay_title->setText(QString::fromLocal8Bit("
支付宝
退款中..."));
// ui->label_pay_title->setText(QString::fromLocal8Bit("退款中..."));
// emit RequestWithType(refund, list);
}
...
...
@@ -178,7 +187,7 @@ void HostWidget::ShowWithRequest(AlipayRequest request)
ShowWidget
(
ui
->
pay
);
_curr_show_widget
=
ui
->
pay
;
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
->
label_pay_money
->
setText
(
QString
::
fromLocal8Bit
(
"需收取 ¥ %1"
).
arg
(
Amount
));
}
...
...
@@ -203,7 +212,7 @@ void HostWidget::ShowWithRequest(AlipayRequest request)
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
);
}
...
...
@@ -348,6 +357,13 @@ void HostWidget::ShowWithRequest(POSType posType, QJsonObject requestObj)
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
);
ui
->
horizontalLayout_manager
->
setSpacing
(
spacing
);
...
...
@@ -368,7 +384,7 @@ void HostWidget::ShowWithRequest(POSType posType, QJsonObject requestObj)
QString
reqCode
=
requestObj
[
JSON_KEY_CODE
].
toString
(
""
);
if
(
reqCode
.
isEmpty
())
{
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
->
label_pay_money
->
setText
(
QString
::
fromLocal8Bit
(
"需收取 ¥ %1"
).
arg
(
Amount
));
}
else
{
...
...
@@ -407,7 +423,7 @@ void HostWidget::ShowWithRequest(POSType posType, QJsonObject requestObj)
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
);
break
;
}
...
...
@@ -749,6 +765,8 @@ void HostWidget::on_btn_find_check_clicked()
list
.
append
(
ui
->
dateEdit_find_begin
->
text
().
replace
(
"/"
,
"-"
));
list
.
append
(
ui
->
dateEdit_find_end
->
text
().
replace
(
"/"
,
"-"
));
list
.
append
(
ui
->
label_find_page
->
text
());
list
.
append
(
_paymentMethodBtns
->
checkedButton
()
->
text
());
qDebug
()
<<
"Find list: "
<<
list
;
_label_find_timer
->
start
();
emit
RequestWithType
(
finds
,
list
);
}
...
...
@@ -808,3 +826,15 @@ void HostWidget::StopPay()
ui
->
btn_pay_exitint
->
hide
();
_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 @@
class
LabelsTimer
;
class
QMovie
;
class
QButtonGroup
;
class
QAbstractButton
;
namespace
Ui
{
class
HostWidget
;
...
...
@@ -86,6 +88,8 @@ private slots:
void
on_btn_pay_exitint_clicked
();
void
onPaymentMethodBtnsToggled
(
QAbstractButton
*
,
bool
);
private
:
void
ShowWidget
(
QWidget
*
showwidget
);
...
...
@@ -113,6 +117,8 @@ private:
QMovie
*
_label_pay_movie
;
QButtonGroup
*
_paymentMethodBtns
;
int
_line
;
bool
_need_exit
;
...
...
sbkpay/hostwidget.ui
View file @
dea23c24
...
...
@@ -6,7 +6,7 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
2
511
</width>
<width>
2
977
</width>
<height>
839
</height>
</rect>
</property>
...
...
@@ -552,6 +552,83 @@
</spacer>
</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"
>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
#label_find_begin
...
...
@@ -1254,7 +1331,7 @@ QHeaderView::section{
}
</string>
</property>
<property
name=
"text"
>
<string>
请扫描支付
宝
二维码
</string>
<string>
请扫描支付二维码
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
...
...
sbkpay/jsonfactory.h
View file @
dea23c24
...
...
@@ -262,7 +262,7 @@ private:
//查询流水
static
bool
GetFindJson
(
QJsonObject
&
json
,
const
AlipayRequest
&
request
,
QStringList
list
)
{
if
(
list
.
size
()
!=
3
||
list
[
0
].
isEmpty
()
||
list
[
1
].
isEmpty
())
if
(
list
.
size
()
!=
4
||
list
[
0
].
isEmpty
()
||
list
[
1
].
isEmpty
())
return
false
;
QString
tmp0
=
list
[
0
];
...
...
@@ -290,12 +290,13 @@ private:
}
static
bool
GetFindJson
(
QJsonObject
&
json
,
const
QJsonObject
&
request
,
QStringList
list
)
{
if
(
list
.
size
()
!=
3
||
list
[
0
].
isEmpty
()
||
list
[
1
].
isEmpty
())
if
(
list
.
size
()
!=
4
||
list
[
0
].
isEmpty
()
||
list
[
1
].
isEmpty
())
return
false
;
QString
tmp0
=
list
[
0
];
QString
tmp1
=
list
[
1
];
QString
tmp2
=
list
[
2
];
QString
tmpPayMethod
=
list
[
3
];
QString
cur
=
QDateTime
::
currentDateTime
().
toString
(
"hh:mm:ss"
);
...
...
@@ -312,7 +313,14 @@ private:
json
.
insert
(
JSON_KEY_ENDTIME
,
tmp1
);
json
.
insert
(
JSON_KEY_PAGESIZE
,
10
);
json
.
insert
(
JSON_KEY_PAGENUM
,
tmp2
.
toInt
());
json
.
insert
(
JSON_KEY_METHCODE
,
10001
);
int
paymentMethod
=
10001
;
if
(
tmpPayMethod
==
QString
::
fromLocal8Bit
(
"支付宝"
))
{
paymentMethod
=
10001
;
}
else
if
(
tmpPayMethod
==
QString
::
fromLocal8Bit
(
"微信支付"
))
{
paymentMethod
=
10004
;
}
json
[
JSON_KEY_METHCODE
]
=
paymentMethod
;
return
true
;
}
...
...
sbkpay/version.h
View file @
dea23c24
...
...
@@ -3,7 +3,7 @@
#define VER_MAJOR 0
#define VER_MINOR 2
#define VER_REVISION
4
#define VER_REVISION
5
#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