|
|
@ -12,7 +12,7 @@ |
|
|
|
</div> |
|
|
|
<template #footer> |
|
|
|
<div style="text-align: center;"> |
|
|
|
<el-button text type="primary" @click="extractTcNumbers">体福</el-button> |
|
|
|
<!-- <el-button text type="primary" @click="extractTcNumbers">体福</el-button> --> |
|
|
|
<el-button text type="primary" @click="leftTongji">统计</el-button> |
|
|
|
<el-button text type="danger" @click="leftClear">清空</el-button> |
|
|
|
<el-button text type="success" @click="setFuwufei">服务费</el-button> |
|
|
@ -118,7 +118,10 @@ |
|
|
|
中奖赔付 |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
{{ 0 }} |
|
|
|
{{ |
|
|
|
zhongjiangshuTotal - Number((((tongjiValue || 0) * (checkDailishangRaw.dailifei || 0)) / |
|
|
|
100).toFixed(2)) - Number(((tongjiValue * (fuwufei.fuwufeiValue || 0)) / 100).toFixed(2)) |
|
|
|
}} |
|
|
|
</el-descriptions-item> |
|
|
|
<el-descriptions-item> |
|
|
|
<template #label> |
|
|
@ -135,7 +138,7 @@ |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
{{ ((tongjiValue || 0) - Number((((tongjiValue || 0) * ((checkDailishangRaw.dailifei || 0))) / |
|
|
|
100).toFixed(2)) |
|
|
|
100).toFixed(2)) - zhongjiangshuTotal |
|
|
|
- Number(((tongjiValue * (fuwufei.fuwufeiValue || 0)) / 100).toFixed(2))).toFixed(2) |
|
|
|
}} |
|
|
|
</el-descriptions-item> |
|
|
@ -234,9 +237,17 @@ export default { |
|
|
|
return { |
|
|
|
_: _, |
|
|
|
dayjs: dayjs, |
|
|
|
leftText: `体彩102,678,378,034。403,301。780。763,337。773,677一单一组共44 |
|
|
|
福彩。059。590各一单一组共8 |
|
|
|
合计52`, |
|
|
|
leftText: `一单一组:684,784,876共12 |
|
|
|
1单:784,961,637共6 |
|
|
|
1组:214,315共4 |
|
|
|
1组六:1269共10 |
|
|
|
1组六:12069共10 |
|
|
|
1组六:120769共10 |
|
|
|
1组三:874共10 |
|
|
|
1毒:6 |
|
|
|
1双飞:98共10 |
|
|
|
1定位:324共共10 |
|
|
|
1全包对子:共10元`, |
|
|
|
rightText: "", |
|
|
|
resultTitle: "", |
|
|
|
changciList: [], |
|
|
@ -260,10 +271,18 @@ export default { |
|
|
|
fuwufeiValue: 0, |
|
|
|
}, |
|
|
|
screenshotStatus: false, |
|
|
|
ticaihaoma: /体彩.*?([\d,。]+)[^一单一组共]*一单一组共/, |
|
|
|
fucaihaoma: /福彩.*?([\d,。]+)[^一单一组共]*一单一组共/, |
|
|
|
ticaijine: /体彩.*?一单一组共(\d+)/, |
|
|
|
fucaijine: /福彩.*?一单一组共(\d+)/, |
|
|
|
yidanyizu: /一单一组[:|:]*([\d,.\s]+)(?=合计|共*)/, |
|
|
|
yizuliu: /1组六[:|:]*([\d,.\s]+)(?=合计|共*)/, |
|
|
|
yizusan: /1组三[:|:]*([\d,.\s]+)(?=合计|共*)/, |
|
|
|
yidu: /1毒[:|:]*([\d,.\s]+)(?=合计|共*)/, |
|
|
|
yishuangfei: /1双飞[:|:]*([\d,.\s]+)(?=合计|共*)/, |
|
|
|
yidingwei: /1定位[:|:]*([\d,.\s]+)(?=合计|共*)/, |
|
|
|
yibudingwei: /1不定位[:|:]*([\d,.\s]+)(?=合计|共*)/, |
|
|
|
yifushi: /1复式[:|:]*([\d,.\s]+)(?=合计|共*)/, |
|
|
|
yiquanbaoduizi: /1全包对子[:|:]*([\d,.\s]+)(?=合计|共*)/, |
|
|
|
yidan: /1单[:|:]*([\d,.\s]+)(?=合计|共*)/, |
|
|
|
yizu: /1组[:|:]*([\d,.\s]+)(?=合计|共*)/, |
|
|
|
jine: /[合计|共]+(\d+)/ |
|
|
|
} |
|
|
|
}, |
|
|
|
watch: {}, |
|
|
@ -340,8 +359,8 @@ export default { |
|
|
|
leftTongji() { |
|
|
|
// 按照换行符分割 |
|
|
|
let leftTextArr = this.leftText.split("\n") |
|
|
|
// 将分割后的每个字符串剔除含有日期的字符串 |
|
|
|
leftTextArr = leftTextArr.filter(item => !item.match(/\d{2}:\d{2}:\d{2}/g)) |
|
|
|
// 将分割后的每个字符串剔除含有日期的字符串和带退的行 |
|
|
|
leftTextArr = leftTextArr.filter(item => { return !(item.match(/\d{2}:\d{2}:\d{2}/g) || item.includes("退")) }) |
|
|
|
// 将剩下的字符串末尾最多两个汉字的最后一个数字取出 |
|
|
|
leftTextArr = leftTextArr.map(item => { |
|
|
|
let lastNum = item.match(/\d+[\u4e00-\u9fa5]{0,2}$/) |
|
|
@ -380,8 +399,8 @@ export default { |
|
|
|
tongjizhongjiang() { |
|
|
|
// 按照换行符分割 |
|
|
|
let leftTextArr = this.leftText.split("\n") |
|
|
|
// 将分割后的每个字符串剔除含有日期的字符串 |
|
|
|
leftTextArr = leftTextArr.filter(item => !item.match(/\d{2}:\d{2}:\d{2}/g)) |
|
|
|
// 将分割后的每个字符串剔除含有日期的字符串和带退的行 |
|
|
|
leftTextArr = leftTextArr.filter(item => { return !(item.match(/\d{2}:\d{2}:\d{2}/g) || item.includes("退")) }) |
|
|
|
// 将剩下的字符串末尾最多两个汉字的最后一个数字取出 |
|
|
|
let dataObj = {} |
|
|
|
leftTextArr = leftTextArr.map(item => { |
|
|
@ -436,8 +455,9 @@ export default { |
|
|
|
} |
|
|
|
this.checkDailishangRaw = _.find(this.dailishangList, { check: true }) |
|
|
|
this.selectChangci = _.find(this.changciList, { value: this.changciValue }) |
|
|
|
this.tongjiValue = this.leftTongji() |
|
|
|
this.zhongjiangshuTotal = Number(this.zhongjiangshu[this.selectChangci.first] || 0) + Number(this.zhongjiangshu[this.selectChangci.second] || 0) + Number(this.zhongjiangshu[this.selectChangci.third] || 0) |
|
|
|
// this.tongjiValue = this.leftTongji() |
|
|
|
this.extractTcNumbers() |
|
|
|
// this.zhongjiangshuTotal = Number(this.zhongjiangshu[this.selectChangci.first] || 0) + Number(this.zhongjiangshu[this.selectChangci.second] || 0) + Number(this.zhongjiangshu[this.selectChangci.third] || 0) |
|
|
|
this.dialogForm.visible = true |
|
|
|
}, |
|
|
|
// 设置服务费 |
|
|
@ -533,72 +553,688 @@ export default { |
|
|
|
}, |
|
|
|
// 提取体彩和福彩的数字和金额 |
|
|
|
extractTcNumbers() { |
|
|
|
let ticaiList = [] |
|
|
|
let fucaiList = [] |
|
|
|
if (!this.changciValue) { |
|
|
|
ElMessage.error("请选择场次") |
|
|
|
return |
|
|
|
} |
|
|
|
let checkedList = this.dailishangList.filter(item => item.check) |
|
|
|
if (!checkedList.length) { |
|
|
|
ElMessage.error("请选择代理人") |
|
|
|
return |
|
|
|
} |
|
|
|
if (!this.leftText) { |
|
|
|
ElMessage.error("请填写内容后预测") |
|
|
|
return |
|
|
|
} |
|
|
|
let haomaList = [] |
|
|
|
// 按照换行符分割 |
|
|
|
let leftTextArr = this.leftText.split("\n") |
|
|
|
// 将分割后的每个字符串剔除含有日期的字符串 |
|
|
|
leftTextArr = leftTextArr.filter(item => !item.match(/\d{2}:\d{2}:\d{2}/g)) |
|
|
|
// 将分割后的每个字符串剔除含有日期的字符串和带退的行 |
|
|
|
leftTextArr = leftTextArr.filter(item => { return !(item.match(/\d{2}:\d{2}:\d{2}/g) || item.includes("退")) }) |
|
|
|
// 将剩下的字符串末尾最多两个汉字的最后一个数字取出 |
|
|
|
// yidanyizu: /一单一组[:|:]*([\d,.\s]+)(?=合计|共*)/, |
|
|
|
// yizuliu: /1组六[:|:]*([\d,.\s]+)(?=合计|共*)/, |
|
|
|
// yizusan: /1组三[:|:]*([\d,.\s]+)(?=合计|共*)/, |
|
|
|
// yidu: /1毒[:|:]*([\d,.\s]+)(?=合计|共*)/, |
|
|
|
// yishuangfei: /1双飞[:|:]*([\d,.\s]+)(?=合计|共*)/, |
|
|
|
// yidingwei: /1定位[:|:]*([\d,.\s]+)(?=合计|共*)/, |
|
|
|
// yibudingwei: /1不定位[:|:]*([\d,.\s]+)(?=合计|共*)/, |
|
|
|
// yifushi: /1复式[:|:]*([\d,.\s]+)(?=合计|共*)/, |
|
|
|
// yiquanbaoduizi: /1全包对子[:|:]*([\d,.\s]+)(?=合计|共*)/, |
|
|
|
// yidan: /1单[:|:]*([\d,.\s]+)(?=合计|共*)/, |
|
|
|
// yizu: /1组[:|:]*([\d,.\s]+)(?=合计|共*)/, |
|
|
|
// jine: /(?:合计|共)(\d+)/g |
|
|
|
console.log(77711, leftTextArr) |
|
|
|
|
|
|
|
for (let i = 0; i < leftTextArr.length; i++) { |
|
|
|
let item = leftTextArr[i]; |
|
|
|
if (item.includes("体彩")) { |
|
|
|
let ticaimatchhaoma = item.match(this.ticaihaoma); |
|
|
|
let ticaimatchjine = item.match(this.ticaijine); |
|
|
|
let ticaihaomaArr |
|
|
|
let ticaijineStr |
|
|
|
if (ticaimatchhaoma) { |
|
|
|
// 提取匹配到的数字部分(包括中文逗号),将所有的符号换成英文逗号 |
|
|
|
let haomaStr = ticaimatchhaoma[1].replace(/\.|。|,/g, ','); |
|
|
|
ticaihaomaArr = _.compact(_.split(haomaStr, ",")) |
|
|
|
} else { |
|
|
|
console.log("没有找到匹配项"); |
|
|
|
} |
|
|
|
if (ticaimatchjine) { |
|
|
|
// 提取匹配到的数字部分(包括中文逗号),将所有的符号换成英文逗号 |
|
|
|
ticaijineStr = ticaimatchjine[1] |
|
|
|
} else { |
|
|
|
console.log("没有找到匹配项"); |
|
|
|
} |
|
|
|
ticaiList.push({ |
|
|
|
haoma: ticaihaomaArr, |
|
|
|
jine: ticaijineStr, |
|
|
|
let type = "体彩" |
|
|
|
if (item.includes("福彩")) { |
|
|
|
type = "福彩" |
|
|
|
} |
|
|
|
console.log(77722, item) |
|
|
|
let jine = item.match(this.jine) |
|
|
|
if (jine) { |
|
|
|
jine = Number(jine[1]) |
|
|
|
} else { |
|
|
|
continue |
|
|
|
} |
|
|
|
let haoma = [] |
|
|
|
// 一单一组 |
|
|
|
if (item.match(this.yidanyizu)) { |
|
|
|
let match = item.match(this.yidanyizu) |
|
|
|
let numbers = match[1].replace(/\s+/g, '').replace(/[,\.]+/g, ','); |
|
|
|
haoma = _.compact(_.split(numbers, ",")) |
|
|
|
let danxuanList = [] |
|
|
|
let zuxuanList = [] |
|
|
|
for (let j = 0; j < haoma.length; j++) { |
|
|
|
let numberItem = haoma[j]; |
|
|
|
danxuanList.push({ |
|
|
|
type: "danxuan", |
|
|
|
value: [`${numberItem}`], |
|
|
|
jine: (jine / 2) / (haoma.length) |
|
|
|
}) |
|
|
|
zuxuanList.push({ |
|
|
|
type: "zuxuan", |
|
|
|
value: [`${numberItem}`], |
|
|
|
jine: (jine / 2) / (haoma.length) |
|
|
|
}) |
|
|
|
} |
|
|
|
haomaList.push({ |
|
|
|
type: type, |
|
|
|
name: "1单", |
|
|
|
numbers: danxuanList, |
|
|
|
}) |
|
|
|
} else if (item.includes("福彩")) { |
|
|
|
let fucaimatchhaoma = item.match(this.fucaihaoma); |
|
|
|
let fucaimatchjine = item.match(this.fucaijine); |
|
|
|
let fucaihaomaArr |
|
|
|
let fucaijineStr |
|
|
|
if (fucaimatchhaoma) { |
|
|
|
// 提取匹配到的数字部分(包括中文逗号),将所有的符号换成英文逗号 |
|
|
|
let haomaStr = fucaimatchhaoma[1].replace(/\.|。|,/g, ','); |
|
|
|
fucaihaomaArr = _.compact(_.split(haomaStr, ",")) |
|
|
|
} else { |
|
|
|
console.log("没有找到匹配项"); |
|
|
|
} |
|
|
|
if (fucaimatchjine) { |
|
|
|
// 提取匹配到的数字部分(包括中文逗号),将所有的符号换成英文逗号 |
|
|
|
fucaijineStr = fucaimatchjine[1] |
|
|
|
} else { |
|
|
|
console.log("没有找到匹配项"); |
|
|
|
} |
|
|
|
fucaiList.push({ |
|
|
|
haoma: fucaihaomaArr, |
|
|
|
jine: fucaijineStr, |
|
|
|
haomaList.push({ |
|
|
|
type: type, |
|
|
|
name: "1组", |
|
|
|
numbers: zuxuanList, |
|
|
|
}) |
|
|
|
} |
|
|
|
// 1组六 |
|
|
|
else if (item.match(this.yizuliu)) { |
|
|
|
let match = item.match(this.yizuliu) |
|
|
|
let numbers = match[1].replace(/\s+/g, '').replace(/[,\.]+/g, ','); |
|
|
|
haoma = _.compact(_.split(numbers, ",")) |
|
|
|
let groupBy = _.groupBy(haoma, o => { return `${o}`.length }); |
|
|
|
for (let key in groupBy) { |
|
|
|
haomaList.push({ |
|
|
|
type: type, |
|
|
|
name: `1组六${key}码`, |
|
|
|
numbers: [{ |
|
|
|
type: `zuliu${key}`, |
|
|
|
value: groupBy[key], |
|
|
|
jine: (jine / haoma.length) * (groupBy[key].length) |
|
|
|
}], |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
// 1组三 |
|
|
|
else if (item.match(this.yizusan)) { |
|
|
|
let match = item.match(this.yizusan) |
|
|
|
let numbers = match[1].replace(/\s+/g, '').replace(/[,\.]+/g, ','); |
|
|
|
haoma = _.compact(_.split(numbers, ",")) |
|
|
|
let groupBy = _.groupBy(haoma, o => { return `${o}`.length }); |
|
|
|
for (let key in groupBy) { |
|
|
|
haomaList.push({ |
|
|
|
type: type, |
|
|
|
name: `1组三${key}码`, |
|
|
|
numbers: [{ |
|
|
|
type: `zusan${key}`, |
|
|
|
value: groupBy[key], |
|
|
|
jine: (jine / haoma.length) * (groupBy[key].length) |
|
|
|
}], |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
// 1毒 |
|
|
|
else if (item.match(this.yidu)) { |
|
|
|
let match = item.match(this.yidu) |
|
|
|
let numbers = match[1].replace(/\s+/g, '').replace(/[,\.]+/g, ','); |
|
|
|
haoma = _.compact(_.split(numbers, ",")) |
|
|
|
let duslist = [] |
|
|
|
for (let j = 0; j < haoma.length; j++) { |
|
|
|
let numberItem = haoma[j]; |
|
|
|
duslist.push({ |
|
|
|
type: "dudan", |
|
|
|
value: [`${numberItem}`], |
|
|
|
jine: jine / (haoma.length) |
|
|
|
}) |
|
|
|
} |
|
|
|
haomaList.push({ |
|
|
|
type: type, |
|
|
|
name: "1毒", |
|
|
|
numbers: duslist, |
|
|
|
}) |
|
|
|
} |
|
|
|
// 1双飞 |
|
|
|
else if (item.match(this.yishuangfei)) { |
|
|
|
let match = item.match(this.yishuangfei) |
|
|
|
let numbers = match[1].replace(/\s+/g, '').replace(/[,\.]+/g, ','); |
|
|
|
haoma = _.compact(_.split(numbers, ",")) |
|
|
|
let shaungfeislist = [] |
|
|
|
for (let j = 0; j < haoma.length; j++) { |
|
|
|
let numberItem = haoma[j]; |
|
|
|
shaungfeislist.push({ |
|
|
|
type: "shuangfei", |
|
|
|
value: [`${numberItem}`], |
|
|
|
jine: jine / (haoma.length) |
|
|
|
}) |
|
|
|
} |
|
|
|
haomaList.push({ |
|
|
|
type: type, |
|
|
|
name: "1双飞", |
|
|
|
numbers: shaungfeislist, |
|
|
|
}) |
|
|
|
} |
|
|
|
// 1定位 |
|
|
|
else if (item.match(this.yidingwei)) { |
|
|
|
let match = item.match(this.yidingwei) |
|
|
|
let numbers = match[1].replace(/\s+/g, '').replace(/[,\.]+/g, ','); |
|
|
|
haoma = _.compact(_.split(numbers, ",")) |
|
|
|
let dingweislist = [] |
|
|
|
for (let j = 0; j < haoma.length; j++) { |
|
|
|
let numberItem = haoma[j]; |
|
|
|
dingweislist.push({ |
|
|
|
type: "dingwei", |
|
|
|
value: [`${numberItem}`], |
|
|
|
jine: jine / (haoma.length) |
|
|
|
}) |
|
|
|
} |
|
|
|
haomaList.push({ |
|
|
|
type: type, |
|
|
|
name: "1定位", |
|
|
|
numbers: dingweislist, |
|
|
|
}) |
|
|
|
} |
|
|
|
// 1不定位 |
|
|
|
else if (item.match(this.yibudingwei)) { |
|
|
|
let match = item.match(this.yibudingwei) |
|
|
|
let numbers = match[1].replace(/\s+/g, '').replace(/[,\.]+/g, ','); |
|
|
|
haoma = _.compact(_.split(numbers, ",")) |
|
|
|
let budingweislist = [] |
|
|
|
for (let j = 0; j < haoma.length; j++) { |
|
|
|
let numberItem = haoma[j]; |
|
|
|
budingweislist.push({ |
|
|
|
type: "budingwei", |
|
|
|
value: [`${numberItem}`], |
|
|
|
jine: jine / (haoma.length) |
|
|
|
}) |
|
|
|
} |
|
|
|
haomaList.push({ |
|
|
|
type: type, |
|
|
|
name: "1不定位", |
|
|
|
numbers: budingweislist, |
|
|
|
}) |
|
|
|
} |
|
|
|
// 1复式 |
|
|
|
else if (item.match(this.yifushi)) { |
|
|
|
let match = item.match(this.yifushi) |
|
|
|
let numbers = match[1].replace(/\s+/g, '').replace(/[,\.]+/g, ','); |
|
|
|
haoma = _.compact(_.split(numbers, ",")) |
|
|
|
let budingweislist = [] |
|
|
|
for (let j = 0; j < haoma.length; j++) { |
|
|
|
let numberItem = haoma[j]; |
|
|
|
budingweislist.push({ |
|
|
|
type: "fushi", |
|
|
|
value: [`${numberItem}`], |
|
|
|
jine: jine / (haoma.length) |
|
|
|
}) |
|
|
|
} |
|
|
|
haomaList.push({ |
|
|
|
type: type, |
|
|
|
name: "1复式", |
|
|
|
numbers: budingweislist, |
|
|
|
}) |
|
|
|
} |
|
|
|
// 1全包对子 |
|
|
|
else if (item.match(this.yiquanbaoduizi)) { |
|
|
|
let match = item.match(this.yiquanbaoduizi) |
|
|
|
let numbers = match[1].replace(/\s+/g, '').replace(/[,\.]+/g, ','); |
|
|
|
haoma = _.compact(_.split(numbers, ",")) |
|
|
|
let quanbaoduizislist = [] |
|
|
|
for (let j = 0; j < haoma.length; j++) { |
|
|
|
let numberItem = haoma[j]; |
|
|
|
quanbaoduizislist.push({ |
|
|
|
type: "quanbaoduizi", |
|
|
|
value: [`${numberItem}`], |
|
|
|
jine: jine / (haoma.length) |
|
|
|
}) |
|
|
|
} |
|
|
|
haomaList.push({ |
|
|
|
type: type, |
|
|
|
name: "1全包对子", |
|
|
|
numbers: quanbaoduizislist, |
|
|
|
}) |
|
|
|
} |
|
|
|
// 1单 |
|
|
|
else if (item.match(this.yidan)) { |
|
|
|
let match = item.match(this.yidan) |
|
|
|
let numbers = match[1].replace(/\s+/g, '').replace(/[,\.]+/g, ','); |
|
|
|
haoma = _.compact(_.split(numbers, ",")) |
|
|
|
let danxuanList = [] |
|
|
|
for (let j = 0; j < haoma.length; j++) { |
|
|
|
let numberItem = haoma[j]; |
|
|
|
danxuanList.push({ |
|
|
|
type: "danxuan", |
|
|
|
value: [`${numberItem}`], |
|
|
|
jine: jine / (haoma.length) |
|
|
|
}) |
|
|
|
} |
|
|
|
haomaList.push({ |
|
|
|
type: type, |
|
|
|
name: "1单", |
|
|
|
numbers: danxuanList, |
|
|
|
}) |
|
|
|
} |
|
|
|
// 1组 |
|
|
|
else if (item.match(this.yizu)) { |
|
|
|
let match = item.match(this.yizu) |
|
|
|
let numbers = match[1].replace(/\s+/g, '').replace(/[,\.]+/g, ','); |
|
|
|
haoma = _.compact(_.split(numbers, ",")) |
|
|
|
let zuxuanList = [] |
|
|
|
for (let j = 0; j < haoma.length; j++) { |
|
|
|
let numberItem = haoma[j]; |
|
|
|
zuxuanList.push({ |
|
|
|
type: "zuxuan", |
|
|
|
value: [`${numberItem}`], |
|
|
|
jine: jine / (haoma.length) |
|
|
|
}) |
|
|
|
} |
|
|
|
haomaList.push({ |
|
|
|
type: type, |
|
|
|
name: "1组", |
|
|
|
numbers: zuxuanList, |
|
|
|
}) |
|
|
|
} |
|
|
|
// 其他情况继续下一个循环 |
|
|
|
else { |
|
|
|
continue |
|
|
|
} |
|
|
|
} |
|
|
|
let returnObj = { |
|
|
|
ticaiList, |
|
|
|
fucaiList |
|
|
|
// 选中的代理商 |
|
|
|
let checkDailishangRaw = _.find(this.dailishangList, { check: true }) |
|
|
|
// 选中的场次 |
|
|
|
let selectChangci = _.find(this.changciList, { value: this.changciValue }) |
|
|
|
this.checkDailishangRaw = checkDailishangRaw |
|
|
|
this.selectChangci = selectChangci |
|
|
|
|
|
|
|
// 中奖号码 |
|
|
|
let zhonghaoma = `${selectChangci.first}${selectChangci.second}${selectChangci.third}` |
|
|
|
// 选中的代理商的代理费 |
|
|
|
// let selectdailifei = Number(checkDailishangRaw.dailifei / 100) |
|
|
|
let alljine = [] |
|
|
|
let jinegroupBy = _.groupBy(haomaList, o => `${o.type}:${o.name}`) |
|
|
|
for (let key in jinegroupBy) { |
|
|
|
let value = jinegroupBy[key]; |
|
|
|
let jineList = [] |
|
|
|
let keyLocal = key |
|
|
|
for (let i = 0; i < value.length; i++) { |
|
|
|
let element = value[i]; |
|
|
|
for (let j = 0; j < element.numbers.length; j++) { |
|
|
|
let item = element.numbers[j]; |
|
|
|
keyLocal = item.type |
|
|
|
jineList.push({ |
|
|
|
...item |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
alljine.push({ |
|
|
|
key: keyLocal, |
|
|
|
name: key, |
|
|
|
data: jineList |
|
|
|
}) |
|
|
|
} |
|
|
|
ElMessage({ |
|
|
|
type: 'success', |
|
|
|
message: JSON.stringify(returnObj), |
|
|
|
duration: 3000 |
|
|
|
}) |
|
|
|
return returnObj |
|
|
|
//alljine= [{"key":"danxuan","name":"体彩:1单","data":[{"type":"danxuan","value":["684"],"jine":2},{"type":"danxuan","value":["784"],"jine":2},{"type":"danxuan","value":["876"],"jine":2},{"type":"danxuan","value":["784"],"jine":6}]},{"key":"zuxuan","name":"体彩:1组","data":[{"type":"zuxuan","value":["684"],"jine":2},{"type":"zuxuan","value":["784"],"jine":2},{"type":"zuxuan","value":["876"],"jine":2},{"type":"zuxuan","value":["214"],"jine":4}]},{"key":"zuliu4","name":"体彩:1组六4码","data":[{"type":"zuliu4","numbers":["1269"],"jine":10}]},{"key":"zuliu5","name":"体彩:1组六5码","data":[{"type":"zuliu5","numbers":["12069"],"jine":10}]},{"key":"zuliu6","name":"体彩:1组六6码","data":[{"type":"zuliu6","numbers":["120769"],"jine":10}]},{"key":"zusan3","name":"体彩:1组三3码","data":[{"type":"zusan3","numbers":["874"],"jine":10}]},{"key":"shuangfei","name":"体彩:1双飞","data":[{"type":"shuangfei","value":["98"],"jine":10}]},{"key":"dingwei","name":"体彩:1定位","data":[{"type":"dingwei","value":["324"],"jine":10}]}] |
|
|
|
console.log(777, haomaList, alljine, JSON.stringify(alljine)) |
|
|
|
let alljineLocal = {} |
|
|
|
for (let i = 0; i < alljine.length; i++) { |
|
|
|
let element = alljine[i] |
|
|
|
// 处理1单的玩法 |
|
|
|
if (element.key == 'danxuan') { |
|
|
|
let dataObj = { |
|
|
|
all: 0, |
|
|
|
zhong: 0 |
|
|
|
} |
|
|
|
for (let j = 0; j < element.data.length; j++) { |
|
|
|
let item = element.data[j]; |
|
|
|
dataObj.all += Number(item.jine) |
|
|
|
for (let k = 0; k < item.value.length; k++) { |
|
|
|
let xiangmu = `${item.value[k]}`; |
|
|
|
if (xiangmu === zhonghaoma) { |
|
|
|
dataObj.zhong += Number(item.jine) * 900 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
alljineLocal[element.key] = dataObj |
|
|
|
} |
|
|
|
// 处理1组的玩法 |
|
|
|
else if (element.key == 'zuxuan') { |
|
|
|
let dataObj = { |
|
|
|
all: 0, |
|
|
|
zhong: 0 |
|
|
|
} |
|
|
|
for (let j = 0; j < element.data.length; j++) { |
|
|
|
let item = element.data[j]; |
|
|
|
dataObj.all += Number(item.jine) |
|
|
|
for (let k = 0; k < item.value.length; k++) { |
|
|
|
let xiangmu = `${item.value[k]}`; |
|
|
|
let xiangmuArr = xiangmu.split(''); |
|
|
|
let zhonghaomaArr = zhonghaoma.split(''); |
|
|
|
if (_.difference(zhonghaomaArr, xiangmuArr).length === 0) { |
|
|
|
dataObj.zhong += Number(item.jine) * 150 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
alljineLocal[element.key] = dataObj |
|
|
|
} |
|
|
|
// 处理组六4码的玩法 |
|
|
|
else if (element.key == 'zuliu4') { |
|
|
|
let dataObj = { |
|
|
|
all: 0, |
|
|
|
zhong: 0 |
|
|
|
} |
|
|
|
for (let j = 0; j < element.data.length; j++) { |
|
|
|
let item = element.data[j]; |
|
|
|
dataObj.all += Number(item.jine) |
|
|
|
for (let k = 0; k < item.value.length; k++) { |
|
|
|
let xiangmu = `${item.value[k]}`; |
|
|
|
let xiangmuArr = xiangmu.split(''); |
|
|
|
let zhonghaomaArr = zhonghaoma.split(''); |
|
|
|
if (_.difference(zhonghaomaArr, xiangmuArr).length === 0) { |
|
|
|
dataObj.zhong += Number(item.jine) * 35 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
alljineLocal[element.key] = dataObj |
|
|
|
} |
|
|
|
// 处理组六5码的玩法 |
|
|
|
else if (element.key == 'zuliu5') { |
|
|
|
let dataObj = { |
|
|
|
all: 0, |
|
|
|
zhong: 0 |
|
|
|
} |
|
|
|
for (let j = 0; j < element.data.length; j++) { |
|
|
|
let item = element.data[j]; |
|
|
|
dataObj.all += Number(item.jine) |
|
|
|
for (let k = 0; k < item.value.length; k++) { |
|
|
|
let xiangmu = `${item.value[k]}`; |
|
|
|
let xiangmuArr = xiangmu.split(''); |
|
|
|
let zhonghaomaArr = zhonghaoma.split(''); |
|
|
|
if (_.difference(zhonghaomaArr, xiangmuArr).length === 0) { |
|
|
|
dataObj.zhong += Number(item.jine) * 15 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
alljineLocal[element.key] = dataObj |
|
|
|
} |
|
|
|
// 处理组六6码的玩法 |
|
|
|
else if (element.key == 'zuliu6') { |
|
|
|
let dataObj = { |
|
|
|
all: 0, |
|
|
|
zhong: 0 |
|
|
|
} |
|
|
|
for (let j = 0; j < element.data.length; j++) { |
|
|
|
let item = element.data[j]; |
|
|
|
dataObj.all += Number(item.jine) |
|
|
|
for (let k = 0; k < item.value.length; k++) { |
|
|
|
let xiangmu = `${item.value[k]}`; |
|
|
|
let xiangmuArr = xiangmu.split(''); |
|
|
|
let zhonghaomaArr = zhonghaoma.split(''); |
|
|
|
if (_.difference(zhonghaomaArr, xiangmuArr).length === 0) { |
|
|
|
dataObj.zhong += Number(item.jine) * 7 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
alljineLocal[element.key] = dataObj |
|
|
|
} |
|
|
|
// 处理组六7码的玩法 |
|
|
|
else if (element.key == 'zuliu7') { |
|
|
|
let dataObj = { |
|
|
|
all: 0, |
|
|
|
zhong: 0 |
|
|
|
} |
|
|
|
for (let j = 0; j < element.data.length; j++) { |
|
|
|
let item = element.data[j]; |
|
|
|
dataObj.all += Number(item.jine) |
|
|
|
for (let k = 0; k < item.value.length; k++) { |
|
|
|
let xiangmu = `${item.value[k]}`; |
|
|
|
let xiangmuArr = xiangmu.split(''); |
|
|
|
let zhonghaomaArr = zhonghaoma.split(''); |
|
|
|
if (_.difference(zhonghaomaArr, xiangmuArr).length === 0) { |
|
|
|
dataObj.zhong += Number(item.jine) * 4 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
alljineLocal[element.key] = dataObj |
|
|
|
} |
|
|
|
// 处理组三4码的玩法 |
|
|
|
else if (element.key == 'zusan4') { |
|
|
|
let dataObj = { |
|
|
|
all: 0, |
|
|
|
zhong: 0 |
|
|
|
} |
|
|
|
for (let j = 0; j < element.data.length; j++) { |
|
|
|
let item = element.data[j]; |
|
|
|
dataObj.all += Number(item.jine) |
|
|
|
for (let k = 0; k < item.value.length; k++) { |
|
|
|
let xiangmu = `${item.value[k]}`; |
|
|
|
let xiangmuArr = xiangmu.split(''); |
|
|
|
let zhonghaomaArr = zhonghaoma.split(''); |
|
|
|
if (_.difference(zhonghaomaArr, xiangmuArr).length <= 1) { |
|
|
|
dataObj.zhong += Number(item.jine) * 24 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
alljineLocal[element.key] = dataObj |
|
|
|
} |
|
|
|
// 处理组三5码的玩法 |
|
|
|
else if (element.key == 'zusan5') { |
|
|
|
let dataObj = { |
|
|
|
all: 0, |
|
|
|
zhong: 0 |
|
|
|
} |
|
|
|
for (let j = 0; j < element.data.length; j++) { |
|
|
|
let item = element.data[j]; |
|
|
|
dataObj.all += Number(item.jine) |
|
|
|
for (let k = 0; k < item.value.length; k++) { |
|
|
|
let xiangmu = `${item.value[k]}`; |
|
|
|
let xiangmuArr = xiangmu.split(''); |
|
|
|
let zhonghaomaArr = zhonghaoma.split(''); |
|
|
|
if (_.difference(zhonghaomaArr, xiangmuArr).length <= 1) { |
|
|
|
dataObj.zhong += Number(item.jine) * 15 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
alljineLocal[element.key] = dataObj |
|
|
|
} |
|
|
|
// 处理组三6码的玩法 |
|
|
|
else if (element.key == 'zusan6') { |
|
|
|
let dataObj = { |
|
|
|
all: 0, |
|
|
|
zhong: 0 |
|
|
|
} |
|
|
|
for (let j = 0; j < element.data.length; j++) { |
|
|
|
let item = element.data[j]; |
|
|
|
dataObj.all += Number(item.jine) |
|
|
|
for (let k = 0; k < item.value.length; k++) { |
|
|
|
let xiangmu = `${item.value[k]}`; |
|
|
|
let xiangmuArr = xiangmu.split(''); |
|
|
|
let zhonghaomaArr = zhonghaoma.split(''); |
|
|
|
if (_.difference(zhonghaomaArr, xiangmuArr).length <= 1) { |
|
|
|
dataObj.zhong += Number(item.jine) * 8 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
alljineLocal[element.key] = dataObj |
|
|
|
} |
|
|
|
// 处理组三7码的玩法 |
|
|
|
else if (element.key == 'zusan7') { |
|
|
|
let dataObj = { |
|
|
|
all: 0, |
|
|
|
zhong: 0 |
|
|
|
} |
|
|
|
for (let j = 0; j < element.data.length; j++) { |
|
|
|
let item = element.data[j]; |
|
|
|
dataObj.all += Number(item.jine) |
|
|
|
for (let k = 0; k < item.value.length; k++) { |
|
|
|
let xiangmu = `${item.value[k]}`; |
|
|
|
let xiangmuArr = xiangmu.split(''); |
|
|
|
let zhonghaomaArr = zhonghaoma.split(''); |
|
|
|
if (_.difference(zhonghaomaArr, xiangmuArr).length <= 1) { |
|
|
|
dataObj.zhong += Number(item.jine) * 6 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
alljineLocal[element.key] = dataObj |
|
|
|
} |
|
|
|
// 处理毒胆的玩法 |
|
|
|
else if (element.key == 'dudan') { |
|
|
|
let dataObj = { |
|
|
|
all: 0, |
|
|
|
zhong: 0 |
|
|
|
} |
|
|
|
for (let j = 0; j < element.data.length; j++) { |
|
|
|
let item = element.data[j]; |
|
|
|
dataObj.all += Number(item.jine) |
|
|
|
for (let k = 0; k < item.value.length; k++) { |
|
|
|
let xiangmu = `${item.value[k]}`; |
|
|
|
let xiangmuArr = xiangmu.split(''); |
|
|
|
let zhonghaomaArr = zhonghaoma.split(''); |
|
|
|
if (_.difference(zhonghaomaArr, xiangmuArr).length === 2) { |
|
|
|
dataObj.zhong += Number(item.jine) * 3.3 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
alljineLocal[element.key] = dataObj |
|
|
|
} |
|
|
|
// 处理定位的玩法 |
|
|
|
else if (element.key == 'dingwei') { |
|
|
|
let dataObj = { |
|
|
|
all: 0, |
|
|
|
zhong: 0 |
|
|
|
} |
|
|
|
for (let j = 0; j < element.data.length; j++) { |
|
|
|
let item = element.data[j]; |
|
|
|
dataObj.all += Number(item.jine) |
|
|
|
for (let k = 0; k < item.value.length; k++) { |
|
|
|
let xiangmu = `${item.value[k]}`; |
|
|
|
let xiangmuArr = xiangmu.split(''); |
|
|
|
let zhonghaomaArr = zhonghaoma.split(''); |
|
|
|
let count = 0 |
|
|
|
for (let l = 0; l < zhonghaomaArr.length; l++) { |
|
|
|
if (`${xiangmuArr[l]}` === `${zhonghaomaArr[l]}`) { |
|
|
|
count++ |
|
|
|
} |
|
|
|
} |
|
|
|
if (count === 1) { |
|
|
|
dataObj.zhong += Number(item.jine) * 9 |
|
|
|
} else if (count > 1) { |
|
|
|
dataObj.zhong += Number(item.jine) * 80 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
alljineLocal[element.key] = dataObj |
|
|
|
} |
|
|
|
// 处理不定位的玩法 |
|
|
|
else if (element.key == 'budingwei') { |
|
|
|
let dataObj = { |
|
|
|
all: 0, |
|
|
|
zhong: 0 |
|
|
|
} |
|
|
|
for (let j = 0; j < element.data.length; j++) { |
|
|
|
let item = element.data[j]; |
|
|
|
dataObj.all += Number(item.jine) |
|
|
|
for (let k = 0; k < item.value.length; k++) { |
|
|
|
let xiangmu = `${item.value[k]}`; |
|
|
|
let xiangmuArr = xiangmu.split(''); |
|
|
|
let zhonghaomaArr = zhonghaoma.split(''); |
|
|
|
let count = 0 |
|
|
|
for (let l = 0; l < zhonghaomaArr.length; l++) { |
|
|
|
if (xiangmuArr.includes(zhonghaomaArr[l])) { |
|
|
|
count++ |
|
|
|
} |
|
|
|
} |
|
|
|
if (count >= 1) { |
|
|
|
dataObj.zhong += Number(item.jine) * 9 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
alljineLocal[element.key] = dataObj |
|
|
|
} |
|
|
|
// 处理双飞的玩法 |
|
|
|
else if (element.key == 'shuangfei') { |
|
|
|
let dataObj = { |
|
|
|
all: 0, |
|
|
|
zhong: 0 |
|
|
|
} |
|
|
|
for (let j = 0; j < element.data.length; j++) { |
|
|
|
let item = element.data[j]; |
|
|
|
dataObj.all += Number(item.jine) |
|
|
|
for (let k = 0; k < item.value.length; k++) { |
|
|
|
let xiangmu = `${item.value[k]}`; |
|
|
|
let xiangmuArr = xiangmu.split(''); |
|
|
|
let zhonghaomaArr = zhonghaoma.split(''); |
|
|
|
let count = 0 |
|
|
|
for (let l = 0; l < zhonghaomaArr.length; l++) { |
|
|
|
if (xiangmuArr.includes(zhonghaomaArr[l])) { |
|
|
|
count++ |
|
|
|
} |
|
|
|
} |
|
|
|
if (count >= 2) { |
|
|
|
dataObj.zhong += Number(item.jine) * 15 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
alljineLocal[element.key] = dataObj |
|
|
|
} |
|
|
|
// 处理复式的玩法 |
|
|
|
else if (element.key == 'fushi') { |
|
|
|
let dataObj = { |
|
|
|
all: 0, |
|
|
|
zhong: 0 |
|
|
|
} |
|
|
|
for (let j = 0; j < element.data.length; j++) { |
|
|
|
let item = element.data[j]; |
|
|
|
dataObj.all += Number(item.jine) |
|
|
|
for (let k = 0; k < item.value.length; k++) { |
|
|
|
let xiangmu = `${item.value[k]}`; |
|
|
|
let xiangmuArr = xiangmu.split(''); |
|
|
|
let zhonghaomaArr = zhonghaoma.split(''); |
|
|
|
let count = 0 |
|
|
|
for (let l = 0; l < zhonghaomaArr.length; l++) { |
|
|
|
if (xiangmuArr.includes(zhonghaomaArr[l])) { |
|
|
|
count++ |
|
|
|
} |
|
|
|
} |
|
|
|
if (count >= 3) { |
|
|
|
dataObj.zhong += Number(item.jine) * 150 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
alljineLocal[element.key] = dataObj |
|
|
|
} |
|
|
|
// 处理全包对子的玩法 |
|
|
|
// else if (element.key == 'quanbaoduizi') { |
|
|
|
// let dataObj = { |
|
|
|
// all: 0, |
|
|
|
// zhong: 0 |
|
|
|
// } |
|
|
|
// for (let j = 0; j < element.data.length; j++) { |
|
|
|
// let item = element.data[j]; |
|
|
|
// dataObj.all += Number(item.jine) |
|
|
|
// for (let k = 0; k < item.value.length; k++) { |
|
|
|
// let xiangmu = `${item.value[k]}`; |
|
|
|
// let xiangmuArr = xiangmu.split(''); |
|
|
|
// let zhonghaomaArr = zhonghaoma.split(''); |
|
|
|
// let count = 0 |
|
|
|
// for (let l = 0; l < zhonghaomaArr.length; l++) { |
|
|
|
// if (xiangmuArr.includes(zhonghaomaArr[l])) { |
|
|
|
// count++ |
|
|
|
// } |
|
|
|
// } |
|
|
|
// if (count >= 3) { |
|
|
|
// dataObj.zhong += Number(item.jine) * 150 |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } |
|
|
|
// alljineLocal[element.key] = dataObj |
|
|
|
// } |
|
|
|
} |
|
|
|
this.tongjiValue = 0 |
|
|
|
this.zhongjiangshuTotal = 0 |
|
|
|
for (let key in alljineLocal) { |
|
|
|
this.tongjiValue += alljineLocal[key].all |
|
|
|
this.zhongjiangshuTotal += alljineLocal[key].zhong |
|
|
|
} |
|
|
|
console.log(alljineLocal, 555) |
|
|
|
// ElMessage({ |
|
|
|
// type: 'success', |
|
|
|
// message: JSON.stringify(haomaList), |
|
|
|
// duration: 3000 |
|
|
|
// }) |
|
|
|
return haomaList |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|