1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
<template>
<view class="wrap">
<view>
<view class="first">
<input placeholder="请输入购票预留手机号/身份证号" v-model="credentialNumber" />
</view>
<view class="query">
<text class="button" @click="clickQuery()">查询订单</text>
</view>
</view>
<view class="mark-box" v-if="showMark">
<view style="width: 100%;">
<view class="mark-content">
<view class="mark-title"> 获取失败 </view>
<view class="mark-tip"> 查无该订单,请咨询购票渠道!</view>
<!-- <view class="mark-btn">
<text class="btn">重试</text>
</view> -->
</view>
<view class="mark-close" @click="showMark=false">
<u-icon name="close-circle" size='60' color='#ffffff'></u-icon>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
showMark: false ,//是否显示遮罩层
credentialNumber:'',//输入框的值
noNumberList:[],//未排号站点列表
orderId:'',//订单Id
merchantCode:'',//商户码
thirdOrderId:'',//三方Id
channelName:'',//渠道名称
productName:'',//产品名称
}
},
onLoad(option) {
this.merchantCode=this.$commonjs.getKey(option,'merchantCode')
},
methods: {
//---点击查询
clickQuery(){
uni.$u.throttle(this.queryList,3000)
},
//---查询订单
queryList(){
if(!this.credentialNumber){
uni.showToast({
title:'请输入手机号或者身份证号',
icon: 'none'
})
return
}
let data={
credentialNumber:this.credentialNumber,//输入框的值
userId:uni.getStorageSync('openid')||'',
merchantCode:this.merchantCode,
startPlayDate:new Date().Format('yyyy-MM-dd')+' 00:00:00',//开始日期
endPlayDate:new Date().Format('yyyy-MM-dd')+' 23:59:59',//结束日期
}
this.$request('order/userOrder/findOrderPageListByCode',data).then((res)=>{
if(res.code=='00'){
let list=res.data||[]
if(list.length==0){
this.showMark=true
}else{
//下面参数需要传给下一个页面
this.orderId=list[0].id||''
this.thirdOrderId=list[0].thirdOrderId||''
this.merchantCode=list[0].merchantCode||''
this.channelName=list[0].channelName||''
this.productName=list[0].productName||''
this.getFetchInfo()
}
}else{
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
},
//---获取排号信息
getFetchInfo(){
let data={
thirdId:this.thirdOrderId,
merchantCode:this.merchantCode
}
this.noNumberList=[]
this.$request('distribution/distribution/getFetchInfoOta',data).then((res)=>{
if(res.code=='00'){
//如果排号的数组里面有未使用的直接跳转电子门票页面
if(res.data&&res.data.length>0){
let arr1=res.data[0].sorts||[]
let arr2=res.data[0].uses||[]
let number=0
arr1.forEach(item=>{
arr2.forEach(item2=>{
if(item.projectId==item2.projectId){
number+=1
}
})
})
if(arr1.length>number){
uni.navigateTo({
url:`/pages/my/order/electronicTicket/electronicTicket?orderId=${this.orderId}`
})
}
}
//sortFair=3时可重排,排号状态:0-等待中,1-可进入,2-已过号,3-可重排,4-可返程取号(仅胖丁显示),5-第一次取号(仅胖丁显示),6-已过闸
//计算时去除可重排的
let sorts=[]
if(res.data[0].sorts&&res.data[0].sorts.length>0){
res.data[0].sorts.forEach(item=>{
if(item.sortFair!=3){
sorts.push(item)
}
})
}
let uses=res.data[0].uses||[]
let list=res.data[0].timeAreas||[]
//获取所有站点列表
let totalList=[]
list.forEach(item=>{
if(!totalList.find(item2=>item2.projectIds==item.projectIds)){
//去重,并且为排号区的才放入数组
if(item.areaId==1){
totalList.push({
projectIds:item.projectIds,
projectName:item.projectName
})
}
}
})
//获取已使用和已排号站点信息之和
let usedList=sorts.concat(uses)
let usedNewArr=[]
usedList.forEach(item=>{
if(!usedNewArr.find(item2=>item2.projectId==item.projectId)){
usedNewArr.push({
projectId:item.projectId,
projectName:item.projectName
})
}
})
//获取未排号的站点列表
this.noNumberList=JSON.parse(JSON.stringify(totalList))
this.noNumberList.forEach((item,index)=>{
usedNewArr.forEach(item2=>{
if(item.projectIds==item2.projectId){
delete this.noNumberList[index]
}
})
})
this.noNumberList=this.noNumberList.filter(function (val) {
return val
})
if(this.noNumberList.length==0){
uni.navigateTo({
url:`/pages/my/order/electronicTicket/electronicTicket?orderId=${this.orderId}`
})
}
if(this.noNumberList.length==1){
let chooseArea=JSON.stringify(this.noNumberList[0])
uni.navigateTo({
url:`/pages/my/takeNumber/rowNumber/rowNumber?chooseArea=${chooseArea}&orderId=${this.orderId}&thirdOrderId=${this.thirdOrderId}&merchantCode=${this.merchantCode}&channelName=${this.channelName}&productName=${this.productName}`
})
}
if(this.noNumberList.length>1){
let list=JSON.stringify(this.noNumberList)
uni.navigateTo({
url:`/pages/my/takeNumber/numberChoose/numberChoose?list=${list}&orderId=${this.orderId}&thirdOrderId=${this.thirdOrderId}&merchantCode=${this.merchantCode}&channelName=${this.channelName}&productName=${this.productName}`
})
}
}else{
uni.showToast({
title: res.message,
icon: 'none',
duration:4000
})
}
})
}
}
}
</script>
<style lang="scss" scoped>
.wrap {
height: 100%;
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(180deg, #3688ff 0%, #2abbd7 100%);
}
.first input {
width: 600rpx;
height: 88rpx;
background: #fff;
border-radius: 8rpx;
padding: 0 24rpx;
}
.query {
margin-top: 48rpx;
display: flex;
justify-content: center;
}
.button {
display: inline-block;
width: 440rpx;
height: 80rpx;
line-height: 80rpx;
background: #3688ff;
border-radius: 40rpx;
text-align: center;
color: #fff;
font-size: 32rpx;
font-weight: bold;
}
// 遮罩层
.mark-box {
position: fixed;
z-index: 100;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.6);
display: flex;
align-items: center;
justify-content: center;
}
.mark-content{
background: #ffffff;
margin: 0 48rpx;
border-radius: 16rpx;
padding: 64rpx 0;
text-align: center;
}
.mark-title{
font-size: 40rpx;
font-weight: bold;
color: #191919;
}
.mark-tip{
font-size: 32rpx;
margin-top: 24rpx;
}
.mark-btn{
margin-top: 48rpx;
.btn{
width: 212rpx;
height: 80rpx;
line-height: 60rpx;
font-size: 32rpx;
background: #3688FF;
border-radius: 40rpx;
}
}
.mark-close{
margin-top: 60rpx;
display: flex;
justify-content: center;
}
</style>