Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
machine
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hooloo
android
machine
Commits
b098770f
Commit
b098770f
authored
Mar 08, 2023
by
wjg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add release apk
parent
3b7309d6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
1 deletions
+32
-1
main_app/src/main/java/com/ihaoin/hooloo/device/data/vo/Goods.java
+10
-0
main_app/src/main/java/com/ihaoin/hooloo/device/home/view/LauncherActivity.java
+22
-1
No files found.
main_app/src/main/java/com/ihaoin/hooloo/device/data/vo/Goods.java
View file @
b098770f
...
@@ -29,6 +29,16 @@ public class Goods implements Serializable {
...
@@ -29,6 +29,16 @@ public class Goods implements Serializable {
private
Integer
isRecommend
;
private
Integer
isRecommend
;
/** 特惠标签 */
/** 特惠标签 */
private
List
<
String
>
recommendTagList
;
private
List
<
String
>
recommendTagList
;
/** 是否全部售罄 */
private
Boolean
isSellin
;
public
Boolean
isSellin
()
{
return
isSellin
;
}
public
void
setIsSellin
(
Boolean
isSellin
)
{
this
.
isSellin
=
isSellin
;
}
public
List
<
String
>
getRecommendTagList
()
{
public
List
<
String
>
getRecommendTagList
()
{
return
recommendTagList
;
return
recommendTagList
;
...
...
main_app/src/main/java/com/ihaoin/hooloo/device/home/view/LauncherActivity.java
View file @
b098770f
...
@@ -67,6 +67,8 @@ import com.ihaoin.hooloo.device.util.Utils;
...
@@ -67,6 +67,8 @@ import com.ihaoin.hooloo.device.util.Utils;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
public
class
LauncherActivity
extends
Activity
{
public
class
LauncherActivity
extends
Activity
{
private
SkuStateChangeReceiver
skuChangeReceiver
;
private
SkuStateChangeReceiver
skuChangeReceiver
;
...
@@ -511,8 +513,27 @@ public class LauncherActivity extends Activity {
...
@@ -511,8 +513,27 @@ public class LauncherActivity extends Activity {
if
(
CollectionUtils
.
isEmpty
(
category
.
getGoods
()))
{
if
(
CollectionUtils
.
isEmpty
(
category
.
getGoods
()))
{
return
;
return
;
}
}
// 把售罄的商品排到最下面
category
.
getGoods
().
forEach
(
goods
->
{
Sku
sku
=
Utils
.
getDefaultSku
(
goods
.
getSkus
());
if
(
SkuState
.
isSellin
(
sku
.
getState
()))
{
goods
.
setIsSellin
(
true
);
}
else
{
goods
.
setIsSellin
(
false
);
}
});
Map
<
Boolean
,
List
<
Goods
>>
map
=
category
.
getGoods
().
stream
().
collect
(
Collectors
.
groupingBy
(
Goods:
:
isSellin
));
List
<
Goods
>
sellinList
=
map
.
get
(
Boolean
.
TRUE
);
List
<
Goods
>
selloutList
=
map
.
get
(
Boolean
.
FALSE
);
scrollGoods
.
add
(
new
ScrollBean
(
true
,
category
.
getName
()));
scrollGoods
.
add
(
new
ScrollBean
(
true
,
category
.
getName
()));
category
.
getGoods
().
forEach
(
goods
->
scrollGoods
.
add
(
new
ScrollBean
(
new
ScrollBean
.
ScrollItemBean
(
goods
,
category
.
getName
()))));
if
(!
CollectionUtils
.
isEmpty
(
sellinList
))
{
sellinList
.
forEach
(
goods
->
scrollGoods
.
add
(
new
ScrollBean
(
new
ScrollBean
.
ScrollItemBean
(
goods
,
category
.
getName
()))));
}
if
(!
CollectionUtils
.
isEmpty
(
selloutList
))
{
selloutList
.
forEach
(
goods
->
scrollGoods
.
add
(
new
ScrollBean
(
new
ScrollBean
.
ScrollItemBean
(
goods
,
category
.
getName
()))));
}
});
});
for
(
int
i
=
0
;
i
<
scrollGoods
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
scrollGoods
.
size
();
i
++)
{
...
...
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