Commit 219490b8 by 李伟康

fix(OrderPopup): 修复弹窗选择商品后再次打开时规格未重置的问题

- 在 SkuGoodsList 组件中添加了清除已选择商品规格的逻辑
- 优化了 OrderPopup 组件中的确认逻辑,增加了对空选择的处理
- 调整了样式,修复了加载图标显示问题
1 parent 9d469f99
......@@ -304,6 +304,12 @@ export default {
goodsList[index].multipleSpecificationsGoods.specificationList.forEach(item => {
item.value = ''
})
let { chooseList } = this
chooseList.forEach((item, ind) => {
if (item.multipleSpecificationsGoods.id === goodsList[index].multipleSpecificationsGoods.id) {
chooseList.splice(ind, 1)
}
})
this.list = goodsList
// this.setData({
// goodsList
......
......@@ -190,19 +190,24 @@ export default {
else componentRef.handleSearch(this.componentObject.searchValue)
},
confirm () {
let { chooseContent, popupType, componentObject } = this
if (popupType === 13) {
chooseContent = this.componentRef().getResult()
}
if (chooseContent) {
this.$emit('onConfirm', {
chooseContent,
popupType
})
this.$refs.popup.close()
} else {
if (componentObject.nullTips) uni.showToast({
title: componentObject.nullTips,
try {
let { chooseContent, popupType, componentObject } = this
if (popupType === 13) {
chooseContent = this.componentRef().getResult()
}
if (chooseContent) {
if(Array.isArray(chooseContent) && !chooseContent.length && componentObject.nullTips) throw componentObject.nullTips
this.$emit('onConfirm', {
chooseContent,
popupType
})
this.$refs.popup.close()
} else {
if (componentObject.nullTips) throw componentObject.nullTips
}
} catch (error) {
uni.showToast({
title: error,
icon: 'none'
})
}
......@@ -292,7 +297,6 @@ export default {
height: 100%;
padding-top: 32rpx;
opacity: 0;
}
.loading {
position: absolute;
......@@ -302,7 +306,7 @@ export default {
width: toRpx(64);
height: toRpx(64);
}
.show{
.show {
opacity: 1;
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!