|
|
@ -62,8 +62,22 @@ const chou = number => { |
|
|
|
const suan = () => { |
|
|
|
const n = Math.random() * 100 |
|
|
|
const r = getRnadomFiveInt() |
|
|
|
let boo = false |
|
|
|
let result = '' |
|
|
|
// 通过这个n 来跟奖品数据lotteryList进行对比得出 在min 和 max之间返回回来 而后在list中随机出一个 |
|
|
|
return `五星仙元-${r}` |
|
|
|
lotteryList.map(item => { |
|
|
|
if (item.min <= n && item.max > n) { |
|
|
|
boo = true |
|
|
|
// 命中该奖品类 |
|
|
|
const data = item.lottery |
|
|
|
// 随机在data中选中一个返回 |
|
|
|
result = `${data[Math.floor(Math.random() * data.length)]}-${r}` |
|
|
|
} |
|
|
|
}) |
|
|
|
if (boo) { |
|
|
|
return result |
|
|
|
} |
|
|
|
return `200w银元宝-${r}` |
|
|
|
} |
|
|
|
|
|
|
|
const getRnadomFiveInt = () => { |
|
|
|