Commit c08b2d1c by wjg

init

parent cac7a74f
......@@ -61,6 +61,7 @@ dependencies {
implementation 'com.aliyun.alink.linksdk:iot-linkkit:1.7.2'
implementation 'com.aliyun.alink.linksdk:public-channel-core:0.7.7.1'
implementation 'com.aliyun.alink.linksdk:iot-device-manager:1.7.5.0'
implementation 'com.google.zxing:core:3.3.0'
// 引入极光 SDK
implementation project(':library_jiguang')
......
package com.ihaoin.hooloo.device;
import android.app.Application;
import android.util.Log;
import com.ihaoin.hooloo.device.config.AppConfig;
import com.ihaoin.hooloo.device.data.MainData;
import com.ihaoin.hooloo.device.network.HttpUtil;
import cn.jpush.android.api.JPushInterface;
public class HLApplication extends Application {
private static MainData mainData = new MainData();
public static MainData getMainData() {
return mainData;
}
public static void setMainData(MainData data) {
mainData = data;
}
@Override
public void onCreate() {
......@@ -18,6 +29,8 @@ public class HLApplication extends Application {
JPushInterface.setDebugMode(true);
JPushInterface.init(this);
Log.d("PushMessageReceiver", JPushInterface.getRegistrationID(this));
// HttpUtil.postRegistrationId(JPushInterface.getRegistrationID(this), null);
}
@Override
......
......@@ -64,14 +64,16 @@ public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHo
});
}
ImageView imgThumbnail = helper.getView(R.id.img_thumbnail);
RoundedCorners roundedCorners = new RoundedCorners(5);
RequestOptions options = RequestOptions.bitmapTransform(roundedCorners);
Glide.with(mContext).load(goods.getPics().getThumbnail()).apply(options).into(imgThumbnail);
if (goods.getPics() == null) {
imgThumbnail.setImageDrawable(null);
} else {
Glide.with(mContext).load(goods.getPics().getThumbnail()).apply(options).into(imgThumbnail);
}
Sku sku = getSku(goods.getSkus());
if (sku == null) {
helper.setGone(R.id.txt_sellout, true);
helper.setGone(R.id.butn_add, false);
......@@ -83,15 +85,6 @@ public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHo
ViewGroup layoutItem = helper.getView(R.id.layout_item);
Utils.setTouchDelegate(layoutItem, Arrays.asList(butnAdd), 15);
// butnAdd.post(() -> {
// Rect bounds = new Rect();
// ViewGroupUtils.getDescendantRect(layoutItem, butnAdd, bounds);
// bounds.top -= Utils.dpToPx(mContext, 15);
// bounds.left -= Utils.dpToPx(mContext, 15);
// bounds.bottom += Utils.dpToPx(mContext, 15);
// bounds.right += Utils.dpToPx(mContext, 15);
// layoutItem.setTouchDelegate(new TouchDelegate(bounds, butnAdd));
// });
}
View layoutItem = helper.getView(R.id.layout_item);
......
......@@ -34,13 +34,13 @@ public class RecommendAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseVi
protected void convert(BaseViewHolder helper, ScrollBean item) {
ScrollBean.ScrollItemBean t = item.t;
Recommend recommend = (Recommend) t.getObject();
helper.setText(R.id.txt_name, recommend.getTitle());
helper.setText(R.id.txt_name, recommend.getGoodsName());
helper.setText(R.id.txt_intro, recommend.getDesc());
ImageView imgRecommend = helper.getView(R.id.img_recommend);
RoundedCorners roundedCorners = new RoundedCorners(5);
RequestOptions options = RequestOptions.bitmapTransform(roundedCorners);
Glide.with(mContext).load(recommend.getBackground()).apply(options).into(imgRecommend);
Glide.with(mContext).load(recommend.getPic()).apply(options).into(imgRecommend);
View layoutItem = helper.getView(R.id.layout_item);
layoutItem.setOnClickListener(v -> Utils.showGoodsDetail(mContext, recommend.getGoods()));
......
......@@ -29,7 +29,7 @@ public class PushMessageReceiver extends JPushMessageReceiver {
subscribers.put(key, handler);
}
public static void unsubscribe(String key, Handler handler) {
public static void unsubscribe(String key) {
subscribers.remove(key);
}
......
......@@ -5,5 +5,7 @@ public class AppConfig {
public static Boolean DEBUG = true;
/** 机器编码 */
public static String MACHINE_CODE = "";
/** 打开微信网址 */
public static String WX_URL = "https://www.bjjsycloud.com/?id=%s";
}
......@@ -5,6 +5,7 @@ public class Base {
public static final Integer FALSE = 0;
public static final String NOTIFY_ACTION_ORDER_STATE_CHANGED = "ORDER_STATE_CHANGED";
public static final String NOTIFY_ACTION_SKU_STATE_CHANGED = "SKU_STATE_CHANGED";
public static final String NOTIFY_ACTION_QRCODE_VISITED = "QRCODE_VISITED";
public static final String ADD_GOODS_ACTION = "ADD_GOODS_ACTION";
......
package com.ihaoin.hooloo.device.data;
import com.ihaoin.hooloo.device.data.vo.Category;
import com.ihaoin.hooloo.device.data.vo.Recommend;
import com.ihaoin.hooloo.device.data.vo.RightImage;
import java.util.List;
public class Datas {
public static Integer COUNT_OF_ORDER = 9;
public static String tips = "http://www.baidu.com";
public static Integer SHOP_STATE = 1;
public static List<String> leftImages;
public static List<RightImage> rightImages;
public static List<Recommend> recommends;
public static List<Category> categorys;
}
package com.ihaoin.hooloo.device.data;
import com.ihaoin.hooloo.device.data.vo.Category;
import com.ihaoin.hooloo.device.data.vo.Images;
import com.ihaoin.hooloo.device.data.vo.Recommend;
import java.util.List;
public class MainData {
private Integer countOfOrder = 9;
private String tips = "http://www.baidu.com";
private Integer shopState = 1;
private Images images;
private List<Recommend> recommends;
private List<Category> categorys;
public Integer getCountOfOrder() {
return countOfOrder;
}
public void setCountOfOrder(Integer countOfOrder) {
this.countOfOrder = countOfOrder;
}
public String getTips() {
return tips;
}
public void setTips(String tips) {
this.tips = tips;
}
public Integer getShopState() {
return shopState;
}
public void setShopState(Integer shopState) {
this.shopState = shopState;
}
public Images getImages() {
return images;
}
public void setImages(Images images) {
this.images = images;
}
public List<Recommend> getRecommends() {
return recommends;
}
public void setRecommends(List<Recommend> recommends) {
this.recommends = recommends;
}
public List<Category> getCategorys() {
return categorys;
}
public void setCategorys(List<Category> categorys) {
this.categorys = categorys;
}
}
package com.ihaoin.hooloo.device.data.enums;
public enum ImageState {
CLOSED(0, "歇业"),
COOKING(1, "制作中"),
COMPLETED(2, "有待取餐"),
NOT_COMPLETED(3, "无待取餐");
CLOSED("closeDown", "歇业"),
COOKING("inProduction", "制作中"),
COMPLETED("thereAOrder", "有待取餐"),
NOT_COMPLETED("noOrder", "无待取餐");
private Integer code;
private String code;
private String name;
ImageState(Integer code, String name) {
ImageState(String code, String name) {
this.code = code;
this.name = name;
}
public static ImageState get(Integer code) {
public static ImageState get(String code) {
for (ImageState state : ImageState.values()) {
if (state.getCode().equals(code)) {
return state;
......@@ -23,7 +23,7 @@ public enum ImageState {
return null;
}
public Integer getCode() {
public String getCode() {
return code;
}
......
......@@ -45,12 +45,6 @@ public class Category implements Serializable {
this.goods = goods;
}
public Category(Integer id, String name, List<Goods> goods) {
this.setId(id);
this.setName(name);
this.setGoods(goods);
}
@Override
public boolean equals(Object o) {
if (o == null) {
......
......@@ -6,7 +6,7 @@ import java.util.List;
public class Goods implements Serializable {
/** 商品id */
private Integer goodId;
private Integer goodsId;
/** 名称 */
private String name;
/** 原价 */
......@@ -16,7 +16,7 @@ public class Goods implements Serializable {
/** 介绍 */
private String desc;
/** 备注 */
private String remark;
private String remarks;
/** 图片信息 */
private Pics pics;
/** 规格 */
......@@ -26,21 +26,12 @@ public class Goods implements Serializable {
/** SKU */
private List<Sku> skus;
// public Goods(Integer id, String name, Pics pics){
// this.setGoodId(id);
// this.setName(name);
// this.setPics(pics);
// }
//
// public Goods(){
// }
public Integer getGoodId() {
return goodId;
public Integer getGoodsId() {
return goodsId;
}
public void setGoodId(Integer goodId) {
this.goodId = goodId;
public void setGoodsId(Integer goodsId) {
this.goodsId = goodsId;
}
public String getName() {
......@@ -75,12 +66,12 @@ public class Goods implements Serializable {
this.desc = desc;
}
public String getRemark() {
return remark;
public String getRemarks() {
return remarks;
}
public void setRemark(String remark) {
this.remark = remark;
public void setRemarks(String remarks) {
this.remarks = remarks;
}
public Pics getPics() {
......
......@@ -20,6 +20,10 @@ public class GoodsRule implements Serializable {
*/
private Integer isDefault;
/**
* 是否推荐
*/
private Integer isRecommend;
/**
* 状态,1-可售、0-不可售
*/
private Integer state = Base.TRUE;
......@@ -67,4 +71,12 @@ public class GoodsRule implements Serializable {
public void setState(Integer state) {
this.state = state;
}
public Integer getIsRecommend() {
return isRecommend;
}
public void setIsRecommend(Integer isRecommend) {
this.isRecommend = isRecommend;
}
}
package com.ihaoin.hooloo.device.data.vo;
import java.io.Serializable;
import java.util.Map;
public class Images implements Serializable {
private String left;
private Map<String, String> right;
public String getLeft() {
return left;
}
public void setLeft(String left) {
this.left = left;
}
public Map<String, String> getRight() {
return right;
}
public void setRight(Map<String, String> right) {
this.right = right;
}
}
......@@ -6,7 +6,7 @@ public class Recommend implements Serializable {
/**
* 推荐标题
*/
private String title;
private String goodsName;
/**
* 推荐介绍
......@@ -16,26 +16,19 @@ public class Recommend implements Serializable {
/**
* 推荐背景图
*/
private String background;
private String pic;
/**
* 商品信息
*/
private Goods goods;
public Recommend(String title, String desc, String background, Goods goods) {
this.setTitle(title);
this.setDesc(desc);
this.setBackground(background);
this.setGoods(goods);
public String getGoodsName() {
return goodsName;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
public void setGoodsName(String goodsName) {
this.goodsName = goodsName;
}
public String getDesc() {
......@@ -46,12 +39,12 @@ public class Recommend implements Serializable {
this.desc = desc;
}
public String getBackground() {
return background;
public String getPic() {
return pic;
}
public void setBackground(String background) {
this.background = background;
public void setPic(String pic) {
this.pic = pic;
}
public Goods getGoods() {
......
package com.ihaoin.hooloo.device.data.vo;
import java.io.Serializable;
public class ResultVo<T> implements Serializable {
private Integer code;
private String msg;
private T data;
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public T getData() {
return data;
}
public void setData(T data) {
this.data = data;
}
}
package com.ihaoin.hooloo.device.data.vo;
import java.io.Serializable;
public class RightImage implements Serializable {
/**
* 状态
*/
private Integer state;
/**
* 网址
*/
private String url;
public Integer getState() {
return state;
}
public void setState(Integer state) {
this.state = state;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public RightImage(Integer state, String url) {
this.state = state;
this.url = url;
}
}
package com.ihaoin.hooloo.device.data.vo;
import com.alibaba.fastjson.annotation.JSONField;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
......@@ -15,6 +17,7 @@ public class Sku implements Serializable {
/** 原价 */
private BigDecimal price;
/** 折扣价 */
@JSONField(name = "disCount")
private BigDecimal discount;
/** SKU规格 */
private List<SkuRule> rules;
......
package com.ihaoin.hooloo.device.network;
public class BizException extends RuntimeException {
public BizException(String msg) {
super(msg);
}
}
\ No newline at end of file
package com.ihaoin.hooloo.device.network;
public class BaseParams {
public class HttpParams {
private static final String HOST = "http://114.115.234.81:8080";
/** 首页获取数据 */
public static final String GET_MAIN_DATA = HOST + "/application/getOrderTaking?machineCode=%s";
/** 获取订单信息 */
public static final String GET_ORDERS = HOST + "/application/getOrderInfo?machineCode=%s";
/** 校验SKU状态 */
public static final String CHECK_SKU = HOST + "/application/checkSku?machineCode=%s&skuId=%s";
/** 保存购物车数据 */
public static final String POST_CONFIRM_ORDER = HOST + "/application/saveData?machineCode=%s";
/** 保存推送ID */
public static final String POST_REGISTRATION_ID = HOST + "/application/jgRegister?machineCode=%s&registerId=%s";
public static final String GET_CHECK_SKU = HOST + "/application/checkSku?machineCode=%s&skuId=%s";
}
......@@ -4,6 +4,10 @@ import android.os.Handler;
import android.os.Message;
import android.util.Log;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.ihaoin.hooloo.device.config.AppConfig;
import java.io.IOException;
import java.net.NetworkInterface;
import java.util.Collections;
......@@ -21,70 +25,104 @@ public class HttpUtil {
private static final String TAG = "Network";
public static void post(String url, String body, Handler handler) {
if (body == null) {
body = "";
}
OkHttpClient client = new OkHttpClient();
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), body);
Request request = new Request.Builder().url(url).post(requestBody).build();
client.newCall(request).enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
HttpUtil.onFailure(handler, e);
HttpUtil.onFailure(handler, call, e);
}
@Override
public void onResponse(Call call, Response response) {
HttpUtil.onResponse(handler, call, response);
}
});
}
public static void get(String url, Handler handler) {
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder().url(url).get().build();
client.newCall(request).enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
HttpUtil.onFailure(handler, call, e);
}
@Override
public void onResponse(Call call, Response response) throws IOException {
HttpUtil.onResponse(handler, response);
public void onResponse(Call call, Response response) {
HttpUtil.onResponse(handler, call, response);
}
});
}
private static void onFailure(Handler handler, Exception e) {
private static void onFailure(Handler handler, Call call, Exception e) {
if (AppConfig.DEBUG) {
String msgText = String.format("返回状态:%s, 请求:%s, 返回内容:%s", 0, call.request().url(), e.getMessage());
Log.e(TAG, msgText);
}
if (handler == null) {
String msgText = String.format("返回状态:%s, 返回内容:%s", 0, e.getMessage());
Log.d(TAG, msgText);
return;
}
try {
Thread.sleep(3000);
} catch (InterruptedException e3) {
} catch (Exception e3) {
e3.printStackTrace();
}
Message msg = handler.obtainMessage(0, e);
handler.sendMessage(msg);
}
private static void onResponse(Handler handler, Response response) throws IOException {
if (handler == null) {
String msgText = String.format("返回状态:%s, 返回内容:%s", 1, response.body() == null ? "" : response.body().string());
Log.d(TAG, msgText);
return;
}
private static void onResponse(Handler handler, Call call, Response response) {
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
String responseBody = response.body().string();
if (AppConfig.DEBUG) {
String msgText = String.format("返回状态:%s, 请求:%s, 返回内容:%s", 1, call.request().url(), responseBody);
Log.i(TAG, msgText);
}
if (handler == null) {
return;
}
// Thread.sleep(3000);
JSONObject jsonObject = JSON.parseObject(responseBody);
if (jsonObject == null || jsonObject.getInteger("code") == null || jsonObject.getInteger("code") != 200) {
onFailure(handler, call, new BizException("返回状态错误"));
return;
}
Message msg = handler.obtainMessage(1, jsonObject.get("data") == null ? "" : jsonObject.get("data").toString());
handler.sendMessage(msg);
} catch (Exception e) {
onFailure(handler, call, e);
}
Message msg = handler.obtainMessage(1, response.body() == null ? "" : response.body().string());
handler.sendMessage(msg);
}
public static void getMainDatas(String body, Handler handler) {
post(BaseParams.GET_MAIN_DATA, body, handler);
public static void getMainDatas(Handler handler) {
String url = String.format(HttpParams.GET_MAIN_DATA, AppConfig.MACHINE_CODE);
get(url, handler);
}
public static void getOrders(String body, Handler handler) {
post(BaseParams.GET_ORDERS, body, handler);
public static void getOrders(Handler handler) {
String url = String.format(HttpParams.GET_ORDERS, AppConfig.MACHINE_CODE);
get(url, handler);
}
public static void postConfirmOrder(String body, Handler handler) {
post(BaseParams.POST_CONFIRM_ORDER, body, handler);
String url = String.format(HttpParams.POST_CONFIRM_ORDER, AppConfig.MACHINE_CODE);
post(url, body, handler);
}
public static void postRegistrationId(String body, Handler handler) {
post(BaseParams.POST_REGISTRATION_ID, body, handler);
public static void postRegistrationId(String registrationId, Handler handler) {
String url = String.format(HttpParams.POST_REGISTRATION_ID, AppConfig.MACHINE_CODE, registrationId);
get(url, handler);
}
public static void checkSku(String body, Handler handler) {
post(BaseParams.GET_CHECK_SKU, body, handler);
public static void checkSku(Integer skuId, Handler handler) {
String url = String.format(HttpParams.CHECK_SKU, AppConfig.MACHINE_CODE, skuId);
get(url, handler);
}
public static String getMacAddress() {
......
......@@ -4,6 +4,14 @@ import java.util.Collection;
import java.util.Map;
public class CollectionUtils {
public static <T> T lastItem(Collection<T> collection) {
if (isEmpty(collection)) {
return null;
}
return (T) collection.toArray()[collection.size() - 1];
}
public static Boolean isEmpty(Object[] collection) {
if (collection == null || collection.length == 0) {
return true;
......
......@@ -7,4 +7,14 @@ public class StringUtils {
}
return false;
}
public static int indexOf(Object[] items, Object obj) {
for (int i = 0; i < items.length; i++) {
Object item = items[i];
if (item.equals(obj)) {
return i;
}
}
return 0;
}
}
......@@ -73,12 +73,13 @@ public class Utils {
public static void openSystemSettings(Context context) {
Intent intent = new Intent(android.provider.Settings.ACTION_SETTINGS);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent); // 打开系统设置界面
}
public static void openAppSettings(Context context) {
Intent intent = new Intent(context, SettingsActivity.class);
context.startActivity(intent); // 打开系统设置界面
context.startActivity(intent);
}
/**
......@@ -124,7 +125,7 @@ public class Utils {
return null;
}
ConfirmGoods g = new ConfirmGoods();
g.setGoodsId(goods.getGoodId());
g.setGoodsId(goods.getGoodsId());
g.setSkuId(sku.getSkuId());
g.setCount(count);
return Arrays.asList(g);
......
......@@ -3,29 +3,30 @@ package com.ihaoin.hooloo.device.view;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import com.alibaba.fastjson2.JSON;
import com.aliyun.alink.dm.api.DeviceInfo;
import com.aliyun.alink.linkkit.api.ILinkKitConnectListener;
import com.aliyun.alink.linkkit.api.IoTMqttClientConfig;
import com.aliyun.alink.linkkit.api.LinkKit;
import com.aliyun.alink.linkkit.api.LinkKitInitParams;
import com.aliyun.alink.linksdk.channel.core.persistent.mqtt.MqttConfigure;
import com.aliyun.alink.linksdk.tmp.device.payload.ValueWrapper;
import com.aliyun.alink.linksdk.tools.AError;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
import com.google.zxing.MultiFormatWriter;
import com.google.zxing.WriterException;
import com.google.zxing.common.BitMatrix;
import com.ihaoin.hooloo.device.R;
import com.ihaoin.hooloo.device.component.NetworkHandler;
import com.ihaoin.hooloo.device.component.PushMessageReceiver;
import com.ihaoin.hooloo.device.config.AppConfig;
import com.ihaoin.hooloo.device.config.Base;
import com.ihaoin.hooloo.device.data.TrolleyGoods;
import com.ihaoin.hooloo.device.data.po.ConfirmGoods;
import com.ihaoin.hooloo.device.data.po.ConfirmOrder;
......@@ -54,6 +55,7 @@ public class ConfirmOrderDialog extends Dialog {
private View layoutContent;
private View layoutConfirm;
private View layoutSucceed;
private ImageView imgQRCode;
private TextView txtExpire;
private TextView txtReturn;
private View butnClose;
......@@ -76,81 +78,39 @@ public class ConfirmOrderDialog extends Dialog {
super.onCreate(savedInstanceState);
this.setContentView(R.layout.view_confirm_order);
initViews();
}
private void initViews() {
setCancelable(false);
setCanceledOnTouchOutside(false);
layoutContent = findViewById(R.id.layout_content);
layoutConfirm = findViewById(R.id.layout_confirm);
layoutSucceed = findViewById(R.id.layout_succeed);
imgQRCode = findViewById(R.id.img_qrcode);
txtExpire = findViewById(R.id.txt_expire);
txtReturn = findViewById(R.id.txt_return);
butnClose = findViewById(R.id.butn_close);
loading = findViewById(R.id.loading);
layoutConfirm.setVisibility(View.VISIBLE);
layoutSucceed.setVisibility(View.GONE);
butnClose.setOnClickListener(x -> dismiss());
uiHandler = new UIHandler();
setOnDismissListener(dismissListener);
showConfirmViews();
setCancelable(false);
setCanceledOnTouchOutside(false);
setOnDismissListener(dismissListener);
postConfirmOrder();
connectMQTT();
}
private void connectMQTT() {
/**
* 设置设备认证信息
*/
String clientId = AppConfig.MACHINE_CODE;
String productKey = "";
String deviceName = "";
String deviceSecret = "";
String deviceToken = "";
DeviceInfo deviceInfo = new DeviceInfo();
deviceInfo.productKey = productKey;// 产品类型
deviceInfo.deviceName = deviceName;// 设备名称
deviceInfo.deviceSecret = deviceSecret;// 设备密钥
// 如果使用deviceToken和clientID连接物联网平台,那么设备的deviceSecret需要设置为null
// 一型一密免白名单动态注册之后建联需要设置deviceToken、clientId这两个值,这两个值由deviceDynamicRegister接口返回
MqttConfigure.deviceToken = deviceToken;
MqttConfigure.clientId = clientId;
/**
* 设置设备当前的初始状态值,属性需要和物联网平台创建的物模型属性一致
* 若此处为空,物模型属性的初始值则为空。
* 调用物模型上报接口之后,物模型会有相关数据缓存。
*/
Map<String, ValueWrapper> propertyValues = new HashMap<>();
// 示例
// propertyValues.put("LightSwitch", new ValueWrapper.BooleanValueWrapper(0));
IoTMqttClientConfig clientConfig = new IoTMqttClientConfig(productKey, deviceName, deviceSecret);
LinkKitInitParams params = new LinkKitInitParams();
params.deviceInfo = deviceInfo;
params.propertyValues = propertyValues;
params.mqttClientConfig = clientConfig;
/**
* 设备初始化建联
* onError 初始化建联失败,需要用户重试初始化。如因网络问题导致初始化失败。
* onInitDone 初始化成功
*/
LinkKit.getInstance().init(getContext(), params, new ILinkKitConnectListener() {
@Override
public void onError(AError error) {
// 初始化失败 error包含初始化错误信息
}
@Override
public void onInitDone(Object data) {
// 初始化成功 data 作为预留参数
}
});
private void showConfirmViews() {
layoutConfirm.setVisibility(View.VISIBLE);
layoutSucceed.setVisibility(View.GONE);
}
private void showSucceedViews() {
layoutConfirm.setVisibility(View.GONE);
layoutSucceed.setVisibility(View.VISIBLE);
}
private void postConfirmOrder() {
......@@ -218,55 +178,54 @@ public class ConfirmOrderDialog extends Dialog {
confirmOrderHandler.removeCallbacksAndMessages(null);
confirmOrderHandler = null;
}
unregsitQRCodeVisitedListener();
}
};
/** 等待扫码倒计时 */
private void startExpireThread() {
expireThread = new Thread() {
@Override
public void run() {
try {
for (int i = EXPIRE_TIMES; i >= 0; i--) {
if (uiHandler == null) {
return;
}
Message msg = new Message();
msg.what = 0;// 二维码失效倒计时
msg.obj = i;
uiHandler.sendMessage(msg);
Thread.sleep(1000);
regsitQRCodeVisitedListener();
expireThread = new Thread(() -> {
try {
for (int i = EXPIRE_TIMES; i >= 0; i--) {
if (uiHandler == null) {
return;
}
} catch (InterruptedException e) {
e.printStackTrace();
Message msg = new Message();
msg.what = 0;// 二维码失效倒计时
msg.obj = i;
uiHandler.sendMessage(msg);
Thread.sleep(1000);
}
} catch (InterruptedException e) {
e.printStackTrace();
}
};
});
expireThread.start();
}
/** 扫码成功倒计时 */
private void startReturnThread() {
returnThread = new Thread() {
@Override
public void run() {
try {
for (int i = RETURN_TIMES; i >= 0; i--) {
if (uiHandler == null) {
return;
}
Message msg = new Message();
msg.what = 1;// 扫码成功倒计时
msg.obj = i;
uiHandler.sendMessage(msg);
Thread.sleep(1000);
returnThread = new Thread(() -> {
try {
for (int i = RETURN_TIMES; i >= 0; i--) {
if (uiHandler == null) {
return;
}
} catch (InterruptedException e) {
e.printStackTrace();
Message msg = new Message();
msg.what = 1;// 扫码成功倒计时
msg.obj = i;
uiHandler.sendMessage(msg);
Thread.sleep(1000);
}
} catch (InterruptedException e) {
e.printStackTrace();
}
};
});
returnThread.start();
}
/** 刷新UI */
class UIHandler extends Handler {
@Override
public void handleMessage(@NonNull Message msg) {
......@@ -289,6 +248,7 @@ public class ConfirmOrderDialog extends Dialog {
}
}
/** 服务器保存购物车信息回调 */
class ConfirmOrderHandler extends NetworkHandler {
public ConfirmOrderHandler(@NonNull Context context) {
super(context);
......@@ -296,16 +256,71 @@ public class ConfirmOrderDialog extends Dialog {
@Override
public void handleMessage(@NonNull Message msg) {
stopLoading();
if (msg.what == 0) {
try {
stopLoading();
Object obj = msg.obj;
if (msg.what == 0 || obj == null) {
Toast.makeText(getContext(), R.string.error_get_qrcode, Toast.LENGTH_LONG).show();
dismiss();
return;
}
String id = obj.toString();
Bitmap bitmap = genQRCode(id);
imgQRCode.setImageBitmap(bitmap);
startExpireThread();
} catch (Exception e) {
Toast.makeText(getContext(), R.string.error_get_qrcode, Toast.LENGTH_LONG).show();
dismiss();
return;
}
}
}
private Bitmap genQRCode(String saveCode) throws WriterException {
String url = String.format(AppConfig.WX_URL, saveCode);
int width = Utils.dpToPx(getContext(), 100); // 图像宽度
int height = Utils.dpToPx(getContext(), 100); // 图像高度
Map<EncodeHintType, Object> hints = new HashMap();
hints.put(EncodeHintType.CHARACTER_SET, "UTF-8");
BitMatrix bitMatrix = new MultiFormatWriter().encode(url, BarcodeFormat.QR_CODE, width, height, hints);// 生成矩阵
int[] pixels = new int[width * height];
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
if (bitMatrix.get(x, y)) {
pixels[y * width + x] = Color.BLACK; // 黑色色块像素设置
} else {
pixels[y * width + x] = Color.WHITE; // 白色色块像素设置
}
}
}
/** 4.创建Bitmap对象,根据像素数组设置Bitmap每个像素点的颜色值,之后返回Bitmap对象 */
Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
bitmap.setPixels(pixels, 0, width, 0, 0, width, height);
return bitmap;
}
private QRCodeVisitedHandler qrCodeVisitedHandler;
String s = (String) msg.obj;
Log.d("HTTP", s);
startExpireThread();
class QRCodeVisitedHandler extends Handler {
@Override
public void handleMessage(@NonNull Message msg) {
if (msg.what != 1) {
return;
}
expireThread.interrupt();
showSucceedViews();
startReturnThread();
unregsitQRCodeVisitedListener();
}
}
private void regsitQRCodeVisitedListener() {
qrCodeVisitedHandler = new QRCodeVisitedHandler();
PushMessageReceiver.subscribe(Base.NOTIFY_ACTION_QRCODE_VISITED, qrCodeVisitedHandler);
}
private void unregsitQRCodeVisitedListener() {
PushMessageReceiver.unsubscribe(Base.NOTIFY_ACTION_QRCODE_VISITED);
}
}
......@@ -16,9 +16,9 @@ import android.widget.Toast;
import androidx.annotation.NonNull;
import com.bumptech.glide.Glide;
import com.ihaoin.hooloo.device.HLApplication;
import com.ihaoin.hooloo.device.R;
import com.ihaoin.hooloo.device.config.Base;
import com.ihaoin.hooloo.device.data.Datas;
import com.ihaoin.hooloo.device.data.vo.Goods;
import com.ihaoin.hooloo.device.data.vo.GoodsRule;
import com.ihaoin.hooloo.device.data.vo.Sku;
......@@ -48,15 +48,15 @@ public class GoodsDetailDialog extends Dialog {
private Button butnAdd;
private Button butnBuy;
private Button butnTrolley;
private View layoutOperate;
private View layoutButns;
private View txtSellout;
private Integer count = 1;
public GoodsDetailDialog(@NonNull Context context, Goods goods) {
super(context);
this.goods = goods;
// 处理售罄的SKU和规格选项
processSpecRules();
}
@Override
......@@ -67,6 +67,9 @@ public class GoodsDetailDialog extends Dialog {
}
private void initViews() {
layoutButns = findViewById(R.id.layout_butns);
layoutOperate = findViewById(R.id.layout_operate);
txtSellout = findViewById(R.id.txt_sellout);
butnClose = findViewById(R.id.butn_close);
imgIntro = findViewById(R.id.img_intro);
txtName = findViewById(R.id.txt_name);
......@@ -82,7 +85,11 @@ public class GoodsDetailDialog extends Dialog {
butnClose.setOnClickListener(x -> dismiss());
Glide.with(getContext()).load(goods.getPics().getIntroImages().get(0)).into(imgIntro);
if (goods.getPics() == null) {
imgIntro.setImageDrawable(null);
} else {
Glide.with(getContext()).load(goods.getPics().getIntroImages().get(0)).into(imgIntro);
}
txtName.setText(goods.getName());
butnSubtract.setOnClickListener(v -> subtractGoods());
......@@ -94,6 +101,9 @@ public class GoodsDetailDialog extends Dialog {
ViewGroup layoutItem = findViewById(R.id.layout_item);
Utils.setTouchDelegate(layoutItem, Arrays.asList(butnAdd, butnSubtract), 15);
// 处理售罄的SKU和规格选项
processSpecRules();
buildSpecs();
buildDetails();
}
......@@ -117,8 +127,8 @@ public class GoodsDetailDialog extends Dialog {
}
private void addGoods() {
if (count >= Datas.COUNT_OF_ORDER) {
Toast.makeText(this.getContext(), getContext().getString(R.string.count_limit, Datas.COUNT_OF_ORDER.toString()), Toast.LENGTH_SHORT).show();
if (count >= HLApplication.getMainData().getCountOfOrder()) {
Toast.makeText(this.getContext(), getContext().getString(R.string.count_limit, HLApplication.getMainData().getCountOfOrder().toString()), Toast.LENGTH_SHORT).show();
return;
}
count++;
......@@ -222,7 +232,8 @@ public class GoodsDetailDialog extends Dialog {
}
private void processSpecRules() {
if (goods == null || CollectionUtils.isEmpty(goods.getSpecs())) {
if (goods == null || CollectionUtils.isEmpty(goods.getSpecs()) || CollectionUtils.isEmpty(goods.getSkus())) {
showSelloutViews();
return;
}
// 将售罄和未售罄的SKU分组
......@@ -233,6 +244,10 @@ public class GoodsDetailDialog extends Dialog {
// 售罄SKU列表
List<Sku> sellOuts = map.get(Base.FALSE);
List<Sku> sellIns = map.get(Base.TRUE);
if (CollectionUtils.isEmpty(sellIns)) {
showSelloutViews();
return;
}
if (CollectionUtils.isEmpty(sellOuts)) {
return;
}
......@@ -248,6 +263,12 @@ public class GoodsDetailDialog extends Dialog {
});
}
private void showSelloutViews() {
layoutOperate.setVisibility(View.GONE);
layoutButns.setVisibility(View.GONE);
txtSellout.setVisibility(View.VISIBLE);
}
private void setRuleState(SkuRule skuRule, Integer ruleState) {
if (goods == null || CollectionUtils.isEmpty(goods.getSpecs())) {
return;
......
......@@ -10,6 +10,8 @@ import android.graphics.Rect;
import android.hardware.display.DisplayManager;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.Display;
import android.view.View;
......@@ -17,6 +19,7 @@ import android.view.WindowManager;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.GridLayoutManager;
......@@ -24,24 +27,21 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.fastjson2.JSON;
import com.ihaoin.hooloo.device.HLApplication;
import com.ihaoin.hooloo.device.R;
import com.ihaoin.hooloo.device.adapter.GoodsAdapter;
import com.ihaoin.hooloo.device.adapter.RecommendAdapter;
import com.ihaoin.hooloo.device.config.Base;
import com.ihaoin.hooloo.device.data.Datas;
import com.ihaoin.hooloo.device.data.MainData;
import com.ihaoin.hooloo.device.data.ScrollBean;
import com.ihaoin.hooloo.device.data.enums.ImageState;
import com.ihaoin.hooloo.device.data.vo.Category;
import com.ihaoin.hooloo.device.data.vo.Goods;
import com.ihaoin.hooloo.device.data.vo.Pics;
import com.ihaoin.hooloo.device.data.vo.Recommend;
import com.ihaoin.hooloo.device.data.vo.RightImage;
import com.ihaoin.hooloo.device.data.vo.Sku;
import com.ihaoin.hooloo.device.network.HttpUtil;
import com.ihaoin.hooloo.device.util.CollectionUtils;
import com.ihaoin.hooloo.device.util.Utils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class LauncherActivity extends Activity {
......@@ -51,9 +51,7 @@ public class LauncherActivity extends Activity {
private RecyclerView recRecommends;
// private TextView rightTitle;
private List<Recommend> recommends;
private List<ScrollBean> scrollRecommends;
private List<Category> categorys;
private List<ScrollBean> scrollGoods;
private GridLayoutManager recommendManager;
......@@ -67,6 +65,7 @@ public class LauncherActivity extends Activity {
private int first = 0;
private Context mContext;
private TrolleyView trolleyView;
private MenuPresentation menu;
@Override
protected void onCreate(Bundle savedInstanceState) {
......@@ -75,38 +74,26 @@ public class LauncherActivity extends Activity {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
mContext = this;
requestPermissions();
trolleyView = findViewById(R.id.view_trolley);
groupCategory = findViewById(R.id.group_category);
recGoods = findViewById(R.id.rec_right);
recRecommends = findViewById(R.id.rec_recommend);
initData();
initRecommends();
setRecommendsData();
initCategorys();
initGoods();
registerdTrolleyReceiver();
initGoods();
setGoodsData();
registTrolleyReceiver();
showMenuView();
requestPermissions();
}
private void requestPermissions() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
requestPermissions(new String[]{Manifest.permission.READ_PHONE_STATE, Manifest.permission.WRITE_EXTERNAL_STORAGE}, 100);
}
}
private void showMenuView() {
DisplayManager displayManager = (DisplayManager) getSystemService(Context.DISPLAY_SERVICE);
Display[] displays = displayManager.getDisplays();
if (CollectionUtils.isEmpty(displays) || displays.length < 2) {
return;
}
MenuPresentation menu = new MenuPresentation(this, displays[1]);
menu.show();
startLoadDataThread();
}
private void initRecommends() {
......@@ -128,11 +115,16 @@ public class LauncherActivity extends Activity {
recommendAdapter.notifyDataSetChanged();
}
}
private void setRecommendsData() {
if (CollectionUtils.isEmpty(HLApplication.getMainData().getRecommends())) {
return;
}
scrollRecommends = new ArrayList<>();
ScrollBean header = new ScrollBean(true, null);
scrollRecommends.add(header);
recommends.forEach(x -> scrollRecommends.add(new ScrollBean(new ScrollBean.ScrollItemBean(x, null))));
HLApplication.getMainData().getRecommends().forEach(x -> scrollRecommends.add(new ScrollBean(new ScrollBean.ScrollItemBean(x, null))));
recommendAdapter.setNewData(scrollRecommends);
}
......@@ -179,7 +171,7 @@ public class LauncherActivity extends Activity {
}
// 遍历分类列表,设置选中分类
for (Category category : categorys) {
for (Category category : HLApplication.getMainData().getCategorys()) {
if (category.getName().equals(title)) {
if (groupCategory.getCheckedRadioButtonId() == category.getId()) {
break;
......@@ -187,17 +179,32 @@ public class LauncherActivity extends Activity {
groupCategory.check(category.getId());
}
}
if (isSlideToBottom(recGoods)) {
// 滚动到最下,选中最后一个分类
groupCategory.check(CollectionUtils.lastItem(HLApplication.getMainData().getCategorys()).getId());
}
}
});
}
/** 判断RecyclerView是否滚动到最下面 */
private boolean isSlideToBottom(RecyclerView recyclerView) {
if (recyclerView == null) {
return false;
}
if (recyclerView.computeVerticalScrollExtent() + recyclerView.computeVerticalScrollOffset() >= recyclerView.computeVerticalScrollRange()) {
return true;
}
return false;
}
private void initCategorys() {
groupCategory.removeAllViews();
if (categorys == null || categorys.isEmpty()) {
if (CollectionUtils.isEmpty(HLApplication.getMainData().getCategorys())) {
return;
}
categorys.forEach(category -> {
HLApplication.getMainData().getCategorys().forEach(category -> {
RadioGroup.LayoutParams layoutParams = new RadioGroup.LayoutParams(RadioGroup.LayoutParams.MATCH_PARENT, RadioGroup.LayoutParams.WRAP_CONTENT);
RadioButton view = (RadioButton) this.getLayoutInflater().inflate(R.layout.item_category, null);
view.setText(category.getName());
......@@ -208,23 +215,24 @@ public class LauncherActivity extends Activity {
view.setOnClickListener(v -> {
Integer checkedId = v.getId();
Category category1 = (Category) groupCategory.findViewById(checkedId).getTag();
int position = categorys.indexOf(category1);
int position = HLApplication.getMainData().getCategorys().indexOf(category1);
goodsLayoutManager.scrollToPositionWithOffset(tPosition.get(position), 0);
for (int i = 0; i < groupCategory.getChildCount(); i++) {
View child = groupCategory.getChildAt(i);
if (!(child instanceof RadioButton)) {
continue;
}
RadioButton butn = (RadioButton) child;
if (butn.getId() == checkedId) {
butn.getPaint().setFakeBoldText(true);
} else {
butn.getPaint().setFakeBoldText(false);
}
}
});
});
groupCategory.setOnCheckedChangeListener((group, checkedId) -> {
for (int i = 0; i < groupCategory.getChildCount(); i++) {
View child = groupCategory.getChildAt(i);
if (!(child instanceof RadioButton)) {
continue;
}
RadioButton butn = (RadioButton) child;
if (butn.getId() == checkedId) {
butn.getPaint().setFakeBoldText(true);
} else {
butn.getPaint().setFakeBoldText(false);
}
}
});
// 添加温馨提示
RadioGroup.LayoutParams layoutParams = new RadioGroup.LayoutParams(RadioGroup.LayoutParams.MATCH_PARENT, RadioGroup.LayoutParams.WRAP_CONTENT);
......@@ -232,73 +240,17 @@ public class LauncherActivity extends Activity {
groupCategory.addView(view, layoutParams);
view.setOnClickListener(v -> Utils.showTips(LauncherActivity.this));
groupCategory.check(categorys.get(0).getId());
groupCategory.check(HLApplication.getMainData().getCategorys().get(0).getId());
}
//获取数据(若请求服务端数据,请求到的列表需有序排列)
private void initData() {
Pics p1 = new Pics();
Pics p2 = new Pics();
Pics p3 = new Pics();
p1.setThumbnail("https://img1.baidu.com/it/u=3426268058,1014861135&fm=253&fmt=auto&app=138&f=JPEG?w=190&h=118");
p2.setThumbnail("https://ss2.baidu.com/-vo3dSag_xI4khGko9WTAnF6hhy/baike/s%3D220/sign=6e742a00ff03918fd3d13ac8613c264b/d439b6003af33a87e4037dface5c10385243b5e7.jpg");
p3.setThumbnail("https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.jj20.com%2Fup%2Fallimg%2Ftx18%2F0217202021933.jpg&refer=http%3A%2F%2Fimg.jj20.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1653792863&t=ec8778ab3ff1891dbd8e715956097181");
Goods g1 = JSON.parseObject("{\"goodId\":100,\"name\":\"冰茶咖啡\",\"desc\":\"好喝的咖啡好喝的咖啡好喝的咖啡好喝的咖啡好喝的咖啡好喝的咖啡\",\"price\":10.9,\"discount\":9.9,\"pics\":{\"thumbnail\":\"https://img1.baidu.com/it/u=3426268058,1014861135&fm=253&fmt=auto&app=138&f=JPEG?w=190&h=118\",\"introImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F2ff161bap00qzik7b00aad000t700inp.png&thumbnail=660x2147483647&quality=80&type=jpg\"],\"detailImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F5527f996p00qzikdu00avd000th00inp.png&thumbnail=660x2147483647&quality=80&type=jpg\",\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2Fbe0a3f04p00qziken00cvd000te00ikp.png&thumbnail=660x2147483647&quality=80&type=jpg\"]},\"remark\":\"\",\"tags\":[\"YYDS\",\"杨幂同款\"],\"specs\":[{\"specId\":10,\"specName\":\"温度\",\"rules\":[{\"isDefault\":1,\"ruleId\":101,\"ruleName\":\"常温\",\"price\":0},{\"ruleId\":102,\"ruleName\":\"加热\",\"price\":3}]},{\"specId\":11,\"specName\":\"糖度\",\"rules\":[{\"ruleId\":114,\"ruleName\":\"无糖\",\"price\":0},{\"isDefault\":1,\"ruleId\":115,\"ruleName\":\"少糖\",\"price\":1},{\"ruleId\":116,\"ruleName\":\"多糖\",\"price\":2}]}],\"skus\":[{\"isDefault\":0,\"skuId\":1,\"state\":1,\"price\":10.9,\"discount\":9.9,\"rules\":[{\"specId\":10,\"specName\":\"温度\",\"ruleId\":101,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":11,\"specName\":\"糖度\",\"ruleId\":114,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":2,\"state\":1,\"price\":12.9,\"discount\":11.9,\"isDefault\":1,\"rules\":[{\"specId\":10,\"specName\":\"温度\",\"ruleId\":101,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":11,\"specName\":\"糖度\",\"ruleId\":115,\"ruleName\":\"少糖\",\"price\":2.00}]},{\"skuId\":3,\"state\":0,\"price\":14.9,\"discount\":13.9,\"isDefault\":0,\"rules\":[{\"specId\":10,\"specName\":\"温度\",\"ruleId\":101,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":11,\"specName\":\"糖度\",\"ruleId\":116,\"ruleName\":\"多糖\",\"price\":4.00}]},{\"isDefault\":0,\"skuId\":4,\"state\":1,\"price\":13.9,\"discount\":12.9,\"rules\":[{\"specId\":10,\"specName\":\"温度\",\"ruleId\":102,\"ruleName\":\"加热\",\"price\":3.00},{\"specId\":11,\"specName\":\"糖度\",\"ruleId\":114,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":5,\"state\":1,\"price\":15.9,\"discount\":14.9,\"isDefault\":0,\"rules\":[{\"specId\":10,\"specName\":\"温度\",\"ruleId\":102,\"ruleName\":\"加热\",\"price\":3.00},{\"specId\":11,\"specName\":\"糖度\",\"ruleId\":115,\"ruleName\":\"少糖\",\"price\":2.00}]},{\"skuId\":6,\"state\":0,\"price\":17.9,\"discount\":16.9,\"isDefault\":0,\"rules\":[{\"specId\":10,\"specName\":\"温度\",\"ruleId\":102,\"ruleName\":\"加热\",\"price\":3.00},{\"specId\":11,\"specName\":\"糖度\",\"ruleId\":116,\"ruleName\":\"多糖\",\"price\":4.00}]}]}", Goods.class);
Goods g2 = JSON.parseObject("{\"goodId\":100,\"name\":\"冰茶咖啡\",\"price\":29.9,\"discount\":19.9,\"pics\":{\"thumbnail\":\"https://img1.baidu.com/it/u=3426268058,1014861135&fm=253&fmt=auto&app=138&f=JPEG?w=190&h=118\",\"introImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F2ff161bap00qzik7b00aad000t700inp.png&thumbnail=660x2147483647&quality=80&type=jpg\"],\"detailImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F5527f996p00qzikdu00avd000th00inp.png&thumbnail=660x2147483647&quality=80&type=jpg\",\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2Fbe0a3f04p00qziken00cvd000te00ikp.png&thumbnail=660x2147483647&quality=80&type=jpg\"]},\"desc\":\"\",\"remark\":\"\",\"tags\":[\"YYDS\",\"杨幂同款\"],\"specs\":[{\"specId\":1,\"specName\":\"温度\",\"rules\":[{\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0},{\"ruleId\":2,\"ruleName\":\"加冰\",\"price\":2},{\"ruleId\":3,\"ruleName\":\"加热\",\"price\":3}]},{\"specId\":2,\"specName\":\"糖度\",\"rules\":[{\"ruleId\":4,\"ruleName\":\"无糖\",\"price\":0},{\"ruleId\":5,\"ruleName\":\"少糖\",\"price\":1},{\"ruleId\":6,\"ruleName\":\"多糖\",\"price\":2}]}],\"skus\":[{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":2,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":2.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":4.00}]}]}", Goods.class);
Goods g3 = JSON.parseObject("{\"goodId\":100,\"name\":\"冰茶咖啡\",\"price\":29.9,\"discount\":19.9,\"pics\":{\"thumbnail\":\"https://img1.baidu.com/it/u=3426268058,1014861135&fm=253&fmt=auto&app=138&f=JPEG?w=190&h=118\",\"introImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F2ff161bap00qzik7b00aad000t700inp.png&thumbnail=660x2147483647&quality=80&type=jpg\"],\"detailImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F5527f996p00qzikdu00avd000th00inp.png&thumbnail=660x2147483647&quality=80&type=jpg\",\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2Fbe0a3f04p00qziken00cvd000te00ikp.png&thumbnail=660x2147483647&quality=80&type=jpg\"]},\"desc\":\"\",\"remark\":\"\",\"tags\":[\"YYDS\",\"杨幂同款\"],\"specs\":[{\"specId\":1,\"specName\":\"温度\",\"rules\":[{\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0},{\"ruleId\":2,\"ruleName\":\"加冰\",\"price\":2},{\"ruleId\":3,\"ruleName\":\"加热\",\"price\":3}]},{\"specId\":2,\"specName\":\"糖度\",\"rules\":[{\"ruleId\":4,\"ruleName\":\"无糖\",\"price\":0},{\"ruleId\":5,\"ruleName\":\"少糖\",\"price\":1},{\"ruleId\":6,\"ruleName\":\"多糖\",\"price\":2}]}],\"skus\":[{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":2,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":2.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":4.00}]}]}", Goods.class);
Goods g4 = JSON.parseObject("{\"goodId\":100,\"name\":\"冰茶咖啡\",\"price\":29.9,\"discount\":19.9,\"pics\":{\"thumbnail\":\"https://img1.baidu.com/it/u=3426268058,1014861135&fm=253&fmt=auto&app=138&f=JPEG?w=190&h=118\",\"introImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F2ff161bap00qzik7b00aad000t700inp.png&thumbnail=660x2147483647&quality=80&type=jpg\"],\"detailImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F5527f996p00qzikdu00avd000th00inp.png&thumbnail=660x2147483647&quality=80&type=jpg\",\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2Fbe0a3f04p00qziken00cvd000te00ikp.png&thumbnail=660x2147483647&quality=80&type=jpg\"]},\"desc\":\"\",\"remark\":\"\",\"tags\":[\"YYDS\",\"杨幂同款\"],\"specs\":[{\"specId\":1,\"specName\":\"温度\",\"rules\":[{\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0},{\"ruleId\":2,\"ruleName\":\"加冰\",\"price\":2},{\"ruleId\":3,\"ruleName\":\"加热\",\"price\":3}]},{\"specId\":2,\"specName\":\"糖度\",\"rules\":[{\"ruleId\":4,\"ruleName\":\"无糖\",\"price\":0},{\"ruleId\":5,\"ruleName\":\"少糖\",\"price\":1},{\"ruleId\":6,\"ruleName\":\"多糖\",\"price\":2}]}],\"skus\":[{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":2,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":2.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":4.00}]}]}", Goods.class);
Goods g5 = JSON.parseObject("{\"goodId\":100,\"name\":\"冰茶咖啡\",\"price\":29.9,\"discount\":19.9,\"pics\":{\"thumbnail\":\"https://img1.baidu.com/it/u=3426268058,1014861135&fm=253&fmt=auto&app=138&f=JPEG?w=190&h=118\",\"introImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F2ff161bap00qzik7b00aad000t700inp.png&thumbnail=660x2147483647&quality=80&type=jpg\"],\"detailImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F5527f996p00qzikdu00avd000th00inp.png&thumbnail=660x2147483647&quality=80&type=jpg\",\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2Fbe0a3f04p00qziken00cvd000te00ikp.png&thumbnail=660x2147483647&quality=80&type=jpg\"]},\"desc\":\"\",\"remark\":\"\",\"tags\":[\"YYDS\",\"杨幂同款\"],\"specs\":[{\"specId\":1,\"specName\":\"温度\",\"rules\":[{\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0},{\"ruleId\":2,\"ruleName\":\"加冰\",\"price\":2},{\"ruleId\":3,\"ruleName\":\"加热\",\"price\":3}]},{\"specId\":2,\"specName\":\"糖度\",\"rules\":[{\"ruleId\":4,\"ruleName\":\"无糖\",\"price\":0},{\"ruleId\":5,\"ruleName\":\"少糖\",\"price\":1},{\"ruleId\":6,\"ruleName\":\"多糖\",\"price\":2}]}],\"skus\":[{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":2,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":2.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":4.00}]}]}", Goods.class);
Goods g6 = JSON.parseObject("{\"goodId\":100,\"name\":\"冰茶咖啡\",\"price\":29.9,\"discount\":19.9,\"pics\":{\"thumbnail\":\"https://img1.baidu.com/it/u=3426268058,1014861135&fm=253&fmt=auto&app=138&f=JPEG?w=190&h=118\",\"introImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F2ff161bap00qzik7b00aad000t700inp.png&thumbnail=660x2147483647&quality=80&type=jpg\"],\"detailImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F5527f996p00qzikdu00avd000th00inp.png&thumbnail=660x2147483647&quality=80&type=jpg\",\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2Fbe0a3f04p00qziken00cvd000te00ikp.png&thumbnail=660x2147483647&quality=80&type=jpg\"]},\"desc\":\"\",\"remark\":\"\",\"tags\":[\"YYDS\",\"杨幂同款\"],\"specs\":[{\"specId\":1,\"specName\":\"温度\",\"rules\":[{\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0},{\"ruleId\":2,\"ruleName\":\"加冰\",\"price\":2},{\"ruleId\":3,\"ruleName\":\"加热\",\"price\":3}]},{\"specId\":2,\"specName\":\"糖度\",\"rules\":[{\"ruleId\":4,\"ruleName\":\"无糖\",\"price\":0},{\"ruleId\":5,\"ruleName\":\"少糖\",\"price\":1},{\"ruleId\":6,\"ruleName\":\"多糖\",\"price\":2}]}],\"skus\":[{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":2,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":2.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":4.00}]}]}", Goods.class);
Goods g7 = JSON.parseObject("{\"goodId\":100,\"name\":\"冰茶咖啡\",\"price\":29.9,\"discount\":19.9,\"pics\":{\"thumbnail\":\"https://img1.baidu.com/it/u=3426268058,1014861135&fm=253&fmt=auto&app=138&f=JPEG?w=190&h=118\",\"introImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F2ff161bap00qzik7b00aad000t700inp.png&thumbnail=660x2147483647&quality=80&type=jpg\"],\"detailImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F5527f996p00qzikdu00avd000th00inp.png&thumbnail=660x2147483647&quality=80&type=jpg\",\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2Fbe0a3f04p00qziken00cvd000te00ikp.png&thumbnail=660x2147483647&quality=80&type=jpg\"]},\"desc\":\"\",\"remark\":\"\",\"tags\":[\"YYDS\",\"杨幂同款\"],\"specs\":[{\"specId\":1,\"specName\":\"温度\",\"rules\":[{\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0},{\"ruleId\":2,\"ruleName\":\"加冰\",\"price\":2},{\"ruleId\":3,\"ruleName\":\"加热\",\"price\":3}]},{\"specId\":2,\"specName\":\"糖度\",\"rules\":[{\"ruleId\":4,\"ruleName\":\"无糖\",\"price\":0},{\"ruleId\":5,\"ruleName\":\"少糖\",\"price\":1},{\"ruleId\":6,\"ruleName\":\"多糖\",\"price\":2}]}],\"skus\":[{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":2,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":2.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":4.00}]}]}", Goods.class);
Goods g8 = JSON.parseObject("{\"goodId\":100,\"name\":\"冰茶咖啡\",\"price\":29.9,\"discount\":19.9,\"pics\":{\"thumbnail\":\"https://img1.baidu.com/it/u=3426268058,1014861135&fm=253&fmt=auto&app=138&f=JPEG?w=190&h=118\",\"introImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F2ff161bap00qzik7b00aad000t700inp.png&thumbnail=660x2147483647&quality=80&type=jpg\"],\"detailImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F5527f996p00qzikdu00avd000th00inp.png&thumbnail=660x2147483647&quality=80&type=jpg\",\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2Fbe0a3f04p00qziken00cvd000te00ikp.png&thumbnail=660x2147483647&quality=80&type=jpg\"]},\"desc\":\"\",\"remark\":\"\",\"tags\":[\"YYDS\",\"杨幂同款\"],\"specs\":[{\"specId\":1,\"specName\":\"温度\",\"rules\":[{\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0},{\"ruleId\":2,\"ruleName\":\"加冰\",\"price\":2},{\"ruleId\":3,\"ruleName\":\"加热\",\"price\":3}]},{\"specId\":2,\"specName\":\"糖度\",\"rules\":[{\"ruleId\":4,\"ruleName\":\"无糖\",\"price\":0},{\"ruleId\":5,\"ruleName\":\"少糖\",\"price\":1},{\"ruleId\":6,\"ruleName\":\"多糖\",\"price\":2}]}],\"skus\":[{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":2,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":2.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":4.00}]}]}", Goods.class);
Goods g9 = JSON.parseObject("{\"goodId\":100,\"name\":\"冰茶咖啡\",\"price\":29.9,\"discount\":19.9,\"pics\":{\"thumbnail\":\"https://img1.baidu.com/it/u=3426268058,1014861135&fm=253&fmt=auto&app=138&f=JPEG?w=190&h=118\",\"introImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F2ff161bap00qzik7b00aad000t700inp.png&thumbnail=660x2147483647&quality=80&type=jpg\"],\"detailImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F5527f996p00qzikdu00avd000th00inp.png&thumbnail=660x2147483647&quality=80&type=jpg\",\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2Fbe0a3f04p00qziken00cvd000te00ikp.png&thumbnail=660x2147483647&quality=80&type=jpg\"]},\"desc\":\"\",\"remark\":\"\",\"tags\":[\"YYDS\",\"杨幂同款\"],\"specs\":[{\"specId\":1,\"specName\":\"温度\",\"rules\":[{\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0},{\"ruleId\":2,\"ruleName\":\"加冰\",\"price\":2},{\"ruleId\":3,\"ruleName\":\"加热\",\"price\":3}]},{\"specId\":2,\"specName\":\"糖度\",\"rules\":[{\"ruleId\":4,\"ruleName\":\"无糖\",\"price\":0},{\"ruleId\":5,\"ruleName\":\"少糖\",\"price\":1},{\"ruleId\":6,\"ruleName\":\"多糖\",\"price\":2}]}],\"skus\":[{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":2,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":2.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":4.00}]}]}", Goods.class);
Goods g10 = JSON.parseObject("{\"goodId\":100,\"name\":\"冰茶咖啡\",\"price\":29.9,\"discount\":19.9,\"pics\":{\"thumbnail\":\"https://img1.baidu.com/it/u=3426268058,1014861135&fm=253&fmt=auto&app=138&f=JPEG?w=190&h=118\",\"introImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F2ff161bap00qzik7b00aad000t700inp.png&thumbnail=660x2147483647&quality=80&type=jpg\"],\"detailImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F5527f996p00qzikdu00avd000th00inp.png&thumbnail=660x2147483647&quality=80&type=jpg\",\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2Fbe0a3f04p00qziken00cvd000te00ikp.png&thumbnail=660x2147483647&quality=80&type=jpg\"]},\"desc\":\"\",\"remark\":\"\",\"tags\":[\"YYDS\",\"杨幂同款\"],\"specs\":[{\"specId\":1,\"specName\":\"温度\",\"rules\":[{\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0},{\"ruleId\":2,\"ruleName\":\"加冰\",\"price\":2},{\"ruleId\":3,\"ruleName\":\"加热\",\"price\":3}]},{\"specId\":2,\"specName\":\"糖度\",\"rules\":[{\"ruleId\":4,\"ruleName\":\"无糖\",\"price\":0},{\"ruleId\":5,\"ruleName\":\"少糖\",\"price\":1},{\"ruleId\":6,\"ruleName\":\"多糖\",\"price\":2}]}],\"skus\":[{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":2,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":2.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":4.00}]}]}", Goods.class);
Goods g11 = JSON.parseObject("{\"goodId\":100,\"name\":\"冰茶咖啡\",\"price\":29.9,\"discount\":19.9,\"pics\":{\"thumbnail\":\"https://img1.baidu.com/it/u=3426268058,1014861135&fm=253&fmt=auto&app=138&f=JPEG?w=190&h=118\",\"introImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F2ff161bap00qzik7b00aad000t700inp.png&thumbnail=660x2147483647&quality=80&type=jpg\"],\"detailImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F5527f996p00qzikdu00avd000th00inp.png&thumbnail=660x2147483647&quality=80&type=jpg\",\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2Fbe0a3f04p00qziken00cvd000te00ikp.png&thumbnail=660x2147483647&quality=80&type=jpg\"]},\"desc\":\"\",\"remark\":\"\",\"tags\":[\"YYDS\",\"杨幂同款\"],\"specs\":[{\"specId\":1,\"specName\":\"温度\",\"rules\":[{\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0},{\"ruleId\":2,\"ruleName\":\"加冰\",\"price\":2},{\"ruleId\":3,\"ruleName\":\"加热\",\"price\":3}]},{\"specId\":2,\"specName\":\"糖度\",\"rules\":[{\"ruleId\":4,\"ruleName\":\"无糖\",\"price\":0},{\"ruleId\":5,\"ruleName\":\"少糖\",\"price\":1},{\"ruleId\":6,\"ruleName\":\"多糖\",\"price\":2}]}],\"skus\":[{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":2,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":2.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":4.00}]}]}", Goods.class);
Goods g12 = JSON.parseObject("{\"goodId\":100,\"name\":\"冰茶咖啡\",\"price\":29.9,\"discount\":19.9,\"pics\":{\"thumbnail\":\"https://img1.baidu.com/it/u=3426268058,1014861135&fm=253&fmt=auto&app=138&f=JPEG?w=190&h=118\",\"introImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F2ff161bap00qzik7b00aad000t700inp.png&thumbnail=660x2147483647&quality=80&type=jpg\"],\"detailImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F5527f996p00qzikdu00avd000th00inp.png&thumbnail=660x2147483647&quality=80&type=jpg\",\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2Fbe0a3f04p00qziken00cvd000te00ikp.png&thumbnail=660x2147483647&quality=80&type=jpg\"]},\"desc\":\"\",\"remark\":\"\",\"tags\":[\"YYDS\",\"杨幂同款\"],\"specs\":[{\"specId\":1,\"specName\":\"温度\",\"rules\":[{\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0},{\"ruleId\":2,\"ruleName\":\"加冰\",\"price\":2},{\"ruleId\":3,\"ruleName\":\"加热\",\"price\":3}]},{\"specId\":2,\"specName\":\"糖度\",\"rules\":[{\"ruleId\":4,\"ruleName\":\"无糖\",\"price\":0},{\"ruleId\":5,\"ruleName\":\"少糖\",\"price\":1},{\"ruleId\":6,\"ruleName\":\"多糖\",\"price\":2}]}],\"skus\":[{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":2,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":2.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":4.00}]}]}", Goods.class);
Goods g13 = JSON.parseObject("{\"goodId\":100,\"name\":\"冰茶咖啡\",\"price\":29.9,\"discount\":19.9,\"pics\":{\"thumbnail\":\"https://img1.baidu.com/it/u=3426268058,1014861135&fm=253&fmt=auto&app=138&f=JPEG?w=190&h=118\",\"introImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F2ff161bap00qzik7b00aad000t700inp.png&thumbnail=660x2147483647&quality=80&type=jpg\"],\"detailImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F5527f996p00qzikdu00avd000th00inp.png&thumbnail=660x2147483647&quality=80&type=jpg\",\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2Fbe0a3f04p00qziken00cvd000te00ikp.png&thumbnail=660x2147483647&quality=80&type=jpg\"]},\"desc\":\"\",\"remark\":\"\",\"tags\":[\"YYDS\",\"杨幂同款\"],\"specs\":[{\"specId\":1,\"specName\":\"温度\",\"rules\":[{\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0},{\"ruleId\":2,\"ruleName\":\"加冰\",\"price\":2},{\"ruleId\":3,\"ruleName\":\"加热\",\"price\":3}]},{\"specId\":2,\"specName\":\"糖度\",\"rules\":[{\"ruleId\":4,\"ruleName\":\"无糖\",\"price\":0},{\"ruleId\":5,\"ruleName\":\"少糖\",\"price\":1},{\"ruleId\":6,\"ruleName\":\"多糖\",\"price\":2}]}],\"skus\":[{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":2,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":2.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":4.00}]}]}", Goods.class);
Goods g14 = JSON.parseObject("{\"goodId\":100,\"name\":\"冰茶咖啡\",\"price\":29.9,\"discount\":19.9,\"pics\":{\"thumbnail\":\"https://img1.baidu.com/it/u=3426268058,1014861135&fm=253&fmt=auto&app=138&f=JPEG?w=190&h=118\",\"introImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F2ff161bap00qzik7b00aad000t700inp.png&thumbnail=660x2147483647&quality=80&type=jpg\"],\"detailImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F5527f996p00qzikdu00avd000th00inp.png&thumbnail=660x2147483647&quality=80&type=jpg\",\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2Fbe0a3f04p00qziken00cvd000te00ikp.png&thumbnail=660x2147483647&quality=80&type=jpg\"]},\"desc\":\"\",\"remark\":\"\",\"tags\":[\"YYDS\",\"杨幂同款\"],\"specs\":[{\"specId\":1,\"specName\":\"温度\",\"rules\":[{\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0},{\"ruleId\":2,\"ruleName\":\"加冰\",\"price\":2},{\"ruleId\":3,\"ruleName\":\"加热\",\"price\":3}]},{\"specId\":2,\"specName\":\"糖度\",\"rules\":[{\"ruleId\":4,\"ruleName\":\"无糖\",\"price\":0},{\"ruleId\":5,\"ruleName\":\"少糖\",\"price\":1},{\"ruleId\":6,\"ruleName\":\"多糖\",\"price\":2}]}],\"skus\":[{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":2,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":2.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":4.00}]}]}", Goods.class);
Goods g15 = JSON.parseObject("{\"goodId\":100,\"name\":\"冰茶咖啡\",\"price\":29.9,\"discount\":19.9,\"pics\":{\"thumbnail\":\"https://img1.baidu.com/it/u=3426268058,1014861135&fm=253&fmt=auto&app=138&f=JPEG?w=190&h=118\",\"introImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F2ff161bap00qzik7b00aad000t700inp.png&thumbnail=660x2147483647&quality=80&type=jpg\"],\"detailImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F5527f996p00qzikdu00avd000th00inp.png&thumbnail=660x2147483647&quality=80&type=jpg\",\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2Fbe0a3f04p00qziken00cvd000te00ikp.png&thumbnail=660x2147483647&quality=80&type=jpg\"]},\"desc\":\"\",\"remark\":\"\",\"tags\":[\"YYDS\",\"杨幂同款\"],\"specs\":[{\"specId\":1,\"specName\":\"温度\",\"rules\":[{\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0},{\"ruleId\":2,\"ruleName\":\"加冰\",\"price\":2},{\"ruleId\":3,\"ruleName\":\"加热\",\"price\":3}]},{\"specId\":2,\"specName\":\"糖度\",\"rules\":[{\"ruleId\":4,\"ruleName\":\"无糖\",\"price\":0},{\"ruleId\":5,\"ruleName\":\"少糖\",\"price\":1},{\"ruleId\":6,\"ruleName\":\"多糖\",\"price\":2}]}],\"skus\":[{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":2,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":2.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":4.00}]}]}", Goods.class);
Goods g16 = JSON.parseObject("{\"goodId\":100,\"name\":\"冰茶咖啡\",\"price\":29.9,\"discount\":19.9,\"pics\":{\"thumbnail\":\"https://img1.baidu.com/it/u=3426268058,1014861135&fm=253&fmt=auto&app=138&f=JPEG?w=190&h=118\",\"introImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F2ff161bap00qzik7b00aad000t700inp.png&thumbnail=660x2147483647&quality=80&type=jpg\"],\"detailImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F5527f996p00qzikdu00avd000th00inp.png&thumbnail=660x2147483647&quality=80&type=jpg\",\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2Fbe0a3f04p00qziken00cvd000te00ikp.png&thumbnail=660x2147483647&quality=80&type=jpg\"]},\"desc\":\"\",\"remark\":\"\",\"tags\":[\"YYDS\",\"杨幂同款\"],\"specs\":[{\"specId\":1,\"specName\":\"温度\",\"rules\":[{\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0},{\"ruleId\":2,\"ruleName\":\"加冰\",\"price\":2},{\"ruleId\":3,\"ruleName\":\"加热\",\"price\":3}]},{\"specId\":2,\"specName\":\"糖度\",\"rules\":[{\"ruleId\":4,\"ruleName\":\"无糖\",\"price\":0},{\"ruleId\":5,\"ruleName\":\"少糖\",\"price\":1},{\"ruleId\":6,\"ruleName\":\"多糖\",\"price\":2}]}],\"skus\":[{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":2,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":2.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":4.00}]}]}", Goods.class);
Goods g17 = JSON.parseObject("{\"goodId\":100,\"name\":\"冰茶咖啡\",\"price\":29.9,\"discount\":19.9,\"pics\":{\"thumbnail\":\"https://img1.baidu.com/it/u=3426268058,1014861135&fm=253&fmt=auto&app=138&f=JPEG?w=190&h=118\",\"introImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F2ff161bap00qzik7b00aad000t700inp.png&thumbnail=660x2147483647&quality=80&type=jpg\"],\"detailImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F5527f996p00qzikdu00avd000th00inp.png&thumbnail=660x2147483647&quality=80&type=jpg\",\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2Fbe0a3f04p00qziken00cvd000te00ikp.png&thumbnail=660x2147483647&quality=80&type=jpg\"]},\"desc\":\"\",\"remark\":\"\",\"tags\":[\"YYDS\",\"杨幂同款\"],\"specs\":[{\"specId\":1,\"specName\":\"温度\",\"rules\":[{\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0},{\"ruleId\":2,\"ruleName\":\"加冰\",\"price\":2},{\"ruleId\":3,\"ruleName\":\"加热\",\"price\":3}]},{\"specId\":2,\"specName\":\"糖度\",\"rules\":[{\"ruleId\":4,\"ruleName\":\"无糖\",\"price\":0},{\"ruleId\":5,\"ruleName\":\"少糖\",\"price\":1},{\"ruleId\":6,\"ruleName\":\"多糖\",\"price\":2}]}],\"skus\":[{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":2,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":2.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":4.00}]}]}", Goods.class);
Goods g18 = JSON.parseObject("{\"goodId\":100,\"name\":\"冰茶咖啡\",\"price\":29.9,\"discount\":19.9,\"pics\":{\"thumbnail\":\"https://img1.baidu.com/it/u=3426268058,1014861135&fm=253&fmt=auto&app=138&f=JPEG?w=190&h=118\",\"introImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F2ff161bap00qzik7b00aad000t700inp.png&thumbnail=660x2147483647&quality=80&type=jpg\"],\"detailImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F5527f996p00qzikdu00avd000th00inp.png&thumbnail=660x2147483647&quality=80&type=jpg\",\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2Fbe0a3f04p00qziken00cvd000te00ikp.png&thumbnail=660x2147483647&quality=80&type=jpg\"]},\"desc\":\"\",\"remark\":\"\",\"tags\":[\"YYDS\",\"杨幂同款\"],\"specs\":[{\"specId\":1,\"specName\":\"温度\",\"rules\":[{\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0},{\"ruleId\":2,\"ruleName\":\"加冰\",\"price\":2},{\"ruleId\":3,\"ruleName\":\"加热\",\"price\":3}]},{\"specId\":2,\"specName\":\"糖度\",\"rules\":[{\"ruleId\":4,\"ruleName\":\"无糖\",\"price\":0},{\"ruleId\":5,\"ruleName\":\"少糖\",\"price\":1},{\"ruleId\":6,\"ruleName\":\"多糖\",\"price\":2}]}],\"skus\":[{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":2,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":2.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":4.00}]}]}", Goods.class);
Goods g19 = JSON.parseObject("{\"goodId\":100,\"name\":\"冰茶咖啡\",\"price\":29.9,\"discount\":19.9,\"pics\":{\"thumbnail\":\"https://img1.baidu.com/it/u=3426268058,1014861135&fm=253&fmt=auto&app=138&f=JPEG?w=190&h=118\",\"introImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F2ff161bap00qzik7b00aad000t700inp.png&thumbnail=660x2147483647&quality=80&type=jpg\"],\"detailImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F5527f996p00qzikdu00avd000th00inp.png&thumbnail=660x2147483647&quality=80&type=jpg\",\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2Fbe0a3f04p00qziken00cvd000te00ikp.png&thumbnail=660x2147483647&quality=80&type=jpg\"]},\"desc\":\"\",\"remark\":\"\",\"tags\":[\"YYDS\",\"杨幂同款\"],\"specs\":[{\"specId\":1,\"specName\":\"温度\",\"rules\":[{\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0},{\"ruleId\":2,\"ruleName\":\"加冰\",\"price\":2},{\"ruleId\":3,\"ruleName\":\"加热\",\"price\":3}]},{\"specId\":2,\"specName\":\"糖度\",\"rules\":[{\"ruleId\":4,\"ruleName\":\"无糖\",\"price\":0},{\"ruleId\":5,\"ruleName\":\"少糖\",\"price\":1},{\"ruleId\":6,\"ruleName\":\"多糖\",\"price\":2}]}],\"skus\":[{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":2,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":2.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":4.00}]}]}", Goods.class);
Goods g20 = JSON.parseObject("{\"goodId\":100,\"name\":\"冰茶咖啡\",\"price\":29.9,\"discount\":19.9,\"pics\":{\"thumbnail\":\"https://img1.baidu.com/it/u=3426268058,1014861135&fm=253&fmt=auto&app=138&f=JPEG?w=190&h=118\",\"introImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F2ff161bap00qzik7b00aad000t700inp.png&thumbnail=660x2147483647&quality=80&type=jpg\"],\"detailImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F5527f996p00qzikdu00avd000th00inp.png&thumbnail=660x2147483647&quality=80&type=jpg\",\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2Fbe0a3f04p00qziken00cvd000te00ikp.png&thumbnail=660x2147483647&quality=80&type=jpg\"]},\"desc\":\"\",\"remark\":\"\",\"tags\":[\"YYDS\",\"杨幂同款\"],\"specs\":[{\"specId\":1,\"specName\":\"温度\",\"rules\":[{\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0},{\"ruleId\":2,\"ruleName\":\"加冰\",\"price\":2},{\"ruleId\":3,\"ruleName\":\"加热\",\"price\":3}]},{\"specId\":2,\"specName\":\"糖度\",\"rules\":[{\"ruleId\":4,\"ruleName\":\"无糖\",\"price\":0},{\"ruleId\":5,\"ruleName\":\"少糖\",\"price\":1},{\"ruleId\":6,\"ruleName\":\"多糖\",\"price\":2}]}],\"skus\":[{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":2,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":2.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":4.00}]}]}", Goods.class);
Goods g21 = JSON.parseObject("{\"goodId\":100,\"name\":\"冰茶咖啡\",\"price\":29.9,\"discount\":19.9,\"pics\":{\"thumbnail\":\"https://img1.baidu.com/it/u=3426268058,1014861135&fm=253&fmt=auto&app=138&f=JPEG?w=190&h=118\",\"introImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F2ff161bap00qzik7b00aad000t700inp.png&thumbnail=660x2147483647&quality=80&type=jpg\"],\"detailImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F5527f996p00qzikdu00avd000th00inp.png&thumbnail=660x2147483647&quality=80&type=jpg\",\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2Fbe0a3f04p00qziken00cvd000te00ikp.png&thumbnail=660x2147483647&quality=80&type=jpg\"]},\"desc\":\"\",\"remark\":\"\",\"tags\":[\"YYDS\",\"杨幂同款\"],\"specs\":[{\"specId\":1,\"specName\":\"温度\",\"rules\":[{\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0},{\"ruleId\":2,\"ruleName\":\"加冰\",\"price\":2},{\"ruleId\":3,\"ruleName\":\"加热\",\"price\":3}]},{\"specId\":2,\"specName\":\"糖度\",\"rules\":[{\"ruleId\":4,\"ruleName\":\"无糖\",\"price\":0},{\"ruleId\":5,\"ruleName\":\"少糖\",\"price\":1},{\"ruleId\":6,\"ruleName\":\"多糖\",\"price\":2}]}],\"skus\":[{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":2,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":2.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":4.00}]}]}", Goods.class);
Goods g22 = JSON.parseObject("{\"goodId\":100,\"name\":\"冰茶咖啡\",\"price\":29.9,\"discount\":19.9,\"pics\":{\"thumbnail\":\"https://img1.baidu.com/it/u=3426268058,1014861135&fm=253&fmt=auto&app=138&f=JPEG?w=190&h=118\",\"introImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F2ff161bap00qzik7b00aad000t700inp.png&thumbnail=660x2147483647&quality=80&type=jpg\"],\"detailImages\":[\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F5527f996p00qzikdu00avd000th00inp.png&thumbnail=660x2147483647&quality=80&type=jpg\",\"https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2Fbe0a3f04p00qziken00cvd000te00ikp.png&thumbnail=660x2147483647&quality=80&type=jpg\"]},\"desc\":\"\",\"remark\":\"\",\"tags\":[\"YYDS\",\"杨幂同款\"],\"specs\":[{\"specId\":1,\"specName\":\"温度\",\"rules\":[{\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0},{\"ruleId\":2,\"ruleName\":\"加冰\",\"price\":2},{\"ruleId\":3,\"ruleName\":\"加热\",\"price\":3}]},{\"specId\":2,\"specName\":\"糖度\",\"rules\":[{\"ruleId\":4,\"ruleName\":\"无糖\",\"price\":0},{\"ruleId\":5,\"ruleName\":\"少糖\",\"price\":1},{\"ruleId\":6,\"ruleName\":\"多糖\",\"price\":2}]}],\"skus\":[{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":2,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":2.00}]},{\"skuId\":1,\"state\":1,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"加糖\",\"price\":4.00}]}]}", Goods.class);
Sku s1 = JSON.parseObject("{\"skuId\":1,\"state\":1,\"isDefault\":1,\"price\":20.9,\"discount\":19.9,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"常温\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]}", Sku.class);
Sku s2 = JSON.parseObject("{\"skuId\":1,\"state\":1,\"isDefault\":1,\"price\":21.9,\"discount\":39.9,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"冰\",\"price\":2.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"多糖\",\"price\":1.00}]}", Sku.class);
Sku s3 = JSON.parseObject("{\"skuId\":1,\"state\":1,\"isDefault\":1,\"price\":22.9,\"discount\":49.9,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"热\",\"price\":3.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"少糖\",\"price\":4.00}]}", Sku.class);
Sku s4 = JSON.parseObject("{\"skuId\":1,\"state\":1,\"isDefault\":1,\"price\":23.9,\"discount\":59.9,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"不冰\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"无糖\",\"price\":0.00}]}", Sku.class);
Sku s5 = JSON.parseObject("{\"skuId\":1,\"state\":1,\"isDefault\":1,\"price\":24.9,\"discount\":69.9,\"rules\":[{\"specId\":1,\"specName\":\"温度\",\"ruleId\":1,\"ruleName\":\"不热\",\"price\":0.00},{\"specId\":2,\"specName\":\"糖度\",\"ruleId\":3,\"ruleName\":\"多糖\",\"price\":1.00}]}", Sku.class);
// g1.setSkus(Arrays.asList(s1, s2, s3));
g2.setSkus(Arrays.asList(s5, s2, s3));
g3.setSkus(Arrays.asList(s4, s2));
g4.setSkus(Arrays.asList(s3, s5));
g5.setSkus(Arrays.asList(s2, s1));
Category c1 = new Category(1, "分类一", Arrays.asList(g1, g2, g3));
Category c2 = new Category(2, "分类二", Arrays.asList(g4, g5, g6, g7, g8));
Category c3 = new Category(3, "分类三", Arrays.asList(g9, g10));
Category c4 = new Category(4, "分类四", Arrays.asList(g11));
Category c5 = new Category(5, "分类五", Arrays.asList(g12, g13, g14, g15, g16, g17, g18, g19, g20, g21, g22));
Recommend r1 = new Recommend("推荐一", "介绍一介绍一介绍一介绍一介绍一", "https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F2ff161bap00qzik7b00aad000t700inp.png&thumbnail=660x2147483647&quality=80&type=jpg", g1);
Recommend r2 = new Recommend("推荐二", "介介绍二介绍二绍二介绍二介绍二", "https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2F5527f996p00qzikdu00avd000th00inp.png&thumbnail=660x2147483647&quality=80&type=jpg", g2);
Recommend r3 = new Recommend("推荐三", "推荐三推荐三推荐三推荐三推荐三", "https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F0916%2Fbe0a3f04p00qziken00cvd000te00ikp.png&thumbnail=660x2147483647&quality=80&type=jpg", g3);
Recommend r4 = new Recommend("推荐四", "推荐四推荐四推荐四", "https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F1019%2F3f2df175j00r174rk006vc000us00n4c.jpg&thumbnail=660x2147483647&quality=80&type=jpg", g4);
Recommend r5 = new Recommend("推荐五", "推荐五推荐五", "https://nimg.ws.126.net/?url=http%3A%2F%2Fdingyue.ws.126.net%2F2021%2F1019%2F7dd6faa1j00r174rk005gc000us00n4c.jpg&thumbnail=660x2147483647&quality=80&type=jpg", g5);
recommends = Arrays.asList(r1, r2, r3, r4, r5);
categorys = Arrays.asList(c1, c2, c3, c4, c5);
private void setGoodsData() {
if (CollectionUtils.isEmpty(HLApplication.getMainData().getCategorys())) {
return;
}
scrollGoods = new ArrayList<>();
categorys.forEach(category -> {
HLApplication.getMainData().getCategorys().forEach(category -> {
scrollGoods.add(new ScrollBean(true, category.getName()));
category.getGoods().forEach(goods -> {
scrollGoods.add(new ScrollBean(new ScrollBean.ScrollItemBean(goods, category.getName())));
});
......@@ -310,34 +262,79 @@ public class LauncherActivity extends Activity {
tPosition.add(i);
}
}
goodsAdapter.setNewData(scrollGoods);
}
private void startLoadDataThread() {
loadData();
// new Thread(() -> {
// try {
// while (true) {
// runOnUiThread(() -> loadData());
// Thread.sleep(1000 * 10);
// }
// } catch (Exception e) {
// e.printStackTrace();
// }
// }).start();
}
private LoadDataHandler loadDataHandler;
private void loadData() {
loadDataHandler = new LoadDataHandler();
HttpUtil.getMainDatas(loadDataHandler);
}
class LoadDataHandler extends Handler {
@Override
public void handleMessage(@NonNull Message msg) {
super.handleMessage(msg);
try {
Object obj = msg.obj;
if (msg.what == 0 || obj == null) {
Toast.makeText(LauncherActivity.this, R.string.error_load_main_data, Toast.LENGTH_SHORT).show();
return;
}
// String s = "{\"images\":{\"left\":\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/05/14/1.jpg\",\"right\":{\"closeDown\":\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/05/14/1.jpg\",\"inProduction\":\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/05/14/3.jpg\",\"thereAOrder\":\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/05/14/3.jpg\",\"noOrder\":\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/05/14/4.jpg\"}},\"tips\":\"www.baidu.com3\",\"countOfOrder\":\"223\",\"categorys\":[{\"id\":0,\"name\":\"今日特惠\",\"goods\":[{\"goodsId\":\"21\",\"name\":\"樱花初绽拿铁\",\"price\":\"22.00\",\"skus\":[{\"skuId\":\"75\",\"state\":\"1\",\"price\":\"12.00\",\"rules\":[{\"price\":\"0\",\"ruleId\":\"55\",\"specId\":\"46\"},{\"price\":\"0\",\"ruleId\":\"53\",\"specId\":\"45\"},{\"price\":\"2\",\"ruleId\":\"51\",\"specId\":\"44\"}],\"isDefault\":\"1\"},{\"skuId\":\"76\",\"state\":\"1\",\"price\":\"13.00\",\"rules\":[{\"price\":\"1\",\"ruleId\":\"56\",\"specId\":\"46\"},{\"price\":\"0\",\"ruleId\":\"53\",\"specId\":\"45\"},{\"price\":\"2\",\"ruleId\":\"51\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"77\",\"state\":\"1\",\"price\":\"14.00\",\"rules\":[{\"price\":\"2\",\"ruleId\":\"57\",\"specId\":\"46\"},{\"price\":\"0\",\"ruleId\":\"53\",\"specId\":\"45\"},{\"price\":\"2\",\"ruleId\":\"51\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"78\",\"state\":\"1\",\"price\":\"12.00\",\"rules\":[{\"price\":\"0\",\"ruleId\":\"55\",\"specId\":\"46\"},{\"price\":\"1\",\"ruleId\":\"54\",\"specId\":\"45\"},{\"price\":\"2\",\"ruleId\":\"51\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"79\",\"state\":\"1\",\"price\":\"13.00\",\"rules\":[{\"price\":\"1\",\"ruleId\":\"56\",\"specId\":\"46\"},{\"price\":\"1\",\"ruleId\":\"54\",\"specId\":\"45\"},{\"price\":\"2\",\"ruleId\":\"51\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"80\",\"state\":\"1\",\"price\":\"14.00\",\"rules\":[{\"price\":\"2\",\"ruleId\":\"57\",\"specId\":\"46\"},{\"price\":\"1\",\"ruleId\":\"54\",\"specId\":\"45\"},{\"price\":\"2\",\"ruleId\":\"51\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"81\",\"state\":\"1\",\"price\":\"12.00\",\"rules\":[{\"price\":\"0\",\"ruleId\":\"55\",\"specId\":\"46\"},{\"price\":\"0\",\"ruleId\":\"53\",\"specId\":\"45\"},{\"price\":\"1\",\"ruleId\":\"52\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"82\",\"state\":\"1\",\"price\":\"13.00\",\"rules\":[{\"price\":\"1\",\"ruleId\":\"56\",\"specId\":\"46\"},{\"price\":\"0\",\"ruleId\":\"53\",\"specId\":\"45\"},{\"price\":\"1\",\"ruleId\":\"52\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"83\",\"state\":\"1\",\"price\":\"14.00\",\"rules\":[{\"price\":\"2\",\"ruleId\":\"57\",\"specId\":\"46\"},{\"price\":\"0\",\"ruleId\":\"53\",\"specId\":\"45\"},{\"price\":\"1\",\"ruleId\":\"52\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"84\",\"state\":\"1\",\"price\":\"12.00\",\"rules\":[{\"price\":\"0\",\"ruleId\":\"55\",\"specId\":\"46\"},{\"price\":\"1\",\"ruleId\":\"54\",\"specId\":\"45\"},{\"price\":\"1\",\"ruleId\":\"52\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"85\",\"state\":\"1\",\"price\":\"13.00\",\"rules\":[{\"price\":\"1\",\"ruleId\":\"56\",\"specId\":\"46\"},{\"price\":\"1\",\"ruleId\":\"54\",\"specId\":\"45\"},{\"price\":\"1\",\"ruleId\":\"52\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"86\",\"state\":\"1\",\"price\":\"14.00\",\"rules\":[{\"price\":\"2\",\"ruleId\":\"57\",\"specId\":\"46\"},{\"price\":\"1\",\"ruleId\":\"54\",\"specId\":\"45\"},{\"price\":\"1\",\"ruleId\":\"52\",\"specId\":\"44\"}],\"isDefault\":\"0\"}],\"discount\":\"12.00\",\"pics\":null,\"desc\":\"樱花初绽拿铁\",\"remarks\":\"樱花初绽拿铁\",\"tags\":[],\"specs\":[{\"rules\":[{\"isDefault\":\"1\",\"isRecommend\":\"0\",\"price\":\"2\",\"ruleId\":\"51\",\"ruleName\":\"冰\"},{\"isDefault\":\"0\",\"isRecommend\":\"0\",\"price\":\"1\",\"ruleId\":\"52\",\"ruleName\":\"热\"}],\"specId\":\"44\",\"specName\":\"温度\"},{\"rules\":[{\"isDefault\":\"1\",\"isRecommend\":\"0\",\"price\":\"0\",\"ruleId\":\"53\",\"ruleName\":\"不加奶\"},{\"isDefault\":\"0\",\"isRecommend\":\"0\",\"price\":\"1\",\"ruleId\":\"54\",\"ruleName\":\"正常奶\"}],\"specId\":\"45\",\"specName\":\"加奶\"},{\"rules\":[{\"isDefault\":\"1\",\"isRecommend\":\"0\",\"price\":\"0\",\"ruleId\":\"55\",\"ruleName\":\"不加糖\"},{\"isDefault\":\"0\",\"isRecommend\":\"0\",\"price\":\"1\",\"ruleId\":\"56\",\"ruleName\":\"半塘\"},{\"isDefault\":\"0\",\"isRecommend\":\"0\",\"price\":\"2\",\"ruleId\":\"57\",\"ruleName\":\"标准糖\"}],\"specId\":\"46\",\"specName\":\"糖度\"}]},{\"goodsId\":\"25\",\"name\":\"经典手冲咖啡\",\"price\":\"40.00\",\"skus\":[],\"discount\":\"20.00\",\"pics\":null,\"desc\":\"永远经典\",\"remarks\":\"永远经典\",\"tags\":[\"1\"],\"specs\":[{\"rules\":[{\"isDefault\":\"1\",\"isRecommend\":\"0\",\"price\":\"2\",\"ruleId\":\"51\",\"ruleName\":\"冰\"},{\"isDefault\":\"0\",\"isRecommend\":\"0\",\"price\":\"1\",\"ruleId\":\"52\",\"ruleName\":\"热\"}],\"specId\":\"44\",\"specName\":\"温度\"},{\"rules\":[{\"isDefault\":\"1\",\"isRecommend\":\"0\",\"price\":\"0\",\"ruleId\":\"53\",\"ruleName\":\"不加奶\"},{\"isDefault\":\"0\",\"isRecommend\":\"0\",\"price\":\"1\",\"ruleId\":\"54\",\"ruleName\":\"正常奶\"}],\"specId\":\"45\",\"specName\":\"加奶\"}]},{\"goodsId\":\"24\",\"name\":\"冷萃咖啡\",\"price\":\"13.00\",\"skus\":[],\"discount\":\"10.00\",\"pics\":null,\"desc\":\"冷翠永远的神\",\"remarks\":\"加入推荐\",\"tags\":[\"1\"],\"specs\":[{\"rules\":[{\"isDefault\":\"1\",\"isRecommend\":\"0\",\"price\":\"2\",\"ruleId\":\"51\",\"ruleName\":\"冰\"},{\"isDefault\":\"0\",\"isRecommend\":\"0\",\"price\":\"1\",\"ruleId\":\"52\",\"ruleName\":\"热\"}],\"specId\":\"44\",\"specName\":\"温度\"},{\"rules\":[{\"isDefault\":\"1\",\"isRecommend\":\"0\",\"price\":\"0\",\"ruleId\":\"53\",\"ruleName\":\"不加奶\"},{\"isDefault\":\"0\",\"isRecommend\":\"0\",\"price\":\"1\",\"ruleId\":\"54\",\"ruleName\":\"正常奶\"}],\"specId\":\"45\",\"specName\":\"加奶\"}]}]},{\"id\":9,\"name\":\"浓缩咖啡\",\"goods\":[{\"goodsId\":\"21\",\"name\":\"樱花初绽拿铁\",\"price\":\"22\",\"skus\":[{\"skuId\":\"75\",\"state\":\"1\",\"price\":\"12.00\",\"rules\":[{\"price\":\"0\",\"ruleId\":\"55\",\"specId\":\"46\"},{\"price\":\"0\",\"ruleId\":\"53\",\"specId\":\"45\"},{\"price\":\"2\",\"ruleId\":\"51\",\"specId\":\"44\"}],\"isDefault\":\"1\"},{\"skuId\":\"76\",\"state\":\"1\",\"price\":\"13.00\",\"rules\":[{\"price\":\"1\",\"ruleId\":\"56\",\"specId\":\"46\"},{\"price\":\"0\",\"ruleId\":\"53\",\"specId\":\"45\"},{\"price\":\"2\",\"ruleId\":\"51\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"77\",\"state\":\"1\",\"price\":\"14.00\",\"rules\":[{\"price\":\"2\",\"ruleId\":\"57\",\"specId\":\"46\"},{\"price\":\"0\",\"ruleId\":\"53\",\"specId\":\"45\"},{\"price\":\"2\",\"ruleId\":\"51\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"78\",\"state\":\"1\",\"price\":\"12.00\",\"rules\":[{\"price\":\"0\",\"ruleId\":\"55\",\"specId\":\"46\"},{\"price\":\"1\",\"ruleId\":\"54\",\"specId\":\"45\"},{\"price\":\"2\",\"ruleId\":\"51\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"79\",\"state\":\"1\",\"price\":\"13.00\",\"rules\":[{\"price\":\"1\",\"ruleId\":\"56\",\"specId\":\"46\"},{\"price\":\"1\",\"ruleId\":\"54\",\"specId\":\"45\"},{\"price\":\"2\",\"ruleId\":\"51\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"80\",\"state\":\"1\",\"price\":\"14.00\",\"rules\":[{\"price\":\"2\",\"ruleId\":\"57\",\"specId\":\"46\"},{\"price\":\"1\",\"ruleId\":\"54\",\"specId\":\"45\"},{\"price\":\"2\",\"ruleId\":\"51\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"81\",\"state\":\"1\",\"price\":\"12.00\",\"rules\":[{\"price\":\"0\",\"ruleId\":\"55\",\"specId\":\"46\"},{\"price\":\"0\",\"ruleId\":\"53\",\"specId\":\"45\"},{\"price\":\"1\",\"ruleId\":\"52\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"82\",\"state\":\"1\",\"price\":\"13.00\",\"rules\":[{\"price\":\"1\",\"ruleId\":\"56\",\"specId\":\"46\"},{\"price\":\"0\",\"ruleId\":\"53\",\"specId\":\"45\"},{\"price\":\"1\",\"ruleId\":\"52\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"83\",\"state\":\"1\",\"price\":\"14.00\",\"rules\":[{\"price\":\"2\",\"ruleId\":\"57\",\"specId\":\"46\"},{\"price\":\"0\",\"ruleId\":\"53\",\"specId\":\"45\"},{\"price\":\"1\",\"ruleId\":\"52\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"84\",\"state\":\"1\",\"price\":\"12.00\",\"rules\":[{\"price\":\"0\",\"ruleId\":\"55\",\"specId\":\"46\"},{\"price\":\"1\",\"ruleId\":\"54\",\"specId\":\"45\"},{\"price\":\"1\",\"ruleId\":\"52\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"85\",\"state\":\"1\",\"price\":\"13.00\",\"rules\":[{\"price\":\"1\",\"ruleId\":\"56\",\"specId\":\"46\"},{\"price\":\"1\",\"ruleId\":\"54\",\"specId\":\"45\"},{\"price\":\"1\",\"ruleId\":\"52\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"86\",\"state\":\"1\",\"price\":\"14.00\",\"rules\":[{\"price\":\"2\",\"ruleId\":\"57\",\"specId\":\"46\"},{\"price\":\"1\",\"ruleId\":\"54\",\"specId\":\"45\"},{\"price\":\"1\",\"ruleId\":\"52\",\"specId\":\"44\"}],\"isDefault\":\"0\"}],\"discount\":\"12\",\"pics\":{\"thumbnail\":\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/05/14/a.jpg\",\"introImages\":[\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/05/14/a.jpg\",\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/05/14/a.jpg\"],\"introImagesApplet\":[\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/05/14/a.jpg\",\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/05/14/a.jpg\"],\"detailImages\":[\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/05/14/a.jpg\",\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/05/14/a.jpg\",\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/05/14/a.jpg\"],\"thumbnailApplet\":\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/05/14/a.jpg\",\"detailImagesApplet\":[\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/05/14/a.jpg\",\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/05/14/a.jpg\"]},\"desc\":\"樱花初绽拿铁\",\"remarks\":\"樱花初绽拿铁\",\"tags\":[],\"specs\":[{\"rules\":[{\"isDefault\":\"1\",\"isRecommend\":\"0\",\"price\":\"2\",\"ruleId\":\"51\",\"ruleName\":\"冰\"},{\"isDefault\":\"0\",\"isRecommend\":\"0\",\"price\":\"1\",\"ruleId\":\"52\",\"ruleName\":\"热\"}],\"specId\":\"44\",\"specName\":\"温度\"},{\"rules\":[{\"isDefault\":\"1\",\"isRecommend\":\"0\",\"price\":\"0\",\"ruleId\":\"53\",\"ruleName\":\"不加奶\"},{\"isDefault\":\"0\",\"isRecommend\":\"0\",\"price\":\"1\",\"ruleId\":\"54\",\"ruleName\":\"正常奶\"}],\"specId\":\"45\",\"specName\":\"加奶\"},{\"rules\":[{\"isDefault\":\"1\",\"isRecommend\":\"0\",\"price\":\"0\",\"ruleId\":\"55\",\"ruleName\":\"不加糖\"},{\"isDefault\":\"0\",\"isRecommend\":\"0\",\"price\":\"1\",\"ruleId\":\"56\",\"ruleName\":\"半塘\"},{\"isDefault\":\"0\",\"isRecommend\":\"0\",\"price\":\"2\",\"ruleId\":\"57\",\"ruleName\":\"标准糖\"}],\"specId\":\"46\",\"specName\":\"糖度\"}]},{\"goodsId\":\"22\",\"name\":\"燕麦丝绒拿铁\",\"price\":\"60\",\"skus\":[{\"skuId\":\"87\",\"state\":\"1\",\"price\":\"30.00\",\"rules\":[{\"price\":\"0\",\"ruleId\":\"53\",\"specId\":\"45\"},{\"price\":\"2\",\"ruleId\":\"51\",\"specId\":\"44\"}],\"isDefault\":\"1\"},{\"skuId\":\"88\",\"state\":\"1\",\"price\":\"31.00\",\"rules\":[{\"price\":\"1\",\"ruleId\":\"54\",\"specId\":\"45\"},{\"price\":\"2\",\"ruleId\":\"51\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"89\",\"state\":\"1\",\"price\":\"30.00\",\"rules\":[{\"price\":\"0\",\"ruleId\":\"53\",\"specId\":\"45\"},{\"price\":\"1\",\"ruleId\":\"52\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"90\",\"state\":\"1\",\"price\":\"31.00\",\"rules\":[{\"price\":\"1\",\"ruleId\":\"54\",\"specId\":\"45\"},{\"price\":\"1\",\"ruleId\":\"52\",\"specId\":\"44\"}],\"isDefault\":\"0\"}],\"discount\":\"30\",\"pics\":{\"thumbnail\":\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/05/14/a.jpg\",\"introImages\":[\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/05/14/a.jpg\"],\"detailImages\":[\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/05/14/a.jpg\"]},\"desc\":\"燕麦丝绒拿铁\",\"remarks\":\"燕麦丝绒拿铁\",\"tags\":[\"1\"],\"specs\":[{\"rules\":[{\"isDefault\":\"1\",\"isRecommend\":\"0\",\"price\":\"2\",\"ruleId\":\"51\",\"ruleName\":\"冰\"},{\"isDefault\":\"0\",\"isRecommend\":\"0\",\"price\":\"1\",\"ruleId\":\"52\",\"ruleName\":\"热\"}],\"specId\":\"44\",\"specName\":\"温度\"},{\"rules\":[{\"isDefault\":\"1\",\"isRecommend\":\"0\",\"price\":\"0\",\"ruleId\":\"53\",\"ruleName\":\"不加奶\"},{\"isDefault\":\"0\",\"isRecommend\":\"0\",\"price\":\"1\",\"ruleId\":\"54\",\"ruleName\":\"正常奶\"}],\"specId\":\"45\",\"specName\":\"加奶\"}]},{\"goodsId\":\"23\",\"name\":\"燕麦焦糖玛奇朵\",\"price\":\"22\",\"skus\":[],\"discount\":\"11\",\"pics\":{\"thumbnail\":\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/05/14/a.jpg\",\"introImages\":[\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/05/14/a.jpg\"],\"detailImages\":[\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/05/14/a.jpg\"]},\"desc\":\"yyds\",\"remarks\":null,\"tags\":[\"1\"],\"specs\":[{\"rules\":[{\"isDefault\":\"1\",\"isRecommend\":\"0\",\"price\":\"2\",\"ruleId\":\"51\",\"ruleName\":\"冰\"},{\"isDefault\":\"0\",\"isRecommend\":\"0\",\"price\":\"1\",\"ruleId\":\"52\",\"ruleName\":\"热\"}],\"specId\":\"44\",\"specName\":\"温度\"},{\"rules\":[{\"isDefault\":\"1\",\"isRecommend\":\"0\",\"price\":\"0\",\"ruleId\":\"53\",\"ruleName\":\"不加奶\"},{\"isDefault\":\"0\",\"isRecommend\":\"0\",\"price\":\"1\",\"ruleId\":\"54\",\"ruleName\":\"正常奶\"}],\"specId\":\"45\",\"specName\":\"加奶\"}]}]},{\"id\":10,\"name\":\"冷萃咖啡\",\"goods\":[{\"goodsId\":\"24\",\"name\":\"冷萃咖啡\",\"price\":\"13\",\"skus\":[],\"discount\":\"10\",\"pics\":{\"thumbnail\":\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/05/14/a.jpg\",\"introImages\":[\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/05/14/a.jpg\"],\"detailImages\":[\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/05/14/a.jpg\"]},\"desc\":\"冷翠永远的神\",\"remarks\":\"加入推荐\",\"tags\":[\"1\"],\"specs\":[{\"rules\":[{\"isDefault\":\"1\",\"isRecommend\":\"0\",\"price\":\"2\",\"ruleId\":\"51\",\"ruleName\":\"冰\"},{\"isDefault\":\"0\",\"isRecommend\":\"0\",\"price\":\"1\",\"ruleId\":\"52\",\"ruleName\":\"热\"}],\"specId\":\"44\",\"specName\":\"温度\"},{\"rules\":[{\"isDefault\":\"1\",\"isRecommend\":\"0\",\"price\":\"0\",\"ruleId\":\"53\",\"ruleName\":\"不加奶\"},{\"isDefault\":\"0\",\"isRecommend\":\"0\",\"price\":\"1\",\"ruleId\":\"54\",\"ruleName\":\"正常奶\"}],\"specId\":\"45\",\"specName\":\"加奶\"}]}]},{\"id\":11,\"name\":\"冲煮咖啡\",\"goods\":[{\"goodsId\":\"25\",\"name\":\"经典手冲咖啡\",\"price\":\"40\",\"skus\":[],\"discount\":\"20\",\"pics\":{\"thumbnail\":\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/05/14/a.jpg\",\"introImages\":[\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/05/14/a.jpg\"],\"detailImages\":[\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/05/14/a.jpg\"]},\"desc\":\"永远经典\",\"remarks\":\"永远经典\",\"tags\":[\"1\"],\"specs\":[{\"rules\":[{\"isDefault\":\"1\",\"isRecommend\":\"0\",\"price\":\"2\",\"ruleId\":\"51\",\"ruleName\":\"冰\"},{\"isDefault\":\"0\",\"isRecommend\":\"0\",\"price\":\"1\",\"ruleId\":\"52\",\"ruleName\":\"热\"}],\"specId\":\"44\",\"specName\":\"温度\"},{\"rules\":[{\"isDefault\":\"1\",\"isRecommend\":\"0\",\"price\":\"0\",\"ruleId\":\"53\",\"ruleName\":\"不加奶\"},{\"isDefault\":\"0\",\"isRecommend\":\"0\",\"price\":\"1\",\"ruleId\":\"54\",\"ruleName\":\"正常奶\"}],\"specId\":\"45\",\"specName\":\"加奶\"}]},{\"goodsId\":\"26\",\"name\":\"雅致手冲咖啡\",\"price\":\"30\",\"skus\":[],\"discount\":\"11\",\"pics\":{\"thumbnail\":\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/05/14/a.jpg\",\"introImages\":[\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/05/14/a.jpg\"],\"detailImages\":[\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/05/14/a.jpg\"]},\"desc\":\"雅致手冲咖啡\",\"remarks\":\"雅致手冲咖啡\",\"tags\":[\"1\"],\"specs\":[{\"rules\":[{\"isDefault\":\"1\",\"isRecommend\":\"0\",\"price\":\"2\",\"ruleId\":\"51\",\"ruleName\":\"冰\"},{\"isDefault\":\"0\",\"isRecommend\":\"0\",\"price\":\"1\",\"ruleId\":\"52\",\"ruleName\":\"热\"}],\"specId\":\"44\",\"specName\":\"温度\"},{\"rules\":[{\"isDefault\":\"1\",\"isRecommend\":\"0\",\"price\":\"0\",\"ruleId\":\"53\",\"ruleName\":\"不加奶\"},{\"isDefault\":\"0\",\"isRecommend\":\"0\",\"price\":\"1\",\"ruleId\":\"54\",\"ruleName\":\"正常奶\"}],\"specId\":\"45\",\"specName\":\"加奶\"}]}]}],\"recommends\":[{\"goodsName\":\"樱花初绽拿铁\",\"pic\":\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/05/14/a.jpg\",\"desc\":\"店家推荐\",\"goods\":{\"goodsId\":\"21\",\"name\":\"樱花初绽拿铁\",\"price\":\"22.00\",\"skus\":[{\"skuId\":\"75\",\"state\":\"1\",\"price\":\"12.00\",\"rules\":[{\"price\":\"0\",\"ruleId\":\"55\",\"specId\":\"46\"},{\"price\":\"0\",\"ruleId\":\"53\",\"specId\":\"45\"},{\"price\":\"2\",\"ruleId\":\"51\",\"specId\":\"44\"}],\"isDefault\":\"1\"},{\"skuId\":\"76\",\"state\":\"1\",\"price\":\"13.00\",\"rules\":[{\"price\":\"1\",\"ruleId\":\"56\",\"specId\":\"46\"},{\"price\":\"0\",\"ruleId\":\"53\",\"specId\":\"45\"},{\"price\":\"2\",\"ruleId\":\"51\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"77\",\"state\":\"1\",\"price\":\"14.00\",\"rules\":[{\"price\":\"2\",\"ruleId\":\"57\",\"specId\":\"46\"},{\"price\":\"0\",\"ruleId\":\"53\",\"specId\":\"45\"},{\"price\":\"2\",\"ruleId\":\"51\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"78\",\"state\":\"1\",\"price\":\"12.00\",\"rules\":[{\"price\":\"0\",\"ruleId\":\"55\",\"specId\":\"46\"},{\"price\":\"1\",\"ruleId\":\"54\",\"specId\":\"45\"},{\"price\":\"2\",\"ruleId\":\"51\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"79\",\"state\":\"1\",\"price\":\"13.00\",\"rules\":[{\"price\":\"1\",\"ruleId\":\"56\",\"specId\":\"46\"},{\"price\":\"1\",\"ruleId\":\"54\",\"specId\":\"45\"},{\"price\":\"2\",\"ruleId\":\"51\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"80\",\"state\":\"1\",\"price\":\"14.00\",\"rules\":[{\"price\":\"2\",\"ruleId\":\"57\",\"specId\":\"46\"},{\"price\":\"1\",\"ruleId\":\"54\",\"specId\":\"45\"},{\"price\":\"2\",\"ruleId\":\"51\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"81\",\"state\":\"1\",\"price\":\"12.00\",\"rules\":[{\"price\":\"0\",\"ruleId\":\"55\",\"specId\":\"46\"},{\"price\":\"0\",\"ruleId\":\"53\",\"specId\":\"45\"},{\"price\":\"1\",\"ruleId\":\"52\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"82\",\"state\":\"1\",\"price\":\"13.00\",\"rules\":[{\"price\":\"1\",\"ruleId\":\"56\",\"specId\":\"46\"},{\"price\":\"0\",\"ruleId\":\"53\",\"specId\":\"45\"},{\"price\":\"1\",\"ruleId\":\"52\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"83\",\"state\":\"1\",\"price\":\"14.00\",\"rules\":[{\"price\":\"2\",\"ruleId\":\"57\",\"specId\":\"46\"},{\"price\":\"0\",\"ruleId\":\"53\",\"specId\":\"45\"},{\"price\":\"1\",\"ruleId\":\"52\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"84\",\"state\":\"1\",\"price\":\"12.00\",\"rules\":[{\"price\":\"0\",\"ruleId\":\"55\",\"specId\":\"46\"},{\"price\":\"1\",\"ruleId\":\"54\",\"specId\":\"45\"},{\"price\":\"1\",\"ruleId\":\"52\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"85\",\"state\":\"1\",\"price\":\"13.00\",\"rules\":[{\"price\":\"1\",\"ruleId\":\"56\",\"specId\":\"46\"},{\"price\":\"1\",\"ruleId\":\"54\",\"specId\":\"45\"},{\"price\":\"1\",\"ruleId\":\"52\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"86\",\"state\":\"1\",\"price\":\"14.00\",\"rules\":[{\"price\":\"2\",\"ruleId\":\"57\",\"specId\":\"46\"},{\"price\":\"1\",\"ruleId\":\"54\",\"specId\":\"45\"},{\"price\":\"1\",\"ruleId\":\"52\",\"specId\":\"44\"}],\"isDefault\":\"0\"}],\"discount\":\"12.00\",\"pics\":null,\"desc\":\"樱花初绽拿铁\",\"remarks\":\"樱花初绽拿铁\",\"tags\":[],\"specs\":[{\"rules\":[{\"isDefault\":\"1\",\"isRecommend\":\"0\",\"price\":\"2\",\"ruleId\":\"51\",\"ruleName\":\"冰\"},{\"isDefault\":\"0\",\"isRecommend\":\"0\",\"price\":\"1\",\"ruleId\":\"52\",\"ruleName\":\"热\"}],\"specId\":\"44\",\"specName\":\"温度\"},{\"rules\":[{\"isDefault\":\"1\",\"isRecommend\":\"0\",\"price\":\"0\",\"ruleId\":\"53\",\"ruleName\":\"不加奶\"},{\"isDefault\":\"0\",\"isRecommend\":\"0\",\"price\":\"1\",\"ruleId\":\"54\",\"ruleName\":\"正常奶\"}],\"specId\":\"45\",\"specName\":\"加奶\"},{\"rules\":[{\"isDefault\":\"1\",\"isRecommend\":\"0\",\"price\":\"0\",\"ruleId\":\"55\",\"ruleName\":\"不加糖\"},{\"isDefault\":\"0\",\"isRecommend\":\"0\",\"price\":\"1\",\"ruleId\":\"56\",\"ruleName\":\"半塘\"},{\"isDefault\":\"0\",\"isRecommend\":\"0\",\"price\":\"2\",\"ruleId\":\"57\",\"ruleName\":\"标准糖\"}],\"specId\":\"46\",\"specName\":\"糖度\"}]}},{\"goodsName\":\"经典手冲咖啡\",\"pic\":\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/05/14/a.jpg\",\"desc\":\"店家推荐\",\"goods\":{\"goodsId\":\"21\",\"name\":\"樱花初绽拿铁\",\"price\":\"22.00\",\"skus\":[{\"skuId\":\"75\",\"state\":\"1\",\"price\":\"12.00\",\"rules\":[{\"price\":\"0\",\"ruleId\":\"55\",\"specId\":\"46\"},{\"price\":\"0\",\"ruleId\":\"53\",\"specId\":\"45\"},{\"price\":\"2\",\"ruleId\":\"51\",\"specId\":\"44\"}],\"isDefault\":\"1\"},{\"skuId\":\"76\",\"state\":\"1\",\"price\":\"13.00\",\"rules\":[{\"price\":\"1\",\"ruleId\":\"56\",\"specId\":\"46\"},{\"price\":\"0\",\"ruleId\":\"53\",\"specId\":\"45\"},{\"price\":\"2\",\"ruleId\":\"51\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"77\",\"state\":\"1\",\"price\":\"14.00\",\"rules\":[{\"price\":\"2\",\"ruleId\":\"57\",\"specId\":\"46\"},{\"price\":\"0\",\"ruleId\":\"53\",\"specId\":\"45\"},{\"price\":\"2\",\"ruleId\":\"51\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"78\",\"state\":\"1\",\"price\":\"12.00\",\"rules\":[{\"price\":\"0\",\"ruleId\":\"55\",\"specId\":\"46\"},{\"price\":\"1\",\"ruleId\":\"54\",\"specId\":\"45\"},{\"price\":\"2\",\"ruleId\":\"51\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"79\",\"state\":\"1\",\"price\":\"13.00\",\"rules\":[{\"price\":\"1\",\"ruleId\":\"56\",\"specId\":\"46\"},{\"price\":\"1\",\"ruleId\":\"54\",\"specId\":\"45\"},{\"price\":\"2\",\"ruleId\":\"51\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"80\",\"state\":\"1\",\"price\":\"14.00\",\"rules\":[{\"price\":\"2\",\"ruleId\":\"57\",\"specId\":\"46\"},{\"price\":\"1\",\"ruleId\":\"54\",\"specId\":\"45\"},{\"price\":\"2\",\"ruleId\":\"51\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"81\",\"state\":\"1\",\"price\":\"12.00\",\"rules\":[{\"price\":\"0\",\"ruleId\":\"55\",\"specId\":\"46\"},{\"price\":\"0\",\"ruleId\":\"53\",\"specId\":\"45\"},{\"price\":\"1\",\"ruleId\":\"52\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"82\",\"state\":\"1\",\"price\":\"13.00\",\"rules\":[{\"price\":\"1\",\"ruleId\":\"56\",\"specId\":\"46\"},{\"price\":\"0\",\"ruleId\":\"53\",\"specId\":\"45\"},{\"price\":\"1\",\"ruleId\":\"52\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"83\",\"state\":\"1\",\"price\":\"14.00\",\"rules\":[{\"price\":\"2\",\"ruleId\":\"57\",\"specId\":\"46\"},{\"price\":\"0\",\"ruleId\":\"53\",\"specId\":\"45\"},{\"price\":\"1\",\"ruleId\":\"52\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"84\",\"state\":\"1\",\"price\":\"12.00\",\"rules\":[{\"price\":\"0\",\"ruleId\":\"55\",\"specId\":\"46\"},{\"price\":\"1\",\"ruleId\":\"54\",\"specId\":\"45\"},{\"price\":\"1\",\"ruleId\":\"52\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"85\",\"state\":\"1\",\"price\":\"13.00\",\"rules\":[{\"price\":\"1\",\"ruleId\":\"56\",\"specId\":\"46\"},{\"price\":\"1\",\"ruleId\":\"54\",\"specId\":\"45\"},{\"price\":\"1\",\"ruleId\":\"52\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"86\",\"state\":\"1\",\"price\":\"14.00\",\"rules\":[{\"price\":\"2\",\"ruleId\":\"57\",\"specId\":\"46\"},{\"price\":\"1\",\"ruleId\":\"54\",\"specId\":\"45\"},{\"price\":\"1\",\"ruleId\":\"52\",\"specId\":\"44\"}],\"isDefault\":\"0\"}],\"discount\":\"12.00\",\"pics\":null,\"desc\":\"樱花初绽拿铁\",\"remarks\":\"樱花初绽拿铁\",\"tags\":[],\"specs\":[{\"rules\":[{\"isDefault\":\"1\",\"isRecommend\":\"0\",\"price\":\"2\",\"ruleId\":\"51\",\"ruleName\":\"冰\"},{\"isDefault\":\"0\",\"isRecommend\":\"0\",\"price\":\"1\",\"ruleId\":\"52\",\"ruleName\":\"热\"}],\"specId\":\"44\",\"specName\":\"温度\"},{\"rules\":[{\"isDefault\":\"1\",\"isRecommend\":\"0\",\"price\":\"0\",\"ruleId\":\"53\",\"ruleName\":\"不加奶\"},{\"isDefault\":\"0\",\"isRecommend\":\"0\",\"price\":\"1\",\"ruleId\":\"54\",\"ruleName\":\"正常奶\"}],\"specId\":\"45\",\"specName\":\"加奶\"},{\"rules\":[{\"isDefault\":\"1\",\"isRecommend\":\"0\",\"price\":\"0\",\"ruleId\":\"55\",\"ruleName\":\"不加糖\"},{\"isDefault\":\"0\",\"isRecommend\":\"0\",\"price\":\"1\",\"ruleId\":\"56\",\"ruleName\":\"半塘\"},{\"isDefault\":\"0\",\"isRecommend\":\"0\",\"price\":\"2\",\"ruleId\":\"57\",\"ruleName\":\"标准糖\"}],\"specId\":\"46\",\"specName\":\"糖度\"}]}},{\"goodsName\":\"冷萃咖啡\",\"pic\":\"https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/05/14/a.jpg\",\"desc\":\"店家推荐\",\"goods\":{\"goodsId\":\"21\",\"name\":\"樱花初绽拿铁\",\"price\":\"22.00\",\"skus\":[{\"skuId\":\"75\",\"state\":\"1\",\"price\":\"12.00\",\"rules\":[{\"price\":\"0\",\"ruleId\":\"55\",\"specId\":\"46\"},{\"price\":\"0\",\"ruleId\":\"53\",\"specId\":\"45\"},{\"price\":\"2\",\"ruleId\":\"51\",\"specId\":\"44\"}],\"isDefault\":\"1\"},{\"skuId\":\"76\",\"state\":\"1\",\"price\":\"13.00\",\"rules\":[{\"price\":\"1\",\"ruleId\":\"56\",\"specId\":\"46\"},{\"price\":\"0\",\"ruleId\":\"53\",\"specId\":\"45\"},{\"price\":\"2\",\"ruleId\":\"51\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"77\",\"state\":\"1\",\"price\":\"14.00\",\"rules\":[{\"price\":\"2\",\"ruleId\":\"57\",\"specId\":\"46\"},{\"price\":\"0\",\"ruleId\":\"53\",\"specId\":\"45\"},{\"price\":\"2\",\"ruleId\":\"51\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"78\",\"state\":\"1\",\"price\":\"12.00\",\"rules\":[{\"price\":\"0\",\"ruleId\":\"55\",\"specId\":\"46\"},{\"price\":\"1\",\"ruleId\":\"54\",\"specId\":\"45\"},{\"price\":\"2\",\"ruleId\":\"51\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"79\",\"state\":\"1\",\"price\":\"13.00\",\"rules\":[{\"price\":\"1\",\"ruleId\":\"56\",\"specId\":\"46\"},{\"price\":\"1\",\"ruleId\":\"54\",\"specId\":\"45\"},{\"price\":\"2\",\"ruleId\":\"51\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"80\",\"state\":\"1\",\"price\":\"14.00\",\"rules\":[{\"price\":\"2\",\"ruleId\":\"57\",\"specId\":\"46\"},{\"price\":\"1\",\"ruleId\":\"54\",\"specId\":\"45\"},{\"price\":\"2\",\"ruleId\":\"51\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"81\",\"state\":\"1\",\"price\":\"12.00\",\"rules\":[{\"price\":\"0\",\"ruleId\":\"55\",\"specId\":\"46\"},{\"price\":\"0\",\"ruleId\":\"53\",\"specId\":\"45\"},{\"price\":\"1\",\"ruleId\":\"52\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"82\",\"state\":\"1\",\"price\":\"13.00\",\"rules\":[{\"price\":\"1\",\"ruleId\":\"56\",\"specId\":\"46\"},{\"price\":\"0\",\"ruleId\":\"53\",\"specId\":\"45\"},{\"price\":\"1\",\"ruleId\":\"52\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"83\",\"state\":\"1\",\"price\":\"14.00\",\"rules\":[{\"price\":\"2\",\"ruleId\":\"57\",\"specId\":\"46\"},{\"price\":\"0\",\"ruleId\":\"53\",\"specId\":\"45\"},{\"price\":\"1\",\"ruleId\":\"52\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"84\",\"state\":\"1\",\"price\":\"12.00\",\"rules\":[{\"price\":\"0\",\"ruleId\":\"55\",\"specId\":\"46\"},{\"price\":\"1\",\"ruleId\":\"54\",\"specId\":\"45\"},{\"price\":\"1\",\"ruleId\":\"52\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"85\",\"state\":\"1\",\"price\":\"13.00\",\"rules\":[{\"price\":\"1\",\"ruleId\":\"56\",\"specId\":\"46\"},{\"price\":\"1\",\"ruleId\":\"54\",\"specId\":\"45\"},{\"price\":\"1\",\"ruleId\":\"52\",\"specId\":\"44\"}],\"isDefault\":\"0\"},{\"skuId\":\"86\",\"state\":\"1\",\"price\":\"14.00\",\"rules\":[{\"price\":\"2\",\"ruleId\":\"57\",\"specId\":\"46\"},{\"price\":\"1\",\"ruleId\":\"54\",\"specId\":\"45\"},{\"price\":\"1\",\"ruleId\":\"52\",\"specId\":\"44\"}],\"isDefault\":\"0\"}],\"discount\":\"12.00\",\"pics\":null,\"desc\":\"樱花初绽拿铁\",\"remarks\":\"樱花初绽拿铁\",\"tags\":[],\"specs\":[{\"rules\":[{\"isDefault\":\"1\",\"isRecommend\":\"0\",\"price\":\"2\",\"ruleId\":\"51\",\"ruleName\":\"冰\"},{\"isDefault\":\"0\",\"isRecommend\":\"0\",\"price\":\"1\",\"ruleId\":\"52\",\"ruleName\":\"热\"}],\"specId\":\"44\",\"specName\":\"温度\"},{\"rules\":[{\"isDefault\":\"1\",\"isRecommend\":\"0\",\"price\":\"0\",\"ruleId\":\"53\",\"ruleName\":\"不加奶\"},{\"isDefault\":\"0\",\"isRecommend\":\"0\",\"price\":\"1\",\"ruleId\":\"54\",\"ruleName\":\"正常奶\"}],\"specId\":\"45\",\"specName\":\"加奶\"},{\"rules\":[{\"isDefault\":\"1\",\"isRecommend\":\"0\",\"price\":\"0\",\"ruleId\":\"55\",\"ruleName\":\"不加糖\"},{\"isDefault\":\"0\",\"isRecommend\":\"0\",\"price\":\"1\",\"ruleId\":\"56\",\"ruleName\":\"半塘\"},{\"isDefault\":\"0\",\"isRecommend\":\"0\",\"price\":\"2\",\"ruleId\":\"57\",\"ruleName\":\"标准糖\"}],\"specId\":\"46\",\"specName\":\"糖度\"}]}}]}";
MainData mainData = JSON.parseObject(obj.toString(), MainData.class);
HLApplication.setMainData(mainData);
mainDataChanged();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Datas.leftImages = Arrays.asList("https://pica.zhimg.com/v2-58b94c8a9f73bd03bcfcee48eabb3e48_r.jpg?source=1940ef5c");
RightImage ri1 = new RightImage(ImageState.CLOSED.getCode(), "https://img.zcool.cn/community/019f785c7534dea801203d22289e28.jpg?x-oss-process=image/auto-orient,1/resize,m_lfit,w_1280,limit_1/sharpen,100/format,webp/quality,Q_100");
RightImage ri2 = new RightImage(ImageState.COOKING.getCode(), "https://img.zcool.cn/community/0104715c7534e0a801203d22550951.jpg?x-oss-process=image/auto-orient,1/resize,m_lfit,w_1280,limit_1/sharpen,100/format,webp/quality,Q_100");
RightImage ri3 = new RightImage(ImageState.COMPLETED.getCode(), "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic22.nipic.com%2F20120724%2F7703499_142358766000_2.jpg&refer=http%3A%2F%2Fpic22.nipic.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1654422124&t=7b541148ac96856045e7ba4926fb7118");
RightImage ri4 = new RightImage(ImageState.NOT_COMPLETED.getCode(), "https://img2.baidu.com/it/u=4238520002,1692791254&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=366");
Datas.rightImages = Arrays.asList(ri1, ri2, ri3, ri4);
private void mainDataChanged() {
setRecommendsData();
initCategorys();
setGoodsData();
if (menu != null) {
menu.mainDataChanged();
}
}
@Override
protected void onDestroy() {
super.onDestroy();
this.unregisterTrolleyReceiver();
this.unregistTrolleyReceiver();
}
private TrolleyReceiver trolleyReceiver = null;
private void registerdTrolleyReceiver() {
private void registTrolleyReceiver() {
if (trolleyReceiver == null) {
trolleyReceiver = new TrolleyReceiver();
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(Base.ADD_GOODS_ACTION);
intentFilter.addAction(Base.GOODS_CHANGED_ACTION);
intentFilter.addAction(Base.CLEAR_GOODS_ACTION);
this.registerReceiver(trolleyReceiver, intentFilter);
}
}
private void unregisterTrolleyReceiver() {
private void unregistTrolleyReceiver() {
if (trolleyReceiver != null) {
this.unregisterReceiver(trolleyReceiver);
trolleyReceiver = null;
......@@ -359,4 +356,20 @@ public class LauncherActivity extends Activity {
}
}
}
private void requestPermissions() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
requestPermissions(new String[]{Manifest.permission.READ_PHONE_STATE, Manifest.permission.WRITE_EXTERNAL_STORAGE}, 100);
}
}
private void showMenuView() {
DisplayManager displayManager = (DisplayManager) getSystemService(Context.DISPLAY_SERVICE);
Display[] displays = displayManager.getDisplays();
if (CollectionUtils.isEmpty(displays) || displays.length < 2) {
return;
}
menu = new MenuPresentation(this, displays[1]);
menu.show();
}
}
......@@ -14,19 +14,19 @@ import androidx.annotation.NonNull;
import com.alibaba.fastjson2.JSON;
import com.bumptech.glide.Glide;
import com.ihaoin.hooloo.device.HLApplication;
import com.ihaoin.hooloo.device.R;
import com.ihaoin.hooloo.device.adapter.OrderAdapter;
import com.ihaoin.hooloo.device.component.NetworkHandler;
import com.ihaoin.hooloo.device.component.PushMessageReceiver;
import com.ihaoin.hooloo.device.config.Base;
import com.ihaoin.hooloo.device.data.Datas;
import com.ihaoin.hooloo.device.data.enums.ImageState;
import com.ihaoin.hooloo.device.data.enums.OrderState;
import com.ihaoin.hooloo.device.data.vo.Order;
import com.ihaoin.hooloo.device.data.vo.OrderPkg;
import com.ihaoin.hooloo.device.data.vo.RightImage;
import com.ihaoin.hooloo.device.network.HttpUtil;
import com.ihaoin.hooloo.device.util.CollectionUtils;
import com.ihaoin.hooloo.device.util.StringUtils;
import java.util.List;
import java.util.Map;
......@@ -82,38 +82,42 @@ public class MenuPresentation extends Presentation {
gridCompleted.setAdapter(completedAdapter);
}
private String getImage(Integer state) {
if (CollectionUtils.isEmpty(Datas.rightImages)) {
private String getRightImage(String state) {
if (HLApplication.getMainData() == null || HLApplication.getMainData().getImages() == null) {
return null;
}
for (RightImage image : Datas.rightImages) {
if (image.getState().equals(state)) {
return image.getUrl();
}
if (CollectionUtils.isEmpty(HLApplication.getMainData().getImages().getRight())) {
return null;
}
return null;
return HLApplication.getMainData().getImages().getRight().get(state);
}
private void showImages() {
if (!CollectionUtils.isEmpty(Datas.leftImages)) {
Glide.with(getContext()).load(Datas.leftImages.get(0)).into(imgLeft);
if (HLApplication.getMainData() == null || HLApplication.getMainData().getImages() == null) {
return;
}
if (!StringUtils.isEmpty(HLApplication.getMainData().getImages().getLeft())) {
Glide.with(getContext()).load(HLApplication.getMainData().getImages().getLeft()).into(imgLeft);
}
if (Datas.SHOP_STATE.equals(0)) {
Glide.with(getContext()).load(getImage(ImageState.CLOSED.getCode())).into(imgRight);
if (HLApplication.getMainData().getShopState().equals(0)) {
Glide.with(getContext()).load(getRightImage(ImageState.CLOSED.getCode())).into(imgRight);
} else if (!CollectionUtils.isEmpty(cookingOrders)) {
Glide.with(getContext()).load(getImage(ImageState.COOKING.getCode())).into(imgRight);
Glide.with(getContext()).load(getRightImage(ImageState.COOKING.getCode())).into(imgRight);
} else if (!CollectionUtils.isEmpty(completedOrders)) {
Glide.with(getContext()).load(getImage(ImageState.COMPLETED.getCode())).into(imgRight);
Glide.with(getContext()).load(getRightImage(ImageState.COMPLETED.getCode())).into(imgRight);
} else {
Glide.with(getContext()).load(getImage(ImageState.NOT_COMPLETED.getCode())).into(imgRight);
Glide.with(getContext()).load(getRightImage(ImageState.NOT_COMPLETED.getCode())).into(imgRight);
}
}
public void mainDataChanged() {
showImages();
}
private void loadDatas() {
loadOrdersHandler = new LoadOrdersHandler(getContext());
String requestParams = "";
HttpUtil.getOrders(requestParams, loadOrdersHandler);
HttpUtil.getOrders(loadOrdersHandler);
}
private void setDatas(String json) {
......@@ -132,10 +136,10 @@ public class MenuPresentation extends Presentation {
completedAdapter.notifyDataSetChanged();
showImages();
regsiterOrderChangeListener();
regsitOrderChangeListener();
}
private void regsiterOrderChangeListener() {
private void regsitOrderChangeListener() {
orderStateChangeHandler = new OrderStateChangeHandler();
PushMessageReceiver.subscribe(Base.NOTIFY_ACTION_ORDER_STATE_CHANGED, orderStateChangeHandler);
}
......
......@@ -6,13 +6,14 @@ import android.content.pm.PackageInfo;
import android.os.Bundle;
import android.view.View;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.ToggleButton;
import com.ihaoin.hooloo.device.R;
import com.ihaoin.hooloo.device.config.AppConfig;
import com.ihaoin.hooloo.device.util.SharedPreferencesUtils;
import com.ihaoin.hooloo.device.util.StringUtils;
import com.ihaoin.hooloo.device.util.Utils;
public class SettingsActivity extends Activity {
......@@ -51,19 +52,18 @@ public class SettingsActivity extends Activity {
butnClose.setOnClickListener(v -> finish());
layoutScreen.setOnClickListener(v -> showEditScreen());
layoutSysSettings.setOnClickListener(v -> Utils.openSystemSettings(getApplicationContext()));
}
private void showEditScreen() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("修改点单屏编码");
EditText editText = new EditText(getApplicationContext());
editText.setText(SharedPreferencesUtils.getScreenNo(SettingsActivity.this));
builder.setView(editText);
builder.setPositiveButton("确定", (dialog, which) -> {
SharedPreferencesUtils.setScreenNo(SettingsActivity.this, editText.getText().toString());
String[] items = new String[]{"A", "B"};
builder.setSingleChoiceItems(items, StringUtils.indexOf(items, SharedPreferencesUtils.getScreenNo(SettingsActivity.this)), (dialog, which) -> {
SharedPreferencesUtils.setScreenNo(SettingsActivity.this, items[which]);
txtScreenNo.setText(SharedPreferencesUtils.getScreenNo(SettingsActivity.this));
dialog.dismiss();
});
builder.setNegativeButton("取消", null);
builder.create().show();
}
......
......@@ -10,8 +10,9 @@ import android.webkit.WebViewClient;
import androidx.annotation.NonNull;
import com.ihaoin.hooloo.device.HLApplication;
import com.ihaoin.hooloo.device.R;
import com.ihaoin.hooloo.device.data.Datas;
import com.ihaoin.hooloo.device.util.StringUtils;
public class TipsDialog extends Dialog {
private View butnClose;
......@@ -25,6 +26,10 @@ public class TipsDialog extends Dialog {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setContentView(R.layout.view_tips);
if (HLApplication.getMainData() == null || StringUtils.isEmpty(HLApplication.getMainData().getTips())) {
dismiss();
return;
}
initViews();
}
......@@ -38,7 +43,7 @@ public class TipsDialog extends Dialog {
return false;
}
});
webView.loadUrl(Datas.tips);
webView.loadUrl(HLApplication.getMainData().getTips());
butnClose.setOnClickListener(x -> dismiss());
}
}
package com.ihaoin.hooloo.device.view;
import android.content.Context;
import android.os.Handler;
import android.os.Message;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
......@@ -12,12 +14,14 @@ import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import com.ihaoin.hooloo.device.HLApplication;
import com.ihaoin.hooloo.device.R;
import com.ihaoin.hooloo.device.adapter.TrolleyAdapter;
import com.ihaoin.hooloo.device.data.Datas;
import com.ihaoin.hooloo.device.data.TrolleyGoods;
import com.ihaoin.hooloo.device.data.vo.Goods;
import com.ihaoin.hooloo.device.data.vo.Sku;
import com.ihaoin.hooloo.device.data.TrolleyGoods;
import com.ihaoin.hooloo.device.util.RandomUtils;
import com.ihaoin.hooloo.device.util.Utils;
......@@ -67,11 +71,15 @@ public class TrolleyView extends RelativeLayout {
}
public void addGoods(Goods goods, Sku sku, Integer count) {
if (getCount() >= Datas.COUNT_OF_ORDER) {
Toast.makeText(this.getContext(), getContext().getString(R.string.count_limit, Datas.COUNT_OF_ORDER.toString()), Toast.LENGTH_SHORT).show();
if (!checkSkuState(sku.getSkuId())) {
Toast.makeText(this.getContext(), R.string.error_sku_state, Toast.LENGTH_SHORT).show();
return;
}
Optional<TrolleyGoods> optional = this.trolleyGoods.stream().filter(x -> x.getGoodId().equals(goods.getGoodId()) && x.getSkuId().equals(sku.getSkuId())).findAny();
if (getCount() >= HLApplication.getMainData().getCountOfOrder()) {
Toast.makeText(this.getContext(), getContext().getString(R.string.count_limit, HLApplication.getMainData().getCountOfOrder().toString()), Toast.LENGTH_SHORT).show();
return;
}
Optional<TrolleyGoods> optional = this.trolleyGoods.stream().filter(x -> x.getGoodId().equals(goods.getGoodsId()) && x.getSkuId().equals(sku.getSkuId())).findAny();
// 判断是否在购物车里存在同样规格的产品
if (optional.isPresent()) {
TrolleyGoods g = optional.get();
......@@ -80,7 +88,7 @@ public class TrolleyView extends RelativeLayout {
TrolleyGoods g = new TrolleyGoods();
g.setId(RandomUtils.nextLong(trolleyGoods.stream().map(TrolleyGoods::getId).collect(Collectors.toList())));
g.setChecked(true);
g.setGoodId(goods.getGoodId());
g.setGoodId(goods.getGoodsId());
g.setName(goods.getName());
g.setDesc(goods.getDesc());
g.setPics(goods.getPics());
......@@ -99,15 +107,23 @@ public class TrolleyView extends RelativeLayout {
}
public void addGoods(Integer position) {
if (getCount() >= Datas.COUNT_OF_ORDER) {
Toast.makeText(this.getContext(), getContext().getString(R.string.count_limit, Datas.COUNT_OF_ORDER.toString()), Toast.LENGTH_SHORT).show();
if (getCount() >= HLApplication.getMainData().getCountOfOrder()) {
Toast.makeText(this.getContext(), getContext().getString(R.string.count_limit, HLApplication.getMainData().getCountOfOrder().toString()), Toast.LENGTH_SHORT).show();
return;
}
TrolleyGoods goods = this.trolleyGoods.get(position);
if (!checkSkuState(goods.getSkuId())) {
Toast.makeText(this.getContext(), R.string.error_sku_state, Toast.LENGTH_SHORT).show();
return;
}
goods.setCount(goods.getCount() + 1);
this.goodsChanged();
}
private boolean checkSkuState(Integer skuId) {
return true;
}
public void subtractGoods(Integer position) {
TrolleyGoods goods = this.trolleyGoods.get(position);
if (goods.getCount() <= 1) {
......@@ -127,8 +143,8 @@ public class TrolleyView extends RelativeLayout {
}
public Boolean checkGoodsCount() {
if (getCount() > Datas.COUNT_OF_ORDER) {
Toast.makeText(this.getContext(), getContext().getString(R.string.count_limit, Datas.COUNT_OF_ORDER.toString()), Toast.LENGTH_SHORT).show();
if (getCount() > HLApplication.getMainData().getCountOfOrder()) {
Toast.makeText(this.getContext(), getContext().getString(R.string.count_limit, HLApplication.getMainData().getCountOfOrder().toString()), Toast.LENGTH_SHORT).show();
return false;
}
return true;
......@@ -254,6 +270,13 @@ public class TrolleyView extends RelativeLayout {
Utils.showConfirmOrder(getContext(), trolleyGoods);
}
class CheckSkuStateHandler extends Handler {
@Override
public void handleMessage(@NonNull Message msg) {
}
}
public TrolleyView(Context context) {
super(context);
init();
......
......@@ -42,4 +42,5 @@
android:id="@+id/view_trolley"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</RelativeLayout>
\ No newline at end of file
......@@ -8,7 +8,7 @@
android:id="@+id/img_left"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_weight="1.3"
android:adjustViewBounds="true"
android:scaleType="centerCrop" />
<LinearLayout
......
......@@ -98,6 +98,7 @@
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/layout_operate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
......@@ -125,8 +126,18 @@
android:layout_height="20dp"
android:background="@drawable/ic_add" />
</LinearLayout>
<TextView
android:id="@+id/txt_sellout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="已售罄"
android:textColor="@color/textRed"
android:textSize="12sp"
android:visibility="gone" />
</LinearLayout>
<LinearLayout
android:id="@+id/layout_butns"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
......
......@@ -8,4 +8,6 @@
<string name="error_choose_spec">请选择规格</string>
<string name="error_choose_goods">请选择商品</string>
<string name="error_price">商品金额错误</string>
<string name="error_sku_state">本商品已售罄或已经下架</string>
<string name="error_load_main_data">获取数据失败</string>
</resources>
package com.chad.library.adapter.base.animation
import android.animation.Animator
......
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