封装bean类:
package com.example.shoppingcardemo.bean;
/**
* 作者:author
* 时间 :* 说明:
*/
public class Bean {
private String price;
private String number;
public Bean(String price, String number) {
this.price = price;
this.number = number;
}
public String getPrice() {
return price;
}
public void setPrice(String price) {
this.price = price;
}
public String getNumber() {
return number;
}
public void setNumber(String number) {
this.number = number;
}
}
先看布局:MainActivity
<?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"
tools:context="com.example.shoppingcardemo.MainActivity"
android:orientation="vertical">
<ExpandableListView
android:id="@+id/listview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:groupIndicator="@null"></ExpandableListView>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp">
<CheckBox
android:id="@+id/checkAll"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_marginLeft="15dp"
android:drawablePadding="5dp"
android:text="全选"
android:textColor="#6b6868"
android:textSize="18sp" />
<TextView
android:id="@+id/price"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@id/checkAll"
android:gravity="center"
android:text="合计:¥0.00"
android:textColor="#000000"
android:textSize="18sp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:background="#ff0000">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="#ff0000"
android:gravity="center"
android:paddingLeft="30dp"
android:text="去结算"
android:textColor="#ffffff"
android:textSize="22sp" />
<TextView
android:id="@+id/checked_shop"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="#ff0000"
android:gravity="center"
android:paddingRight="30dp"
android:text="(0)"
android:textColor="#ffffff"
android:textSize="13sp" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
group_item:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<CheckBox
android:id="@+id/group_ck"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:focusable="false" />
<TextView
android:id="@+id/group_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
child_item
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<CheckBox
android:id="@+id/child_ck"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp" />
<TextView
android:id="@+id/child_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginTop="10dp">
<TextView
android:id="@+id/danjia"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="200dp"
android:text="100元"
android:textColor="#ff0000" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true">
<TextView
android:id="@+id/jianshao"
android:layout_width="20dp"
android:layout_height="30dp"
android:gravity="center"
android:text="-"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="@+id/number"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:gravity="center"
android:text="1"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="@+id/zengjia"
android:layout_width="20dp"
android:layout_height="30dp"
android:layout_marginRight="20dp"
android:gravity="center"
android:text="+"
android:textSize="20sp"
android:textStyle="bold" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
接下来是主Activity:
package com.example.shoppingcardemo;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.CheckBox;
import android.widget.ExpandableListView;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
private ExpandableListView listview;
private MyAdapter adpater;
private TextView checked_shop;
private TextView price;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
listview = (ExpandableListView) findViewById(R.id.listview);
adpater = new MyAdapter(this);
listview.setAdapter(adpater);
final CheckBox checkAll = (CheckBox) findViewById(R.id.checkAll);
price = (TextView) findViewById(R.id.price);
checked_shop = (TextView) findViewById(R.id.checked_shop);
checkAll.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//设置商品全部选中
adpater.checkAllShop(checkAll.isChecked());
//计算选中的价格和数量
String shopPrice = adpater.getShopPrice();
//判断商品是否全部选中
boolean b = adpater.selectAll();
String[] split = shopPrice.split(",");
price.setText(split[0]);
checked_shop.setText(split[1]);
checkAll.setChecked(b);
}
});
adpater.getAdapterData(new MyAdapter.AdapterData() {
@Override
public void Data(View v, String str, boolean b) {
String[] split = str.split(",");
price.setText(split[0]);
checked_shop.setText(split[1]);
checkAll.setChecked(b);
}
});
checkAll.setChecked(adpater.selectAll());
adpater.notifyDataSetChanged();
}
}
最后是adapter类:
MyAdapter
package com.example.shoppingcardemo;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseExpandableListAdapter;
import android.widget.CheckBox;
import android.widget.TextView;
import com.example.shoppingcardemo.bean.Bean;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* 作者:author
* 时间 :
* 说明:
*/
public class MyAdapter extends BaseExpandableListAdapter {
private Context context;
private String[] group;
private String[][] child;
private HashMap<Integer, Boolean> groupHashMap;
private List<HashMap<Integer, Boolean>> childList;
private List<List<Bean>> dataList;
public MyAdapter(Context context) {
this.context = context;
initData();
}
private void initData() {
group = new String[5];
child = new String[5][];
groupHashMap = new HashMap<>();
childList = new ArrayList<>();
dataList = new ArrayList<>();
for (int i = 0; i < 5; i++) {
group[i] = "商家" + i;
groupHashMap.put(i, false);
String[] strings = new String[3];
HashMap<Integer, Boolean> map = new HashMap<>();
ArrayList<Bean> been = new ArrayList<>();
for (int y = 0; y < 3; y++) {
strings[y] = "商家" + i + "商品" + y;
map.put(y, false);
Bean bean = new Bean("100", "1");
been.add(bean);
}
child[i] = strings;
childList.add(map);
dataList.add(been);
}
}
@Override
public int getGroupCount() {
return group.length;
}
@Override
public int getChildrenCount(int groupPosition) {
return child[groupPosition].length;
}
@Override
public Object getGroup(int groupPosition) {
return group[groupPosition];
}
@Override
public Object getChild(int groupPosition, int childPosition) {
return child[childPosition];
}
@Override
public long getGroupId(int groupPosition) {
return groupPosition;
}
@Override
public long getChildId(int groupPosition, int childPosition) {
return childPosition;
}
@Override
public boolean hasStableIds() {
return false;
}
@Override
public View getGroupView(final int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
GroupViewHolder holder = null;
if (convertView == null) {
convertView = View.inflate(context, R.layout.group_item, null);
holder = new GroupViewHolder();
holder.tv = (TextView) convertView.findViewById(R.id.group_tv);
holder.ck = (CheckBox) convertView.findViewById(R.id.group_ck);
convertView.setTag(holder);
} else {
holder = (GroupViewHolder) convertView.getTag();
}
holder.tv.setText(group[groupPosition]);
holder.ck.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
groupHashMap.put(groupPosition, !groupHashMap.get(groupPosition));
//设置二级列表的选中状态,根据一级列表的状态来改变
setChildCheckAll();
//计算选中的价格和数量
String shopPrice = getShopPrice();
//判断商品是否全部选中
boolean b = selectAll();
adapterData.Data(v, shopPrice, b);
}
});
holder.ck.setChecked(groupHashMap.get(groupPosition));
return convertView;
}
@Override
public View getChildView(final int groupPosition, final int childPosition,
boolean isLastChild, View convertView, ViewGroup parent) {
ChildViewHolder holder = null;
if (convertView == null) {
convertView = View.inflate(context, R.layout.child_item, null);
holder = new ChildViewHolder();
holder.tv = (TextView) convertView.findViewById(R.id.child_tv);
holder.ck = (CheckBox) convertView.findViewById(R.id.child_ck);
holder.jianshao = (TextView) convertView.findViewById(R.id.jianshao);
holder.zengjia = (TextView) convertView.findViewById(R.id.zengjia);
holder.number = (TextView) convertView.findViewById(R.id.number);
convertView.setTag(holder);
} else {
holder = (ChildViewHolder) convertView.getTag();
}
holder.tv.setText(child[groupPosition][childPosition]);
holder.ck.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
HashMap<Integer, Boolean> hashMap = childList.get(groupPosition);
hashMap.put(childPosition, !hashMap.get(childPosition));
//判断二级列表是否全部选中
ChildisChecked(groupPosition);
//计算选中的价格和数量
String shopPrice = getShopPrice();
//判断商品是否全部选中
boolean b = selectAll();
adapterData.Data(v, shopPrice, b);
}
});
final ChildViewHolder finalHolder = holder;
holder.zengjia.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
List<Bean> been = dataList.get(groupPosition);
String num = finalHolder.number.getText().toString();
int i = Integer.parseInt(num);
++i;
been.get(childPosition).setNumber(i + "");
//计算选中的价格和数量
String shopPrice = getShopPrice();
//判断商品是否全部选中
boolean b = selectAll();
adapterData.Data(v, shopPrice, b);
notifyDataSetChanged();
}
});
holder.jianshao.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
List<Bean> been = dataList.get(groupPosition);
String num = finalHolder.number.getText().toString();
int i = Integer.parseInt(num);
if (i > 1) {
--i;
}
been.get(childPosition).setNumber(i + "");
//计算选中的价格和数量
String shopPrice = getShopPrice();
//判断商品是否全部选中
boolean b = selectAll();
adapterData.Data(v, shopPrice, b);
notifyDataSetChanged();
}
});
holder.number.setText(dataList.get(groupPosition).get(childPosition).getNumber().toString());
holder.ck.setChecked(childList.get(groupPosition).get(childPosition));
return convertView;
}
@Override
public boolean isChildSelectable(int groupPosition, int childPosition) {
return false;
}
class GroupViewHolder {
TextView tv;
CheckBox ck;
}
class ChildViewHolder {
TextView tv;
CheckBox ck;
TextView jianshao;
TextView zengjia;
TextView number;
}
//设置二级列表的选中状态,根据一级列表的状态来改变
private void setChildCheckAll() {
for (int i = 0; i < childList.size(); i++) {
HashMap<Integer, Boolean> integerBooleanHashMap1 = childList.get(i);
Set<Map.Entry<Integer, Boolean>> entries = integerBooleanHashMap1.entrySet();
for (Map.Entry<Integer, Boolean> entry : entries) {
entry.setValue(groupHashMap.get(i));
}
}
notifyDataSetChanged();
}
//判断二级列表是否全部选中
private void ChildisChecked(int groupPosition) {
boolean ischecked = true;
HashMap<Integer, Boolean> hashMap = childList.get(groupPosition);
Set<Map.Entry<Integer, Boolean>> entries = hashMap.entrySet();
for (Map.Entry<Integer, Boolean> entry : entries) {
if (!entry.getValue()) {
ischecked = false;
break;
}
}
groupHashMap.put(groupPosition, ischecked);
notifyDataSetChanged();
}
//全选
public void checkAllShop(boolean checked) {
Set<Map.Entry<Integer, Boolean>> entries = groupHashMap.entrySet();
for (Map.Entry<Integer, Boolean> entry : entries) {
entry.setValue(checked);
}
//调用让二级列表全选的方法
setChildCheckAll();
notifyDataSetChanged();
}
//计算价格
public String getShopPrice() {
int price = 0;
int number = 0;
for (int y = 0; y < childList.size(); y++) {
HashMap<Integer, Boolean> integerBooleanHashMap1 = childList.get(y);
Set<Map.Entry<Integer, Boolean>> entries = integerBooleanHashMap1.entrySet();
for (Map.Entry<Integer, Boolean> entry : entries) {
if (entry.getValue()) {
Bean bean = dataList.get(y).get(entry.getKey());
price += Integer.parseInt(bean.getPrice()) * Integer.parseInt(bean.getNumber());
number += Integer.parseInt(bean.getNumber());
}
}
}
return price + "," + number;
}
//编辑一级和二级列表,如果全部选中,全选按钮也选中
public boolean selectAll() {
boolean isChecked = true;
for (int y = 0; y < childList.size(); y++) {
HashMap<Integer, Boolean> hashMap = childList.get(y);
Set<Map.Entry<Integer, Boolean>> entries = hashMap.entrySet();
for (Map.Entry<Integer, Boolean> entry : entries) {
if (!entry.getValue()) {
isChecked = false;
break;
}
}
}
return isChecked;
}
private AdapterData adapterData;
public interface AdapterData {
void Data(View v, String str, boolean b);
}
public void getAdapterData(AdapterData adapterData) {
this.adapterData = adapterData;
}
}
根据上述我们可以通过okhttp来请求个数据来实现(改变adapter就可以了)
package com.example.shoppingcardemo;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseExpandableListAdapter;
import android.widget.CheckBox;
import android.widget.TextView;
import com.example.shoppingcardemo.bean.Bean;
import com.example.shoppingcardemo.bean.Bean2;
import com.example.shoppingcardemo.ok.OkHttpUtils;
import com.example.shoppingcardemo.ok.OnUiCallback;
import com.google.gson.Gson;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import okhttp3.Call;
/**
* 作者:author
* 时间 :2017/10/24:19:19
* 说明:
*/
public class MyAdapter extends BaseExpandableListAdapter {
private Context context;
private String[] group;
private String[][] child;
private HashMap<Integer, Boolean> groupHashMap;
private List<HashMap<Integer, Boolean>> childList;
private List<List<Bean>> dataList;
List<Bean2.DatasBean.ClassListBean> class_list;
public MyAdapter(Context context) {
this.context = context;
initData();
}
private void initData() {
OkHttpUtils.getInstance().doGet("http://169.254.35.159/mobile/index.php?
act=goods_class&op=get_child_all&gc_id=1", new OnUiCallback() {
@Override
public void onFailed(Call call, IOException e) {
}
@Override
public void onSuccess(String result) throws IOException {
Gson gson = new Gson();
Bean2 bean2 = gson.fromJson(result, Bean2.class);
class_list = bean2.getDatas().getClass_list();
group = new String[class_list.size()];
child = new String[class_list.size()][];
groupHashMap = new HashMap<>();
childList = new ArrayList<>();
dataList = new ArrayList<>();
for (int i = 0; i < class_list.size(); i++) {
group[i] = class_list.get(i).getGc_name();
groupHashMap.put(i, false);
String[] strings = new String[class_list.get(i).getChild().size()];
HashMap<Integer, Boolean> map = new HashMap<>();
ArrayList<Bean> been = new ArrayList<>();
for (int y = 0; y <class_list.get(i).getChild().size(); y++) {
strings[y] =class_list.get(i).getGc_name() + class_list.get(i).
getChild().get(y).getGc_name();
map.put(y, false);
Bean bean = new Bean("100", "1");
been.add(bean);
}
child[i] = strings;
childList.add(map);
dataList.add(been);
}
}
});
}
@Override
public int getGroupCount() {
return group==null?0:group.length;
}
@Override
public int getChildrenCount(int groupPosition) {
return child[groupPosition].length;
}
@Override
public Object getGroup(int groupPosition) {
return group[groupPosition];
}
@Override
public Object getChild(int groupPosition, int childPosition) {
return child[childPosition];
}
@Override
public long getGroupId(int groupPosition) {
return groupPosition;
}
@Override
public long getChildId(int groupPosition, int childPosition) {
return childPosition;
}
@Override
public boolean hasStableIds() {
return false;
}
@Override
public View getGroupView(final int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
GroupViewHolder holder = null;
if (convertView == null) {
convertView = View.inflate(context, R.layout.group_item, null);
holder = new GroupViewHolder();
holder.tv = (TextView) convertView.findViewById(R.id.group_tv);
holder.ck = (CheckBox) convertView.findViewById(R.id.group_ck);
convertView.setTag(holder);
} else {
holder = (GroupViewHolder) convertView.getTag();
}
holder.tv.setText(group[groupPosition]);
holder.ck.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
groupHashMap.put(groupPosition, !groupHashMap.get(groupPosition));
//设置二级列表的选中状态,根据一级列表的状态来改变
setChildCheckAll();
//计算选中的价格和数量
String shopPrice = getShopPrice();
//判断商品是否全部选中
boolean b = selectAll();
adapterData.Data(v, shopPrice, b);
}
});
holder.ck.setChecked(groupHashMap.get(groupPosition));
return convertView;
}
@Override
public View getChildView(final int groupPosition, final int childPosition,
boolean isLastChild, View convertView, ViewGroup parent) {
ChildViewHolder holder = null;
if (convertView == null) {
convertView = View.inflate(context, R.layout.child_item, null);
holder = new ChildViewHolder();
holder.tv = (TextView) convertView.findViewById(R.id.child_tv);
holder.ck = (CheckBox) convertView.findViewById(R.id.child_ck);
holder.jianshao = (TextView) convertView.findViewById(R.id.jianshao);
holder.zengjia = (TextView) convertView.findViewById(R.id.zengjia);
holder.number = (TextView) convertView.findViewById(R.id.number);
convertView.setTag(holder);
} else {
holder = (ChildViewHolder) convertView.getTag();
}
holder.tv.setText(child[groupPosition][childPosition]);
holder.ck.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
HashMap<Integer, Boolean> hashMap = childList.get(groupPosition);
hashMap.put(childPosition, !hashMap.get(childPosition));
//判断二级列表是否全部选中
ChildisChecked(groupPosition);
//计算选中的价格和数量
String shopPrice = getShopPrice();
//判断商品是否全部选中
boolean b = selectAll();
adapterData.Data(v, shopPrice, b);
}
});
final ChildViewHolder finalHolder = holder;
holder.zengjia.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
List<Bean> been = dataList.get(groupPosition);
String num = finalHolder.number.getText().toString();
int i = Integer.parseInt(num);
++i;
been.get(childPosition).setNumber(i + "");
//计算选中的价格和数量
String shopPrice = getShopPrice();
//判断商品是否全部选中
boolean b = selectAll();
adapterData.Data(v, shopPrice, b);
notifyDataSetChanged();
}
});
holder.jianshao.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
List<Bean> been = dataList.get(groupPosition);
String num = finalHolder.number.getText().toString();
int i = Integer.parseInt(num);
if (i > 1) {
--i;
}
been.get(childPosition).setNumber(i + "");
//计算选中的价格和数量
String shopPrice = getShopPrice();
//判断商品是否全部选中
boolean b = selectAll();
adapterData.Data(v, shopPrice, b);
notifyDataSetChanged();
}
});
holder.number.setText(dataList.get(groupPosition).get(childPosition).getNumber().toString());
holder.ck.setChecked(childList.get(groupPosition).get(childPosition));
return convertView;
}
@Override
public boolean isChildSelectable(int groupPosition, int childPosition) {
return false;
}
class GroupViewHolder {
TextView tv;
CheckBox ck;
}
class ChildViewHolder {
TextView tv;
CheckBox ck;
TextView jianshao;
TextView zengjia;
TextView number;
}
//设置二级列表的选中状态,根据一级列表的状态来改变
private void setChildCheckAll() {
for (int i = 0; i < childList.size(); i++) {
HashMap<Integer, Boolean> integerBooleanHashMap1 = childList.get(i);
Set<Map.Entry<Integer, Boolean>> entries = integerBooleanHashMap1.entrySet();
for (Map.Entry<Integer, Boolean> entry : entries) {
entry.setValue(groupHashMap.get(i));
}
}
notifyDataSetChanged();
}
//判断二级列表是否全部选中
private void ChildisChecked(int groupPosition) {
boolean ischecked = true;
HashMap<Integer, Boolean> hashMap = childList.get(groupPosition);
Set<Map.Entry<Integer, Boolean>> entries = hashMap.entrySet();
for (Map.Entry<Integer, Boolean> entry : entries) {
if (!entry.getValue()) {
ischecked = false;
break;
}
}
groupHashMap.put(groupPosition, ischecked);
notifyDataSetChanged();
}
//全选
public void checkAllShop(boolean checked) {
Set<Map.Entry<Integer, Boolean>> entries = groupHashMap.entrySet();
for (Map.Entry<Integer, Boolean> entry : entries) {
entry.setValue(checked);
}
//调用让二级列表全选的方法
setChildCheckAll();
notifyDataSetChanged();
}
//计算价格
public String getShopPrice() {
int price = 0;
int number = 0;
for (int y = 0; y < childList.size(); y++) {
HashMap<Integer, Boolean> integerBooleanHashMap1 = childList.get(y);
Set<Map.Entry<Integer, Boolean>> entries = integerBooleanHashMap1.entrySet();
for (Map.Entry<Integer, Boolean> entry : entries) {
if (entry.getValue()) {
Bean bean = dataList.get(y).get(entry.getKey());
price += Integer.parseInt(bean.getPrice()) * Integer.parseInt(bean.getNumber());
number += Integer.parseInt(bean.getNumber());
}
}
}
return price + "," + number;
}
//编辑一级和二级列表,如果全部选中,全选按钮也选中
public boolean selectAll() {
boolean isChecked = true;
if(childList!=null){
for (int y = 0; y < childList.size(); y++) {
HashMap<Integer, Boolean> hashMap = childList.get(y);
Set<Map.Entry<Integer, Boolean>> entries = hashMap.entrySet();
for (Map.Entry<Integer, Boolean> entry : entries) {
if (!entry.getValue()) {
isChecked = false;
break;
}
}
}
}
return isChecked;
}
private AdapterData adapterData;
public interface AdapterData {
void Data(View v, String str, boolean b);
}
public void getAdapterData(AdapterData adapterData) {
this.adapterData = adapterData;
}
}
别忘了在bean的包里加一个bean2(此类是json解析):
/**
* code : 200
* datas : {"class_list":[{"gc_id":"4","gc_name":"女装","child":[{"gc_id":"12","gc_name":"T恤"},{"gc_id":"13","gc_name":"衬衫"},{"gc_id":"14","gc_name":"针织衫"},{"gc_id":"15","gc_name":"雪纺衫"},{"gc_id":"16","gc_name":"卫衣"},{"gc_id":"17","gc_name":"马甲"},{"gc_id":"18","gc_name":"连衣裙"},{"gc_id":"19","gc_name":"半身裙"},{"gc_id":"20","gc_name":"牛仔裤"},{"gc_id":"21","gc_name":"休闲裤"},{"gc_id":"22","gc_name":"打底裤"},{"gc_id":"23","gc_name":"正装裤"},{"gc_id":"24","gc_name":"西服"},{"gc_id":"25","gc_name":"短外套"},{"gc_id":"26","gc_name":"风衣"},{"gc_id":"27","gc_name":"大衣"},{"gc_id":"28","gc_name":"皮衣皮草"},{"gc_id":"29","gc_name":"棉服"},{"gc_id":"30","gc_name":"羽绒服"},{"gc_id":"31","gc_name":"孕妇装"},{"gc_id":"32","gc_name":"大码装"},{"gc_id":"33","gc_name":"中老年装"},{"gc_id":"34","gc_name":"婚纱礼服"},{"gc_id":"1053","gc_name":"女装"}]},{"gc_id":"5","gc_name":"男装","child":[{"gc_id":"35","gc_name":"衬衫"},{"gc_id":"36","gc_name":"T恤"},{"gc_id":"37","gc_name":"POLO衫"},{"gc_id":"38","gc_name":"针织衫"},{"gc_id":"39","gc_name":"羊绒衫"},{"gc_id":"40","gc_name":"卫衣"},{"gc_id":"41","gc_name":"马甲/背心"},{"gc_id":"42","gc_name":"夹克"},{"gc_id":"43","gc_name":"风衣"},{"gc_id":"44","gc_name":"大衣"},{"gc_id":"45","gc_name":"皮衣"},{"gc_id":"46","gc_name":"外套"},{"gc_id":"47","gc_name":"西服"},{"gc_id":"48","gc_name":"棉服"},{"gc_id":"49","gc_name":"羽绒服"},{"gc_id":"50","gc_name":"牛仔裤"},{"gc_id":"51","gc_name":"休闲裤"},{"gc_id":"52","gc_name":"西裤"},{"gc_id":"53","gc_name":"西服套装"},{"gc_id":"54","gc_name":"大码装"},{"gc_id":"55","gc_name":"中老年装"},{"gc_id":"56","gc_name":"唐装"},{"gc_id":"57","gc_name":"工装"}]},{"gc_id":"6","gc_name":"内衣","child":[{"gc_id":"58","gc_name":"文胸"},{"gc_id":"59","gc_name":"女式内裤"},{"gc_id":"60","gc_name":"男式内裤"},{"gc_id":"61","gc_name":"家居"},{"gc_id":"62","gc_name":"睡衣"},{"gc_id":"63","gc_name":"塑身衣"},{"gc_id":"64","gc_name":"睡袍/浴袍"},{"gc_id":"65","gc_name":"泳衣"},{"gc_id":"66","gc_name":"背心"},{"gc_id":"67","gc_name":"抹胸"},{"gc_id":"68","gc_name":"连裤袜"},{"gc_id":"69","gc_name":"美腿袜"},{"gc_id":"70","gc_name":"男袜"},{"gc_id":"71","gc_name":"女袜"},{"gc_id":"72","gc_name":"情趣内衣"},{"gc_id":"73","gc_name":"保暖内衣"}]},{"gc_id":"7","gc_name":"运动","child":[{"gc_id":"74","gc_name":"休闲鞋"},{"gc_id":"75","gc_name":"帆布鞋"},{"gc_id":"76","gc_name":"跑步鞋"},{"gc_id":"77","gc_name":"篮球鞋"},{"gc_id":"78","gc_name":"足球鞋"},{"gc_id":"79","gc_name":"训练鞋"},{"gc_id":"80","gc_name":"乒羽鞋"},{"gc_id":"81","gc_name":"拖鞋"},{"gc_id":"82","gc_name":"卫衣"},{"gc_id":"83","gc_name":"夹克"},{"gc_id":"84","gc_name":"T恤"},{"gc_id":"85","gc_name":"棉服/羽绒服"},{"gc_id":"86","gc_name":"运动裤"},{"gc_id":"87","gc_name":"套装"},{"gc_id":"88","gc_name":"运动包"},{"gc_id":"89","gc_name":"运动配件"}]},{"gc_id":"8","gc_name":"女鞋","child":[{"gc_id":"90","gc_name":"平底鞋"},{"gc_id":"91","gc_name":"高跟鞋"},{"gc_id":"92","gc_name":"单鞋"},{"gc_id":"93","gc_name":"休闲鞋"},{"gc_id":"94","gc_name":"凉鞋"},{"gc_id":"95","gc_name":"女靴"},{"gc_id":"96","gc_name":"雪地靴"},{"gc_id":"97","gc_name":"拖鞋"},{"gc_id":"98","gc_name":"裸靴"},{"gc_id":"99","gc_name":"筒靴"},{"gc_id":"100","gc_name":"帆布鞋"},{"gc_id":"101","gc_name":"雨鞋/雨靴"},{"gc_id":"102","gc_name":"妈妈鞋"},{"gc_id":"103","gc_name":"鞋配件"},{"gc_id":"104","gc_name":"特色鞋"},{"gc_id":"105","gc_name":"鱼嘴鞋"},{"gc_id":"106","gc_name":"布鞋/绣花鞋"}]},{"gc_id":"9","gc_name":"男鞋","child":[{"gc_id":"107","gc_name":"商务休闲鞋"},{"gc_id":"108","gc_name":"正装鞋"},{"gc_id":"109","gc_name":"休闲鞋"},{"gc_id":"110","gc_name":"凉鞋/沙滩鞋"},{"gc_id":"111","gc_name":"男靴"},{"gc_id":"112","gc_name":"功能鞋"},{"gc_id":"113","gc_name":"拖鞋"},{"gc_id":"114","gc_name":"传统布鞋"},{"gc_id":"115","gc_name":"鞋配件"},{"gc_id":"116","gc_name":"帆布鞋"},{"gc_id":"117","gc_name":"豆豆鞋"},{"gc_id":"118","gc_name":"驾车鞋"}]},{"gc_id":"10","gc_name":"配饰","child":[{"gc_id":"119","gc_name":"太阳镜"},{"gc_id":"120","gc_name":"框镜"},{"gc_id":"121","gc_name":"皮带"},{"gc_id":"122","gc_name":"围巾"},{"gc_id":"123","gc_name":"手套"},{"gc_id":"124","gc_name":"帽子"},{"gc_id":"125","gc_name":"领带"},{"gc_id":"126","gc_name":"袖扣"},{"gc_id":"127","gc_name":"其他配件"},{"gc_id":"128","gc_name":"丝巾"},{"gc_id":"129","gc_name":"披肩"},{"gc_id":"130","gc_name":"腰带"},{"gc_id":"131","gc_name":"腰链/腰封"},{"gc_id":"132","gc_name":"棒球帽"},{"gc_id":"133","gc_name":"毛线"},{"gc_id":"134","gc_name":"遮阳帽"},{"gc_id":"135","gc_name":"防紫外线手套"},{"gc_id":"136","gc_name":"草帽"}]},{"gc_id":"11","gc_name":"童装","child":[{"gc_id":"137","gc_name":"套装"},{"gc_id":"138","gc_name":"上衣"},{"gc_id":"139","gc_name":"裤子"},{"gc_id":"140","gc_name":"裙子"},{"gc_id":"141","gc_name":"内衣/家居服"},{"gc_id":"142","gc_name":"羽绒服/棉服"},{"gc_id":"143","gc_name":"亲子装"},{"gc_id":"144","gc_name":"儿童配饰"},{"gc_id":"145","gc_name":"礼服/演出服"},{"gc_id":"146","gc_name":"运动鞋"},{"gc_id":"147","gc_name":"单鞋"},{"gc_id":"148","gc_name":"靴子"},{"gc_id":"149","gc_name":"凉鞋"},{"gc_id":"150","gc_name":"功能鞋"}]}]}
*/
private int code;
private DatasBean datas;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public DatasBean getDatas() {
return datas;
}
public void setDatas(DatasBean datas) {
this.datas = datas;
}
public static class DatasBean {
private List<ClassListBean> class_list;
public List<ClassListBean> getClass_list() {
return class_list;
}
public void setClass_list(List<ClassListBean> class_list) {
this.class_list = class_list;
}
public static class ClassListBean {
/**
* gc_id : 4
* gc_name : 女装
* child : [{"gc_id":"12","gc_name":"T恤"},{"gc_id":"13","gc_name":"衬衫"},{"gc_id":"14","gc_name":"针织衫"},{"gc_id":"15","gc_name":"雪纺衫"},{"gc_id":"16","gc_name":"卫衣"},{"gc_id":"17","gc_name":"马甲"},{"gc_id":"18","gc_name":"连衣裙"},{"gc_id":"19","gc_name":"半身裙"},{"gc_id":"20","gc_name":"牛仔裤"},{"gc_id":"21","gc_name":"休闲裤"},{"gc_id":"22","gc_name":"打底裤"},{"gc_id":"23","gc_name":"正装裤"},{"gc_id":"24","gc_name":"西服"},{"gc_id":"25","gc_name":"短外套"},{"gc_id":"26","gc_name":"风衣"},{"gc_id":"27","gc_name":"大衣"},{"gc_id":"28","gc_name":"皮衣皮草"},{"gc_id":"29","gc_name":"棉服"},{"gc_id":"30","gc_name":"羽绒服"},{"gc_id":"31","gc_name":"孕妇装"},{"gc_id":"32","gc_name":"大码装"},{"gc_id":"33","gc_name":"中老年装"},{"gc_id":"34","gc_name":"婚纱礼服"},{"gc_id":"1053","gc_name":"女装"}]
*/
private String gc_id;
private String gc_name;
private List<ChildBean> child;
public String getGc_id() {
return gc_id;
}
public void setGc_id(String gc_id) {
this.gc_id = gc_id;
}
public String getGc_name() {
return gc_name;
}
public void setGc_name(String gc_name) {
this.gc_name = gc_name;
}
public List<ChildBean> getChild() {
return child;
}
public void setChild(List<ChildBean> child) {
this.child = child;
}
public static class ChildBean {
/**
* gc_id : 12
* gc_name : T恤
*/
private String gc_id;
private String gc_name;
public String getGc_id() {
return gc_id;
}
public void setGc_id(String gc_id) {
this.gc_id = gc_id;
}
public String getGc_name() {
return gc_name;
}
public void setGc_name(String gc_name) {
this.gc_name = gc_name;
}
}
}
}