Commit c6b8768a by NitefullWind

Merge branch 'dev' of gitlab.freemud.com:zhenfei.zhang/FMVip_LXJ into dev

parents 870cd5ed 45d1cce7
...@@ -104,7 +104,7 @@ QJsonObject FMPRedeem::Redeem(const QJsonObject &request) ...@@ -104,7 +104,7 @@ QJsonObject FMPRedeem::Redeem(const QJsonObject &request)
if(scanningDialog.exec() != QDialog::Accepted) if(scanningDialog.exec() != QDialog::Accepted)
{ {
QJsonObject ret; QJsonObject ret;
ret["statusCode"] = FM_API_WINDOWCLOSE; ret["status_code"] = FM_API_WINDOWCLOSE;
ret["msg"] = "窗口关闭"; ret["msg"] = "窗口关闭";
return ret; return ret;
} }
...@@ -283,7 +283,6 @@ QJsonObject FMPRedeem::ShowForUnConsum(QJsonObject json) ...@@ -283,7 +283,6 @@ QJsonObject FMPRedeem::ShowForUnConsum(QJsonObject json)
QJsonObject redeemResult; QJsonObject redeemResult;
QJsonObject retJson = SendRequest(reqData); QJsonObject retJson = SendRequest(reqData);
qDebug() << retJson;
int statusCode = retJson["statusCode"].toInt(); int statusCode = retJson["statusCode"].toInt();
switch(statusCode) switch(statusCode)
{ {
...@@ -320,14 +319,14 @@ QJsonObject FMPRedeem::ShowForUnConsum(QJsonObject json) ...@@ -320,14 +319,14 @@ QJsonObject FMPRedeem::ShowForUnConsum(QJsonObject json)
ErrCodeDialog::showForErr(coupon, QString("error:").append(QString::number(statusCode))); ErrCodeDialog::showForErr(coupon, QString("error:").append(QString::number(statusCode)));
break; break;
} }
redeemResult["statusCode"] = retJson["statusCode"]; redeemResult["status_code"] = retJson["statusCode"];
redeemResult["msg"] = retJson["msg"].toString(); redeemResult["msg"] = retJson["msg"].toString();
return redeemResult; return redeemResult;
} }
else else
{ {
QJsonObject retJson; QJsonObject retJson;
retJson["statusCode"] = FM_API_WINDOWCLOSE; retJson["status_code"] = FM_API_WINDOWCLOSE;
retJson["msg"] = "窗口关闭"; retJson["msg"] = "窗口关闭";
return retJson; return retJson;
} }
...@@ -337,18 +336,24 @@ QJsonObject FMPRedeem::ShowForHasConsum(QJsonObject json) ...@@ -337,18 +336,24 @@ QJsonObject FMPRedeem::ShowForHasConsum(QJsonObject json)
{ {
QString storeInfo = QString("%1(%2)").arg(_store_id).arg(_station_id); QString storeInfo = QString("%1(%2)").arg(_store_id).arg(_station_id);
ConsumptionDialog::ShowForHasConsum(json["msg"].toString(), "", storeInfo, _coupon); ConsumptionDialog::ShowForHasConsum(json["msg"].toString(), "", storeInfo, _coupon);
json["status_code"] = json["statusCode"];
json.remove("statusCode");
return json; return json;
} }
QJsonObject FMPRedeem::ShowForInvalid(QJsonObject json) QJsonObject FMPRedeem::ShowForInvalid(QJsonObject json)
{ {
ErrCodeDialog::showForInvalid(_coupon); ErrCodeDialog::showForInvalid(_coupon);
json["status_code"] = json["statusCode"];
json.remove("statusCode");
return json; return json;
} }
QJsonObject FMPRedeem::ShowForExpird(QJsonObject json) QJsonObject FMPRedeem::ShowForExpird(QJsonObject json)
{ {
ErrCodeDialog::showForExpird("", "", "", _coupon); ErrCodeDialog::showForExpird("", "", "", _coupon);
json["status_code"] = json["statusCode"];
json.remove("statusCode");
return json; return json;
} }
...@@ -357,6 +362,8 @@ QJsonObject FMPRedeem::ShowForErr(QJsonObject json) ...@@ -357,6 +362,8 @@ QJsonObject FMPRedeem::ShowForErr(QJsonObject json)
int statusCode = json["statusCode"].toInt(); int statusCode = json["statusCode"].toInt();
QString msg = json["msg"].toString(); QString msg = json["msg"].toString();
ErrCodeDialog::showForErr(_coupon, QString("%1: %2").arg(QString::number(statusCode)).arg(msg)); ErrCodeDialog::showForErr(_coupon, QString("%1: %2").arg(QString::number(statusCode)).arg(msg));
json["status_code"] = json["statusCode"];
json.remove("statusCode");
return json; return json;
} }
...@@ -364,7 +371,7 @@ QJsonObject FMPRedeem::ShowForMismatch(QJsonObject json) ...@@ -364,7 +371,7 @@ QJsonObject FMPRedeem::ShowForMismatch(QJsonObject json)
{ {
ErrCodeDialog::showForMismatch(_coupon, "券和商品不匹配"); ErrCodeDialog::showForMismatch(_coupon, "券和商品不匹配");
QJsonObject mismatch; QJsonObject mismatch;
mismatch["statusCode"] = 31; mismatch["status_code"] = 31;
mismatch["msg"] = "券和商品不匹配"; mismatch["msg"] = "券和商品不匹配";
return mismatch; return mismatch;
} }
......
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