Commit 5c982b42 by NitefullWind

1. 能够演示

parent ebd75d4b
...@@ -25,8 +25,8 @@ FMVipDispatcher::FMVipDispatcher(QObject *parent) : ...@@ -25,8 +25,8 @@ FMVipDispatcher::FMVipDispatcher(QObject *parent) :
connect(this, SIGNAL(startSocketTimer()), _posSocketTimer, SLOT(start())); connect(this, SIGNAL(startSocketTimer()), _posSocketTimer, SLOT(start()));
connect(this, SIGNAL(stopSocketTimer()), _posSocketTimer, SLOT(stop())); connect(this, SIGNAL(stopSocketTimer()), _posSocketTimer, SLOT(stop()));
connect(_confirmRechageTimer, SIGNAL(timeout()), this, SLOT(onConfirmRechageTimeOut())); // connect(_confirmRechageTimer, SIGNAL(timeout()), this, SLOT(onConfirmRechageTimeOut()));
_confirmRechageTimer->setSingleShot(true); // _confirmRechageTimer->setSingleShot(true);
} }
FMVipDispatcher::~FMVipDispatcher() FMVipDispatcher::~FMVipDispatcher()
...@@ -99,21 +99,21 @@ void FMVipDispatcher::onDoTask() ...@@ -99,21 +99,21 @@ void FMVipDispatcher::onDoTask()
} else { } else {
rspData = fmTask->doTask(); rspData = fmTask->doTask();
if(fmTask->FM_Type() == FM_Manage) { // if(fmTask->FM_Type() == FM_Manage) {
QJsonObject posRspJsonObj = *(fmTask->getPosRspJsonObj()); // QJsonObject posRspJsonObj = *(fmTask->getPosRspJsonObj());
if(!posRspJsonObj.empty() && posRspJsonObj.contains(PosProps.FundInfo)) { // if(!posRspJsonObj.empty() && posRspJsonObj.contains(PosProps.FundInfo)) {
backupReqObj = *(fmTask->getPosReqJsonObj()); // backupReqObj = *(fmTask->getPosReqJsonObj());
backupReqObj[PosProps.TransId] = fmTask->session()->data(PosProps.TransId).toString(); // backupReqObj[PosProps.TransId] = fmTask->session()->data(PosProps.TransId).toString();
backupReqObj[PosProps.Fm_id] = fmTask->session()->data(PosProps.Fm_id).toString(); // backupReqObj[PosProps.Fm_id] = fmTask->session()->data(PosProps.Fm_id).toString();
backupReqObj[PosProps.Print] = fmTask->session()->data(PosProps.Print).toString(); // backupReqObj[PosProps.Print] = fmTask->session()->data(PosProps.Print).toString();
// 启动定时器,30秒后对该充值订单进行冲正 // // 启动定时器,30秒后对该充值订单进行冲正
if(_confirmRechageTimer->isActive()) { // if(_confirmRechageTimer->isActive()) {
onConfirmRechageTimeOut(); // onConfirmRechageTimeOut();
_confirmRechageTimer->stop(); // _confirmRechageTimer->stop();
} // }
_confirmRechageTimer->start(30000); // _confirmRechageTimer->start(30000);
} // }
} // }
} }
qDebug() << "Send to pos: " << QString::fromUtf8(rspData); qDebug() << "Send to pos: " << QString::fromUtf8(rspData);
qDebug() << "==============="; qDebug() << "===============";
...@@ -205,13 +205,13 @@ void FMVipDispatcher::onAbout() ...@@ -205,13 +205,13 @@ void FMVipDispatcher::onAbout()
void FMVipDispatcher::onConfirmRechageTimeOut() void FMVipDispatcher::onConfirmRechageTimeOut()
{ {
if(!backupReqObj.empty()) { // if(!backupReqObj.empty()) {
qDebug() << "冲正备份的请求:" << backupReqObj; // qDebug() << "冲正备份的请求:" << backupReqObj;
FMTask *reversalTask = new TaskRefundOrder(backupReqObj, this); // FMTask *reversalTask = new TaskRefundOrder(backupReqObj, this);
reversalTask->doTask(); // reversalTask->doTask();
reversalTask->deleteLater(); // reversalTask->deleteLater();
backupReqObj = QJsonObject(); // backupReqObj = QJsonObject();
} else { // } else {
qDebug() << "备份的请求为空,未执行冲正."; // qDebug() << "备份的请求为空,未执行冲正.";
} // }
} }
...@@ -30,19 +30,19 @@ void TaskFinal::packageServerReq() ...@@ -30,19 +30,19 @@ void TaskFinal::packageServerReq()
QString type = pay_ob[PosProps.Pay_id].toString(); QString type = pay_ob[PosProps.Pay_id].toString();
if(type == "01") { if(type == "01") {
cashAmount = pay_ob[PosProps.Paid_total_amount].toInt(); cashAmount = pay_ob[PosProps.Paid_total_amount].toInt();
} else if(type == "20") { } else if(type == "24") {
codeAmount = pay_ob[PosProps.Paid_total_amount].toInt(); codeAmount = pay_ob[PosProps.Paid_total_amount].toInt();
} else if(type == "20002") { // 积分,暂无 } else if(type == "25") { // 积分,暂无
scoreAmount = pay_ob[PosProps.Paid_total_amount].toInt(); scoreAmount = pay_ob[PosProps.Paid_total_amount].toInt();
} else if(type == "21") { // 代金券 } else if(type == "77") { // 代金券
coupons.append(pay_ob[PosProps.Coupon_code].toString()); coupons.append(pay_ob[PosProps.Coupon_code].toString());
} else if(type == "10" || type == "11" || type == "12") { } else if(type == "72" || type == "73" || type == "12") {
thirdAmount = pay_ob[PosProps.Paid_total_amount].toInt(); thirdAmount = pay_ob[PosProps.Paid_total_amount].toInt();
trans[ServerProps(PosProps.Pay_transId)] = pay_ob[PosProps.Pay_transId]; trans[ServerProps(PosProps.Pay_transId)] = pay_ob[PosProps.Pay_transId];
if (type == "10") { // 支付宝 if (type == "72") { // 支付宝
trans[ServerProps(PosProps.Pay_type)] = 1; trans[ServerProps(PosProps.Pay_type)] = 1;
} else if(type == "11") { // 微信 } else if(type == "73") { // 微信
trans[ServerProps(PosProps.Pay_type)] = 2; trans[ServerProps(PosProps.Pay_type)] = 2;
} else if(type == "12") { // 非码支付 } else if(type == "12") { // 非码支付
trans[ServerProps(PosProps.Pay_type)] = 5; trans[ServerProps(PosProps.Pay_type)] = 5;
......
...@@ -84,14 +84,14 @@ void TaskPay::packagePOSRsp() ...@@ -84,14 +84,14 @@ void TaskPay::packagePOSRsp()
QJsonArray pay_ids; QJsonArray pay_ids;
QJsonObject pay_id; QJsonObject pay_id;
pay_id[PosProps.Pay_id] = "20001"; pay_id[PosProps.Pay_id] = "24";
pay_id[PosProps.Pay_str] = "会员储值金支付"; pay_id[PosProps.Pay_str] = "会员储值金支付";
int codeAmount = getServerJsonValue(PosProps.CodeAmount).toInt(); int codeAmount = getServerJsonValue(PosProps.CodeAmount).toInt();
pay_id[PosProps.Paid_total_amount] = codeAmount; pay_id[PosProps.Paid_total_amount] = codeAmount;
paidTotalAmount += codeAmount; paidTotalAmount += codeAmount;
pay_ids.append(pay_id); pay_ids.append(pay_id);
pay_id[PosProps.Pay_id] = "20002"; pay_id[PosProps.Pay_id] = "25";
pay_id[PosProps.Pay_str] = "会员积分支付"; pay_id[PosProps.Pay_str] = "会员积分支付";
int scoreAmount = getServerJsonValue(PosProps.ScoreAmount).toInt(); int scoreAmount = getServerJsonValue(PosProps.ScoreAmount).toInt();
pay_id[PosProps.Paid_total_amount] = scoreAmount; pay_id[PosProps.Paid_total_amount] = scoreAmount;
...@@ -100,7 +100,7 @@ void TaskPay::packagePOSRsp() ...@@ -100,7 +100,7 @@ void TaskPay::packagePOSRsp()
for(auto coupon : getServerJsonValue(PosProps.Coupons).toArray()) { for(auto coupon : getServerJsonValue(PosProps.Coupons).toArray()) {
QJsonObject cp = coupon.toObject(); QJsonObject cp = coupon.toObject();
pay_id[PosProps.Pay_id] = "20003"; pay_id[PosProps.Pay_id] = "77";
pay_id[PosProps.Pay_str] = "代金券支付"; pay_id[PosProps.Pay_str] = "代金券支付";
int couponAmount = cp[ServerProps(PosProps.Coupon_disAmount)].toInt(); int couponAmount = cp[ServerProps(PosProps.Coupon_disAmount)].toInt();
pay_id[PosProps.Paid_total_amount] = couponAmount; pay_id[PosProps.Paid_total_amount] = couponAmount;
......
...@@ -67,7 +67,7 @@ bool FMVipOrder::initWnd(Session *session) ...@@ -67,7 +67,7 @@ bool FMVipOrder::initWnd(Session *session)
initCouponItems(); initCouponItems();
// ui->pay_chk->setText(QString("使用积分抵用 %1 元").arg(orderInfo->getScoreAmount())); ui->pay_chk->setText(QString("使用积分抵用 %1 元").arg(orderInfo->getScoreAmount()));
if(standard_amount > 0) { if(standard_amount > 0) {
ui->standard_label->setText(QString("满 %1 元可享受储值金满额优惠").arg(standard_amount)); ui->standard_label->setText(QString("满 %1 元可享受储值金满额优惠").arg(standard_amount));
...@@ -96,13 +96,13 @@ void FMVipOrder::on_pay_btn_clicked() ...@@ -96,13 +96,13 @@ void FMVipOrder::on_pay_btn_clicked()
emit pay(); emit pay();
} }
//void FMVipOrder::on_pay_chk_clicked(bool checked) void FMVipOrder::on_pay_chk_clicked(bool checked)
//{ {
// int is = checked ? 1 : 0; int is = checked ? 1 : 0;
// session()->addData(ServerProps(PosProps.IsUseScore), is); session()->addData(ServerProps(PosProps.IsUseScore), is);
// orderInfo->setUseScore(checked); orderInfo->setUseScore(checked);
// setWillPayText(); setWillPayText();
//} }
//! 点击元素时选中/取消选中代金券 //! 点击元素时选中/取消选中代金券
......
...@@ -31,7 +31,7 @@ signals: ...@@ -31,7 +31,7 @@ signals:
public slots: public slots:
void on_pay_btn_clicked(); void on_pay_btn_clicked();
// void on_pay_chk_clicked(bool checked); void on_pay_chk_clicked(bool checked);
void on_clean_numpad(); void on_clean_numpad();
......
...@@ -43,9 +43,9 @@ bool FMVipPanel::initWnd(Session *session) ...@@ -43,9 +43,9 @@ bool FMVipPanel::initWnd(Session *session)
void FMVipPanel::on_fund_btn_clicked() void FMVipPanel::on_fund_btn_clicked()
{ {
if(session()->data(PosProps.Member_type).toInt() == Member_Type::EntityCard) { // if(session()->data(PosProps.Member_type).toInt() == Member_Type::EntityCard) {
emit fund(); emit fund();
} else { // } else {
FMMsgWnd::FailureWnd("POS上只能进行实体卡充值!"); // FMMsgWnd::FailureWnd("POS上只能进行实体卡充值!");
} // }
} }
...@@ -194,12 +194,12 @@ QWidget { ...@@ -194,12 +194,12 @@ QWidget {
#pay_chk { #pay_chk {
color: rgb(60,60,60); color: rgb(60,60,60);
font-size: 26px; font-size: 22px;
} }
#pay_chk::indicator { #pay_chk::indicator {
width: 56px; width: 56px;
height: 48px; height: 30px;
margin-right: -10px; margin-right: -10px;
} }
...@@ -744,7 +744,7 @@ QWidget { ...@@ -744,7 +744,7 @@ QWidget {
<widget class="QWidget" name="pay_widget" native="true"> <widget class="QWidget" name="pay_widget" native="true">
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing"> <property name="spacing">
<number>10</number> <number>0</number>
</property> </property>
<property name="leftMargin"> <property name="leftMargin">
<number>60</number> <number>60</number>
...@@ -821,6 +821,16 @@ font: 13px &quot;微软雅黑&quot;; ...@@ -821,6 +821,16 @@ font: 13px &quot;微软雅黑&quot;;
</layout> </layout>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="pay_chk">
<property name="cursor">
<cursorShape>PointingHandCursor</cursorShape>
</property>
<property name="text">
<string>使用积分抵扣 0 元</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="standard_label"> <widget class="QLabel" name="standard_label">
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
......
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