依赖
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.github.bumptech.glide:glide:4.9.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.mcxiaoke.volley:library:1.0.19'
implementation 'com.github.xiaohaibin:XBanner:1.6.4'(maven { url 'https://jitpack.io' })
展示布局
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#d4facece"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="60dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/imageView_home_left"
android:layout_width="60dp"
android:layout_height="60dp"
android:background="@drawable/bleak_one" />
<EditText
android:id="@+id/edit_home"
android:layout_width="0dp"
android:layout_height="60dp"
android:layout_weight="1"
android:hint="请输入您想查找的商品" />
<ImageView
android:id="@+id/imageView_home_right"
android:layout_width="60dp"
android:layout_height="60dp"
android:background="@drawable/pink_one" />
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/recy"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"></android.support.v7.widget.RecyclerView>
</LinearLayout>
展示页面
package com.bawei.lmx.day13_2.fragment;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Toast;
import com.android.volley.VolleyError;
import com.bawei.lmx.day13_2.ChaxunActivity;
import com.bawei.lmx.day13_2.HttpVolley;
import com.bawei.lmx.day13_2.LayoutState;
import com.bawei.lmx.day13_2.R;
import com.bawei.lmx.day13_2.adapter.GridAdapter;
import com.bawei.lmx.day13_2.adapter.UrlAdapter;
import com.bawei.lmx.day13_2.bean.UrlBean;
import com.bawei.lmx.day13_2.mvp.Contract.IView;
import com.bawei.lmx.day13_2.mvp.Presenter;
import com.google.gson.Gson;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.List;
public class Home extends Fragment implements IView {
private EditText edit_home;
private ImageView imageView_home_left;
String Url = "http://172.17.8.100/small/commodity/v1/findCommodityByKeyword?page=1&count=71&keyword=";
private RecyclerView recy;
private Presenter presenter;
private List<UrlBean.ResultBean> result;
private String encode;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.home, container, false);
edit_home = view.findViewById(R.id.edit_home);
recy = view.findViewById(R.id.recy);
imageView_home_left = view.findViewById(R.id.imageView_home_left);
presenter = new Presenter();
presenter.attch(this);
presenter.login(Url + "1");
edit_home.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(getActivity(), ChaxunActivity.class);
startActivityForResult(intent, 1);
}
});
imageView_home_left.setOnClickListener(new View.OnClickListener() {
private GridAdapter gridAdapter;
@Override
public void onClick(View v) {
boolean state = LayoutState.getLayoutstate(getActivity(), "state");
if (state) {
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());
linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
recy.setLayoutManager(linearLayoutManager);
UrlAdapter urlAdapter = new UrlAdapter(getActivity(), result);
recy.setAdapter(urlAdapter);
Toast.makeText(getActivity(), "listviewչʾ", Toast.LENGTH_SHORT).show();
LayoutState.setLayoutstate(getActivity(), "state", !state);
} else {
GridLayoutManager gridLayoutManager = new GridLayoutManager(getActivity(), 2);
recy.setLayoutManager(gridLayoutManager);
gridAdapter = new GridAdapter(getActivity(), result);
recy.setAdapter(gridAdapter);
Toast.makeText(getActivity(), "gridviewչʾ", Toast.LENGTH_SHORT).show();
LayoutState.setLayoutstate(getActivity(), "state", !state);
}
}
});
return view;
}
@Override
public void getPreData(String data) {
Gson gson = new Gson();
UrlBean urlBean = gson.fromJson(data, UrlBean.class);
result = urlBean.getResult();
Log.i("TRE", "getPreData: " + urlBean.getMessage());
Toast.makeText(getActivity(), urlBean.getMessage(), Toast.LENGTH_SHORT).show();
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());
linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
recy.setLayoutManager(linearLayoutManager);
UrlAdapter urlAdapter = new UrlAdapter(getActivity(), result);
recy.setAdapter(urlAdapter);
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 1 || resultCode == 2) {
if (data != null) {
String value = data.getStringExtra("value");
Toast.makeText(getContext(), value, Toast.LENGTH_SHORT).show();
try {
encode = URLEncoder.encode(value, "UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
presenter.login(Url + encode);
}
}
}
@Override
public void onDetach() {
super.onDetach();
}
}
LayoutState
package com.bawei.lmx.day13_2;
import android.content.Context;
import android.content.SharedPreferences;
public class LayoutState {
public static void setLayoutstate(Context context, String key, boolean value) {
if (context != null) {
SharedPreferences sp = context.getSharedPreferences("layoutstate", Context.MODE_PRIVATE);
SharedPreferences.Editor edit = sp.edit();
edit.putBoolean(key, value);
edit.commit();
}
}
public static boolean getLayoutstate(Context context, String key) {
if (context != null) {
SharedPreferences sp = context.getSharedPreferences("layoutstate", Context.MODE_PRIVATE);
boolean spBoolean = sp.getBoolean(key, false);
return spBoolean;
}
return false;
}
}
UrlAdapter
package com.bawei.lmx.day13_2.adapter;
import android.content.Context;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v4.app.FragmentActivity;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.bawei.lmx.day13_2.R;
import com.bawei.lmx.day13_2.XiangqingActivity;
import com.bawei.lmx.day13_2.bean.UrlBean;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import java.util.List;
public class UrlAdapter extends RecyclerView.Adapter<UrlAdapter.ViewHolder> {
Context context;
List<UrlBean.ResultBean> result;
public UrlAdapter(Context context, List<UrlBean.ResultBean> result) {
this.context = context;
this.result = result;
}
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
View inflate = LayoutInflater.from(context).inflate(R.layout.url_item, viewGroup, false);
return new ViewHolder(inflate);
}
@Override
public void onBindViewHolder(@NonNull ViewHolder viewHolder, int i) {
viewHolder.name.setText(result.get(i).getCommodityName());
viewHolder.price.setText("¥" + result.get(i).getPrice() + "");
Glide.with(context).load(result.get(i).getMasterPic())
.apply(RequestOptions.centerCropTransform()).into(viewHolder.imageView);
final int cid = result.get(i).getCommodityId();
viewHolder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(context, XiangqingActivity.class);
intent.putExtra("cid", cid);
context.startActivity(intent);
}
});
}
@Override
public int getItemCount() {
return result.size();
}
public class ViewHolder extends RecyclerView.ViewHolder {
private final ImageView imageView;
private final TextView name, price;
public ViewHolder(@NonNull View itemView) {
super(itemView);
imageView = itemView.findViewById(R.id.imageView_url_item);
name = itemView.findViewById(R.id.name_url_item);
price = itemView.findViewById(R.id.price_url_item);
}
}
}
GridAdapter
package com.bawei.lmx.day13_2.adapter;
import android.content.Context;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v4.app.FragmentActivity;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.bawei.lmx.day13_2.R;
import com.bawei.lmx.day13_2.XiangqingActivity;
import com.bawei.lmx.day13_2.bean.UrlBean;
import com.bumptech.glide.Glide;
import java.util.List;
public class GridAdapter extends RecyclerView.Adapter<GridAdapter.ViewHolder> {
Context context;
List<UrlBean.ResultBean> result;
public GridAdapter(Context context, List<UrlBean.ResultBean> result) {
this.context = context;
this.result = result;
}
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
View inflate = LayoutInflater.from(context).inflate(R.layout.grid_item, viewGroup, false);
return new ViewHolder(inflate);
}
@Override
public void onBindViewHolder(@NonNull ViewHolder viewHolder, int i) {
viewHolder.name.setText(result.get(i).getCommodityName());
viewHolder.price.setText("¥" + result.get(i).getPrice() + "");
Glide.with(context).load(result.get(i).getMasterPic()).into(viewHolder.imageView);
final int cid = result.get(i).getCommodityId();
viewHolder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(context, XiangqingActivity.class);
intent.putExtra("cid", cid);
context.startActivity(intent);
}
});
}
@Override
public int getItemCount() {
return result.size();
}
public class ViewHolder extends RecyclerView.ViewHolder {
private final ImageView imageView;
private final TextView name, price;
public ViewHolder(@NonNull View itemView) {
super(itemView);
imageView = itemView.findViewById(R.id.imageView_grid_item);
name = itemView.findViewById(R.id.name_grid_item);
price = itemView.findViewById(R.id.price_grid_item);
}
}
}
url_item
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="@+id/imageView_url_item"
android:layout_width="120dp"
android:layout_height="120dp"
android:padding="10dp" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="120dp"
android:layout_marginLeft="20dp"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/name_url_item"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center"
android:textSize="24sp" />
<TextView
android:id="@+id/price_url_item"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:textColor="#FF3B3C"
android:gravity="center_vertical"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>
grid_item
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="vertical">
<ImageView
android:id="@+id/imageView_grid_item"
android:layout_width="120dp"
android:layout_height="160dp"
android:padding="10dp" />
<TextView
android:id="@+id/name_grid_item"
android:layout_width="match_parent"
android:layout_height="80dp"
android:gravity="center"
android:textSize="24sp" />
<TextView
android:id="@+id/price_grid_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:textColor="#FF3B3C"
android:textSize="20sp" />
</LinearLayout>
linearlayout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<ImageView
android:id="@+id/imageView_linear_left"
android:layout_width="60dp"
android:layout_height="60dp"
android:src="@drawable/fanhui" />
<EditText
android:id="@+id/edit_linear"
android:layout_width="0dp"
android:layout_height="60dp"
android:layout_weight="1" />
<ImageView
android:id="@+id/imageView_linear_right"
android:layout_width="60dp"
android:layout_height="60dp"
android:background="@drawable/tianjia" />
<ImageView
android:id="@+id/imageView_linear_chaxun"
android:layout_width="60dp"
android:layout_height="60dp"
android:background="@drawable/pink_one" />
</LinearLayout>
CliearLayout
package com.bawei.lmx.day13_2.cliear;
import android.content.Context;
import android.content.Intent;
import android.util.AttributeSet;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.Toast;
import com.bawei.lmx.day13_2.R;
public class CliearLayout extends LinearLayout {
private ImageView imageView_linear_left;
private EditText edit_linear;
Call call;
private ImageView imageView_linear_right;
public CliearLayout(Context context) {
this(context, null);
}
public CliearLayout(Context context, AttributeSet attrs) {
this(context, attrs, 2);
}
public CliearLayout(final Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
View inflate = inflate(context, R.layout.linearlayout, this);
imageView_linear_left = inflate.findViewById(R.id.imageView_linear_left);
imageView_linear_right = inflate.findViewById(R.id.imageView_linear_right);
edit_linear = inflate.findViewById(R.id.edit_linear);
imageView_linear_right.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (call != null) {
String trim = edit_linear.getText().toString().trim();
call.result(trim);
} else {
Toast.makeText(context, "输入内容不能为空", Toast.LENGTH_SHORT).show();
}
}
});
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
measureChildren(widthMeasureSpec, heightMeasureSpec);
}
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
int width = r - l;
int x = 0;
int y = 0;
int row = 1;
int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
View childAt = getChildAt(i);
x += childAt.getMeasuredWidth();
if (x > width) {
x = childAt.getMeasuredWidth();
row++;
}
y = row * childAt.getMeasuredHeight();
childAt.layout(x - childAt.getMeasuredWidth(), y - childAt.getMeasuredHeight(), x, y);
}
}
public void setCall(Call call) {
this.call = call;
}
public interface Call {
void result(String message);
}
}
activity_chaxun
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".ChaxunActivity">
<com.bawei.lmx.day13_2.cliear.CliearLayout
android:id="@+id/cliearx"
android:layout_width="match_parent"
android:layout_height="200dp"></com.bawei.lmx.day13_2.cliear.CliearLayout>
</LinearLayout>
ChaxunActivity
package com.bawei.lmx.day13_2;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.bawei.lmx.day13_2.cliear.CliearLayout;
public class ChaxunActivity extends AppCompatActivity {
private CliearLayout cliearx;
private ImageView fanhui;
private static final String TAG = "ChaxunActivity";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_chaxun);
fanhui = findViewById(R.id.imageView_linear_left);
fanhui.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
cliearx = findViewById(R.id.cliearx);
cliearx.setCall(new CliearLayout.Call() {
@Override
public void result(final String message) {
if (!TextUtils.isEmpty(message)) {
TextView textView = new TextView(ChaxunActivity.this);
textView.setText(message);
textView.setTextSize(22);
textView.setTextColor(R.drawable.pink_one);
cliearx.addView(textView);
Log.i(TAG, "result: " + message);
textView.setPadding(20, 20, 20, 20);
Toast.makeText(ChaxunActivity.this, message, Toast.LENGTH_SHORT).show();
cliearx.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = getIntent();
intent.putExtra("value", message);
setResult(2, intent);
finish();
}
});
} else {
Toast.makeText(ChaxunActivity.this, "输入内容不能为空", Toast.LENGTH_SHORT).show();
}
}
});
}
}
activity_xiangqing
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".XiangqingActivity">
<ImageView
android:id="@+id/fanhui_xiangqing"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/fanhui_xq" />
<com.stx.xhb.xbanner.XBanner
android:id="@+id/xbanner"
android:layout_width="match_parent"
android:layout_height="200dp" />
<TextView
android:id="@+id/price_xiangqing"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textColor="#FE3234"
android:textSize="24sp" />
<TextView
android:id="@+id/name_xiangqing"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textSize="20sp" />
<com.bawei.lmx.day13_2.cliear.linea
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"></com.bawei.lmx.day13_2.cliear.linea>
</LinearLayout>
XiangqingActivity
package com.bawei.lmx.day13_2;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.android.volley.VolleyError;
import com.bawei.lmx.day13_2.bean.DedailsBean;
import com.bawei.lmx.day13_2.bean.UrlBean;
import com.bumptech.glide.Glide;
import com.google.gson.Gson;
import com.stx.xhb.xbanner.XBanner;
import java.util.ArrayList;
import java.util.List;
public class XiangqingActivity extends AppCompatActivity {
private XBanner xbanner;
private TextView name;
private TextView price;
private static final String TAG = "XiangqingActivity";
String Xbannerurl = "http://172.17.8.100/small/commodity/v1/findCommodityDetailsById?commodityId=";
private ImageView fanhui_xq;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_xiangqing);
xbanner = findViewById(R.id.xbanner);
name = findViewById(R.id.name_xiangqing);
price = findViewById(R.id.price_xiangqing);
fanhui_xq = findViewById(R.id.fanhui_xiangqing);
fanhui_xq.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
Intent intent = getIntent();
final int cid = intent.getIntExtra("cid", 0);
Log.d(TAG, "onCreate: " + cid);
HttpVolley.getInstance().VolleyHttpGet(Xbannerurl + cid, new HttpVolley.VolleyCallBack() {
private String[] split;
private DedailsBean.ResultBean result;
@Override
public void onSuccess(String data) {
Log.d(TAG, "onSuccess: " + data);
Gson gson = new Gson();
DedailsBean dedailsBean = gson.fromJson(data, DedailsBean.class);
result = dedailsBean.getResult();
name.setText(result.getCommodityName());
price.setText("¥" + result.getPrice() + "");
split = result.getPicture().split(",");
final List<String> list = new ArrayList<>();
for (int i = 0; i < split.length; i++) {
list.add(split[i]);
}
xbanner.setData(list, null);
xbanner.loadImage(new XBanner.XBannerAdapter() {
@Override
public void loadBanner(XBanner banner, Object model, View view, int position) {
Glide.with(XiangqingActivity.this).load(list.get(position)).into((ImageView) view);
}
});
}
@Override
public void onFail(VolleyError error) {
}
});
}
}
UlBean
package com.bawei.lmx.day13_2.bean;
import java.util.List;
public class UrlBean {
/**
* result : [{"commodityId":121,"commodityName":"佳能(Canon)EOS 3000D 入门级数码单反相机18-55mm IS II防抖镜头套装 32G内存卡 备用电池 三脚架摄影包等礼包版","masterPic":"http://172.17.8.100/images/small/commodity/sjsm/zxj/1/1.jpg","price":3099,"saleNum":0},{"commodityId":134,"commodityName":"四季沐歌MicoeM-ZN108X智能马桶智能马桶 一体式智能多功能冲洗加温座便器 305/400坑距","masterPic":"http://172.17.8.100/images/small/commodity/sjsm/znsb/7/1.jpg","price":2398,"saleNum":0},{"commodityId":182,"commodityName":"美国妮可米勒拉杆箱 炫彩轻盈旅行箱 男女旅游商务硬箱 万向轮登机箱行李箱 20英寸白色 N4635-10-20S","masterPic":"http://172.17.8.100/images/small/commodity/xbsd/lgx/6/1.jpg","price":699,"saleNum":0},{"commodityId":128,"commodityName":"儿童人工智能机器人玩具语音对话早教第五代学习机3-6-12岁高科技遥控教育语音聊天对话会跳舞的智能机器人","masterPic":"http://172.17.8.100/images/small/commodity/sjsm/znsb/1/1.jpg","price":689,"saleNum":0},{"commodityId":175,"commodityName":"倍晶 苹果微软联想惠普华硕戴尔宏基笔记本电脑包13英寸内胆14手提15单肩15.6小新11保护套 粉红色手提包+同色电源小包 15.6英寸","masterPic":"http://172.17.8.100/images/small/commodity/xbsd/dnb/6/1.jpg","price":119,"saleNum":0},{"commodityId":113,"commodityName":"闪充充电器 9V-2A快充 适用 X21/X20/X9s/X9sPlus/X9/XPlay6/Xplay5/X7/X7Plus","masterPic":"http://172.17.8.100/images/small/commodity/sjsm/sjpj/7/1.jpg","price":85,"saleNum":0},{"commodityId":124,"commodityName":"台湾AC5高清4K摄像机数码DV12倍光学变焦专业家用旅游","masterPic":"http://172.17.8.100/images/small/commodity/sjsm/zxj/4/1.jpg","price":1998,"saleNum":0},{"commodityId":171,"commodityName":"HOTBOOM2018男士双肩包休闲背包潮流学生书包多功能笔记本商务14英寸电脑包5606 时尚灰","masterPic":"http://172.17.8.100/images/small/commodity/xbsd/dnb/2/1.jpg","price":109,"saleNum":0},{"commodityId":186,"commodityName":"SWISSGEAR双肩包 防水多功能笔记本电脑包14.6英寸/15.6英寸商务背包男学生书包休闲 SA-9393III","masterPic":"http://172.17.8.100/images/small/commodity/xbsd/sjb/3/1.jpg","price":99,"saleNum":0},{"commodityId":88,"commodityName":"冬新品 梵希蔓毛呢外套女短款长袖2018冬季新款宽松英伦格子翻领斜门襟大衣女","masterPic":"http://172.17.8.100/images/small/commodity/nz/wt/3/1.jpg","price":358,"saleNum":0},{"commodityId":118,"commodityName":" 新款 iPad 128G WIFI 版 平板电脑","masterPic":"http://172.17.8.100/images/small/commodity/sjsm/yyyl/5/1.jpg","price":2988,"saleNum":0},{"commodityId":132,"commodityName":"10升不锈钢智能垃圾桶 时尚香槟金感应收纳桶 家用酒店用厨房环保桶","masterPic":"http://172.17.8.100/images/small/commodity/sjsm/znsb/5/1.jpg","price":298,"saleNum":0},{"commodityId":179,"commodityName":"莎米特SUMMIT拉杆箱22英寸PC材质万向轮旅行箱行李箱PC154T4A可扩容","masterPic":"http://172.17.8.100/images/small/commodity/xbsd/lgx/3/1.jpg","price":199,"saleNum":0},{"commodityId":127,"commodityName":"【夜视高清 智能摄像头】小米语音互动 1080P 夜视高清 智能摄像头","masterPic":"http://172.17.8.100/images/small/commodity/sjsm/zxj/7/1.jpg","price":399,"saleNum":0},{"commodityId":174,"commodityName":"帆布派 Canvas artisan 苹果笔记本电脑包 女14/15.6寸惠普电脑包联想1 PT38-1酒红色 14寸可用","masterPic":"http://172.17.8.100/images/small/commodity/xbsd/dnb/5/1.jpg","price":229,"saleNum":0},{"commodityId":190,"commodityName":"XDDESIGN 蒙马特城市安全防盗背包 经典版 商务男女款双肩包15英寸笔记本电脑包 ","masterPic":"http://172.17.8.100/images/small/commodity/xbsd/sjb/7/1.jpg","price":369,"saleNum":0},{"commodityId":106,"commodityName":"三星Galaxy S9+ 6GB+128GB版曲屏手机/指纹识别手机/拍照手机","masterPic":"http://172.17.8.100/images/small/commodity/sjsm/sj/7/1.jpg","price":6199,"saleNum":0},{"commodityId":123,"commodityName":"Fujifilm/富士X-A10 自拍复古微单数码相机 富士xa10(16-50)花漾粉","masterPic":"http://172.17.8.100/images/small/commodity/sjsm/zxj/3/1.jpg","price":1899,"saleNum":0},{"commodityId":170,"commodityName":"爱登堡电脑包背包男士双肩包14/15.6英寸防泼水大容量商务通勤旅行休闲学生笔记本书包 黑色643001-01","masterPic":"http://172.17.8.100/images/small/commodity/xbsd/dnb/1/1.jpg","price":99,"saleNum":0},{"commodityId":185,"commodityName":"Texwood 休闲双肩包男款背包男时尚潮流男士旅行包书包潮 Z77J0011-67","masterPic":"http://172.17.8.100/images/small/commodity/xbsd/sjb/2/1.jpg","price":199,"saleNum":0},{"commodityId":129,"commodityName":"360儿童 电话手表X1 运动快充版 轻薄防水拍照 七重定位 智能手表学生W702","masterPic":"http://172.17.8.100/images/small/commodity/sjsm/znsb/2/1.jpg","price":419,"saleNum":0},{"commodityId":176,"commodityName":"瑞士军刀大容量背包多功能户外出差旅行包双肩包男15.6英寸笔记本电脑包手提斜挎行李包旅游登山包防泼水 黑色【多功能手提斜跨双肩单肩】","masterPic":"http://172.17.8.100/images/small/commodity/xbsd/dnb/7/1.jpg","price":119,"saleNum":0},{"commodityId":116,"commodityName":"【千元爆款智能投影】坚果A6投影仪 支持1080p家用高清 微型智能wifi无线投影仪 家庭影院 便携电视","masterPic":"http://172.17.8.100/images/small/commodity/sjsm/yyyl/3/1.jpg","price":998,"saleNum":0},{"commodityId":125,"commodityName":"Sony/索尼 DSC-KW1 靓咔 自拍神器 数码相机 美颜相机","masterPic":"http://172.17.8.100/images/small/commodity/sjsm/zxj/5/1.jpg","price":799,"saleNum":0},{"commodityId":173,"commodityName":"新番祖 电脑包 13.3/14/15.6英寸苹果笔记本电脑包 女 手提公文包 贝壳 樱花粉-13.3英寸及以下(淑女款)","masterPic":"http://172.17.8.100/images/small/commodity/xbsd/dnb/4/1.jpg","price":119,"saleNum":0},{"commodityId":189,"commodityName":"高尔夫GOLF锦纶双肩包男士个性旅行背包大容量电脑背包D8BV33913J","masterPic":"http://172.17.8.100/images/small/commodity/xbsd/sjb/6/1.jpg","price":179,"saleNum":0},{"commodityId":104,"commodityName":"OPPO R17 全网通 8G+128G 美拍补光灯+美容补水仪套餐 全面屏AI智慧美颜双摄拍照手机","masterPic":"http://172.17.8.100/images/small/commodity/sjsm/sj/5/1.jpg","price":3799,"saleNum":0}]
* message : 查询成功
* status : 0000
*/
private String message;
private String status;
private List<ResultBean> result;
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public List<ResultBean> getResult() {
return result;
}
public void setResult(List<ResultBean> result) {
this.result = result;
}
public static class ResultBean {
/**
* commodityId : 121
* commodityName : 佳能(Canon)EOS 3000D 入门级数码单反相机18-55mm IS II防抖镜头套装 32G内存卡 备用电池 三脚架摄影包等礼包版
* masterPic : http://172.17.8.100/images/small/commodity/sjsm/zxj/1/1.jpg
* price : 3099
* saleNum : 0
*/
private int commodityId;
private String commodityName;
private String masterPic;
private int price;
private int saleNum;
public int getCommodityId() {
return commodityId;
}
public void setCommodityId(int commodityId) {
this.commodityId = commodityId;
}
public String getCommodityName() {
return commodityName;
}
public void setCommodityName(String commodityName) {
this.commodityName = commodityName;
}
public String getMasterPic() {
return masterPic;
}
public void setMasterPic(String masterPic) {
this.masterPic = masterPic;
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
public int getSaleNum() {
return saleNum;
}
public void setSaleNum(int saleNum) {
this.saleNum = saleNum;
}
}
}
DedailsBean
package com.bawei.lmx.day13_2.bean;
public class DedailsBean {
/**
* result : {"categoryId":"1001007004","categoryName":"彩妆","commentNum":26,"commodityId":6,"commodityName":"轻柔系自然裸妆假睫毛","describe":"浓密卷翘 自然裸妆","details":"<div class=\"M-detailCon\" id=\"J-detailCon\">\r\n \r\n \r\n<!-- 商品参数 -->\r\n<div class=\"J-dc-tit-new dc-tit-new\"><i class=\"dc-tit-new-icon\"><\/i><p class=\"dc-title\">商品参数<i class=\"dc-title-en\">DETAIL<\/i><\/p><\/div>\r\n<div class=\"dc-info clearfix\">\r\n <table class=\"dc-table fst\">\r\n <tbody>\r\n <tr>\r\n <th class=\"dc-table-tit\">彩妆功效:<\/th>\r\n <td>持久,纤长,浓密,卷翘<\/td>\r\n <th class=\"dc-table-tit\">品牌名称:<\/th>\r\n <td>美丽工匠<\/td>\r\n <\/tr><tr> <th class=\"dc-table-tit\">商品名称:<\/th>\r\n <td>【浓密卷翘 自然裸妆】美丽工匠 轻柔系自然裸妆假睫毛 素颜款赠胶水<\/td>\r\n <th class=\"dc-table-tit\">商品编号:<\/th>\r\n <td>6922608612383<\/td>\r\n <\/tr> <\/tbody>\r\n <\/table>\r\n\r\n<\/div>\r\n<!-- 商品参数 end -->\r\n\r\n\r\n<!-- 商品展示 -->\r\n<div class=\"J-dc-tit-new dc-tit-new\" id=\"J-proShow-scroll\"><i class=\"dc-tit-new-icon\"><\/i><p class=\"dc-title\">商品展示<i class=\"dc-title-en\">IMAGE<\/i><\/p><\/div>\r\n<div class=\"dc-img\">\r\n <div class=\"dc-img-detail\">\r\n <img class=\"J-mer-bigImg\" alt=\"\" src=\"http://a.vpimg2.com/upload/merchandise/pdcvis/609796/2018/1019/57/6cb8f510-afe8-4e80-ae89-ceddc83451d9.jpg\" data-original=\"http://a.vpimg2.com/upload/merchandise/pdcvis/609796/2018/1019/57/6cb8f510-afe8-4e80-ae89-ceddc83451d9.jpg\">\r\n <div class=\"img-6xx-bg\">\r\n <img src=\"http://a.vpimg2.com/upload/merchandise/pdcvis/609796/2018/1019/171/de592765-8724-404a-95ef-db6942ef2d11.jpg\" class=\"J-mer-bigImg\" data-original=\"http://a.vpimg2.com/upload/merchandise/pdcvis/609796/2018/1019/171/de592765-8724-404a-95ef-db6942ef2d11.jpg\">\r\n <\/div>\r\n <div class=\"img-6xx-bg\">\r\n <img src=\"http://a.vpimg2.com/upload/merchandise/pdcvis/609796/2018/1019/46/a9abfc3c-89d7-48cb-aef0-5f78909b87c7.jpg\" class=\"J-mer-bigImg\" data-original=\"http://a.vpimg2.com/upload/merchandise/pdcvis/609796/2018/1019/46/a9abfc3c-89d7-48cb-aef0-5f78909b87c7.jpg\">\r\n <\/div>\r\n <div class=\"img-6xx-bg\">\r\n <img src=\"http://a.vpimg2.com/upload/merchandise/pdcvis/609796/2018/1019/30/b7cd9afb-1edc-4aca-9cd7-af699d719ed2.jpg\" class=\"J-mer-bigImg\" data-original=\"http://a.vpimg2.com/upload/merchandise/pdcvis/609796/2018/1019/30/b7cd9afb-1edc-4aca-9cd7-af699d719ed2.jpg\">\r\n <\/div>\r\n <div class=\"img-6xx-bg\">\r\n <img src=\"http://s2.vipstatic.com/img/share/blank.png\" class=\"lazy J-mer-bigImg\" data-original=\"http://a.vpimg2.com/upload/merchandise/pdcvis/609796/2018/1019/62/18ac0774-df13-4900-90fa-6668cf71e37d.jpg\">\r\n <\/div>\r\n <div class=\"img-6xx-bg\">\r\n <img src=\"http://s2.vipstatic.com/img/share/blank.png\" class=\"lazy J-mer-bigImg\" data-original=\"http://a.vpimg2.com/upload/merchandise/pdcvis/609796/2018/1019/10/e5ed2cc5-3ec1-4143-b8c5-6ef203f1f78d.jpg\">\r\n <\/div>\r\n <div class=\"img-6xx-bg\">\r\n <img src=\"http://s2.vipstatic.com/img/share/blank.png\" class=\"lazy J-mer-bigImg\" data-original=\"http://a.vpimg2.com/upload/merchandise/pdcvis/609796/2018/1019/91/49d65c5e-60e3-41d9-a28d-90c8888f88bc.jpg\">\r\n <\/div>\r\n <div class=\"img-6xx-bg\">\r\n <img src=\"http://s2.vipstatic.com/img/share/blank.png\" class=\"lazy J-mer-bigImg\" data-original=\"http://a.vpimg2.com/upload/merchandise/pdcvis/609796/2018/1019/112/5b1b3db0-59a2-400c-bbd4-fe04b547e999.jpg\">\r\n <\/div>\r\n <div class=\"img-6xx-bg\">\r\n <img src=\"http://s2.vipstatic.com/img/share/blank.png\" class=\"lazy J-mer-bigImg\" data-original=\"http://a.vpimg2.com/upload/merchandise/pdcvis/609796/2018/1019/39/564f6fa3-9af1-43b1-835c-f286d15fef83.jpg\">\r\n <\/div>\r\n <div class=\"img-6xx-bg\">\r\n <img src=\"http://s2.vipstatic.com/img/share/blank.png\" class=\"lazy J-mer-bigImg\" data-original=\"http://a.vpimg2.com/upload/merchandise/pdcvis/609796/2018/1019/72/ac8f36fb-609a-4807-a9ce-c20c1da56c23.jpg\">\r\n <\/div>\r\n <div class=\"img-6xx-bg\">\r\n <img src=\"http://s2.vipstatic.com/img/share/blank.png\" class=\"lazy J-mer-bigImg\" data-original=\"http://a.vpimg2.com/upload/merchandise/pdcvis/609796/2018/1019/25/b4fea529-c7ec-46f5-ae5c-b7eb6482c19c.jpg\">\r\n <\/div>\r\n <\/div>\r\n <div class=\"dc-img-con\">\r\n <\/div>\r\n <div class=\"dc-txt-con\">\r\n <\/div>\r\n<\/div>\r\n<!-- 商品展示 end -->\r\n\r\n <div class=\"c-safeguard\">\r\n <div class=\"c-safeguard-top\">\r\n <p class=\"c-safeguard-title\">100% 正品保障\u2014\u2014中国人民财产保险为您购买的每一件商品承保<\/p>\r\n <\/div>\r\n <ul class=\"c-safeguard-list\">\r\n <li class=\"c-safeguard-item\">\r\n <span class=\"c-safeguard-icon-genuine\"><\/span>\r\n 唯品会承诺,<br>在售商品均为正品,<br>并为每一件商品投保。\r\n <\/li><!--\r\n --><li class=\"c-safeguard-item\">\r\n <span class=\"c-safeguard-icon-research\"><\/span>\r\n 若您对商品质量存疑,<br>唯品会将协助您<br>进行全面的查证调研。\r\n <\/li><!--\r\n --><li class=\"c-safeguard-item\">\r\n <span class=\"c-safeguard-icon-money\"><\/span>\r\n 若检验出商品非正品,<br>中国人民财产保险将给您<br>商品售价的全额赔偿。\r\n <\/li>\r\n <\/ul>\r\n <\/div>\r\n <div class=\"J-dc-tit-new dc-tit-new\">\r\n <i class=\"dc-tit-new-icon\"><\/i>\r\n <p class=\"dc-title\">品牌介绍<i class=\"dc-title-en\">BRAND INTRODUCTION<\/i><\/p>\r\n <\/div>\r\n <div class=\"dc-img-detail clearfix\">\r\n <img class=\"lazy\" src=\"//shop.vipstatic.com/img/te/ui-loading-goods.gif\" data-original=\"http://a.vpimg2.com/upload/merchandise/ugcaudit/2018/09/28/76/a198f75c-c2e2-11e8-9fc3-14187737f303.jpg\">\r\n <\/div>\r\n <\/div>","picture":"http://172.17.8.100/images/small/commodity/mzhf/cz/4/1.jpg,http://172.17.8.100/images/small/commodity/mzhf/cz/4/2.jpg,http://172.17.8.100/images/small/commodity/mzhf/cz/4/3.jpg,http://172.17.8.100/images/small/commodity/mzhf/cz/4/4.jpg,http://172.17.8.100/images/small/commodity/mzhf/cz/4/5.jpg,","price":39,"saleNum":0,"stock":9999,"weight":1}
* message : 查询成功
* status : 0000
*/
private ResultBean result;
private String message;
private String status;
public ResultBean getResult() {
return result;
}
public void setResult(ResultBean result) {
this.result = result;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public static class ResultBean {
/**
* categoryId : 1001007004
* categoryName : 彩妆
* commentNum : 26
* commodityId : 6
* commodityName : 轻柔系自然裸妆假睫毛
* describe : 浓密卷翘 自然裸妆
* details : <div class="M-detailCon" id="J-detailCon">
* <p>
* <p>
* <!-- 商品参数 -->
* <div class="J-dc-tit-new dc-tit-new"><i class="dc-tit-new-icon"></i><p class="dc-title">商品参数<i class="dc-title-en">DETAIL</i></p></div>
* <div class="dc-info clearfix">
* <table class="dc-table fst">
* <tbody>
* <tr>
* <th class="dc-table-tit">彩妆功效:</th>
* <td>持久,纤长,浓密,卷翘</td>
* <th class="dc-table-tit">品牌名称:</th>
* <td>美丽工匠</td>
* </tr><tr> <th class="dc-table-tit">商品名称:</th>
* <td>【浓密卷翘 自然裸妆】美丽工匠 轻柔系自然裸妆假睫毛 素颜款赠胶水</td>
* <th class="dc-table-tit">商品编号:</th>
* <td>6922608612383</td>
* </tr> </tbody>
* </table>
*
* </div>
* <!-- 商品参数 end -->
* <p>
* <p>
* <!-- 商品展示 -->
* <div class="J-dc-tit-new dc-tit-new" id="J-proShow-scroll"><i class="dc-tit-new-icon"></i><p class="dc-title">商品展示<i class="dc-title-en">IMAGE</i></p></div>
* <div class="dc-img">
* <div class="dc-img-detail">
* <img class="J-mer-bigImg" alt="" src="http://a.vpimg2.com/upload/merchandise/pdcvis/609796/2018/1019/57/6cb8f510-afe8-4e80-ae89-ceddc83451d9.jpg" data-original="http://a.vpimg2.com/upload/merchandise/pdcvis/609796/2018/1019/57/6cb8f510-afe8-4e80-ae89-ceddc83451d9.jpg">
* <div class="img-6xx-bg">
* <img src="http://a.vpimg2.com/upload/merchandise/pdcvis/609796/2018/1019/171/de592765-8724-404a-95ef-db6942ef2d11.jpg" class="J-mer-bigImg" data-original="http://a.vpimg2.com/upload/merchandise/pdcvis/609796/2018/1019/171/de592765-8724-404a-95ef-db6942ef2d11.jpg">
* </div>
* <div class="img-6xx-bg">
* <img src="http://a.vpimg2.com/upload/merchandise/pdcvis/609796/2018/1019/46/a9abfc3c-89d7-48cb-aef0-5f78909b87c7.jpg" class="J-mer-bigImg" data-original="http://a.vpimg2.com/upload/merchandise/pdcvis/609796/2018/1019/46/a9abfc3c-89d7-48cb-aef0-5f78909b87c7.jpg">
* </div>
* <div class="img-6xx-bg">
* <img src="http://a.vpimg2.com/upload/merchandise/pdcvis/609796/2018/1019/30/b7cd9afb-1edc-4aca-9cd7-af699d719ed2.jpg" class="J-mer-bigImg" data-original="http://a.vpimg2.com/upload/merchandise/pdcvis/609796/2018/1019/30/b7cd9afb-1edc-4aca-9cd7-af699d719ed2.jpg">
* </div>
* <div class="img-6xx-bg">
* <img src="http://s2.vipstatic.com/img/share/blank.png" class="lazy J-mer-bigImg" data-original="http://a.vpimg2.com/upload/merchandise/pdcvis/609796/2018/1019/62/18ac0774-df13-4900-90fa-6668cf71e37d.jpg">
* </div>
* <div class="img-6xx-bg">
* <img src="http://s2.vipstatic.com/img/share/blank.png" class="lazy J-mer-bigImg" data-original="http://a.vpimg2.com/upload/merchandise/pdcvis/609796/2018/1019/10/e5ed2cc5-3ec1-4143-b8c5-6ef203f1f78d.jpg">
* </div>
* <div class="img-6xx-bg">
* <img src="http://s2.vipstatic.com/img/share/blank.png" class="lazy J-mer-bigImg" data-original="http://a.vpimg2.com/upload/merchandise/pdcvis/609796/2018/1019/91/49d65c5e-60e3-41d9-a28d-90c8888f88bc.jpg">
* </div>
* <div class="img-6xx-bg">
* <img src="http://s2.vipstatic.com/img/share/blank.png" class="lazy J-mer-bigImg" data-original="http://a.vpimg2.com/upload/merchandise/pdcvis/609796/2018/1019/112/5b1b3db0-59a2-400c-bbd4-fe04b547e999.jpg">
* </div>
* <div class="img-6xx-bg">
* <img src="http://s2.vipstatic.com/img/share/blank.png" class="lazy J-mer-bigImg" data-original="http://a.vpimg2.com/upload/merchandise/pdcvis/609796/2018/1019/39/564f6fa3-9af1-43b1-835c-f286d15fef83.jpg">
* </div>
* <div class="img-6xx-bg">
* <img src="http://s2.vipstatic.com/img/share/blank.png" class="lazy J-mer-bigImg" data-original="http://a.vpimg2.com/upload/merchandise/pdcvis/609796/2018/1019/72/ac8f36fb-609a-4807-a9ce-c20c1da56c23.jpg">
* </div>
* <div class="img-6xx-bg">
* <img src="http://s2.vipstatic.com/img/share/blank.png" class="lazy J-mer-bigImg" data-original="http://a.vpimg2.com/upload/merchandise/pdcvis/609796/2018/1019/25/b4fea529-c7ec-46f5-ae5c-b7eb6482c19c.jpg">
* </div>
* </div>
* <div class="dc-img-con">
* </div>
* <div class="dc-txt-con">
* </div>
* </div>
* <!-- 商品展示 end -->
*
* <div class="c-safeguard">
* <div class="c-safeguard-top">
* <p class="c-safeguard-title">100% 正品保障——中国人民财产保险为您购买的每一件商品承保</p>
* </div>
* <ul class="c-safeguard-list">
* <li class="c-safeguard-item">
* <span class="c-safeguard-icon-genuine"></span>
* 唯品会承诺,<br>在售商品均为正品,<br>并为每一件商品投保。
* </li><!--
* --><li class="c-safeguard-item">
* <span class="c-safeguard-icon-research"></span>
* 若您对商品质量存疑,<br>唯品会将协助您<br>进行全面的查证调研。
* </li><!--
* --><li class="c-safeguard-item">
* <span class="c-safeguard-icon-money"></span>
* 若检验出商品非正品,<br>中国人民财产保险将给您<br>商品售价的全额赔偿。
* </li>
* </ul>
* </div>
* <div class="J-dc-tit-new dc-tit-new">
* <i class="dc-tit-new-icon"></i>
* <p class="dc-title">品牌介绍<i class="dc-title-en">BRAND INTRODUCTION</i></p>
* </div>
* <div class="dc-img-detail clearfix">
* <img class="lazy" src="//shop.vipstatic.com/img/te/ui-loading-goods.gif" data-original="http://a.vpimg2.com/upload/merchandise/ugcaudit/2018/09/28/76/a198f75c-c2e2-11e8-9fc3-14187737f303.jpg">
* </div>
* </div>
* picture : http://172.17.8.100/images/small/commodity/mzhf/cz/4/1.jpg,http://172.17.8.100/images/small/commodity/mzhf/cz/4/2.jpg,http://172.17.8.100/images/small/commodity/mzhf/cz/4/3.jpg,http://172.17.8.100/images/small/commodity/mzhf/cz/4/4.jpg,http://172.17.8.100/images/small/commodity/mzhf/cz/4/5.jpg,
* price : 39
* saleNum : 0
* stock : 9999
* weight : 1
*/
private String categoryId;
private String categoryName;
private int commentNum;
private int commodityId;
private String commodityName;
private String describe;
private String details;
private String picture;
private int price;
private int saleNum;
private int stock;
private int weight;
public String getCategoryId() {
return categoryId;
}
public void setCategoryId(String categoryId) {
this.categoryId = categoryId;
}
public String getCategoryName() {
return categoryName;
}
public void setCategoryName(String categoryName) {
this.categoryName = categoryName;
}
public int getCommentNum() {
return commentNum;
}
public void setCommentNum(int commentNum) {
this.commentNum = commentNum;
}
public int getCommodityId() {
return commodityId;
}
public void setCommodityId(int commodityId) {
this.commodityId = commodityId;
}
public String getCommodityName() {
return commodityName;
}
public void setCommodityName(String commodityName) {
this.commodityName = commodityName;
}
public String getDescribe() {
return describe;
}
public void setDescribe(String describe) {
this.describe = describe;
}
public String getDetails() {
return details;
}
public void setDetails(String details) {
this.details = details;
}
public String getPicture() {
return picture;
}
public void setPicture(String picture) {
this.picture = picture;
}
public int getPrice() {
return price;
}
public void setPrice(int price) {
this.price = price;
}
public int getSaleNum() {
return saleNum;
}
public void setSaleNum(int saleNum) {
this.saleNum = saleNum;
}
public int getStock() {
return stock;
}
public void setStock(int stock) {
this.stock = stock;
}
public int getWeight() {
return weight;
}
public void setWeight(int weight) {
this.weight = weight;
}
}
}