jufubao-movie 1.0.36-beta2 → 1.0.36-beta4

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.
@@ -14,87 +14,816 @@
14
14
  </view>
15
15
  <!-- #endif -->
16
16
  <view class="jfb-movie-tfk-film-list__body">
17
- <view>测试插件( {{containerId}} )</view>
17
+ <view class="x-line"></view>
18
+ <view
19
+ class="tfk-list"
20
+ v-if="showTypeListData.length > 0"
21
+ :style="{
22
+ padding: outSpacing + 'rpx'
23
+ }"
24
+ >
25
+ <view class="list-tab" v-if="showTypeListData.length > 1">
26
+ <view
27
+ :class="{active: item.value === type}"
28
+ v-for="(item,index) in showTypeListData"
29
+ @click="handleTab(item.value)"
30
+ :key="index"
31
+ :style="{
32
+ backgroundColor:item.value === type ? tabStyle.actBgColor:tabStyle.bgColor,
33
+ color: item.value === type?tabStyle.actColor:tabStyle.color,
34
+ fontWeight: item.value === type? tabStyle.actFontWeight: tabStyle.fontWeight,
35
+ fontSize: item.value === type?(tabStyle.actFontSize):(tabStyle.fontSize),
36
+ borderRadius: tabRradius + 'rpx',
37
+ border:item.value === type?tabActBorder:tabBorder,
38
+ boxShadow: item.value === type ? tabActShadow: tabShadow,
39
+ marginRight: outSpacing + 'rpx',
40
+ }"
41
+ >{{item.label}}</view>
42
+ </view>
43
+ <!--poster-->
44
+ <view
45
+ class="list-poster"
46
+ v-if="posterList !== null && posterList.length > 0"
47
+ :style="{marginTop:outSpacing + 'rpx'}"
48
+ >
49
+ <view
50
+ :style="{width: posterSize.width + 'rpx', height: posterSize.height + 'rpx' }"
51
+ class="list-poster-one"
52
+ v-if="posterList.length === 1"
53
+ >
54
+ <image :src="posterList[0].image_url" :alt="posterList[0].content_name"></image>
55
+ </view>
56
+ <view class="list-poster-more" v-else>
57
+ <xd-swiper-dot
58
+ :style="{width: posterSize.width + 'rpx', height: posterSize.height + 'rpx' }"
59
+ :current="current"
60
+ :info="posterList"
61
+ field="content_name"
62
+ :mode="mode"
63
+ :dots-styles="dotStyleData"
64
+ >
65
+ <swiper
66
+ class="swiper xd-swiper-content"
67
+ :style="{width: posterSize.width + 'rpx', height: posterSize.height + 'rpx' }"
68
+ :indicator-dots="false"
69
+ :autoplay="carouselTime >0"
70
+ :interval="carouselTime"
71
+ :duration="500"
72
+ :current="current"
73
+ circular
74
+ @animationfinish="handleAnimationfinish"
75
+ >
76
+ <swiper-item v-for="(item,index) in posterList" :key="index" @click.stop="handleClick(item,index)">
77
+ <image :style="{width: posterSize.width + 'rpx', height: posterSize.height + 'rpx' }" :src="item['image_url']" mode="aspectFill"></image>
78
+ </swiper-item>
79
+ </swiper>
80
+ </xd-swiper-dot>
81
+ </view>
82
+ </view>
83
+ <!--poster-->
84
+ <!--film hot|rightnow-->
85
+ <view
86
+ v-if="type === 'hot' || type === 'rightnow'"
87
+ class="list-cont"
88
+ :style="{marginTop:outSpacing + 'rpx'}"
89
+ >
90
+ <view class="skeleton-wrap" v-if="dataList === null">
91
+ <view
92
+ class="skeleton-wrap-item"
93
+ v-for="item in 6"
94
+ :key="item"
95
+ :style="{
96
+ marginBottom:outSpacing + 'rpx',
97
+ padding:contMarginComp,
98
+ borderRadius:contRradius+ 'rpx',
99
+ border:contBorder,
100
+ boxShadow:contShadow,
101
+ }"
102
+ >
103
+ <view class="skeleton-wrap-item-image skeleton-item" :style="{marginRight:outSpacing + 'rpx'}"></view>
104
+ <view class="skeleton-wrap-item-title">
105
+ <view class="title skeleton-item"></view>
106
+ <view class="type skeleton-item"></view>
107
+ <view class="director skeleton-item"></view>
108
+ <view class="star skeleton-item"></view>
109
+ </view>
110
+ <view class="skeleton-wrap-item-btn skeleton-item" :style="{marginLeft:outSpacing + 'rpx'}">
111
+ <view class="score skeleton-item"></view>
112
+ <view class="btn skeleton-item"></view>
113
+ </view>
114
+ </view>
115
+ </view>
116
+ <template v-if="dataList !== null">
117
+ <view
118
+ class="list-cont-item"
119
+ v-for="film in dataList"
120
+ :key="film.id"
121
+ :style="{
122
+ marginBottom:outSpacing + 'rpx',
123
+ padding:contMarginComp,
124
+ borderRadius:contRradius+ 'rpx',
125
+ border:contBorder,
126
+ boxShadow:contShadow,
127
+ backgroundColor:contBgColor,
128
+ }"
129
+ >
130
+ <content-item
131
+ style="width: 100%;height: 100%"
132
+ :item="film"
133
+ :out-spacing="outSpacing"
134
+ :color="mainColor"
135
+ :type="type"
136
+ :border-radius="imgRradius"
137
+ @on-film-detail="handleFilmDetail"
138
+ @on-buy="handleBuy"
139
+ ></content-item>
140
+ </view>
141
+ </template>
142
+ </view>
143
+ <!--film hot|rightnow-->
144
+ <!--cinema-->
145
+ <view v-if="type === 'list'" class="list-filter" :style="{marginTop:outSpacing + 'rpx'}">
146
+ <view class="list-filter-block" :class="{hasFitler:!!curQueryTab}">
147
+ <view @click="handleFilterTab('filter')">
148
+ <xd-font-icon icon="iconrepository-xialaxuanxiangdown" size="24" color="#999"></xd-font-icon>
149
+ <text>{{areaName}}</text>
150
+ </view>
151
+ <view @click="handleFilterTab('sort')">
152
+ <xd-font-icon icon="iconshaixuanbiaoji_mian" size="28" color="#999"></xd-font-icon>
153
+ <text>{{sortName}}</text>
154
+ </view>
155
+ </view>
156
+ <view class="list-filter-modal" v-if="curQueryTab">
157
+ <xd-query-sort
158
+ key="sort"
159
+ :sort="sort"
160
+ v-if="sortUserList !== null && curQueryTab === 'sort'"
161
+ @onConfirm="handleQuerySort"
162
+ :list="sortUserList"
163
+ ></xd-query-sort>
164
+ <xd-query-filter
165
+ key="filter"
166
+ v-if="cinemaAreaList !== null && curQueryTab === 'filter'"
167
+ :list="cinemaAreaList"
168
+ @onConfirm="handleQueryFilter"
169
+ ></xd-query-filter>
170
+ </view>
171
+ </view>
172
+ <view
173
+ v-if="type === 'list'"
174
+ class="list-cont"
175
+ :style="{marginTop:outSpacing + 'rpx'}"
176
+ >
177
+ <view class="skeleton-wrap" v-if="dataList === null">
178
+ <view
179
+ class="skeleton-wrap-item list"
180
+ v-for="item in 8"
181
+ :key="item"
182
+ :style="{
183
+ marginBottom:outSpacing + 'rpx',
184
+ padding:contMarginComp,
185
+ borderRadius:contRradius+ 'rpx',
186
+ border:contBorder,
187
+ boxShadow:contShadow,
188
+ }"
189
+ >
190
+ <view class="title skeleton-item"></view>
191
+ <view class="address skeleton-item"></view>
192
+ <view class="bottom">
193
+ <view class="local skeleton-item"></view>
194
+ <view class="btn skeleton-item"></view>
195
+ </view>
196
+ </view>
197
+ </view>
198
+ <template v-if="dataList !== null">
199
+ <view
200
+ class="list-cont-item"
201
+ v-for="(film) in dataList"
202
+ :key="film.cinema_id"
203
+ :style="{
204
+ marginBottom:outSpacing + 'rpx',
205
+ padding:contMarginComp,
206
+ borderRadius:contRradius+ 'rpx',
207
+ border:contBorder,
208
+ boxShadow:contShadow,
209
+ backgroundColor:contBgColor,
210
+ height: 'auto'
211
+ }"
212
+ >
213
+ <content-cinema
214
+ style="width: 100%;height: 100%"
215
+ :item="film"
216
+ :out-spacing="outSpacing"
217
+ :color="{SEAT:mainColor,CODE:subMainColor,SELL:successColor}"
218
+ :type="type"
219
+ :border-radius="imgRradius"
220
+ @on-schedule="handleSchedule"
221
+ @on-cashier-detail="handleCashierDetail"
222
+ @on-code-detail="handleCodeDetail"
223
+ ></content-cinema>
224
+ </view>
225
+ <view
226
+ class="cont-mask"
227
+ v-if="curQueryTab"
228
+ @click="handleClose"
229
+ :style="{left:- outSpacing + 'rpx', right: - outSpacing + 'rpx', }"
230
+ ></view>
231
+ </template>
232
+ </view>
233
+ <!--cinema-->
234
+ <view class="hasNoData" v-if="dataList && dataList.length > 0 && pageToken === ''">已经到底没有更多数据了</view>
235
+ </view>
236
+ <template v-else>
237
+ <view
238
+ class="noConfig"
239
+ v-if="isPreview"
240
+ :style="{backgroundColor:backgroundColor, color:warningColor}"
241
+ >热映影片,即将上映未配置,此模块在线上不显</view>
242
+ </template>
18
243
  </view>
19
244
  </view>
20
245
  </template>
21
246
 
22
247
  <script>
23
248
  import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
249
+ import XdSwiperDot from "./XdSwiperDot.vue";
24
250
  import { jfbRootExec } from "@/utils/xd.event";
25
251
  import JfbMovieTfkFilmListMixin from "./JfbMovieTfkFilmListMixin";
26
252
  import { getContainerPropsValue } from "@/utils/xd.base";
253
+ import getServiceUrl from '@/common/getServiceUrl'
27
254
  import componentsMixins from "@/mixins/componentsMixins";
28
255
  import extsMixins from "@/mixins/extsMixins";
256
+ import ContentItem from './ContentItem.vue'
257
+ import ContentCinema from "./ContentCinema.vue";
258
+ import XdQuerySort from "./XdQuerySort.vue";
259
+ import XdQueryFilter from "./XdQueryFilter.vue";
260
+ import {mapState} from "vuex";
261
+ import Color from "color";
262
+
29
263
  export default {
30
264
  name: "JfbMovieTfkFilmList",
31
265
  components: {
32
- XdFontIcon
266
+ XdFontIcon,
267
+ ContentItem,
268
+ XdSwiperDot,
269
+ ContentCinema,
270
+ XdQuerySort,
271
+ XdQueryFilter
33
272
  },
34
273
  mixins: [
35
274
  componentsMixins, extsMixins, JfbMovieTfkFilmListMixin
36
275
  ],
37
276
  data() {
38
277
  return {
278
+ options: {},
279
+ //hideMask: true,
280
+ type:'', //hot rightnow
281
+ typeList:{hot:{label: '热映影片', value: 'hot'},list:{label: '影院列表', value: 'list'}, rightnow:{label: '即将上映', value: 'rightnow'}},
282
+ showTypeListData:null,
283
+ backgroundColor:'',
284
+ isPreview: false,
285
+ pageToken:'1',
286
+ pageSize: 20,
287
+ total: null,
288
+ isFirstLoadingData: false,
289
+ dataList:null,
290
+ cinemaOrgDataList:null,
291
+ cinemaAreaList:null,
292
+ sort_consume_mode:'',//获取影院数据排序
293
+ sortUserList:null,
294
+
295
+
296
+ //filter
297
+ showQueryModal:false,
298
+ curQueryTab:'',
299
+ sort:'',
300
+ sortName:'排序',
301
+ sortCode:'default',
302
+
303
+ //区域
304
+ areaCode:'all',
305
+ areaName:'区域筛选',
306
+
307
+ //广告
308
+ posterList:null,
309
+ poster:{},
310
+ posterNum:1,
311
+ mode:'round',
312
+ current: 0,
313
+ carouselTime: 5000,//轮播图轮播周期
314
+
315
+ //基础配置
316
+ outSpacing:'20',
317
+ showHot: '',
318
+ showRightnow:'',
319
+ showList:'Y',
320
+ showHotName:'',
321
+ showRightnowName: '',
322
+ showListName: '',
323
+ isList:'Y', //组件是否用户列表或者是否为首页(是否开启返回功能)
324
+ tabStyle:{},
325
+
326
+
327
+ //tab
328
+ tabBorder:'0',
329
+ tabActBorder:'0',
330
+ tabShadow:'0 0 0 rgba(0,0,0,0)',
331
+ tabActShadow:'0 0 0 rgba(0,0,0,0)',
332
+ tabRradius:'10',
333
+
334
+ //列表样式
335
+ contMargin:{},
336
+ contRradius:'20',
337
+ contBorder:'0',
338
+ contShadow:'0 0 10rpx rgba(0,0,0,.05)',
339
+ contBgColor:'#fff',
340
+ imgRradius:'10',
341
+
342
+ //链接
343
+ onlinePath:'',
344
+ codePath:'',
345
+ cashierPath:'',
346
+
347
+ buyPath:'',
348
+ fimeDetailPath:'',
349
+
39
350
 
40
- //todo
41
351
  }
352
+ },
353
+ computed:{
354
+ ...mapState({
355
+ stateCity: state => state.cityLocation.city,
356
+ stateLocation: (state) => state.cityLocation.location || {},
357
+ }),
358
+
359
+ dotStyleData(){
360
+ let alpha = 0.6;
361
+ let selectedColor = `rgba(${Color(this.mainColor).alpha(alpha).array().join(',')})`;
362
+ let style = {
363
+ dot: {
364
+ backgroundColor: 'rgba(166,166,166,.5)',
365
+ border: '0px rgba(166,166,166,.5) solid',
366
+ color: '#fff',
367
+ selectedBackgroundColor: selectedColor,
368
+ selectedBorder: `0px this.mainColor solid`
369
+ },
370
+ default: {
371
+ width: 16,
372
+ backgroundColor: 'rgba(200,200,200,.45)',
373
+ border: '1px rgba(200,200,200,.45) solid',
374
+ color: '#fff',
375
+ selectedBackgroundColor: selectedColor,
376
+ selectedBorder: `1px this.mainColor solid`
377
+ },
378
+ round: {
379
+ backgroundColor: 'rgba(166,166,166,.5)',
380
+ border: '0px rgba(166,166,166,.5) solid',
381
+ color: '#fff',
382
+ selectedBackgroundColor: selectedColor,
383
+ selectedBorder: `0px this.mainColor solid`
384
+ },
385
+ nav: {
386
+ backgroundColor: 'rgba(0,0,0,.5)',
387
+ border: '1px rgba(0,0,0,.5) solid',
388
+ color: '#fff',
389
+ selectedBackgroundColor: 'rgba(255, 255, 255, 1)',
390
+ selectedBorder: '1px rgba(255, 255, 255 1) solid'
391
+ },
392
+ indexes: {
393
+ backgroundColor: 'rgba(0,0,0,.5)',
394
+ border: '0px rgba(0,0,0,.5) solid',
395
+ color: '#aaa',
396
+ selectedBackgroundColor: 'rgba(0,0,0,.8)',
397
+ selectedBorder: '0px rgba(0,0,0,.8) solid',
398
+ selectedColor: '#fff',
399
+ }
400
+ }
401
+ return style[this.mode]
402
+ },
403
+ contMarginComp(){
404
+ let str = `${this.checkValue(this.contMargin.top, 20)}rpx`;
405
+ str = `${str} ${this.checkValue(this.contMargin.right, 20)}rpx`;
406
+ str = `${str} ${this.checkValue(this.contMargin.bottom, 20)}rpx`;
407
+ str = `${str} ${this.checkValue(this.contMargin.left, 20)}rpx`;
408
+ return str
409
+ },
410
+
411
+ posterSize(){
412
+ if(this.poster && this.poster.size) {
413
+ let {width, height} = this.poster.size
414
+ let size = {}
415
+ if(width) size['width'] = width || 710;
416
+ if(height) size['height'] = height || 280;
417
+ return size;
418
+ }
419
+ return {
420
+ width: 710,
421
+ height: 280,
422
+ }
423
+ },
424
+
425
+
42
426
  },
43
427
  watch: {
44
428
  container(value, oldValue) {
45
429
  if (JSON.stringify(value) === JSON.stringify(oldValue)) return;
46
430
  if (this.$configProject['isPreview']) this.init(value)
47
431
  },
432
+
433
+ posterNum(){
434
+ if (this.$configProject['isPreview']){
435
+ this.onJfbLoad();
436
+ }
437
+ },
438
+ stateCity(n, o){
439
+ if(n && JSON.stringify(n) !== JSON.stringify(o)){
440
+ this.clearDataVar()
441
+ this.getList();
442
+ }
443
+ },
444
+ showTypeListData(){
445
+ if(this.type === '') return;
446
+ this.clearDataVar();
447
+ this.getList();
448
+ },
48
449
  },
49
450
  created() {
451
+ this.isPreview = this.$configProject.isPreview;
452
+ this.backgroundColor = Color(this.warningColor).alpha(0.2).toString();
50
453
  this.init(this.container);
51
-
52
- //todo
53
454
  },
54
455
  methods: {
55
- onJfbLoad(options) {
456
+ clearDataVar(){
457
+ this.dataList = null;
458
+ this.pageToken = '1';
459
+ this.areaCode = 'all'
460
+ this.areaName ='区域筛选';
461
+ this.sortName = '排序'
462
+ this.sortCode = 'default'
463
+ this.cinemaOrgDataList = null;
464
+ },
465
+ getSortList(){
466
+ jfbRootExec('getTFKSortList', {
467
+ vm: this,
468
+ data:{}
469
+ }).then(res => {
470
+ this.sortUserList = res['cinema_customer_sort'];
471
+ debugger
472
+ }).catch(err=>{
473
+ console.error(err);
474
+ })
475
+
476
+ },
477
+
478
+ //影片列表
479
+ handleFilmDetail(film_id){
480
+ console.warn(`toFilmInfo(影片详情).${film_id}`)
481
+ if(!this.fimeDetailPath) {
482
+ console.error('未配置链接');
483
+ return;
484
+ }
485
+ if( this.isPreview) return;
486
+ this.$xdUniHelper.navigateTo({
487
+ url: this.fimeDetailPath + `?film_id=${film_id}`
488
+ })
489
+ },
490
+ handleBuy(film_id){
491
+ console.warn(`toBuyChooseCinema(选择影院).${film_id}`)
492
+ if(!this.buyPath) {
493
+ console.error('未配置链接');
494
+ return;
495
+ }
496
+ if( this.isPreview) return;
497
+ this.$xdUniHelper.navigateTo({
498
+ url: this.buyPath + `?film_id=${film_id}`
499
+ })
500
+ },
501
+ //影片列表
502
+
503
+ //影院列表
504
+ handleSchedule(item){
505
+ console.warn(`handleSchedule(选择排期).${item.cinema_id}`)
506
+ if(!this.onlinePath) {
507
+ console.error('未配置链接');
508
+ return;
509
+ }
510
+ if( this.isPreview) return;
511
+ this.$xdUniHelper.navigateTo({
512
+ url: this.onlinePath + `?cinema_id=${item.cinema_id}`,
513
+ });
514
+ },
515
+ handleCodeDetail(item){
516
+ console.warn(`handleCodeDetail(选择电子码列表).${item.cinema_id}`)
517
+ if(!this.codePath) {
518
+ console.error('未配置链接');
519
+ return;
520
+ }
521
+ if( this.isPreview) return;
522
+ this.$xdUniHelper.navigateTo({
523
+ url: this.codePath + `?cinema_id=${item.cinema_id}`,
524
+ });
525
+ },
526
+ handleCashierDetail(item){
527
+ //todo
528
+ },
529
+
530
+ handleFilterTab(tab){
531
+ if(tab === this.curQueryTab ) {
532
+ this.curQueryTab = ''
533
+ }
534
+ else this.curQueryTab = tab
535
+ },
536
+
537
+ handleQuerySort(sortData){
538
+ this.sortCode = sortData.value;
539
+ this.sortName = sortData.label;
540
+ this.pageToken = '1';
541
+ this.dataList = null;
542
+ this.cinemaOrgDataList = null;
543
+ this.getList();
544
+
545
+ //等待排序规则
546
+ setTimeout(()=>{
547
+ this.curQueryTab = '';
548
+ },200)
549
+
550
+ },
551
+
552
+ handleQueryFilter(sortData){
553
+ this.areaCode = sortData.area_code;
554
+ this.areaName = sortData.area_name;
555
+ this.pageToken = '1';
556
+ this.dataList = null;
557
+ this.getList();
558
+ setTimeout(()=>{
559
+ this.curQueryTab = '';
560
+ },200)
561
+
562
+ },
563
+ handleClose(){
564
+ this.curQueryTab = '';
565
+ },
566
+ //影院列表
567
+
568
+
569
+
570
+ handleClick(){
571
+ //todo
572
+ },
573
+
574
+ handleAnimationfinish(e){
575
+ this.current = e.detail.current;
576
+ },
577
+
578
+ getCinemaOrgData(){
579
+ let fitlerData = this.$xdUniHelper.cloneDeep(this.cinemaOrgDataList||[])
580
+
581
+ //非全域处理
582
+ if(this.areaCode !== 'all') {
583
+ fitlerData = fitlerData.filter(item=>{
584
+ return item.area_code === this.areaCode;
585
+ });
586
+ }
587
+
588
+ //添加测试数据
589
+ // "NODE_ENV": "development",
590
+ // #ifdef H5
591
+ if(window.location.href.indexOf('filter=1') !== -1
592
+ || this.$configProject.NODE_ENV === 'development'
593
+ ) {
594
+ fitlerData = fitlerData.map((item,index)=>{
595
+ return {
596
+ ...item,
597
+ cinema_name: `${item.cinema_name}-${index+1}`,
598
+ }
599
+ });
600
+ }
601
+ //#endif
602
+
603
+ console.log(`fitlerData:`,fitlerData)
604
+ console.warn(`fitlerData.length=${fitlerData.length}`)
605
+
606
+ //过滤之后不够分页直接返回值
607
+ if(fitlerData.length <= this.pageSize) {
608
+ this.dataList = this.$xdUniHelper.cloneDeep(fitlerData);
609
+ this.pageToken = ''
610
+ return;
611
+ }
612
+
613
+ let list = this.$xdUniHelper.getLocalPaginationData(
614
+ fitlerData, this.pageToken, this.pageSize
615
+ );
616
+
617
+ //分页完成的数据为0
618
+ if(list.length === 0) {
619
+ this.pageToken = ''
620
+ return;
621
+ }
622
+
623
+ this.dataList = (this.dataList||[]).concat(this.$xdUniHelper.cloneDeep(list));
624
+ if(this.pageSize < list.length) this.pageToken = '';
625
+ else this.pageToken = (Number(this.pageToken)+1) + '';
626
+ },
56
627
 
57
- // jfbRootExec('baiduUserLogin', {
628
+ handleTab(value){
629
+ if(value === this.type) return;
630
+ this.type = value;
631
+ this.dataList = null;
632
+ this.pageToken = '1';
633
+ this.getList();
634
+ },
635
+
636
+ getList(){
637
+ let fName = 'getTFKListFilmHotList';
638
+ if(this.type === 'rightnow') fName = 'getTFKListFilmRightnowList';
639
+ if(this.type === 'list') fName = 'getTFKCinemaList';
640
+
641
+ if(this.isFirstLoadingData) this.$xdShowLoading({});
642
+ if(!this.isFirstLoadingData){
643
+ this.isFirstLoadingData = true;
644
+ }
645
+
646
+ let params = {
647
+ city_code: this.stateCity.city_code,
648
+ type: this.type,
649
+ page_token: this.pageToken,
650
+ page_size: this.pageSize
651
+ }
652
+
653
+ //影院参数
654
+ if(this.type === 'list') {
655
+ //有数据直接进行数据分页
656
+ if(this.cinemaOrgDataList !== null) {
657
+ this.getCinemaOrgData();
658
+ this.$xdHideLoading({});
659
+ return
660
+ }
661
+
662
+ params = {
663
+ city_code: this.stateCity.city_code,
664
+ latitude: this.stateLocation.latitude,
665
+ longitude: this.stateLocation.longitude,
666
+ sort_consume_mode: this.sort_consume_mode || '',
667
+ sort_custom:this.sortCode
668
+ }
669
+ }
670
+
671
+
672
+
673
+ jfbRootExec(fName, {
674
+ vm: this,
675
+ data:params
676
+ }).then(res => {
677
+ if(this.isFirstLoadingData) this.$xdHideLoading({});
678
+
679
+ //影片列表处理
680
+ if(this.type === 'rightnow' || this.type==='hot'){
681
+ this.dataList = (this.dataList||[]).concat(res['list']);
682
+ this.pageToken = res.next_page_token;
683
+ return;
684
+ }
685
+
686
+ //影院列表处理
687
+ if(this.type === 'list') {
688
+ //res['list'].splice(0, 31);
689
+ this.cinemaOrgDataList = res['list'];
690
+ this.cinemaAreaList = [{area_code:'all', area_name:'全城'}].concat(res['area_list']);
691
+
692
+
693
+ //小于数量页面显示记录
694
+ if(res['list'].length <= this.pageSize) {
695
+ this.dataList = res['list'];
696
+ this.pageToken = '';
697
+ return
698
+ }
699
+
700
+ //正常处理
701
+ this.getCinemaOrgData();
702
+ }
703
+
704
+ }).catch(e=>{
705
+ console.error(e);
706
+ this.$xdHideLoading({});
707
+ })
708
+ },
58
709
 
59
- // vm: this,// data: {
710
+ onJfbLoad(options) {
711
+ this.options = options;
60
712
 
61
- // account: 'gaoshiyong',// password: '123456789',// type: 3,// ...options
713
+ jfbRootExec('getTFKPosterContent', {
714
+ vm: this,
715
+ data: {
716
+ page_id: this.pageAttr['page_id'], //页面ID
717
+ container_id: this.containerId, //组件ID
718
+ page_size: this.posterNum //可以不传
719
+ },
720
+ })
721
+ .then(res => {
722
+ this.posterList = res.list.map((item,index) => {
723
+ return {
724
+ ...item,
725
+ image_background_url: item.image_background_url?getServiceUrl(item.image_background_url):'',
726
+ image_url: item.image_url?getServiceUrl(item.image_url):''
727
+ }
728
+ });
729
+ })
730
+ .catch(err=>{
731
+ console.error(err);
732
+ })
62
733
 
63
- // }
734
+ this.getSortList();
64
735
 
65
- // }).then().catch()
66
736
  },
737
+
67
738
  /**
68
739
  * @description 监听事件变化
69
740
  * @param container {object} 业务组件对象自己
70
741
  */
71
742
  init(container) {
743
+ this.outSpacing = getContainerPropsValue(container, 'content.outSpacing', '20');
744
+ this.tabStyle = Object.assign({},{
745
+ color:'#333',
746
+ bgColor: '#fff',
747
+ fontSize: '26rpx',
748
+ fontWeight: 'normal',
749
+ actBgColor: this.mainColor,
750
+ actColor: '#fff',
751
+ actFontSize: '26rpx',
752
+ actFontWeight: 'normal',
753
+ },getContainerPropsValue(container, 'content.tabStyle', {}));
754
+ this.tabShadow = this.getXdShadow({width:20, color:'rgba(0,0,0,0.05)'},getContainerPropsValue(container, 'content.tabShadow', {}))
755
+ this.tabActShadow = this.getXdShadow( {width:20, color:this.mainColor},getContainerPropsValue(container, 'content.tabActShadow', {}))
756
+ this.tabBorder = this.getXdBorder({width:2,color:'rgba(0,0,0,0)'},getContainerPropsValue(container, 'content.tabBorder', {}));
757
+ this.tabActBorder = this.getXdBorder({width:2,color:'rgba(0,0,0,0)'},getContainerPropsValue(container, 'content.tabActBorder', {}));
758
+ this.tabRradius = getContainerPropsValue(container, 'content.tabRradius', '10');
759
+
760
+ //内容
761
+ this.contMargin = getContainerPropsValue(container, 'content.contMargin', {});
762
+ this.contRradius = getContainerPropsValue(container, 'content.contRradius', '10');
763
+ this.contShadow = this.getXdShadow({width:20, color:'rgba(0,0,0,0)'},getContainerPropsValue(container, 'content.contShadow', {}))
764
+ this.contBorder = this.getXdBorder({width:2,color:'rgba(0,0,0,0)'},getContainerPropsValue(container, 'content.contBorder', {}));
765
+ this.contBgColor = getContainerPropsValue(container, 'content.contBgColor', '#fff');
766
+ this.imgRradius = getContainerPropsValue(container, 'content.imgRradius', '10');
767
+
768
+ //控制标签显示
769
+ this.showHot = getContainerPropsValue(container, 'content.showHot','Y');
770
+ this.showRightnow = getContainerPropsValue(container, 'content.showRightnow','Y');
771
+ this.showList = getContainerPropsValue(container, 'content.showList','Y');
772
+ this.showHotName = getContainerPropsValue(container, 'content.showHotName', '');
773
+ this.showRightnowName = getContainerPropsValue(container, 'content.showRightnowName', '');
774
+ this.showListName = getContainerPropsValue(container, 'content.showListName', '');
72
775
 
73
- //this.bgcolor = getContainerPropsValue(container, 'content.bgcolor', '#fff');
74
776
 
75
- //this.height = getContainerPropsValue(container, 'content.height', 10);
777
+ this.poster = getContainerPropsValue(container, 'content.poster',{});
778
+ this.posterNum = getContainerPropsValue(container, 'content.posterNum',1);
779
+ this.sort_consume_mode = getContainerPropsValue(container, 'content.sort_consume_mode', '');
780
+ this.isList = getContainerPropsValue(container, 'content.isList', 'N');
781
+
782
+ //链接(影院)
783
+ this.onlinePath = getContainerPropsValue(container, 'content.onlinePath', {value:''}).value;
784
+
785
+ //链接(影片)
786
+ this.buyPath = getContainerPropsValue(container, 'content.buyPath', {value: ""}).value;
787
+ this.fimeDetailPath = getContainerPropsValue(container, 'content.fimeDetailPath', {value: ""}).value;
788
+
789
+ //初始化数据
790
+ this.setShowTypeList();
76
791
  },
77
- onJfbScroll(options) {
78
- console.log('event.onJfbScroll', options)
792
+
793
+ setShowTypeList(){
794
+ let list = [];
795
+ if(this.showHot === 'Y') list.push(this.typeList["hot"]);
796
+ if(this.showList === 'Y') list.push(this.typeList["list"]);
797
+ if(this.showRightnow === 'Y') list.push(this.typeList["rightnow"]);
798
+ list = this.$xdUniHelper.cloneDeep(list).map(item=>{
799
+ if(item.value === 'hot') item.label = this.showHotName ||item.label
800
+ if(item.value === 'list') item.label = this.showListName || item.label;
801
+ if(item.value === 'rightnow') item.label = this.showRightnowName || item.label;
802
+ return item
803
+ })
804
+
805
+ //已有选中值不设置默认值
806
+ if(this.type === '' && list.length > 0) {
807
+ this.type = list[0].value;
808
+ }
809
+ this.showTypeListData = list;
79
810
  },
811
+
80
812
  onJfbReachBottom(options) {
81
- console.log('event.onJfbReachBottom', options)
82
- },
83
- onJfbShow(options) {
84
- console.log('event.onJfbShow', options)
85
- },
86
- onJfbHide(options) {
87
- console.log('event.onJfbHide', options)
813
+ if(!this.pageToken) return false;
814
+ this.getList();
88
815
  },
816
+
89
817
  onJfbBack(options) {
90
- console.log('event.onJfbBack', options)
91
- },
92
- onJfbUpdate(...data) {
93
- console.log('event.onJfbUpdate', data)
818
+ if(this.isList === 'Y') {
819
+ this.$xdUniHelper.navigateBack();
820
+ }
94
821
  },
95
- onJfbCustomEvent(options) {
96
- console.log('event.onJfbReachBottom', options)
822
+ //重新回去广告位置工
823
+ onJfbUpdate() {
824
+ this.onJfbLoad(this.options)
97
825
  },
826
+
98
827
  }
99
828
  }
100
829
 
@@ -105,7 +834,201 @@
105
834
 
106
835
  .jfb-movie-tfk-film-list {
107
836
  &__body{
837
+ .tfk-list {
838
+ & >view:first-child {
839
+ margin-top: 0 !important;
840
+ }
841
+ }
842
+
843
+ .list-tab {
844
+ display: flex;
845
+ justify-content: space-between;
846
+ align-items: center;
847
+
848
+ & > view {
849
+ flex: 1;
850
+ height: 80rpx;
851
+ line-height: 80rpx;
852
+ text-align: center;
853
+ font-size: 28rpx;
854
+
855
+ &:last-child {
856
+ margin-right: 0!important;
857
+ }
858
+ }
859
+ }
860
+
861
+ .list-cont {
862
+ position: relative;
863
+ z-index: 2;
864
+ .skeleton-wrap {
865
+ .skeleton-wrap-item {
866
+ height: 240rpx;
867
+ padding: 20rpx;
868
+ background: #fff;
869
+ display: flex;
870
+ justify-content: space-between;
871
+ align-items: center;
872
+
873
+ //影片列表骨架
874
+ &-image {
875
+ .skeleton-item(160rpx, 240rpx);
876
+ flex-shrink: 0;
877
+ margin-right: 20rpx;
878
+ }
879
+
880
+ &-title {
881
+ flex: 1;
882
+
883
+ .title {
884
+ .skeleton-item(100%, 50rpx);
885
+ margin-bottom: 20rpx;
886
+ }
887
+
888
+ .director,.star,.type {
889
+ .skeleton-item(100%, 40rpx);
890
+ margin-bottom: 10rpx;
891
+ }
892
+ }
893
+
894
+ &-btn {
895
+ display: flex;
896
+ align-content: space-between;
897
+ align-items: flex-end;
898
+ justify-content: flex-end;
899
+ flex-flow: wrap;
900
+ height: 100%;
901
+ box-sizing: border-box;
902
+ padding: 10rpx 0;
903
+ width: 130rpx;
904
+ flex-shrink: 0;
905
+
906
+ & > .score {
907
+ .skeleton-item(100rpx, 40rpx);
908
+ }
909
+ & > .btn {
910
+ .skeleton-item(130rpx, 60rpx);
911
+ }
912
+ }
913
+
914
+ &:last-child {
915
+ margin-bottom: 0!important;
916
+ }
917
+
918
+ //影院列表骨架
919
+ &.list {
920
+ display: block;
921
+ }
922
+ & > .title {
923
+ .skeleton-item(100%, 60rpx);
924
+ margin-bottom: 20rpx;
925
+ }
926
+ & > .address {
927
+ .skeleton-item(100%, 40rpx);
928
+ margin-bottom: 20rpx;
929
+ }
930
+ & > .bottom {
931
+ display: flex;
932
+ justify-content: space-between;
933
+ align-items: center;
934
+ padding-top: 30rpx;
935
+
936
+ & > .local {
937
+ .skeleton-item(120rpx, 30rpx);
938
+ }
939
+ & > .btn {
940
+ .skeleton-item(150rpx, 70rpx);
941
+ }
942
+ }
943
+ }
944
+
945
+
946
+ }
947
+
948
+ &-item {
949
+ height: 240rpx;
950
+
951
+ &:last-child {
952
+ margin-bottom: 0!important;
953
+ }
954
+ }
955
+
956
+ .cont-mask {
957
+ position: absolute;
958
+ top: 0;
959
+ bottom: 0;
960
+ z-index: 1;
961
+ background-color: rgba(0, 0, 0, .2);
962
+ }
963
+ }
964
+
965
+ .list-poster {
966
+ &-one {
967
+ display: flex;
968
+ justify-content: center;
969
+ align-items: center;
970
+
971
+ & > image {
972
+ height: 100%;
973
+ width: 100%;
974
+ }
975
+ }
976
+ }
977
+
978
+ .list-filter {
979
+ position: relative;
980
+ z-index: 3;
981
+ .hasFitler {
982
+ box-shadow: 0 -5rpx 20rpx 0 rgba(0,0,0, .1);
983
+ border-radius: 20rpx 20rpx 0 0;
984
+ }
985
+
986
+ &-block {
987
+ display: flex;
988
+ justify-content: space-between;
989
+ align-items: center;
990
+ height: 100rpx;
991
+ background: #fff;
992
+ font-size: 28rpx;
993
+
994
+ & > view {
995
+ flex: 1;
996
+ text-align: center;
997
+ cursor: pointer;
998
+ color:#999;
999
+ display: flex;
1000
+ justify-content: center;
1001
+ align-items: center;
1002
+
1003
+ & > text {
1004
+ margin-left: 10rpx;
1005
+ }
1006
+ }
1007
+ }
1008
+
1009
+ &-modal {
1010
+ position: relative;
1011
+ height: 1px;
1012
+ width: 100%;
1013
+ z-index: 3;
1014
+ }
1015
+ }
1016
+ }
1017
+
1018
+ .noConfig {
1019
+ line-height: 100rpx;
1020
+ text-align: center;
1021
+ font-size: 26rpx;
1022
+ }
108
1023
 
1024
+ .hasNoData {
1025
+ height: 80rpx;
1026
+ line-height: 80rpx;
1027
+ font-size: 24rpx;
1028
+ text-align: center;
1029
+ color: #ccc;
1030
+ background-color: rgba(255, 255, 255, .05);
1031
+ margin: 20rpx 0
109
1032
  }
110
1033
  }
111
1034
  </style>