jufubao-movie 1.0.39 → 1.0.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -44,10 +44,9 @@
|
|
|
44
44
|
<view class="seat_btn"></view>
|
|
45
45
|
</view>
|
|
46
46
|
<xd-online-seat
|
|
47
|
-
v-if="filmId"
|
|
47
|
+
v-if="isReload && filmId"
|
|
48
48
|
ref="xdOnlineSeat"
|
|
49
49
|
:is-show-title="isShowTitle"
|
|
50
|
-
:key="cinemaSeatKey"
|
|
51
50
|
:is-old="false"
|
|
52
51
|
:film-id="filmId"
|
|
53
52
|
:cinema-id="cinemaId"
|
|
@@ -56,6 +55,7 @@
|
|
|
56
55
|
:is_not_show_price="is_not_show_price"
|
|
57
56
|
@onGetFilm="handleGetFilm"
|
|
58
57
|
@onGetSeatList="handleGetSeatList"
|
|
58
|
+
@onGetFilmPaiqi="handleGetFilmPaiqi"
|
|
59
59
|
@onBuy="handleBuy"></xd-online-seat>
|
|
60
60
|
</view>
|
|
61
61
|
</view>
|
|
@@ -99,6 +99,8 @@
|
|
|
99
99
|
time: 0,
|
|
100
100
|
xItem: 10,
|
|
101
101
|
yItem: 7,
|
|
102
|
+
|
|
103
|
+
isReload: true,//控制重新加载(onJfbShow)
|
|
102
104
|
}
|
|
103
105
|
},
|
|
104
106
|
watch: {
|
|
@@ -125,6 +127,37 @@
|
|
|
125
127
|
}
|
|
126
128
|
},
|
|
127
129
|
|
|
130
|
+
/**
|
|
131
|
+
* @description 获取排期数据
|
|
132
|
+
* @param resolve
|
|
133
|
+
*/
|
|
134
|
+
handleGetFilmPaiqi(resolve){
|
|
135
|
+
const {filmId, cinemaId} = this;
|
|
136
|
+
this.$xdShowLoading({});
|
|
137
|
+
jfbRootExec("getCinemaSchedule", {
|
|
138
|
+
vm: this,
|
|
139
|
+
data: {cinema_id: cinemaId, film_id: filmId}
|
|
140
|
+
}).then(res=>{
|
|
141
|
+
this.paiQiData = res.schedule_data.map(item => {
|
|
142
|
+
item['name'] = item['date_name'];
|
|
143
|
+
item['paiqi_data'] = item['paiqi'].map(pp => {
|
|
144
|
+
pp['price'] = pp['sale_price'];
|
|
145
|
+
pp['jfb_film_id'] = pp['film_id'];
|
|
146
|
+
pp['jfb_cinema_id'] = pp['cinema_id'];
|
|
147
|
+
pp['data_id'] = pp['schedule_id'];
|
|
148
|
+
return pp;
|
|
149
|
+
});
|
|
150
|
+
return item;
|
|
151
|
+
});
|
|
152
|
+
resolve(this.paiQiData);
|
|
153
|
+
this.$xdHideLoading();
|
|
154
|
+
})
|
|
155
|
+
.catch(err=>{
|
|
156
|
+
console.error(err);
|
|
157
|
+
this.$xdHideLoading();
|
|
158
|
+
})
|
|
159
|
+
},
|
|
160
|
+
|
|
128
161
|
getSeatStatus(request_seat_id) {
|
|
129
162
|
this.$xdShowLoading({});
|
|
130
163
|
jfbRootExec("getCinemaSeatsStatus", {
|
|
@@ -133,6 +166,10 @@
|
|
|
133
166
|
request_seat_id: request_seat_id
|
|
134
167
|
}
|
|
135
168
|
}).then(res => {
|
|
169
|
+
// res['seat_code'] = 'P0007';
|
|
170
|
+
// res['seat_message'] = '当前场次有误,请您重新选择影片';
|
|
171
|
+
// res['seat_status'] = 'N'
|
|
172
|
+
|
|
136
173
|
if (res.seat_status === 'Y') {
|
|
137
174
|
this.$xdHideLoading()
|
|
138
175
|
clearTimeout(this.timer)
|
|
@@ -140,17 +177,21 @@
|
|
|
140
177
|
url: this.moviePayPath + `?order_id=${res.temp_order_id}`
|
|
141
178
|
},true);
|
|
142
179
|
return
|
|
143
|
-
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
//有错处理res.seat_status
|
|
183
|
+
else if (res.seat_status === 'N') {
|
|
144
184
|
clearTimeout(this.timer)
|
|
145
185
|
this.$xdHideLoading();
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
return
|
|
153
|
-
}
|
|
186
|
+
|
|
187
|
+
if(res['seat_message']) res['error_msg'] = res['error_msg'] || res['seat_message'];
|
|
188
|
+
if(res['seat_code']) res['error_code'] = res['error_code'] || res['seat_code']
|
|
189
|
+
|
|
190
|
+
//检查是否报错
|
|
191
|
+
this.handleCheckStatusIsError(res);
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
else{
|
|
154
195
|
this.timer = setTimeout(() => {
|
|
155
196
|
this.getSeatStatus(request_seat_id);
|
|
156
197
|
}, ++this.time > 5 ? (Math.pow(2, (this.time - 4)) * 1000) : 3000)
|
|
@@ -160,6 +201,7 @@
|
|
|
160
201
|
this.$xdHideLoading()
|
|
161
202
|
})
|
|
162
203
|
},
|
|
204
|
+
|
|
163
205
|
/**
|
|
164
206
|
* @description 监听事件变化
|
|
165
207
|
* @param container {object} 业务组件对象自己
|
|
@@ -171,8 +213,12 @@
|
|
|
171
213
|
if(this.isShowTitle === 'Y') this.yItem = 7;
|
|
172
214
|
else this.yItem = 10;
|
|
173
215
|
},
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* @description 获取排期与影片基础信息数据
|
|
219
|
+
* @param resolve
|
|
220
|
+
*/
|
|
174
221
|
handleGetFilm(resolve) {
|
|
175
|
-
// console.log('11111', paiqi.result);
|
|
176
222
|
const {filmId, cinemaId} = this;
|
|
177
223
|
this.$xdShowLoading({});
|
|
178
224
|
Promise.all([
|
|
@@ -182,6 +228,15 @@
|
|
|
182
228
|
]).then(([res, res1]) => {
|
|
183
229
|
this.loadingList = false;
|
|
184
230
|
this.$xdHideLoading();
|
|
231
|
+
|
|
232
|
+
//错误异常
|
|
233
|
+
if(res1['error_code']) {
|
|
234
|
+
this.handleCheckStatusIsError(res1, ()=>{
|
|
235
|
+
this.handleGetFilm(resolve)
|
|
236
|
+
});
|
|
237
|
+
return
|
|
238
|
+
}
|
|
239
|
+
|
|
185
240
|
this.is_not_show_price = res.is_not_show_price;
|
|
186
241
|
let paiqi_data = res.schedule_data.map(item => {
|
|
187
242
|
item['name'] = item['date_name'];
|
|
@@ -195,7 +250,6 @@
|
|
|
195
250
|
return item;
|
|
196
251
|
});
|
|
197
252
|
this.paiQiData = paiqi_data;
|
|
198
|
-
// const {cinema_data, film_data} = res1;
|
|
199
253
|
resolve({
|
|
200
254
|
paiqi_data: paiqi_data,
|
|
201
255
|
film_data: [{
|
|
@@ -225,6 +279,10 @@
|
|
|
225
279
|
request_ident: this.request_ident
|
|
226
280
|
}
|
|
227
281
|
}).then(res => {
|
|
282
|
+
// res['error_code'] = 'P0002';
|
|
283
|
+
// res['error_msg'] = '当前场次有更新 <br/> 请您手动切换或由系统自动切换到下一场次。';
|
|
284
|
+
// res['status'] = 'E'
|
|
285
|
+
|
|
228
286
|
if(res.status === "P"){
|
|
229
287
|
if(!this.$root.$isShow) return;
|
|
230
288
|
this.request_ident = res.request_ident;
|
|
@@ -234,32 +292,36 @@
|
|
|
234
292
|
}, ++this.seatTime > 5 ? (Math.pow(2, (this.seatTime - 4)) * 1000) : 2000)
|
|
235
293
|
return;
|
|
236
294
|
}
|
|
295
|
+
|
|
237
296
|
if(res.status === "E"){
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
})
|
|
297
|
+
this.handleCheckStatusIsError(res, ()=>{
|
|
298
|
+
resolve(null);
|
|
299
|
+
});
|
|
242
300
|
this.$xdHideLoading();
|
|
243
301
|
return;
|
|
244
302
|
}
|
|
303
|
+
|
|
245
304
|
let seatData = Object.assign({}, res, {
|
|
246
305
|
seat: res.seat_data.map(item => {
|
|
247
306
|
return item.seat_columns;
|
|
248
307
|
})
|
|
249
|
-
})
|
|
308
|
+
});
|
|
309
|
+
|
|
250
310
|
resolve(seatData);
|
|
251
311
|
this.$xdHideLoading();
|
|
252
312
|
})
|
|
253
313
|
},
|
|
314
|
+
|
|
254
315
|
//去支付未完成订单
|
|
255
316
|
handleToPay(res){
|
|
256
317
|
const { temp_order_id, oms_order_id, pay_order_id } = res;
|
|
257
318
|
this.$xdConfirm({
|
|
258
319
|
styles: this.styles,
|
|
259
320
|
width: '90%',
|
|
260
|
-
content: '
|
|
261
|
-
confirmText: '
|
|
262
|
-
|
|
321
|
+
content: '您当前有一笔未付款订单,<br/>请先处理!',
|
|
322
|
+
confirmText: '立即付款',
|
|
323
|
+
isHtml: true,
|
|
324
|
+
cancelText: '取消订单',
|
|
263
325
|
showClose: false,
|
|
264
326
|
success: (res) => {
|
|
265
327
|
if (res.confirm) {
|
|
@@ -288,6 +350,60 @@
|
|
|
288
350
|
})
|
|
289
351
|
},
|
|
290
352
|
|
|
353
|
+
handleCheckStatusIsError({error_msg,error_message,error_code}, cb=null){
|
|
354
|
+
let msg = error_message || error_msg;
|
|
355
|
+
if(!msg) return false;
|
|
356
|
+
|
|
357
|
+
//是否切换场次
|
|
358
|
+
if(error_code === 'P0002') {
|
|
359
|
+
this.$xdConfirm({
|
|
360
|
+
content: msg,
|
|
361
|
+
zIndex: 5000,
|
|
362
|
+
isHtml: true,
|
|
363
|
+
isTitle:false,
|
|
364
|
+
cancelText:'手动切换',
|
|
365
|
+
confirmText:'自动切换',
|
|
366
|
+
msgIcon:'iconinformation',
|
|
367
|
+
success:(res)=>{
|
|
368
|
+
if(res.confirm) {
|
|
369
|
+
if(typeof cb === 'function') cb();
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
})
|
|
373
|
+
return true
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
//当前场次有误,请您重新选择影片
|
|
377
|
+
if(error_code === 'P0007') {
|
|
378
|
+
this.$xdConfirm({
|
|
379
|
+
content: msg,
|
|
380
|
+
zIndex: 5000,
|
|
381
|
+
cancel:false,
|
|
382
|
+
isHtml: true,
|
|
383
|
+
isTitle:false,
|
|
384
|
+
confirmText:'返回首页',
|
|
385
|
+
msgIcon:'iconinformation',
|
|
386
|
+
success:(res)=>{
|
|
387
|
+
if(res.confirm) {
|
|
388
|
+
this.$xdUniHelper.redirectTo({
|
|
389
|
+
url: this.$settings.index
|
|
390
|
+
})
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
})
|
|
394
|
+
return true
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
this.$xdAlert({
|
|
398
|
+
content: msg,
|
|
399
|
+
type: 'error',
|
|
400
|
+
time: 3000,
|
|
401
|
+
zIndex: 5000
|
|
402
|
+
})
|
|
403
|
+
this.$xdHideLoading({})
|
|
404
|
+
return true;
|
|
405
|
+
},
|
|
406
|
+
|
|
291
407
|
handleBuy(item) {
|
|
292
408
|
let postData = {
|
|
293
409
|
schedule_id: this.scheduleId,
|
|
@@ -301,16 +417,28 @@
|
|
|
301
417
|
vm: this,
|
|
302
418
|
data: postData
|
|
303
419
|
}).then(res => {
|
|
304
|
-
|
|
420
|
+
//检查是否有错误信息并且弹层
|
|
421
|
+
if(this.handleCheckStatusIsError(res)){
|
|
422
|
+
this.$xdHideLoading()
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
//未获取到锁座ID
|
|
427
|
+
if(!res.request_seat_id) {
|
|
428
|
+
this.$xdHideLoading();
|
|
429
|
+
this.$xdAlert({
|
|
430
|
+
content: '未获取到锁座ID',
|
|
431
|
+
type: 'error',
|
|
432
|
+
time: 3000
|
|
433
|
+
})
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
|
|
305
437
|
this.timer = setTimeout(() => {
|
|
306
438
|
this.getSeatStatus(res.request_seat_id);
|
|
307
439
|
}, 2000)
|
|
308
440
|
}).catch(error=>{
|
|
309
441
|
console.error(error);
|
|
310
|
-
uni.showToast({
|
|
311
|
-
title: '锁座失败!',
|
|
312
|
-
icon: "none"
|
|
313
|
-
})
|
|
314
442
|
this.$xdHideLoading()
|
|
315
443
|
})
|
|
316
444
|
},
|
|
@@ -318,17 +446,23 @@
|
|
|
318
446
|
onJfbBack(options){
|
|
319
447
|
this.$xdUniHelper.navigateBack();
|
|
320
448
|
},
|
|
449
|
+
|
|
321
450
|
onJfbShow(options) {
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
451
|
+
this.isReload = false;
|
|
452
|
+
setTimeout(()=>{
|
|
453
|
+
this.isReload = true;
|
|
454
|
+
this.onJfbLoad(options);
|
|
455
|
+
},100)
|
|
325
456
|
},
|
|
457
|
+
|
|
326
458
|
onJfbUnload(){
|
|
327
459
|
this.unmount();
|
|
328
460
|
},
|
|
461
|
+
|
|
329
462
|
onJfbHide(){
|
|
330
463
|
this.unmount();
|
|
331
464
|
},
|
|
465
|
+
|
|
332
466
|
unmount(){
|
|
333
467
|
if(this.seatTimer) clearTimeout(this.seatTimer);
|
|
334
468
|
if(this.timer) clearTimeout(this.timer);
|
|
@@ -257,6 +257,7 @@ export default {
|
|
|
257
257
|
mainColorToArray: null,
|
|
258
258
|
paiqiStatus: false, //影院信息与排期信息状态
|
|
259
259
|
cinemaInfo: null, //影院信息
|
|
260
|
+
paiqiData:null, //排期数据
|
|
260
261
|
filmInfo: null, //电影信息
|
|
261
262
|
height: null, //内容区域高度
|
|
262
263
|
show: false, //是否显示返回
|
|
@@ -454,6 +455,21 @@ export default {
|
|
|
454
455
|
*/
|
|
455
456
|
getSeat(item) {
|
|
456
457
|
this.$emit("onGetSeatList", item, (seat) => {
|
|
458
|
+
|
|
459
|
+
//排期有更新自动选中下一场
|
|
460
|
+
if(seat === null) {
|
|
461
|
+
this.$emit('onGetFilmPaiqi',(paiqiData)=>{
|
|
462
|
+
let list = [];
|
|
463
|
+
paiqiData.map(item => {
|
|
464
|
+
list.push(item["paiqi_data"]);
|
|
465
|
+
});
|
|
466
|
+
this.replaceParams(this.getFirst(list));
|
|
467
|
+
});
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
//正常数据
|
|
472
|
+
this.selectedSeatInfo = seat;
|
|
457
473
|
this.selectedSeatList = seat["seat"];
|
|
458
474
|
this.areaPrices = (seat['area_price'] || []).map(item=>{
|
|
459
475
|
return {
|
|
@@ -467,13 +483,13 @@ export default {
|
|
|
467
483
|
},
|
|
468
484
|
|
|
469
485
|
/**
|
|
470
|
-
* @description
|
|
486
|
+
* @description 获取排期与影院信息数据
|
|
471
487
|
*/
|
|
472
488
|
getFilm() {
|
|
473
489
|
this.$emit("onGetFilm", (film) => {
|
|
474
490
|
this.cinemaInfo = film["cinema_data"];
|
|
491
|
+
this.paiqiData = film["paiqi_data"];
|
|
475
492
|
this.filmInfo = this.getFilmInfo(film["film_data"]);
|
|
476
|
-
debugger
|
|
477
493
|
this.getScheduleList(film["paiqi_data"]);
|
|
478
494
|
console.log("getFilm", film);
|
|
479
495
|
this.paiqiStatus = true;
|
|
@@ -559,9 +575,13 @@ export default {
|
|
|
559
575
|
console.warn(`params.seatId:${this.seatId}`);
|
|
560
576
|
console.warn(`all.seatId:${JSON.stringify(allPaiqiId)}`);
|
|
561
577
|
this.$xdConfirm({
|
|
562
|
-
content:'
|
|
578
|
+
content:'当前场次有更新<br/>请您手动切换或由系统自动切换到下一场次。',
|
|
563
579
|
confirmText:'自动切换',
|
|
564
580
|
cancelText:'手动切换',
|
|
581
|
+
msgIcon:'iconinformation',
|
|
582
|
+
zIndex:5000,
|
|
583
|
+
isHtml: true,
|
|
584
|
+
isTitle:false,
|
|
565
585
|
styles: this.$parent.$parent.$parent.styles,
|
|
566
586
|
success:(status)=>{
|
|
567
587
|
if(status.confirm) {
|
|
@@ -585,9 +605,16 @@ export default {
|
|
|
585
605
|
this.scheduleListIndex
|
|
586
606
|
);
|
|
587
607
|
},
|
|
608
|
+
|
|
588
609
|
replaceParams(selectPaiqi) {
|
|
589
|
-
let
|
|
590
|
-
|
|
610
|
+
let { params, path } = this.$xdUniHelper.parseURL();
|
|
611
|
+
|
|
612
|
+
//#ifdef H5
|
|
613
|
+
let pathArr = path.split("/");
|
|
614
|
+
pathArr.splice(0,2)
|
|
615
|
+
path = `/${pathArr.join('/')}`
|
|
616
|
+
//#endif
|
|
617
|
+
|
|
591
618
|
params["scheduleId"] = selectPaiqi["data_id"];
|
|
592
619
|
let searchParams = this.$xdUniHelper.jsonToParams(params);
|
|
593
620
|
this.$xdUniHelper.redirectTo({
|