Commit 54c06fce by gujin.wang

完善卡券核销插件,添加对券和商品不匹配情况的判断,并给出提示。

parent 3e7b797c
...@@ -15,8 +15,8 @@ Level=4 ...@@ -15,8 +15,8 @@ Level=4
[Home] [Home]
Server=http://115.159.226.87:20001/api/user/login Server=http://115.159.226.87:20001/api/user/login
PartnerId=1521 PartnerId=1371
StoreId=9999 StoreId=fm99999
PosId=01 PosId=01
Position=1479, 521 Position=1479, 521
CashierId=001 CashierId=001
......
No preview for this file type
...@@ -52,7 +52,9 @@ ...@@ -52,7 +52,9 @@
} }
/**/ /**/
#labActName{ #labActName{
font: 75 45pt "微软雅黑"; font-size:30px;
font-family:"微软雅黑";
font-weight:bold;
color: rgb(255, 255, 0); color: rgb(255, 255, 0);
} }
#labCodeName{ #labCodeName{
......
...@@ -52,7 +52,10 @@ ...@@ -52,7 +52,10 @@
} }
/**/ /**/
#labActName{ #labActName{
font: 75 45pt "微软雅黑"; /*font: 30 bold "微软雅黑";*/
font-size:30px;
font-family:"微软雅黑";
font-weight:bold;
color: rgb(255, 255, 0); color: rgb(255, 255, 0);
border:none; border:none;
} }
......
...@@ -71,4 +71,23 @@ void ErrCodeDialog::showForErr(const QString& coupon, const QString& mess, QWidg ...@@ -71,4 +71,23 @@ void ErrCodeDialog::showForErr(const QString& coupon, const QString& mess, QWidg
v.ui->labActName->setText( mess); v.ui->labActName->setText( mess);
v.exec(); v.exec();
} }
\ No newline at end of file
void ErrCodeDialog::showForMismatch(const QString &coupon, const QString &mess, QWidget *parent)
{
ErrCodeDialog v(parent);
// v.setGeometry( 0,0,350,470);
v.ui->topInvalidWidget->setObjectName("topExpirdWidget");
v.ui->topInvalidWidget->setStyleSheet( v.ui->topInvalidWidget->styleSheet());
v.ui->labTime->setVisible( false);
v.ui->labCodeName->setVisible( false);
v.ui->labFolat->setVisible( false);
v.ui->labActName->setVisible( true);
v.ui->labCode->setText(coupon );
v.ui->labActName->setText( mess);
v.exec();
}
...@@ -17,7 +17,8 @@ public: ...@@ -17,7 +17,8 @@ public:
static void showForInvalid(const QString& coupon, QWidget *parent = 0); static void showForInvalid(const QString& coupon, QWidget *parent = 0);
static void showForExpird(const QString& act_name, const QString& code_name, const QString& time_name, const QString& coupon, QWidget *parent = 0); static void showForExpird(const QString& act_name, const QString& code_name, const QString& time_name, const QString& coupon, QWidget *parent = 0);
static void showForErr( const QString& coupon, const QString& mess, QWidget *parent = 0); static void showForErr(const QString& coupon, const QString& mess, QWidget *parent = 0);
static void showForMismatch(const QString& coupon, const QString& mess, QWidget *parent = 0);
private: private:
Ui::ErrCodeDialog *ui; Ui::ErrCodeDialog *ui;
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
} }
/*label*/ /*label*/
#labActName{ #labActName{
font: 75 45pt "微软雅黑"; font: 75 30pt "微软雅黑";
color: rgb(81, 81, 81); color: rgb(81, 81, 81);
} }
......
#ifndef FMP_REDEEM_H #ifndef FMP_REDEEM_H
#define FMP_REDEEM_H #define FMP_REDEEM_H
#include "fmp_redeem_i.h" #include "fmp_redeem_i.h"
#include "fmp_settings_i.h" #include "fmp_settings_i.h"
#include <QJsonObject> #include <QJsonObject>
#include <QJsonArray>
#include <QPointer> #include <QPointer>
class FMPStartEventHandler; class FMPStartEventHandler;
class FMPRedeem : public FMPRedeemInterface class FMPRedeem : public FMPRedeemInterface
...@@ -28,7 +29,7 @@ public: ...@@ -28,7 +29,7 @@ public:
explicit FMPRedeem(const FMPContext context); explicit FMPRedeem(const FMPContext context);
virtual ~FMPRedeem(); virtual ~FMPRedeem();
QJsonObject Redeem(const QJsonObject& storeInfo); //券码核销 QJsonObject Redeem(const double needPay, const QJsonObject& requestInfo); //券码核销
protected: protected:
const FMPContext GetContext() const { return _context; } const FMPContext GetContext() const { return _context; }
...@@ -39,20 +40,28 @@ protected slots: ...@@ -39,20 +40,28 @@ protected slots:
private: private:
QJsonObject SendRequest(const QByteArray &reqData); QJsonObject SendRequest(const QByteArray &reqData);
QJsonObject ShowForUnConsum(const QJsonObject &json); QJsonObject ShowForUnConsum(QJsonObject json);
QJsonObject ShowForHasConsum(const QJsonObject &json); QJsonObject ShowForHasConsum(QJsonObject json);
QJsonObject ShowForInvalid(const QJsonObject &json); QJsonObject ShowForInvalid(QJsonObject json);
QJsonObject ShowForExpird(const QJsonObject &json); QJsonObject ShowForExpird(QJsonObject json);
QJsonObject ShowForErr(const QJsonObject &json); QJsonObject ShowForErr(QJsonObject json);
QJsonObject ShowForMismatch(QJsonObject json);
int ZH_caclChkValue(char * pJsonData, int startPos, int endPos); int ZH_caclChkValue(char * pJsonData, int startPos, int endPos);
QByteArray CheckSendArray( QByteArray & jsonArray); QByteArray CheckSendArray( QByteArray & jsonArray);
QJsonValue SearchJsonObject(const QJsonObject& searchJson, const QString& searchKey);
QJsonValue SearchJsonArray(const QJsonArray& searchJson, const QString& searchKey);
bool IsContinue(int couponAmount);
private: private:
bool _inited; bool _inited;
double _needPay;
QString _store_id; QString _store_id;
int _station_id; QString _station_id;
QString _operator_id; QString _operator_id;
int _clientReqCount; QString _coupon;
int _partner_id;
QString _url;
QJsonArray _products_info;
int _clientReqCount;
const FMPContext _context; const FMPContext _context;
QPointer<FMPStartEventHandler> _ste_handler; QPointer<FMPStartEventHandler> _ste_handler;
}; };
......
#ifndef FMP_REDEEM_I_H #ifndef FMP_REDEEM_I_H
#define FMP_REDEEM_I_H #define FMP_REDEEM_I_H
#include <fmp_plugin_i.h> #include <fmp_plugin_i.h>
...@@ -20,7 +20,7 @@ public: ...@@ -20,7 +20,7 @@ public:
connect(this, &FMPRedeemInterface::TriggerUninit, this, &FMPRedeemInterface::OnTriggerUninit); connect(this, &FMPRedeemInterface::TriggerUninit, this, &FMPRedeemInterface::OnTriggerUninit);
} }
virtual QJsonObject Redeem(const QJsonObject& storeInfo) = 0; //券码核销 virtual QJsonObject Redeem(const double needPay, const QJsonObject& requestInfo) = 0; //券码核销
signals: signals:
void TriggerInit(); void TriggerInit();
void TriggerUninit(); void TriggerUninit();
......
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
<file>img/btn_canel.png</file> <file>img/btn_canel.png</file>
<file>img/btn_consumption.png</file> <file>img/btn_consumption.png</file>
<file>img/btn_consumption_invalid.png</file> <file>img/btn_consumption_invalid.png</file>
<file>img/btn_manual.png</file>
<file>img/close.png</file> <file>img/close.png</file>
<file>img/consumption_ok.png</file> <file>img/consumption_ok.png</file>
<file>img/folat_be_invalid.png</file> <file>img/folat_be_invalid.png</file>
<file>img/ma_bg.png</file> <file>img/ma_bg.png</file>
<file>img/scanning_bar.png</file> <file>img/scanning_bar.png</file>
<file>img/tray.png</file>
</qresource> </qresource>
</RCC> </RCC>
fmp_redeem/res/img/bg_be_invalid.png

7.59 KB | W: | H:

fmp_redeem/res/img/bg_be_invalid.png

3.87 KB | W: | H:

fmp_redeem/res/img/bg_be_invalid.png
fmp_redeem/res/img/bg_be_invalid.png
fmp_redeem/res/img/bg_be_invalid.png
fmp_redeem/res/img/bg_be_invalid.png
  • 2-up
  • Swipe
  • Onion skin
fmp_redeem/res/img/bg_exchange.png

47 KB | W: | H:

fmp_redeem/res/img/bg_exchange.png

8.44 KB | W: | H:

fmp_redeem/res/img/bg_exchange.png
fmp_redeem/res/img/bg_exchange.png
fmp_redeem/res/img/bg_exchange.png
fmp_redeem/res/img/bg_exchange.png
  • 2-up
  • Swipe
  • Onion skin
fmp_redeem/res/img/bg_invalid_code.png

12.7 KB | W: | H:

fmp_redeem/res/img/bg_invalid_code.png

10.8 KB | W: | H:

fmp_redeem/res/img/bg_invalid_code.png
fmp_redeem/res/img/bg_invalid_code.png
fmp_redeem/res/img/bg_invalid_code.png
fmp_redeem/res/img/bg_invalid_code.png
  • 2-up
  • Swipe
  • Onion skin
fmp_redeem/res/img/bg_no_exchange.png

47.2 KB | W: | H:

fmp_redeem/res/img/bg_no_exchange.png

8.37 KB | W: | H:

fmp_redeem/res/img/bg_no_exchange.png
fmp_redeem/res/img/bg_no_exchange.png
fmp_redeem/res/img/bg_no_exchange.png
fmp_redeem/res/img/bg_no_exchange.png
  • 2-up
  • Swipe
  • Onion skin
fmp_redeem/res/img/bg_sanning.png

62.9 KB | W: | H:

fmp_redeem/res/img/bg_sanning.png

51 KB | W: | H:

fmp_redeem/res/img/bg_sanning.png
fmp_redeem/res/img/bg_sanning.png
fmp_redeem/res/img/bg_sanning.png
fmp_redeem/res/img/bg_sanning.png
  • 2-up
  • Swipe
  • Onion skin
fmp_redeem/res/img/bg_working.png

50 KB | W: | H:

fmp_redeem/res/img/bg_working.png

26.3 KB | W: | H:

fmp_redeem/res/img/bg_working.png
fmp_redeem/res/img/bg_working.png
fmp_redeem/res/img/bg_working.png
fmp_redeem/res/img/bg_working.png
  • 2-up
  • Swipe
  • Onion skin
fmp_redeem/res/img/btn_canel.png

2.93 KB | W: | H:

fmp_redeem/res/img/btn_canel.png

2.63 KB | W: | H:

fmp_redeem/res/img/btn_canel.png
fmp_redeem/res/img/btn_canel.png
fmp_redeem/res/img/btn_canel.png
fmp_redeem/res/img/btn_canel.png
  • 2-up
  • Swipe
  • Onion skin
fmp_redeem/res/img/btn_consumption.png

4.83 KB | W: | H:

fmp_redeem/res/img/btn_consumption.png

4.98 KB | W: | H:

fmp_redeem/res/img/btn_consumption.png
fmp_redeem/res/img/btn_consumption.png
fmp_redeem/res/img/btn_consumption.png
fmp_redeem/res/img/btn_consumption.png
  • 2-up
  • Swipe
  • Onion skin
fmp_redeem/res/img/close.png

1.62 KB | W: | H:

fmp_redeem/res/img/close.png

2.17 KB | W: | H:

fmp_redeem/res/img/close.png
fmp_redeem/res/img/close.png
fmp_redeem/res/img/close.png
fmp_redeem/res/img/close.png
  • 2-up
  • Swipe
  • Onion skin
fmp_redeem/res/img/consumption_ok.png

5.95 KB | W: | H:

fmp_redeem/res/img/consumption_ok.png

5.79 KB | W: | H:

fmp_redeem/res/img/consumption_ok.png
fmp_redeem/res/img/consumption_ok.png
fmp_redeem/res/img/consumption_ok.png
fmp_redeem/res/img/consumption_ok.png
  • 2-up
  • Swipe
  • Onion skin
fmp_redeem/res/img/ma_bg.png

7.27 KB | W: | H:

fmp_redeem/res/img/ma_bg.png

8.07 KB | W: | H:

fmp_redeem/res/img/ma_bg.png
fmp_redeem/res/img/ma_bg.png
fmp_redeem/res/img/ma_bg.png
fmp_redeem/res/img/ma_bg.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -40,7 +40,8 @@ ...@@ -40,7 +40,8 @@
#btnManual{ #btnManual{
border: 0 solid red; border: 0 solid red;
background: rgb(231,68,59); /*background: rgb(231,68,59);*/
background-image: url(:/img/btn_manual.png);
color: rgb(253,197,24); color: rgb(253,197,24);
font: normal 18px &quot;微软雅黑&quot;; font: normal 18px &quot;微软雅黑&quot;;
}</string> }</string>
...@@ -83,14 +84,14 @@ ...@@ -83,14 +84,14 @@
<widget class="QPushButton" name="btnManual"> <widget class="QPushButton" name="btnManual">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>100</x> <x>30</x>
<y>220</y> <y>220</y>
<width>141</width> <width>273</width>
<height>41</height> <height>77</height>
</rect> </rect>
</property> </property>
<property name="text"> <property name="text">
<string>手动输入券码</string> <string/>
</property> </property>
</widget> </widget>
</widget> </widget>
......
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