Fix(我的/收藏):[#1622]未选择任何项目点击“删除”,仍会弹出是否确认删除对话框
This commit is contained in:
@@ -248,8 +248,29 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
async remove() {
|
remove() {
|
||||||
let that = this
|
const _this = this
|
||||||
|
const ids = []
|
||||||
|
switch (that.tabsIndex) {
|
||||||
|
case 0:
|
||||||
|
_this.productList.forEach(item => {
|
||||||
|
if (item['state']) ids.push(item.id)
|
||||||
|
})
|
||||||
|
break
|
||||||
|
case 1:
|
||||||
|
_this.storeList.forEach(item => {
|
||||||
|
if (item['state']) ids.push(item.id)
|
||||||
|
})
|
||||||
|
break
|
||||||
|
case 2:
|
||||||
|
_this.videoList.forEach(item => {
|
||||||
|
if (item['state']) ids.push(item.id)
|
||||||
|
})
|
||||||
|
break
|
||||||
|
}
|
||||||
|
if (ids.length < 1) {
|
||||||
|
return
|
||||||
|
}
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '确认删除已选项目?',
|
title: '确认删除已选项目?',
|
||||||
content: '',
|
content: '',
|
||||||
@@ -258,30 +279,11 @@ export default {
|
|||||||
confirmText: '确认',
|
confirmText: '确认',
|
||||||
success: async (r) => {
|
success: async (r) => {
|
||||||
if (r.confirm) {
|
if (r.confirm) {
|
||||||
let ids = []
|
|
||||||
switch (that.tabsIndex) {
|
|
||||||
case 0:
|
|
||||||
that.productList.forEach(item => {
|
|
||||||
if (item['state']) ids.push(item.id)
|
|
||||||
})
|
|
||||||
break
|
|
||||||
case 1:
|
|
||||||
that.storeList.forEach(item => {
|
|
||||||
if (item['state']) ids.push(item.id)
|
|
||||||
})
|
|
||||||
break
|
|
||||||
case 2:
|
|
||||||
that.videoList.forEach(item => {
|
|
||||||
if (item['state']) ids.push(item.id)
|
|
||||||
})
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
const res = await removeFavorite(ids)
|
const res = await removeFavorite(ids)
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
that.isAll = false
|
_this.isAll = false
|
||||||
that.fetchData()
|
_this.fetchData()
|
||||||
that.removeAfter()
|
_this.removeAfter()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user