大数组调用filter方法循环过滤 普安段条件为小数组是否包含大数组中的元素
const newArr = goods.value.filter(item => e.detail.value.includes(item.id))
//对总价进行一个初始化
totalPrice.value = 0
//循环遍历新数组 求和
newArr.forEach(ele => {
totalPrice.value += ele.price
})
}