Commit ceb9aa69 authored by 李硕's avatar 李硕

选择宝贝为20个时无法取消

parent 2000cfcf
......@@ -114,7 +114,12 @@ Component({
},
changeCheckStatus(e) {
const { chooseId } = this.data;
const { item } = e.target.dataset;
if (chooseId.includes(item.itemId)) {
this.setData({
chooseId: chooseId.filter(v => v !== item.itemId),
});
} else {
if (chooseId.length >= 20) {
my.showToast({
type: "fail",
......@@ -122,13 +127,6 @@ Component({
});
return;
}
const { item } = e.target.dataset;
if (chooseId.includes(item.itemId)) {
this.setData({
chooseId: chooseId.filter(v => v !== item.itemId),
});
} else {
this.setData({
chooseId: [...chooseId, item.itemId],
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment