Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fmp_vip
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
xiaojing.zhang
fmp_vip
Commits
15cc2cd3
Commit
15cc2cd3
authored
Aug 10, 2017
by
gujin.wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
以麦当劳为参考对卡券核销功能进行测试
parent
5d373f53
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
2 deletions
+42
-2
fmnetwork.cpp
+1
-1
fmp_vip_p.cpp
+4
-0
windows/fmloading.h
+2
-1
windows/fmviplogin.cpp
+35
-0
No files found.
fmnetwork.cpp
View file @
15cc2cd3
...
@@ -55,7 +55,7 @@ int FMNetwork::send(const QString &url, const QByteArray &reqData, QByteArray &r
...
@@ -55,7 +55,7 @@ int FMNetwork::send(const QString &url, const QByteArray &reqData, QByteArray &r
}
else
{
}
else
{
int
err
=
reply
->
error
();
int
err
=
reply
->
error
();
error
=
FM_API_NETWORERROR
;
error
=
FM_API_NETWORERROR
;
errorMsg
=
netErrInfo
(
err
);
errorMsg
=
reply
->
errorString
(
);
}
}
}
else
{
}
else
{
disconnect
(
reply
,
&
QNetworkReply
::
finished
,
&
loop
,
&
QEventLoop
::
quit
);
disconnect
(
reply
,
&
QNetworkReply
::
finished
,
&
loop
,
&
QEventLoop
::
quit
);
...
...
fmp_vip_p.cpp
View file @
15cc2cd3
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
#include "fmp_logger_i.h"
#include "fmp_logger_i.h"
#include "resend.h"
#include "resend.h"
#include <QDebug>
#include <QDebug>
#include "fmloading.h"
FMPVipPrivate
::
FMPVipPrivate
(
FMPVip
*
vip
)
:
FMPVipPrivate
::
FMPVipPrivate
(
FMPVip
*
vip
)
:
q_ptr
(
vip
)
q_ptr
(
vip
)
...
@@ -35,6 +36,9 @@ int FMPVipPrivate::Init()
...
@@ -35,6 +36,9 @@ int FMPVipPrivate::Init()
home
->
notification
(
QString
::
fromLocal8Bit
(
"[非码会员]启动成功!"
));
home
->
notification
(
QString
::
fromLocal8Bit
(
"[非码会员]启动成功!"
));
FMP_INFO
()
<<
"Vip start"
;
FMP_INFO
()
<<
"Vip start"
;
//for test
ctxTest
=
q
->
_ctx
;
}
}
return
FMP_SUCCESS
;
return
FMP_SUCCESS
;
...
...
windows/fmloading.h
View file @
15cc2cd3
...
@@ -3,7 +3,8 @@
...
@@ -3,7 +3,8 @@
#include <QDialog>
#include <QDialog>
#include <QMovie>
#include <QMovie>
#include <ctkPluginContext.h>
extern
ctkPluginContext
*
ctxTest
;
namespace
Ui
{
namespace
Ui
{
class
FMLoading
;
class
FMLoading
;
}
}
...
...
windows/fmviplogin.cpp
View file @
15cc2cd3
...
@@ -5,6 +5,11 @@
...
@@ -5,6 +5,11 @@
#include <QMutex>
#include <QMutex>
#include "fmloading.h"
#include "fmloading.h"
#include <ctkPluginContext.h>
#include <QJsonObject>
#include "fmp_redeem_i.h"
ctkPluginContext
*
ctxTest
=
nullptr
;
FMVipLogin
::
FMVipLogin
(
QDialog
*
parent
)
:
FMVipLogin
::
FMVipLogin
(
QDialog
*
parent
)
:
FMVipWnd
(
parent
),
FMVipWnd
(
parent
),
ui
(
new
Ui
::
FMVipLogin
)
ui
(
new
Ui
::
FMVipLogin
)
...
@@ -50,6 +55,36 @@ QString FMVipLogin::getVersionInfo()
...
@@ -50,6 +55,36 @@ QString FMVipLogin::getVersionInfo()
void
FMVipLogin
::
on_login_btn_clicked
()
void
FMVipLogin
::
on_login_btn_clicked
()
{
{
QJsonObject
result
;
QJsonObject
req
;
//req["ver"] = 1;
//req["action"] = "redeem";
req
[
"store_id"
]
=
"99998"
;
req
[
"operator_id"
]
=
"00000002"
;
req
[
"station_id"
]
=
1
;
req
[
"trans_id"
]
=
QDateTime
::
currentDateTime
().
toString
(
"yyyyMMddHHmmsszzz"
);
req
[
"business_date"
]
=
QDate
::
currentDate
().
toString
(
"yyyyMMdd"
);
if
(
ctxTest
!=
nullptr
)
{
try
{
//! Verify pointer
ctxTest
->
getPlugin
();
ctkServiceReference
ref
=
ctxTest
->
getServiceReference
<
FMPRedeemInterface
>
();
FMPRedeemInterface
*
redeem
=
ctxTest
->
getService
<
FMPRedeemInterface
>
(
ref
);
redeem
->
StartService
();
result
=
redeem
->
Redeem
(
QJsonObject
(),
req
);
qDebug
()
<<
result
;
}
catch
(
const
ctkException
&
)
{
qDebug
()
<<
"Invalid context"
<<
ctxTest
;
}
}
return
;
QString
id
=
ui
->
login_edit
->
text
();
QString
id
=
ui
->
login_edit
->
text
();
_session
->
addData
(
"code"
,
id
);
_session
->
addData
(
"code"
,
id
);
...
...
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