🎈 perf(活动): 神州探秘购买添加次数参数
This commit is contained in:
@@ -183,17 +183,19 @@ export function stringToRewardParam(rewardStr: string): Array<RewardParam> {
|
||||
}
|
||||
|
||||
//数据格式转换'类型&id&数量|类型&id&数量|' ->> Array<ItemInter> 资源消耗
|
||||
export function stringToConsumeParam(rewardStr: string) {
|
||||
export function stringToConsumeParam(...rewardStrs: string[]) {
|
||||
let result = new Array<{ type: number, id: number, count: number }>();
|
||||
if (!rewardStr) return result;
|
||||
let decodeArr = decodeArrayListStr(rewardStr);
|
||||
for (let [type, id, count] of decodeArr) {
|
||||
if (isNaN(parseInt(type)) || isNaN(parseInt(id)) || isNaN(parseInt(count))) {
|
||||
throw new Error('data table format wrong');
|
||||
for(let rewardStr of rewardStrs) {
|
||||
if(!rewardStr) continue;
|
||||
let decodeArr = decodeArrayListStr(rewardStr);
|
||||
for (let [type, id, count] of decodeArr) {
|
||||
if (isNaN(parseInt(type)) || isNaN(parseInt(id)) || isNaN(parseInt(count))) {
|
||||
throw new Error('data table format wrong');
|
||||
}
|
||||
result.push({ type: parseInt(type), id: parseInt(id), count: parseInt(count) });
|
||||
}
|
||||
result.push({ type: parseInt(type), id: parseInt(id), count: parseInt(count) });
|
||||
}
|
||||
return result
|
||||
}
|
||||
return combineItems(result);
|
||||
}
|
||||
|
||||
//数据格式转换'id&数量|id&数量|' ->> Array<RewardInter> 老资源格式
|
||||
|
||||
Reference in New Issue
Block a user