Commit fbf61bc3 by 李伟康

refactor(OrderPopup): 优化 SKU 弹窗逻辑

- 在 SkuGoodsList 组件中,修改 openSkuPopup 事件的参数,增加 chooseList
- 在 SkuPopup 组件中,添加 currentId 初始化操作
- 修改 OrderPopup 组件中的 openSkuPopup 方法,根据 chooseList 决定是否关闭弹窗
1 parent 00524deb
...@@ -303,7 +303,7 @@ export default { ...@@ -303,7 +303,7 @@ export default {
item.specificationStr = item.specificationData.replace(/;~;/g, '/') item.specificationStr = item.specificationData.replace(/;~;/g, '/')
}) })
goodsList[index].multipleSpecificationsGoods.skuGoodsList = goodsArr goodsList[index].multipleSpecificationsGoods.skuGoodsList = goodsArr
this.$emit('openSkuPopup', goodsList[index]) this.$emit('openSkuPopup', goodsList[index], this.chooseList)
this.$set(searchStatus ? this.searchList : this.list, index, goodsList[index]) this.$set(searchStatus ? this.searchList : this.list, index, goodsList[index])
} }
} else { } else {
......
...@@ -74,6 +74,7 @@ export default { ...@@ -74,6 +74,7 @@ export default {
}, },
methods: { methods: {
open (data) { open (data) {
this.currentId = ''
this.data = data this.data = data
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.popup.open() this.$refs.popup.open()
......
...@@ -137,7 +137,7 @@ export default { ...@@ -137,7 +137,7 @@ export default {
position: 'bottom', position: 'bottom',
chooseContent: null, chooseContent: null,
componentObject: JSON.parse(JSON.stringify(config.componentConfig)), componentObject: JSON.parse(JSON.stringify(config.componentConfig)),
positionTypeList:[] positionTypeList: []
} }
}, },
...@@ -233,8 +233,9 @@ export default { ...@@ -233,8 +233,9 @@ export default {
}) })
} }
}, },
openSkuPopup (data) { openSkuPopup (data, chooseList) {
this.confirm() if (chooseList.length) this.confirm()
else this.$refs.popup.close()
this.$refs.skuPopupRef.open(data) this.$refs.skuPopupRef.open(data)
}, },
skuConfirm (e) { skuConfirm (e) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!