Commit 7078eb4e by 李定达

1.调整标签打印大小;2.调整网络异常错误提示;

parent 191a20ff
......@@ -97,6 +97,8 @@ void PrintLib::_PrintLab( OrderObject* order)
f_TSCInit();
//qDebug() << "f_TSCInit";
QString title = QString(" %2 %4/%5").arg(datetime, QString::number(++index), QString::number(allprod));
QString tmptitle;
......@@ -123,9 +125,13 @@ void PrintLib::_PrintLab( OrderObject* order)
QString prodname = dish->name;
qDebug() << "input9:" << prodname;
//prodname= "dklahsdkjadhaksjdhkasjdhkajsd11231222222222222222312312312312";
f_TSCWinPrintln(0,0,22,0,2,0,0,QString("\xE5\xAE\x8B\xE4\xBD\x93").toLocal8Bit().data(),tmptitle.toLocal8Bit().data(),0);
f_TSCWinPrintln(0,0,22,0,2,0,0,QString("\xE5\xAE\x8B\xE4\xBD\x93").toLocal8Bit().data(),"-----------------------------------",0.0266666);
f_TSCWinPrintln(10,0,30,0,2,0,0,QString("\xE5\xAE\x8B\xE4\xBD\x93").toLocal8Bit().data(), prodname.
f_TSCWinPrintln(10,0,24,0,2,0,0,QString("\xE5\xAE\x8B\xE4\xBD\x93").toLocal8Bit().data(), prodname.
append(" ¥").
append(QString::number(dish->price/100.0, 'f', 2)).toLocal8Bit().data(),0.0666665);
QString property_tags;
......@@ -146,9 +152,11 @@ void PrintLib::_PrintLab( OrderObject* order)
f_TSCWinPrintln(10,0,24,0,2,2,0,QString("\xE5\xAE\x8B\xE4\xBD\x93").toLocal8Bit().data(),property_tags.toLocal8Bit().data(),0.0666665);
//预约送达
QString sendtimes = QString("\xE9\xA2\x84\xE7\xBA\xA6\xE9\x80\x81\xE8\xBE\xBE\x3A");
//QString sendtimes = QString("\xE9\xA2\x84\xE7\xBA\xA6\xE9\x80\x81\xE8\xBE\xBE\x3A");
QString sendtimes = QString("");
QLOG_DEBUG() << "tmpdelitime : " << tmpdelitime << order->srcdlv_time;
//QLOG_DEBUG() << "tmpdelitime : " << tmpdelitime << order->srcdlv_time;
if(tmpdelitime != 0 /*&& (order->order_type == 1 || order->order_type == 2)*/)
{
......
......@@ -100,6 +100,7 @@ void OrderGetWork::workstart()
QTimer::singleShot(tmptime*1000, &loop, &QEventLoop::quit);
connect(this, &OrderGetWork::quit, &loop, &QEventLoop::quit);
connect(this, &OrderGetWork::quitwork, &loop, &QEventLoop::quit);
loop.exec();
}
......@@ -589,7 +590,7 @@ bool OrderGetWork::event(QEvent *e)
if(e->type() == PosEvent::s_need_get_order)
{
QLOG_INFO() << QThread::currentThreadId() << "OrderGetWork PosEvent::s_need_get_order";
emit quit();
emit quitwork();
return true;
}
......
......@@ -73,8 +73,8 @@ public:
public slots:
void workstart();
//signals:
// void quit();
signals:
void quitwork();
private:
//设置门店信息
......
......@@ -33,6 +33,7 @@ FloatForm::FloatForm(QWidget *parent) :
FMApplication::subscibeEvent(this, PosEvent::s_show_float);
FMApplication::subscibeEvent(this, PosEvent::s_delete_order);
FMApplication::subscibeEvent(this, PosEvent::s_login_status);
FMApplication::subscibeEvent(this, PosEvent::s_network_outtime);
m_bReminding = false;
......@@ -115,12 +116,14 @@ bool FloatForm::event(QEvent *e)
if(!oldorder && ((orderstatus == NewOrder && autoconf.toInt() == 0) || (orderstatus == FirmOrder && autoconf.toInt() == 1)) &&
refundstatus != ApplicationRefundOrder && refundstatus != ApplicationPartialRefundOrder && refundstatus != RefusingRefundOrder)
{
m_play_flag = false;
onStartRemind(0);
return true;
}
if((refundstatus == ApplicationRefundOrder || refundstatus == ApplicationPartialRefundOrder))
{
m_play_flag = false;
onStartRemind(1);
return true;
}
......@@ -134,6 +137,26 @@ bool FloatForm::event(QEvent *e)
return true;
}
if(e->type() == PosEvent::s_network_outtime)
{
if(!this->isHidden())
{
QVariantMap value;
GETEVENTINFO(value,e,QVariantMap);
if(value.contains(EVENT_KEY_NETWORKSTATUS) && value[EVENT_KEY_NETWORKSTATUS].toBool() == true)
{
this->onStopRemind();
}
else
{
m_play_flag = true;
onStartRemind(2);
}
}
return true;
}
if(e->type() == PosEvent::s_delete_order)
{
int tk_new = 0, tk_make = 0, tk_send = 0, tk_refund = 0;
......@@ -301,6 +324,7 @@ void FloatForm::_Blink()
void FloatForm::_PlayWav()
{
if(m_play_flag == false && m_bReminding == true)
QSound::play(m_remindWav);
if(m_bReminding)
{
......@@ -352,7 +376,10 @@ void FloatForm::onStartRemind(int type)
m_wavPlayInterval = ConfigManger::GetInstance().GetSoundInterval() + VALUE_REFUNDORDERTIME;
ui->label_newmsg->setText(QString::fromLocal8Bit("您有新的退单了!\r\n点击打开查看订单!"));
break;
case 2:
ui->label_newmsg->setText(QString::fromLocal8Bit("网络异常!"));
}
if(m_bReminding)
{
return;
......@@ -375,11 +402,8 @@ void FloatForm::onStartRemind(int type)
void FloatForm::onStopRemind()
{
// if(m_bReminding)
// {
// _UdpRadio("msg1.wav",0,m_wavPlayInterval);
// }
m_bReminding = false;
m_play_flag = false;
}
void FloatForm::onShow()
......
......@@ -54,6 +54,8 @@ private:
QTimer m_remindTimer;
// 是否登录成功
bool m_is_login;
//停止标识
bool m_play_flag;
/* 功能:初始化
* 参数:NULL
* 返回:NULL
......
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