Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fmp_home
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
fmp_home
Commits
139e5e3f
Commit
139e5e3f
authored
Sep 11, 2017
by
gujin.wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新建鲜芋仙分支
parent
e32c00d4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
15 deletions
+35
-15
fmp_home_p.cpp
+35
-15
No files found.
fmp_home_p.cpp
View file @
139e5e3f
...
@@ -11,8 +11,10 @@
...
@@ -11,8 +11,10 @@
#include "fmp_login.h"
#include "fmp_login.h"
#include "fmp_he_handlers.h"
#include "fmp_he_handlers.h"
#include "fmp_home_settings.h"
#include "fmp_home_settings.h"
#include "fmp_redeem_i.h"
#include <QTimer>
#include <QTimer>
#include <QEventLoop>
#include <QEventLoop>
#include <QJsonArray>
FMPHomePrivate
::
FMPHomePrivate
(
FMPHome
*
q
)
FMPHomePrivate
::
FMPHomePrivate
(
FMPHome
*
q
)
:
q_ptr
(
q
),
:
q_ptr
(
q
),
...
@@ -37,35 +39,53 @@ int FMPHomePrivate::Init()
...
@@ -37,35 +39,53 @@ int FMPHomePrivate::Init()
FMPStartEventHandler
*
handler
=
new
FMPStartEventHandler
(
q
);
FMPStartEventHandler
*
handler
=
new
FMPStartEventHandler
(
q
);
_navWindow
=
new
NavWindow
;
_navWindow
=
new
NavWindow
;
std
::
vector
<
FMPBaseInterface
*>
svcVector
;
//
std::vector<FMPBaseInterface*> svcVector;
svcVector
.
push_back
(
FMP
::
GetService
<
FMPVipInterface
>
());
//
svcVector.push_back(FMP::GetService<FMPVipInterface>());
svcVector
.
push_back
(
FMP
::
GetService
<
FMPePayInterface
>
());
//
svcVector.push_back(FMP::GetService<FMPePayInterface>());
_navWindow
->
createMenuBtn
(
"payment"
,
QString
::
fromLocal8Bit
(
"非码支付"
));
//
_navWindow->createMenuBtn("payment", QString::fromLocal8Bit("非码支付"));
// _navWindow->createMenuBtn("vip", QString::fromLocal8Bit("非码会员"));
// _navWindow->createMenuBtn("vip", QString::fromLocal8Bit("非码会员"));
_navWindow
->
createMenuBtn
(
"takeout"
,
QString
::
fromLocal8Bit
(
"非码外卖"
));
//
_navWindow->createMenuBtn("takeout", QString::fromLocal8Bit("非码外卖"));
// _navWindow->createMenuBtn("coupons", QString::fromLocal8Bit("码多多"));
// _navWindow->createMenuBtn("coupons", QString::fromLocal8Bit("码多多"));
//
_navWindow->createMenuBtn("tool", QString::fromLocal8Bit("设置"));
//
_navWindow->createMenuBtn("tool", QString::fromLocal8Bit("设置"));
_navWindow
->
show
();
//
_navWindow->show();
connect
(
_navWindow
,
SIGNAL
(
menuBtnClicked
(
QString
)),
this
,
SLOT
(
onMenuBtnClicked
(
QString
)));
connect
(
_navWindow
,
SIGNAL
(
menuBtnClicked
(
QString
)),
this
,
SLOT
(
onMenuBtnClicked
(
QString
)));
connect
(
_navWindow
,
&
NavWindow
::
pluginActived
,
this
,
&
FMPHomePrivate
::
onPluginActived
);
connect
(
_navWindow
,
&
NavWindow
::
pluginActived
,
this
,
&
FMPHomePrivate
::
onPluginActived
);
login
();
login
();
// 启动会员
// 启动会员
FMPBaseInterface
*
svc
=
FMP
::
GetService
<
FMPVipInterface
>
();
//
FMPBaseInterface* svc = FMP::GetService<FMPVipInterface>();
if
(
svc
)
{
//
if(svc) {
svc
->
StartService
();
//
svc->StartService();
}
//
}
//启动外卖
//启动外卖
FMPBaseInterface
*
svcTakeout
=
FMP
::
GetService
<
FMPTakeoutInterface
>
();
//
FMPBaseInterface *svcTakeout = FMP::GetService<FMPTakeoutInterface>();
if
(
svcTakeout
)
{
//
if(svcTakeout) {
svcTakeout
->
StartService
();
//
svcTakeout->StartService();
}
//
}
q
->
_inited
=
true
;
q
->
_inited
=
true
;
q
->
notification
(
QString
::
fromLocal8Bit
(
"[非码POS插件]启动成功!"
));
QTimer
::
singleShot
(
1000
,
this
,
[](){
//启动卡券核销
FMPRedeemInterface
*
svcRedeem
=
FMP
::
GetService
<
FMPRedeemInterface
>
();
if
(
svcRedeem
)
{
svcRedeem
->
StartService
();
QJsonArray
products
;
QJsonObject
product
;
product
[
"consume_num"
]
=
1
;
product
[
"pid"
]
=
"1607271"
;
product
[
"price"
]
=
500
;
products
.
append
(
product
);
QJsonObject
result
=
svcRedeem
->
Redeem
(
products
);
FMP_DEBUG
()
<<
result
;
}
});
return
FMP_SUCCESS
;
return
FMP_SUCCESS
;
}
}
...
...
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