Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
FMVip_Today
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
FMVip_Today
Commits
e2aad1ef
Commit
e2aad1ef
authored
Sep 21, 2016
by
Carwyn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved: 1. 代金券界面细节美化
parent
35851cc6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
204 additions
and
67 deletions
+204
-67
FMVip/FMVip.pro
+8
-4
FMVip/fmcouponwidget.cpp
+10
-0
FMVip/fmcouponwidget.h
+1
-0
FMVip/fmviporder.cpp
+15
-9
FMVip/forms/fmcouponwidget.ui
+106
-37
FMVip/forms/fmviporder.ui
+64
-17
No files found.
FMVip/FMVip.pro
View file @
e2aad1ef
...
...
@@ -23,7 +23,8 @@ SOURCES += main.cpp\
fmvipdispatcher
.
cpp
\
fmvipforward
.
cpp
\
fmmsgwnd
.
cpp
\
fmloading
.
cpp
fmloading
.
cpp
\
fmcouponwidget
.
cpp
HEADERS
+=
fmviporder
.
h
\
fmviplogin
.
h
\
...
...
@@ -33,14 +34,16 @@ HEADERS += fmviporder.h \
fmvipdispatcher
.
h
\
fmvipforward
.
h
\
fmmsgwnd
.
h
\
fmloading
.
h
fmloading
.
h
\
fmcouponwidget
.
h
FORMS
+=
forms
/
fmviporder
.
ui
\
forms
/
fmviplogin
.
ui
\
forms
/
fmvippanel
.
ui
\
forms
/
fmvipfund
.
ui
\
forms
/
fmmsgwnd
.
ui
\
forms
/
fmloading
.
ui
forms
/
fmloading
.
ui
\
forms
/
fmcouponwidget
.
ui
RESOURCES
+=
\
res
/
FMVip
.
qrc
...
...
@@ -64,6 +67,7 @@ CONFIG(debug, debug|release) {
}
else
{
DESTDIR
=
$$
PWD
/../
FMVipTest
/
Release
TARGET
=
fmvip
LIBS
+=
-
L
..
\
FMVipTest
\
Release
-
lFMVipDC
LIBS
+=
-
L
..
\
..
\
FMVip
\
FMVipTest
\
Release
-
lFMVipDC
}
QMAKE_LFLAGS
+=
-
static
-
libstdc
++
-
static
-
libgcc
-
static
-
lpthread
FMVip/fmcouponwidget.cpp
View file @
e2aad1ef
#include "fmcouponwidget.h"
#include "ui_fmcouponwidget.h"
#include <QPainter>
FMCouponWidget
::
FMCouponWidget
(
Coupon
conpon
,
QWidget
*
parent
)
:
QWidget
(
parent
),
...
...
@@ -15,3 +16,12 @@ FMCouponWidget::~FMCouponWidget()
{
delete
ui
;
}
void
FMCouponWidget
::
paintEvent
(
QPaintEvent
*
event
)
{
Q_UNUSED
(
event
);
QStyleOption
opt
;
opt
.
init
(
this
);
QPainter
p
(
this
);
style
()
->
drawPrimitive
(
QStyle
::
PE_Widget
,
&
opt
,
&
p
,
this
);
}
FMVip/fmcouponwidget.h
View file @
e2aad1ef
...
...
@@ -16,6 +16,7 @@ public:
explicit
FMCouponWidget
(
Coupon
conpon
,
QWidget
*
parent
=
0
);
~
FMCouponWidget
();
void
paintEvent
(
QPaintEvent
*
event
);
private
:
Ui
::
FMCouponWidget
*
ui
;
};
...
...
FMVip/fmviporder.cpp
View file @
e2aad1ef
...
...
@@ -29,23 +29,23 @@ FMVipOrder::FMVipOrder(QDialog *parent) :
ui
->
price_label
->
setText
(
orderInfo
->
getNeedPayStr
());
ui
->
name_label
->
setText
(
name
);
ui
->
scrollAreaWidgetContents
->
setViewMode
(
QListView
::
IconMode
);
// ui->
scrollAreaWidgetContents
->setResizeMode(QListView::Adjust);
// ui->
scrollAreaWidgetContents
->setMovement(QListView::Static);
// ui->coupon_page
->setViewMode(QListView::IconMode);
// ui->
coupon_page
->setResizeMode(QListView::Adjust);
// ui->
coupon_page
->setMovement(QListView::Static);
couponMap
=
FMVipForward
::
instance
()
->
sessionCouponMap
();
for
(
Coupon
coupon
:
couponMap
.
values
())
{
auto
item
=
new
QListWidgetItem
();
item
->
setData
(
Coupon_Code
,
coupon
.
code
);
ui
->
scrollAreaWidgetContents
->
addItem
(
item
);
FMCouponWidget
*
itemWidget
=
new
FMCouponWidget
(
coupon
,
ui
->
scrollAreaWidgetContents
);
ui
->
coupon_page
->
addItem
(
item
);
FMCouponWidget
*
itemWidget
=
new
FMCouponWidget
(
coupon
,
ui
->
coupon_page
);
// itemWidget->show();
ui
->
scrollAreaWidgetContents
->
setItemWidget
(
item
,
itemWidget
);
ui
->
coupon_page
->
setItemWidget
(
item
,
itemWidget
);
//item大小
item
->
setSizeHint
(
QSize
(
itemWidget
->
rect
().
width
(),
itemWidget
->
rect
().
height
()));
}
connect
(
ui
->
scrollAreaWidgetContents
,
SIGNAL
(
itemClicked
(
QListWidgetItem
*
)),
this
,
SLOT
(
on_item_clicked
(
QListWidgetItem
*
)));
connect
(
ui
->
coupon_page
,
SIGNAL
(
itemClicked
(
QListWidgetItem
*
)),
this
,
SLOT
(
on_item_clicked
(
QListWidgetItem
*
)));
ui
->
pay_chk
->
setText
(
QString
(
"使用积分抵扣 %1 元"
).
arg
(
orderInfo
->
getScoreAmount
()));
...
...
@@ -69,11 +69,11 @@ FMVipOrder::~FMVipOrder()
void
FMVipOrder
::
on_pay_btn_clicked
()
{
int
count
=
ui
->
scrollAreaWidgetContents
->
count
();
int
count
=
ui
->
coupon_page
->
count
();
QStringList
checkedCode
;
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
auto
item
=
ui
->
scrollAreaWidgetContents
->
item
(
i
);
auto
item
=
ui
->
coupon_page
->
item
(
i
);
if
(
item
->
checkState
()
==
Qt
::
Checked
)
{
checkedCode
<<
item
->
data
(
Coupon_Code
).
toString
();
}
...
...
@@ -106,6 +106,12 @@ void FMVipOrder::on_pay_chk_clicked(bool checked)
void
FMVipOrder
::
on_item_clicked
(
QListWidgetItem
*
item
)
{
qDebug
()
<<
item
->
data
(
Coupon_Code
);
if
(
item
->
isSelected
())
{
ui
->
coupon_page
->
itemWidget
(
item
)
->
setStyleSheet
(
"#FMCouponWidget{background-color: rgb(255, 255, 255); border: none; border-image: url(:/coupon_select.png);}"
);
}
else
{
ui
->
coupon_page
->
itemWidget
(
item
)
->
setStyleSheet
(
"#FMCouponWidget{background-color: rgb(255, 255, 255); border: none; border-left: 5 solid rgb(255, 170, 37);"
);
}
// if(item != NULL)
// {
// Qt::CheckState state = item->checkState();
...
...
FMVip/forms/fmcouponwidget.ui
View file @
e2aad1ef
...
...
@@ -6,8 +6,8 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
300
</width>
<height>
1
5
0
</height>
<width>
234
</width>
<height>
1
2
0
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
...
...
@@ -15,43 +15,45 @@
</property>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
#FMCouponWidget
{
#FMCouponWidget
{
border: 0 solid white;
border-left: 5 solid rgb(255, 170, 37);
background-color: rgb(255, 255, 255);
border-image: url(:/coupon_select.png);
}
#code_lab
{
max-height: 15%;
}
#code_lab
{
max-height: 22;
min-height: 22;
color: rgb(127,127,127);
font: 15px
"
Microsoft YaHei
"
;
}
#amount_lab
{
min-height: 65%;
max-height: 65%;
}
#amount_lab, #currency
{
color: rgb(229, 11, 72);
font: bold 36px
"
Microsoft YaHei
"
;
}
#desc_lab
{
max-height: 30%;
}
#desc_lab
{
max-height: 36;
min-height: 36;
color: rgb(252,255,255);
background-color: rgb(229, 11, 72);
font: bold 18px
"
Microsoft YaHei
"
;
}
#coupon_left
{
max-width: 5px;
background-color: rgb(255, 170, 37);
}
#coupon_separator
{
margin-left: 4px;
padding: 0 16 0 16;
}
#coupon_separator
{
max-height: 1px;
background-image: url(:/coupon_separator.png);
background-repeat: none;
background-position: center;
margin-bottom: 5px;
}
</string>
}
</string>
</property>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
>
<property
name=
"spacing"
>
...
...
@@ -70,29 +72,51 @@
<number>
0
</number>
</property>
<item>
<widget
class=
"QLabel"
name=
"coupon_left"
/>
</item>
<item>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
>
<property
name=
"spacing"
>
<number>
0
</number>
</property>
<property
name=
"leftMargin"
>
<number>
5
</number>
<number>
0
</number>
</property>
<property
name=
"topMargin"
>
<number>
5
</number>
<number>
0
</number>
</property>
<property
name=
"rightMargin"
>
<number>
5
</number>
<number>
0
</number>
</property>
<property
name=
"bottomMargin"
>
<number>
5
</number>
<number>
0
</number>
</property>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_2"
>
<property
name=
"spacing"
>
<number>
0
</number>
</property>
<item>
<spacer
name=
"horizontalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
40
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
<item>
<widget
class=
"QLabel"
name=
"currency"
>
<property
name=
"text"
>
<string>
¥
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLabel"
name=
"amount_lab"
>
<property
name=
"text"
>
<string>
¥
40.00
</string>
<string>
40.00
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
...
...
@@ -100,14 +124,44 @@
</widget>
</item>
<item>
<spacer
name=
"horizontalSpacer_2"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
40
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget
class=
"QLabel"
name=
"coupon_separator"
/>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_3"
>
<item>
<spacer
name=
"horizontalSpacer_3"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
40
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
<item>
<widget
class=
"QLabel"
name=
"desc_lab"
>
<property
name=
"maximumSize"
>
<size>
<width>
16777215
</width>
<height>
30
</height>
<height>
36
</height>
</size>
</property>
<property
name=
"text"
>
...
...
@@ -122,6 +176,21 @@
</widget>
</item>
<item>
<spacer
name=
"horizontalSpacer_4"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
40
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget
class=
"QLabel"
name=
"code_lab"
>
<property
name=
"text"
>
<string>
123456789
</string>
...
...
FMVip/forms/fmviporder.ui
View file @
e2aad1ef
...
...
@@ -112,11 +112,12 @@
border-top: 0 solid silver;
}
#coupon_page
QWidget
{
background: rgb(24
8,239,222
);
#coupon_page{
background: rgb(24
6,246,246
);
border: 1 solid white;
border-top: 1 solid silver;
border-right: 1 solid silver;
border-bottom: 1 solid silver;
border-left: 0 solid silver;
}
#coupon_label {
background: rgb(222,88,51);
...
...
@@ -212,7 +213,48 @@
border: 1 solid silver;
border-top: 0;
}
</string>
/*======Coupon======*/
#FMCouponWidget
{
border: 0 solid white;
border-left: 5 solid rgb(255, 170, 37);
background-color: rgb(255, 255, 255);
}
#code_lab
{
max-height: 22;
min-height: 22;
color: rgb(127,127,127);
font: 15px
"
Microsoft YaHei
"
;
}
#amount_lab, #currency
{
color: rgb(229, 11, 72);
font: bold 36px
"
Microsoft YaHei
"
;
}
#desc_lab
{
max-height: 36;
min-height: 36;
color: rgb(252,255,255);
background-color: rgb(229, 11, 72);
font: bold 18px
"
Microsoft YaHei
"
;
margin-left: 4px;
padding: 0 16 0 16;
}
#coupon_separator
{
max-height: 1px;
background-image: url(:/coupon_separator.png);
background-repeat: none;
background-position: center;
margin-bottom: 5px;
}
</string>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
>
<property
name=
"spacing"
>
...
...
@@ -478,26 +520,31 @@
<number>
0
</number>
</property>
<item>
<widget
class=
"Q
ScrollArea
"
name=
"coupon_page"
>
<widget
class=
"Q
ListWidget
"
name=
"coupon_page"
>
<property
name=
"frameShape"
>
<enum>
QFrame::NoFrame
</enum>
</property>
<property
name=
"lineWidth"
>
<number>
1
</number>
<number>
0
</number>
</property>
<property
name=
"
widgetResizabl
e"
>
<
bool>
true
</bool
>
<property
name=
"
selectionMod
e"
>
<
enum>
QAbstractItemView::MultiSelection
</enum
>
</property>
<widget
class=
"QListWidget"
name=
"scrollAreaWidgetContents"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
764
</width>
<height>
249
</height>
</rect>
<property
name=
"verticalScrollMode"
>
<enum>
QAbstractItemView::ScrollPerPixel
</enum>
</property>
<property
name=
"horizontalScrollMode"
>
<enum>
QAbstractItemView::ScrollPerPixel
</enum>
</property>
<property
name=
"spacing"
>
<number>
10
</number>
</property>
<property
name=
"viewMode"
>
<enum>
QListView::IconMode
</enum>
</property>
<property
name=
"widgetResizable"
stdset=
"0"
>
<bool>
true
</bool>
</property>
</widget>
</widget>
</item>
</layout>
...
...
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