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
c39f8eab
Commit
c39f8eab
authored
Jan 18, 2019
by
xiaoqing.gu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、分离获取档口信息的代码成单独的函数 2、修改主界面的样式表
parent
4f8ef409
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
77 additions
and
53 deletions
+77
-53
takeout/control/stallsgetwork.cpp
+34
-28
takeout/control/stallsgetwork.h
+2
-0
takeout/view/newmainform.cpp
+3
-2
takeout/view/newmainform.ui
+38
-23
No files found.
takeout/control/stallsgetwork.cpp
View file @
c39f8eab
...
@@ -73,35 +73,9 @@ void StallsGetWork::workstart()
...
@@ -73,35 +73,9 @@ void StallsGetWork::workstart()
while
(
!
_stopflag
)
while
(
!
_stopflag
)
{
{
//获取档口信息
//获取档口信息
QJsonObject
json
,
recvjson
;
QJsonObject
recvjson
=
getStallsInfo
();
QString
realurl
;
QString
error
;
if
(
!
GetStallsDataProcess
::
getStallsOptRequest
(
json
,
_storeinfo
[
JSON_KEY_PARTNERID
].
toString
()))
{
QLOG_ERROR
()
<<
"getStallsOptRequest failed"
;
return
;
}
QLOG_INFO
()
<<
"getStallsOptRequest request json : "
<<
json
;
if
(
!
GetStallsDataProcess
::
getRealUrl
(
ADVANCEORDER
,
json
,
_url
,
realurl
))
{
QLOG_ERROR
()
<<
"getStallsOptRequest getRealUrl failed"
;
return
;
}
QLOG_INFO
()
<<
"getStallsOptRequest request url :"
<<
realurl
;
if
(
!
this
->
S_Request
(
json
,
recvjson
,
realurl
,
error
))
{
QLOG_ERROR
()
<<
"getStallsOptRequest failed : "
<<
error
;
return
;
}
QLOG_INFO
()
<<
"getStallsOptRequest return json : "
<<
recvjson
;
//判断recvjson,如果返回失败和
一种
,则不推送这个消息
//判断recvjson,如果返回失败和
没有商品列表
,则不推送这个消息
QJsonObject
tmpjson
;
QJsonObject
tmpjson
;
QJsonArray
tmparray
;
QJsonArray
tmparray
;
if
(
recvjson
.
contains
(
EVENT_KEY_RESULT
)
&&
recvjson
[
EVENT_KEY_RESULT
].
toObject
().
contains
(
EVENT_KEY_FILEPRODUCTLIST
))
{
if
(
recvjson
.
contains
(
EVENT_KEY_RESULT
)
&&
recvjson
[
EVENT_KEY_RESULT
].
toObject
().
contains
(
EVENT_KEY_FILEPRODUCTLIST
))
{
...
@@ -123,3 +97,35 @@ void StallsGetWork::workstart()
...
@@ -123,3 +97,35 @@ void StallsGetWork::workstart()
_stoped
=
true
;
_stoped
=
true
;
}
}
QJsonObject
StallsGetWork
::
getStallsInfo
()
{
QJsonObject
json
,
recvjson
;
QString
realurl
;
QString
error
;
if
(
!
GetStallsDataProcess
::
getStallsOptRequest
(
json
,
_storeinfo
[
JSON_KEY_PARTNERID
].
toString
()))
{
QLOG_ERROR
()
<<
"getStallsOptRequest failed"
;
return
QJsonObject
();
}
QLOG_INFO
()
<<
"getStallsOptRequest request json : "
<<
json
;
if
(
!
GetStallsDataProcess
::
getRealUrl
(
ADVANCEORDER
,
json
,
_url
,
realurl
))
{
QLOG_ERROR
()
<<
"getStallsOptRequest getRealUrl failed"
;
return
QJsonObject
();
}
QLOG_INFO
()
<<
"getStallsOptRequest request url :"
<<
realurl
;
if
(
!
this
->
S_Request
(
json
,
recvjson
,
realurl
,
error
))
{
QLOG_ERROR
()
<<
"getStallsOptRequest failed : "
<<
error
;
return
QJsonObject
();
}
QLOG_INFO
()
<<
"getStallsOptRequest return json : "
<<
recvjson
;
return
recvjson
;
}
takeout/control/stallsgetwork.h
View file @
c39f8eab
...
@@ -29,6 +29,8 @@ signals:
...
@@ -29,6 +29,8 @@ signals:
public
slots
:
public
slots
:
void
workstart
();
void
workstart
();
private
:
private
:
QJsonObject
getStallsInfo
();
QVariantMap
_storeinfo
;
QVariantMap
_storeinfo
;
QString
_token
;
QString
_token
;
...
...
takeout/view/newmainform.cpp
View file @
c39f8eab
...
@@ -1093,13 +1093,13 @@ void NewMainForm::onSetStalls(QJsonObject json)
...
@@ -1093,13 +1093,13 @@ void NewMainForm::onSetStalls(QJsonObject json)
QJsonObject
tmpjson
=
tmparray
[
i
].
toObject
();
QJsonObject
tmpjson
=
tmparray
[
i
].
toObject
();
QString
stallsStr
;
QString
stallsStr
;
stallsList
.
append
(
tmpjson
[
EVENT_KEY_FILENAME
].
toString
());
stallsList
.
append
(
tmpjson
[
EVENT_KEY_FILENAME
].
toString
());
stallsStr
.
append
(
tmpjson
[
EVENT_KEY_FILENAME
].
toString
()
+
QString
::
fromLocal8Bit
(
"
:
"
));
stallsStr
.
append
(
tmpjson
[
EVENT_KEY_FILENAME
].
toString
()
+
QString
::
fromLocal8Bit
(
"
:
"
));
if
(
tmpjson
.
contains
(
EVENT_KEY_PRODUCTLIST
))
{
if
(
tmpjson
.
contains
(
EVENT_KEY_PRODUCTLIST
))
{
QJsonArray
proarray
=
tmpjson
[
EVENT_KEY_PRODUCTLIST
].
toArray
();
QJsonArray
proarray
=
tmpjson
[
EVENT_KEY_PRODUCTLIST
].
toArray
();
if
(
proarray
.
size
()
!=
0
)
{
if
(
proarray
.
size
()
!=
0
)
{
for
(
int
j
=
0
;
j
<
proarray
.
size
();
j
++
)
{
for
(
int
j
=
0
;
j
<
proarray
.
size
();
j
++
)
{
stallsStr
.
append
(
proarray
[
j
].
toObject
()[
EVENT_KEY_FILEPRODUCT
].
toString
()
+
QString
::
fromLocal8Bit
(
" "
));
stallsStr
.
append
(
proarray
[
j
].
toObject
()[
EVENT_KEY_FILEPRODUCT
].
toString
()
+
QString
::
fromLocal8Bit
(
"
"
));
}
}
}
}
}
}
...
@@ -1112,6 +1112,7 @@ void NewMainForm::onSetStalls(QJsonObject json)
...
@@ -1112,6 +1112,7 @@ void NewMainForm::onSetStalls(QJsonObject json)
for
(
int
k
=
0
;
k
<
productList
.
size
();
k
++
)
{
for
(
int
k
=
0
;
k
<
productList
.
size
();
k
++
)
{
ui
->
stallsTextBrowser
->
append
(
QString
(
productList
.
at
(
k
)));
ui
->
stallsTextBrowser
->
append
(
QString
(
productList
.
at
(
k
)));
}
}
ui
->
stallsTextBrowser
->
anchorAt
(
QPoint
(
0
,
0
));
}
}
...
...
takeout/view/newmainform.ui
View file @
c39f8eab
...
@@ -6,8 +6,8 @@
...
@@ -6,8 +6,8 @@
<rect>
<rect>
<x>
0
</x>
<x>
0
</x>
<y>
0
</y>
<y>
0
</y>
<width>
164
7
</width>
<width>
164
4
</width>
<height>
7
33
</height>
<height>
7
62
</height>
</rect>
</rect>
</property>
</property>
<property
name=
"minimumSize"
>
<property
name=
"minimumSize"
>
...
@@ -246,10 +246,16 @@ QTabWidget#newmaintbwgt QTabBar::tab
...
@@ -246,10 +246,16 @@ QTabWidget#newmaintbwgt QTabBar::tab
font: 16px
"
微软雅黑
"
;
font: 16px
"
微软雅黑
"
;
color: rgb(51, 51, 51);
color: rgb(51, 51, 51);
}
}
#newlabel_11,#newlabel_12,#newmaincombx_del,#newmainvtn_ordersave,#newmainrdbtn_self,#newmainrdbtn_auto
#newlabel_11,#newlabel_12,#newmaincombx_del,#newmainvtn_ordersave,#newmainrdbtn_self,#newmainrdbtn_auto
,#newmaincmbox_stalls,#label_stalls
{
{
font: 16px
"
微软雅黑
"
;
font: 16px
"
微软雅黑
"
;
color: rgb(51, 51, 51);
color: rgb(51, 51, 51);
}
#stallsTextBrowser
{
font: 16px
"
微软雅黑
"
;
color: rgb(51, 51, 51);
background-color:rgb(255, 255, 203);
}
</string>
}
</string>
</property>
</property>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
stretch=
"0,7"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
stretch=
"0,7"
>
...
@@ -1140,7 +1146,7 @@ QTabWidget#newmaintbwgt QTabBar::tab
...
@@ -1140,7 +1146,7 @@ QTabWidget#newmaintbwgt QTabBar::tab
<attribute
name=
"title"
>
<attribute
name=
"title"
>
<string>
打印设置
</string>
<string>
打印设置
</string>
</attribute>
</attribute>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_8"
stretch=
"0,7,
0,
2"
>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout_8"
stretch=
"0,7,2"
>
<property
name=
"spacing"
>
<property
name=
"spacing"
>
<number>
0
</number>
<number>
0
</number>
</property>
</property>
...
@@ -3676,19 +3682,6 @@ QTabWidget#newmaintbwgt QTabBar::tab
...
@@ -3676,19 +3682,6 @@ QTabWidget#newmaintbwgt QTabBar::tab
</widget>
</widget>
</item>
</item>
<item>
<item>
<spacer
name=
"verticalSpacer_22"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
20
</width>
<height>
40
</height>
</size>
</property>
</spacer>
</item>
<item>
<widget
class=
"QWidget"
name=
"widget_3"
native=
"true"
>
<widget
class=
"QWidget"
name=
"widget_3"
native=
"true"
>
<property
name=
"styleSheet"
>
<property
name=
"styleSheet"
>
<string
notr=
"true"
/>
<string
notr=
"true"
/>
...
@@ -3713,8 +3706,14 @@ QTabWidget#newmaintbwgt QTabBar::tab
...
@@ -3713,8 +3706,14 @@ QTabWidget#newmaintbwgt QTabBar::tab
<widget
class=
"QLabel"
name=
"label_stalls"
>
<widget
class=
"QLabel"
name=
"label_stalls"
>
<property
name=
"minimumSize"
>
<property
name=
"minimumSize"
>
<size>
<size>
<width>
100
</width>
<width>
65
</width>
<height>
30
</height>
<height>
0
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
65
</width>
<height>
16777215
</height>
</size>
</size>
</property>
</property>
<property
name=
"text"
>
<property
name=
"text"
>
...
@@ -3730,9 +3729,12 @@ QTabWidget#newmaintbwgt QTabBar::tab
...
@@ -3730,9 +3729,12 @@ QTabWidget#newmaintbwgt QTabBar::tab
<property
name=
"orientation"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
<enum>
Qt::Horizontal
</enum>
</property>
</property>
<property
name=
"sizeType"
>
<enum>
QSizePolicy::Fixed
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<size>
<width>
4
0
</width>
<width>
8
0
</width>
<height>
20
</height>
<height>
20
</height>
</size>
</size>
</property>
</property>
...
@@ -3742,8 +3744,14 @@ QTabWidget#newmaintbwgt QTabBar::tab
...
@@ -3742,8 +3744,14 @@ QTabWidget#newmaintbwgt QTabBar::tab
<widget
class=
"QComboBox"
name=
"newmaincmbox_stalls"
>
<widget
class=
"QComboBox"
name=
"newmaincmbox_stalls"
>
<property
name=
"minimumSize"
>
<property
name=
"minimumSize"
>
<size>
<size>
<width>
150
</width>
<width>
180
</width>
<height>
30
</height>
<height>
0
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
180
</width>
<height>
16777215
</height>
</size>
</size>
</property>
</property>
</widget>
</widget>
...
@@ -3764,7 +3772,14 @@ QTabWidget#newmaintbwgt QTabBar::tab
...
@@ -3764,7 +3772,14 @@ QTabWidget#newmaintbwgt QTabBar::tab
</layout>
</layout>
</item>
</item>
<item>
<item>
<widget
class=
"QTextBrowser"
name=
"stallsTextBrowser"
/>
<widget
class=
"QTextBrowser"
name=
"stallsTextBrowser"
>
<property
name=
"minimumSize"
>
<size>
<width>
0
</width>
<height>
120
</height>
</size>
</property>
</widget>
</item>
</item>
</layout>
</layout>
</widget>
</widget>
...
...
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