Commit efd309dd by NitefullWind

1. 修改代金券样式,代金券都不可叠加使用。 2. 修复支付界面账号、姓名显示问题。 3. 隐藏积分支付输入框。

parent c8ecd983
...@@ -6,12 +6,13 @@ ...@@ -6,12 +6,13 @@
const int PaintingWidth = 220; const int PaintingWidth = 220;
const int PaintingHeight = 116; const int PaintingHeight = 116;
Coupon::Coupon(QString name, QString code, QString type, double disAmount, double limitAmount, bool isCompatible) : Coupon::Coupon(QString name, QString code, QString type, double disAmount, double limitAmount, QString limitTime, bool isCompatible) :
_name(name), _name(name),
_code(code), _code(code),
_type(type), _type(type),
_disAmount(disAmount), _disAmount(disAmount),
_limitAmount(limitAmount), _limitAmount(limitAmount),
_limitTime(limitTime),
_isCompatible(isCompatible) _isCompatible(isCompatible)
{ {
} }
...@@ -75,7 +76,7 @@ void Coupon::paint(QPainter *painter, const QRect &rect, const QPalette &palette ...@@ -75,7 +76,7 @@ void Coupon::paint(QPainter *painter, const QRect &rect, const QPalette &palette
painter->setPen(pen); painter->setPen(pen);
fontHeight = painter->fontMetrics().height(); fontHeight = painter->fontMetrics().height();
QRect codeRect(rect.x(), rect.y()+rect.height()-fontHeight-5, rect.width(), fontHeight); QRect codeRect(rect.x(), rect.y()+rect.height()-fontHeight-5, rect.width(), fontHeight);
painter->drawText(codeRect, Qt::AlignCenter, this->_code); painter->drawText(codeRect, Qt::AlignCenter, this->_limitTime);
painter->restore(); painter->restore();
} }
......
...@@ -10,7 +10,7 @@ class QPainter; ...@@ -10,7 +10,7 @@ class QPainter;
class Coupon class Coupon
{ {
public: public:
explicit Coupon(QString name="", QString code="", QString type="", double disAmount=0, double limitAmount=0, bool isCompatible=true); explicit Coupon(QString name="", QString code="", QString type="", double disAmount=0, double limitAmount=0, QString limitTime="", bool isCompatible=true);
void paint(QPainter *painter, const QRect &rect, void paint(QPainter *painter, const QRect &rect,
const QPalette &palette) const; const QPalette &palette) const;
...@@ -29,6 +29,7 @@ private: ...@@ -29,6 +29,7 @@ private:
double _disAmount; double _disAmount;
double _limitAmount; double _limitAmount;
bool _isCompatible; bool _isCompatible;
QString _limitTime;
}; };
Q_DECLARE_METATYPE(Coupon) Q_DECLARE_METATYPE(Coupon)
......
...@@ -75,7 +75,7 @@ void TaskLogin::onLogin() ...@@ -75,7 +75,7 @@ void TaskLogin::onLogin()
QString name = getServerJsonValue(PosProps.Name).toString(); QString name = getServerJsonValue(PosProps.Name).toString();
bool canPay = (getServerJsonValue(PosProps.CanPay).toInt() == 1); bool canPay = (getServerJsonValue(PosProps.CanPay).toInt() == 1);
canPay = 1; canPay = true;
if(!canPay) { if(!canPay) {
if(getPosJsonValue(PosProps.Fm_cmd).toInt() != FM_Pay) { if(getPosJsonValue(PosProps.Fm_cmd).toInt() != FM_Pay) {
FMMsgWnd::LoginSuccess(account, name, birthday, _window); FMMsgWnd::LoginSuccess(account, name, birthday, _window);
......
...@@ -37,8 +37,9 @@ void TaskCoupon::packagePOSRsp() ...@@ -37,8 +37,9 @@ void TaskCoupon::packagePOSRsp()
double amount = couponOb[ServerProps(PosProps.Coupon_disAmount)].toInt() / 100.0; double amount = couponOb[ServerProps(PosProps.Coupon_disAmount)].toInt() / 100.0;
QString desc = couponOb["active_name"].toString(); QString desc = couponOb["active_name"].toString();
int type = couponOb[ServerProps(PosProps.Coupon_type)].toInt(); int type = couponOb[ServerProps(PosProps.Coupon_type)].toInt();
QString limitTime = couponOb["expiration_date"].toString();
Coupon c(desc, code, QString::number(type), amount, 0, true); Coupon c(desc, code, QString::number(type), amount, 0, limitTime, false);
QVariant v; QVariant v;
v.setValue(c); v.setValue(c);
couponMap[code] = v; couponMap[code] = v;
......
...@@ -88,13 +88,11 @@ void TaskPay::packageServerReq() ...@@ -88,13 +88,11 @@ void TaskPay::packageServerReq()
//余额支付详情 //余额支付详情
QJsonObject balance; QJsonObject balance;
int codeAmount = session()->data(PosProps.CodeAmount).toInt(); int codeAmount = session()->data(PosProps.CodeAmount).toInt();
if(codeAmount > 0) { balance["amount"] = codeAmount;
balance["amount"] = codeAmount; balance["transId"] = getPosJsonValue("trans_id");
balance["transId"] = getPosJsonValue("trans_id"); balance["typeModeFlag"] = 20001;
balance["typeModeFlag"] = 20001; balance["thirdPayTransId"] = "";
balance["thirdPayTransId"] = ""; payList.push_back(balance);
payList.push_back(balance);
}
// 积分支付详情 // 积分支付详情
QJsonObject score; QJsonObject score;
......
...@@ -25,8 +25,11 @@ bool FMVipOrder::initWnd(Session *session) ...@@ -25,8 +25,11 @@ bool FMVipOrder::initWnd(Session *session)
QString operator_id = session->data(PosProps.OperatorId).toString(); QString operator_id = session->data(PosProps.OperatorId).toString();
QString business_date = session->data(PosProps.BussinessDate).toString(); QString business_date = session->data(PosProps.BussinessDate).toString();
QString fm_id = session->data(PosProps.Account).toString(); QString fm_id = session->data(PosProps.Fm_open_id).toString();
QString name = session->data(PosProps.Name).toString(); QString name = session->data(PosProps.Name).toString();
if(name.isEmpty()) {
name = "--";
}
QString birthday = session->data(PosProps.Birthday).toString(); QString birthday = session->data(PosProps.Birthday).toString();
QString amount_str = QString::number(session->data(PosProps.Amount).toInt()); QString amount_str = QString::number(session->data(PosProps.Amount).toInt());
...@@ -97,8 +100,9 @@ void FMVipOrder::on_coupon_page_clicked(const QModelIndex &index) ...@@ -97,8 +100,9 @@ void FMVipOrder::on_coupon_page_clicked(const QModelIndex &index)
if(selectionModel->selectedIndexes().length() == 1) { if(selectionModel->selectedIndexes().length() == 1) {
QModelIndex firstIndex = selectionModel->selectedIndexes().first(); QModelIndex firstIndex = selectionModel->selectedIndexes().first();
if(!couponModel->coupon(firstIndex).isCompatible()) { if(!couponModel->coupon(firstIndex).isCompatible()) {
FMMsgWnd::FailureWnd(QString::fromLocal8Bit("已经选中了一张不可叠加券,不能再选用其他代金券")); // FMMsgWnd::FailureWnd(QString::fromLocal8Bit("已经选中了一张不可叠加券,不能再选用其他代金券"));
return; // return;
selectionModel->clear();
} }
} }
Coupon coupon = couponModel->coupon(index); Coupon coupon = couponModel->coupon(index);
......
...@@ -179,7 +179,7 @@ ...@@ -179,7 +179,7 @@
color: red; color: red;
} }
#pay_edit,#score_edit { #pay_edit {
min-height: 45px; min-height: 45px;
border: 1 solid silver; border: 1 solid silver;
text-align: center; text-align: center;
...@@ -765,7 +765,7 @@ ...@@ -765,7 +765,7 @@
</size> </size>
</property> </property>
<property name="text"> <property name="text">
<string>满 0 元可享受储值金满额优惠</string> <string/>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
...@@ -774,6 +774,18 @@ ...@@ -774,6 +774,18 @@
</item> </item>
<item> <item>
<widget class="QLineEdit" name="score_edit"> <widget class="QLineEdit" name="score_edit">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text"> <property name="text">
<string>0</string> <string>0</string>
</property> </property>
...@@ -784,6 +796,12 @@ ...@@ -784,6 +796,12 @@
</item> </item>
<item> <item>
<widget class="QLabel" name="score_label"> <widget class="QLabel" name="score_label">
<property name="maximumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text"> <property name="text">
<string>使用 0 积分抵扣 0 元</string> <string>使用 0 积分抵扣 0 元</string>
</property> </property>
......
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