Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fmtakeout
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李定达
fmtakeout
Commits
38f8f79e
Commit
38f8f79e
authored
Oct 30, 2018
by
李定达
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.修复退单状态不一致bug;2.悬浮窗添加测试完成;3.修复悬浮窗退单提示异常bug
parent
6eea0025
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
273 additions
and
15 deletions
+273
-15
takeout/control/ordergetwork.cpp
+5
-0
takeout/control/ordergetwork.h
+1
-1
takeout/model/posorderpool.cpp
+3
-1
takeout/preDefine.h
+1
-0
takeout/view/floatForm.cpp
+64
-6
takeout/view/floatForm.h
+7
-1
takeout/view/floatForm.ui
+192
-6
No files found.
takeout/control/ordergetwork.cpp
View file @
38f8f79e
...
...
@@ -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
)
...
...
takeout/control/ordergetwork.h
View file @
38f8f79e
...
...
@@ -239,7 +239,7 @@ private:
}
if
(
storeinfo
.
contains
(
JSON_KEY_PARTNERID
))
{
json
.
insert
(
JSON_KEY_PARTNERID
,
storeinfo
[
JSON_KEY_
PARTNER
ID
].
toString
());
json
.
insert
(
JSON_KEY_PARTNERID
,
storeinfo
[
JSON_KEY_
UNIFY
ID
].
toString
());
}
if
(
storeinfo
.
contains
(
JSON_STOREID
))
{
...
...
takeout/model/posorderpool.cpp
View file @
38f8f79e
...
...
@@ -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
;
...
...
takeout/preDefine.h
View file @
38f8f79e
...
...
@@ -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"
...
...
takeout/view/floatForm.cpp
View file @
38f8f79e
...
...
@@ -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
();
}
takeout/view/floatForm.h
View file @
38f8f79e
...
...
@@ -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
...
...
takeout/view/floatForm.ui
View file @
38f8f79e
...
...
@@ -6,14 +6,166 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
10
0
</width>
<width>
21
0
</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>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment