🐞 fix(道具): 获取道具叠加显示
This commit is contained in:
@@ -38,7 +38,7 @@ export function sortItems(goods: ItemInter[], handleType: HANDLE_REWARD_TYPE) {
|
||||
}
|
||||
} else if (table == ITEM_TABLE.ITEM) { // 可叠加道具
|
||||
let index = items.findIndex(cur => cur.id == good.id);
|
||||
if(index > 0) {
|
||||
if(index >= 0) {
|
||||
items[index].count += good.count;
|
||||
} else {
|
||||
items.push({ id: good.id, count: good.count });
|
||||
@@ -56,7 +56,7 @@ export function sortItems(goods: ItemInter[], handleType: HANDLE_REWARD_TYPE) {
|
||||
if(dicCurrency) {
|
||||
if(dicCurrency.type == CURRENCY_TYPE.GOLD) { // 金币,区分付费和免费,默认免费
|
||||
let index = gold.findIndex(cur => cur.isPay == !!good.isPay);
|
||||
if(index > 0) {
|
||||
if(index >= 0) {
|
||||
gold[index].count += good.count;
|
||||
} else {
|
||||
gold.push({ count: good.count, isPay: !!good.isPay });
|
||||
|
||||
Reference in New Issue
Block a user