|
@@ -60,24 +60,21 @@ export const randomScoreElement = (element?: string) => {
|
|
|
const randomIndex = Math.floor(Math.random() * newArr.length);
|
|
|
return {
|
|
|
url: prefix + newArr[randomIndex] + '.png',
|
|
|
- index: newArr[randomIndex],
|
|
|
- key: randomIndex
|
|
|
+ index: randomIndex
|
|
|
};
|
|
|
} else {
|
|
|
// 如果只有一个就直接返回
|
|
|
if (tempoList.length === 1) {
|
|
|
return {
|
|
|
url: prefix + tempoList[0] + '.png',
|
|
|
- index: tempoList[0],
|
|
|
- key: 0
|
|
|
+ index: 0
|
|
|
};
|
|
|
} else {
|
|
|
const randomIndex = Math.floor(Math.random() * tempoList.length);
|
|
|
const randomItem = tempoList[randomIndex];
|
|
|
return {
|
|
|
url: prefix + randomItem + '.png',
|
|
|
- index: randomItem,
|
|
|
- key: randomIndex
|
|
|
+ index: randomIndex
|
|
|
};
|
|
|
}
|
|
|
}
|
|
@@ -107,11 +104,10 @@ export const elementDirection = (type: string, index: number) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // console.log(ele, Number(index), type, i);
|
|
|
+ console.log(ele, Number(index), type, i);
|
|
|
return {
|
|
|
url: prefix + ele + '.png',
|
|
|
- index: Number(ele),
|
|
|
- key: Number(i)
|
|
|
+ index: Number(i)
|
|
|
};
|
|
|
};
|
|
|
|