jufubao-movie 1.0.38 → 1.0.39-beta2

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