Commit b098770f by wjg

add release apk

parent 3b7309d6
...@@ -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;
......
...@@ -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++) {
......
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