Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
supplier
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
王宇航
supplier
Commits
4ccca7e1
Commit
4ccca7e1
authored
Mar 17, 2021
by
Wyh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、外送顯示訂單數量不正確問題
parent
90585346
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/model/viewModel/PageViewModel.kt
+2
-6
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/ui/activity/DeliveryOrderMainActivity.kt
+5
-1
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/util/OtherOrderUtils.kt
+1
-1
No files found.
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/model/viewModel/PageViewModel.kt
View file @
4ccca7e1
...
...
@@ -48,6 +48,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
companion
object
{
//0,1
var
fragmentStatus
=
arrayOf
(
"0,1,2,3,8"
,
"0,1"
,
"2"
,
"3"
,
"3"
)
//訂單類型:0為所有,2是外送,7是自取。
//第四個為2(外送),是因為第四個頁面是“送貨中”,只有外送有
//第五個為7(自取),因為第五個頁面是待取餐,只有自取有
...
...
@@ -121,7 +122,6 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
launch
({
repository
.
getOrderGroup
(
restaurantId
.
toString
()).
apply
{
//先把所有置0
mOrderNum
=
ArrayList
(
5
)
for
(
i
in
mOrderNum
)
{
i
.
value
=
0
}
...
...
@@ -129,11 +129,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
for
(
i
in
data
.
selfTakeaway
)
{
when
(
i
.
STATUS
)
{
0
->
//未支付的待確認
if
(
mOrderNum
.
size
>
1
)
{
mOrderNum
[
1
].
value
=
mOrderNum
[
1
].
value
?.
plus
(
i
.
SumNum
)
}
else
{
mOrderNum
[
1
]
=
MutableLiveData
(
i
.
SumNum
)
}
1
->
//已支付的待確認
mOrderNum
[
1
].
value
=
mOrderNum
[
1
].
value
?.
plus
(
i
.
SumNum
)
2
->
//製作中
...
...
@@ -159,7 +155,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
num
+=
i
.
value
!!
}
}
mOrderNum
[
0
]
=
MutableLiveData
(
num
)
mOrderNum
[
0
]
.
value
=
num
}
},
{
it
.
printStackTrace
()
...
...
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/ui/activity/DeliveryOrderMainActivity.kt
View file @
4ccca7e1
...
...
@@ -111,8 +111,8 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
initAppTop
()
//初始化切換餐廳狀態
initSwitchRestStatus
()
initTabs
()
initViewPager
()
initTabs
()
//搜索
searchMethod
()
//獲取餐廳營業信息展示欄的高度
...
...
@@ -135,6 +135,8 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
getBalance
(
RestaurantInfoManager
.
newInstance
().
brandId
)
//第一次獲取數據
getCurrentPageOrderList
()
//獲取每個狀態的訂單數量
pageViewModel
.
getOrderGroupNum
()
//餐廳營業信息刷新監聽
restaurantBusinessInfo
.
observe
(
this
@DeliveryOrderMainActivity
,
Observer
{
binding
.
data
=
it
...
...
@@ -460,6 +462,8 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
}
//獲取每個狀態的訂單數量
pageViewModel
.
getOrderGroupNum
()
//查詢預約單和即時單數量
pageViewModel
.
getOrderStatistics
(
fragmentStatus
[
view_pager
.
currentItem
])
}
}
})
...
...
component-delivery-pick/src/main/java/com/gingersoft/gsa/delivery_pick_mode/util/OtherOrderUtils.kt
View file @
4ccca7e1
...
...
@@ -285,7 +285,7 @@ object OtherOrderUtils {
private
var
soundPool
:
SoundPool
?
=
null
var
lastTime
:
Long
=
0
private
var
lastTime
:
Long
=
0
fun
initSoundPool
(
context
:
Context
,
resId
:
Int
)
{
//限制10秒提示一次
if
(
System
.
currentTimeMillis
()
-
lastTime
<
10
*
1000
)
{
...
...
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