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
21fd80c3
Commit
21fd80c3
authored
Jun 27, 2017
by
gujin.wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
天福vip功能,包括会员认证,支付,支付结算,退款结算
parent
ac9481ea
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
462 additions
and
575 deletions
+462
-575
fmp_vip_server.cpp
+2
-1
global.h
+7
-7
task/fmtask.cpp
+41
-128
task/fmtask.h
+13
-23
task/taskcoupon.cpp
+126
-80
task/taskcoupon.h
+44
-40
task/taskfinal.cpp
+0
-0
task/taskfinal.h
+43
-40
task/tasklogin.cpp
+0
-0
task/tasklogin.h
+43
-39
task/taskpay.cpp
+0
-0
task/taskpay.h
+41
-39
windows/fmviplogin.cpp
+1
-1
windows/fmviporder.cpp
+4
-0
windows/forms/fmmsgwnd.ui
+97
-177
No files found.
fmp_vip_server.cpp
View file @
21fd80c3
...
@@ -50,7 +50,6 @@ void FMPVipServer::onDisconnected()
...
@@ -50,7 +50,6 @@ void FMPVipServer::onDisconnected()
void
FMPVipServer
::
onReadyRead
()
void
FMPVipServer
::
onReadyRead
()
{
{
QByteArray
recvData
=
socket
->
readAll
();
QByteArray
recvData
=
socket
->
readAll
();
FMSOCKEHEADER
header
=
{
0
};
FMSOCKEHEADER
header
=
{
0
};
memcpy
(
&
header
,
recvData
.
data
(),
sizeof
(
FMSOCKEHEADER
));
memcpy
(
&
header
,
recvData
.
data
(),
sizeof
(
FMSOCKEHEADER
));
if
(
header
.
flag
!=
FMSOCKFLAG
)
{
if
(
header
.
flag
!=
FMSOCKFLAG
)
{
...
@@ -59,6 +58,8 @@ void FMPVipServer::onReadyRead()
...
@@ -59,6 +58,8 @@ void FMPVipServer::onReadyRead()
}
}
QByteArray
rspData
;
QByteArray
rspData
;
// qDebug() << recvData.mid(sizeof(FMSOCKEHEADER));
qDebug
()
<<
QString
(
recvData
.
mid
(
sizeof
(
FMSOCKEHEADER
))).
toUtf8
();
dispatcher
->
doTask
(
recvData
.
mid
(
sizeof
(
FMSOCKEHEADER
)),
rspData
);
dispatcher
->
doTask
(
recvData
.
mid
(
sizeof
(
FMSOCKEHEADER
)),
rspData
);
Write
(
rspData
);
Write
(
rspData
);
...
...
global.h
View file @
21fd80c3
...
@@ -264,13 +264,13 @@ typedef std::map<const int, const char*> FMErrorMap;
...
@@ -264,13 +264,13 @@ typedef std::map<const int, const char*> FMErrorMap;
const
FMErrorMap
::
value_type
fm_error_pairs
[]
=
const
FMErrorMap
::
value_type
fm_error_pairs
[]
=
{
{
FMErrorMap
::
value_type
(
FM_API_SUCCESS
,
"
Success
"
),
FMErrorMap
::
value_type
(
FM_API_SUCCESS
,
"
成功
"
),
FMErrorMap
::
value_type
(
FM_API_ERROR
,
"
Error
"
),
FMErrorMap
::
value_type
(
FM_API_ERROR
,
"
失败
"
),
FMErrorMap
::
value_type
(
FM_API_TIMEOUT
,
"
Timeout
"
),
FMErrorMap
::
value_type
(
FM_API_TIMEOUT
,
"
网络超时
"
),
FMErrorMap
::
value_type
(
FM_API_BADJSON
,
"
Invalid json data
"
),
FMErrorMap
::
value_type
(
FM_API_BADJSON
,
"
无效的JSON数据
"
),
FMErrorMap
::
value_type
(
FM_API_NETWORERROR
,
"
Network error
"
),
FMErrorMap
::
value_type
(
FM_API_NETWORERROR
,
"
网络错误
"
),
FMErrorMap
::
value_type
(
FM_API_SERVERERROR
,
"
Server error
"
),
FMErrorMap
::
value_type
(
FM_API_SERVERERROR
,
"
服务器错误
"
),
FMErrorMap
::
value_type
(
FM_API_WINDOWCLOSE
,
"
Window is closed
"
)
FMErrorMap
::
value_type
(
FM_API_WINDOWCLOSE
,
"
窗口关闭
"
)
};
};
const
FMErrorMap
fm_error
(
fm_error_pairs
,
fm_error_pairs
+
(
sizeof
fm_error_pairs
/
sizeof
fm_error_pairs
[
0
]));
const
FMErrorMap
fm_error
(
fm_error_pairs
,
fm_error_pairs
+
(
sizeof
fm_error_pairs
/
sizeof
fm_error_pairs
[
0
]));
...
...
task/fmtask.cpp
View file @
21fd80c3
...
@@ -7,153 +7,64 @@
...
@@ -7,153 +7,64 @@
#include <QCryptographicHash>
#include <QCryptographicHash>
#include "fmp_vip_settings.h"
#include "fmp_vip_settings.h"
#define RunFunction(function) do { \
FMTask
::
FMTask
(
QJsonObject
&
jsonObj
,
Session
*
session
,
QObject
*
parent
)
:
function##(); \
if(error() != FM_API_SUCCESS) { \
FMP_WARN() << QString("Task error %1: %2").arg(error()).arg(errorString()); \
return QString(ErrorMsgJson).arg(error()).arg(errorString()).toLatin1(); \
} \
} while(0);
FMTask
::
FMTask
(
QJsonObject
&
jsonObj
,
FM_TYPE
fmType
,
Session
*
session
,
QObject
*
parent
)
:
QObject
(
parent
),
QObject
(
parent
),
posReqJsonObj
(
jsonObj
),
posReqJsonObj
(
jsonObj
),
_window
(
nullptr
),
_window
(
nullptr
),
isCreator
(
false
),
_FM_Type
(
fmType
),
preTask
(
nullptr
),
_error
(
FM_API_SUCCESS
),
_error
(
FM_API_SUCCESS
),
_errorMsg
(
""
)
_errorMsg
(
""
),
_session
(
session
)
{
{
if
(
session
==
0
)
{
_session
=
new
Session
();
isCreator
=
true
;
}
else
{
_session
=
session
;
}
}
}
FMTask
::~
FMTask
()
FMTask
::~
FMTask
()
{
{
del_p
(
_window
);
del_p
(
_window
);
del_p
(
preTask
);
if
(
isCreator
)
{
del_p
(
_session
);
}
}
QByteArray
FMTask
::
doTask
()
{
FMP_DEBUG
()
<<
__FUNCTION__
;
RunFunction
(
copyPros
);
RunFunction
(
setWindow
);
RunFunction
(
showWindow
);
RunFunction
(
packagePOSRsp
);
QJsonDocument
json
(
posRspJsonObj
);
return
json
.
toJson
(
QJsonDocument
::
Compact
);
}
void
FMTask
::
stopTask
()
{
FMP_DEBUG
()
<<
__FUNCTION__
;
if
(
preTask
!=
nullptr
)
{
preTask
->
stopTask
();
}
if
(
_window
!=
nullptr
)
{
_window
->
close
();
_window
=
nullptr
;
}
setError
(
FM_API_WINDOWCLOSE
);
}
}
void
FMTask
::
copyPros
(
)
QJsonValue
FMTask
::
searchJsonObject
(
QJsonObject
&
searchJson
,
QString
searchKey
)
{
{
FMP_DEBUG
()
<<
__FUNCTION__
;
QJsonValue
value
;
for
(
int
i
=
0
;
i
<
sizeof
(
DefaultProps
)
/
sizeof
(
DefaultProps
[
0
]);
++
i
)
{
if
(
searchJson
.
contains
(
searchKey
))
QString
posPro
=
DefaultProps
[
i
];
{
serverReqJsonObj
[
ServerProps
(
posPro
)]
=
posReqJsonObj
[
posPro
];
return
searchJson
[
searchKey
];
}
}
void
FMTask
::
showWindow
()
{
FMP_DEBUG
()
<<
__FUNCTION__
;
QString
sL
[]
=
{
PosProps
.
OperatorId
,
PosProps
.
BussinessDate
,
};
for
(
int
i
=
0
;
i
<
sizeof
(
sL
)
/
sizeof
(
sL
[
0
]);
++
i
)
{
QString
s
=
sL
[
i
];
_session
->
addData
(
s
,
posReqJsonObj
[
s
].
toString
());
}
}
else
if
(
_window
!=
nullptr
)
{
{
_window
->
initWnd
(
this
->
session
());
foreach
(
QString
key
,
searchJson
.
keys
())
int
ret
=
_window
->
exec
();
{
if
(
ret
==
-
1
)
{
if
(
searchJson
[
key
].
isObject
())
setError
(
FM_API_WINDOWCLOSE
);
{
QJsonObject
ob
=
searchJson
[
key
].
toObject
();
value
=
searchJsonObject
(
ob
,
searchKey
);
}
else
if
(
searchJson
[
key
].
isArray
())
{
QJsonArray
arr
=
searchJson
[
key
].
toArray
();
value
=
searchJsonArray
(
arr
,
searchKey
);
}
}
}
}
}
return
value
;
}
}
bool
FMTask
::
sendToServer
(
bool
isShowMsg
)
QJsonValue
FMTask
::
searchJsonArray
(
QJsonArray
&
searchJson
,
QString
searchKey
)
{
{
FMP_DEBUG
()
<<
__FUNCTION__
;
QJsonValue
value
;
// 固定部分
for
(
int
i
=
0
;
i
<
searchJson
.
size
();
i
++
)
serverReqJsonObj
[
PosProps
.
AppId
]
=
APP_ID
;
serverReqJsonObj
[
PosProps
.
PartnerId
]
=
PARTNER_ID
;
serverReqJsonObj
[
PosProps
.
T
]
=
QString
::
number
(
QDateTime
::
currentMSecsSinceEpoch
());
serverReqJsonObj
[
ServerProps
(
PosProps
.
Fm_cmd
)]
=
FM_Type
();
packageServerReq
();
QJsonDocument
json
(
serverReqJsonObj
);
QByteArray
data
=
json
.
toJson
(
QJsonDocument
::
Compact
);
url
=
QString
(
"%1?sign=%2"
).
arg
(
FMPVipSettings
::
instance
()
->
getServerUrl
()).
arg
(
sign
());
QByteArray
rspData
;
FMNetwork
net
;
net
.
send
(
url
,
data
,
rspData
);
// 网络错误
if
(
net
.
error
!=
FM_API_SUCCESS
)
{
setError
(
net
.
error
,
net
.
errorMsg
);
}
else
{
QJsonParseError
jsonErr
;
QJsonDocument
rspJson
=
QJsonDocument
::
fromJson
(
rspData
,
&
jsonErr
);
// Json错误
if
(
jsonErr
.
error
!=
QJsonParseError
::
NoError
)
{
setError
(
FM_API_BADJSON
);
}
else
{
serverRspJsonObj
=
rspJson
.
object
();
qDebug
()
<<
"serverRspJsonObj: "
<<
serverRspJsonObj
;
// 服务器返回的错误
if
(
serverRspJsonObj
.
contains
(
"errcode"
))
{
setError
(
FM_API_SERVERERROR
,
serverRspJsonObj
[
"errcode"
].
toInt
(),
serverRspJsonObj
[
"errmsg"
].
toString
());
}
}
}
FMP_INFO
()
<<
"Server rsponse: "
<<
serverRspJsonObj
;
if
(
_window
!=
nullptr
)
{
_window
->
setIsBusy
(
false
);
}
bool
isOk
=
(
error
()
==
FM_API_SUCCESS
);
if
(
!
isOk
&&
isShowMsg
)
{
{
FMMsgWnd
::
FailureWnd
(
errorString
(),
_window
);
if
(
searchJson
[
i
].
isObject
())
{
QJsonObject
ob
=
searchJson
[
i
].
toObject
();
value
=
searchJsonObject
(
ob
,
searchKey
);
}
else
if
(
searchJson
[
i
].
isArray
())
{
QJsonArray
arr
=
searchJson
[
i
].
toArray
();
value
=
searchJsonArray
(
arr
,
searchKey
);
}
}
}
return
value
;
return
isOk
;
}
}
QJsonValue
FMTask
::
searchJsonValue
(
QJsonObject
&
searchJson
,
QString
searchKey
)
QJsonValue
FMTask
::
searchJsonValue
(
QJsonObject
&
searchJson
,
QString
searchKey
)
...
@@ -177,12 +88,14 @@ QJsonValue FMTask::searchJsonValue(QJsonObject &searchJson, QString searchKey)
...
@@ -177,12 +88,14 @@ QJsonValue FMTask::searchJsonValue(QJsonObject &searchJson, QString searchKey)
QJsonValue
FMTask
::
getServerJsonValue
(
const
QString
prop
)
QJsonValue
FMTask
::
getServerJsonValue
(
const
QString
prop
)
{
{
return
searchJsonValue
(
serverRspJsonObj
,
ServerProps
(
prop
));
// return searchJsonValue(serverRspJsonObj, ServerProps(prop));
return
searchJsonObject
(
serverRspJsonObj
,
prop
);
}
}
QJsonValue
FMTask
::
getPosJsonValue
(
const
QString
prop
)
QJsonValue
FMTask
::
getPosJsonValue
(
const
QString
prop
)
{
{
return
searchJsonValue
(
posReqJsonObj
,
prop
);
// return searchJsonValue(posReqJsonObj, prop);
return
searchJsonObject
(
posReqJsonObj
,
prop
);
}
}
QString
FMTask
::
sign
()
const
QString
FMTask
::
sign
()
const
...
...
task/fmtask.h
View file @
21fd80c3
...
@@ -8,49 +8,39 @@
...
@@ -8,49 +8,39 @@
#include <QJsonArray>
#include <QJsonArray>
#include <QDebug>
#include <QDebug>
#define RunFunction(function) do { \
function##(); \
if(error() != FM_API_SUCCESS) { \
FMP_WARN() << QString("Task error %1: %2").arg(error()).arg(errorString()); \
return QString(ErrorMsgJson).arg(error()).arg(errorString()).toLatin1(); \
} \
} while(0);
class
FMTask
:
public
QObject
class
FMTask
:
public
QObject
{
{
Q_OBJECT
Q_OBJECT
public
:
public
:
explicit
FMTask
(
QJsonObject
&
jsonObj
,
FM_TYPE
fmType
,
Session
*
session
=
0
,
QObject
*
parent
=
0
);
explicit
FMTask
(
QJsonObject
&
jsonObj
,
Session
*
session
=
0
,
QObject
*
parent
=
0
);
~
FMTask
();
~
FMTask
();
virtual
QByteArray
doTask
();
virtual
void
stopTask
();
void
setFM_Type
(
const
FM_TYPE
fmType
)
{
_FM_Type
=
fmType
;}
FM_TYPE
FM_Type
()
const
{
return
_FM_Type
;}
Session
*
session
()
const
{
return
_session
;}
Session
*
session
()
const
{
return
_session
;}
QJsonValue
searchJsonValue
(
QJsonObject
&
searchJson
,
QString
searchKey
);
QJsonValue
searchJsonValue
(
QJsonObject
&
searchJson
,
QString
searchKey
);
QJsonValue
searchJsonObject
(
QJsonObject
&
searchJson
,
QString
searchKey
);
QJsonValue
searchJsonArray
(
QJsonArray
&
searchJson
,
QString
searchKey
);
QJsonValue
getServerJsonValue
(
const
QString
prop
);
QJsonValue
getServerJsonValue
(
const
QString
prop
);
QJsonValue
getPosJsonValue
(
const
QString
prop
);
QJsonValue
getPosJsonValue
(
const
QString
prop
);
protected
:
protected
:
// 从配置文件中拷贝数据信息
void
copyPros
();
virtual
void
setWindow
(){}
virtual
void
showWindow
();
virtual
void
packageServerReq
()
=
0
;
virtual
bool
sendToServer
(
bool
isShowMsg
=
true
);
virtual
void
packagePOSRsp
()
=
0
;
protected
:
QJsonObject
posReqJsonObj
;
QJsonObject
posReqJsonObj
;
QJsonObject
posRspJsonObj
;
QJsonObject
posRspJsonObj
;
QJsonObject
serverReqJsonObj
;
QJsonObject
serverReqJsonObj
;
QJsonObject
serverRspJsonObj
;
QJsonObject
serverRspJsonObj
;
FMVipWnd
*
_window
;
FMVipWnd
*
_window
;
Session
*
_session
;
Session
*
_session
;
bool
isCreator
;
FM_TYPE
_FM_Type
;
QString
url
;
QString
url
;
FMTask
*
preTask
;
public
:
private
:
QString
sign
()
const
;
QString
sign
()
const
;
/**
/**
...
...
task/taskcoupon.cpp
View file @
21fd80c3
...
@@ -8,11 +8,12 @@
...
@@ -8,11 +8,12 @@
#include <QJsonObject>
#include <QJsonObject>
#include <QCryptographicHash>
#include <QCryptographicHash>
TaskCoupon
::
TaskCoupon
(
QJsonObject
&
jsonObj
,
Session
*
session
,
QObject
*
parent
)
:
QObject
(
parent
)
TaskCoupon
::
TaskCoupon
(
QJsonObject
&
jsonObj
,
Session
*
session
,
QObject
*
parent
)
:
/*QObject(parent)*/
FMTask
(
jsonObj
,
session
,
parent
)
{
{
posReqJsonObj
=
jsonObj
;
//
posReqJsonObj = jsonObj;
_session
=
session
;
//
_session = session;
_error
=
FM_API_SUCCESS
;
//
_error = FM_API_SUCCESS;
}
}
QByteArray
TaskCoupon
::
doTask
()
QByteArray
TaskCoupon
::
doTask
()
...
@@ -36,7 +37,7 @@ QByteArray TaskCoupon::doTask()
...
@@ -36,7 +37,7 @@ QByteArray TaskCoupon::doTask()
p
.
price
=
applyProducts
[
i
].
toObject
()[
"price"
].
toInt
();
p
.
price
=
applyProducts
[
i
].
toObject
()[
"price"
].
toInt
();
p
.
coupon_discount_amount
=
applyProducts
[
i
].
toObject
()[
"coupon_discount_amount"
].
toInt
();
p
.
coupon_discount_amount
=
applyProducts
[
i
].
toObject
()[
"coupon_discount_amount"
].
toInt
();
p
.
pid
=
applyProducts
[
i
].
toObject
()[
"pid"
].
toString
();
p
.
pid
=
applyProducts
[
i
].
toObject
()[
"pid"
].
toString
();
p
.
consume_num
=
applyProducts
[
i
].
toObject
()[
"consume_num"
].
to
Int
();
p
.
consume_num
=
applyProducts
[
i
].
toObject
()[
"consume_num"
].
to
String
().
toDouble
();
c
.
applyProducts
.
push_back
(
p
);
c
.
applyProducts
.
push_back
(
p
);
}
}
c
.
code
=
couponOb
[
"code"
].
toString
();
c
.
code
=
couponOb
[
"code"
].
toString
();
...
@@ -56,7 +57,7 @@ QByteArray TaskCoupon::doTask()
...
@@ -56,7 +57,7 @@ QByteArray TaskCoupon::doTask()
void
TaskCoupon
::
packageServerReq
()
void
TaskCoupon
::
packageServerReq
()
{
{
serverReqJsonObj
[
"appId"
]
=
APP_ID
;
serverReqJsonObj
[
"appId"
]
=
APP_ID
;
serverReqJsonObj
[
"reqType"
]
=
FM_Coupon
;
serverReqJsonObj
[
"reqType"
]
=
QString
::
number
(
FM_Coupon
)
;
serverReqJsonObj
[
"stationId"
]
=
getPosJsonValue
(
"pos_id"
);
serverReqJsonObj
[
"stationId"
]
=
getPosJsonValue
(
"pos_id"
);
serverReqJsonObj
[
"storeId"
]
=
getPosJsonValue
(
"store_id"
);
serverReqJsonObj
[
"storeId"
]
=
getPosJsonValue
(
"store_id"
);
serverReqJsonObj
[
"operatorId"
]
=
getPosJsonValue
(
"operator_id"
);
serverReqJsonObj
[
"operatorId"
]
=
getPosJsonValue
(
"operator_id"
);
...
@@ -67,14 +68,14 @@ void TaskCoupon::packageServerReq()
...
@@ -67,14 +68,14 @@ void TaskCoupon::packageServerReq()
QJsonObject
transaction
;
QJsonObject
transaction
;
transaction
[
"memberTransId"
]
=
""
;
transaction
[
"memberTransId"
]
=
""
;
transaction
[
"account"
]
=
getPosJsonValue
(
"fm_open_id"
);
transaction
[
"account"
]
=
getPosJsonValue
(
"fm_open_id"
);
transaction
[
"isUseScore"
]
=
1
;
transaction
[
"isUseScore"
]
=
0
;
transaction
[
"payAmount"
]
=
getPosJsonValue
(
"need_amount"
);
transaction
[
"payAmount"
]
=
getPosJsonValue
(
"need_amount"
);
QJsonArray
products
;
QJsonArray
products
;
QJsonArray
clientArr
=
getPosJsonValue
(
"products"
).
toArray
();
QJsonArray
clientArr
=
getPosJsonValue
(
"products"
).
toArray
();
for
(
int
i
=
0
;
i
<
clientArr
.
size
();
i
++
)
for
(
int
i
=
0
;
i
<
clientArr
.
size
();
i
++
)
{
{
QJsonObject
product
;
QJsonObject
product
;
product
[
"consumeNum"
]
=
clientArr
[
i
].
toObject
()[
"consume_num"
];
product
[
"consumeNum"
]
=
clientArr
[
i
].
toObject
()[
"consume_num"
]
.
toString
().
toDouble
()
;
product
[
"price"
]
=
clientArr
[
i
].
toObject
()[
"price"
];
product
[
"price"
]
=
clientArr
[
i
].
toObject
()[
"price"
];
product
[
"productId"
]
=
clientArr
[
i
].
toObject
()[
"pid"
];
product
[
"productId"
]
=
clientArr
[
i
].
toObject
()[
"pid"
];
products
.
append
(
product
);
products
.
append
(
product
);
...
@@ -109,7 +110,6 @@ bool TaskCoupon::sendToServer(bool isShowMsg)
...
@@ -109,7 +110,6 @@ bool TaskCoupon::sendToServer(bool isShowMsg)
setError
(
FM_API_BADJSON
);
setError
(
FM_API_BADJSON
);
}
else
{
}
else
{
serverRspJsonObj
=
rspJson
.
object
();
serverRspJsonObj
=
rspJson
.
object
();
// 服务器返回的错误
// 服务器返回的错误
if
(
serverRspJsonObj
.
contains
(
"errcode"
))
{
if
(
serverRspJsonObj
.
contains
(
"errcode"
))
{
setError
(
FM_API_SERVERERROR
,
serverRspJsonObj
[
"errcode"
].
toInt
(),
serverRspJsonObj
[
"errmsg"
].
toString
());
setError
(
FM_API_SERVERERROR
,
serverRspJsonObj
[
"errcode"
].
toInt
(),
serverRspJsonObj
[
"errmsg"
].
toString
());
...
@@ -120,10 +120,10 @@ bool TaskCoupon::sendToServer(bool isShowMsg)
...
@@ -120,10 +120,10 @@ bool TaskCoupon::sendToServer(bool isShowMsg)
FMP_INFO
()
<<
"Server rsponse: "
<<
serverRspJsonObj
;
FMP_INFO
()
<<
"Server rsponse: "
<<
serverRspJsonObj
;
bool
isOk
=
(
error
()
==
FM_API_SUCCESS
);
bool
isOk
=
(
error
()
==
FM_API_SUCCESS
);
if
(
!
isOk
&&
isShowMsg
)
//
if(!isOk && isShowMsg)
{
//
{
FMMsgWnd
::
FailureWnd
(
errorString
(),
nullptr
);
//
FMMsgWnd::FailureWnd(errorString(), nullptr);
}
//
}
return
isOk
;
return
isOk
;
}
}
...
@@ -135,69 +135,115 @@ void TaskCoupon::packagePOSRsp()
...
@@ -135,69 +135,115 @@ void TaskCoupon::packagePOSRsp()
posRspJsonObj
[
"msg"
]
=
getServerJsonValue
(
"msg"
);
posRspJsonObj
[
"msg"
]
=
getServerJsonValue
(
"msg"
);
}
}
QJsonValue
TaskCoupon
::
searchJsonValue
(
QJsonObject
&
searchJson
,
QString
searchKey
)
//QJsonValue TaskCoupon::searchJsonObject(QJsonObject& searchJson, QString searchKey)
{
//{
if
(
searchJson
.
contains
(
searchKey
))
{
// QJsonValue value;
return
searchJson
[
searchKey
];
// if(searchJson.contains(searchKey))
}
else
{
// {
qDebug
()
<<
searchJson
.
keys
();
// return searchJson[searchKey];
foreach
(
QString
key
,
searchJson
.
keys
())
{
// }
if
(
searchJson
[
key
].
isObject
())
{
// else
QJsonObject
ob
=
searchJson
[
key
].
toObject
();
// {
QJsonValue
value
=
searchJsonValue
(
ob
,
searchKey
);
// foreach(QString key, searchJson.keys())
if
(
!
value
.
isNull
()){
// {
return
value
;
// if(searchJson[key].isObject())
}
// {
}
// QJsonObject ob = searchJson[key].toObject();
}
// value = searchJsonObject(ob, searchKey);
}
// }
return
QJsonValue
();
// else if(searchJson[key].isArray())
}
// {
// QJsonArray arr = searchJson[key].toArray();
QJsonValue
TaskCoupon
::
getServerJsonValue
(
const
QString
prop
)
// value = searchJsonArray(arr, searchKey);
{
// }
return
searchJsonValue
(
serverRspJsonObj
,
prop
);
// }
}
// }
// return value;
QJsonValue
TaskCoupon
::
getPosJsonValue
(
const
QString
prop
)
//}
{
return
searchJsonValue
(
posReqJsonObj
,
prop
);
//QJsonValue TaskCoupon::searchJsonArray(QJsonArray& searchJson, QString searchKey)
}
//{
// QJsonValue value;
QString
TaskCoupon
::
sign
()
const
// for(int i = 0; i < searchJson.size(); i++)
{
// {
FMP_DEBUG
()
<<
__FUNCTION__
;
// if(searchJson[i].isObject())
// 解析JSON插入MAP中按字典排序
// {
QMap
<
QString
,
QString
>
mapData
;
// QJsonObject ob = searchJson[i].toObject();
// value = searchJsonObject(ob, searchKey);
for
(
int
i
=
0
;
i
<
sizeof
(
SignProps
)
/
sizeof
(
SignProps
[
0
]);
++
i
)
{
// }
QString
word
=
SignProps
[
i
];
// else if(searchJson[i].isArray())
if
(
serverReqJsonObj
[
word
].
isDouble
())
{
// {
mapData
[
word
]
=
QString
::
number
(
serverReqJsonObj
[
word
].
toDouble
());
// QJsonArray arr = searchJson[i].toArray();
}
else
{
// value = searchJsonArray(arr, searchKey);
mapData
[
word
]
=
serverReqJsonObj
[
word
].
toString
();
// }
}
// }
}
// return value;
//}
if
(
serverRspJsonObj
[
ServerProps
(
PosProps
.
Fm_cmd
)].
toInt
()
==
FM_Fund
)
{
mapData
[
ServerProps
(
PosProps
.
TransId
)]
=
serverReqJsonObj
[
ServerProps
(
PosProps
.
TransId
)].
toString
();
//QJsonValue TaskCoupon::searchJsonValue(QJsonObject &searchJson, QString searchKey)
}
//{
// if(searchJson.contains(searchKey)) {
// 使用URL键值对的格式拼接
// return searchJson[searchKey];
QString
sb
=
""
;
// } else {
foreach
(
QString
key
,
mapData
.
keys
())
// foreach(QString key , searchJson.keys()) {
{
// if(searchJson[key].isObject()) {
sb
+=
(
key
+
"="
+
mapData
.
value
(
key
)
+
"&"
);
// QJsonObject ob = searchJson[key].toObject();
}
// QJsonValue value = searchJsonValue(ob, searchKey);
sb
.
remove
(
sb
.
length
()
-
1
,
1
);
// 去掉最后一个&
// if(!value.isNull()){
// return value;
sb
.
append
(
KEY_CODE
);
// }
// }
QByteArray
bt
;
// }
bt
.
append
(
sb
);
// }
// return QJsonValue();
FMP_INFO
()
<<
"Sign String: "
<<
bt
;
//}
QByteArray
md5Bt
=
QCryptographicHash
::
hash
(
bt
,
QCryptographicHash
::
Md5
);
//QJsonValue TaskCoupon::getServerJsonValue(const QString prop)
return
md5Bt
.
toHex
();
//{
}
// //return searchJsonValue(serverRspJsonObj, prop);
\ No newline at end of file
// return searchJsonObject(serverRspJsonObj, prop);
//}
//QJsonValue TaskCoupon::getPosJsonValue(const QString prop)
//{
// //return searchJsonValue(posReqJsonObj, prop);
// return searchJsonObject(posReqJsonObj, prop);
//}
//QString TaskCoupon::sign() const
//{
// FMP_DEBUG() << __FUNCTION__;
// // 解析JSON插入MAP中按字典排序
// QMap<QString, QString> mapData;
// for(int i=0; i<sizeof(SignProps)/sizeof(SignProps[0]); ++i) {
// QString word = SignProps[i];
// if(serverReqJsonObj[word].isDouble()) {
// mapData[word] = QString::number(serverReqJsonObj[word].toDouble());
// } else {
// mapData[word] = serverReqJsonObj[word].toString();
// }
// }
// if (serverRspJsonObj[ServerProps(PosProps.Fm_cmd)].toInt() == FM_Fund) {
// mapData[ServerProps(PosProps.TransId)] = serverReqJsonObj[ServerProps(PosProps.TransId)].toString();
// }
// // 使用URL键值对的格式拼接
// QString sb = "";
// foreach(QString key , mapData.keys())
// {
// sb += (key + "=" + mapData.value(key) + "&");
// }
// sb.remove(sb.length() - 1, 1); // 去掉最后一个&
// sb.append(KEY_CODE);
// QByteArray bt;
// bt.append(sb);
// FMP_INFO() << "Sign String: " << bt;
// QByteArray md5Bt = QCryptographicHash::hash(bt, QCryptographicHash::Md5);
// return md5Bt.toHex();
//
}
\ No newline at end of file
task/taskcoupon.h
View file @
21fd80c3
...
@@ -4,9 +4,10 @@
...
@@ -4,9 +4,10 @@
#include <QObject>
#include <QObject>
#include <QJsonObject>
#include <QJsonObject>
#include "session.h"
#include "session.h"
#include "fmtask.h"
//根据订单,查询可用的优惠券
//根据订单,查询可用的优惠券
class
TaskCoupon
:
public
QObject
class
TaskCoupon
:
public
/*QObject*/
FMTask
{
{
Q_OBJECT
Q_OBJECT
public
:
public
:
...
@@ -14,53 +15,55 @@ public:
...
@@ -14,53 +15,55 @@ public:
QByteArray
doTask
();
QByteArray
doTask
();
Session
*
session
()
const
{
return
_session
;}
//
Session* session() const {return _session;}
QJsonValue
searchJsonValue
(
QJsonObject
&
searchJson
,
QString
searchKey
);
// QJsonValue searchJsonValue(QJsonObject &searchJson, QString searchKey);
QJsonValue
getServerJsonValue
(
const
QString
prop
);
// QJsonValue searchJsonObject(QJsonObject& searchJson, QString searchKey);
QJsonValue
getPosJsonValue
(
const
QString
prop
);
// QJsonValue searchJsonArray(QJsonArray& searchJson, QString searchKey);
// QJsonValue getServerJsonValue(const QString prop);
// QJsonValue getPosJsonValue(const QString prop);
pr
otected
:
pr
ivate
:
void
packageServerReq
();
void
packageServerReq
();
bool
sendToServer
(
bool
isShowMsg
=
true
);
bool
sendToServer
(
bool
isShowMsg
=
true
);
void
packagePOSRsp
();
void
packagePOSRsp
();
protected
:
//
protected:
QJsonObject
posReqJsonObj
;
//
QJsonObject posReqJsonObj;
QJsonObject
posRspJsonObj
;
//
QJsonObject posRspJsonObj;
QJsonObject
serverReqJsonObj
;
//
QJsonObject serverReqJsonObj;
QJsonObject
serverRspJsonObj
;
//
QJsonObject serverRspJsonObj;
Session
*
_session
;
//
Session *_session;
QString
url
;
//
QString url;
private
:
//
private:
QString
sign
()
const
;
//
QString sign() const;
/**
//
/**
* @brief FMError
//
* @brief FMError
* define error.
//
* define error.
*/
//
*/
typedef
int
FMError
;
//
typedef int FMError;
public
:
//
public:
FMError
error
()
const
{
return
_error
;}
//
FMError error() const {return _error;}
void
setError
(
const
FMError
error
)
//
void setError(const FMError error)
{
_error
=
error
;
_errorMsg
=
""
;}
//
{ _error = error; _errorMsg = "";}
void
setError
(
const
FMError
error
,
const
QString
errorMsg
)
//
void setError(const FMError error, const QString errorMsg)
{
_error
=
error
;
_errorMsg
=
errorMsg
;}
//
{ _error = error; _errorMsg = errorMsg;}
void
setError
(
const
FMError
error
,
const
int
errorCode
,
const
QString
errorMsg
)
//
void setError(const FMError error, const int errorCode, const QString errorMsg)
{
_error
=
error
;
_errorMsg
=
QString
(
"[%1]%2"
).
arg
(
errorCode
).
arg
(
errorMsg
);}
//
{ _error = error; _errorMsg = QString("[%1]%2").arg(errorCode).arg(errorMsg);}
QString
errorString
()
{
//
QString errorString() {
if
(
fm_error
.
find
(
_error
)
==
fm_error
.
end
())
{
//
if(fm_error.find(_error) == fm_error.end()) {
return
"Undefine Error"
;
//
return "Undefine Error";
}
else
{
//
} else {
if
(
_errorMsg
!=
""
)
//
if(_errorMsg != "")
return
_errorMsg
;
//
return _errorMsg;
return
fm_error
.
at
(
_error
);
//
return fm_error.at(_error);
}
//
}
}
//
}
private
:
//
private:
FMError
_error
;
//
FMError _error;
QString
_errorMsg
;
//
QString _errorMsg;
};
};
#endif // TASKCOUPON_H
#endif // TASKCOUPON_H
\ No newline at end of file
task/taskfinal.cpp
View file @
21fd80c3
This diff is collapsed.
Click to expand it.
task/taskfinal.h
View file @
21fd80c3
...
@@ -3,62 +3,65 @@
...
@@ -3,62 +3,65 @@
#include <QObject>
#include <QObject>
#include <QJsonObject>
#include <QJsonObject>
#include "session.h"
#include "session.h"
#include "fmtask.h"
class
TaskFinal
:
public
QObject
class
TaskFinal
:
public
/*QObject*/
FMTask
{
{
Q_OBJECT
Q_OBJECT
public
:
public
:
explicit
TaskFinal
(
QJsonObject
&
jsonObj
,
Session
*
session
=
0
,
QObject
*
parent
=
0
);
explicit
TaskFinal
(
QJsonObject
&
jsonObj
,
Session
*
session
=
0
,
QObject
*
parent
=
0
);
QByteArray
doTask
();
QByteArray
doTask
();
void
setFM_Type
(
const
FM_TYPE
fmType
)
{
_FM_Type
=
fmType
;}
//
void setFM_Type(const FM_TYPE fmType) {_FM_Type = fmType;}
FM_TYPE
FM_Type
()
const
{
return
_FM_Type
;}
//
FM_TYPE FM_Type() const { return _FM_Type;}
Session
*
session
()
const
{
return
_session
;}
//
Session* session() const {return _session;}
void
packageServerReq
();
void
packageServerReq
();
bool
sendToServer
(
bool
isShowMsg
=
true
);
bool
sendToServer
(
bool
isShowMsg
=
true
);
void
packagePOSRsp
();
void
packagePOSRsp
();
QJsonValue
searchJsonValue
(
QJsonObject
&
searchJson
,
QString
searchKey
);
// QJsonValue searchJsonValue(QJsonObject &searchJson, QString searchKey);
QJsonValue
getServerJsonValue
(
const
QString
prop
);
// QJsonValue searchJsonObject(QJsonObject& searchJson, QString searchKey);
QJsonValue
getPosJsonValue
(
const
QString
prop
);
// QJsonValue searchJsonArray(QJsonArray& searchJson, QString searchKey);
// QJsonValue getServerJsonValue(const QString prop);
// QJsonValue getPosJsonValue(const QString prop);
private:
private:
QString
backup
();
QString
backup
();
QString
sign
()
const
;
//
QString sign() const;
QJsonObject
posReqJsonObj
;
//
QJsonObject posReqJsonObj;
QJsonObject
posRspJsonObj
;
//
QJsonObject posRspJsonObj;
QJsonObject
serverReqJsonObj
;
//
QJsonObject serverReqJsonObj;
QJsonObject
serverRspJsonObj
;
//
QJsonObject serverRspJsonObj;
Session
*
_session
;
//
Session *_session;
FM_TYPE
_FM_Type
;
//
FM_TYPE _FM_Type;
QString
url
;
//
QString url;
/**
//
/**
* @brief FMError
//
* @brief FMError
* define error.
//
* define error.
*/
//
*/
typedef
int
FMError
;
//
typedef int FMError;
public
:
//
public:
FMError
error
()
const
{
return
_error
;}
//
FMError error() const {return _error;}
void
setError
(
const
FMError
error
)
//
void setError(const FMError error)
{
_error
=
error
;
_errorMsg
=
""
;}
//
{ _error = error; _errorMsg = "";}
void
setError
(
const
FMError
error
,
const
QString
errorMsg
)
//
void setError(const FMError error, const QString errorMsg)
{
_error
=
error
;
_errorMsg
=
errorMsg
;}
//
{ _error = error; _errorMsg = errorMsg;}
void
setError
(
const
FMError
error
,
const
int
errorCode
,
const
QString
errorMsg
)
//
void setError(const FMError error, const int errorCode, const QString errorMsg)
{
_error
=
error
;
_errorMsg
=
QString
(
"[%1]%2"
).
arg
(
errorCode
).
arg
(
errorMsg
);}
//
{ _error = error; _errorMsg = QString("[%1]%2").arg(errorCode).arg(errorMsg);}
QString
errorString
()
{
//
QString errorString() {
if
(
fm_error
.
find
(
_error
)
==
fm_error
.
end
())
{
//
if(fm_error.find(_error) == fm_error.end()) {
return
"Undefine Error"
;
//
return "Undefine Error";
}
else
{
//
} else {
if
(
_errorMsg
!=
""
)
//
if(_errorMsg != "")
return
_errorMsg
;
//
return _errorMsg;
return
fm_error
.
at
(
_error
);
//
return fm_error.at(_error);
}
//
}
}
//
}
private
:
//
private:
FMError
_error
;
//
FMError _error;
QString
_errorMsg
;
//
QString _errorMsg;
};
};
#endif // TASKFINAL_H
#endif // TASKFINAL_H
task/tasklogin.cpp
View file @
21fd80c3
This diff is collapsed.
Click to expand it.
task/tasklogin.h
View file @
21fd80c3
...
@@ -3,20 +3,23 @@
...
@@ -3,20 +3,23 @@
#include "fmtask.h"
#include "fmtask.h"
#include <QObject>
#include <QObject>
#include <QJsonObject>
#include <QJsonObject>
#include "fmtask.h"
class
TaskLogin
:
public
QObject
class
TaskLogin
:
public
/*QObject*/
FMTask
{
{
Q_OBJECT
Q_OBJECT
public
:
public
:
explicit
TaskLogin
(
QJsonObject
&
jsonObj
,
Session
*
session
=
0
,
QObject
*
parent
=
0
);
explicit
TaskLogin
(
QJsonObject
&
jsonObj
,
Session
*
session
=
0
,
QObject
*
parent
=
0
);
~
TaskLogin
();
//
~TaskLogin();
QByteArray
doTask
();
QByteArray
doTask
();
Session
*
session
()
const
{
return
_session
;}
//
Session* session() const {return _session;}
QJsonValue
searchJsonValue
(
QJsonObject
&
searchJson
,
QString
searchKey
);
// QJsonValue searchJsonValue(QJsonObject &searchJson, QString searchKey);
QJsonValue
getServerJsonValue
(
const
QString
prop
);
// QJsonValue searchJsonObject(QJsonObject& searchJson, QString searchKey);
QJsonValue
getPosJsonValue
(
const
QString
prop
);
// QJsonValue searchJsonArray(QJsonArray& searchJson, QString searchKey);
// QJsonValue getServerJsonValue(const QString prop);
// QJsonValue getPosJsonValue(const QString prop);
private
:
private
:
void
setWindow
();
void
setWindow
();
...
@@ -29,42 +32,42 @@ public slots:
...
@@ -29,42 +32,42 @@ public slots:
void
onLogin
();
void
onLogin
();
private
:
private
:
QString
sign
()
const
;
//
QString sign() const;
private
:
private
:
QJsonObject
posReqJsonObj
;
//pos发来的请求数据
//
QJsonObject posReqJsonObj; //pos发来的请求数据
QJsonObject
posRspJsonObj
;
//返回给pos的数据
//
QJsonObject posRspJsonObj; //返回给pos的数据
QJsonObject
serverReqJsonObj
;
//发送给server端的请求数据
//
QJsonObject serverReqJsonObj; //发送给server端的请求数据
QJsonObject
serverRspJsonObj
;
//server返回的数据
//
QJsonObject serverRspJsonObj; //server返回的数据
FMVipWnd
*
_window
;
//
FMVipWnd *_window;
Session
*
_session
;
//
Session *_session;
QString
url
;
//server url
//
QString url; //server url
/**
//
/**
* @brief FMError
//
* @brief FMError
* define error.
//
* define error.
*/
//
*/
typedef
int
FMError
;
//
typedef int FMError;
public
:
//
public:
FMError
error
()
const
{
return
_error
;}
//
FMError error() const {return _error;}
void
setError
(
const
FMError
error
)
//
void setError(const FMError error)
{
_error
=
error
;
_errorMsg
=
""
;}
//
{ _error = error; _errorMsg = "";}
void
setError
(
const
FMError
error
,
const
QString
errorMsg
)
//
void setError(const FMError error, const QString errorMsg)
{
_error
=
error
;
_errorMsg
=
errorMsg
;}
//
{ _error = error; _errorMsg = errorMsg;}
void
setError
(
const
FMError
error
,
const
int
errorCode
,
const
QString
errorMsg
)
//
void setError(const FMError error, const int errorCode, const QString errorMsg)
{
_error
=
error
;
_errorMsg
=
QString
(
"[%1]%2"
).
arg
(
errorCode
).
arg
(
errorMsg
);}
//
{ _error = error; _errorMsg = QString("[%1]%2").arg(errorCode).arg(errorMsg);}
QString
errorString
()
{
//
QString errorString() {
if
(
fm_error
.
find
(
_error
)
==
fm_error
.
end
())
{
//
if(fm_error.find(_error) == fm_error.end()) {
return
"Undefine Error"
;
//
return "Undefine Error";
}
else
{
//
} else {
if
(
_errorMsg
!=
""
)
//
if(_errorMsg != "")
return
_errorMsg
;
//
return _errorMsg;
return
fm_error
.
at
(
_error
);
//
return fm_error.at(_error);
}
//
}
}
//
}
private
:
//
private:
FMError
_error
;
//
FMError _error;
QString
_errorMsg
;
//
QString _errorMsg;
};
};
#endif // TASKLOGIN_H
#endif // TASKLOGIN_H
\ No newline at end of file
task/taskpay.cpp
View file @
21fd80c3
This diff is collapsed.
Click to expand it.
task/taskpay.h
View file @
21fd80c3
...
@@ -3,12 +3,12 @@
...
@@ -3,12 +3,12 @@
#include "fmtask.h"
#include "fmtask.h"
#include "taskcoupon.h"
#include "taskcoupon.h"
class
TaskPay
:
public
QObject
class
TaskPay
:
public
/*QObject*/
FMTask
{
{
Q_OBJECT
Q_OBJECT
public
:
public
:
explicit
TaskPay
(
QJsonObject
&
jsonObj
,
Session
*
session
=
0
,
QObject
*
parent
=
0
);
explicit
TaskPay
(
QJsonObject
&
jsonObj
,
Session
*
session
=
0
,
QObject
*
parent
=
0
);
~
TaskPay
();
//
~TaskPay();
QByteArray
doTask
();
QByteArray
doTask
();
QByteArray
queryMemberInfo
();
QByteArray
queryMemberInfo
();
...
@@ -18,52 +18,54 @@ public:
...
@@ -18,52 +18,54 @@ public:
bool
sendToServer
(
bool
isShowMsg
=
true
);
bool
sendToServer
(
bool
isShowMsg
=
true
);
void
packagePOSRsp
();
void
packagePOSRsp
();
Session
*
session
()
const
{
return
_session
;}
//
Session* session() const {return _session;}
QJsonValue
searchJsonValue
(
QJsonObject
&
searchJson
,
QString
searchKey
);
// QJsonValue searchJsonValue(QJsonObject &searchJson, QString searchKey);
QJsonValue
getServerJsonValue
(
const
QString
prop
);
// QJsonValue searchJsonObject(QJsonObject& searchJson, QString searchKey);
QJsonValue
getPosJsonValue
(
const
QString
prop
);
// QJsonValue searchJsonArray(QJsonArray& searchJson, QString searchKey);
// QJsonValue getServerJsonValue(const QString prop);
// QJsonValue getPosJsonValue(const QString prop);
private
slots
:
private
slots
:
void
onPay
();
void
onPay
();
private
:
private
:
QJsonObject
posReqJsonObj
;
//
QJsonObject posReqJsonObj;
QJsonObject
posRspJsonObj
;
//
QJsonObject posRspJsonObj;
QJsonObject
serverReqJsonObj
;
//
QJsonObject serverReqJsonObj;
QJsonObject
serverRspJsonObj
;
//
QJsonObject serverRspJsonObj;
FMVipWnd
*
_window
;
//
FMVipWnd *_window;
Session
*
_session
;
//
Session *_session;
QString
url
;
//
QString url;
private
:
private
:
QString
sign
()
const
;
//
QString sign() const;
/**
//
/**
* @brief FMError
//
* @brief FMError
* define error.
//
* define error.
*/
//
*/
typedef
int
FMError
;
//
typedef int FMError;
public
:
//
public:
FMError
error
()
const
{
return
_error
;}
//
FMError error() const {return _error;}
void
setError
(
const
FMError
error
)
//
void setError(const FMError error)
{
_error
=
error
;
_errorMsg
=
""
;}
//
{ _error = error; _errorMsg = "";}
void
setError
(
const
FMError
error
,
const
QString
errorMsg
)
//
void setError(const FMError error, const QString errorMsg)
{
_error
=
error
;
_errorMsg
=
errorMsg
;}
//
{ _error = error; _errorMsg = errorMsg;}
void
setError
(
const
FMError
error
,
const
int
errorCode
,
const
QString
errorMsg
)
//
void setError(const FMError error, const int errorCode, const QString errorMsg)
{
_error
=
error
;
_errorMsg
=
QString
(
"[%1]%2"
).
arg
(
errorCode
).
arg
(
errorMsg
);}
//
{ _error = error; _errorMsg = QString("[%1]%2").arg(errorCode).arg(errorMsg);}
QString
errorString
()
{
//
QString errorString() {
if
(
fm_error
.
find
(
_error
)
==
fm_error
.
end
())
{
//
if(fm_error.find(_error) == fm_error.end()) {
return
"Undefine Error"
;
//
return "Undefine Error";
}
else
{
//
} else {
if
(
_errorMsg
!=
""
)
//
if(_errorMsg != "")
return
_errorMsg
;
//
return _errorMsg;
return
fm_error
.
at
(
_error
);
//
return fm_error.at(_error);
}
//
}
}
//
}
private
:
//
private:
FMError
_error
;
//
FMError _error;
QString
_errorMsg
;
//
QString _errorMsg;
};
};
#endif // TASKPAY_H
#endif // TASKPAY_H
windows/fmviplogin.cpp
View file @
21fd80c3
...
@@ -21,7 +21,7 @@ void FMVipLogin::initWnd(Session *session)
...
@@ -21,7 +21,7 @@ void FMVipLogin::initWnd(Session *session)
{
{
this
->
_session
=
session
;
this
->
_session
=
session
;
QString
placeText
=
QString
::
fromLocal8Bit
(
"
输入手机号/会员码/
支付码"
);
QString
placeText
=
QString
::
fromLocal8Bit
(
"
请输入
支付码"
);
// if(session->data(PosProps.FM_Type).toInt() == FM_Pay) {
// if(session->data(PosProps.FM_Type).toInt() == FM_Pay) {
// placeText = QString::fromLocal8Bit("输入支付码");
// placeText = QString::fromLocal8Bit("输入支付码");
// } else {
// } else {
...
...
windows/fmviporder.cpp
View file @
21fd80c3
...
@@ -21,6 +21,10 @@ FMVipOrder::~FMVipOrder()
...
@@ -21,6 +21,10 @@ FMVipOrder::~FMVipOrder()
void
FMVipOrder
::
initWnd
(
Session
*
se
)
void
FMVipOrder
::
initWnd
(
Session
*
se
)
{
{
//天福目前不使用积分支付和满减,故隐藏相关控件
ui
->
pay_chk
->
hide
();
ui
->
standard_label
->
hide
();
this
->
_session
=
se
;
this
->
_session
=
se
;
QString
operator_id
=
session
()
->
data
(
"operator_id"
).
toString
();
QString
operator_id
=
session
()
->
data
(
"operator_id"
).
toString
();
QString
business_date
=
session
()
->
data
(
"business_date"
).
toString
();
QString
business_date
=
session
()
->
data
(
"business_date"
).
toString
();
...
...
windows/forms/fmmsgwnd.ui
View file @
21fd80c3
...
@@ -106,176 +106,29 @@
...
@@ -106,176 +106,29 @@
opacity:0;
opacity:0;
}
</string>
}
</string>
</property>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
>
<widget
class=
"QPushButton"
name=
"btn_confirm"
>
<property
name=
"spacing"
>
<property
name=
"geometry"
>
<number>
0
</number>
<rect>
<x>
1
</x>
<y>
160
</y>
<width>
341
</width>
<height>
62
</height>
</rect>
</property>
</property>
<property
name=
"leftMargin"
>
<property
name=
"minimumSize"
>
<number>
0
</number>
<size>
<width>
121
</width>
<height>
62
</height>
</size>
</property>
</property>
<property
name=
"topMargin"
>
<property
name=
"maximumSize"
>
<number>
0
</number>
<size>
<width>
16777215
</width>
<height>
62
</height>
</size>
</property>
</property>
<property
name=
"rightMargin"
>
<property
name=
"styleSheet"
>
<number>
0
</number>
<string
notr=
"true"
>
#btn_confirm
</property>
<property
name=
"bottomMargin"
>
<number>
0
</number>
</property>
<item>
<spacer
name=
"verticalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
40
</height>
</size>
</property>
</spacer>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout_2"
>
<property
name=
"spacing"
>
<number>
0
</number>
</property>
<item>
<spacer
name=
"horizontalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
40
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
<item>
<widget
class=
"QLabel"
name=
"label_logo"
>
<property
name=
"minimumSize"
>
<size>
<width>
60
</width>
<height>
60
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
80
</width>
<height>
16777215
</height>
</size>
</property>
<property
name=
"styleSheet"
>
<string
notr=
"true"
/>
</property>
<property
name=
"text"
>
<string/>
</property>
</widget>
</item>
<item>
<spacer
name=
"horizontalSpacer_7"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeType"
>
<enum>
QSizePolicy::Minimum
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
13
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
<item>
<widget
class=
"QLabel"
name=
"label_msg"
>
<property
name=
"minimumSize"
>
<size>
<width>
161
</width>
<height>
0
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
16777215
</width>
<height>
16777215
</height>
</size>
</property>
<property
name=
"font"
>
<font>
<family>
微软雅黑
</family>
<pointsize>
16
</pointsize>
<weight>
50
</weight>
<italic>
false
</italic>
<bold>
false
</bold>
</font>
</property>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
#label_msg
{
color: rgb(100, 100, 100);
font: 16pt
"
微软雅黑
"
;
}
</string>
</property>
<property
name=
"text"
>
<string>
成功
</string>
</property>
<property
name=
"wordWrap"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item>
<spacer
name=
"horizontalSpacer_2"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeType"
>
<enum>
QSizePolicy::Expanding
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
13
</width>
<height>
57
</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer
name=
"verticalSpacer_2"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
40
</height>
</size>
</property>
</spacer>
</item>
<item>
<widget
class=
"QPushButton"
name=
"btn_confirm"
>
<property
name=
"minimumSize"
>
<size>
<width>
121
</width>
<height>
62
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
16777215
</width>
<height>
62
</height>
</size>
</property>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
#btn_confirm
{
{
font: 75 16pt
"
微软雅黑
"
;
font: 75 16pt
"
微软雅黑
"
;
border-bottom-right-radius: 8px;
border-bottom-right-radius: 8px;
...
@@ -283,16 +136,83 @@
...
@@ -283,16 +136,83 @@
background-color: rgb(93, 144, 236);
background-color: rgb(93, 144, 236);
color: rgb(255, 255, 255);
color: rgb(255, 255, 255);
}
</string>
}
</string>
</property>
</property>
<property
name=
"text"
>
<property
name=
"text"
>
<string>
确认
</string>
<string>
确认
</string>
</property>
</property>
</widget>
</widget>
</item>
<widget
class=
"QLabel"
name=
"label_msg"
>
</layout>
<property
name=
"geometry"
>
<zorder>
verticalSpacer
</zorder>
<rect>
<zorder>
verticalSpacer_2
</zorder>
<x>
138
</x>
<zorder>
btn_confirm
</zorder>
<y>
33
</y>
<width>
191
</width>
<height>
101
</height>
</rect>
</property>
<property
name=
"minimumSize"
>
<size>
<width>
161
</width>
<height>
0
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
16777215
</width>
<height>
16777215
</height>
</size>
</property>
<property
name=
"font"
>
<font>
<family>
微软雅黑
</family>
<pointsize>
16
</pointsize>
<weight>
50
</weight>
<italic>
false
</italic>
<bold>
false
</bold>
</font>
</property>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
#label_msg
{
color: rgb(100, 100, 100);
font: 16pt
"
微软雅黑
"
;
}
</string>
</property>
<property
name=
"text"
>
<string>
成功
</string>
</property>
<property
name=
"wordWrap"
>
<bool>
true
</bool>
</property>
</widget>
<widget
class=
"QLabel"
name=
"label_logo"
>
<property
name=
"geometry"
>
<rect>
<x>
47
</x>
<y>
48
</y>
<width>
60
</width>
<height>
60
</height>
</rect>
</property>
<property
name=
"minimumSize"
>
<size>
<width>
60
</width>
<height>
60
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
60
</width>
<height>
60
</height>
</size>
</property>
<property
name=
"styleSheet"
>
<string
notr=
"true"
/>
</property>
<property
name=
"text"
>
<string/>
</property>
</widget>
</widget>
</widget>
</item>
</item>
<item>
<item>
...
...
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