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