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
35851cc6
Commit
35851cc6
authored
Sep 21, 2016
by
NitefllWind
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.新增支付时必须使用支付码认证。2.修复按ECS键程序无返回而卡死。3.美化代金券元素显示界面。
parent
cfea96e1
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
166 additions
and
88 deletions
+166
-88
FMVip/fmvipdispatcher.cpp
+32
-4
FMVip/fmvipdispatcher.h
+1
-0
FMVip/fmviplogin.cpp
+14
-28
FMVip/fmviplogin.h
+3
-4
FMVip/fmvipwnd.cpp
+9
-2
FMVip/fmvipwnd.h
+5
-4
FMVip/forms/fmcouponwidget.ui
+88
-36
FMVip/forms/fmmsgwnd.ui
+10
-4
FMVip/forms/fmviplogin.ui
+1
-5
FMVip/forms/fmviporder.ui
+1
-1
FMVip/res/FMVip.qrc
+2
-0
FMVip/res/coupon_select.png
+0
-0
FMVip/res/coupon_separator.png
+0
-0
No files found.
FMVip/fmvipdispatcher.cpp
View file @
35851cc6
...
...
@@ -69,6 +69,7 @@ INT FMVipDispatcher::_ParseRequest(LPSTR data)
isLastOne
=
true
;
_serverRspData
.
clear
();
isPayLogin
=
false
;
// 唤起客户端界面
emit
requested
(
_posReqObj
);
...
...
@@ -130,9 +131,17 @@ void FMVipDispatcher::onRequest(const QJsonObject &jsonObj)
requestSuccess
=
true
;
// 支付、充值、结算先检查登陆状态。
QJsonObject
copyJsonObj
(
jsonObj
);
if
(
!
isLogined
())
{
if
(
type
==
Type_Fund
&&
!
isLogined
())
{
_posReqObj
[
"fm_cmd"
]
=
Type_Login
;
isLastOne
=
false
;
login
();
}
if
(
type
==
Type_Pay
)
{
_posReqObj
[
"fm_cmd"
]
=
Type_Login
;
isLastOne
=
false
;
isPayLogin
=
true
;
login
();
}
if
(
requestSuccess
==
true
&&
_windowReturn
!=
-
1
)
{
...
...
@@ -173,8 +182,29 @@ void FMVipDispatcher::onFinished()
void
FMVipDispatcher
::
onServerResponsed
(
const
QJsonObject
&
rspObj
)
{
int
status
=
rspObj
[
"statusCode"
].
toInt
();
int
prompt
=
rspObj
[
"prompt"
].
toInt
();
if
(
_vindow
!=
0
)
{
_vindow
->
setIsBusy
(
false
);
// 支付时, 会员认证的返回,如果不可付款
int
canPan
=
FMVipForward
::
instance
()
->
sessionDataInt
(
"canPay"
);
// 如果是支付认证则不关闭窗口
if
(
isPayLogin
)
{
if
(
status
!=
100
)
{
_vindow
->
resetWnd
();
FMMsgWnd
::
FailureWnd
(
rspObj
[
"msg"
].
toString
());
return
;
}
else
if
(
canPan
!=
1
)
{
_vindow
->
resetWnd
();
FMMsgWnd
::
FailureWnd
(
"请使用支付码付款"
);
return
;
}
}
_vindow
->
deleteLater
();
}
...
...
@@ -182,8 +212,6 @@ void FMVipDispatcher::onServerResponsed(const QJsonObject &rspObj)
QByteArray
rspData
=
rspDoc
.
toJson
();
_serverRspData
=
rspData
;
int
status
=
rspObj
[
"statusCode"
].
toInt
();
int
prompt
=
rspObj
[
"prompt"
].
toInt
();
if
(
status
!=
100
)
{
if
(
prompt
==
0
)
...
...
@@ -210,7 +238,7 @@ void FMVipDispatcher::onDoPost()
void
FMVipDispatcher
::
login
()
{
if
(
!
_vindow
)
{
FMVipLogin
*
login
=
new
FMVipLogin
;
FMVipLogin
*
login
=
new
FMVipLogin
(
isPayLogin
)
;
connect
(
login
,
SIGNAL
(
destroyed
(
QObject
*
)),
SLOT
(
onFinished
()));
connect
(
login
,
SIGNAL
(
doPost
()),
SLOT
(
onDoPost
()));
_vindow
=
login
;
...
...
FMVip/fmvipdispatcher.h
View file @
35851cc6
...
...
@@ -63,6 +63,7 @@ private:
QMutex
mutex
;
QWaitCondition
serverIsBusy
;
BOOL
requestSuccess
;
BOOL
isPayLogin
;
};
#endif // FMVIPDISPATCHER_H
FMVip/fmviplogin.cpp
View file @
35851cc6
...
...
@@ -9,7 +9,7 @@
#include "fmvipforward.h"
#include "fmloading.h"
FMVipLogin
::
FMVipLogin
(
QDialog
*
parent
)
:
FMVipLogin
::
FMVipLogin
(
bool
isMustPayCode
,
QDialog
*
parent
)
:
FMVipWnd
(
parent
),
ui
(
new
Ui
::
FMVipLogin
)
{
...
...
@@ -18,9 +18,17 @@ FMVipLogin::FMVipLogin(QDialog *parent) :
QString
operator_id
=
FMVipForward
::
instance
()
->
sessionData
(
"operator_id"
);
QString
business_date
=
FMVipForward
::
instance
()
->
sessionData
(
"business_date"
);
ui
->
login_edit
->
setFocus
();
ui
->
operator_label
->
setText
(
operator_id
);
ui
->
bd_label
->
setText
(
business_date
);
if
(
isMustPayCode
)
{
ui
->
login_edit
->
setPlaceholderText
(
"支付码"
);
}
else
{
ui
->
login_edit
->
setPlaceholderText
(
"手机号/账号/支付码"
);
}
}
FMVipLogin
::~
FMVipLogin
()
...
...
@@ -43,32 +51,10 @@ void FMVipLogin::on_login_btn_clicked()
setIsBusy
(
true
);
}
void
FMVipLogin
::
on_login_result
(
QNetworkReply
*
reply
)
void
FMVipLogin
::
resetWnd
(
)
{
qDebug
()
<<
__FUNCTION__
;
QJsonDocument
json
=
QJsonDocument
::
fromJson
(
reply
->
readAll
());
QFile
user
(
":/data/user"
);
if
(
user
.
open
(
QFile
::
ReadOnly
))
{
if
(
ui
->
login_edit
->
text
()
==
user
.
readAll
())
{
FMVipPanel
*
panel
=
new
FMVipPanel
;
QFile
file
(
":/data/profile"
);
if
(
file
.
open
(
QFile
::
ReadOnly
))
{
panel
->
setProfile
(
file
.
readAll
());
panel
->
show
();
close
();
emit
loginSuccess
();
}
else
{
qDebug
()
<<
"Failed opening file: "
<<
file
.
fileName
();
}
}
else
{
qDebug
()
<<
"User not authorized."
;
}
}
else
{
qDebug
()
<<
"Failed opening file: "
<<
user
.
fileName
();
}
ui
->
login_btn
->
setEnabled
(
true
);
ui
->
login_edit
->
setEnabled
(
true
);
ui
->
login_edit
->
clear
();
ui
->
login_edit
->
setFocus
();
}
FMVip/fmviplogin.h
View file @
35851cc6
...
...
@@ -14,15 +14,14 @@ class FMVipLogin : public FMVipWnd
Q_OBJECT
public
:
explicit
FMVipLogin
(
QDialog
*
parent
=
0
);
explicit
FMVipLogin
(
bool
isMustPayCode
=
false
,
QDialog
*
parent
=
0
);
~
FMVipLogin
();
protected
:
void
resetWnd
();
signals
:
void
loginSuccess
();
public
slots
:
void
on_login_btn_clicked
();
protected
slots
:
void
on_login_result
(
QNetworkReply
*
);
private
:
Ui
::
FMVipLogin
*
ui
;
};
...
...
FMVip/fmvipwnd.cpp
View file @
35851cc6
...
...
@@ -48,13 +48,18 @@ bool FMVipWnd::setProfile(const QByteArray &d)
return
true
;
}
void
FMVipWnd
::
on_close_btn_clicked
()
void
FMVipWnd
::
reject
()
{
close
();
QDialog
::
reject
();
setResult
(
-
1
);
// 关闭时返回-1
deleteLater
();
}
void
FMVipWnd
::
on_close_btn_clicked
()
{
reject
();
}
void
FMVipWnd
::
setIsBusy
(
const
bool
isBusy
)
{
if
(
isBusy
)
...
...
@@ -80,6 +85,8 @@ int FMVipWnd::exec()
QRect
rc
=
w
.
availableGeometry
();
setGeometry
((
rc
.
width
()
-
width
())
/
2
,
(
rc
.
height
()
-
height
())
/
2
,
width
(),
height
());
qDebug
()
<<
QString
(
"rc(%1, %2), w(%3, %4)"
).
arg
(
rc
.
width
()).
arg
(
rc
.
height
()).
arg
(
w
.
width
()).
arg
(
w
.
height
());
return
QDialog
::
exec
();
}
...
...
FMVip/fmvipwnd.h
View file @
35851cc6
...
...
@@ -17,6 +17,7 @@ public:
//! Set current user profile (Json data)
bool
setProfile
(
const
QByteArray
&
);
void
setIsBusy
(
const
bool
isBusy
=
true
);
virtual
void
resetWnd
(){}
int
exec
();
signals
:
...
...
@@ -25,6 +26,10 @@ public slots:
void
on_close_btn_clicked
();
private
:
FMLoading
*
loadingWindow
;
protected
:
QJsonObject
_profile_obj
;
bool
_isBusy
;
void
reject
();
#ifdef Q_OS_WIN
protected
:
bool
nativeEvent
(
const
QByteArray
&
eventType
,
void
*
message
,
long
*
result
);
...
...
@@ -32,10 +37,6 @@ protected:
protected
:
long
winNCHitTest
(
MSG
*
msg
);
protected
:
QJsonObject
_profile_obj
;
bool
_isBusy
;
#endif
};
...
...
FMVip/forms/fmcouponwidget.ui
View file @
35851cc6
...
...
@@ -6,8 +6,8 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
3
27
</width>
<height>
1
65
</height>
<width>
3
00
</width>
<height>
1
50
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
...
...
@@ -15,71 +15,123 @@
</property>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
#FMCouponWidget
{
background-color: rgb(255, 255, 255);
border-image: url(:/coupon_select.png);
}
#code_lab
{
color: rgb(50,50,50);
font: 18px
"
Microsoft YaHei
"
;
max-height: 15%;
color: rgb(127,127,127);
font: 15px
"
Microsoft YaHei
"
;
}
#amount_lab
{
color: rgb(50,50,50);
min-height: 65%;
max-height: 65%;
color: rgb(229, 11, 72);
font: bold 36px
"
Microsoft YaHei
"
;
}
#desc_lab
{
color: rgb(50,50,50);
font: 18px
"
Microsoft YaHei
"
;
max-height: 30%;
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
{
max-height: 1px;
background-image: url(:/coupon_separator.png);
margin-bottom: 5px;
}
</string>
</property>
<layout
class=
"Q
VBoxLayout"
name=
"vertic
alLayout"
>
<layout
class=
"Q
HBoxLayout"
name=
"horizont
alLayout"
>
<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>
<widget
class=
"QLabel"
name=
"code_lab"
>
<property
name=
"text"
>
<string>
123456789
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
</property>
</widget>
<widget
class=
"QLabel"
name=
"coupon_left"
/>
</item>
<item>
<
widget
class=
"QLabel"
name=
"amount_lab
"
>
<property
name=
"
text
"
>
<
string>
40
</string
>
<
layout
class=
"QVBoxLayout"
name=
"verticalLayout
"
>
<property
name=
"
spacing
"
>
<
number>
0
</number
>
</property>
<property
name=
"
alignment
"
>
<
set>
Qt::AlignCenter
</set
>
<property
name=
"
leftMargin
"
>
<
number>
5
</number
>
</property>
</widget>
</item>
<item>
<widget
class=
"QLabel"
name=
"desc_lab"
>
<property
name=
"text"
>
<string>
测试代金券
</string>
<property
name=
"topMargin"
>
<number>
5
</number>
</property>
<property
name=
"
alignment
"
>
<
set>
Qt::AlignCenter
</set
>
<property
name=
"
rightMargin
"
>
<
number>
5
</number
>
</property>
<property
name=
"
wordWrap
"
>
<
bool>
true
</bool
>
<property
name=
"
bottomMargin
"
>
<
number>
5
</number
>
</property>
</widget>
<item>
<widget
class=
"QLabel"
name=
"amount_lab"
>
<property
name=
"text"
>
<string>
¥40.00
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
</property>
</widget>
</item>
<item>
<widget
class=
"QLabel"
name=
"coupon_separator"
/>
</item>
<item>
<widget
class=
"QLabel"
name=
"desc_lab"
>
<property
name=
"maximumSize"
>
<size>
<width>
16777215
</width>
<height>
30
</height>
</size>
</property>
<property
name=
"text"
>
<string>
测试代金券
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
</property>
<property
name=
"wordWrap"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item>
<widget
class=
"QLabel"
name=
"code_lab"
>
<property
name=
"text"
>
<string>
123456789
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
...
...
FMVip/forms/fmmsgwnd.ui
View file @
35851cc6
...
...
@@ -41,14 +41,16 @@
}
#close_btn {
min-width: 53px; min-height: 53px;
border-image: url(
"
:/btn_close.png
"
);
min-width: 30px; min-height: 30px;
max-width: 30px; max-height: 30px;
margin-left: 260;
border-image: url(
"
:/btn_alert_close.png
"
);
}
#close_btn:hover{
<!--
#close_btn:hover{
min-width: 51px; min-height: 51px;
border-image: url(":/btn_alert_close.png");
}
}
-->
#alertLabMsg
{
color: rgb(129, 129, 129);
...
...
@@ -84,6 +86,10 @@
<number>
0
</number>
</property>
<item>
<widget
class=
"QPushButton"
name=
"close_btn"
>
</widget>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_3"
>
<property
name=
"spacing"
>
<number>
0
</number>
...
...
FMVip/forms/fmviplogin.ui
View file @
35851cc6
...
...
@@ -74,13 +74,12 @@
#login_edit {
min-height: 60px;
border: 1 solid silver;
text-align: center;
font: 100 30px
"
Microsoft YaHei
"
;
color: rgb(50,50,50);
background: white;
border: 1 solid silver;
border-left: 0;
margin-left: -82;
<!-- margin-left: -82; -->
}
#login_btn {
...
...
@@ -244,9 +243,6 @@
<property
name=
"frame"
>
<bool>
true
</bool>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
</property>
<property
name=
"placeholderText"
>
<string/>
</property>
...
...
FMVip/forms/fmviporder.ui
View file @
35851cc6
...
...
@@ -87,7 +87,7 @@
border-top: 0 solid silver;
}
#price_label {
font: bold
36
px
"
Microsoft YaHei
"
;
font: bold
42
px
"
Microsoft YaHei
"
;
padding-left: 70px;
color: rgb(50,50,50);
border: 0 solid silver;
...
...
FMVip/res/FMVip.qrc
View file @
35851cc6
...
...
@@ -14,5 +14,7 @@
<file>loading.gif</file>
<file>alert_bg.png</file>
<file>tip_warning.png</file>
<file>coupon_select.png</file>
<file>coupon_separator.png</file>
</qresource>
</RCC>
FMVip/res/coupon_select.png
0 → 100644
View file @
35851cc6
1.94 KB
FMVip/res/coupon_separator.png
0 → 100644
View file @
35851cc6
1.3 KB
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