Commit dcb47bd1 by 胡悦

refactor(订单创建): 优化商品列表处理逻辑并移除无用代码

- 将 selectedTradeData 重命名为 transmissionOfData 以提高可读性
- 移除无用的 onload 生命周期钩子
- 重构商品列表处理逻辑,支持单商品、套餐和多规格商品
- 更新 NoticePopup 组件默认标题为 'warning'
1 parent 594c7e74
...@@ -64,7 +64,7 @@ export default { ...@@ -64,7 +64,7 @@ export default {
} }
}, },
watch: { watch: {
selectedTradeData: { transmissionOfData: {
handler(newVal) { handler(newVal) {
if (newVal) { if (newVal) {
console.log('接收到的交易数据:', newVal) console.log('接收到的交易数据:', newVal)
...@@ -126,9 +126,6 @@ export default { ...@@ -126,9 +126,6 @@ export default {
else return false else return false
} }
}, },
onload(options) {
console.log(options, 'options')
},
mounted() { mounted() {
console.log('mounted', this.orderCreateType) console.log('mounted', this.orderCreateType)
this.userInfo = uni.$storage.get('userInfo') || {} this.userInfo = uni.$storage.get('userInfo') || {}
...@@ -340,8 +337,36 @@ export default { ...@@ -340,8 +337,36 @@ export default {
goodsList.map(e => { goodsList.map(e => {
if (e.goodsFlag == 1) { if (e.goodsFlag == 1) {
// 单商品 // 单商品
subGoodsList.push({
totalPrice: e.goods.sellPrice,
number: e.goods.number,
merchantGoodsId: e.goods.merchantGoodsId
})
}
// 套餐
if (e.goodsFlag == 3) {
e.packageGoods.goodsList.forEach(g => {
subGoodsList.push({
packageCode: e.packageGoods.packageCode,
packageName: e.packageGoods.packageName,
totalPrice: e.packageGoods.upgradePrice,
number: e.packageGoods.number,
merchantGoodsId: g.merchantGoodsId,
upgradePrice: g.sellPrice
})
})
}
// 多规格
if (e.goodsFlag == 2) {
subGoodsList.push({
baseGoodsId: e.multipleSpecificationsGoods.goods.baseGoodsId,
totalPrice: Number(e.multipleSpecificationsGoods.goods.sellPrice),
number: e.multipleSpecificationsGoods.number,
merchantGoodsId: e.multipleSpecificationsGoods.goods.id || e.multipleSpecificationsGoods.goods.merchantGoodsId,
})
} }
}) })
obj.subOrderList = subGoodsList
// obj.subOrderList = goodsList.map(item => { // obj.subOrderList = goodsList.map(item => {
// return { // return {
// totalPrice: item.goods.sellPrice, // totalPrice: item.goods.sellPrice,
......
...@@ -38,7 +38,7 @@ export default { ...@@ -38,7 +38,7 @@ export default {
// 弹窗标题 // 弹窗标题
title: { title: {
type: String, type: String,
default: '提示' default: 'warning'
}, },
// 弹窗内容 // 弹窗内容
text: { text: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!