Your Name 4 лет назад
Родитель
Сommit
7295dbc946
1 измененных файлов: 7 добавлений и 5 удалений
  1. 7
    5
      src/util/Basketball.js

+ 7
- 5
src/util/Basketball.js Просмотреть файл

@@ -18,9 +18,11 @@ export function GetPrice (allParts) {
18 18
   let minPrice
19 19
   let maxPrice
20 20
 
21
+  debugger
22
+
21 23
   // 遍历模拟比赛的各种可能
22 24
   matches.forEach(match => {
23
-    const [min, max] = GetMinAndMax(allParts, match, rq, ys)
25
+    const [min, max] = GetMinAndMax(allParts, match)
24 26
     if (min < minPrice || minPrice === undefined) {
25 27
       minPrice = min
26 28
     }
@@ -33,7 +35,7 @@ export function GetPrice (allParts) {
33 35
   return [minPrice, maxPrice]
34 36
 }
35 37
 
36
-function GetMinAndMax (allParts, match, rq, ys) {
38
+function GetMinAndMax (allParts, match) {
37 39
   let minPrice = 0
38 40
   let maxPrice = 0
39 41
 
@@ -54,7 +56,7 @@ function GetMinAndMax (allParts, match, rq, ys) {
54 56
       minPrice = price
55 57
     }
56 58
 
57
-    maxPrice += maxPrice
59
+    maxPrice += price
58 60
   })
59 61
 
60 62
   return [minPrice, maxPrice]
@@ -76,7 +78,7 @@ function computeWDL (part, match) {
76 78
 // 让球胜平负
77 79
 function computeWDLS (part, match, rq) {
78 80
   const [x, y] = match
79
-  const { ruleCode, odds } = part.rules
81
+  const { ruleCode, odds } = part.detail
80 82
 
81 83
   switch (ruleCode) {
82 84
     case 'bst-sp-win':
@@ -102,7 +104,7 @@ function computeScore (part, match, rq, ys) {
102 104
 // 进球数
103 105
 function computePoints (part, match) {
104 106
   const [x, y] = match
105
-  const { ruleCode, odds } = part.rules
107
+  const { ruleCode, odds } = part.detail
106 108
 
107 109
   switch (ruleCode) {
108 110
     case 'bst-w15':