jufubao-base 1.0.103 → 1.0.105-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.
@@ -2,109 +2,770 @@
2
2
  <view
3
3
  class="jfb-base-poster-big-small"
4
4
  @click="handleEditxSelect"
5
- :class="{ editx : isEditx && active }"
5
+ :class="{ editx: isEditx && active }"
6
6
  >
7
7
  <!--#ifdef H5-->
8
8
  <view
9
9
  class="jfb-base-poster-big-small__edit"
10
- :class="{ editx : isEditx && active }"
10
+ :class="{ editx: isEditx && active }"
11
11
  v-if="isEditx && active"
12
12
  >
13
- <view class="jfb-base-poster-big-small__edit-icon" @click="delEdit">删除</view>
13
+ <view class="jfb-base-poster-big-small__edit-icon" @click="delEdit"
14
+ >删除</view
15
+ >
14
16
  </view>
15
17
  <!-- #endif -->
16
18
  <view class="jfb-base-poster-big-small__body">
17
- <view>测试插件( {{containerId}} )</view>
19
+ <view
20
+ class="jfb-base-poster-big-small__body-wrap"
21
+ :style="{
22
+ margin: margin,
23
+ flexDirection: position === 1 ? 'row' : 'row-reverse',
24
+ }"
25
+ >
26
+ <view
27
+ v-if="isCarousel === 1"
28
+ :style="{
29
+ margin: msMarginComputed,
30
+ width: bigWidth + 'rpx',
31
+ height: bigHeight + 'rpx',
32
+ borderRadius: radius + 'rpx',
33
+ }"
34
+ ><view>
35
+ <image
36
+ :style="{
37
+ width: bigWidth + 'rpx',
38
+ height: bigHeight + 'rpx',
39
+ borderRadius: radius + 'rpx',
40
+ }"
41
+ :src="bigList[0].image_url"
42
+ mode="aspectFill"
43
+ ></image> </view
44
+ ></view>
45
+ <view
46
+ v-else
47
+ :style="{
48
+ margin: msMarginComputed,
49
+ width: bigWidth + 'rpx',
50
+ height: bigHeight + 'rpx',
51
+ borderRadius: radius + 'rpx',
52
+ }"
53
+ >
54
+ <xd-swiper-dot
55
+ :current="current"
56
+ :info="bigList"
57
+ field="content_name"
58
+ :mode="dot_type"
59
+ :dots-styles="dotStyleData"
60
+ >
61
+ <xd-swiper
62
+ :indicator-dots="false"
63
+ :list="bigList"
64
+ :current="current"
65
+ :width="bigWidth + 'rpx'"
66
+ :height="bigHeight + 'rpx'"
67
+ :interval="carouselTime"
68
+ @onClickItem="handleClick"
69
+ @animationfinish="handleBigAnimationfinish"
70
+ >
71
+ <template slot-scope="{ item, index }">
72
+ <image
73
+ :style="{
74
+ borderRadius: radius + 'rpx',
75
+ }"
76
+ :src="item['image_url']"
77
+ mode="aspectFill"
78
+ ></image>
79
+ </template>
80
+ </xd-swiper>
81
+ </xd-swiper-dot>
82
+
83
+ <view v-if="isPreview" class="carousel-mask"></view>
84
+ </view>
85
+ <view
86
+ :style="{
87
+ width: bigWidth + 'rpx',
88
+ height: '100%',
89
+ }"
90
+ >
91
+ <view
92
+ :style="{
93
+ width: '100%',
94
+ marginBottom: msMargin + 'rpx',
95
+ height: smallHeight + 'rpx',
96
+ }"
97
+ >
98
+ <view
99
+ v-if="topIsCarousel === 1"
100
+ :style="{
101
+ width: bigWidth + 'rpx',
102
+ height: smallHeight + 'rpx',
103
+ borderRadius: topRadius + 'rpx',
104
+ }"
105
+ ><view>
106
+ <image
107
+ :style="{
108
+ width: bigWidth + 'rpx',
109
+ height: smallHeight + 'rpx',
110
+ borderRadius: topRadius + 'rpx',
111
+ }"
112
+ :src="topList[0].image_url"
113
+ mode="aspectFill"
114
+ ></image> </view
115
+ ></view>
116
+ <view
117
+ v-else
118
+ :style="{
119
+ width: bigWidth + 'rpx',
120
+ height: smallHeight + 'rpx',
121
+ borderRadius: topRadius + 'rpx',
122
+ }"
123
+ >
124
+ <xd-swiper-dot
125
+ :current="topCurrent"
126
+ :info="topList"
127
+ field="content_name"
128
+ :mode="top_dot_type"
129
+ :dots-styles="topDotStyleData"
130
+ >
131
+ <xd-swiper
132
+ :indicator-dots="false"
133
+ :list="topList"
134
+ :current="topCurrent"
135
+ :width="bigWidth + 'rpx'"
136
+ :height="smallHeight + 'rpx'"
137
+ :interval="topCarouselTime"
138
+ @onClickItem="handleClick"
139
+ @animationfinish="handleTopAnimationfinish"
140
+ >
141
+ <template slot-scope="{ item, index }">
142
+ <image
143
+ :style="{
144
+ borderRadius: topRadius + 'rpx',
145
+ }"
146
+ :src="item['image_url']"
147
+ mode="aspectFill"
148
+ ></image>
149
+ </template>
150
+ </xd-swiper>
151
+ </xd-swiper-dot>
152
+
153
+ <view v-if="isPreview" class="carousel-mask"></view>
154
+ </view>
155
+ </view>
156
+ <view
157
+ :style="{
158
+ width: '100%',
159
+ height: smallHeight + 'rpx',
160
+ }"
161
+ >
162
+ <view
163
+ v-if="bottomIsCarousel === 1"
164
+ :style="{
165
+ width: bigWidth + 'rpx',
166
+ height: smallHeight + 'rpx',
167
+ borderRadius: bottomRadius + 'rpx',
168
+ }"
169
+ ><view>
170
+ <image
171
+ :style="{
172
+ width: bigWidth + 'rpx',
173
+ height: smallHeight + 'rpx',
174
+ borderRadius: bottomRadius + 'rpx',
175
+ }"
176
+ :src="bottomList[0].image_url"
177
+ mode="aspectFill"
178
+ ></image> </view
179
+ ></view>
180
+ <view
181
+ v-else
182
+ :style="{
183
+ width: bigWidth + 'rpx',
184
+ height: smallHeight + 'rpx',
185
+ borderRadius: bottomRadius + 'rpx',
186
+ }"
187
+ >
188
+ <xd-swiper-dot
189
+ :current="bottomCurrent"
190
+ :info="bottomList"
191
+ field="content_name"
192
+ :mode="bottom_dot_type"
193
+ :dots-styles="bottomDotStyleData"
194
+ >
195
+ <xd-swiper
196
+ :indicator-dots="false"
197
+ :list="bottomList"
198
+ :current="bottomCurrent"
199
+ :width="bigWidth + 'rpx'"
200
+ :height="smallHeight + 'rpx'"
201
+ :interval="bottomCarouselTime"
202
+ @onClickItem="handleClick"
203
+ @animationfinish="handleBottomAnimationfinish"
204
+ >
205
+ <template slot-scope="{ item, index }">
206
+ <image
207
+ :style="{
208
+ borderRadius: bottomRadius + 'rpx',
209
+ }"
210
+ :src="item['image_url']"
211
+ mode="aspectFill"
212
+ ></image>
213
+ </template>
214
+ </xd-swiper>
215
+ </xd-swiper-dot>
216
+
217
+ <view v-if="isPreview" class="carousel-mask"></view>
218
+ </view>
219
+ </view>
220
+ </view>
221
+ </view>
18
222
  </view>
19
223
  </view>
20
224
  </template>
21
225
 
22
226
  <script>
23
- import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
24
- import { jfbRootExec } from "@/utils/xd.event";
25
- import JfbBasePosterBigSmallMixin from "./JfbBasePosterBigSmallMixin";
26
- import { getContainerPropsValue } from "@/utils/xd.base";
27
- import componentsMixins from "@/mixins/componentsMixins";
28
- import extsMixins from "@/mixins/extsMixins";
29
- export default {
30
- name: "JfbBasePosterBigSmall",
31
- components: {
32
- XdFontIcon
227
+ const color = require("color");
228
+ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
229
+ import { jfbRootExec } from "@/utils/xd.event";
230
+ import JfbBasePosterBigSmallMixin from "./JfbBasePosterBigSmallMixin";
231
+ import { getContainerPropsValue } from "@/utils/xd.base";
232
+ import componentsMixins from "@/mixins/componentsMixins";
233
+ import extsMixins from "@/mixins/extsMixins";
234
+ import XdSwiper from "@/components/XdSwiper/XdSwiper";
235
+ import XdSwiperDot from "./XdSwiperDot";
236
+ import getServiceUrl from "@/common/getServiceUrl";
237
+ import getWidthHeight from './getWidthHeight'
238
+ export default {
239
+ name: "JfbBasePosterBigSmall",
240
+ components: {
241
+ XdFontIcon,
242
+ XdSwiper,
243
+ XdSwiperDot,
244
+ },
245
+ mixins: [componentsMixins, extsMixins, JfbBasePosterBigSmallMixin],
246
+ data() {
247
+ return {
248
+ height: 0, //组件高度
249
+ mS: {
250
+ top: 0,
251
+ bottom: 0,
252
+ left: 0,
253
+ right: 0,
254
+ }, //间距
255
+ isPreview: false, //是否预览
256
+ test: {
257
+ content_id: "KpBbUKdj4aBejwe7Fh1ki",
258
+ position_id: "QCk3PmoyQmOWRP1SxnYR3",
259
+ partner_id: 0,
260
+ site_id: "",
261
+ content_name: "测试.",
262
+ image_url: "//dummyimage.com/200x200",
263
+ redirect_type: "EMP",
264
+ redirect_type_name: "无链接",
265
+ redirect_data: "",
266
+ sort: "",
267
+ status: "",
268
+ start_time: "",
269
+ end_time: "",
270
+ op_user_id: "",
271
+ created_time: 0,
272
+ updated_time: 0,
273
+ }, //测试数据
274
+
275
+ msMargin: 0, //大小图间距
276
+
277
+ position: 1, //控制大图位置
278
+
279
+ //大图
280
+ current: 0,
281
+ carouselTime: 5, //轮播图轮播周期
282
+ bigList: [],
283
+ number: null,
284
+ dot_type: "dot",
285
+ isCarousel: 1, //大图是否轮播图
286
+ radius: 0, //大图圆角
287
+ bigWidth: 0,
288
+ bigHeight: 0,
289
+
290
+ //小图下
291
+ bottomList: [],
292
+ bottomNumber: null,
293
+ bottom_dot_type: "dot",
294
+ bottomRadius: 0, //小图上圆角
295
+ bottomCurrent: 0, //小图上
296
+ bottomIsCarousel: 1,
297
+
298
+ //小图上
299
+ topList: [],
300
+ topNumber: null,
301
+ top_dot_type: "dot",
302
+ topRadius: 0, //小图上圆角
303
+ topCurrent: 0, //小图上
304
+ topIsCarousel: 1,
305
+ smallHeight: 0,
306
+
307
+ timer: null,
308
+
309
+ };
310
+ },
311
+ computed: {
312
+ margin() {
313
+ return `${this.mS.top || 0}rpx ${this.mS.right || 0}rpx ${
314
+ this.mS.bottom || 0
315
+ }rpx ${this.mS.left || 0}rpx`;
316
+ },
317
+ msMarginComputed() {
318
+ if (this.position === 1) {
319
+ return `0 ${this.msMargin}rpx 0 0`;
320
+ } else {
321
+ return `0 0 0 ${this.msMargin}rpx`;
322
+ }
323
+ },
324
+ dotStyleData() {
325
+ let alpha = 0.6;
326
+ let selectedColor = `rgba(${color(this.mainColor)
327
+ .alpha(alpha)
328
+ .array()
329
+ .join(",")})`;
330
+ let style = {
331
+ dot: {
332
+ backgroundColor: "rgba(166,166,166,.5)",
333
+ border: "0px rgba(166,166,166,.5) solid",
334
+ color: "#fff",
335
+ selectedBackgroundColor: selectedColor,
336
+ selectedBorder: `0px this.mainColor solid`,
337
+ },
338
+ default: {
339
+ width: 16,
340
+ backgroundColor: "rgba(200,200,200,.45)",
341
+ border: "1px rgba(200,200,200,.45) solid",
342
+ color: "#fff",
343
+ selectedBackgroundColor: selectedColor,
344
+ selectedBorder: `1px this.mainColor solid`,
345
+ },
346
+ round: {
347
+ backgroundColor: "rgba(166,166,166,.5)",
348
+ border: "0px rgba(166,166,166,.5) solid",
349
+ color: "#fff",
350
+ selectedBackgroundColor: selectedColor,
351
+ selectedBorder: `0px this.mainColor solid`,
352
+ },
353
+ nav: {
354
+ backgroundColor: "rgba(0,0,0,.5)",
355
+ border: "1px rgba(0,0,0,.5) solid",
356
+ color: "#fff",
357
+ selectedBackgroundColor: "rgba(255, 255, 255, 1)",
358
+ selectedBorder: "1px rgba(255, 255, 255 1) solid",
359
+ },
360
+ indexes: {
361
+ backgroundColor: "rgba(0,0,0,.5)",
362
+ border: "0px rgba(0,0,0,.5) solid",
363
+ color: "#aaa",
364
+ selectedBackgroundColor: "rgba(0,0,0,.8)",
365
+ selectedBorder: "0px rgba(0,0,0,.8) solid",
366
+ selectedColor: "#fff",
367
+ },
368
+ };
369
+ console.log(
370
+ style[this.dot_type],
371
+ "style[this.dot_type]style[this.dot_type]style[this.dot_type]"
372
+ );
373
+ return style[this.dot_type];
374
+ },
375
+ topDotStyleData() {
376
+ let alpha = 0.6;
377
+ let selectedColor = `rgba(${color(this.mainColor)
378
+ .alpha(alpha)
379
+ .array()
380
+ .join(",")})`;
381
+ let style = {
382
+ dot: {
383
+ backgroundColor: "rgba(166,166,166,.5)",
384
+ border: "0px rgba(166,166,166,.5) solid",
385
+ color: "#fff",
386
+ selectedBackgroundColor: selectedColor,
387
+ selectedBorder: `0px this.mainColor solid`,
388
+ },
389
+ default: {
390
+ width: 16,
391
+ backgroundColor: "rgba(200,200,200,.45)",
392
+ border: "1px rgba(200,200,200,.45) solid",
393
+ color: "#fff",
394
+ selectedBackgroundColor: selectedColor,
395
+ selectedBorder: `1px this.mainColor solid`,
396
+ },
397
+ round: {
398
+ backgroundColor: "rgba(166,166,166,.5)",
399
+ border: "0px rgba(166,166,166,.5) solid",
400
+ color: "#fff",
401
+ selectedBackgroundColor: selectedColor,
402
+ selectedBorder: `0px this.mainColor solid`,
403
+ },
404
+ nav: {
405
+ backgroundColor: "rgba(0,0,0,.5)",
406
+ border: "1px rgba(0,0,0,.5) solid",
407
+ color: "#fff",
408
+ selectedBackgroundColor: "rgba(255, 255, 255, 1)",
409
+ selectedBorder: "1px rgba(255, 255, 255 1) solid",
410
+ },
411
+ indexes: {
412
+ backgroundColor: "rgba(0,0,0,.5)",
413
+ border: "0px rgba(0,0,0,.5) solid",
414
+ color: "#aaa",
415
+ selectedBackgroundColor: "rgba(0,0,0,.8)",
416
+ selectedBorder: "0px rgba(0,0,0,.8) solid",
417
+ selectedColor: "#fff",
418
+ },
419
+ };
420
+ return style[this.top_dot_type];
421
+ },
422
+ bottomDotStyleData() {
423
+ let alpha = 0.6;
424
+ let selectedColor = `rgba(${color(this.mainColor)
425
+ .alpha(alpha)
426
+ .array()
427
+ .join(",")})`;
428
+ let style = {
429
+ dot: {
430
+ backgroundColor: "rgba(166,166,166,.5)",
431
+ border: "0px rgba(166,166,166,.5) solid",
432
+ color: "#fff",
433
+ selectedBackgroundColor: selectedColor,
434
+ selectedBorder: `0px this.mainColor solid`,
435
+ },
436
+ default: {
437
+ width: 16,
438
+ backgroundColor: "rgba(200,200,200,.45)",
439
+ border: "1px rgba(200,200,200,.45) solid",
440
+ color: "#fff",
441
+ selectedBackgroundColor: selectedColor,
442
+ selectedBorder: `1px this.mainColor solid`,
443
+ },
444
+ round: {
445
+ backgroundColor: "rgba(166,166,166,.5)",
446
+ border: "0px rgba(166,166,166,.5) solid",
447
+ color: "#fff",
448
+ selectedBackgroundColor: selectedColor,
449
+ selectedBorder: `0px this.mainColor solid`,
450
+ },
451
+ nav: {
452
+ backgroundColor: "rgba(0,0,0,.5)",
453
+ border: "1px rgba(0,0,0,.5) solid",
454
+ color: "#fff",
455
+ selectedBackgroundColor: "rgba(255, 255, 255, 1)",
456
+ selectedBorder: "1px rgba(255, 255, 255 1) solid",
457
+ },
458
+ indexes: {
459
+ backgroundColor: "rgba(0,0,0,.5)",
460
+ border: "0px rgba(0,0,0,.5) solid",
461
+ color: "#aaa",
462
+ selectedBackgroundColor: "rgba(0,0,0,.8)",
463
+ selectedBorder: "0px rgba(0,0,0,.8) solid",
464
+ selectedColor: "#fff",
465
+ },
466
+ };
467
+ return style[this.bottom_dot_type];
33
468
  },
34
- mixins: [
35
- componentsMixins, extsMixins, JfbBasePosterBigSmallMixin
36
- ],
37
- data() {
38
- return {
469
+ },
470
+ watch: {
471
+ container(value) {
472
+ this.init(value);
473
+ if(this.timer) clearTimeout(this.timer);
474
+ this.timer = setTimeout(()=>{
475
+ if (this.$configProject['isPreview']) this.onJfbLoad()
476
+ }, 400)
477
+ },
478
+ },
479
+ created() {
480
+ this.init(this.container);
481
+ this.isPreview = this.$configProject.isPreview;
482
+ },
483
+ methods: {
484
+ onJfbLoad(options) {
485
+ this.params = options;
486
+ //获取大图列表
487
+ jfbRootExec("getListPosterContent", {
488
+ vm: this,
489
+ data: {
490
+ page_id: this.pageAttr["page_id"], //页面ID
491
+ container_id: this.containerId + "big", //组件ID
492
+ page_size: this.number,
493
+ },
494
+ })
495
+ .then((res) => {
496
+ //如果res.list为空且isPreview为true,则获取测试数据
497
+ if (res.list.length === 0 && this.isPreview) {
498
+ res.list = this.getTestData("big");
499
+ }
500
+ //将res.list中的image_url替换为服务地址
501
+ this.bigList =
502
+ res.list &&
503
+ res.list.length > 0 &&
504
+ res.list.map((item) => {
505
+ item.image_url = item.image_url
506
+ ? getServiceUrl(item.image_url)
507
+ : "";
508
+ return item;
509
+ });
510
+ })
511
+ .catch((error) => {
512
+ console.error(error);
513
+ });
514
+ //获取小图上列表
515
+ jfbRootExec("getListPosterContent", {
516
+ vm: this,
517
+ data: {
518
+ page_id: this.pageAttr["page_id"], //页面ID
519
+ container_id: this.containerId + "top", //组件ID
520
+ page_size: this.topNumber,
521
+ },
522
+ })
523
+ .then((res) => {
524
+ //如果res.list为空且isPreview为true,则获取测试数据
525
+ if (res.list.length === 0 && this.isPreview) {
526
+ res.list = this.getTestData("top");
527
+ }
528
+ //将res.list中的image_url替换为服务地址
529
+ this.topList =
530
+ res.list &&
531
+ res.list.length > 0 &&
532
+ res.list.map((item) => {
533
+ item.image_url = item.image_url
534
+ ? getServiceUrl(item.image_url)
535
+ : "";
536
+ return item;
537
+ });
538
+ })
539
+ .catch((error) => {
540
+ console.error(error);
541
+ });
542
+ //获取小图下列表
543
+ jfbRootExec("getListPosterContent", {
544
+ vm: this,
545
+ data: {
546
+ page_id: this.pageAttr["page_id"], //页面ID
547
+ container_id: this.containerId + "bottom", //组件ID
548
+ page_size: this.bottomNumber,
549
+ },
550
+ })
551
+ .then((res) => {
552
+ //如果res.list为空且isPreview为true,则获取测试数据
553
+ if (res.list.length === 0 && this.isPreview) {
554
+ res.list = this.getTestData("bottom");
555
+ }
556
+ //将res.list中的image_url替换为服务地址
557
+ this.bottomList =
558
+ res.list &&
559
+ res.list.length > 0 &&
560
+ res.list.map((item) => {
561
+ item.image_url = item.image_url
562
+ ? getServiceUrl(item.image_url)
563
+ : "";
564
+ return item;
565
+ });
566
+ })
567
+ .catch((error) => {
568
+ console.error(error);
569
+ });
570
+ },
571
+ handleBigAnimationfinish(e) {
572
+ this.current = e.detail.current;
573
+ },
574
+ handleTopAnimationfinish(e) {
575
+ this.topCurrent = e.detail.current;
576
+ },
577
+ handleBottomAnimationfinish(e) {
578
+ this.bottomCurrent = e.detail.current;
579
+ },
580
+ handleClick(item) {
581
+ //内部链接跳转地址
582
+ if (item.redirect_type === "INN") {
583
+ try {
584
+ let url = JSON.parse(item.redirect_data);
585
+ let params = "";
586
+ if (item["redirect_params"]) params = `?${item["redirect_params"]}`;
587
+ this.$xdUniHelper.navigateTo({
588
+ url: url.page + params,
589
+ });
590
+ } catch (e) {
591
+ console.error(e);
592
+ }
593
+ }
39
594
 
40
- //todo
595
+ //外部链接
596
+ if (item.redirect_type === "URL") {
597
+ let reg = /^(http:\/\/|https:\/\/|\/\/)+.+$/;
598
+ //#ifdef MP-WEIXIN
599
+ try {
600
+ let url = JSON.parse(item.redirect_data);
601
+ if (reg.test(url.url) && this.$configProject.extras.webview) {
602
+ console.warn(`广告跳转外站: ${url.url}`);
603
+ this.$xdUniHelper.navigateTo({
604
+ url: `${
605
+ this.$configProject.extras.webview
606
+ }?seatUrl=${Base64.encodeURI(url.url)}`,
607
+ });
608
+ } else {
609
+ throw Error("地址错误");
610
+ }
611
+ } catch (e) {
612
+ console.error(e);
613
+ }
614
+ //#endif
615
+ //#ifdef H5
616
+ try {
617
+ let url = JSON.parse(item.redirect_data);
618
+ if (reg.test(url.url)) {
619
+ console.warn(`广告跳转外站: ${url.url}`);
620
+ window.location.href = url.url;
621
+ } else {
622
+ throw Error("地址错误");
623
+ }
624
+ } catch (e) {
625
+ console.error(e);
626
+ }
627
+ //#endif
41
628
  }
42
629
  },
43
- watch: {
44
- container(value) {
45
- this.init(value)
630
+ getTestData(type) {
631
+ let width;
632
+ let height;
633
+ // 根据type参数,设置width和height
634
+ if (type == "big") {
635
+ width = this.bigWidth;
636
+ height = this.bigHeight;
637
+ }
638
+ if (type == "top") {
639
+ width = this.bigWidth;
640
+ height = this.smallHeight;
641
+ }
642
+ if (type == "bottom") {
643
+ width = this.bigWidth;
644
+ height = this.smallHeight;
46
645
  }
646
+ // 创建一个临时数组,用于存放生成的测试数据
647
+ let temp = [];
648
+ // 循环number次,生成number个测试数据
649
+ for (let i = 0; i < this.number; i++) {
650
+ // 克隆一个测试数据
651
+ let item = this.$xdUniHelper.cloneDeep(this.test);
652
+ // 设置content_id和content_name
653
+ item.content_id = i;
654
+ item.content_name = item.content_name + i;
655
+ // 设置图片url
656
+ item.image_url = `//dummyimage.com/${width}x${height}`;
657
+ // 将生成的测试数据添加到临时数组中
658
+ temp.push(item);
659
+ }
660
+ // 返回临时数组
661
+ return temp;
47
662
  },
48
- created() {
49
- this.init(this.container);
663
+ /**
664
+ * @description 监听事件变化
665
+ * @param container {object} 业务组件对象自己
666
+ */
667
+ init(container) {
668
+ this.height = getContainerPropsValue(container, "content.height", "500");
669
+ // 获取最外面间距,如果没有则设置默认值
670
+ this.mS = getContainerPropsValue(container, "content.margin", {
671
+ top: 0,
672
+ bottom: 0,
673
+ left: 0,
674
+ right: 0,
675
+ });
676
+ this.position = getContainerPropsValue(container, "content.position", 1);
677
+ // 获取大小图之间间距,如果没有则设置默认值
678
+ this.msMargin = getContainerPropsValue(container, "content.msMargin", 10);
679
+ // 获取安全区域宽度,减去margin的值,再除以2,获取大图宽度
680
+ this.bigWidth = getWidthHeight(this.height,this.mS,this.msMargin).bigWidth;
681
+ this.bigHeight = getWidthHeight(this.height,this.mS,this.msMargin).bigHeight;
682
+ // 获取容器高度,减去margin的值,再除以2,获取小图高度
683
+ this.smallHeight = getWidthHeight(this.height,this.mS,this.msMargin).smallHeight;
684
+ // 获取大图数据
685
+ this.isCarousel = getContainerPropsValue(
686
+ container,
687
+ "content.isCarousel",
688
+ 1
689
+ );
690
+ this.radius = getContainerPropsValue(container, "content.radius", 0);
691
+ this.number = getContainerPropsValue(container, "content.number", 1);
692
+ this.dot_type = getContainerPropsValue(
693
+ container,
694
+ "content.dot_type",
695
+ "dot"
696
+ );
697
+ this.carouselTime =
698
+ Number(getContainerPropsValue(container, "content.carouselTime", 5)) *
699
+ 1000;
700
+ this.topRadius = getContainerPropsValue(
701
+ container,
702
+ "content.topRadius",
703
+ 0
704
+ );
50
705
 
51
- //todo
52
- },
53
- methods: {
54
- onJfbLoad(options) {
55
-
56
- // jfbRootExec('baiduUserLogin', {
57
-
58
- // vm: this,// data: {
59
-
60
- // account: 'gaoshiyong',// password: '123456789',// type: 3,// ...options
61
-
62
- // }
63
-
64
- // }).then().catch()
65
- },
66
- /**
67
- * @description 监听事件变化
68
- * @param container {object} 业务组件对象自己
69
- */
70
- init(container) {
71
-
72
- //this.bgcolor = getContainerPropsValue(container, 'content.bgcolor', '#fff');
73
-
74
- //this.height = getContainerPropsValue(container, 'content.height', 10);
75
- },
76
- onJfbScroll(options) {
77
- console.log('event.onJfbScroll', options)
78
- },
79
- onJfbReachBottom(options) {
80
- console.log('event.onJfbReachBottom', options)
81
- },
82
- onJfbShow(options) {
83
- console.log('event.onJfbShow', options)
84
- },
85
- onJfbHide(options) {
86
- console.log('event.onJfbHide', options)
87
- },
88
- onJfbBack(options) {
89
- console.log('event.onJfbBack', options)
90
- },
91
- onJfbUpdate(...data) {
92
- console.log('event.onJfbUpdate', data)
93
- },
94
- onJfbCustomEvent(options) {
95
- console.log('event.onJfbReachBottom', options)
96
- },
97
- }
98
- }
706
+ // 获取小图上数据
707
+ this.topNumber = getContainerPropsValue(
708
+ container,
709
+ "content.topNumber",
710
+ 1
711
+ );
712
+ this.top_dot_type = getContainerPropsValue(
713
+ container,
714
+ "content.top_dot_type",
715
+ "dot"
716
+ );
717
+ this.topIsCarousel = getContainerPropsValue(
718
+ container,
719
+ "content.topIsCarousel",
720
+ 1
721
+ );
722
+ this.topCarouselTime =
723
+ Number(
724
+ getContainerPropsValue(container, "content.topCarouselTime", 5)
725
+ ) * 1000;
99
726
 
727
+ //获取小图下数据
728
+ this.bottomNumber = getContainerPropsValue(
729
+ container,
730
+ "content.bottomNumber",
731
+ 1
732
+ );
733
+ this.bottom_dot_type = getContainerPropsValue(
734
+ container,
735
+ "content.bottom_dot_type",
736
+ "dot"
737
+ );
738
+
739
+ this.bottomRadius = getContainerPropsValue(
740
+ container,
741
+ "content.bottomRadius",
742
+ 0
743
+ );
744
+ this.bottomIsCarousel = getContainerPropsValue(
745
+ container,
746
+ "content.bottomIsCarousel",
747
+ 1
748
+ );
749
+ this.bottomCarouselTime =
750
+ Number(
751
+ getContainerPropsValue(container, "content.bottomCarouselTime", 5)
752
+ ) * 1000;
753
+ },
754
+ onJfbUpdate(data) {
755
+ this.onJfbLoad(this.params);
756
+ }
757
+ },
758
+ };
100
759
  </script>
101
760
 
102
761
  <style scoped lang="less">
103
- @import "./JfbBasePosterBigSmallLess.less";
104
-
105
- .jfb-base-poster-big-small {
106
- &__body{
762
+ @import "./JfbBasePosterBigSmallLess.less";
107
763
 
764
+ .jfb-base-poster-big-small {
765
+ &__body {
766
+ &-wrap {
767
+ display: flex;
108
768
  }
109
769
  }
770
+ }
110
771
  </style>