Commit 5c982b42 by NitefullWind

1. 能够演示

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