Commit dea23c24 by NitefullWind

1. 流水查询区分支付宝和微信。 2. 修改部分提示语。

parent 216ee36f
......@@ -230,8 +230,6 @@ bool Control::SendMessageToPayMent(const QJsonObject &json, QByteArray &outdata,
QString url = _setting.GetValue(VALUE_URL, "").toString();
QLOG_INFO() << "send json to payment: " << json;
QByteArray data = QJsonDocument(json).toJson(QJsonDocument::Compact);
#ifdef MOCK_SIMPHONY
......
......@@ -8,10 +8,12 @@
#include <QMovie>
#include <QDateTime>
#include <QJsonArray>
#include <QButtonGroup>
HostWidget::HostWidget(QWidget *parent) :
FMPWindow(parent),
ui(new Ui::HostWidget)
ui(new Ui::HostWidget),
_paymentMethodBtns(new QButtonGroup(this))
{
ui->setupUi(this);
......@@ -62,6 +64,12 @@ HostWidget::HostWidget(QWidget *parent) :
ui->tableWidget->verticalHeader()->setDefaultSectionSize(45);
ui->btn_mananger_print_shift->setVisible(false);
_paymentMethodBtns->setExclusive(true);
_paymentMethodBtns->addButton(ui->btn_payment_method_ali, 0);
_paymentMethodBtns->addButton(ui->btn_payment_method_wx, 1);
connect(_paymentMethodBtns, SIGNAL(buttonToggled(QAbstractButton*,bool)), this, SLOT(onPaymentMethodBtnsToggled(QAbstractButton*,bool)));
}
void HostWidget::ShowWidget(QWidget *showwidget)
......@@ -115,6 +123,7 @@ HostWidget::~HostWidget()
delete _label_pay_timer;
_label_pay_timer = NULL;
}
delete _paymentMethodBtns;
}
void HostWidget::keyPressEvent(QKeyEvent *ke)
......@@ -152,7 +161,7 @@ void HostWidget::ShowPayWidget()
}
else
{
// ui->label_pay_title->setText(QString::fromLocal8Bit("支付宝退款中..."));
// ui->label_pay_title->setText(QString::fromLocal8Bit("退款中..."));
// emit RequestWithType(refund, list);
}
......@@ -178,7 +187,7 @@ void HostWidget::ShowWithRequest(AlipayRequest request)
ShowWidget(ui->pay);
_curr_show_widget = ui->pay;
double Amount = FMTool::GetString(_data.Amount, 12).toInt()/100.0;
ui->label_pay_title->setText(QString::fromLocal8Bit("请扫描支付二维码"));
ui->label_pay_title->setText(QString::fromLocal8Bit("请扫描支付二维码"));
ui->btn_pay_exit->setText(QString::fromLocal8Bit("取消支付"));
ui->label_pay_money->setText(QString::fromLocal8Bit("需收取 ¥ %1").arg(Amount));
}
......@@ -203,7 +212,7 @@ void HostWidget::ShowWithRequest(AlipayRequest request)
list.append(FMTool::GetString(request.OriginTrace, 64));
ui->label_pay_title->setText(QString::fromLocal8Bit("支付宝退款中..."));
ui->label_pay_title->setText(QString::fromLocal8Bit("退款中..."));
emit RequestWithType(refund, list);
}
......@@ -348,6 +357,13 @@ void HostWidget::ShowWithRequest(POSType posType, QJsonObject requestObj)
ui->btn_mananger_print_shift->setMinimumSize(0,0);
}
if(_posType==SIMPHONY) {
btnNums = 2;
ui->btn_mananger_print->setVisible(false);
ui->btn_mananger_print->setMaximumSize(0,0);
ui->btn_mananger_print->setMinimumSize(0,0);
}
int spacing = (qApp->desktop()->availableGeometry().width()-ui->btn_mananger_register->width()*btnNums)/(btnNums+2);
ui->horizontalLayout_manager->setSpacing(spacing);
......@@ -368,7 +384,7 @@ void HostWidget::ShowWithRequest(POSType posType, QJsonObject requestObj)
QString reqCode = requestObj[JSON_KEY_CODE].toString("");
if(reqCode.isEmpty()) {
double Amount = FMTool::GetJsonValue(requestObj, JSON_KEY_TRANSAMOUNT).toInt()/100.0;
ui->label_pay_title->setText(QString::fromLocal8Bit("请扫描支付二维码"));
ui->label_pay_title->setText(QString::fromLocal8Bit("请扫描支付二维码"));
ui->btn_pay_exit->setText(QString::fromLocal8Bit("取消支付"));
ui->label_pay_money->setText(QString::fromLocal8Bit("需收取 ¥ %1").arg(Amount));
} else {
......@@ -407,7 +423,7 @@ void HostWidget::ShowWithRequest(POSType posType, QJsonObject requestObj)
list.append(FMTool::GetJsonValue(requestObj, JSON_KEY_FMID).toString());
ui->label_pay_title->setText(QString::fromLocal8Bit("支付宝退款中..."));
ui->label_pay_title->setText(QString::fromLocal8Bit("退款中..."));
emit RequestWithType(refund, list);
break;
}
......@@ -749,6 +765,8 @@ void HostWidget::on_btn_find_check_clicked()
list.append(ui->dateEdit_find_begin->text().replace("/","-"));
list.append(ui->dateEdit_find_end->text().replace("/","-"));
list.append(ui->label_find_page->text());
list.append(_paymentMethodBtns->checkedButton()->text());
qDebug() << "Find list: " << list;
_label_find_timer->start();
emit RequestWithType(finds, list);
}
......@@ -808,3 +826,15 @@ void HostWidget::StopPay()
ui->btn_pay_exitint->hide();
_label_pay_timer->start(60, QString::fromLocal8Bit("%1 秒"));
}
void HostWidget::onPaymentMethodBtnsToggled(QAbstractButton *button, bool checked)
{
static QString style_checked("#%1{border:0px;border-radius:2px;background-color:rgb(0,179,238);font:75 20px\"MicrosoftYaHeiUILight\";max-height:35px;max-width:100px;min-height:35px;min-width:100px;}");
static QString style_unchecked("#%2{border:0px;border-radius:2px;background-color:rgb(150, 150, 150);font:75 20px\"MicrosoftYaHeiUILight\";max-height:35px;max-width:100px;min-height:35px;min-width:100px;}");
if(checked) {
button->setStyleSheet(style_checked.arg(button->objectName()));
} else {
button->setStyleSheet(style_unchecked.arg(button->objectName()));
}
}
......@@ -11,6 +11,8 @@
class LabelsTimer;
class QMovie;
class QButtonGroup;
class QAbstractButton;
namespace Ui {
class HostWidget;
......@@ -86,6 +88,8 @@ private slots:
void on_btn_pay_exitint_clicked();
void onPaymentMethodBtnsToggled(QAbstractButton *, bool);
private:
void ShowWidget(QWidget *showwidget);
......@@ -113,6 +117,8 @@ private:
QMovie *_label_pay_movie;
QButtonGroup *_paymentMethodBtns;
int _line;
bool _need_exit;
......
......@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>2511</width>
<width>2977</width>
<height>839</height>
</rect>
</property>
......@@ -552,6 +552,83 @@
</spacer>
</item>
<item>
<widget class="QPushButton" name="btn_payment_method_ali">
<property name="styleSheet">
<string notr="true">#btn_payment_method_ali
{
border:0px;
border-radius:2px;
background-color: rgb(0, 179, 238);
font: 75 20px &quot;Microsoft YaHei UI Light&quot;;
max-height: 35px; max-width: 100px;
min-height: 35px; min-width: 100px;
}</string>
</property>
<property name="text">
<string>支付宝</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Maximum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btn_payment_method_wx">
<property name="styleSheet">
<string notr="true">#btn_payment_method_wx
{
border:0px;
border-radius:2px;
background-color: rgb(150, 150, 150);
font: 75 20px &quot;Microsoft YaHei UI Light&quot;;
max-height: 35px; max-width: 100px;
min-height: 35px; min-width: 100px;
}</string>
</property>
<property name="text">
<string>微信支付</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Maximum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_find_begin">
<property name="styleSheet">
<string notr="true">#label_find_begin
......@@ -1254,7 +1331,7 @@ QHeaderView::section{
}</string>
</property>
<property name="text">
<string>请扫描支付二维码</string>
<string>请扫描支付二维码</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
......
......@@ -3,7 +3,7 @@
#define VER_MAJOR 0
#define VER_MINOR 2
#define VER_REVISION 4
#define VER_REVISION 5
#define VER_BUILD 0
......
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