Commit 43bcd057 by NitefullWind

v1.7 更新:1. 选择和取消优惠券后,付款输入框都默认为最大可支付值。2. 修复结算接口支付类型不对应问题。4. 修复虚拟键盘不能在金额全选时进行输入。5. 会员认证框输入空不可进行认证。

parent 35fe4f4b
......@@ -28,27 +28,28 @@ void TaskFinal::packageServerReq()
{
QJsonObject pay_ob = pay_v.toObject();
QString type = pay_ob[PosProps.Pay_id].toString();
if(type == "20005") {
if(type == "01") {
cashAmount = pay_ob[PosProps.Paid_total_amount].toInt();
} else if(type == "20001") {
} else if(type == "22") {
codeAmount = pay_ob[PosProps.Paid_total_amount].toInt();
} else if(type == "20002") {
} else if(type == "20002") { // 积分,暂无
scoreAmount = pay_ob[PosProps.Paid_total_amount].toInt();
} else if(type == "20003") { // 代金券
} else if(type == "21") { // 代金券
coupons.append(pay_ob[PosProps.Coupon_code].toString());
} else if(type == "10001" || type == "10004" || type == "12") {
} else if(type == "10" || type == "11" || type == "12") {
thirdAmount = pay_ob[PosProps.Paid_total_amount].toInt();
trans[ServerProps(PosProps.Pay_transId)] = pay_ob[PosProps.Pay_transId];
if (type == "10001") { // 支付宝
if (type == "10") { // 支付宝
trans[ServerProps(PosProps.Pay_type)] = 1;
} else if(type == "10004") { // 微信
} else if(type == "11") { // 微信
trans[ServerProps(PosProps.Pay_type)] = 2;
} else if(type == "12") { // 非码支付
trans[ServerProps(PosProps.Pay_type)] = 5;
}
} else {
qDebug() << QString("未知的Pay Type: %1").arg(type);
thirdAmount = pay_ob[PosProps.Paid_total_amount].toInt();
}
}
trans[ServerProps(PosProps.Coupons)] = coupons;
......
......@@ -116,6 +116,12 @@ void FMVipLogin::on_login_btn_clicked()
{
QString id = ui->login_edit->text();
if(id.length() <= 0) {
FMMsgWnd::FailureWnd("会员号无效,请重新输入!");
ui->login_edit->setFocus();
return;
}
if(session()->data(PosProps.Member_type).toInt() != Member_Type::EntityCard) {
switch (id.length()) {
case 20:
......
......@@ -166,6 +166,7 @@ void FMVipOrder::onSelectionChanged(const QItemSelection &selected, const QItemS
orderInfo->setMaxDisAmount(orderInfo->getMaxDisAmount() + coupon.limitAmount());
}
orderInfo->enoughCoupon();
oldPayText = DOUBLE_STR(orderInfo->getMaxWillPay());
setWillPayText();
}
......@@ -193,7 +194,7 @@ void FMVipOrder::on_pay_edit_textChanged(const QString &text)
{
double num = text.toDouble();
double maxPay = orderInfo->getMaxWillPay();
if (num > maxPay) {
if (num >= maxPay) {
ui->pay_edit->setText(DOUBLE_STR(maxPay));
QString maxPay_info = "余额只需支付 %1 元";
......@@ -227,6 +228,8 @@ void FMVipOrder::on_pay_key_clicked()
delete numpad;
numpad = NULL;
}
ui->pay_edit->setFocus();
ui->pay_edit->selectAll();
}
void FMVipOrder::on_clean_numpad()
......@@ -240,6 +243,9 @@ void FMVipOrder::on_clean_numpad()
void FMVipOrder::on_edit_change(QString numkey)
{
if(ui->pay_edit->text() == DOUBLE_STR(orderInfo->getMaxWillPay())) {
ui->pay_edit->clear();
}
ui->pay_edit->setText(ui->pay_edit->text() + numkey);
}
......
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