Commit 18030203 by gujin.wang

券核销后,修改应付金额

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