Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
FmTakeaway
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
shangshang.dai
FmTakeaway
Commits
ccc20292
Commit
ccc20292
authored
Apr 19, 2017
by
ss.dai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
入账方式及编码在配置文件中读取
parent
3c222875
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
8 deletions
+46
-8
fmPlugin/fmPlugin.cpp
+20
-2
fmTakeaway/Model/orderObject.cpp
+10
-0
fmTakeaway/Model/orderObject.h
+6
-0
fmTakeaway/fmTakeaway.pro
+2
-5
fmTakeaway/preDefine.h
+2
-1
run/config.ini
+6
-0
No files found.
fmPlugin/fmPlugin.cpp
View file @
ccc20292
...
@@ -379,11 +379,29 @@ QString FmPlugin::_GetOrderStr( const OrderObject *orderObject)
...
@@ -379,11 +379,29 @@ QString FmPlugin::_GetOrderStr( const OrderObject *orderObject)
rObj
.
insert
(
"PluDetails"
,
products
);
rObj
.
insert
(
"PluDetails"
,
products
);
QJsonArray
payDetails
;
QJsonArray
payDetails
;
QString
zfCode
=
"001"
;
QString
zfName
=
"非码外卖"
;
QSettings
set
(
QString
(
"%1/config.ini"
).
arg
(
QCoreApplication
::
applicationDirPath
()),
QSettings
::
IniFormat
);
set
.
setIniCodec
(
"utf-8"
);
if
(
orderObject
->
pay
==
1
)
{
zfCode
=
set
.
value
(
QString
(
"payDetails/cash"
)).
toString
();
zfName
=
"现金"
;
}
else
{
QStringList
values
=
set
.
value
(
QString
(
"payDetails/%1"
).
arg
(
orderObject
->
channel
)).
toString
().
split
(
'|'
);
if
(
values
.
count
()
==
2
)
{
zfCode
=
values
.
at
(
0
);
zfName
=
values
.
at
(
1
);
}
}
QJsonObject
tObj
;
QJsonObject
tObj
;
tObj
.
insert
(
"SerialNo"
,
1
);
tObj
.
insert
(
"SerialNo"
,
1
);
tObj
.
insert
(
"ZfCode"
,
"001"
);
tObj
.
insert
(
"ZfCode"
,
zfCode
);
tObj
.
insert
(
"ZfName"
,
"非码外卖"
);
tObj
.
insert
(
"ZfName"
,
zfName
);
tObj
.
insert
(
"ZfTotal"
,
QString
::
number
(
YsTotal
,
'f'
,
2
));
tObj
.
insert
(
"ZfTotal"
,
QString
::
number
(
YsTotal
,
'f'
,
2
));
tObj
.
insert
(
"TradeNo"
,
""
);
tObj
.
insert
(
"TradeNo"
,
""
);
payDetails
.
insert
(
0
,
tObj
);
payDetails
.
insert
(
0
,
tObj
);
...
...
fmTakeaway/Model/orderObject.cpp
View file @
ccc20292
...
@@ -19,6 +19,16 @@ void OrderObject::FromJson(const QJsonObject &json)
...
@@ -19,6 +19,16 @@ void OrderObject::FromJson(const QJsonObject &json)
return
;
return
;
}
}
int
OrderObject
::
getpay
()
const
{
return
pay
;
}
void
OrderObject
::
setpay
(
const
int
&
v
)
{
pay
=
v
;
}
int
OrderObject
::
getproduct_fee
()
const
int
OrderObject
::
getproduct_fee
()
const
{
{
return
product_fee
;
return
product_fee
;
...
...
fmTakeaway/Model/orderObject.h
View file @
ccc20292
...
@@ -56,6 +56,7 @@ public:
...
@@ -56,6 +56,7 @@ public:
Q_PROPERTY
(
int
service_fee
READ
getservice_fee
WRITE
setservice_fee
)
Q_PROPERTY
(
int
service_fee
READ
getservice_fee
WRITE
setservice_fee
)
Q_PROPERTY
(
int
product_fee
READ
getproduct_fee
WRITE
setproduct_fee
)
Q_PROPERTY
(
int
product_fee
READ
getproduct_fee
WRITE
setproduct_fee
)
Q_PROPERTY
(
int
pay
READ
getpay
WRITE
setpay
)
QString
address
;
//地址
QString
address
;
//地址
QString
channel
;
//渠道
QString
channel
;
//渠道
...
@@ -98,7 +99,12 @@ public:
...
@@ -98,7 +99,12 @@ public:
int
service_fee
;
//外卖平台服务费
int
service_fee
;
//外卖平台服务费
int
product_fee
;
//商品总价
int
product_fee
;
//商品总价
int
pay
;
protected
:
protected
:
int
getpay
()
const
;
void
setpay
(
const
int
&
v
);
int
getproduct_fee
()
const
;
int
getproduct_fee
()
const
;
void
setproduct_fee
(
const
int
&
v
);
void
setproduct_fee
(
const
int
&
v
);
int
getdis_shop_fee
()
const
;
int
getdis_shop_fee
()
const
;
...
...
fmTakeaway/fmTakeaway.pro
View file @
ccc20292
...
@@ -80,11 +80,8 @@ FORMS += mainForm.ui \
...
@@ -80,11 +80,8 @@ FORMS += mainForm.ui \
RC_FILE
+=
fmTakeaway
.
rc
RC_FILE
+=
fmTakeaway
.
rc
CONFIG
(
release
,
debug
|
release
)
{
CONFIG
(
release
,
debug
|
release
)
{
LIBS
+=
-
L
..
/
HaiDing
-
lfmPlugin
LIBS
+=
-
L
..
/
HaiXing
-
lfmPlugin
LIBS
+=
-
L
..
/
HaiDing
-
lfmPrinter
LIBS
+=
-
L
..
/
HaiXing
-
lfmPrinter
}
else
{
LIBS
+=
-
L
..
/
fmPlugin
/
debug
-
lfmPlugin
LIBS
+=
-
L
..
/
fmPrinter
/
debug
-
lfmPrinter
}
}
...
...
fmTakeaway/preDefine.h
View file @
ccc20292
...
@@ -6,7 +6,8 @@
...
@@ -6,7 +6,8 @@
#define APP_THEME "deaufult"
#define APP_THEME "deaufult"
#define APP_VERSION "1.20160923.01" //TODO
#define APP_VERSION "1.20160923.01" //TODO
#define SERVER_PASSWORD "pos@freemud.cn"
//#define SERVER_PASSWORD "pos@freemud.cn"
#define SERVER_PASSWORD "posoperator@freemud.cn"
#define CONFIG_NAME "config.ini"
#define CONFIG_NAME "config.ini"
#define USERCONFIG_NAME "userConfig.ini"
#define USERCONFIG_NAME "userConfig.ini"
...
...
run/config.ini
View file @
ccc20292
...
@@ -3,3 +3,9 @@ url=http://waimaiapi.freemudorder.com/api
...
@@ -3,3 +3,9 @@ url=http://waimaiapi.freemudorder.com/api
[RefundListener]
[RefundListener]
port
=
34953
port
=
34953
;支付编码和名称
;格式为 平台代号=支付编码,支付名称
[payDetails]
cash
=
001
eleme
=
002,饿了么
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