some判断是否重复添加某个商品
2019-04-09 本文已影响0人
苏苡
图片为判断是否重复添加:
注:couponCode为唯一标识:
(1)通过表格获取到scope.row.couponCode
(2)循环 couponLists 将它与你添加后得到的List中的每一个 couponCode 比较
(3)如果 couponLists[i] couponCode == scope.row.couponCode
(4)return 结束循环,切提示添加过该商品
![](https://img.haomeiwen.com/i3536548/f9da73c31f243bc9.png)
图片为判断是否重复添加:
注:couponCode为唯一标识:
(1)通过表格获取到scope.row.couponCode
(2)循环 couponLists 将它与你添加后得到的List中的每一个 couponCode 比较
(3)如果 couponLists[i] couponCode == scope.row.couponCode
(4)return 结束循环,切提示添加过该商品