Commit 6796b1b4 by wuyang.zou

fix : FloatFrom Display Store Status;

      Version
      2.2019.1125.1
parent 1c772fb1
......@@ -749,17 +749,13 @@ bool FlowControl::_Login()
emit setCashierInfo(m_cashierName);
//***********************登陆时获取门店的营业状态 begin ************************//
/*
m_eleStoreStatus = recvJson[JSON_ELESTORESTS].toInt();
m_modStoreStatus = recvJson[JSON_MODSTORESTS].toInt();
m_mopStoreStatus = recvJson[JSON_MOPSTORESTS].toInt();
QLOG_INFO()<<QString("[<<<<---FlowControl::_Login eleStoreStatus:%1;modStoreStatus:%2;mopStoreStatus:%3 --->>>>]").
arg(m_eleStoreStatus).arg(m_modStoreStatus).arg(m_mopStoreStatus);
emit doUpdateStoreStatus(m_eleStoreStatus,m_modStoreStatus,m_mopStoreStatus);
*/
m_eleStoreStatus = 0;
m_modStoreStatus = 0;
m_mopStoreStatus = 0;
//***********************登陆时获取门店的营业状态 end ************************//
m_bLoginResult= true;
m_clearTimer->start(1000*60*60*2); // 5分钟执行一次清理任务:正式上线需要两小时清理一次;
......@@ -977,6 +973,7 @@ bool FlowControl::_SendHeart()
{
m_bLastHeartIsError = true;
emit setNetStatus(QString::fromLocal8Bit("<font color='#ff0000'>网络不稳定,正在重试</font>"));
emit doUpdateStoreStatus(0,0,0); //NetWork Is Error , Refresh Store Default Status;
}else
{
QLOG_INFO() << QString("[<<<<---Send Heart Finish: code:%1--->>>>]").arg(recvJson[JSON_LOGINCODE].toInt());
......@@ -985,29 +982,27 @@ bool FlowControl::_SendHeart()
result = false;
m_bLastHeartIsError = true;
emit setNetStatus(QString::fromLocal8Bit("<font color='#ff0000'>网络不稳定,正在重试</font>"));
emit doUpdateStoreStatus(0,0,0); //Interface Return Error , Refresh Store Default Status;
}else{
result = true;
emit setNetStatus(QString::fromLocal8Bit("<font color='#f5f5f5'>正常</font>"));
//只有上一次心跳是异常:才根据心跳来展示门店营业状态 [数据延迟比较严重:同时也需要通过OMS推门店状态给插件]
if(m_bLastHeartIsError){
if( recvJson.contains(JSON_ELESTORESTS) ){
//m_eleStoreStatus = recvJson[JSON_ELESTORESTS].toInt();
m_eleStoreStatus = 0;
//if (m_bLastHeartIsError) { //OMS服务端 门店开关店不主动推送,主要依赖心跳请求更新数据;
if ( recvJson.contains(JSON_ELESTORESTS) ) {
m_eleStoreStatus = recvJson[JSON_ELESTORESTS].toInt();
}
if( recvJson.contains(JSON_MODSTORESTS) ){
//m_modStoreStatus = recvJson[JSON_MODSTORESTS].toInt();
m_modStoreStatus = 0;
if ( recvJson.contains(JSON_MODSTORESTS) ) {
m_modStoreStatus = recvJson[JSON_MODSTORESTS].toInt();
}
if( recvJson.contains(JSON_MOPSTORESTS) ){
//m_mopStoreStatus = recvJson[JSON_MOPSTORESTS].toInt();
m_mopStoreStatus = 0;
if ( recvJson.contains(JSON_MOPSTORESTS) ) {
m_mopStoreStatus = recvJson[JSON_MOPSTORESTS].toInt();
}
QLOG_INFO()<<QString("[<<<<---FlowControl::_SendHeart eleStoreStatus:%1;modStoreStatus:%2;mopStoreStatus:%3 --->>>>]").
arg(m_eleStoreStatus).arg(m_modStoreStatus).arg(m_mopStoreStatus);
//emit doUpdateStoreStatus(m_eleStoreStatus,m_modStoreStatus,m_mopStoreStatus);
emit doUpdateStoreStatus(m_eleStoreStatus,m_modStoreStatus,m_mopStoreStatus);
//还原并标记上一次心跳为正常状态;
m_bLastHeartIsError = false;
}
//}
}
}
return result;
......@@ -2353,17 +2348,14 @@ bool FlowControl::_ResponseOMS12Request(const QJsonObject &content, QJsonObject
if(result){
if(!content["storeId"].toString().compare(m_storeId)) {
QLOG_INFO()<<"FlowControl::_ResponseOMS12Request:"<<content;
/*
m_eleStoreStatus = content[JSON_ELESTORESTS].toInt();
m_modStoreStatus = content[JSON_MODSTORESTS].toInt();
m_mopStoreStatus = content[JSON_MOPSTORESTS].toInt();
QLOG_INFO()<<QString("[<<<<---FlowControl::_ResponseOMS12Request eleStoreStatus:%1;modStoreStatus:%2;mopStoreStatus:%3 --->>>>]").
arg(m_eleStoreStatus).arg(m_modStoreStatus).arg(m_mopStoreStatus);
emit doUpdateStoreStatus(m_eleStoreStatus,m_modStoreStatus,m_mopStoreStatus);
*/
m_eleStoreStatus = 0;
m_modStoreStatus = 0;
m_mopStoreStatus = 0;
error=QString("success");
result = true;
} else {
......
......@@ -2,6 +2,7 @@
#include "ui_floatForm.h"
#include "windows.h"
#include <QPixmap>
#include <QLabel>
#include "DTools/configManger.h"
#include "preDefine.h"
#include "QsLog.h"
......@@ -19,12 +20,11 @@ FloatForm::FloatForm(QWidget *parent) :
m_bReminding = false;
m_bStoreStatus = true; //程序启动后,初始化为开店状态;
QPixmap imgNormal(":float_normal.png");
m_imgNormalSize = imgNormal.size();
QPixmap imgStoreClose(":float_storeCloseStatus.png");
m_imgStoreCloseSize = imgStoreClose.size();
/*
QPixmap imgNormal(":float_normal.png"); m_imgNormalSize = imgNormal.size();
*/
QPixmap imgStoreBusiStat(":StoreBusinessStatus.png");
m_imgStoreBusiStatSize = imgStoreBusiStat.size();
QPixmap imgRemind(":float_remind.png");
m_imgRemindSize = imgRemind.size();
......@@ -57,20 +57,19 @@ void FloatForm::mouseMoveEvent(QMouseEvent *event)
void FloatForm::mousePressEvent(QMouseEvent *event)
{
if (event->button()==Qt::LeftButton)
{
if (event->button()==Qt::LeftButton) {
m_bMousePress = true;
m_lastMousePos = event->globalPos();
m_absMove = QPoint(0,0);
}
// if(event->button()==Qt::RightButton)
// {
// sInfoThread.terminate();
// workThread.terminate();
// qApp->exit(-1);
// QProcess::startDetached(qApp->applicationFilePath(), QStringList(qApp->applicationFilePath()));
// }
/*
if(event->button()==Qt::RightButton) {
sInfoThread.terminate();
workThread.terminate();
qApp->exit(-1);
QProcess::startDetached(qApp->applicationFilePath(), QStringList(qApp->applicationFilePath()));
}
*/
}
void FloatForm::mouseReleaseEvent(QMouseEvent *event)
......@@ -109,16 +108,13 @@ void FloatForm::_Init()
{
setWindowFlags(this->windowFlags() | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::Tool);
setAttribute(Qt::WA_TranslucentBackground);
//根据门店的开店/关店 状态来显示不同的图片;
if(m_bStoreStatus) {
setFixedSize(m_imgNormalSize);
setStyleSheet("#floatWdg{ border-image: url(:float_normal.png); }");
}else{
setFixedSize(m_imgStoreCloseSize);
setStyleSheet("#floatWdg{ border-image: url(:float_storeCloseStatus.png); }");
}
//setFixedSize(m_imgNormalSize);
//setStyleSheet("#floatWdg{ border-image: url(:float_normal.png); }");
setFixedSize(m_imgStoreBusiStatSize);
setStyleSheet("#floatWdg{ border-image: url(:StoreBusinessStatus.png); }");
//初始化悬浮框 多渠道门店营业状态;
RefreshStoreStatus();
QPoint point = ConfigManger::GetInstance().GetFloatInitPostion();
QLOG_INFO()<<QString::fromLocal8Bit("Float From Init Postion(x:%1,y:%2)").arg(point.x()).arg(point.y());
int nWidth = GetSystemMetrics(SM_CXSCREEN) - 200;
......@@ -142,8 +138,9 @@ void FloatForm::_Blink()
m_animation.setEndValue(0);
m_animation.start();
loop.exec();
this->setFixedSize(m_imgRemindSize);
ui->floatWdg->setStyleSheet("#floatWdg{ border-image: url(:float_remind.png);}");
//this->setFixedSize(m_imgRemindSize);
//ui->floatWdg->setStyleSheet("#floatWdg{ border-image: url(:float_remind.png);}");
m_animation.setStartValue(0);
m_animation.setEndValue(1);
m_animation.start();
......@@ -153,13 +150,12 @@ void FloatForm::_Blink()
m_animation.start();
loop.exec();
/*
if(m_bStoreStatus) {
this->setFixedSize(m_imgNormalSize);
ui->floatWdg->setStyleSheet("#floatWdg{ border-image: url(:float_normal.png);}");
}else{
this->setFixedSize(m_imgStoreCloseSize);
ui->floatWdg->setStyleSheet("#floatWdg{ border-image: url(:float_storeCloseStatus.png);}");
}
}*/
m_animation.setStartValue(0);
m_animation.setEndValue(1);
m_animation.start();
......@@ -197,6 +193,7 @@ void FloatForm::onStartRemind(int type)
if(!m_bReminding) {
m_bReminding = true;
RefreshOrderManagerStatus(1);
}
//10s后触发将闪烁提醒标志(m_bReminding)重置为False事件;
QTimer::singleShot(1000*10, this, &FloatForm::onStopRemind);
......@@ -208,6 +205,7 @@ void FloatForm::onStartRemind(int type)
void FloatForm::onStopRemind()
{
m_bReminding = false;
RefreshOrderManagerStatus(0);
}
void FloatForm::onShow()
......@@ -234,15 +232,69 @@ void FloatForm::onUnLockFloatForm(){
void FloatForm::onUpdateStoreStatus(int eleStoreStatus, int modStoreStatus,int mopStoreStatus){
QLOG_INFO()<<QString("[<<<----FloatForm::onUpdateStoreStatus:eleStoreStatus, modStoreStatus, mopStoreStatus: --->>>>]")<<eleStoreStatus <<modStoreStatus <<mopStoreStatus ;
RefreshStoreStatus(eleStoreStatus, modStoreStatus,mopStoreStatus);
}
/*
m_bStoreStatus = flag;
if(m_bStoreStatus) {
this->setFixedSize(m_imgNormalSize);
ui->floatWdg->setStyleSheet("#floatWdg{ border-image: url(:float_normal.png);}");
}else{
this->setFixedSize(m_imgStoreCloseSize);
ui->floatWdg->setStyleSheet("#floatWdg{ border-image: url(:float_storeCloseStatus.png);}");
void FloatForm::RefreshStoreStatus(int eleStoreStatus, int modStoreStatus,int mopStoreStatus){
QLOG_INFO()<<QString("[<<<----FloatForm::RefreshStoreStatus:--->>>>]");
//准备MOD门店营业状态Label;
this->ui->Mod1Lable->resize(56, 14); //图片源文件大小
this->ui->Mod1Lable->move(10, 40); //左边距10像素;
this->ui->Mod1Lable->setPixmap(QPixmap(":ModTitle.png"));
this->ui->Mod2Lable->resize(44, 20); //图片源文件大小
this->ui->Mod2Lable->move(70, 36); // 在 Mod1Lable 基础上 x+4; y-4;
if(1 == modStoreStatus){
this->ui->Mod2Lable->setPixmap(QPixmap(":StoreOn.png"));
}else if(2 == modStoreStatus){
this->ui->Mod2Lable->setPixmap(QPixmap(":StoreOff.png"));
}else {
this->ui->Mod2Lable->setPixmap(QPixmap(":StoreDef.png"));
}
*/
//准备Eleme门店营业状态Label;
this->ui->Eleme1Lable->resize(43, 14); //图片源文件大小
this->ui->Eleme1Lable->move(10, 66); //左边距10像素;高度距离上面一个标签 高度 + 10 像素间隔;
this->ui->Eleme1Lable->setPixmap(QPixmap(":ElemeTitle.png"));
this->ui->Eleme2Lable->resize(44, 20); //图片源文件大小
this->ui->Eleme2Lable->move(70, 62); // x 与 Mod1Lable 对齐; y-4;
if(1 == eleStoreStatus){
this->ui->Eleme2Lable->setPixmap(QPixmap(":StoreOn.png"));
}else if(2 == eleStoreStatus){
this->ui->Eleme2Lable->setPixmap(QPixmap(":StoreOff.png"));
} else {
this->ui->Eleme2Lable->setPixmap(QPixmap(":StoreDef.png"));
}
//准备Mop门店营业状态Label;
this->ui->Mop1Lable->resize(56, 14); //图片源文件大小
this->ui->Mop1Lable->move(10, 92); //左边距10像素;高度距离上面一个标签 高度 + 10 像素间隔;
this->ui->Mop1Lable->setPixmap(QPixmap(":MopTitle.png"));
this->ui->Mop2Lable->resize(44, 20); //图片源文件大小
this->ui->Mop2Lable->move(70, 88); // x 与 Mod1Lable 对齐; y-4;
if(1 == mopStoreStatus){
this->ui->Mop2Lable->setPixmap(QPixmap(":StoreOn.png"));
} else if(2 == mopStoreStatus) {
this->ui->Mop2Lable->setPixmap(QPixmap(":StoreOff.png"));
} else {
this->ui->Mop2Lable->setPixmap(QPixmap(":StoreDef.png"));
}
//准备订单管理状态Label;
this->ui->OrderManagerLable->resize(120, 36); //图片源文件大小; x缩小10像素;
this->ui->OrderManagerLable->move(2, 118); //左边距0像素;高度距离上面一个标签 高度 + 10 像素间隔;
this->ui->OrderManagerLable->setPixmap(QPixmap(":NomalOrderManager.png"));
}
void FloatForm::RefreshOrderManagerStatus(int existNewOrder){
QLOG_INFO()<<QString("[<<<----FloatForm::RefreshOrderManagerStatus:%1--->>>>]").arg(existNewOrder);
if(existNewOrder){ //有新订单;
this->ui->OrderManagerLable->resize(120, 36); //图片源文件大小; x缩小10像素;
this->ui->OrderManagerLable->move(2, 118); //左边距0像素;高度距离上面一个标签 高度 + 10 像素间隔;
this->ui->OrderManagerLable->setPixmap(QPixmap(":ComeNewOrder.png"));
} else { //无新订单;
this->ui->OrderManagerLable->resize(120, 36); //图片源文件大小; x缩小10像素;
this->ui->OrderManagerLable->move(2, 118); //左边距0像素;高度距离上面一个标签 高度 + 10 像素间隔;
this->ui->OrderManagerLable->setPixmap(QPixmap(":NomalOrderManager.png"));
}
}
......@@ -39,12 +39,10 @@ private:
// 记录门店营业状态
bool m_bStoreStatus;
// 记录正常状态图片的大小
QSize m_imgNormalSize;
// 记录提示状态图片的大小
QSize m_imgRemindSize;
// 记录门店关店状态图片的大小[和正常状态大小一样,此时主要用表现门店的关店状态:切换了图片]
QSize m_imgStoreCloseSize;
// 三个渠道的门店营业状态;
QSize m_imgStoreBusiStatSize;
// 记录是否正在提示
bool m_bReminding;
// 闪烁动画
......@@ -117,6 +115,18 @@ public slots:
* */
void onUpdateStoreStatus(int eleStoreStatus, int modStoreStatus,int mopStoreStatus);
/* 功能:更新多渠道门店营业状态显示;
* 参数:1 [ele开关店状态] 2[MOD开关店状态] 3[MOP开关店状态]
* 返回:NULL
* */
void RefreshStoreStatus(int eleStoreStatus=0, int modStoreStatus=0,int mopStoreStatus=0);
/* 功能:新订单到POS更新悬浮框显示;
* 参数:1 [是否存在新订单]
* 返回:NULL
* */
void RefreshOrderManagerStatus(int existNewOrder=0);
};
#endif // FLOATFORM_H
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>171</width>
<height>141</height>
<width>158</width>
<height>204</height>
</rect>
</property>
<property name="windowTitle">
......@@ -18,7 +18,108 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QWidget" name="floatWdg" native="true"/>
<widget class="QWidget" name="floatWdg" native="true">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<widget class="QLabel" name="Mod1Lable">
<property name="geometry">
<rect>
<x>0</x>
<y>30</y>
<width>61</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="Mod2Lable">
<property name="geometry">
<rect>
<x>60</x>
<y>30</y>
<width>61</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="Eleme1Lable">
<property name="geometry">
<rect>
<x>0</x>
<y>70</y>
<width>61</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="Eleme2Lable">
<property name="geometry">
<rect>
<x>60</x>
<y>70</y>
<width>61</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="Mop1Lable">
<property name="geometry">
<rect>
<x>0</x>
<y>100</y>
<width>51</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="Mop2Lable">
<property name="geometry">
<rect>
<x>60</x>
<y>90</y>
<width>51</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
<widget class="QLabel" name="OrderManagerLable">
<property name="geometry">
<rect>
<x>0</x>
<y>121</y>
<width>121</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
</widget>
</item>
</layout>
</widget>
......
......@@ -7,8 +7,8 @@ IDI_ICON ICON DISCARDABLE "logo.ico"
#endif
VS_VERSION_INFO VERSIONINFO
//***每次修改后编译发版必须变更版本号(preDefine.h中APP_VERSION 需要一致)***//
FILEVERSION 2,2019,916,2
PRODUCTVERSION 2,2019,916,2
FILEVERSION 2,2019,1125,1
PRODUCTVERSION 2,2019,1125,1
//*************************************************************************//
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
......@@ -31,8 +31,8 @@ VS_VERSION_INFO VERSIONINFO
VALUE "OriginalFilename", "fmTakeout.exe"
VALUE "ProductName", "Delivery Order Plugin"
//***每次修改后编译发版必须变更版本号(preDefine.h中APP_VERSION 需要一致)***//
VALUE "ProductVersion", "2.2019.916.2"
VALUE "FileVersion", "2.2019.916.2"
VALUE "ProductVersion", "2.2019.1125.1"
VALUE "FileVersion", "2.2019.1125.1"
//*************************************************************************//
END
END
......
......@@ -23,7 +23,8 @@
//#define APP_VERSION "2.2019.528.1"
//#define APP_VERSION "2.2019.729.1"
//#define APP_VERSION "2.2019.815.1"
#define APP_VERSION "2.2019.916.2"
//#define APP_VERSION "2.2019.916.2"
#define APP_VERSION "2.2019.1125.1"
//修正版本号时,切记修正 FmTakeout.rc 中的版本号
......
run/skin/MopTitle.png

1.05 KB | W: | H:

run/skin/MopTitle.png

1.15 KB | W: | H:

run/skin/MopTitle.png
run/skin/MopTitle.png
run/skin/MopTitle.png
run/skin/MopTitle.png
  • 2-up
  • Swipe
  • Onion skin
No preview for this file type
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