Comments (7)
这是购物车的逻辑,不支持单选的。
from cartlayout.
这是购物车的逻辑,不支持单选的。
我看了下源码 想修改成 group 可以单选 可是能力有限 大神能给一点思路吗?
from cartlayout.
就是只可以选择一个店铺里面的商品
from cartlayout.
我明白你说的逻辑,但是这个库我是按照普通购物车封装的,如果你有特殊需求,可以下载源码,在源码内拓展逻辑以符合你的需求
from cartlayout.
下载了 改乱了都.... 大神有空的话 提供一点思路呗 拜托了.......
from cartlayout.
这个逻辑也很明确:
1. 用一个变量 currentGroup 保存勾选的当前店铺的下标,默认为 -1;
2. 当勾选一个店铺时,判断 currentGroup 的值,不为 -1 时把这个下标的店铺 item 勾选状态改变,然后把当前勾选的店铺下标再赋值给 currentGroup;
3. 当取消勾选店铺时,把 currentGroup 的值重置为-1;
4. 当勾选一个商品时,先获取这个商品所属的店铺下标,和 currentGroup 不等时执行步骤 2 ,相等时不执行任何逻辑;
5. 当取消一个商品时,先判断同店铺下是否还有其他商品是勾选状态,如果没有执行 3 ,如果有不执行任何逻辑;
目前我只想到这些逻辑应该就可以了。是否有漏洞要靠实践。
from cartlayout.
谢谢谢谢 非常感谢
from cartlayout.
Related Issues (6)
- RecyclerView刷新问题 HOT 1
- List下标溢出啦 HOT 6
- 关于获取选中数据的问题 HOT 5
- 如果想点击组进行折叠 怎么搞 HOT 7
- 想获取被选中的商品id。。。好像没这个方案 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cartlayout.