1002884655 4 gadus atpakaļ
vecāks
revīzija
607a1fe620

+ 52
- 27
src/pages/KaiJiangZhanShi/DaLeTou/index.vue Parādīt failu

@@ -8,7 +8,7 @@
8 8
       <div slot="SwiperItem-1" class="Item">
9 9
 
10 10
         <!-- 开奖信息 -->
11
-        <div class="PrizeInfo">
11
+        <div class="PrizeInfo" v-if="LotteryRes.length">
12 12
           <div class="flex-h">
13 13
             <div class="Icon">
14 14
               <img src="../../../assets/img/icon4.png" class="centerLabel cover" alt="">
@@ -16,17 +16,12 @@
16 16
             <span>大乐透</span>
17 17
             <div class="flex-item">
18 18
               <div class="Time">
19
-                <span>开奖日期:2020-08-14</span>
20
-                <span>第202076期</span>
19
+                <span>开奖日期:{{LotteryRes[0].openingDate}}</span>
20
+                <span>第{{LotteryRes[0].issueNo}}期</span>
21 21
               </div>
22 22
               <ul class="Num">
23
-                <li>02</li>
24
-                <li>04</li>
25
-                <li>52</li>
26
-                <li>44</li>
27
-                <li>57</li>
28
-                <li class="active">54</li>
29
-                <li class="active">12</li>
23
+                <li v-for="(item, index) in LotteryRes[0].firstResult.split(',')" :key="`First-${index}`">{{item}}</li>
24
+                <li v-for="(item, index) in LotteryRes[0].secondResult.split(',')" :key="`Second-${index}`" class="active">{{item}}</li>
30 25
               </ul>
31 26
             </div>
32 27
           </div>
@@ -75,7 +70,7 @@
75 70
             </li>
76 71
           </ul>
77 72
           <div class="Btn">
78
-            <a>大乐透投注</a>
73
+            <router-link :to="{ name: 'DaLeTou' }">大乐透投注</router-link>
79 74
           </div>
80 75
         </div>
81 76
 
@@ -87,24 +82,19 @@
87 82
       <!-- 开奖历史 -->
88 83
       <div slot="SwiperItem-3" class="Item">
89 84
         <ul class="HistoryList">
90
-          <router-link tag="li" v-for="(item, index) in 10" :key="index" :to="{ name: 'DaLeTouXiangQing' }" class="flex-h">
85
+          <router-link tag="li" v-for="(item, index) in LotteryRes" :key="index" :to="{ name: 'DaLeTouXiangQing', query: { serialNo: item.serialNo, lotteryId: 'lottery', issueNo: item.issueNo } }" class="flex-h">
91 86
             <div class="Icon">
92 87
               <img src="../../../assets/img/icon4.png" class="centerLabel cover" alt="">
93 88
             </div>
94 89
             <span>大乐透</span>
95 90
             <div class="flex-item">
96 91
               <div class="Time">
97
-                <span>开奖日期:2020-08-14</span>
98
-                <span>第202076期</span>
92
+                <span>开奖日期:{{item.openingDate}}</span>
93
+                <span>第{{item.issueNo}}期</span>
99 94
               </div>
100 95
               <ul class="Num">
101
-                <li>02</li>
102
-                <li>04</li>
103
-                <li>52</li>
104
-                <li>44</li>
105
-                <li>57</li>
106
-                <li class="active">54</li>
107
-                <li class="active">12</li>
96
+                <li v-for="(subItem, subIndex) in item.firstResult.split(',')" :key="`First-${subIndex}`">{{subItem}}</li>
97
+                <li v-for="(subItem, subIndex) in item.secondResult.split(',')" :key="`Second-${subIndex}`" class="active">{{subItem}}</li>
108 98
               </ul>
109 99
             </div>
110 100
           </router-link>
@@ -117,20 +107,30 @@
117 107
 </template>
118 108
 
119 109
 <script>
120
-import { mapMutations } from 'vuex'
110
+import { mapMutations, createNamespacedHelpers } from 'vuex'
121 111
 import TabSwiper from '../../../components/common/TabSwiper'
112
+const { mapState: mapIndexState, mapActions: mapIndexActions, mapMutations: mapIndexMutations } = createNamespacedHelpers('index')
122 113
 export default {
123 114
   name: '',
124 115
   data () {
125 116
     return {
126 117
       NavList: [ // nav数据
127 118
         { name: '最新开奖', id: 1 },
128
-        { name: '走势图', id: 2 },
119
+        // { name: '走势图', id: 2 },
129 120
         { name: '开奖历史', id: 3 }
130
-      ]
121
+      ],
122
+      PageData: {
123
+        pageNum: 1,
124
+        pageSize: 100
125
+      },
126
+      Total: 1,
127
+      DataLock: false
131 128
     }
132 129
   },
133 130
   computed: {
131
+    ...mapIndexState({
132
+      LotteryRes: x => x.LotteryRes // 数字彩开奖结果列表
133
+    })
134 134
   },
135 135
   components: {
136 136
     TabSwiper
@@ -141,6 +141,7 @@ export default {
141 141
       { name: 'MainHeaderTitle', value: '大乐透开奖' },
142 142
       { name: 'ShowMainHeaderBack', value: true }
143 143
     ])
144
+    this.Init()
144 145
   },
145 146
   mounted () {
146 147
     this.$nextTick(() => {
@@ -150,13 +151,37 @@ export default {
150 151
     ...mapMutations([
151 152
       'EditMainData' // 配置页面框架数据
152 153
     ]),
154
+    ...mapIndexActions([
155
+      'GetLotteryRes'
156
+    ]),
157
+    ...mapIndexMutations([
158
+      'EmptyLotteryRes'
159
+    ]),
160
+    Init () {
161
+      this.EmptyLotteryRes()
162
+      this.ToGetLotteryRes()
163
+    },
153 164
     TabChange (e) { // nav切换
154 165
 
166
+    },
167
+    ToGetLotteryRes (done = () => { }) { // 获取开奖列表
168
+      if (this.DataLock || this.LotteryRes.length >= this.Total) {
169
+        done()
170
+      } else {
171
+        this.DataLock = true
172
+        this.GetLotteryRes({ queryData: { ...this.PageData, lotteryId: 'lottery' } }).then((res) => {
173
+          this.Total = res.data.data.total > 1 ? res.data.data.total : this.LotteryRes.length
174
+          this.DataLock = false
175
+          done()
176
+        }).catch((res) => {
177
+          this.Toast(res.data.message)
178
+          this.DataLock = false
179
+          done()
180
+        })
181
+      }
155 182
     },
156 183
     Refresh (e) { // 页面下拉刷新
157
-      window.setTimeout(() => {
158
-        e.done()
159
-      }, 1000)
184
+      this.ToGetLotteryRes(e.done())
160 185
     }
161 186
   }
162 187
 }

+ 4
- 2
src/pages/index/LanQiuDingDan/index.vue Parādīt failu

@@ -46,7 +46,7 @@
46 46
       </div>
47 47
       <div class="Count">
48 48
         <span>
49
-          <em>{{AllParts.length}}</em>注
49
+          <em>{{AllPartsCounts}}</em>注
50 50
         </span>
51 51
         <span>金额:<em>{{TotalPrize * Multiple}}</em>元</span>
52 52
         <span>预计奖金:<em>0 ~ 0</em>元</span>
@@ -116,6 +116,7 @@ export default {
116 116
   name: '',
117 117
   data () {
118 118
     return {
119
+      AllPartsCounts: 0,
119 120
       AllParts: [], // 投注生成结果
120 121
       CurrentPassUnitNum: 0,
121 122
       CurrentPassAmount: 0,
@@ -213,7 +214,8 @@ export default {
213 214
           PassTarget = item
214 215
         }
215 216
       })
216
-      this.AllParts = GetAllParts([...ListData], PassTarget)
217
+      this.AllParts = GetAllParts([...ListData], PassTarget).allParts
218
+      this.AllPartsCounts = GetAllParts([...ListData], PassTarget).sum
217 219
     },
218 220
     CalcRes () { // 计算投注数、金额
219 221
       if (this.CurrentPassCode === null) {

+ 1
- 1
src/pages/index/ShouYe/index.vue Parādīt failu

@@ -112,7 +112,7 @@ export default {
112 112
         this.GetNewstLotteryRes().then(() => { // 获取最新数字彩开奖结果列表
113 113
           done()
114 114
         })
115
-        this.GetLotteryRes({ queryData: { pageNum: 1, pageSize: 10 } })
115
+        // this.GetLotteryRes({ queryData: { pageNum: 1, pageSize: 10 } })
116 116
         this.GetAllLotteryType({ queryData: { pageNum: 1, pageSize: 1000 } })
117 117
       })
118 118
     },

+ 8
- 1
src/store/index/index.js Parādīt failu

@@ -13,7 +13,14 @@ export default {
13 13
       state.Banner = data.records || []
14 14
     },
15 15
     UpdateLotteryRes (state, data) { // 更新数字彩开奖结果列表
16
-      state.LotteryRes = data.records || []
16
+      // state.LotteryRes = data.records || []
17
+      let Arr = data.records || []
18
+      Arr.map((item) => {
19
+        state.LotteryRes.push(item)
20
+      })
21
+    },
22
+    EmptyLotteryRes (state) { // 清空数字彩开奖结果列表
23
+      state.LotteryRes = []
17 24
     },
18 25
     UpdateNewstLotteryRes (state, data) { // 更新最新数字彩开奖结果列表
19 26
       state.NewstLotteryRes = data || []