diff --git a/js/handle.js b/js/handle.js index aa1e676..dd17189 100644 --- a/js/handle.js +++ b/js/handle.js @@ -228,7 +228,7 @@ function receiveMessage(event) if (giftList.length > 0) { updateUserCell(giftList) - // console.log(userCell, '用户礼物记录') + console.log(userCell, '用户电池记录') } // console.log(adminList, '舰长列表') @@ -472,9 +472,14 @@ function createVirtual() { function updateUserCell(list) { $.each(list, function (index, item) { let cell = 0 - if (giftObj[item.gift] != undefined) { - cell = giftObj[item.gift] * item.num + // console.log(item.gift, '礼物名称') + // console.log(giftObj, '礼物对象') + let giftCellNum = giftObj[item.gift] + // console.log(giftCellNum) + if (giftCellNum != undefined) { + cell = giftCellNum * item.num } + // console.log(cell, '本次电池数量') if (cell > 0) { if (userCell[item.uname] == undefined) { userCell[item.uname] = cell