From 6e80e45b6e9297abd9fcfff827c0ef1e0ff01132 Mon Sep 17 00:00:00 2001 From: yin5th <541304803@qq.com> Date: Wed, 8 Dec 2021 18:10:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/handle.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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