Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fmPOS
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
fmPOS
Commits
3e83e27d
Commit
3e83e27d
authored
Sep 26, 2018
by
gujin.wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加核销界面文本换行显示
parent
454a4b3b
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
91 additions
and
31 deletions
+91
-31
fmp_redeem/consumokdialog.cpp
+23
-1
fmp_redeem/consumokdialog.h
+3
-0
fmp_redeem/consumokdialog.ui
+4
-4
fmp_redeem/consumptiondialog.cpp
+23
-1
fmp_redeem/consumptiondialog.h
+1
-0
fmp_redeem/couponkeypad.cpp
+5
-3
fmp_redeem/errcodedialog.cpp
+24
-21
fmp_redeem/errcodedialog.h
+3
-1
fmp_redeem/fmp_redeem.cpp
+5
-0
No files found.
fmp_redeem/consumokdialog.cpp
View file @
3e83e27d
...
@@ -25,7 +25,8 @@ void ConsumOkDialog::showConsumOk(const QString& act_name, const QString& code_n
...
@@ -25,7 +25,8 @@ void ConsumOkDialog::showConsumOk(const QString& act_name, const QString& code_n
// v.setGeometry( 0,0,350,470);
// v.setGeometry( 0,0,350,470);
v
.
ui
->
labCode
->
setText
(
coupon
);
v
.
ui
->
labCode
->
setText
(
coupon
);
v
.
ui
->
labActName
->
setText
(
act_name
);
v
.
ui
->
labActName
->
setText
(
v
.
GetLineFeed
(
act_name
));
v
.
ui
->
labTime
->
setText
(
time_name
);
v
.
ui
->
labTime
->
setText
(
time_name
);
v
.
ui
->
labCodeName
->
setText
(
code_name
);
v
.
ui
->
labCodeName
->
setText
(
code_name
);
v
.
exec
();
v
.
exec
();
...
@@ -52,3 +53,24 @@ void ConsumOkDialog::mouseReleaseEvent(QMouseEvent *e)
...
@@ -52,3 +53,24 @@ void ConsumOkDialog::mouseReleaseEvent(QMouseEvent *e)
{
{
mouse_pressed
=
true
;
mouse_pressed
=
true
;
}
}
QString
ConsumOkDialog
::
GetLineFeed
(
const
QString
&
str
)
{
int
w
=
ui
->
labActName
->
width
();
QFontMetrics
fm
=
ui
->
labActName
->
fontMetrics
();
QString
tmp
,
newStr
;
for
(
int
i
=
0
;
i
<
str
.
length
();
i
++
)
{
tmp
.
append
(
str
.
at
(
i
));
int
nw
=
fm
.
width
(
tmp
);
if
(
nw
>=
w
-
20
)
{
tmp
.
append
(
QChar
::
LineFeed
);
newStr
.
append
(
tmp
);
tmp
.
clear
();
}
}
if
(
!
tmp
.
isEmpty
())
newStr
.
append
(
tmp
);
return
newStr
;
}
fmp_redeem/consumokdialog.h
View file @
3e83e27d
...
@@ -23,6 +23,9 @@ protected:
...
@@ -23,6 +23,9 @@ protected:
void
mouseReleaseEvent
(
QMouseEvent
*
e
);
void
mouseReleaseEvent
(
QMouseEvent
*
e
);
private
:
private
:
QString
GetLineFeed
(
const
QString
&
str
);
private
:
Ui
::
ConsumOkDialog
*
ui
;
Ui
::
ConsumOkDialog
*
ui
;
bool
mouse_pressed
;
bool
mouse_pressed
;
QPoint
movePosition
;
QPoint
movePosition
;
...
...
fmp_redeem/consumokdialog.ui
View file @
3e83e27d
...
@@ -153,9 +153,9 @@
...
@@ -153,9 +153,9 @@
<property
name=
"geometry"
>
<property
name=
"geometry"
>
<rect>
<rect>
<x>
0
</x>
<x>
0
</x>
<y>
105
</y>
<y>
30
</y>
<width>
330
</width>
<width>
330
</width>
<height>
8
0
</height>
<height>
15
0
</height>
</rect>
</rect>
</property>
</property>
<property
name=
"minimumSize"
>
<property
name=
"minimumSize"
>
...
@@ -167,14 +167,14 @@
...
@@ -167,14 +167,14 @@
<property
name=
"maximumSize"
>
<property
name=
"maximumSize"
>
<size>
<size>
<width>
330
</width>
<width>
330
</width>
<height>
8
0
</height>
<height>
15
0
</height>
</size>
</size>
</property>
</property>
<property
name=
"text"
>
<property
name=
"text"
>
<string>
5元脆骨鸡
</string>
<string>
5元脆骨鸡
</string>
</property>
</property>
<property
name=
"alignment"
>
<property
name=
"alignment"
>
<set>
Qt::Align
Center
</set>
<set>
Qt::Align
HCenter|Qt::AlignTop
</set>
</property>
</property>
</widget>
</widget>
<widget
class=
"QLabel"
name=
"labCodeName"
>
<widget
class=
"QLabel"
name=
"labCodeName"
>
...
...
fmp_redeem/consumptiondialog.cpp
View file @
3e83e27d
...
@@ -106,7 +106,7 @@ void ConsumptionDialog::setData(const QString& act_name, const QString& code_nam
...
@@ -106,7 +106,7 @@ void ConsumptionDialog::setData(const QString& act_name, const QString& code_nam
{
{
ui
->
labCode
->
setText
(
coupon
);
ui
->
labCode
->
setText
(
coupon
);
ui
->
labCodeName
->
setText
(
code_name
);
ui
->
labCodeName
->
setText
(
code_name
);
ui
->
labActName
->
setText
(
act_name
);
ui
->
labActName
->
setText
(
GetLineFeed
(
act_name
)
);
ui
->
labTime
->
setText
(
time_name
);
ui
->
labTime
->
setText
(
time_name
);
}
}
...
@@ -132,4 +132,25 @@ void ConsumptionDialog::mouseReleaseEvent(QMouseEvent *e)
...
@@ -132,4 +132,25 @@ void ConsumptionDialog::mouseReleaseEvent(QMouseEvent *e)
{
{
mouse_pressed
=
false
;
mouse_pressed
=
false
;
return
QDialog
::
mouseReleaseEvent
(
e
);
return
QDialog
::
mouseReleaseEvent
(
e
);
}
QString
ConsumptionDialog
::
GetLineFeed
(
const
QString
&
str
)
{
int
w
=
ui
->
labActName
->
width
();
QFontMetrics
fm
=
ui
->
labActName
->
fontMetrics
();
QString
tmp
,
newStr
;
for
(
int
i
=
0
;
i
<
str
.
length
();
i
++
)
{
tmp
.
append
(
str
.
at
(
i
));
int
nw
=
fm
.
width
(
tmp
);
if
(
nw
>=
w
-
20
)
{
tmp
.
append
(
QChar
::
LineFeed
);
newStr
.
append
(
tmp
);
tmp
.
clear
();
}
}
if
(
!
tmp
.
isEmpty
())
newStr
.
append
(
tmp
);
return
newStr
;
}
}
\ No newline at end of file
fmp_redeem/consumptiondialog.h
View file @
3e83e27d
...
@@ -25,6 +25,7 @@ public:
...
@@ -25,6 +25,7 @@ public:
private
slots
:
private
slots
:
void
OnTimeout
();
void
OnTimeout
();
QString
GetLineFeed
(
const
QString
&
str
);
protected
:
protected
:
void
mousePressEvent
(
QMouseEvent
*
e
);
void
mousePressEvent
(
QMouseEvent
*
e
);
...
...
fmp_redeem/couponkeypad.cpp
View file @
3e83e27d
...
@@ -18,6 +18,8 @@ CouponKeypad::CouponKeypad(QWidget *parent, Qt::WindowFlags f) :
...
@@ -18,6 +18,8 @@ CouponKeypad::CouponKeypad(QWidget *parent, Qt::WindowFlags f) :
connect
(
ui
->
d7
,
SIGNAL
(
clicked
(
bool
)),
SLOT
(
onDigitClicked
()));
connect
(
ui
->
d7
,
SIGNAL
(
clicked
(
bool
)),
SLOT
(
onDigitClicked
()));
connect
(
ui
->
d8
,
SIGNAL
(
clicked
(
bool
)),
SLOT
(
onDigitClicked
()));
connect
(
ui
->
d8
,
SIGNAL
(
clicked
(
bool
)),
SLOT
(
onDigitClicked
()));
connect
(
ui
->
d9
,
SIGNAL
(
clicked
(
bool
)),
SLOT
(
onDigitClicked
()));
connect
(
ui
->
d9
,
SIGNAL
(
clicked
(
bool
)),
SLOT
(
onDigitClicked
()));
connect
(
ui
->
text
,
SIGNAL
(
returnPressed
()),
this
,
SLOT
(
on_btnOK_clicked
()));
}
}
CouponKeypad
::~
CouponKeypad
()
CouponKeypad
::~
CouponKeypad
()
...
@@ -56,9 +58,9 @@ void CouponKeypad::onDigitClicked()
...
@@ -56,9 +58,9 @@ void CouponKeypad::onDigitClicked()
void
CouponKeypad
::
mousePressEvent
(
QMouseEvent
*
e
)
void
CouponKeypad
::
mousePressEvent
(
QMouseEvent
*
e
)
{
{
mouse_pressed
=
true
;
mouse_pressed
=
true
;
movePosition
=
e
->
globalPos
()
-
pos
();
movePosition
=
e
->
globalPos
()
-
pos
();
return
QDialog
::
mousePressEvent
(
e
);
return
QDialog
::
mousePressEvent
(
e
);
}
}
void
CouponKeypad
::
mouseMoveEvent
(
QMouseEvent
*
e
)
void
CouponKeypad
::
mouseMoveEvent
(
QMouseEvent
*
e
)
...
...
fmp_redeem/errcodedialog.cpp
View file @
3e83e27d
...
@@ -49,7 +49,7 @@ void ErrCodeDialog::showForExpird(const QString& act_name, const QString& code_n
...
@@ -49,7 +49,7 @@ void ErrCodeDialog::showForExpird(const QString& act_name, const QString& code_n
v
.
ui
->
labCode
->
setText
(
coupon
);
v
.
ui
->
labCode
->
setText
(
coupon
);
v
.
ui
->
labTime
->
setText
(
time_name
);
v
.
ui
->
labTime
->
setText
(
time_name
);
v
.
ui
->
labActName
->
setText
(
act_name
);
v
.
ui
->
labActName
->
setText
(
v
.
GetLineFeed
(
act_name
)
);
v
.
ui
->
labCodeName
->
setText
(
code_name
);
v
.
ui
->
labCodeName
->
setText
(
code_name
);
v
.
exec
();
v
.
exec
();
...
@@ -69,26 +69,7 @@ void ErrCodeDialog::showForErr(const QString& coupon, const QString& mess, QWidg
...
@@ -69,26 +69,7 @@ void ErrCodeDialog::showForErr(const QString& coupon, const QString& mess, QWidg
v
.
ui
->
labActName
->
setVisible
(
true
);
v
.
ui
->
labActName
->
setVisible
(
true
);
v
.
ui
->
labCode
->
setText
(
coupon
);
v
.
ui
->
labCode
->
setText
(
coupon
);
v
.
ui
->
labActName
->
setText
(
mess
);
v
.
ui
->
labActName
->
setText
(
v
.
GetLineFeed
(
mess
));
v
.
exec
();
}
void
ErrCodeDialog
::
showForMismatch
(
const
QString
&
coupon
,
const
QString
&
mess
,
QWidget
*
parent
)
{
ErrCodeDialog
v
(
parent
);
// v.setGeometry( 0,0,350,470);
v
.
ui
->
topInvalidWidget
->
setObjectName
(
"topExpirdWidget"
);
v
.
ui
->
topInvalidWidget
->
setStyleSheet
(
v
.
ui
->
topInvalidWidget
->
styleSheet
());
v
.
ui
->
labTime
->
setVisible
(
false
);
v
.
ui
->
labCodeName
->
setVisible
(
false
);
v
.
ui
->
labFolat
->
setVisible
(
false
);
v
.
ui
->
labActName
->
setVisible
(
true
);
v
.
ui
->
labCode
->
setText
(
coupon
);
v
.
ui
->
labActName
->
setText
(
mess
);
v
.
exec
();
v
.
exec
();
}
}
...
@@ -114,4 +95,25 @@ void ErrCodeDialog::mouseMoveEvent(QMouseEvent *e)
...
@@ -114,4 +95,25 @@ void ErrCodeDialog::mouseMoveEvent(QMouseEvent *e)
void
ErrCodeDialog
::
mouseReleaseEvent
(
QMouseEvent
*
e
)
void
ErrCodeDialog
::
mouseReleaseEvent
(
QMouseEvent
*
e
)
{
{
mouse_pressed
=
false
;
mouse_pressed
=
false
;
}
QString
ErrCodeDialog
::
GetLineFeed
(
const
QString
&
str
)
{
int
w
=
ui
->
labActName
->
width
();
QFontMetrics
fm
=
ui
->
labActName
->
fontMetrics
();
QString
tmp
,
newStr
;
for
(
int
i
=
0
;
i
<
str
.
length
();
i
++
)
{
tmp
.
append
(
str
.
at
(
i
));
int
nw
=
fm
.
width
(
tmp
);
if
(
nw
>=
w
-
20
)
{
tmp
.
append
(
QChar
::
LineFeed
);
newStr
.
append
(
tmp
);
tmp
.
clear
();
}
}
if
(
!
tmp
.
isEmpty
())
newStr
.
append
(
tmp
);
return
newStr
;
}
}
\ No newline at end of file
fmp_redeem/errcodedialog.h
View file @
3e83e27d
...
@@ -19,7 +19,6 @@ public:
...
@@ -19,7 +19,6 @@ public:
static
void
showForInvalid
(
const
QString
&
coupon
,
QWidget
*
parent
=
0
);
static
void
showForInvalid
(
const
QString
&
coupon
,
QWidget
*
parent
=
0
);
static
void
showForExpird
(
const
QString
&
act_name
,
const
QString
&
code_name
,
const
QString
&
time_name
,
const
QString
&
coupon
,
QWidget
*
parent
=
0
);
static
void
showForExpird
(
const
QString
&
act_name
,
const
QString
&
code_name
,
const
QString
&
time_name
,
const
QString
&
coupon
,
QWidget
*
parent
=
0
);
static
void
showForErr
(
const
QString
&
coupon
,
const
QString
&
mess
,
QWidget
*
parent
=
0
);
static
void
showForErr
(
const
QString
&
coupon
,
const
QString
&
mess
,
QWidget
*
parent
=
0
);
static
void
showForMismatch
(
const
QString
&
coupon
,
const
QString
&
mess
,
QWidget
*
parent
=
0
);
protected
:
protected
:
void
mousePressEvent
(
QMouseEvent
*
e
);
void
mousePressEvent
(
QMouseEvent
*
e
);
...
@@ -27,6 +26,9 @@ protected:
...
@@ -27,6 +26,9 @@ protected:
void
mouseReleaseEvent
(
QMouseEvent
*
e
);
void
mouseReleaseEvent
(
QMouseEvent
*
e
);
private
:
private
:
QString
GetLineFeed
(
const
QString
&
str
);
private
:
Ui
::
ErrCodeDialog
*
ui
;
Ui
::
ErrCodeDialog
*
ui
;
bool
mouse_pressed
;
bool
mouse_pressed
;
QPoint
movePosition
;
QPoint
movePosition
;
...
...
fmp_redeem/fmp_redeem.cpp
View file @
3e83e27d
...
@@ -348,6 +348,11 @@ QJsonObject FMPRedeem::ShowForUnConsum(QJsonObject json)
...
@@ -348,6 +348,11 @@ QJsonObject FMPRedeem::ShowForUnConsum(QJsonObject json)
redeemResult
[
"discount"
]
=
SearchJsonObject
(
json
,
"amount"
).
toInt
();
redeemResult
[
"discount"
]
=
SearchJsonObject
(
json
,
"amount"
).
toInt
();
redeemResult
[
"couponType"
]
=
"20003"
;
redeemResult
[
"couponType"
]
=
"20003"
;
}
}
else
if
(
couponType
==
3
)
{
redeemResult
[
"discount"
]
=
SearchJsonObject
(
json
,
"amount"
).
toInt
();
redeemResult
[
"couponType"
]
=
"20005"
;
}
redeemResult
[
"couponDesc"
]
=
act_name
;
redeemResult
[
"couponDesc"
]
=
act_name
;
redeemResult
[
"code"
]
=
coupon
;
redeemResult
[
"code"
]
=
coupon
;
redeemResult
[
"redeem_json"
]
=
_redeem_json
;
redeemResult
[
"redeem_json"
]
=
_redeem_json
;
...
...
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