Commit 219490b8 by 李伟康

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

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