Commit b0ec2e4e by NitefullWind

1. 认证返回levelCode字段。 2. 认证将memberDiscount转为"Y"或空字符串。

parent 82dc02b4
...@@ -11,6 +11,8 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets ...@@ -11,6 +11,8 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++11 CONFIG += c++11
#DEFINES += FMTEST
SOURCES += \ SOURCES += \
fmp_vip.cpp \ fmp_vip.cpp \
fmp_vip_p.cpp \ fmp_vip_p.cpp \
......
...@@ -52,6 +52,7 @@ void TaskLogin::packagePOSRsp() ...@@ -52,6 +52,7 @@ void TaskLogin::packagePOSRsp()
posRspJsonObj["name"] = getServerJsonValue("name").toString(); posRspJsonObj["name"] = getServerJsonValue("name").toString();
posRspJsonObj["sex"] = getServerJsonValue("sex").toString(); posRspJsonObj["sex"] = getServerJsonValue("sex").toString();
posRspJsonObj["birthday"] = getServerJsonValue("birthday").toString(); posRspJsonObj["birthday"] = getServerJsonValue("birthday").toString();
posRspJsonObj["levelCode"] = getServerJsonValue("levelCode").toString();
QString phone = getServerJsonValue("mobile").toString(); QString phone = getServerJsonValue("mobile").toString();
if(phone.isEmpty()) { if(phone.isEmpty()) {
phone = session()->data(PosProps.Phone).toString(); phone = session()->data(PosProps.Phone).toString();
...@@ -61,7 +62,9 @@ void TaskLogin::packagePOSRsp() ...@@ -61,7 +62,9 @@ void TaskLogin::packagePOSRsp()
posRspJsonObj["email"] = getServerJsonValue("email").toString(); posRspJsonObj["email"] = getServerJsonValue("email").toString();
posRspJsonObj[PosProps.Member_sign] = session()->data(PosProps.Member_sign).toString(); posRspJsonObj[PosProps.Member_sign] = session()->data(PosProps.Member_sign).toString();
posRspJsonObj["memberDiscount"] = getServerJsonValue("memberDiscount").toDouble(1.00); QJsonValue discount = getServerJsonValue("memberDiscount");
posRspJsonObj["memberDiscount"] = (discount.isDouble() && discount.toDouble(1.0)!=1.0) ? "Y" : "";
} }
void TaskLogin::onLogin() void TaskLogin::onLogin()
...@@ -97,6 +100,9 @@ void TaskLogin::onLogin() ...@@ -97,6 +100,9 @@ void TaskLogin::onLogin()
QString scoreStr = QString::number(score); QString scoreStr = QString::number(score);
bool canPay = (getServerJsonValue(PosProps.CanPay).toInt() == 1); bool canPay = (getServerJsonValue(PosProps.CanPay).toInt() == 1);
#ifdef FMTEST
canPay = true;
#endif
if(!canPay) { if(!canPay) {
if(getPosJsonValue(PosProps.Fm_cmd).toInt() != FM_Pay) { if(getPosJsonValue(PosProps.Fm_cmd).toInt() != FM_Pay) {
QString info = QString::fromLocal8Bit("账号: %1\n姓名: %2\n余额: %3\n积分: %4").arg(account, name, amountStr, scoreStr); QString info = QString::fromLocal8Bit("账号: %1\n姓名: %2\n余额: %3\n积分: %4").arg(account, name, amountStr, scoreStr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment