diff --git a/shared/pubUtils/util.ts b/shared/pubUtils/util.ts index 298304b03..2c9fda718 100644 --- a/shared/pubUtils/util.ts +++ b/shared/pubUtils/util.ts @@ -397,4 +397,17 @@ export function ratioReward(rewardStr: string, ratio: number): string { res += `${k}&${v}|`; } return res.substring(0, res.length - 1); +} + +export function getItems(str:string) { + let arr = []; + let strArr = str.split('|'); + for (let item of strArr) { + var itemArr = item.split('&'); + arr.push({ + id : itemArr[0], + count : itemArr[1] + }); + } + return arr; } \ No newline at end of file