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
d0e9a90d
Commit
d0e9a90d
authored
Jan 05, 2018
by
NitefullWind
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 实现流水查询中卡券和第三方不同的表格头。 2. 优化界面。
parent
caacb832
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
103 additions
and
48 deletions
+103
-48
sbkpay/DataProcess/fmglobal.h
+2
-0
sbkpay/hostwidget.cpp
+63
-43
sbkpay/hostwidget.h
+4
-2
sbkpay/hostwidget.ui
+30
-3
sbkpay/res.qrc
+1
-0
sbkpay/res/drop-down.png
+0
-0
sbkpay/sbkpay.pri
+3
-0
No files found.
sbkpay/DataProcess/fmglobal.h
View file @
d0e9a90d
...
...
@@ -78,5 +78,7 @@ typedef enum
#define CONFIG_LOG_SIZE "LOG/SIZE"
#define CONFIG_LOG_COUNT "LOG/COUNT"
#define CONFIG_PAYMENT_METHODS "PaymentMethods"
#define CONFIG_PAYMENT_METHODS_THIRD "PaymentMethodsThird"
#define CONFIG_PAYMENT_METHODS_COUPON "PaymentMethodsCoupon"
#endif
sbkpay/hostwidget.cpp
View file @
d0e9a90d
...
...
@@ -102,7 +102,7 @@ void HostWidget::InitWidget()
}
// Init manage page.
_posType
=
(
POSType
)
setting
.
GetValue
(
CONFIG_ALL_PARTNER
,
SIMPHONY
).
toInt
();
_posType
=
(
POSType
)
_
setting
.
GetValue
(
CONFIG_ALL_PARTNER
,
SIMPHONY
).
toInt
();
int
btnNums
=
3
;
...
...
@@ -132,12 +132,18 @@ void HostWidget::InitWidget()
int
spacing
=
(
qApp
->
desktop
()
->
availableGeometry
().
width
()
-
ui
->
btn_mananger_register
->
width
()
*
btnNums
)
/
(
btnNums
+
2
);
ui
->
horizontalLayout_manager
->
setSpacing
(
spacing
);
QStringList
payCodes
=
setting
.
GetAllKeys
(
CONFIG_PAYMENT_METHODS
);
QStringList
payCodes
=
_setting
.
GetAllKeys
(
CONFIG_PAYMENT_METHODS_THIRD
);
foreach
(
QString
payCode
,
payCodes
)
{
QString
payStr
=
setting
.
GetValue
(
QString
(
"%1/%2"
).
arg
(
CONFIG_PAYMENT_METHODS
).
arg
(
payCode
),
""
).
toString
();
_paymentMethodsMap
.
insert
(
payStr
,
payCode
);
QString
payStr
=
_setting
.
GetValue
(
QString
(
"%1/%2"
).
arg
(
CONFIG_PAYMENT_METHODS_THIRD
).
arg
(
payCode
),
""
).
toString
();
_paymentMethodsMap
Third
.
insert
(
payStr
,
payCode
);
ui
->
comBox_payment_method
->
addItem
(
payStr
);
}
payCodes
=
_setting
.
GetAllKeys
(
CONFIG_PAYMENT_METHODS_COUPON
);
foreach
(
QString
payCode
,
payCodes
)
{
QString
payStr
=
_setting
.
GetValue
(
QString
(
"%1/%2"
).
arg
(
CONFIG_PAYMENT_METHODS_COUPON
).
arg
(
payCode
),
""
).
toString
();
_paymentMethodsMapCoupon
.
insert
(
payStr
,
payCode
);
ui
->
comBox_payment_method
->
addItem
(
payStr
);
}
}
void
HostWidget
::
setRuning
(
bool
runing
)
...
...
@@ -727,44 +733,7 @@ void HostWidget::on_btn_find_check_clicked()
QStringList
list
;
ui
->
tableWidget
->
clear
();
QStringList
headerString
;
QList
<
double
>
widthScale
;
headerString
<<
QString
::
fromLocal8Bit
(
"订单编号"
)
<<
QString
::
fromLocal8Bit
(
"订单金额"
)
<<
QString
::
fromLocal8Bit
(
"订单时间"
)
<<
QString
::
fromLocal8Bit
(
"支付状态"
);
//NOTE 显示支付渠道
// if(_posType == SIMPHONY) {
// headerString << QString::fromLocal8Bit("支付渠道");
// }
if
(
_posType
!=
SPCC
)
{
headerString
<<
QString
::
fromLocal8Bit
(
"操作"
);
}
switch
(
headerString
.
length
())
{
case
4
:
widthScale
<<
0.39
<<
0.18
<<
0.25
<<
0.18
;
break
;
case
5
:
widthScale
<<
0.35
<<
0.15
<<
0.21
<<
0.15
<<
0.14
;
break
;
case
6
:
widthScale
<<
0.32
<<
0.13
<<
0.18
<<
0.13
<<
0.12
<<
0.12
;
break
;
default
:
break
;
}
int
width
=
ui
->
widget_find_main
->
width
()
-
4
;
ui
->
tableWidget
->
horizontalHeader
()
->
setStyleSheet
(
"QHeaderView::section{border: 0px;font: 75 18px
\"
Microsoft YaHei UI Light
\"
;}"
);
ui
->
tableWidget
->
horizontalHeader
()
->
setFixedHeight
(
25
);
//设置表头的高度
ui
->
tableWidget
->
setColumnCount
(
headerString
.
length
());
for
(
int
i
=
0
;
i
<
headerString
.
length
();
i
++
)
{
ui
->
tableWidget
->
setColumnWidth
(
i
,
widthScale
[
i
]
*
width
);
}
ui
->
tableWidget
->
setHorizontalHeaderLabels
(
headerString
);
SetTableWidgetHeader
();
ui
->
frame
->
hide
();
ui
->
widget_check_load
->
show
();
...
...
@@ -775,7 +744,13 @@ void HostWidget::on_btn_find_check_clicked()
// 支付方式code
QString
currPaymentMethod
=
ui
->
comBox_payment_method
->
currentText
();
list
.
append
(
_paymentMethodsMap
[
currPaymentMethod
]);
QString
payCode
;
if
(
_paymentMethodsMapThird
.
contains
(
currPaymentMethod
))
{
payCode
=
_paymentMethodsMapThird
[
currPaymentMethod
];
}
else
{
payCode
=
_paymentMethodsMapCoupon
[
currPaymentMethod
];
}
list
.
append
(
payCode
);
qDebug
()
<<
"Find list: "
<<
list
;
_label_find_timer
->
start
();
...
...
@@ -849,3 +824,48 @@ void HostWidget::onPaymentMethodBtnsToggled(QAbstractButton *button, bool checke
button
->
setStyleSheet
(
style_unchecked
.
arg
(
button
->
objectName
()));
}
}
void
HostWidget
::
SetTableWidgetHeader
()
{
QStringList
headerString
;
QList
<
double
>
widthScale
;
QString
currPayStr
=
ui
->
comBox_payment_method
->
currentText
();
if
(
_paymentMethodsMapThird
.
contains
(
currPayStr
))
{
headerString
<<
QString
::
fromLocal8Bit
(
"订单编号"
)
<<
QString
::
fromLocal8Bit
(
"订单金额"
)
<<
QString
::
fromLocal8Bit
(
"订单时间"
)
<<
QString
::
fromLocal8Bit
(
"支付状态"
);
// 只有微信支付和支付宝支付有操作列,且商户不是SPCC
if
(
_posType
!=
SPCC
&&
(
currPayStr
==
QString
::
fromLocal8Bit
(
"支付宝"
)
||
currPayStr
==
QString
::
fromLocal8Bit
(
"微信支付"
)))
{
headerString
<<
QString
::
fromLocal8Bit
(
"操作"
);
}
}
else
{
headerString
<<
QString
::
fromLocal8Bit
(
"卡券号码"
)
<<
QString
::
fromLocal8Bit
(
"销售单号"
)
<<
QString
::
fromLocal8Bit
(
"授权码"
)
<<
QString
::
fromLocal8Bit
(
"交易金额"
)
<<
QString
::
fromLocal8Bit
(
"交易时间"
)
<<
QString
::
fromLocal8Bit
(
"状态"
);
}
switch
(
headerString
.
length
())
{
case
4
:
widthScale
<<
0.39
<<
0.18
<<
0.25
<<
0.18
;
break
;
case
5
:
widthScale
<<
0.35
<<
0.15
<<
0.21
<<
0.15
<<
0.14
;
break
;
case
6
:
widthScale
<<
0.32
<<
0.13
<<
0.18
<<
0.13
<<
0.12
<<
0.12
;
break
;
default
:
break
;
}
int
width
=
ui
->
widget_find_main
->
width
()
-
4
;
ui
->
tableWidget
->
horizontalHeader
()
->
setStyleSheet
(
"QHeaderView::section{border: 0px;font: 75 18px
\"
Microsoft YaHei UI Light
\"
;}"
);
ui
->
tableWidget
->
horizontalHeader
()
->
setFixedHeight
(
25
);
//设置表头的高度
ui
->
tableWidget
->
setColumnCount
(
headerString
.
length
());
for
(
int
i
=
0
;
i
<
headerString
.
length
();
i
++
)
{
ui
->
tableWidget
->
setColumnWidth
(
i
,
widthScale
[
i
]
*
width
);
}
ui
->
tableWidget
->
setHorizontalHeaderLabels
(
headerString
);
}
sbkpay/hostwidget.h
View file @
d0e9a90d
...
...
@@ -98,10 +98,12 @@ private:
void
ShowPayWidget
();
void
SetTableWidgetHeader
();
private
:
Ui
::
HostWidget
*
ui
;
FMPSettings
setting
;
FMPSettings
_
setting
;
QList
<
QWidget
*>
_widgetlist
;
...
...
@@ -129,7 +131,7 @@ private:
POSType
_posType
;
ReqType
_type
;
QMap
<
QString
,
QString
>
_paymentMethodsMap
;
QMap
<
QString
,
QString
>
_paymentMethodsMap
Third
,
_paymentMethodsMapCoupon
;
};
#endif // HOSTWIDGET_H
sbkpay/hostwidget.ui
View file @
d0e9a90d
...
...
@@ -23,6 +23,28 @@
<string
notr=
"true"
>
#HostWidget
{
background-color: rgb(165, 165, 165);
}
QComboBox,QDateEdit
{
border: 1px solid gray;
border-radius: 3px;
}
QComboBox::drop-down, QDateEdit::drop-down
{
subcontrol-origin: padding;
subcontrol-position: top right;
width: 25px;
border-left-width: 1px;
border-left-color: darkgray;
border-left-style: solid; /* just a single line */
border-top-right-radius: 3px; /* same radius as the QComboBox */
border-bottom-right-radius: 3px;
}
QComboBox::down-arrow, QDateEdit::drop-down {
image: url(:/res/drop-down.png);
}
</string>
</property>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_4"
>
...
...
@@ -557,7 +579,6 @@
<string
notr=
"true"
>
#comBox_payment_method
{
font: 75 20px
"
Microsoft YaHei UI Light
"
;
background-color: rgb(208, 208, 208);
}
</string>
</property>
</widget>
...
...
@@ -619,7 +640,7 @@
<string
notr=
"true"
>
#dateEdit_find_begin
{
font: 75 20px
"
Microsoft YaHei UI Light
"
;
background-color: rgb(208, 208, 208)
;
min-width: 120px
;
}
</string>
</property>
<property
name=
"maximumDate"
>
...
...
@@ -695,9 +716,15 @@
<string
notr=
"true"
>
#dateEdit_find_end
{
font: 75 20px
"
Microsoft YaHei UI Light
"
;
background-color: rgb(208, 208, 208)
;
min-width: 120px
;
}
</string>
</property>
<property
name=
"readOnly"
>
<bool>
false
</bool>
</property>
<property
name=
"displayFormat"
>
<string>
yyyy-MM-dd
</string>
</property>
<property
name=
"calendarPopup"
>
<bool>
true
</bool>
</property>
...
...
sbkpay/res.qrc
View file @
d0e9a90d
...
...
@@ -4,5 +4,6 @@
<file>res/fail.png</file>
<file>res/success.png</file>
<file>res/warning.png</file>
<file>res/drop-down.png</file>
</qresource>
</RCC>
sbkpay/res/drop-down.png
0 → 100644
View file @
d0e9a90d
203 Bytes
sbkpay/sbkpay.pri
View file @
d0e9a90d
...
...
@@ -29,3 +29,6 @@ HEADERS += $$PWD/hostwidget.h \
$$PWD/fmp_settings.h
FORMS += $$PWD/hostwidget.ui
RESOURCES += \
$$PWD/res.qrc
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