jufubao-base 1.0.205-beta1 → 1.0.206-beta1

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.
@@ -3,81 +3,81 @@
3
3
  <view
4
4
  class="sreen__box notCarousel"
5
5
  :class="{
6
- cell4: config['column'] === 4,
7
- cell5: config['column'] === 5,
6
+ cell4: config.cells === 4,
7
+ cell5: config.cells === 5,
8
8
  }"
9
- v-if="config['isCarousel'] === false"
10
- :style="[notCarouselComp,{'--title-height':titleHeight}]"
11
- >
9
+ v-if="config.isCarousel === false"
10
+ :style="{
11
+ height: (getHeight) + 'px'
12
+ }">
12
13
  <view
13
14
  v-for="item in list"
14
15
  :key="item['content_id']"
15
16
  @click="handleClick(item)"
16
- :style="[config['iconItemStyleComp']]"
17
+ :style="{
18
+ height: (height + rpxText) + 'px'
19
+ }"
17
20
  >
18
- <view :style="[config['iconItemBoxStyleComp']]">
19
- <view :style="[config['iconStyleComp']]" class="image">
20
- <image :src="item.image_url"></image>
21
+ <view :style="{ height: height + 'px', width:width, padding: config.iconPadding}">
22
+ <view :style="{
23
+ borderRadius: config.radius + 'rpx',
24
+ boxShadow: config.shadow === 1? `0 0 8rpx ${config.shadowColor}` : '',
25
+ }">
26
+ <image :src="item.image_url" style=""></image>
21
27
  </view>
22
28
  </view>
23
- <view
24
- class="content_name"
25
- v-if="item['content_name']"
26
- :style="[config['titleStyle']]"
27
- >{{item['content_name']}}</view>
29
+ <view v-if="item['content_name']" :style="{color: config.textColor}">{{item['content_name']}}</view>
28
30
  </view>
29
31
  </view>
30
- <view class="sreen__box carousel" v-if="config['isCarousel'] === true">
32
+ <view class="sreen__box carousel" v-if="config.isCarousel === true">
31
33
  <xd-swiper-dot
32
34
  :current="current"
33
35
  :info="list"
34
36
  field="content_name"
35
- :mode="config['mode']"
36
- :dots-styles="config['dotStyleData']"
37
- :style="{height: (getContHeight + getIndexHeigth) + 'px', width:'100%'}"
37
+ :mode="config.mode"
38
+ :dots-styles="config.dotStyleData"
39
+ :style="{height: (getHeight) + 'px', width:'100%'}"
38
40
  >
39
41
  <!--#ifdef MP-WEIXIN-->
40
42
  <swiper
41
- v-if="0"
42
43
  class="swiper xd-swiper-content"
43
- :style="{width: '100%', height: getContHeight + 'px'}"
44
+ :style="{width: '100%', height: getHeight + 'px'}"
44
45
  :indicator-dots="false"
45
- :autoplay="config['carouselTime'] > 0"
46
- :interval="config['carouselTime'] "
46
+ :autoplay="config.carouselTime > 0"
47
+ :interval="config.carouselTime"
47
48
  :duration="500"
48
49
  :current="current"
49
50
  circular
50
- @change="handleAnimationfinish"
51
+ @animationfinish="handleAnimationfinish"
51
52
  >
52
53
  <swiper-item
53
54
  v-for="(item,index) in list"
54
55
  :key="index"
55
- :style="{width: '100%', height: getContHeight + 'px'}"
56
+ :style="{width: '100%', height: getHeight + 'px'}"
56
57
  >
57
58
  <view
58
59
  class="sreen__box-list"
59
60
  :class="{
60
- cell4: config['column'] === 4,
61
- cell5: config['column'] === 5,
61
+ cell4: config.cells === 4,
62
+ cell5: config.cells === 5,
62
63
  }"
63
- :style="[{height: getContHeight + 'px'},{'--title-height':titleHeight}]"
64
+ :style="{ height: getHeight + 'px'}"
64
65
  >
65
66
  <view
66
67
  v-for="it in item"
67
68
  :key="it['content_id']"
68
- :style="[config['iconItemStyleComp']]"
69
+ :style="{height: boxHeight + 'px'}"
69
70
  @click="handleClick(it)"
70
71
  >
71
- <view :style="[config['iconItemBoxStyleComp']]">
72
- <view :style="[config['iconStyleComp']]" class="image">
72
+ <view :style="{ height: height + 'px', padding: config.iconPadding}">
73
+ <view :style="{
74
+ borderRadius: config.radius + 'rpx',
75
+ boxShadow: config.shadow === 1? `0 0 10rpx rgba(0, 0, 0, .5)` : '',
76
+ }">
73
77
  <image :src="it.image_url"></image>
74
78
  </view>
75
79
  </view>
76
- <view
77
- class="content_name"
78
- v-if="it['content_name']"
79
- :style="[config['titleStyle']]"
80
- >{{it['content_name']}}</view>
80
+ <view v-if="it['content_name']" :style="{color: config.textColor}">{{it['content_name']}}</view>
81
81
  </view>
82
82
  </view>
83
83
  </swiper-item>
@@ -85,41 +85,43 @@
85
85
  <!--#endif-->
86
86
  <!--#ifdef H5-->
87
87
  <xd-swiper
88
- :key="h5key"
89
88
  :indicator-dots="false"
90
- :interval="config['carouselTime']"
89
+ :interval="config.carouselTime"
91
90
  :list="list"
92
91
  :current="current"
93
92
  width="100%"
94
- :height="getContHeight + 'px'"
93
+ :height="getHeight + 'px'"
95
94
  @onClickItem="handleClick"
96
- @change="handleAnimationfinish"
95
+ @animationfinish="handleAnimationfinish"
97
96
  >
98
97
  <template slot-scope="{ item, index}">
99
98
  <view
100
99
  class="sreen__box-list"
101
100
  :class="{
102
- cell4: config['column'] === 4,
103
- cell5: config['column'] === 5,
101
+ cell4: config.cells === 4,
102
+ cell5: config.cells === 5,
103
+ }"
104
+ :style="{
105
+ height: getHeight + 'px'
104
106
  }"
105
- :style="[{height: getContHeight + 'px'},{'--title-height':titleHeight}]"
106
107
  >
107
108
  <view
108
109
  v-for="it in item"
109
110
  :key="it['content_id']"
110
- :style="[config['iconItemStyleComp']]"
111
+ :style="{
112
+ height: boxHeight + 'px'
113
+ }"
111
114
  @click="handleClick(it)"
112
115
  >
113
- <view :style="[config['iconItemBoxStyleComp']]">
114
- <view :style="[config['iconStyleComp']]" class="image">
116
+ <view :style="{ height: height + 'px', padding: config.iconPadding}">
117
+ <view :style="{
118
+ borderRadius: config.radius + 'rpx',
119
+ boxShadow: config.shadow === 1? `0 0 10rpx rgba(0, 0, 0, .5)` : '',
120
+ }">
115
121
  <image :src="it.image_url"></image>
116
122
  </view>
117
123
  </view>
118
- <view
119
- class="content_name"
120
- v-if="it['content_name']"
121
- :style="[config['titleStyle']]"
122
- >{{it['content_name']}}</view>
124
+ <view v-if="it['content_name']" :style="{color: config.textColor}">{{it['content_name']}}</view>
123
125
  </view>
124
126
  </view>
125
127
  </template>
@@ -155,37 +157,36 @@
155
157
  timer: null,
156
158
  width: 0,
157
159
  height: 0,
158
- indexHeigth: 48,
160
+ text: 40,
159
161
  padding: 0,
160
162
  status: false,
161
163
  list: [],
162
164
  filterContentList:[],
163
165
  isPreview: false,
164
166
  current: 0,
165
- h5key: 'h5key'
166
167
  }
167
168
  },
168
169
  computed:{
169
- titleHeight(){
170
- return parseInt(this.config.titleStyle.lineHeight)+'rpx'
171
- },
172
- notCarouselComp(){
173
- return {
174
- height: this.height * this.config.row + 'px'
170
+ getHeight() {
171
+ let len = this.filterContentList.length
172
+
173
+ //数量小于等于2,3行
174
+ if(len <= this.config.cells) {
175
+ return this.height + this.rpxText
175
176
  }
176
- },
177
- getIndexHeigth(){
178
- if(['indexes', 'nav'].includes(this.config['mode'])) return 60 * this.$rpxNum
179
- return (this.config['mode'] === 'normal'?0:48) * this.$rpxNum;
180
- },
181
- getContHeight() {
182
- let realRow = Math.min(Math.ceil(this.filterContentList.length/this.config.column),this.config['row']);
183
- //数量小于等于1,2行
184
- if(realRow < 3) {
185
- return this.height * realRow;
177
+
178
+ //三行小于等于两个数量
179
+ if(this.config.jdRows === 3) {
180
+ if(len <= this.config.cells * 2) {
181
+ return this.height * 2 + this.rpxText * 2
182
+ }
186
183
  }
187
- return this.height * this.config['row'];
184
+
185
+ return this.height * this.config.jdRows + this.rpxText * this.config.jdRows;
188
186
  },
187
+ rpxText(){
188
+ return this.$rpxNum * this.text
189
+ },
189
190
  boxHeight(){
190
191
  return this.height + this.$rpxNum * this.text;
191
192
  }
@@ -279,27 +280,25 @@
279
280
  //静态图显示
280
281
  if(this.config.isCarousel === false) {
281
282
  this.list = content.filter((item,index)=>{
282
- return index < (this.config['column'] * this.config['row']);
283
+ return index < (this.config.cells * this.config.jdRows);
283
284
  })
284
285
  }
285
286
  //轮播图显示
286
287
  else {
287
- let num = this.config['column'] * this.config['row'];
288
+ let num = this.config.cells * this.config.jdRows;
288
289
  let maxPage = Math.ceil(content.length / num);
289
290
  let arr = [];
290
291
  for(let i =1 ; i <= maxPage; i++) {
291
292
  arr.push(this.$xdUniHelper.getLocalPaginationData(content, i, num))
292
293
  }
293
294
  this.list = arr;
294
- this.h5key = Date.now()
295
295
  }
296
296
 
297
- }, 500)
297
+
298
+ }, 100)
298
299
  },
299
300
 
300
301
  handleClick(item) {
301
- if(this.config.isPreview) return;
302
-
303
302
  if(!item.redirect_data) {
304
303
  console.warn(`未配置链接地址: ${item.redirect_data}`);
305
304
  console.error(`未配置链接地址: ${item.redirect_data}`);
@@ -367,26 +366,6 @@
367
366
  height: 100%;
368
367
  position: relative;
369
368
 
370
- & .image {
371
- width: 100%;
372
- height: 100%;
373
- overflow: hidden;
374
- & > image {
375
- width: 100%;
376
- height: 100%;
377
- }
378
- }
379
-
380
- .content_name {
381
- text-align: center;
382
- max-height: var(--title-height);
383
- overflow: hidden;
384
- text-overflow: ellipsis;
385
- display: -webkit-box;
386
- -webkit-line-clamp: 1;
387
- -webkit-box-orient: vertical;
388
- }
389
-
390
369
  & .carousel-mask {
391
370
  position: absolute;
392
371
  left: 0;
@@ -407,17 +386,88 @@
407
386
  flex-wrap: wrap;
408
387
  overflow: hidden;
409
388
 
389
+ //行
390
+ &.cell4 {
391
+ //图片+文字外框
392
+ & > view {
393
+ width: calc(100% / 4);
394
+ flex-shrink: 0;
395
+
396
+ //图片
397
+ & > view:first-child {
398
+ overflow: hidden;
399
+ display: flex;
400
+ justify-content: center;
401
+ align-items: center;
402
+ box-sizing: border-box;
403
+
404
+ & > view {
405
+ width: 100%;
406
+ height: 100%;
407
+ overflow: hidden;
408
+ display: flex;
409
+ justify-content: center;
410
+ align-items: center;
411
+ & > image {
412
+ width: 100%;
413
+ height: 100%;
414
+ }
415
+ }
416
+ }
410
417
 
411
- &.cell4 {
412
- & > view:nth-child(4n) {
413
- margin-right: 0!important;
414
- }
415
- }
416
- &.cell5 {
417
- & > view:nth-child(5n) {
418
- margin-right: 0!important;
419
- }
420
- }
418
+ & > view:last-child {
419
+ text-align: center;
420
+ line-height: unit(36, rpx);
421
+ width: 90%;
422
+ margin: 0 5%;
423
+ overflow: hidden;
424
+ font-size: unit(24, rpx);
425
+ .uni-max-cut(1, 36);
426
+
427
+ }
428
+ }
429
+ }
430
+
431
+ &.cell5 {
432
+ & > view {
433
+ width: calc(100% / 5);
434
+ flex-shrink: 0;
435
+
436
+ //图片
437
+ & > view:first-child {
438
+ overflow: hidden;
439
+ display: flex;
440
+ justify-content: center;
441
+ align-items: center;
442
+ width: 100%;
443
+ box-sizing: border-box;
444
+
445
+ & > view {
446
+ width: 100%;
447
+ height: 100%;
448
+ overflow: hidden;
449
+ display: flex;
450
+ justify-content: center;
451
+ align-items: center;
452
+
453
+ & > image {
454
+ width: 100%;
455
+ height: 100%;
456
+ }
457
+ }
458
+ }
459
+
460
+ & > view:last-child {
461
+ text-align: center;
462
+ line-height: unit(36, rpx);
463
+ width: 90%;
464
+ margin: 0 5%;
465
+ overflow: hidden;
466
+ font-size: unit(24, rpx);
467
+ .uni-max-cut(1, 36);
468
+ }
469
+ }
470
+ }
421
471
  }
422
472
 
423
473
  &__box.carousel {
@@ -440,16 +490,84 @@
440
490
  flex-wrap: wrap;
441
491
  overflow: hidden;
442
492
 
443
- &.cell4 {
444
- & > view:nth-child(4n) {
445
- margin-right: 0!important;
446
- }
447
- }
448
- &.cell5 {
449
- & > view:nth-child(5n) {
450
- margin-right: 0!important;
451
- }
452
- }
493
+ //行
494
+ &.cell4 {
495
+ //图片+文字外框
496
+ & > view {
497
+ width: calc(100% / 4);
498
+ flex-shrink: 0;
499
+
500
+ //图片
501
+ & > view:first-child {
502
+ overflow: hidden;
503
+ display: flex;
504
+ justify-content: center;
505
+ align-items: center;
506
+ width: 100%;
507
+ box-sizing: border-box;
508
+
509
+ & > view {
510
+ width: 100%;
511
+ height: 100%;
512
+ display: flex;
513
+ justify-content: center;
514
+ align-items: center;
515
+ overflow: hidden;
516
+
517
+ & > image {
518
+ width: 100%;
519
+ height: 100%;
520
+ }
521
+ }
522
+ }
523
+
524
+ & > view:last-child {
525
+ text-align: center;
526
+ line-height: 15px;
527
+ font-size: unit(24, rpx);
528
+ }
529
+ }
530
+ }
531
+
532
+ &.cell5 {
533
+ & > view {
534
+ width: calc(100% / 5);
535
+ flex-shrink: 0;
536
+
537
+ //图片
538
+ & > view:first-child {
539
+ overflow: hidden;
540
+ display: flex;
541
+ justify-content: center;
542
+ align-items: center;
543
+ width: 100%;
544
+ box-sizing: border-box;
545
+
546
+ & > view {
547
+ width: 100%;
548
+ height: 100%;
549
+ overflow: hidden;
550
+ display: flex;
551
+ justify-content: center;
552
+ align-items: center;
553
+
554
+ & > image {
555
+ width: 100%;
556
+ height: 100%;
557
+ }
558
+ }
559
+ }
560
+
561
+ & > view:last-child {
562
+ text-align: center;
563
+ line-height: unit(36, rpx);
564
+ width: 90%;
565
+ margin: 0 5%;
566
+ overflow: hidden;
567
+ font-size: unit(24, rpx);
568
+ }
569
+ }
570
+ }
453
571
  }
454
572
  }
455
573