Commit 38f8f79e by 李定达

1.修复退单状态不一致bug;2.悬浮窗添加测试完成;3.修复悬浮窗退单提示异常bug

parent 6eea0025
......@@ -121,6 +121,11 @@ void OrderGetWork::setLocalStoreInfo(const QJsonObject &recvjson)
if(recvjson.contains(LOGIN_RESULT) && recvjson[LOGIN_RESULT].isObject() &&
recvjson[LOGIN_RESULT].toObject().contains(JSON_KEY_STOREUNIFYID) && recvjson[LOGIN_RESULT].toObject()[JSON_KEY_STOREUNIFYID].isString())
_storeinfo.insert(JSON_KEY_STOREUNIFYID, recvjson[LOGIN_RESULT].toObject()[JSON_KEY_STOREUNIFYID].toString());
if(recvjson.contains(LOGIN_RESULT) && recvjson[LOGIN_RESULT].isObject() &&
recvjson[LOGIN_RESULT].toObject().contains(JSON_KEY_UNIFYID) && recvjson[LOGIN_RESULT].toObject()[JSON_KEY_UNIFYID].isString())
_storeinfo.insert(JSON_KEY_UNIFYID, recvjson[LOGIN_RESULT].toObject()[JSON_KEY_UNIFYID].toString());
}
bool OrderGetWork::loginToServer(QString &error)
......
......@@ -239,7 +239,7 @@ private:
}
if(storeinfo.contains(JSON_KEY_PARTNERID))
{
json.insert(JSON_KEY_PARTNERID, storeinfo[JSON_KEY_PARTNERID].toString());
json.insert(JSON_KEY_PARTNERID, storeinfo[JSON_KEY_UNIFYID].toString());
}
if(storeinfo.contains(JSON_STOREID))
{
......
......@@ -338,7 +338,9 @@ bool PosOrderPool::GetOrderStatus(QString key, int &status, int &refund_status,
Order_Info info = s_order_pool[key];
status = info.order_status;
refund_status = info.order_refund_status;
refund_status = info.order_refund;
QLOG_DEBUG() << "input0 : " << info.order_id << info.order_status << info.order_refund << info.order_data.refund_status;
if(s_order_list.contains(info.order_id, Qt::CaseInsensitive))
oldorder = true;
......
......@@ -123,6 +123,7 @@
#define JSON_FAILEDNUM "fail_number"
#define JSON_SUCCESSSUM "success_total_fee"
#define JSON_FAILEDSUM "fail_total_fee"
//#define JSON_KEY_UNIFY_ID "unify_id"
#define DB_KEY_ORDERID "order_id"
#define DB_KEY_ORDETRCAHNGETIME "order_change_time"
......
......@@ -25,15 +25,18 @@ FloatForm::FloatForm(QWidget *parent) :
{
ui->setupUi(this);
m_is_login = false;
FMApplication::subscibeEvent(this, PosEvent::s_change_order);
FMApplication::subscibeEvent(this, PosEvent::s_show_float);
FMApplication::subscibeEvent(this, PosEvent::s_delete_order);
FMApplication::subscibeEvent(this, PosEvent::s_login_status);
m_bReminding = false;
QPixmap imgNormal(":float_normal.png");
QPixmap imgNormal(":loginlogin.png");
m_imgNormalSize = imgNormal.size();
QPixmap imgRemind(":float_remind.png");
QPixmap imgRemind(":loginlogin.png");
m_imgRemindSize = imgRemind.size();
m_animation.setTargetObject(this);
......@@ -50,6 +53,26 @@ FloatForm::~FloatForm()
delete ui;
}
void FloatForm::InitWidget(int flag)
{
if(flag == -1)
{
if(m_is_login)
{
ui->widget_base->hide();
ui->widget_login->hide();
ui->widget_synshow->show();
}
else
{
ui->widget_base->show();
ui->widget_login->hide();
ui->widget_synshow->hide();
}
return ;
}
}
bool FloatForm::event(QEvent *e)
{
if(e->type() == PosEvent::s_change_order)
......@@ -68,10 +91,16 @@ bool FloatForm::event(QEvent *e)
QLOG_DEBUG() << "tk_new" << tk_new << "tk_make" << tk_make << "tk_send" << tk_send << "self_new" << self_new << "self_make" << self_make;
ui->label_tknew->setText(QString::number(tk_new));
ui->label_tkmake->setText(QString::number(tk_make));
ui->label_tksend->setText(QString::number(tk_send));
ui->label_sfnew->setText(QString::number(self_new));
ui->label_sfmake->setText(QString::number(self_make));
if(!PosOrderPool::GetOrderStatus(orderid, orderstatus, refundstatus, oldorder))
return true;
qDebug() << "input : " << orderid << orderstatus << refundstatus << oldorder;
QLOG_DEBUG() << "input : " << orderid << orderstatus << refundstatus << oldorder;
if(!oldorder && (orderstatus == NewOrder || orderstatus == FirmOrder) &&
......@@ -81,7 +110,7 @@ bool FloatForm::event(QEvent *e)
return true;
}
if(!oldorder && (refundstatus == ApplicationRefundOrder || refundstatus == ApplicationPartialRefundOrder))
if((refundstatus == ApplicationRefundOrder || refundstatus == ApplicationPartialRefundOrder))
{
onStartRemind(1);
return true;
......@@ -105,6 +134,25 @@ bool FloatForm::event(QEvent *e)
QLOG_DEBUG() << "tk_new" << tk_new << "tk_make" << tk_make << "tk_send" << tk_send << "self_new" << self_new << "self_make" << self_make;
ui->label_tknew->setText(QString::number(tk_new));
ui->label_tkmake->setText(QString::number(tk_make));
ui->label_tksend->setText(QString::number(tk_send));
ui->label_sfnew->setText(QString::number(self_new));
ui->label_sfmake->setText(QString::number(self_make));
return true;
}
if(e->type() == PosEvent::s_login_status)
{
QVariantMap value;
GETEVENTINFO(value,e,QVariantMap);
if(value.contains(EVENT_KEY_STATUS) && value[EVENT_KEY_STATUS].toBool() == true)
{
m_is_login = true;
}
return true;
}
......@@ -176,7 +224,11 @@ void FloatForm::_Blink()
m_animation.start();
loop.exec();
this->setFixedSize(m_imgRemindSize);
ui->floatWdg->setStyleSheet("#floatWdg{ border-image: url(:float_remind.png)}");
//ui->floatWdg->setStyleSheet("#floatWdg{ border-image: url(:float_remind.png)}");
//ui->widget_login->show();
ui->widget_base->hide();
ui->widget_synshow->hide();
ui->widget_login->show();
m_animation.setStartValue(0);
m_animation.setEndValue(1);
m_animation.start();
......@@ -186,7 +238,10 @@ void FloatForm::_Blink()
m_animation.start();
loop.exec();
this->setFixedSize(m_imgNormalSize);
ui->floatWdg->setStyleSheet("#floatWdg{ border-image: url(:float_normal.png)}");
//ui->floatWdg->setStyleSheet("#floatWdg{ border-image: url(:float_normal.png)}");
ui->widget_base->hide();
ui->widget_synshow->show();
ui->widget_login->hide();
m_animation.setStartValue(0);
m_animation.setEndValue(1);
m_animation.start();
......@@ -244,10 +299,12 @@ void FloatForm::onStartRemind(int type)
m_remindWav = QString("%1/wav/msg.wav").arg(QApplication::applicationDirPath());
// 加上音频的时长
m_wavPlayInterval = ConfigManger::GetInstance().GetSoundInterval() + VALUE_NEWORDERTIME;
ui->label_newmsg->setText(QString::fromLocal8Bit("您有新的订单了!\r\n点击打开查看订单"));
break;
case 1:
m_remindWav = QString("%1/wav/msg1.wav").arg(QApplication::applicationDirPath());
m_wavPlayInterval = ConfigManger::GetInstance().GetSoundInterval() + VALUE_REFUNDORDERTIME;
ui->label_newmsg->setText(QString::fromLocal8Bit("您有新的退单了!\r\n点击打开查看订单"));
break;
}
if(m_bReminding)
......@@ -279,6 +336,7 @@ void FloatForm::onStopRemind()
void FloatForm::onShow()
{
InitWidget();
show();
m_raiseTimer.start();
}
......@@ -52,12 +52,18 @@ private:
// 置顶定时器
QTimer m_raiseTimer;
QTimer m_remindTimer;
// 是否登录成功
bool m_is_login;
/* 功能:初始化
* 参数:NULL
* 返回:NULL
* */
void _Init();
/* 功能:界面展示
* 参数:[1] -1界面展示; 0新订单; 1新退单
* 返回:NULL
* */
void InitWidget(int flag = -1);
private slots:
/* 功能:闪烁
* 参数:NULL
......
......@@ -6,14 +6,166 @@
<rect>
<x>0</x>
<y>0</y>
<width>100</width>
<width>210</width>
<height>100</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<widget class="QWidget" name="widget_synshow" native="true">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>210</width>
<height>100</height>
</rect>
</property>
<widget class="QLabel" name="label_new">
<property name="geometry">
<rect>
<x>122</x>
<y>14</y>
<width>18</width>
<height>18</height>
</rect>
</property>
<property name="text">
<string></string>
</property>
</widget>
<widget class="QLabel" name="label_make">
<property name="geometry">
<rect>
<x>148</x>
<y>14</y>
<width>18</width>
<height>18</height>
</rect>
</property>
<property name="text">
<string></string>
</property>
</widget>
<widget class="QLabel" name="label_send">
<property name="geometry">
<rect>
<x>175</x>
<y>14</y>
<width>18</width>
<height>18</height>
</rect>
</property>
<property name="text">
<string></string>
</property>
</widget>
<widget class="QLabel" name="label_tknew">
<property name="geometry">
<rect>
<x>122</x>
<y>35</y>
<width>20</width>
<height>18</height>
</rect>
</property>
<property name="text">
<string>0</string>
</property>
</widget>
<widget class="QLabel" name="label_tkmake">
<property name="geometry">
<rect>
<x>148</x>
<y>35</y>
<width>20</width>
<height>18</height>
</rect>
</property>
<property name="text">
<string>0</string>
</property>
</widget>
<widget class="QLabel" name="label_tksend">
<property name="geometry">
<rect>
<x>175</x>
<y>35</y>
<width>20</width>
<height>18</height>
</rect>
</property>
<property name="text">
<string>0</string>
</property>
</widget>
<widget class="QLabel" name="label_tk">
<property name="geometry">
<rect>
<x>100</x>
<y>35</y>
<width>20</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="label_sf">
<property name="geometry">
<rect>
<x>100</x>
<y>65</y>
<width>20</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="label_sfnew">
<property name="geometry">
<rect>
<x>122</x>
<y>65</y>
<width>20</width>
<height>18</height>
</rect>
</property>
<property name="text">
<string>0</string>
</property>
</widget>
<widget class="QLabel" name="label_sfmake">
<property name="geometry">
<rect>
<x>148</x>
<y>65</y>
<width>20</width>
<height>18</height>
</rect>
</property>
<property name="text">
<string>999</string>
</property>
</widget>
</widget>
<widget class="QWidget" name="widget_login" native="true">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>210</width>
<height>100</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
......@@ -26,14 +178,48 @@
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>101</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_newmsg">
<property name="text">
<string/>
</property>
<item row="0" column="0">
<widget class="QWidget" name="floatWdg" native="true"/>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="widget_base" native="true">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>100</width>
<height>100</height>
</rect>
</property>
</widget>
<zorder>widget_base</zorder>
<zorder>widget_login</zorder>
<zorder>widget_synshow</zorder>
</widget>
<resources/>
<connections/>
</ui>
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