修改拨打电话的时候,灯光支付未0的问题
This commit is contained in:
@ -821,8 +821,17 @@
|
|||||||
},
|
},
|
||||||
function(res) {
|
function(res) {
|
||||||
console.log("🚀 ~ res:", res)
|
console.log("🚀 ~ res:", res)
|
||||||
self.detail.trade[groupIdx][idx].light_price = res.data.lists.set_light_price
|
const lightPrice = res.data.lists.set_light_price
|
||||||
self.selectedTimes.push({ group: groupIdx, idx, roomId });
|
self.detail.trade[groupIdx][idx].light_price = lightPrice
|
||||||
|
self.selectedTimes.push({
|
||||||
|
group: groupIdx,
|
||||||
|
idx,
|
||||||
|
roomId,
|
||||||
|
light_price: lightPrice,
|
||||||
|
start_time: self.detail.trade[groupIdx][idx].start_time,
|
||||||
|
end_time: self.detail.trade[groupIdx][idx].end_time,
|
||||||
|
day_time: self.detail.trade[groupIdx][idx].day_time
|
||||||
|
});
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
self.loadding = false
|
self.loadding = false
|
||||||
@ -844,13 +853,21 @@
|
|||||||
self.lightPrice = 0
|
self.lightPrice = 0
|
||||||
self.selectedTimes.forEach(sel => {
|
self.selectedTimes.forEach(sel => {
|
||||||
if (!roomMap[sel.roomId]) roomMap[sel.roomId] = [];
|
if (!roomMap[sel.roomId]) roomMap[sel.roomId] = [];
|
||||||
// 获取时间段
|
// 优先从 selectedTimes 中获取 light_price(修复后)
|
||||||
const item = trade[sel.group] && trade[sel.group][sel.idx];
|
if (sel.light_price) {
|
||||||
console.log("🚀 ~ item:", item)
|
roomMap[sel.roomId].push(`${sel.start_time}-${sel.end_time}`);
|
||||||
if (item) {
|
if (!self.lightDateTime && sel.day_time) {
|
||||||
roomMap[sel.roomId].push(`${item.start_time}-${item.end_time}`);
|
self.lightDateTime = sel.day_time
|
||||||
self.lightDateTime = item.day_time
|
}
|
||||||
self.lightPrice += parseFloat(item.light_price)
|
self.lightPrice += parseFloat(sel.light_price)
|
||||||
|
} else {
|
||||||
|
// 兼容旧数据:如果 selectedTimes 中没有,从 detail.trade 中获取
|
||||||
|
const item = trade[sel.group] && trade[sel.group][sel.idx];
|
||||||
|
if (item) {
|
||||||
|
roomMap[sel.roomId].push(`${item.start_time}-${item.end_time}`);
|
||||||
|
self.lightDateTime = item.day_time
|
||||||
|
self.lightPrice += parseFloat(item.light_price || 0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user