jufubao-movie 1.0.39-beta14 → 1.0.39-beta17
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
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
:is_not_show_price="is_not_show_price"
|
|
57
57
|
@onGetFilm="handleGetFilm"
|
|
58
58
|
@onGetSeatList="handleGetSeatList"
|
|
59
|
+
@onGetFilmPaiqi="handleGetFilmPaiqi"
|
|
59
60
|
@onBuy="handleBuy"></xd-online-seat>
|
|
60
61
|
</view>
|
|
61
62
|
</view>
|
|
@@ -125,6 +126,37 @@
|
|
|
125
126
|
}
|
|
126
127
|
},
|
|
127
128
|
|
|
129
|
+
/**
|
|
130
|
+
* @description 获取排期数据
|
|
131
|
+
* @param resolve
|
|
132
|
+
*/
|
|
133
|
+
handleGetFilmPaiqi(resolve){
|
|
134
|
+
const {filmId, cinemaId} = this;
|
|
135
|
+
this.$xdShowLoading({});
|
|
136
|
+
jfbRootExec("getCinemaSchedule", {
|
|
137
|
+
vm: this,
|
|
138
|
+
data: {cinema_id: cinemaId, film_id: filmId}
|
|
139
|
+
}).then(res=>{
|
|
140
|
+
this.paiQiData = res.schedule_data.map(item => {
|
|
141
|
+
item['name'] = item['date_name'];
|
|
142
|
+
item['paiqi_data'] = item['paiqi'].map(pp => {
|
|
143
|
+
pp['price'] = pp['sale_price'];
|
|
144
|
+
pp['jfb_film_id'] = pp['film_id'];
|
|
145
|
+
pp['jfb_cinema_id'] = pp['cinema_id'];
|
|
146
|
+
pp['data_id'] = pp['schedule_id'];
|
|
147
|
+
return pp;
|
|
148
|
+
});
|
|
149
|
+
return item;
|
|
150
|
+
});
|
|
151
|
+
resolve(this.paiQiData);
|
|
152
|
+
this.$xdHideLoading();
|
|
153
|
+
})
|
|
154
|
+
.catch(err=>{
|
|
155
|
+
console.error(err);
|
|
156
|
+
this.$xdHideLoading();
|
|
157
|
+
})
|
|
158
|
+
},
|
|
159
|
+
|
|
128
160
|
getSeatStatus(request_seat_id) {
|
|
129
161
|
this.$xdShowLoading({});
|
|
130
162
|
jfbRootExec("getCinemaSeatsStatus", {
|
|
@@ -133,6 +165,10 @@
|
|
|
133
165
|
request_seat_id: request_seat_id
|
|
134
166
|
}
|
|
135
167
|
}).then(res => {
|
|
168
|
+
// res['seat_code'] = 'P0007';
|
|
169
|
+
// res['seat_message'] = '当前场次有误,请您重新选择影片';
|
|
170
|
+
// res['seat_status'] = 'N'
|
|
171
|
+
|
|
136
172
|
if (res.seat_status === 'Y') {
|
|
137
173
|
this.$xdHideLoading()
|
|
138
174
|
clearTimeout(this.timer)
|
|
@@ -140,17 +176,21 @@
|
|
|
140
176
|
url: this.moviePayPath + `?order_id=${res.temp_order_id}`
|
|
141
177
|
},true);
|
|
142
178
|
return
|
|
143
|
-
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
//有错处理res.seat_status
|
|
182
|
+
else if (res.seat_status === 'N') {
|
|
144
183
|
clearTimeout(this.timer)
|
|
145
184
|
this.$xdHideLoading();
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
return
|
|
153
|
-
}
|
|
185
|
+
|
|
186
|
+
if(res['seat_message']) res['error_msg'] = res['error_msg'] || res['seat_message'];
|
|
187
|
+
if(res['seat_code']) res['error_code'] = res['error_code'] || res['seat_code']
|
|
188
|
+
|
|
189
|
+
//检查是否报错
|
|
190
|
+
this.handleCheckStatusIsError(res);
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
else{
|
|
154
194
|
this.timer = setTimeout(() => {
|
|
155
195
|
this.getSeatStatus(request_seat_id);
|
|
156
196
|
}, ++this.time > 5 ? (Math.pow(2, (this.time - 4)) * 1000) : 3000)
|
|
@@ -160,6 +200,7 @@
|
|
|
160
200
|
this.$xdHideLoading()
|
|
161
201
|
})
|
|
162
202
|
},
|
|
203
|
+
|
|
163
204
|
/**
|
|
164
205
|
* @description 监听事件变化
|
|
165
206
|
* @param container {object} 业务组件对象自己
|
|
@@ -171,8 +212,12 @@
|
|
|
171
212
|
if(this.isShowTitle === 'Y') this.yItem = 7;
|
|
172
213
|
else this.yItem = 10;
|
|
173
214
|
},
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* @description 获取排期与影片基础信息数据
|
|
218
|
+
* @param resolve
|
|
219
|
+
*/
|
|
174
220
|
handleGetFilm(resolve) {
|
|
175
|
-
// console.log('11111', paiqi.result);
|
|
176
221
|
const {filmId, cinemaId} = this;
|
|
177
222
|
this.$xdShowLoading({});
|
|
178
223
|
Promise.all([
|
|
@@ -182,6 +227,15 @@
|
|
|
182
227
|
]).then(([res, res1]) => {
|
|
183
228
|
this.loadingList = false;
|
|
184
229
|
this.$xdHideLoading();
|
|
230
|
+
|
|
231
|
+
//错误异常
|
|
232
|
+
if(res1['error_code']) {
|
|
233
|
+
this.handleCheckStatusIsError(res1, ()=>{
|
|
234
|
+
this.handleGetFilm(resolve)
|
|
235
|
+
});
|
|
236
|
+
return
|
|
237
|
+
}
|
|
238
|
+
|
|
185
239
|
this.is_not_show_price = res.is_not_show_price;
|
|
186
240
|
let paiqi_data = res.schedule_data.map(item => {
|
|
187
241
|
item['name'] = item['date_name'];
|
|
@@ -195,7 +249,6 @@
|
|
|
195
249
|
return item;
|
|
196
250
|
});
|
|
197
251
|
this.paiQiData = paiqi_data;
|
|
198
|
-
// const {cinema_data, film_data} = res1;
|
|
199
252
|
resolve({
|
|
200
253
|
paiqi_data: paiqi_data,
|
|
201
254
|
film_data: [{
|
|
@@ -225,6 +278,10 @@
|
|
|
225
278
|
request_ident: this.request_ident
|
|
226
279
|
}
|
|
227
280
|
}).then(res => {
|
|
281
|
+
// res['error_code'] = 'P0002';
|
|
282
|
+
// res['error_msg'] = '当前场次有更新 <br/> 请您手动切换或由系统自动切换到下一场次。';
|
|
283
|
+
// res['status'] = 'E'
|
|
284
|
+
|
|
228
285
|
if(res.status === "P"){
|
|
229
286
|
if(!this.$root.$isShow) return;
|
|
230
287
|
this.request_ident = res.request_ident;
|
|
@@ -234,32 +291,36 @@
|
|
|
234
291
|
}, ++this.seatTime > 5 ? (Math.pow(2, (this.seatTime - 4)) * 1000) : 2000)
|
|
235
292
|
return;
|
|
236
293
|
}
|
|
294
|
+
|
|
237
295
|
if(res.status === "E"){
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
})
|
|
296
|
+
this.handleCheckStatusIsError(res, ()=>{
|
|
297
|
+
resolve(null);
|
|
298
|
+
});
|
|
242
299
|
this.$xdHideLoading();
|
|
243
300
|
return;
|
|
244
301
|
}
|
|
302
|
+
|
|
245
303
|
let seatData = Object.assign({}, res, {
|
|
246
304
|
seat: res.seat_data.map(item => {
|
|
247
305
|
return item.seat_columns;
|
|
248
306
|
})
|
|
249
|
-
})
|
|
307
|
+
});
|
|
308
|
+
|
|
250
309
|
resolve(seatData);
|
|
251
310
|
this.$xdHideLoading();
|
|
252
311
|
})
|
|
253
312
|
},
|
|
313
|
+
|
|
254
314
|
//去支付未完成订单
|
|
255
315
|
handleToPay(res){
|
|
256
316
|
const { temp_order_id, oms_order_id, pay_order_id } = res;
|
|
257
317
|
this.$xdConfirm({
|
|
258
318
|
styles: this.styles,
|
|
259
319
|
width: '90%',
|
|
260
|
-
content: '
|
|
261
|
-
confirmText: '
|
|
262
|
-
|
|
320
|
+
content: '您当前有一笔未付款订单,<br/>请先处理!',
|
|
321
|
+
confirmText: '立即付款',
|
|
322
|
+
isHtml: true,
|
|
323
|
+
cancelText: '取消订单',
|
|
263
324
|
showClose: false,
|
|
264
325
|
success: (res) => {
|
|
265
326
|
if (res.confirm) {
|
|
@@ -288,6 +349,60 @@
|
|
|
288
349
|
})
|
|
289
350
|
},
|
|
290
351
|
|
|
352
|
+
handleCheckStatusIsError({error_msg,error_message,error_code}, cb=null){
|
|
353
|
+
let msg = error_message || error_msg;
|
|
354
|
+
if(!msg) return false;
|
|
355
|
+
|
|
356
|
+
//是否切换场次
|
|
357
|
+
if(error_code === 'P0002') {
|
|
358
|
+
this.$xdConfirm({
|
|
359
|
+
content: msg,
|
|
360
|
+
zIndex: 5000,
|
|
361
|
+
isHtml: true,
|
|
362
|
+
isTitle:false,
|
|
363
|
+
cancelText:'手动切换',
|
|
364
|
+
confirmText:'自动切换',
|
|
365
|
+
msgIcon:'iconinformation',
|
|
366
|
+
success:(res)=>{
|
|
367
|
+
if(res.confirm) {
|
|
368
|
+
if(typeof cb === 'function') cb();
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
})
|
|
372
|
+
return true
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
//当前场次有误,请您重新选择影片
|
|
376
|
+
if(error_code === 'P0007') {
|
|
377
|
+
this.$xdConfirm({
|
|
378
|
+
content: msg,
|
|
379
|
+
zIndex: 5000,
|
|
380
|
+
cancel:false,
|
|
381
|
+
isHtml: true,
|
|
382
|
+
isTitle:false,
|
|
383
|
+
confirmText:'返回首页',
|
|
384
|
+
msgIcon:'iconinformation',
|
|
385
|
+
success:(res)=>{
|
|
386
|
+
if(res.confirm) {
|
|
387
|
+
this.$xdUniHelper.redirectTo({
|
|
388
|
+
url: this.$settings.index
|
|
389
|
+
})
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
})
|
|
393
|
+
return true
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
this.$xdAlert({
|
|
397
|
+
content: msg,
|
|
398
|
+
type: 'error',
|
|
399
|
+
time: 3000,
|
|
400
|
+
zIndex: 5000
|
|
401
|
+
})
|
|
402
|
+
this.$xdHideLoading({})
|
|
403
|
+
return true;
|
|
404
|
+
},
|
|
405
|
+
|
|
291
406
|
handleBuy(item) {
|
|
292
407
|
let postData = {
|
|
293
408
|
schedule_id: this.scheduleId,
|
|
@@ -301,16 +416,28 @@
|
|
|
301
416
|
vm: this,
|
|
302
417
|
data: postData
|
|
303
418
|
}).then(res => {
|
|
304
|
-
|
|
419
|
+
//检查是否有错误信息并且弹层
|
|
420
|
+
if(this.handleCheckStatusIsError(res)){
|
|
421
|
+
this.$xdHideLoading()
|
|
422
|
+
return;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
//未获取到锁座ID
|
|
426
|
+
if(!res.request_seat_id) {
|
|
427
|
+
this.$xdHideLoading();
|
|
428
|
+
this.$xdAlert({
|
|
429
|
+
content: '未获取到锁座ID',
|
|
430
|
+
type: 'error',
|
|
431
|
+
time: 3000
|
|
432
|
+
})
|
|
433
|
+
return;
|
|
434
|
+
}
|
|
435
|
+
|
|
305
436
|
this.timer = setTimeout(() => {
|
|
306
437
|
this.getSeatStatus(res.request_seat_id);
|
|
307
438
|
}, 2000)
|
|
308
439
|
}).catch(error=>{
|
|
309
440
|
console.error(error);
|
|
310
|
-
uni.showToast({
|
|
311
|
-
title: '锁座失败!',
|
|
312
|
-
icon: "none"
|
|
313
|
-
})
|
|
314
441
|
this.$xdHideLoading()
|
|
315
442
|
})
|
|
316
443
|
},
|
|
@@ -319,16 +446,18 @@
|
|
|
319
446
|
this.$xdUniHelper.navigateBack();
|
|
320
447
|
},
|
|
321
448
|
onJfbShow(options) {
|
|
322
|
-
console.log('onJfbShow', options)
|
|
323
449
|
this.onJfbLoad(options);
|
|
324
450
|
this.cinemaSeatKey = Date.now()
|
|
325
451
|
},
|
|
452
|
+
|
|
326
453
|
onJfbUnload(){
|
|
327
454
|
this.unmount();
|
|
328
455
|
},
|
|
456
|
+
|
|
329
457
|
onJfbHide(){
|
|
330
458
|
this.unmount();
|
|
331
459
|
},
|
|
460
|
+
|
|
332
461
|
unmount(){
|
|
333
462
|
if(this.seatTimer) clearTimeout(this.seatTimer);
|
|
334
463
|
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({
|