|
@@ -3,14 +3,14 @@
|
3
|
3
|
<MainPageContainer :ShowMainHeader="true" :ShowMainTabBar="true" :MainTabBarActiveId="2" :MainHeaderTitle="`派奖管理`" :ShowMainHeaderBack="true" :ShowMainHeaderMore="true" :MainHeaderMoreIcon="`iconjilu`" :MainHeaderMoreText="`派奖记录`" :MainHeaderMoreClick="() => { this.$router.push({ name: 'PaiJiangJiLu' }) }">
|
4
|
4
|
<div class="PageContainer flex-v">
|
5
|
5
|
<!-- 搜索 -->
|
6
|
|
- <div class="Search">
|
|
6
|
+ <!-- <div class="Search">
|
7
|
7
|
<div class="flex-h">
|
8
|
8
|
<i class="iconfont iconsousuo"></i>
|
9
|
9
|
<div class="flex-item">
|
10
|
10
|
<input type="text" placeholder="请输入您要查询的派奖类型">
|
11
|
11
|
</div>
|
12
|
12
|
</div>
|
13
|
|
- </div>
|
|
13
|
+ </div> -->
|
14
|
14
|
|
15
|
15
|
<!-- nav -->
|
16
|
16
|
<div class="Nav flex-h">
|
|
@@ -27,23 +27,23 @@
|
27
|
27
|
<!-- 列表 -->
|
28
|
28
|
<div class="ListContainer flex-item">
|
29
|
29
|
<div>
|
30
|
|
- <scroller :on-refresh="Refresh">
|
|
30
|
+ <scroller :on-refresh="Refresh" :on-infinite="Infinite" ref="MyScroller">
|
31
|
31
|
<div class="Container">
|
32
|
32
|
<ul>
|
33
|
|
- <li v-for="(item, index) in 15" :key="index" class="flex-h">
|
34
|
|
- <a class="iconfont iconweigouxuan"></a>
|
|
33
|
+ <li v-for="(item, index) in PageList" :key="index" class="flex-h">
|
|
34
|
+ <a class="iconfont" :class="[item.Active ? 'icongouxuan active' : 'iconweigouxuan']" @click="SelectItem(item, index)"></a>
|
35
|
35
|
<div class="flex-item">
|
36
|
36
|
<div class="Title flex-h">
|
37
|
|
- <span class="flex-item">竞足胜平负</span>
|
38
|
|
- <span>1注</span>
|
39
|
|
- <span>1倍</span>
|
40
|
|
- <span><em>2.00</em>元</span>
|
|
37
|
+ <span class="flex-item">{{item.customerBetting.lotteryName}}</span>
|
|
38
|
+ <span>{{item.customerBetting.notesNum}}注</span>
|
|
39
|
+ <span>{{item.customerBetting.bettingTimes}}倍</span>
|
|
40
|
+ <span><em>{{item.customerBetting.totalPrice}}</em>元</span>
|
41
|
41
|
</div>
|
42
|
|
- <span>订单编号:TE20200810000146179970</span>
|
43
|
|
- <span>出票时间:2020-08-10 15:10:10</span>
|
|
42
|
+ <span>订单编号:{{item.orderId}}</span>
|
|
43
|
+ <span>出票时间:{{ToolClass.DateFormat(item.createDate)}}</span>
|
44
|
44
|
<div class="Res">
|
45
|
|
- <span>过关方式:2串1</span>
|
46
|
|
- <span>奖金:<em>5.20元</em></span>
|
|
45
|
+ <span v-if="item.customerBetting.lotteryId === 'basketball' || item.customerBetting.lotteryId === 'football'">过关方式:{{item.customerBetting.bettingPlan.passName}}</span>
|
|
46
|
+ <span>奖金:<em>{{item.customerBetting.winAmount}}元</em></span>
|
47
|
47
|
</div>
|
48
|
48
|
</div>
|
49
|
49
|
</li>
|
|
@@ -55,14 +55,14 @@
|
55
|
55
|
|
56
|
56
|
<!-- 底部栏 -->
|
57
|
57
|
<div class="Bottom flex-h">
|
58
|
|
- <a class="iconfont iconweigouxuan"></a>
|
59
|
|
- <span>全选</span>
|
|
58
|
+ <!-- <a class="iconfont" :class="[SelectNum === PageList.length ? 'icongouxuan active' : 'iconweigouxuan']" @click="SelectAll"></a>
|
|
59
|
+ <span>全选</span> -->
|
60
|
60
|
<div class="flex-item">
|
61
|
61
|
<div>
|
62
|
|
- <span>合计:<em>5.20元</em></span>
|
|
62
|
+ <span>合计:<em>{{TotalPrice}}元</em></span>
|
63
|
63
|
</div>
|
64
|
64
|
</div>
|
65
|
|
- <a>派奖</a>
|
|
65
|
+ <a @click="SendMoney" :class="{'active': !DataLock}">{{DataLock ? '正在提交' : '派奖'}}</a>
|
66
|
66
|
</div>
|
67
|
67
|
</div>
|
68
|
68
|
</MainPageContainer>
|
|
@@ -73,26 +73,44 @@
|
73
|
73
|
import MainPageContainer from '../../../components/common/MainPageContainer'
|
74
|
74
|
import 'swiper/dist/css/swiper.css'
|
75
|
75
|
import { swiper, swiperSlide } from 'vue-awesome-swiper'
|
|
76
|
+import { createNamespacedHelpers } from 'vuex'
|
|
77
|
+const { mapState: mapUserState, mapActions: mapUserActions, mapMutations: mapUserMutations } = createNamespacedHelpers('user')
|
76
|
78
|
export default {
|
77
|
79
|
name: 'index',
|
78
|
80
|
data () {
|
79
|
81
|
return {
|
|
82
|
+ PageList: [],
|
|
83
|
+ Done: null,
|
|
84
|
+ PageData: {
|
|
85
|
+ pageNum: 0,
|
|
86
|
+ pageSize: 10
|
|
87
|
+ },
|
|
88
|
+ Timer: null,
|
|
89
|
+ HasNextPage: true,
|
|
90
|
+ DataLock: false,
|
80
|
91
|
SwiperOptions: {
|
81
|
92
|
slidesPerView: 'auto'
|
82
|
93
|
},
|
83
|
|
- ActiveNavId: 1,
|
|
94
|
+ SelectNum: 0,
|
|
95
|
+ ActiveNavId: 'all',
|
|
96
|
+ IsAll: false,
|
|
97
|
+ TotalPrice: 0,
|
84
|
98
|
NavList: [
|
85
|
|
- { Name: '全部彩种', Id: 1 },
|
86
|
|
- { Name: '双色球', Id: 2 },
|
87
|
|
- { Name: '大乐透', Id: 3 },
|
88
|
|
- { Name: '排列三', Id: 4 },
|
89
|
|
- { Name: '排列五', Id: 5 },
|
90
|
|
- { Name: '足球', Id: 6 },
|
91
|
|
- { Name: '篮球', Id: 7 }
|
|
99
|
+ { Name: '全部彩种', Id: 'all' },
|
|
100
|
+ { Name: '双色球', Id: 'double-color' },
|
|
101
|
+ { Name: '大乐透', Id: 'lottery' },
|
|
102
|
+ { Name: '排列三', Id: 'p3' },
|
|
103
|
+ { Name: '排列五', Id: 'p5' },
|
|
104
|
+ { Name: '足球', Id: 'football' },
|
|
105
|
+ { Name: '篮球', Id: 'basketball' }
|
92
|
106
|
]
|
93
|
107
|
}
|
94
|
108
|
},
|
95
|
109
|
computed: {
|
|
110
|
+ ...mapUserState({
|
|
111
|
+ UserInfo: x => x.UserInfo,
|
|
112
|
+ CurrentShopOrderList: x => x.CurrentShopOrderList
|
|
113
|
+ }),
|
96
|
114
|
MySwiper () {
|
97
|
115
|
return this.$refs.MySwiper.swiper
|
98
|
116
|
}
|
|
@@ -109,13 +127,112 @@ export default {
|
109
|
127
|
})
|
110
|
128
|
},
|
111
|
129
|
methods: {
|
|
130
|
+ ...mapUserMutations([
|
|
131
|
+ 'EmptyCurrentShopOrderList'
|
|
132
|
+ ]),
|
|
133
|
+ ...mapUserActions([
|
|
134
|
+ 'GetCurrentShopOrderList',
|
|
135
|
+ 'SendPrize'
|
|
136
|
+ ]),
|
|
137
|
+ SendMoney () { // 派奖
|
|
138
|
+ if (this.DataLock || this.SelectNum === 0) return
|
|
139
|
+ this.DataLock = true
|
|
140
|
+ let OrderId = []
|
|
141
|
+ let Index = null
|
|
142
|
+ this.PageList.map((item, index) => {
|
|
143
|
+ if (item.Active) {
|
|
144
|
+ Index = index
|
|
145
|
+ OrderId.push(item.orderId)
|
|
146
|
+ }
|
|
147
|
+ })
|
|
148
|
+ this.SendPrize({ urlData: { id: OrderId.join(',') } }).then(() => {
|
|
149
|
+ this.Toast('派奖成功')
|
|
150
|
+ this.PageList.splice(Index, 1)
|
|
151
|
+ this.DataLock = false
|
|
152
|
+ }).catch((res) => {
|
|
153
|
+ this.Toast(res.data.message)
|
|
154
|
+ this.DataLock = false
|
|
155
|
+ })
|
|
156
|
+ },
|
|
157
|
+ SelectAll () {
|
|
158
|
+ if (this.SelectNum === this.PageList.length) {
|
|
159
|
+ this.PageList.map((item) => {
|
|
160
|
+ item.Active = false
|
|
161
|
+ })
|
|
162
|
+ } else {
|
|
163
|
+ this.PageList.map((item) => {
|
|
164
|
+ item.Active = true
|
|
165
|
+ })
|
|
166
|
+ }
|
|
167
|
+ this.CheckList()
|
|
168
|
+ },
|
|
169
|
+ SelectItem (item, index) {
|
|
170
|
+ if (!item.Active) {
|
|
171
|
+ this.PageList.map((item) => {
|
|
172
|
+ item.Active = false
|
|
173
|
+ })
|
|
174
|
+ }
|
|
175
|
+ item.Active = !item.Active
|
|
176
|
+ this.CheckList()
|
|
177
|
+ },
|
|
178
|
+ CheckList () {
|
|
179
|
+ this.SelectNum = 0
|
|
180
|
+ this.TotalPrice = 0
|
|
181
|
+ this.PageList.map((item) => {
|
|
182
|
+ if (item.Active) {
|
|
183
|
+ this.SelectNum += 1
|
|
184
|
+ this.TotalPrice += item.customerBetting.winAmount
|
|
185
|
+ }
|
|
186
|
+ })
|
|
187
|
+ },
|
|
188
|
+ Init (done = () => { }) { // 初始化
|
|
189
|
+ this.EmptyCurrentShopOrderList()
|
|
190
|
+ this.PageList = []
|
|
191
|
+ this.PageData.pageNum = 1
|
|
192
|
+ this.HasNextPage = true
|
|
193
|
+ this.DataLock = false
|
|
194
|
+ this.ToGetPageList(done)
|
|
195
|
+ },
|
|
196
|
+ ToGetPageList (done = () => { }) { // 获取页面列表
|
|
197
|
+ if (this.HasNextPage) {
|
|
198
|
+ let QueryData = { ...this.PageData, isCashed: true }
|
|
199
|
+ if (this.ActiveNavId !== 'all') {
|
|
200
|
+ QueryData.lotteryId = this.ActiveNavId
|
|
201
|
+ }
|
|
202
|
+ this.GetCurrentShopOrderList({ queryData: { ...QueryData } }).then((res) => {
|
|
203
|
+ let Arr = res.data.data.records || []
|
|
204
|
+ Arr.map((item) => {
|
|
205
|
+ this.PageList.push({ ...item, Active: false })
|
|
206
|
+ })
|
|
207
|
+ this.HasNextPage = res.data.data.total > this.CurrentShopOrderList.length
|
|
208
|
+ done()
|
|
209
|
+ }).catch(() => {
|
|
210
|
+ done()
|
|
211
|
+ })
|
|
212
|
+ }
|
|
213
|
+ },
|
112
|
214
|
CutNav (id) {
|
113
|
215
|
this.ActiveNavId = id
|
|
216
|
+ this.EmptyCurrentShopOrderList()
|
|
217
|
+ this.PageList = []
|
|
218
|
+ this.$refs.MyScroller.triggerPullToRefresh(true)
|
|
219
|
+ },
|
|
220
|
+ Infinite (done) { // 上拉加载
|
|
221
|
+ this.Timer = window.setTimeout(() => {
|
|
222
|
+ if (this.HasNextPage) {
|
|
223
|
+ this.PageData.pageNum += 1
|
|
224
|
+ this.ToGetPageList(done)
|
|
225
|
+ } else {
|
|
226
|
+ this.$refs.MyScroller.finishInfinite(true)
|
|
227
|
+ }
|
|
228
|
+ }, 1000)
|
114
|
229
|
},
|
115
|
230
|
Refresh (done) { // 页面下拉刷新
|
116
|
|
- window.setTimeout(() => {
|
|
231
|
+ if (!this.DataLock) {
|
|
232
|
+ this.Init(done)
|
|
233
|
+ } else {
|
117
|
234
|
done()
|
118
|
|
- }, 1000)
|
|
235
|
+ }
|
119
|
236
|
}
|
120
|
237
|
}
|
121
|
238
|
}
|