<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<script type="text/javascript">
//1.修改配号及公布的中签号码
let distributeNumber = '000055764003'//初始配号
let distributeArr = []//所有配号集合
let last5 = ['64017','01517','14017','26517','39017','51517','76517','89017']
let last6 = ['188579','688579']
let last7 = ['1832099']
let last8 = ['51724799']
let last9 = ['082326319','282326319','482326319','682326319','882326319','029932460','279932460','529932460','779932460']
let last10 = ['0518939171','2209941609']
for (var i = distributeNumber*1; i < distributeNumber*1 + 1000; i++){
distributeArr.push('0000'+i)//2.补足初始配号前面的0
}
//console.log(distributeArr)
//遍历整个配号集合取出后面几位依次比较
distributeArr.map(item1 => {
let lastFiveNumber = item1.toString().substring(item1.toString().length - 5)//取出后五位进行比较
let lastSixNumber = item1.toString().substring(item1.toString().length - 6)//取出后6位进行比较
let lastSevenNumber = item1.toString().substring(item1.toString().length - 7)//取出后7位进行比较
let lastEightNumber = item1.toString().substring(item1.toString().length - 8)//取出后8位进行比较
let lastNineNumber = item1.toString().substring(item1.toString().length - 9)//取出后9位进行比较
let lastTenNumber = item1.toString().substring(item1.toString().length - 10)//取出后10位进行比较
last5.map(item2 => {
if(item2 == lastFiveNumber){
console.log(item1)
}
})
last6.map(item2 => {
if(item2 == lastSixNumber){
console.log(item1)
}
})
last7.map(item2 => {
if(item2 == lastSevenNumber){
console.log(item1)
}
})
last8.map(item2 => {
if(item2 == lastEightNumber){
console.log(item1)
}
})
last9.map(item2 => {
if(item2 == lastNineNumber){
console.log(item1)
}
})
last10.map(item2 => {
if(item2 == lastTenNumber){
console.log(item1)
}
})
})
</script>
</body>
</html>
网友评论