|
@@ -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
|
}
|