解析道具
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user