//所用的依赖
compile 'com.hjm:BottomTabBar:1.1.1' compile 'com.facebook.fresco:fresco:0.11.0' compile 'com.jakewharton:butterknife:8.8.1' annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1' compile 'com.squareup.retrofit2:converter-gson:2.2.0' compile 'com.squareup.retrofit2:adapter-rxjava2:2.2.0' compile 'io.reactivex.rxjava2:rxandroid:2.0.1' compile 'com.squareup.retrofit2:retrofit:2.2.0' compile 'io.reactivex.rxjava2:rxjava:2.0.7' compile 'com.squareup.okhttp3:okhttp:3.7.0' compile 'com.squareup.okhttp3:logging-interceptor:3.6.0' compile 'com.youth.banner:banner:1.4.9' compile 'com.github.bumptech.glide:glide:3.7.0' compile 'com.android.support:recyclerview-v7:26.1.0' compile 'de.greenrobot:eventbus:3.0.0-beta1'
*******************
Model层
public interface ICartsModel { void cart(String uid, String source, OnNetListner<CartsBean> onNetListner); }
************************************
public class CartsMdoel implements ICartsModel{ @Override public void cart(String uid, String source, final OnNetListner<CartsBean> onNetListner) { Observable<CartsBean> carts = Retrofitss.getServer().carts(uid, source); carts.observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()) .subscribe(new Observer<CartsBean>() { @Override public void onSubscribe(Disposable d) { } @Override public void onNext(CartsBean cartsBean) { onNetListner.onSuccess(cartsBean); } @Override public void onError(Throwable e) { onNetListner.onFailed((Exception) e); } @Override public void onComplete() { } }); } }
****************************************
P层的代码
public class CartsPresenter { private IShopping activity; private final ICartsModel model; public CartsPresenter(IShopping activity) { this.activity = activity; model = new CartsMdoel(); } public void onDestroys() { if (activity != null) { activity = null; } } public void getcarts(String uid, String source) { model.cart(uid, source, new OnNetListner<CartsBean>() { @Override public void onSuccess(CartsBean cartsBean) { if (activity != null) { List<CartsBean.DataBean> group = cartsBean.getData(); List<List<CartsBean.DataBean.ListBean>> chiled = new ArrayList<>(); for (int i = 0; i <group.size() ; i++) { List<CartsBean.DataBean.ListBean> list = group.get(i).getList(); chiled.add(list); } activity.show(group,chiled); } } @Override public void onFailed(Exception e) { } }); } } ******************* //View层
public interface IShopping { void show(List<CartsBean.DataBean> group,List<List<CartsBean.DataBean.ListBean>> child); }*************************************
import java.util.List; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.Unbinder; import de.greenrobot.event.EventBus; import de.greenrobot.event.Subscribe; /** * 姓名: * 日期: * 类作用: */ public class ShoppingFragment extends Fragment implements IShopping { @BindView(R.id.shop_elv) ExpandableListView shopElv; @BindView(R.id.shop_quanxuan) CheckBox shopQuanxuan; @BindView(R.id.shop_zongjia) TextView shopZongjia; @BindView(R.id.shop_count) TextView shopCount; Unbinder unbinder; private CartsPresenter presenter; private MyExpandebleAdapter adapter; @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View inflate = inflater.inflate(R.layout.shoppingfragment, container, false); unbinder = ButterKnife.bind(this, inflate); presenter = new CartsPresenter(this); //这个就是储存uid的过程,参考
/* @Override public void TZ(SingnBean singnBean) { SharedPreferences sp = getSharedPreferences("UIDS", Context.MODE_PRIVATE); SharedPreferences.Editor edit = sp.edit(); edit.putString("uid",singnBean.getData().getUid()+""); edit.commit(); startActivity(new Intent(SignActivity.this, MainActivity.class)); }*/
//这个uid是自己登陆的uid,考试给的一般是uid=71SharedPreferences sp = getActivity().getSharedPreferences( "UIDS", Context. MODE_PRIVATE); String uid = sp.getString( "uid", "");
presenter.getcarts(uid, "android"); EventBus. getDefault().register( this); shopQuanxuan.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { adapter.qx( shopQuanxuan.isChecked()); } }); return inflate; } @Override public void onDestroyView() { super.onDestroyView(); unbinder.unbind(); presenter.onDestroys(); } @Override public void show(List<CartsBean.DataBean> group, List<List<CartsBean.DataBean.ListBean>> child) { adapter = new MyExpandebleAdapter(getActivity(), group, child); shopElv.setAdapter( adapter); for ( int i = 0; i < group.size(); i++) { shopElv.expandGroup(i); } } @Subscribe public void onPriceAndCount1(CountAndPrice cp) { shopZongjia.setText( "共" + cp.getCount() + "件商品"); shopCount.setText( "总计" + cp.getPrice()); }
********************************************
//他的xml
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <ExpandableListView android:id="@+id/shop_elv" android:layout_above="@+id/lls" android:layout_width="wrap_content" android:layout_height="wrap_content"/> <LinearLayout android:id="@+id/lls" android:layout_alignParentBottom="true" android:layout_width="match_parent" android:layout_height="50dp" android:gravity="center_vertical" android:orientation="horizontal"> <CheckBox android:id="@+id/shop_quanxuan" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="全选"/> <LinearLayout android:layout_marginLeft="70dp" android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content"> <TextView android:id="@+id/shop_zongjia" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="总价:0.0"/> <TextView android:text="共0件商品" android:id="@+id/shop_count" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> <TextView android:text="去结算" android:background="#FFD82020" android:layout_marginLeft="120dp" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> </RelativeLayout>***************************
Adapter里的逻辑
public class MyExpandebleAdapter extends BaseExpandableListAdapter { private Context context; private List<CartsBean.DataBean> group; private List<List<CartsBean.DataBean.ListBean>> chiled; public MyExpandebleAdapter(Context context, List<CartsBean.DataBean> group, List<List<CartsBean.DataBean.ListBean>> chiled) { this.context = context; this.group = group; this.chiled = chiled; } @Override public int getGroupCount() { return group.size(); } @Override public int getChildrenCount(int groupPosition) { return chiled.get(groupPosition).size(); } @Override public Object getGroup(int groupPosition) { return group.get(groupPosition); } @Override public Object getChild(int groupPosition, int childPosition) { return chiled.get(groupPosition).get(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) { View views; final GroupViewHolder holder; if (convertView == null) { holder = new GroupViewHolder(); views = View.inflate(context, R.layout.carts_group, null); holder.gr_checkBox = views.findViewById(R.id.carts_check ); holder.gr_title = views.findViewById(R.id.carts_tv); views.setTag(holder); } else { views = convertView; holder = (GroupViewHolder) views.getTag(); } final CartsBean.DataBean dataBean = group.get(groupPosition); holder.gr_title.setText(dataBean.getSellerName()); holder.gr_checkBox.setChecked(dataBean.isChecked()); //一级列表的点击事件 holder.gr_checkBox.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { dataBean.setChecked(holder.gr_checkBox.isChecked()); changeChildState(groupPosition, holder.gr_checkBox.isChecked()); EventBus.getDefault().post(js()); changeMianQXstatus(checkGroupAll()); notifyDataSetChanged(); } }); return views; } @Override public View getChildView(final int groupPosition, final int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { final ChileViewHolder chileViewHolder; View inflate; if (convertView == null) { chileViewHolder = new ChileViewHolder(); inflate = View.inflate(context, R.layout.carts_chiled, null); chileViewHolder.chi_check = inflate.findViewById(R.id.chi_check); chileViewHolder.chi_add = inflate.findViewById(R.id.chi_add); chileViewHolder.chi_jian = inflate.findViewById(R.id.chi_jian); chileViewHolder.chi_del = inflate.findViewById(R.id.chi_del); chileViewHolder.chi_im = inflate.findViewById(R.id.chi_im); chileViewHolder.chi_num = inflate.findViewById(R.id.chi_num); chileViewHolder.chi_price = inflate.findViewById(R.id.chi_price); chileViewHolder.chi_title = inflate.findViewById(R.id.chi_title); chileViewHolder.chi_yanse = inflate.findViewById(R.id.chi_yanse); inflate.setTag(chileViewHolder); } else { inflate = convertView; chileViewHolder = (ChileViewHolder) inflate.getTag(); } final CartsBean.DataBean.ListBean listBean = chiled.get(groupPosition).get(childPosition); int price = (int) listBean.getPrice(); chileViewHolder.chi_check.setChecked(listBean.isCheckeds()); chileViewHolder.chi_price.setText("¥" + price); String title = listBean.getTitle(); chileViewHolder.chi_title.setText(title); String subhead = listBean.getSubhead().substring(1, 10) + "....."; chileViewHolder.chi_yanse.setText(subhead); String[] split = listBean.getImages().split("\\|"); Uri parse = Uri.parse(split[0]); chileViewHolder.chi_im.setImageURI(parse); //给子条目的check设置点击事件 chileViewHolder.chi_check.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { listBean.setCheckeds(chileViewHolder.chi_check.isChecked()); EventBus.getDefault().post(js()); //如果二级列表选中,一级列表也选中 if (chileViewHolder.chi_check.isChecked()) { if (ischeckAllchild(groupPosition)) { //改变一级列表的选中状态 changeGroupstatus(groupPosition, true); changeMianQXstatus(checkGroupAll()); } }else { changeGroupstatus(groupPosition, false); changeMianQXstatus(checkGroupAll()); } notifyDataSetChanged(); } }); //点击加加功能 chileViewHolder.chi_add.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { int cou = listBean.getCou(); chileViewHolder.chi_num.setText(++cou + ""); listBean.setCou(cou); if (chileViewHolder.chi_check.isChecked()) { EventBus.getDefault().post(js()); } } }); //点击减减 chileViewHolder.chi_jian.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { int cou = listBean.getCou(); if (cou == 1) { Toast.makeText(context, "最小数量为1", Toast.LENGTH_LONG).show(); return; } chileViewHolder.chi_num.setText(--cou + ""); listBean.setCou(cou); if (chileViewHolder.chi_check.isChecked()) { EventBus.getDefault().post(js()); } } }); //点击删除 chileViewHolder.chi_del.setOnClickListener(new View.OnClickListener() { private AlertDialog dialog; @Override public void onClick(View v) { /*List<CartsBean.DataBean.ListBean> listBeans = chiled.get(groupPosition); CartsBean.DataBean.ListBean remove = listBeans.remove(childPosition); if (listBeans.size() == 0) { chiled.remove(childPosition); group.remove(groupPosition); } EventBus.getDefault().post(js()); notifyDataSetChanged();*/ final List<CartsBean.DataBean.ListBean> listBeans = chiled.get(groupPosition); AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle("提示"); builder.setMessage("确认是否删除?"); builder.setPositiveButton("确定", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { CartsBean.DataBean.ListBean remove = listBeans.remove(childPosition); if (listBeans.size()==0){ chiled.remove(groupPosition); group.remove(groupPosition); } EventBus.getDefault().post(js()); notifyDataSetChanged(); } }); builder.setNegativeButton("取消", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); dialog = builder.create(); dialog.show(); } }); return inflate; } @Override public boolean isChildSelectable(int groupPosition, int childPosition) { return true; } class GroupViewHolder { CheckBox gr_checkBox; TextView gr_title; } class ChileViewHolder { CheckBox chi_check; TextView chi_title; SimpleDraweeView chi_im; TextView chi_price, chi_yanse, chi_num,chi_del; ImageView chi_add, chi_jian; } //改变所有子item的选中状态 private void changeChildState(int groupPosition, boolean flag) { List<CartsBean.DataBean.ListBean> listBeans = chiled.get(groupPosition); for (int i = 0; i < listBeans.size(); i++) { listBeans.get(i).setCheckeds(flag); } } private CountAndPrice js() { int cou = 0; int jiage = 0; for (int i = 0; i < group.size(); i++) { for (int j = 0; j < chiled.get(i).size(); j++) { CartsBean.DataBean.ListBean listBean = chiled.get(i).get(j); if (listBean.isCheckeds()) { cou += listBean.getCou(); jiage += (int)listBean.getPrice() * listBean.getCou(); } } } CountAndPrice countAndPrice = new CountAndPrice(); countAndPrice.setCount(cou); countAndPrice.setPrice(jiage); return countAndPrice; } //判断是否全部选中 private boolean checkGroupAll() { for (int i = 0; i < group.size(); i++) { if (!group.get(i).isChecked()) { return false; } } return true; } //改变全选状态 private void changeMianQXstatus(boolean flag) { MessgeEvent messgeEvent = new MessgeEvent(); messgeEvent.setCheck(flag); EventBus.getDefault().post(messgeEvent); } //判断二级列表是否选中 private boolean ischeckAllchild(int groups) { List<CartsBean.DataBean.ListBean> listBeans = chiled.get(groups); for (int i = 0; i < listBeans.size(); i++) { CartsBean.DataBean.ListBean listBean = listBeans.get(i); if (!listBean.isCheckeds()) { return false; } } return true; } //改变一级列表的状态 private void changeGroupstatus(int groups, boolean flag) { CartsBean.DataBean dataBean = group.get(groups); dataBean.setChecked(flag); } public void qx(boolean flag){ for (int i = 0; i <group.size() ; i++) { changeGroupstatus(i,flag); changeChildState(i,flag); } EventBus.getDefault().post(js()); notifyDataSetChanged(); } } *************************** //里面用的两个xml布局 一级列表的xml
<?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"> <CheckBox android:id="@+id/carts_check" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <TextView android:id="@+id/carts_tv" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dp" /> </LinearLayout> **********************************************二级列表的xml
<?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="vertical"> <TextView android:id="@+id/chi_title" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="20dp" /> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal"> <CheckBox android:id="@+id/chi_check" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="20dp" android:gravity="center_vertical" /> <com.facebook.drawee.view.SimpleDraweeView android:id="@+id/chi_im" android:layout_width="50dp" android:layout_height="50dp" android:gravity="center_vertical" /> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dp" android:orientation="vertical"> <TextView android:id="@+id/chi_price" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dp" /> <TextView android:id="@+id/chi_yanse" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="100dp" android:orientation="horizontal"> <ImageView android:id="@+id/chi_add" android:layout_width="20dp" android:layout_height="20dp" android:src="@drawable/iv_add" /> <TextView android:id="@+id/chi_num" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="5dp" android:paddingBottom="2dp" android:paddingLeft="20dp" android:paddingRight="20dp" android:paddingTop="2dp" android:text="1" /> <ImageView android:id="@+id/chi_jian" android:layout_width="20dp" android:layout_height="20dp" android:src="@drawable/iv_del" /> </LinearLayout> </LinearLayout> <TextView android:id="@+id/chi_del" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="20dp" android:textSize="15dp" android:textColor="#f00" android:text="删除" /> </LinearLayout> </LinearLayout>/
定义价格和数量的类
public class CountAndPrice { private int count; private int price; public int getCount() { return count; } public void setCount(int count) { this.count = count; } public int getPrice() { return price; } public void setPrice(int price) { this.price = price; } }//
Eventbus所用的类
public class MessgeEvent { private boolean check; public boolean isCheck() { return check; } public void setCheck(boolean check) { this.check = check; } } // 最后他的been,主要就是我们在been的一级和二级列表自己分别写了一个checked用来判断选中状态
package com.example.jingdong.shopping.bean; import android.widget.CheckBox; import java.util.List; /** * 姓名: * 日期: * 类作用: */ public class CartsBean { /** * msg : 请求成功 * code : 0 * data : [{"list":[{"bargainPrice":99,"createtime":"2017-10-14T21:38:26","detailUrl":"https://item.m.jd.com/product/4345173.html?utm#_source=androidapp&utm#_medium=appshare&utm#_campaign=t#_335139774&utm#_term=QQfriends","images":"https://m.360buyimg.com/n0/jfs/t6037/35/2944615848/95178/6cd6cff0/594a3a10Na4ec7f39.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t6607/258/1025744923/75738/da120a2d/594a3a12Ne3e6bc56.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t6370/292/1057025420/64655/f87644e3/594a3a12N5b900606.jpg!q70.jpg","num":3,"pid":45,"price":2999,"pscid":39,"selected":0,"sellerid":1,"subhead":"高清双摄,就是清晰!2000+1600万高清摄像头,6GB大内存+高通骁龙835处理器,性能怪兽!","title":"一加手机5 (A5000) 6GB+64GB 月岩灰 全网通 双卡双待 移动联通电信4G手机"}],"sellerName":"商家1","sellerid":"1"},{"list":[{"bargainPrice":5599,"createtime":"2017-10-10T17:30:32","detailUrl":"https://item.m.jd.com/product/4824715.html?utm#_source=androidapp&utm#_medium=appshare&utm#_campaign=t#_335139774&utm#_term=QQfriends","images":"https://m.360buyimg.com/n12/jfs/t7768/184/1153704394/148460/f42e1432/599a930fN8a85626b.jpg!q70.jpg","num":1,"pid":59,"price":5599,"pscid":40,"selected":0,"sellerid":3,"subhead":"游戏本选择4G独显,拒绝掉帧】升级版IPS全高清防眩光显示屏,WASD方向键颜色加持,三大出风口立体散热!","title":"戴尔DELL灵越游匣15PR-6648B GTX1050 15.6英寸游戏笔记本电脑(i5-7300HQ 8G 128GSSD+1T 4G独显 IPS)黑"},{"bargainPrice":1599,"createtime":"2017-10-14T21:48:08","detailUrl":"https://item.m.jd.com/product/1993026402.html?utm#_source=androidapp&utm#_medium=appshare&utm#_campaign=t#_335139774&utm#_term=QQfriends","images":"https://m.360buyimg.com/n0/jfs/t5863/302/8961270302/97126/41feade1/5981c81cNc1b1fbef.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t7003/250/1488538438/195825/53bf31ba/5981c57eN51e95176.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t5665/100/8954482513/43454/418611a9/5981c57eNd5fc97ba.jpg!q70.jpg","num":4,"pid":47,"price":111,"pscid":39,"selected":0,"sellerid":3,"subhead":"碳黑色 32GB 全网通 官方标配 1件","title":"锤子 坚果Pro 特别版 巧克力色 酒红色 全网通 移动联通电信4G手机 双卡双待 碳黑色 32GB 全网通"}],"sellerName":"商家3","sellerid":"3"},{"list":[{"bargainPrice":11800,"createtime":"2017-10-14T21:48:08","detailUrl":"https://mitem.jd.hk/ware/view.action?wareId=1988853309&cachekey=1acb07a701ece8d2434a6ae7fa6870a1","images":"https://m.360buyimg.com/n0/jfs/t6130/97/1370670410/180682/1109582a/593276b1Nd81fe723.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t5698/110/2617517836/202970/c9388feb/593276b7Nbd94ef1f.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t5698/110/2617517836/202970/c9388feb/593276b7Nbd94ef1f.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t5815/178/2614671118/51656/7f52d137/593276c7N107b725a.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t5878/60/2557817477/30873/4502b606/593276caN5a7d6357.jpg!q70.jpg","num":1,"pid":60,"price":13888,"pscid":40,"selected":0,"sellerid":4,"subhead":"购买电脑办公部分商品满1元返火车票5元优惠券(返完即止)","title":"全球购 新款Apple MacBook Pro 苹果笔记本电脑 银色VP2新13英寸Bar i5/8G/256G"},{"bargainPrice":3455,"createtime":"2017-10-14T21:38:26","detailUrl":"https://item.m.jd.com/product/12224420750.html?utm_source=androidapp&utm_medium=appshare&utm_campaign=t_335139774&utm_term=QQfriends","images":"https://m.360buyimg.com/n0/jfs/t9106/106/1785172479/537280/253bc0ab/59bf78a7N057e5ff7.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t9106/106/1785172479/537280/253bc0ab/59bf78a7N057e5ff7.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t8461/5/1492479653/68388/7255e013/59ba5e84N91091843.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t8461/5/1492479653/68388/7255e013/59ba5e84N91091843.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t8803/356/1478945529/489755/2a163ace/59ba5e84N7bb9a666.jpg!q70.jpg","num":2,"pid":48,"price":222,"pscid":39,"selected":0,"sellerid":4,"subhead":"【现货新品抢购】全面屏2.0震撼来袭,骁龙835处理器,四曲面陶瓷机","title":"小米(MI) 小米MIX2 手机 黑色 全网通 (6GB+64GB)【标配版】"}],"sellerName":"商家4","sellerid":"4"},{"list":[{"bargainPrice":3455,"createtime":"2017-10-14T21:38:26","detailUrl":"https://item.m.jd.com/product/12224420750.html?utm_source=androidapp&utm_medium=appshare&utm_campaign=t_335139774&utm_term=QQfriends","images":"https://m.360buyimg.com/n0/jfs/t9106/106/1785172479/537280/253bc0ab/59bf78a7N057e5ff7.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t9106/106/1785172479/537280/253bc0ab/59bf78a7N057e5ff7.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t8461/5/1492479653/68388/7255e013/59ba5e84N91091843.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t8461/5/1492479653/68388/7255e013/59ba5e84N91091843.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t8803/356/1478945529/489755/2a163ace/59ba5e84N7bb9a666.jpg!q70.jpg","num":1,"pid":51,"price":555,"pscid":39,"selected":0,"sellerid":7,"subhead":"【现货新品抢购】全面屏2.0震撼来袭,骁龙835处理器,四曲面陶瓷机","title":"小米(MI) 小米MIX2 手机 黑色 全网通 (6GB+64GB)【标配版】"}],"sellerName":"商家7","sellerid":"7"},{"list":[{"bargainPrice":2999,"createtime":"2017-10-14T21:48:08","detailUrl":"https://item.m.jd.com/product/2385655.html?utm#_source=androidapp&utm#_medium=appshare&utm#_campaign=t#_335139774&utm#_term=QQfriends","images":"https://m.360buyimg.com/n0/jfs/t2068/298/2448145915/157953/7be197df/56d51a42Nd86f1c8e.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t2437/128/1687178395/117431/bcc190c1/56d3fcbaNb2963d21.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t2467/222/2263160610/95597/927b8a2f/56d3eafeNdecebeb6.jpg!q70.jpg","num":2,"pid":53,"price":777,"pscid":39,"selected":0,"sellerid":9,"subhead":"Super AMOLED三星双曲面2K 屏,支持无线充电!","title":"三星 Galaxy S7 edge(G9350)4GB+32GB 铂光金 移动联通电信4G手机 双卡双待"},{"bargainPrice":159,"createtime":"2017-10-14T21:49:15","detailUrl":"https://item.m.jd.com/product/5061723.html?utm_source=androidapp&utm_medium=appshare&utm_campaign=t_335139774&utm_term=QQfriends","images":"https://m.360buyimg.com/n0/jfs/t8716/197/1271594444/173291/2f40bb4f/59b743bcN8509428e.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t8347/264/1286771527/92188/5cf5ec04/59b7420fN65378e9e.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t7363/165/3000956253/190883/179a372/59b743bfNd0c79d93.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t7399/112/2935531768/183594/b77c7d4a/59b7441aNc3d40133.jpg!q70.jpg","num":1,"pid":98,"price":1900,"pscid":112,"selected":0,"sellerid":9,"subhead":"针织针织闪闪闪亮你的眼","title":"维迩旎 2017秋冬新款长袖针织连衣裙韩版气质中长款名媛包臀A字裙 zx179709 黑色 XL"}],"sellerName":"商家9","sellerid":"9"},{"list":[{"bargainPrice":111.99,"createtime":"2017-10-03T23:53:28","detailUrl":"https://item.m.jd.com/product/4719303.html?utm_source=androidapp&utm_medium=appshare&utm_campaign=t_335139774&utm_term=QQfriends","images":"https://m.360buyimg.com/n0/jfs/t9004/210/1160833155/647627/ad6be059/59b4f4e1N9a2b1532.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t7504/338/63721388/491286/f5957f53/598e95f1N7f2adb87.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t7441/10/64242474/419246/adb30a7d/598e95fbNd989ba0a.jpg!q70.jpg","num":1,"pid":17,"price":299,"pscid":1,"selected":0,"sellerid":10,"subhead":"每个中秋都不能简单,无论身在何处,你总需要一块饼让生活更圆满,京东月饼让爱更圆满京东自营,闪电配送,更多惊喜,快用手指戳一下","title":"北京稻香村 稻香村中秋节月饼 老北京月饼礼盒655g"},{"bargainPrice":11800,"createtime":"2017-10-14T21:38:26","detailUrl":"https://mitem.jd.hk/ware/view.action?wareId=1988853309&cachekey=1acb07a701ece8d2434a6ae7fa6870a1","images":"https://m.360buyimg.com/n0/jfs/t6130/97/1370670410/180682/1109582a/593276b1Nd81fe723.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t5698/110/2617517836/202970/c9388feb/593276b7Nbd94ef1f.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t5698/110/2617517836/202970/c9388feb/593276b7Nbd94ef1f.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t5815/178/2614671118/51656/7f52d137/593276c7N107b725a.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t5878/60/2557817477/30873/4502b606/593276caN5a7d6357.jpg!q70.jpg","num":1,"pid":66,"price":13000,"pscid":40,"selected":0,"sellerid":10,"subhead":"购买电脑办公部分商品满1元返火车票5元优惠券(返完即止)","title":"全球购 新款Apple MacBook Pro 苹果笔记本电脑 银色VP2新13英寸Bar i5/8G/256G"}],"sellerName":"商家10","sellerid":"10"},{"list":[{"bargainPrice":11800,"createtime":"2017-10-14T21:48:08","detailUrl":"https://mitem.jd.hk/ware/view.action?wareId=1988853309&cachekey=1acb07a701ece8d2434a6ae7fa6870a1","images":"https://m.360buyimg.com/n0/jfs/t6130/97/1370670410/180682/1109582a/593276b1Nd81fe723.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t5698/110/2617517836/202970/c9388feb/593276b7Nbd94ef1f.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t5698/110/2617517836/202970/c9388feb/593276b7Nbd94ef1f.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t5815/178/2614671118/51656/7f52d137/593276c7N107b725a.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t5878/60/2557817477/30873/4502b606/593276caN5a7d6357.jpg!q70.jpg","num":1,"pid":68,"price":15000,"pscid":40,"selected":0,"sellerid":12,"subhead":"购买电脑办公部分商品满1元返火车票5元优惠券(返完即止)","title":"全球购 新款Apple MacBook Pro 苹果笔记本电脑 银色VP2新13英寸Bar i5/8G/256G"}],"sellerName":"商家12","sellerid":"12"},{"list":[{"bargainPrice":111.99,"createtime":"2017-10-03T23:53:28","detailUrl":"https://item.m.jd.com/product/4719303.html?utm_source=androidapp&utm_medium=appshare&utm_campaign=t_335139774&utm_term=QQfriends","images":"https://m.360buyimg.com/n0/jfs/t9004/210/1160833155/647627/ad6be059/59b4f4e1N9a2b1532.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t7504/338/63721388/491286/f5957f53/598e95f1N7f2adb87.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t7441/10/64242474/419246/adb30a7d/598e95fbNd989ba0a.jpg!q70.jpg","num":1,"pid":21,"price":699,"pscid":1,"selected":0,"sellerid":14,"subhead":"每个中秋都不能简单,无论身在何处,你总需要一块饼让生活更圆满,京东月饼让爱更圆满京东自营,闪电配送,更多惊喜,快用手指戳一下","title":"北京稻香村 稻香村中秋节月饼 老北京月饼礼盒655g"}],"sellerName":"商家14","sellerid":"14"},{"list":[{"bargainPrice":111.99,"createtime":"2017-10-14T21:39:05","detailUrl":"https://item.m.jd.com/product/4719303.html?utm_source=androidapp&utm_medium=appshare&utm_campaign=t_335139774&utm_term=QQfriends","images":"https://m.360buyimg.com/n0/jfs/t9004/210/1160833155/647627/ad6be059/59b4f4e1N9a2b1532.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t7504/338/63721388/491286/f5957f53/598e95f1N7f2adb87.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t7441/10/64242474/419246/adb30a7d/598e95fbNd989ba0a.jpg!q70.jpg","num":1,"pid":1,"price":118,"pscid":1,"selected":0,"sellerid":17,"subhead":"每个中秋都不能简单,无论身在何处,你总需要一块饼让生活更圆满,京东月饼让爱更圆满京东自营,闪电配送,更多惊喜,快用手指戳一下","title":"北京稻香村 稻香村中秋节月饼 老北京月饼礼盒655g"}],"sellerName":"商家17","sellerid":"17"},{"list":[{"bargainPrice":111.99,"createtime":"2017-10-03T23:53:28","detailUrl":"https://item.m.jd.com/product/4719303.html?utm_source=androidapp&utm_medium=appshare&utm_campaign=t_335139774&utm_term=QQfriends","images":"https://m.360buyimg.com/n0/jfs/t9004/210/1160833155/647627/ad6be059/59b4f4e1N9a2b1532.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t7504/338/63721388/491286/f5957f53/598e95f1N7f2adb87.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t7441/10/64242474/419246/adb30a7d/598e95fbNd989ba0a.jpg!q70.jpg","num":2,"pid":3,"price":198,"pscid":1,"selected":0,"sellerid":19,"subhead":"每个中秋都不能简单,无论身在何处,你总需要一块饼让生活更圆满,京东月饼让爱更圆满京东自营,闪电配送,更多惊喜,快用手指戳一下","title":"北京稻香村 稻香村中秋节月饼 老北京月饼礼盒655g"}],"sellerName":"商家19","sellerid":"19"},{"list":[{"bargainPrice":22.9,"createtime":"2017-10-03T23:53:28","detailUrl":"https://item.m.jd.com/product/2542855.html?utm_source=androidapp&utm_medium=appshare&utm_campaign=t_335139774&utm_term=QQfriends","images":"https://m.360buyimg.com/n0/jfs/t1930/284/2865629620/390243/e3ade9c4/56f0a08fNbd3a1235.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t2137/336/2802996626/155915/e5e90d7a/56f0a09cN33e01bd0.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t1882/31/2772215910/389956/c8dbf370/56f0a0a2Na0c86ea6.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t2620/166/2703833710/312660/531aa913/57709035N33857877.jpg!q70.jpg","num":2,"pid":44,"price":789,"pscid":2,"selected":0,"sellerid":21,"subhead":"三只松鼠零食特惠,专区满99减50,满199减100,火速抢购》","title":"三只松鼠 坚果炒货 零食奶油味 碧根果225g/袋"},{"bargainPrice":11800,"createtime":"2017-10-14T21:48:08","detailUrl":"https://mitem.jd.hk/ware/view.action?wareId=1988853309&cachekey=1acb07a701ece8d2434a6ae7fa6870a1","images":"https://m.360buyimg.com/n0/jfs/t6130/97/1370670410/180682/1109582a/593276b1Nd81fe723.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t5698/110/2617517836/202970/c9388feb/593276b7Nbd94ef1f.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t5698/110/2617517836/202970/c9388feb/593276b7Nbd94ef1f.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t5815/178/2614671118/51656/7f52d137/593276c7N107b725a.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t5878/60/2557817477/30873/4502b606/593276caN5a7d6357.jpg!q70.jpg","num":1,"pid":77,"price":38999.99,"pscid":40,"selected":0,"sellerid":21,"subhead":"购买电脑办公部分商品满1元返火车票5元优惠券(返完即止)","title":"全球购 新款Apple MacBook Pro 苹果笔记本电脑 银色VP2新13英寸Bar i5/8G/256G"}],"sellerName":"商家21","sellerid":"21"},{"list":[{"bargainPrice":11800,"createtime":"2017-10-03T23:53:28","detailUrl":"https://mitem.jd.hk/ware/view.action?wareId=1988853309&cachekey=1acb07a701ece8d2434a6ae7fa6870a1","images":"https://m.360buyimg.com/n0/jfs/t6130/97/1370670410/180682/1109582a/593276b1Nd81fe723.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t5698/110/2617517836/202970/c9388feb/593276b7Nbd94ef1f.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t5698/110/2617517836/202970/c9388feb/593276b7Nbd94ef1f.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t5815/178/2614671118/51656/7f52d137/593276c7N107b725a.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t5878/60/2557817477/30873/4502b606/593276caN5a7d6357.jpg!q70.jpg","num":1,"pid":79,"price":888,"pscid":40,"selected":0,"sellerid":23,"subhead":"购买电脑办公部分商品满1元返火车票5元优惠券(返完即止)","title":"全球购 新款Apple MacBook Pro 苹果笔记本电脑 银色VP2新13英寸Bar i5/8G/256G"}],"sellerName":"商家23","sellerid":"23"}] */ private String msg; private String code; private List<DataBean> data; public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } public List<DataBean> getData() { return data; } public void setData(List<DataBean> data) { this.data = data; } public static class DataBean { /** * list : [{"bargainPrice":99,"createtime":"2017-10-14T21:38:26","detailUrl":"https://item.m.jd.com/product/4345173.html?utm#_source=androidapp&utm#_medium=appshare&utm#_campaign=t#_335139774&utm#_term=QQfriends","images":"https://m.360buyimg.com/n0/jfs/t6037/35/2944615848/95178/6cd6cff0/594a3a10Na4ec7f39.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t6607/258/1025744923/75738/da120a2d/594a3a12Ne3e6bc56.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t6370/292/1057025420/64655/f87644e3/594a3a12N5b900606.jpg!q70.jpg","num":3,"pid":45,"price":2999,"pscid":39,"selected":0,"sellerid":1,"subhead":"高清双摄,就是清晰!2000+1600万高清摄像头,6GB大内存+高通骁龙835处理器,性能怪兽!","title":"一加手机5 (A5000) 6GB+64GB 月岩灰 全网通 双卡双待 移动联通电信4G手机"}] * sellerName : 商家1 * sellerid : 1 */ private String sellerName; private String sellerid; private List<ListBean> list; private boolean checked; public boolean isChecked() { return checked; } public void setChecked(boolean checked) { this.checked = checked; } public String getSellerName() { return sellerName; } public void setSellerName(String sellerName) { this.sellerName = sellerName; } public String getSellerid() { return sellerid; } public void setSellerid(String sellerid) { this.sellerid = sellerid; } public List<ListBean> getList() { return list; } public void setList(List<ListBean> list) { this.list = list; } public static class ListBean { /** * bargainPrice : 99.0 * createtime : 2017-10-14T21:38:26 * detailUrl : https://item.m.jd.com/product/4345173.html?utm#_source=androidapp&utm#_medium=appshare&utm#_campaign=t#_335139774&utm#_term=QQfriends * images : https://m.360buyimg.com/n0/jfs/t6037/35/2944615848/95178/6cd6cff0/594a3a10Na4ec7f39.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t6607/258/1025744923/75738/da120a2d/594a3a12Ne3e6bc56.jpg!q70.jpg|https://m.360buyimg.com/n0/jfs/t6370/292/1057025420/64655/f87644e3/594a3a12N5b900606.jpg!q70.jpg * num : 3 * pid : 45 * price : 2999.0 * pscid : 39 * selected : 0 * sellerid : 1 * subhead : 高清双摄,就是清晰!2000+1600万高清摄像头,6GB大内存+高通骁龙835处理器,性能怪兽! * title : 一加手机5 (A5000) 6GB+64GB 月岩灰 全网通 双卡双待 移动联通电信4G手机 */ private double bargainPrice; private String createtime; private String detailUrl; private String images; private int num; private int pid; private double price; private int pscid; private int selected; private int sellerid; private String subhead; private String title; private boolean checkeds; private int cou=1; public int getCou() { return cou; } public void setCou(int cou) { this.cou = cou; } public boolean isCheckeds() { return checkeds; } public void setCheckeds(boolean checkeds) { this.checkeds = checkeds; } public double getBargainPrice() { return bargainPrice; } public void setBargainPrice(double bargainPrice) { this.bargainPrice = bargainPrice; } public String getCreatetime() { return createtime; } public void setCreatetime(String createtime) { this.createtime = createtime; } public String getDetailUrl() { return detailUrl; } public void setDetailUrl(String detailUrl) { this.detailUrl = detailUrl; } public String getImages() { return images; } public void setImages(String images) { this.images = images; } public int getNum() { return num; } public void setNum(int num) { this.num = num; } public int getPid() { return pid; } public void setPid(int pid) { this.pid = pid; } public double getPrice() { return price; } public void setPrice(double price) { this.price = price; } public int getPscid() { return pscid; } public void setPscid(int pscid) { this.pscid = pscid; } public int getSelected() { return selected; } public void setSelected(int selected) { this.selected = selected; } public int getSellerid() { return sellerid; } public void setSellerid(int sellerid) { this.sellerid = sellerid; } public String getSubhead() { return subhead; } public void setSubhead(String subhead) { this.subhead = subhead; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } } } }