diff --git a/README.md b/README.md index 7c68fd9..0c5a829 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ ## 更新日志 `新增` 隐藏设置支持屏蔽简介上方活动广告 `修复` 小电视功能不正常的问题 +`修复` 礼物包裹功能不正常的问题 `修复` 弹幕增强开启后颜文字以及弹幕热词不正常的问题 ## TODO List diff --git a/src/live/FuncGiftPackage.js b/src/live/FuncGiftPackage.js index 0885ac0..40ac6e7 100644 --- a/src/live/FuncGiftPackage.js +++ b/src/live/FuncGiftPackage.js @@ -155,25 +155,24 @@ class FuncGiftPackage { } static openSendPanel(target) { - let giftID = target.attr('class').match(/gift-(\d+)/)[1]; - let index = target.parent().index(); - let bagID = this.gifts[giftID][index].bagID; + this.giftID = target.attr('class').match(/gift-(\d+)/)[1]; + this.index = target.parent().index(); - this.sendPanelImage.attr('class', 'gift-img float-left gift-' + this.chooseGiftID); - this.sendPanelInfo.text(`您的包裹中还剩 ${this.currentGift.number} 个可用`); - this.sendPanelCount.val(this.currentGift.number); - this.sendPanelButton.off('click').on('click', () => this.sendGift(giftID, this.sendPanelCount.val(), bagID, index)); + this.sendPanelImage.attr('class', 'gift-img float-left gift-' + this.giftID); + this.sendPanelInfo.text(`您的包裹中还剩 ${this.gifts[this.giftID][this.index].number} 个可用`); + this.sendPanelCount.val(this.gifts[this.giftID][this.index].number); + this.sendPanelButton.off('click').on('click', () => this.sendGift(this.giftID, this.sendPanelCount.val(), this.gifts[this.giftID][this.index].bagID, this.index)); this.sendPanel.show(); } static setNumber(target) { let number = target.text(); if(number == 'MAX') { - number = this.currentGift.number; + number = this.gifts[this.giftID][this.index].number; } else if(number.endsWith('%')) { - number = Math.round(this.currentGift.number * Number.parseInt(number) * 0.01); + number = Math.round(this.gifts[this.giftID][this.index].number * Number.parseInt(number) * 0.01); } - if(number > this.currentGift.number || Number.isNaN(number)) { - number = this.currentGift.number; + if(number > this.gifts[this.giftID][this.index].number || Number.isNaN(number)) { + number = this.gifts[this.giftID][this.index].number; } if(number < 1) { number = 1; diff --git a/src/options/updatelog.html b/src/options/updatelog.html index 00978e8..f19aab7 100644 --- a/src/options/updatelog.html +++ b/src/options/updatelog.html @@ -2,6 +2,7 @@

更新日志

V0.0.21

新增 隐藏设置支持屏蔽简介上方活动广告

修复 小电视功能不正常的问题

+

修复 礼物包裹功能不正常的问题

修复 弹幕增强开启后颜文字以及弹幕热词不正常的问题


V0.0.20