解析道具
This commit is contained in:
@@ -398,3 +398,16 @@ export function ratioReward(rewardStr: string, ratio: number): string {
|
|||||||
}
|
}
|
||||||
return res.substring(0, res.length - 1);
|
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