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
a2417bef
Commit
a2417bef
authored
Sep 10, 2016
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.新增关闭窗口返回状态码。2.修复支付接口的返回参数与文档不对应。3.修改三个支付代码。
parent
fbfc7abf
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
27 deletions
+37
-27
FMVip/fmvipdispatcher.cpp
+21
-22
FMVip/fmvipdispatcher.h
+2
-0
FMVip/fmvipforward.cpp
+12
-5
FMVip/fmvipforward.h
+2
-0
No files found.
FMVip/fmvipdispatcher.cpp
View file @
a2417bef
...
...
@@ -29,7 +29,7 @@ FMVipDispatcher::FMVipDispatcher(QObject *parent)
QMenu
*
menu
=
new
QMenu
();
menu
->
addAction
(
"退出"
,
[
=
](){
qDebug
()
<<
"quit"
;
this
->
_ParseRequest
(
"{
\"
fm_cmd
\"
:
\"
-1
\"
}"
)
;
});
_sysIcon
->
setContextMenu
(
menu
);
...
...
@@ -112,27 +112,23 @@ void FMVipDispatcher::onRequest(const QJsonObject &jsonObj)
isLastOne
=
false
;
login
();
}
if
(
requestSuccess
==
false
||
_windowReturn
==
-
1
)
{
_serverRspData
.
clear
();
serverIsBusy
.
wakeAll
();
return
;
}
_posReqObj
=
copyJsonObj
;
isLastOne
=
true
;
if
(
type
==
Type_Pay
)
{
pay
();
}
else
if
(
type
==
Type_Fund
)
{
fund
();
}
else
if
(
type
==
Type_Final
)
{
final
();
if
(
requestSuccess
==
true
&&
_windowReturn
!=
-
1
)
{
_posReqObj
=
copyJsonObj
;
isLastOne
=
true
;
if
(
type
==
Type_Pay
)
{
pay
();
}
else
if
(
type
==
Type_Fund
)
{
fund
();
}
else
if
(
type
==
Type_Final
)
{
final
();
}
}
FMVipForward
::
instance
()
->
clearSessionData
();
}
if
(
_windowReturn
==
-
1
)
{
_serverRspData
.
clear
();
}
}
void
FMVipDispatcher
::
onResponse
(
const
QByteArray
&
rsp
)
...
...
@@ -146,6 +142,7 @@ void FMVipDispatcher::onFinished()
qDebug
()
<<
__FUNCTION__
;
if
(
_windowReturn
==
-
1
){
_serverRspData
=
Err_WindowClose
;
serverIsBusy
.
wakeAll
();
}
...
...
@@ -158,10 +155,11 @@ void FMVipDispatcher::onServerResponsed(const QJsonObject &rspObj)
_vindow
->
deleteLater
();
}
QJsonDocument
rspDoc
(
rspObj
);
QByteArray
rspData
=
rspDoc
.
toJson
();
_serverRspData
=
rspData
;
if
(
isLastOne
)
{
QJsonDocument
rspDoc
(
rspObj
);
QByteArray
rspData
=
rspDoc
.
toJson
();
_serverRspData
=
rspData
;
serverIsBusy
.
wakeAll
();
}
...
...
@@ -187,6 +185,7 @@ void FMVipDispatcher::onServerResponsed(const QJsonObject &rspObj)
requestSuccess
=
false
;
_vindow
=
0
;
serverIsBusy
.
wakeAll
();
}
}
...
...
FMVip/fmvipdispatcher.h
View file @
a2417bef
...
...
@@ -16,6 +16,8 @@
//#define Type_Fund "member_charge_rquest"
//#define Type_Final "Integral_request"
#define Err_WindowClose "{\"statusCode\":1001,\"msg\":\"窗口异常关闭\"}"
#define FM_VIP_LOGIN 1001
#define FM_VIP_FUND 1002
#define FM_VIP_PAY 1003
...
...
FMVip/fmvipforward.cpp
View file @
a2417bef
...
...
@@ -171,6 +171,8 @@ void FMVipForward::pay(const QJsonObject &job, QJsonObject &fmjob)
Q_UNUSED
(
job
);
fmjob
[
"reqType"
]
=
FM_VIP_PAY
;
_sessionForward
=
job
[
"forward"
].
toObject
();
QJsonObject
transObj
;
// transObj["account"] = job["fm_open_id"];
transObj
[
"account"
]
=
sessionData
(
"fm_open_id"
);
...
...
@@ -280,18 +282,23 @@ void FMVipForward::payed(const QJsonObject &serverJob, QJsonObject &posJob)
posJob
[
"print"
]
=
""
;
QJsonArray
pay_ids
;
QJsonObject
pay_obj_1
,
pay_obj_2
;
pay_obj_1
[
"pay_id"
]
=
"
001
"
;
QJsonObject
pay_obj_1
,
pay_obj_2
,
pay_obj_3
;
pay_obj_1
[
"pay_id"
]
=
"
24
"
;
pay_obj_1
[
"pay_str"
]
=
"会员储值金支付"
;
pay_obj_1
[
"paid_total_amount"
]
=
serverJob
[
"codeAmount"
];
pay_obj_2
[
"pay_id"
]
=
"
002
"
;
pay_obj_2
[
"pay_id"
]
=
"
25
"
;
pay_obj_2
[
"pay_str"
]
=
"会员积分支付"
;
pay_obj_2
[
"paid_total_amount"
]
=
serverJob
[
"scoreAmount"
];
pay_obj_3
[
"pay_id"
]
=
"77"
;
pay_obj_3
[
"pay_str"
]
=
"优惠支付"
;
pay_obj_3
[
"pain_total_amount"
]
=
0
;
pay_obj_3
[
"code"
]
=
""
;
pay_ids
.
append
(
pay_obj_1
);
pay_ids
.
append
(
pay_obj_2
);
posJob
[
"pays_ids"
]
=
pay_ids
;
pay_ids
.
append
(
pay_obj_3
);
posJob
[
"pay_ids"
]
=
pay_ids
;
QJsonObject
forward
;
QJsonObject
forward
=
_sessionForward
;
posJob
[
"forward"
]
=
forward
;
}
...
...
FMVip/fmvipforward.h
View file @
a2417bef
...
...
@@ -6,6 +6,7 @@
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QNetworkRequest>
#include <QJsonObject>
#define AppId "T007"
#define KeyCode "98d094a7-0d07-4cf5-b23b-d18783f0d76a"
...
...
@@ -73,6 +74,7 @@ private:
QMap
<
QString
,
QString
>
_sessionDataMap
;
QStringList
_sessionDataList
;
QJsonObject
_sessionForward
;
signals
:
void
serverResponsed
(
const
QJsonObject
&
rspData
);
private
slots
:
...
...
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