|
@@ -105,7 +105,7 @@ export default defineComponent({
|
|
|
state.details = details
|
|
|
|
|
|
// 默认选中所有的
|
|
|
- if (!state.paymentOrderDetails.includes(item.goodsType)) {
|
|
|
+ if (!state.paymentOrderDetails.includes(item.goodsType) && item.goodsType !== 'REPAIR') {
|
|
|
state.check.push(item.goodsId)
|
|
|
}
|
|
|
})
|
|
@@ -117,11 +117,7 @@ export default defineComponent({
|
|
|
}
|
|
|
|
|
|
const onSelect = (type: string) => {
|
|
|
- console.log(type, 'type')
|
|
|
- console.log(state.goodsInfo, 'goodsInfo')
|
|
|
-
|
|
|
state.checkboxRefs[type].toggle()
|
|
|
-
|
|
|
calcPrice()
|
|
|
}
|
|
|
|
|
@@ -194,8 +190,10 @@ export default defineComponent({
|
|
|
calcPrice()
|
|
|
const params: any = [] // 支付参数
|
|
|
const details = state.details
|
|
|
+
|
|
|
+ let checkInstruments = false // 是否选择了乐器
|
|
|
details.forEach((item: any) => {
|
|
|
- // 是否选中
|
|
|
+ // 是否选中 并且没有购买过
|
|
|
if (
|
|
|
state.check.includes(item.goodsId) &&
|
|
|
!state.paymentOrderDetails.includes(item.goodsType)
|
|
@@ -208,7 +206,28 @@ export default defineComponent({
|
|
|
paymentCouponAmount: 0 // 优惠券金额
|
|
|
})
|
|
|
}
|
|
|
+ // 判断是否是乐器
|
|
|
+ if (
|
|
|
+ item.goodsType === 'INSTRUMENTS' &&
|
|
|
+ state.check.includes(item.goodsId) &&
|
|
|
+ !state.paymentOrderDetails.includes(item.goodsType)
|
|
|
+ ) {
|
|
|
+ checkInstruments = true
|
|
|
+ }
|
|
|
})
|
|
|
+
|
|
|
+ // 为了处理,商品和乐器保养做关联
|
|
|
+ const repaire = state.repaireInfo
|
|
|
+ if (checkInstruments && repaire.goodsId) {
|
|
|
+ params.push({
|
|
|
+ goodsId: repaire.goodsId,
|
|
|
+ goodsNum: 1,
|
|
|
+ goodsType: repaire.goodsType,
|
|
|
+ paymentCashAmount: repaire.currentPrice, // 现金支付金额
|
|
|
+ paymentCouponAmount: 0 // 优惠券金额
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
console.log({
|
|
|
bizId: route.query.id, // 乐团编号
|
|
|
orderType: 'ORCHESTRA',
|