解析道具

This commit is contained in:
mamengke01
2020-12-09 21:37:49 +08:00
parent 68a44f194a
commit ff5e6adfaa

View File

@@ -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;
}