Commit 18030203 by gujin.wang

券核销后,修改应付金额

parent 9426a791
......@@ -243,7 +243,6 @@ void FMPePayPrivate::Init()
FMP_INFO() << "++++++++++++++++++request JOSN" <<hash;
_payDialog = new FMPPayDialog(this, hash);
}
_payDialog->show();
}
......@@ -279,6 +278,11 @@ void FMPePayPrivate::DockPayRequest(const QByteArray &json)
FMP_INFO() << "pay request json:" <<json;
}
QJsonObject FMPePayPrivate::GetRequestInfo()
{
return _origin_request;
}
#define FMP_EPAY_STATUSCODE "statusCode"
#define FMP_EPAY_ERRORMSG "msg"
#define FMP_EPAY_FMID "fm_id"
......
......@@ -70,6 +70,8 @@ public:
void GetDailyBillData(QVector<PayDetail> &vecPay);
QJsonObject GetRequestInfo();
private:
void ControlReverseJson();
......
......@@ -6,6 +6,7 @@
#include "fmp_epay_plugin_p.h"
#include "fmp_forceclose_dialog.h"
#include "fmp_redeem_i.h"
#include "fmp_home_i.h"
#include <QDebug>
#include <fmp_settings_i.h>
......@@ -19,6 +20,7 @@
#include <QPropertyAnimation>
#include <QPushButton>
#include <QVBoxLayout>
#include <QSettings>
FMPPayDialog::FMPPayDialog(FMPePayPrivate *control, QVariantHash basicinfo, QWidget *parent) :
_control(control),
......@@ -1101,12 +1103,12 @@ void FMPPayDialog::setShowFunc()
#endif
void FMPPayDialog::redeem()
{
double needPay = ui->lineedit_num->text().toDouble();
FMPRedeemInterface* redeem = FMP::GetService<FMPRedeemInterface>();
redeem->StartService();
QJsonObject storeInfo;
storeInfo["store_id"] = "99998";
storeInfo["station_id"] = 1;
storeInfo["operator_id"] = "00000002";
QJsonObject result = redeem->Redeem(storeInfo);
qDebug() << result;
QJsonObject requestInfo = _control->GetRequestInfo();
QJsonObject result = redeem->Redeem(needPay, requestInfo);
FMP_DEBUG() << "redeem result: " << result;
needPay -= result["discount"].toDouble();
ui->lineedit_num->setText(QString::number(qMax(0.0, needPay)));
}
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