Commit 1be029b4 by gujin.wang

修改卡券核销时,商品信息的传递方式

parent 6869663f
fmp_epay @ 30a8ed65
Subproject commit 180302030459e884456c8d1ab66443e18f9d4f17
Subproject commit 30a8ed65198847106c3218cb6d103dd8558e7e25
......@@ -55,7 +55,7 @@ void FMPRedeem::UninitService()
{
}
QJsonValue FMPRedeem::SearchJsonObject(const QJsonObject& searchJson, const QString& searchKey)
QJsonValue FMPRedeem::SearchJsonObject(QJsonObject& searchJson, QString searchKey)
{
QJsonValue value;
if(searchJson.contains(searchKey))
......@@ -81,7 +81,7 @@ QJsonValue FMPRedeem::SearchJsonObject(const QJsonObject& searchJson, const QStr
return value;
}
QJsonValue FMPRedeem::SearchJsonArray(const QJsonArray& searchJson, const QString& searchKey)
QJsonValue FMPRedeem::SearchJsonArray(QJsonArray& searchJson, QString searchKey)
{
QJsonValue value;
for(int i = 0; i < searchJson.size(); i++)
......@@ -100,10 +100,10 @@ QJsonValue FMPRedeem::SearchJsonArray(const QJsonArray& searchJson, const QStrin
return value;
}
QJsonObject FMPRedeem::Redeem(const double needPay, const QJsonObject& requestInfo, QWidget* parent)
QJsonObject FMPRedeem::Redeem(const double needPay, const QJsonArray& productsInfo)
{
FMP_DEBUG() << "Recv redeem data: " << QJsonDocument(requestInfo).toJson(QJsonDocument::Compact);
_products_info = SearchJsonObject(requestInfo, "products").toArray();
FMP_DEBUG() << "Recv redeem data: " << QJsonDocument(productsInfo).toJson(QJsonDocument::Compact);
_products_info = productsInfo;
_needPay = needPay;
//读取门店信息
QString apppath = QCoreApplication::applicationDirPath();
......@@ -115,7 +115,7 @@ QJsonObject FMPRedeem::Redeem(const double needPay, const QJsonObject& requestIn
_partner_id = settings.value(FMP_INIKEY_LOGINPARTNERID).toInt();
//显示扫码界面获取券码
ScanningDialog scanningDialog(parent);
ScanningDialog scanningDialog;
if(scanningDialog.exec() != QDialog::Accepted)
{
QJsonObject ret;
......
......@@ -29,7 +29,7 @@ public:
explicit FMPRedeem(const FMPContext context);
virtual ~FMPRedeem();
QJsonObject Redeem(const double needPay, const QJsonObject& requestInfo, QWidget* parent = 0); //券码核销
QJsonObject Redeem(const double needPay, const QJsonArray& productsInfo); //券码核销
protected:
const FMPContext GetContext() const { return _context; }
......@@ -48,9 +48,9 @@ private:
QJsonObject ShowForMismatch(QJsonObject json);
int ZH_caclChkValue(char * pJsonData, int startPos, int endPos);
QByteArray CheckSendArray( QByteArray & jsonArray);
QJsonValue SearchJsonObject(const QJsonObject& searchJson, const QString& searchKey);
QJsonValue SearchJsonArray(const QJsonArray& searchJson, const QString& searchKey);
bool IsContinue(int couponAmount);
QJsonValue SearchJsonObject(QJsonObject& searchJson, QString searchKey);
QJsonValue SearchJsonArray(QJsonArray& searchJson, QString searchKey);
private:
bool _inited;
double _needPay;
......
......@@ -20,7 +20,7 @@ public:
connect(this, &FMPRedeemInterface::TriggerUninit, this, &FMPRedeemInterface::OnTriggerUninit);
}
virtual QJsonObject Redeem(const double needPay, const QJsonObject& requestInfo, QWidget* parent = 0) = 0; //券码核销
virtual QJsonObject Redeem(const double needPay, const QJsonArray& productsInfo) = 0; //券码核销
signals:
void TriggerInit();
void TriggerUninit();
......
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