hookehuyr

fix 购物车删除选中值后处理逻辑优化

<!--
* @Date: 2024-07-23 12:53:15
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-07-27 21:00:09
* @LastEditTime: 2024-07-28 00:53:21
* @FilePath: /temple_material_request/src/views/material_pre_request.vue
* @Description: 待申领物资页面
-->
......@@ -252,10 +252,13 @@ const onClickDel = () => { // 点击删除回调
.then(async () => {
const { code, data } = await delCartAPI({ activity_id, good_ids: del_ids });
if (code) {
if (!list.value.length) {
// 还原列表显示
onClickCancel();
// 获取购物车列表
getCartList();
}
// 删除del_ids
list.value = list.value.filter(item => !del_ids.includes(item.good_id));
sum_num.value = list.value.length;
//
showToast('删除成功');
}
......