广告
返回顶部
首页 > 资讯 > 移动开发 >Android实现淘宝购物车
  • 844
分享到

Android实现淘宝购物车

2024-04-02 19:04:59 844人浏览 独家记忆
摘要

本文实例为大家分享了Android实现淘宝购物车的具体代码,供大家参考,具体内容如下 功能基本和淘宝购物车一样,商品按照店铺分类显示,全选,反选,选中商品数量变化,总价随之变化。效果

本文实例为大家分享了Android实现淘宝购物车的具体代码,供大家参考,具体内容如下

功能基本和淘宝购物车一样,商品按照店铺分类显示,全选,反选,选中商品数量变化,总价随之变化。效果图

思路:店铺和商品都增加一个select属性,列表的CheckBox选择或未选中状态改变同时设置店铺和商品的select属性,每次CheckBox状态改变设置select的值等于cb.isChecked()

购物车页面布局文件activity_shopping_car


<?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=".ui.activity.ShoppinGCarActivity">
 
    <com.hjq.bar.TitleBar
        android:id="@+id/titleBar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:rightTitle="管理"
        app:title="购物车" />
 
    <com.qiyetec.flyingsnail.widget.HintLayout
        android:id="@+id/hintLayout"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1">
 
        <com.scwang.smartrefresh.layout.SmartRefreshLayout
            android:id="@+id/smartRefreshLayout"
            android:layout_width="match_parent"
            android:layout_height="match_parent">
 
            <com.scwang.smartrefresh.layout.header.ClassicsHeader
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />
 
            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/rv"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />
 
        </com.scwang.smartrefresh.layout.SmartRefreshLayout>
    </com.qiyetec.flyingsnail.widget.HintLayout>
 
    <LinearLayout
        android:id="@+id/ll_bottom"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/ali_auth_space_10"
        android:background="#fff"
        android:gravity="center_vertical"
        android:padding="15dp">
 
        <CheckBox
            android:id="@+id/cb_all"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:button="@drawable/selector_checkbox_green"
            android:text="全选" />
 
        <View
            android:layout_width="0dp"
            android:layout_height="1dp"
            android:layout_weight="1" />
 
        <LinearLayout
            android:id="@+id/ll"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">
 
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="合计:"
                android:textColor="#333"
                android:textSize="15sp" />
 
            <TextView
                android:id="@+id/tv_total_price"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="5dp"
                android:text="¥0.00"
                android:textColor="#DA3527"
                android:textSize="24sp" />
 
            <TextView
                android:id="@+id/tv_buy"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="10dp"
                android:background="@drawable/shape_red10"
                android:paddingLeft="15dp"
                android:paddingTop="5dp"
                android:paddingRight="15dp"
                android:paddingBottom="5dp"
                android:text="结算"
                android:textColor="#fff"
                android:textSize="18sp" />
        </LinearLayout>
 
        <TextView
            android:id="@+id/tv_del"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/shape_stroke_red15"
            android:paddingLeft="15dp"
            android:paddingTop="5dp"
            android:paddingRight="15dp"
            android:paddingBottom="5dp"
            android:text="删除"
            android:textColor="#DA3527"
            android:textSize="18sp"
            android:visibility="Gone" />
    </LinearLayout>
</LinearLayout>

Java代码


public class ShoppingCarActivity extends MyActivity implements StatusAction {
 
    @BindView(R.id.titleBar)
    TitleBar titleBar;
    @BindView(R.id.rv)
    RecyclerView rv;
    @BindView(R.id.hintLayout)
    HintLayout hintLayout;
    @BindView(R.id.ll_bottom)
    LinearLayout ll_bottom;
    @BindView(R.id.ll)
    LinearLayout ll;
    @BindView(R.id.tv_total_price)
    TextView tv_total_price;
    @BindView(R.id.tv_del)
    TextView tv_del;
    @BindView(R.id.cb_all)
    CheckBox cb_all;
    @BindView(R.id.smartRefreshLayout)
    SmartRefreshLayout smartRefreshLayout;
 
    private ShoppingCarAdapter shoppingCarAdapter;
    private int total_page, page = 1;
 
    @Override
    protected int getLayoutId() {
        return R.layout.activity_shopping_car;
    }
 
    @Override
    protected void initView() {
        setOnClickListener(R.id.tv_buy, R.id.tv_del);
    }
 
    @Override
    protected void initData() {
        EventBus.getDefault().reGISter(this);
        //网络请求 获取购物车数据
        getCarData();
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this, RecyclerView.VERTICAL, false);
        rv.setLayoutManager(linearLayoutManager);
        shoppingCarAdapter = new ShoppingCarAdapter(this);
        //商品选中价格改变回调
        shoppingCarAdapter.setOnPriceChangeListener(new ShoppingCarAdapter.OnPriceChangeListener() {
            @Override
            public void onClick(boolean allSelect, String totalPrice) {
 
                cb_all.setChecked(allSelect);
                tv_total_price.setText("¥" + totalPrice);
            }
        });
        rv.setAdapter(shoppingCarAdapter);
        //全选 反选
        cb_all.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (shoppingCarAdapter != null && shoppingCarAdapter.getData() != null) {
                    for (int i = 0; i < shoppingCarAdapter.getData().size(); i++) {
                        shoppingCarAdapter.getData().get(i).setSelect(cb_all.isChecked());
                        for (int j = 0; j < shoppingCarAdapter.getData().get(i).getItem_data().size(); j++) {
                            shoppingCarAdapter.getData().get(i).getItem_data().get(j).setSelect(cb_all.isChecked());
                        }
                    }
                    shoppingCarAdapter.notifyDataSetChanged();
                    shoppingCarAdapter.calculatePrice();
                }
            }
        });
        smartRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
            @Override
            public void onRefresh(@NonNull RefreshLayout refreshLayout) {
                page = 1;
                getCarData();
                refreshLayout.finishRefresh();
            }
        }).setOnLoadMoreListener(new OnLoadMoreListener() {
            @Override
            public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
                if (page <= total_page) {
                    getCarData();
                }
                refreshLayout.finishLoadMore();
            }
        });
    }
 
    @Subscribe(threadMode = ThreadMode.MAIN)
    public void onGetMessage(MessageWrap message) {
        if (message.message.equals("refresh_car")) {
            getCarData();
        }
    }
 
    @Override
    public void onDestroy() {
        super.onDestroy();
        EventBus.getDefault().unregister(this);
    }
 
    @Override
    public void onRightClick(View v) {
        if (titleBar.getRightTitle().equals("管理")) {
            titleBar.setRightTitle("完成");
            ll.setVisibility(View.GONE);
            tv_del.setVisibility(View.VISIBLE);
        } else if (titleBar.getRightTitle().equals("完成")) {
            titleBar.setRightTitle("管理");
            ll.setVisibility(View.VISIBLE);
            tv_del.setVisibility(View.GONE);
        }
    }
 
    @SingleClick
    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            //点击结算
            case R.id.tv_buy:
                if (shoppingCarAdapter != null && shoppingCarAdapter.getData() != null) {
                    JSONArray ja = new jsONArray();
                    for (ShoppingCarBean shoppingCarBean : shoppingCarAdapter.getData()) {
                        JSONArray array = new JSONArray();
                        JSONObject object = null;
                        for (ShoppingCarBean.ItemDataBean itemDataBean : shoppingCarBean.getItem_data())
                            if (itemDataBean.isSelect()) {
                                object = new JSONObject();
                                if (StringUtils.isNotNullOrEmpty(shoppingCarBean.getShop().getShop_id()))
                                    object.put("shop_id", shoppingCarBean.getShop().getShop_id());
                                else
                                    object.put("shop_id", 1);
                                JSONObject object1 = new JSONObject();
                                object1.put("item_id", itemDataBean.getItem_id());
                                object1.put("count", itemDataBean.getCount());
                                object1.put("cart_id", itemDataBean.getCart_id());
                                object1.put("sku_id", itemDataBean.getSku_id());
                                array.add(object1);
                                object.put("items", array);
                            }
                        if (object != null)
                            ja.add(object);
                    }
                    // Log.i("logger", "onClick: " + JSONObject.toJSONString(ja));
                    if (ja != null && ja.size() > 0) {
                        //提交
                        confirmOrder(ja);
                    } else
                        toast("请选择商品");
                }
                break;
            case R.id.tv_del:
                if (shoppingCarAdapter != null && shoppingCarAdapter.getData() != null) {
                    List<String> list = new ArrayList<>();
                    for (ShoppingCarBean shoppingCarBean : shoppingCarAdapter.getData()) {
                        for (ShoppingCarBean.ItemDataBean itemDataBean : shoppingCarBean.getItem_data())
                            if (itemDataBean.isSelect()) {
                                list.add(itemDataBean.getCart_id());
                            }
                    }
                    delCart(list);
                }
                break;
        }
    }
 
    @Override
    public HintLayout getHintLayout() {
        return hintLayout;
    }
 
}

adapter代码


public final class ShoppingCarAdapter extends MyAdapter<ShoppingCarBean> {
 
    public ShoppingCarAdapter(Context context) {
        super(context);
    }
 
    @NonNull
    @Override
    public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        return new ViewHolder();
    }
 
    final class ViewHolder extends MyAdapter.ViewHolder {
        @BindView(R.id.cb)
        CheckBox cb;
        @BindView(R.id.iv_shopicon)
        ImageView iv_shopicon;
        @BindView(R.id.tv_shopname)
        TextView tv_shopname;
        @BindView(R.id.ll)
        LinearLayout linearLayout;
 
        ViewHolder() {
            super(R.layout.item_car);
        }
 
        @Override
        public void onBindView(int position) {
            ShoppingCarBean bean = getItem(position);
            tv_shopname.setText(bean.getShop().getShop_name());
            cb.setChecked(bean.isSelect());
            //每次添加前先移除所有布局
            linearLayout.removeAllViews();
            if (bean.getItem_data() != null) {
                //动态添加商品列表
                for (int i = 0; i < bean.getItem_data().size(); i++) {
                    View view = LayoutInflater.from(getContext()).inflate(R.layout.layout_item_car, null);
                    CheckBox c_cb = view.findViewById(R.id.cb);
                    ImageView iv_cover = view.findViewById(R.id.iv);
                    TextView tv_title = view.findViewById(R.id.tv_title);
                    TextView tv_guige = view.findViewById(R.id.tv_guige);
                    TextView tv_price = view.findViewById(R.id.tv_price);
                    TextView tv_count = view.findViewById(R.id.tv_count);
                    TextView tv_des = view.findViewById(R.id.tv_des);
                    TextView tv_add = view.findViewById(R.id.tv_add);
                    tv_title.setText(bean.getItem_data().get(i).getTitle());
                    tv_price.setText("¥" + bean.getItem_data().get(i).getZk_price());
                    tv_count.setText("" + bean.getItem_data().get(i).getCount());
                    tv_guige.setText(bean.getItem_data().get(i).getSku());
                    Glide.with(getContext()).load(bean.getItem_data().get(i).getPic())
                            .transfORM(new RoundedCorners((int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 5, getContext().getResources().getDisplayMetrics())))
                            .into(iv_cover);
                    if (bean.isSelect()) {
                        c_cb.setChecked(true);
                    } else {
                        c_cb.setChecked(bean.getItem_data().get(i).isSelect());
                    }
                    int finalI = i;
                    tv_des.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View view) {
                            if (bean.getItem_data().get(finalI).getCount() > 1) {
                                bean.getItem_data().get(finalI).setCount(bean.getItem_data().get(finalI).getCount()-1);
                                tv_count.setText(bean.getItem_data().get(finalI).getCount()+"");
                                calculatePrice();
                            } else
                                ToastUtils.show("不能再少了哦~");
 
                        }
                    });
                    tv_add.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View view) {
                            bean.getItem_data().get(finalI).setCount(bean.getItem_data().get(finalI).getCount()+1);
                            tv_count.setText(bean.getItem_data().get(finalI).getCount()+"");
                            calculatePrice();                        }
                    });
                    c_cb.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View view) {
                            boolean select = true;
                            bean.getItem_data().get(finalI).setSelect(c_cb.isChecked());
                            for (int j = 0; j < bean.getItem_data().size(); j++) {
                                if (bean.getItem_data().get(j).isSelect() == false) {
                                    select = false;
                                    break;
                                }
                            }
                            bean.setSelect(select);
                            notifyDataSetChanged();
                            calculatePrice();
                        }
                    });
                    view.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View view) {
                            Intent intent = new Intent(getContext(), ShoppingDetailActivity.class);
                            intent.putExtra("item_id", bean.getItem_data().get(finalI).getItem_id());
                            startActivity(intent);
                        }
                    });
 
                    linearLayout.addView(view);
                }
            }
            cb.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    bean.setSelect(cb.isChecked());
                    for (int j = 0; j < bean.getItem_data().size(); j++) {
                        bean.getItem_data().get(j).setSelect(cb.isChecked());
                    }
                    notifyDataSetChanged();
                    calculatePrice();
                }
            });
        }
    }
 
    public interface OnPriceChangeListener {
        void onClick(boolean allSelect, String totalPrice);
    }
 
    private OnPriceChangeListener onPriceChangeListener;
 
    public void setOnPriceChangeListener(OnPriceChangeListener onPriceChangeListener) {
        this.onPriceChangeListener = onPriceChangeListener;
    }
 
    public void calculatePrice() {
        if (onPriceChangeListener != null) {
            BigDecimal total = new BigDecimal("0.00");
            boolean allSelect = true;
            List<ShoppingCarBean> list = getData();
            for (int i = 0; i < getItemCount(); i++) {
                if (list.get(i).isSelect() == false)
                    allSelect = false;
                for (int j = 0; j < list.get(i).getItem_data().size(); j++) {
                    if (list.get(i).getItem_data().get(j).isSelect()) {
                        BigDecimal multiply = new BigDecimal(list.get(i).getItem_data().get(j).getZk_price()).multiply(new BigDecimal(list.get(i).getItem_data().get(j).getCount()));
                        BigDecimal price = new BigDecimal(multiply + "");
                        total = total.add(price);
                    }
                }
            }
            onPriceChangeListener.onClick(allSelect, total + "");
        }
    }
}

RecyclerView条目布局item_car


<?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_marginLeft="15dp"
    android:layout_marginTop="10dp"
    android:layout_marginRight="15dp"
    android:background="@drawable/shape_white5"
    android:orientation="vertical"
    android:paddingLeft="10dp"
    android:paddingTop="15dp"
    android:paddingRight="15dp"
    android:paddingBottom="20dp">
 
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center_vertical">
 
        <CheckBox
            android:id="@+id/cb"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:button="@drawable/selector_checkbox_green" />
 
        <ImageView
            android:id="@+id/iv_shopicon"
            android:layout_width="25dp"
            android:layout_height="25dp"
            android:layout_marginLeft="10dp" />
 
        <TextView
            android:id="@+id/tv_shopname"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10dp"
            android:textColor="#333"
            android:textSize="15sp"
            android:textStyle="bold" />
    </LinearLayout>
 
    <LinearLayout
        android:id="@+id/ll"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">
 
    </LinearLayout>
 
</LinearLayout>

商品条目布局layout_item_car


<?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="wrap_content"
    android:paddingTop="10dp"
    android:paddingBottom="5dp">
 
    <CheckBox
        android:id="@+id/cb"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:button="@drawable/selector_checkbox_green" />
 
    <ImageView
        android:id="@+id/iv"
        android:layout_width="75dp"
        android:layout_height="75dp"
        android:layout_centerVertical="true"
        android:layout_marginLeft="8dp"
        android:layout_toRightOf="@id/cb" />
 
    <TextView
        android:id="@+id/tv_title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="10dp"
        android:layout_toRightOf="@id/iv"
        android:ellipsize="end"
        android:maxLines="2"
        android:textColor="#333"
        android:textSize="15sp" />
 
    <TextView
        android:id="@+id/tv_guige"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/tv_title"
        android:layout_marginLeft="10dp"
        android:layout_marginTop="3Dp"
        android:layout_toRightOf="@id/iv"
        android:background="@drawable/shape_gray5"
        android:paddingLeft="3dp"
        android:paddingRight="3dp"
        android:textColor="#C1C1C1"
        android:textSize="10sp" />
 
    <TextView
        android:id="@+id/tv_price"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/tv_guige"
        android:layout_marginLeft="10dp"
        android:layout_marginTop="8dp"
        android:layout_toRightOf="@id/iv"
        android:textColor="#DA3527"
        android:textSize="18sp" />
 
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="25dp"
        android:layout_below="@id/tv_guige"
        android:layout_alignParentRight="true"
        android:layout_marginTop="8dp"
        android:layout_marginBottom="5dp"
        android:background="@drawable/stroke_gray2">
 
        <TextView
            android:id="@+id/tv_des"
            android:layout_width="25dp"
            android:layout_height="match_parent"
            android:gravity="center"
            android:text="-"
            android:textColor="#cccccc" />
 
        <View
            android:layout_width="0.5dp"
            android:layout_height="match_parent"
            android:background="#cccccc" />
 
        <TextView
            android:id="@+id/tv_count"
            android:layout_width="30dp"
            android:layout_height="match_parent"
            android:gravity="center" />
 
        <View
            android:layout_width="0.5dp"
            android:layout_height="match_parent"
            android:background="#cccccc" />
 
        <TextView
            android:id="@+id/tv_add"
            android:layout_width="25dp"
            android:layout_height="match_parent"
            android:gravity="center"
            android:text="+"
            android:textColor="#cccccc" />
    </LinearLayout>
 
</RelativeLayout>

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持编程网。

--结束END--

本文标题: Android实现淘宝购物车

本文链接: https://www.lsjlt.com/news/127098.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • Android实现淘宝购物车
    本文实例为大家分享了Android实现淘宝购物车的具体代码,供大家参考,具体内容如下 功能基本和淘宝购物车一样,商品按照店铺分类显示,全选,反选,选中商品数量变化,总价随之变化。效果...
    99+
    2022-11-12
  • Android实现的仿淘宝购物车demo示例
    本文实例讲述了Android实现的仿淘宝购物车。分享给大家供大家参考,具体如下: 夏的热情渐渐退去,秋如期而至,丰收的季节,小编继续着实习之路,走着走着,就走到了购物车,逛过淘...
    99+
    2022-06-06
    淘宝 demo Android
  • 基于jQuery模拟实现淘宝购物车模块
    这是网页版淘宝中购物车的页面 注意给checkbox添加事件就是用change() 给button添加事件就是用click() 1、每次点击+号,根据文本框的值乘以当前商品的价格就...
    99+
    2022-11-13
  • jQuery怎么模拟实现淘宝购物车功能
    这篇文章主要讲解了“jQuery怎么模拟实现淘宝购物车功能”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“jQuery怎么模拟实现淘宝购物车功能”吧!首先我们要实现的内容的需求有如下几点:1....
    99+
    2023-06-04
  • jQuery如何模拟淘宝购物车功能
    这篇文章主要介绍jQuery如何模拟淘宝购物车功能,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!首先我们要实现的内容的需求有如下几点:1.在购物车页面中,当选中“全选”复选框时,所有...
    99+
    2022-10-19
  • Vue实现淘宝购物车三级选中功能详解
    最近在练习商城项目,记录下实现购物车三级选中的过程(小白一个,水平很菜) 效果图: 实现: 1.全选时所有商品+店铺全部选中;反之全部取消选中 2.店铺选中时,当前店铺内所有商品选...
    99+
    2022-11-12
  • Vue如何实现淘宝购物车三级选中功能
    本文小编为大家详细介绍“Vue如何实现淘宝购物车三级选中功能”,内容详细,步骤清晰,细节处理妥当,希望这篇“Vue如何实现淘宝购物车三级选中功能”文章能帮助大家解决疑惑,下面跟着小编的思路慢慢深入,一起来学习新知识吧。实现:全选时所有商品+...
    99+
    2023-06-26
  • 基于jQuery如何模拟实现淘宝购物车模块
    小编给大家分享一下基于jQuery如何模拟实现淘宝购物车模块,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧!这是网页版淘宝中购物车的页面注意给checkbox添加事件就是用change()给button添加事件就是用clic...
    99+
    2023-06-29
  • Android中实现淘宝购物车RecyclerView或LIstView的嵌套选择的逻辑
    使用了RecyclerView嵌套RecyclerView的方案。 购物车的第一个界面为RecyclerView,每个Item里面包含一个店铺。在Item中使用Recycler...
    99+
    2022-06-06
    淘宝 选择 recyclerview listview 嵌套 Android
  • JavaScript实现淘宝购物件数选择
    本文实例为大家分享了JavaScript实现淘宝购物件数选择的具体代码,供大家参考,具体内容如下 实现一个简易的淘宝购物件数量的选择算法,通过鼠标点击“+”、...
    99+
    2022-11-13
    js淘宝购物件数选择 js淘宝购物选择 js购物件数选择
  • Android实现仿淘宝购物车增加和减少商品数量功能demo示例
    本文实例讲述了Android实现仿淘宝购物车增加和减少商品数量功能。分享给大家供大家参考,具体如下: 在前面一篇《Android实现的仿淘宝购物车demo示例》中,小编简单的介...
    99+
    2022-06-06
    淘宝 demo 购物车 Android
  • Android实现简单购物车
    本文实例为大家分享了Android实现简单购物车的具体代码,供大家参考,具体内容如下 这里我用到的都是Android自带SDK中的资源,做了一个极其简单的购物车实现,总结购物车难点包...
    99+
    2022-11-13
  • 怎么使用Android实现购物车页面及购物车效果
    这篇文章主要介绍了怎么使用Android实现购物车页面及购物车效果,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。Android实现购物车页面及购物车效果(点击动画),具体如下...
    99+
    2023-05-30
    android
  • Android实现简单购物车功能
    本文实例为大家分享了Android实现购物车功能的具体代码,供大家参考,具体内容如下MainActivity布局:<?xml version="1.0" encoding="utf-8"?><LinearL...
    99+
    2023-05-30
    android 购物车 roi
  • Android如何实现简单购物车
    这篇文章主要介绍“Android如何实现简单购物车”,在日常操作中,相信很多人在Android如何实现简单购物车问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Android如何实现简单购物车”的疑惑有所帮助!...
    99+
    2023-07-02
  • Android怎么实现购物车功能
    要实现购物车功能,你可以按照以下步骤进行操作:1. 创建一个购物车实体类,包含商品的名称、价格、数量等信息。2. 在你的应用程序中创...
    99+
    2023-08-16
    Android
  • jQuery实现购物车
    本文实例为大家分享了jQuery实现购物车的具体代码,供大家参考,具体内容如下 1.描述 2.HTML布局 <div>         <button>全选...
    99+
    2022-11-13
  • Android仿淘宝物流信息TimeLineView
    淘宝物流信息TimeLine的制作方法: 仿照的TimeLine效果图: 代码实现: package com.zms.timelineview; import and...
    99+
    2022-06-06
    宝物 淘宝 Android
  • Android怎么实现仿淘宝物流追踪功能
    这篇文章给大家分享的是有关Android怎么实现仿淘宝物流追踪功能的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。效果图拿到这个图,大家首先想到的是这是一个RecyclerView来实现,可能比较疑惑的地方是那个红...
    99+
    2023-05-31
    android
  • 购物车实现要点
    一、购物车模块1.1购物车两种实现方式的区别:    用session保存        缺点:浏览器关闭,session失效时保存在sessio...
    99+
    2022-10-18
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作