jufubao-base 1.0.89-beta6 → 1.0.100-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.
- package/package.json +1 -1
- package/src/components/JfbBaseCity/JfbBaseCity.vue +103 -117
- package/src/components/JfbBasePosterBigSmall/Api.js +39 -7
- package/src/components/JfbBasePosterBigSmall/Attr.js +72 -972
- package/src/components/JfbBasePosterBigSmall/JfbBasePosterBigSmall.vue +77 -741
- package/src/components/JfbBasePosterBigSmall/XdSwiperDot.vue +0 -234
|
@@ -2,773 +2,109 @@
|
|
|
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"
|
|
14
|
-
>删除</view
|
|
15
|
-
>
|
|
13
|
+
<view class="jfb-base-poster-big-small__edit-icon" @click="delEdit">删除</view>
|
|
16
14
|
</view>
|
|
17
15
|
<!-- #endif -->
|
|
18
16
|
<view class="jfb-base-poster-big-small__body">
|
|
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>
|
|
17
|
+
<view>测试插件( {{containerId}} )</view>
|
|
222
18
|
</view>
|
|
223
19
|
</view>
|
|
224
20
|
</template>
|
|
225
21
|
|
|
226
22
|
<script>
|
|
227
|
-
|
|
228
|
-
import
|
|
229
|
-
import
|
|
230
|
-
import
|
|
231
|
-
import
|
|
232
|
-
import
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
export default {
|
|
238
|
-
name: "JfbBasePosterBigSmall",
|
|
239
|
-
components: {
|
|
240
|
-
XdFontIcon,
|
|
241
|
-
XdSwiper,
|
|
242
|
-
XdSwiperDot,
|
|
243
|
-
},
|
|
244
|
-
mixins: [componentsMixins, extsMixins, JfbBasePosterBigSmallMixin],
|
|
245
|
-
data() {
|
|
246
|
-
return {
|
|
247
|
-
height: 0, //组件高度
|
|
248
|
-
mS: {
|
|
249
|
-
top: 0,
|
|
250
|
-
bottom: 0,
|
|
251
|
-
left: 0,
|
|
252
|
-
right: 0,
|
|
253
|
-
}, //间距
|
|
254
|
-
isPreview: false, //是否预览
|
|
255
|
-
test: {
|
|
256
|
-
content_id: "KpBbUKdj4aBejwe7Fh1ki",
|
|
257
|
-
position_id: "QCk3PmoyQmOWRP1SxnYR3",
|
|
258
|
-
partner_id: 0,
|
|
259
|
-
site_id: "",
|
|
260
|
-
content_name: "测试.",
|
|
261
|
-
image_url: "//dummyimage.com/200x200",
|
|
262
|
-
redirect_type: "EMP",
|
|
263
|
-
redirect_type_name: "无链接",
|
|
264
|
-
redirect_data: "",
|
|
265
|
-
sort: "",
|
|
266
|
-
status: "",
|
|
267
|
-
start_time: "",
|
|
268
|
-
end_time: "",
|
|
269
|
-
op_user_id: "",
|
|
270
|
-
created_time: 0,
|
|
271
|
-
updated_time: 0,
|
|
272
|
-
}, //测试数据
|
|
273
|
-
|
|
274
|
-
msMargin: 0, //大小图间距
|
|
275
|
-
|
|
276
|
-
position: 1, //控制大图位置
|
|
277
|
-
|
|
278
|
-
//大图
|
|
279
|
-
current: 0,
|
|
280
|
-
carouselTime: 5, //轮播图轮播周期
|
|
281
|
-
bigList: [],
|
|
282
|
-
number: null,
|
|
283
|
-
dot_type: "dot",
|
|
284
|
-
isCarousel: 1, //大图是否轮播图
|
|
285
|
-
radius: 0, //大图圆角
|
|
286
|
-
bigWidth: 0,
|
|
287
|
-
bigHeight: 0,
|
|
288
|
-
|
|
289
|
-
//小图下
|
|
290
|
-
bottomList: [],
|
|
291
|
-
bottomNumber: null,
|
|
292
|
-
bottom_dot_type: "dot",
|
|
293
|
-
bottomRadius: 0, //小图上圆角
|
|
294
|
-
bottomCurrent: 0, //小图上
|
|
295
|
-
bottomIsCarousel: 1,
|
|
296
|
-
|
|
297
|
-
//小图上
|
|
298
|
-
topList: [],
|
|
299
|
-
topNumber: null,
|
|
300
|
-
top_dot_type: "dot",
|
|
301
|
-
topRadius: 0, //小图上圆角
|
|
302
|
-
topCurrent: 0, //小图上
|
|
303
|
-
topIsCarousel: 1,
|
|
304
|
-
smallHeight: 0,
|
|
305
|
-
|
|
306
|
-
timer: null,
|
|
307
|
-
|
|
308
|
-
};
|
|
309
|
-
},
|
|
310
|
-
computed: {
|
|
311
|
-
margin() {
|
|
312
|
-
return `${this.mS.top || 0}rpx ${this.mS.right || 0}rpx ${
|
|
313
|
-
this.mS.bottom || 0
|
|
314
|
-
}rpx ${this.mS.left || 0}rpx`;
|
|
315
|
-
},
|
|
316
|
-
msMarginComputed() {
|
|
317
|
-
if (this.position === 1) {
|
|
318
|
-
return `0 ${this.msMargin}rpx 0 0`;
|
|
319
|
-
} else {
|
|
320
|
-
return `0 0 0 ${this.msMargin}rpx`;
|
|
321
|
-
}
|
|
322
|
-
},
|
|
323
|
-
dotStyleData() {
|
|
324
|
-
let alpha = 0.6;
|
|
325
|
-
let selectedColor = `rgba(${color(this.mainColor)
|
|
326
|
-
.alpha(alpha)
|
|
327
|
-
.array()
|
|
328
|
-
.join(",")})`;
|
|
329
|
-
let style = {
|
|
330
|
-
dot: {
|
|
331
|
-
backgroundColor: "rgba(166,166,166,.5)",
|
|
332
|
-
border: "0px rgba(166,166,166,.5) solid",
|
|
333
|
-
color: "#fff",
|
|
334
|
-
selectedBackgroundColor: selectedColor,
|
|
335
|
-
selectedBorder: `0px this.mainColor solid`,
|
|
336
|
-
},
|
|
337
|
-
default: {
|
|
338
|
-
width: 16,
|
|
339
|
-
backgroundColor: "rgba(200,200,200,.45)",
|
|
340
|
-
border: "1px rgba(200,200,200,.45) solid",
|
|
341
|
-
color: "#fff",
|
|
342
|
-
selectedBackgroundColor: selectedColor,
|
|
343
|
-
selectedBorder: `1px this.mainColor solid`,
|
|
344
|
-
},
|
|
345
|
-
round: {
|
|
346
|
-
backgroundColor: "rgba(166,166,166,.5)",
|
|
347
|
-
border: "0px rgba(166,166,166,.5) solid",
|
|
348
|
-
color: "#fff",
|
|
349
|
-
selectedBackgroundColor: selectedColor,
|
|
350
|
-
selectedBorder: `0px this.mainColor solid`,
|
|
351
|
-
},
|
|
352
|
-
nav: {
|
|
353
|
-
backgroundColor: "rgba(0,0,0,.5)",
|
|
354
|
-
border: "1px rgba(0,0,0,.5) solid",
|
|
355
|
-
color: "#fff",
|
|
356
|
-
selectedBackgroundColor: "rgba(255, 255, 255, 1)",
|
|
357
|
-
selectedBorder: "1px rgba(255, 255, 255 1) solid",
|
|
358
|
-
},
|
|
359
|
-
indexes: {
|
|
360
|
-
backgroundColor: "rgba(0,0,0,.5)",
|
|
361
|
-
border: "0px rgba(0,0,0,.5) solid",
|
|
362
|
-
color: "#aaa",
|
|
363
|
-
selectedBackgroundColor: "rgba(0,0,0,.8)",
|
|
364
|
-
selectedBorder: "0px rgba(0,0,0,.8) solid",
|
|
365
|
-
selectedColor: "#fff",
|
|
366
|
-
},
|
|
367
|
-
};
|
|
368
|
-
console.log(
|
|
369
|
-
style[this.dot_type],
|
|
370
|
-
"style[this.dot_type]style[this.dot_type]style[this.dot_type]"
|
|
371
|
-
);
|
|
372
|
-
return style[this.dot_type];
|
|
373
|
-
},
|
|
374
|
-
topDotStyleData() {
|
|
375
|
-
let alpha = 0.6;
|
|
376
|
-
let selectedColor = `rgba(${color(this.mainColor)
|
|
377
|
-
.alpha(alpha)
|
|
378
|
-
.array()
|
|
379
|
-
.join(",")})`;
|
|
380
|
-
let style = {
|
|
381
|
-
dot: {
|
|
382
|
-
backgroundColor: "rgba(166,166,166,.5)",
|
|
383
|
-
border: "0px rgba(166,166,166,.5) solid",
|
|
384
|
-
color: "#fff",
|
|
385
|
-
selectedBackgroundColor: selectedColor,
|
|
386
|
-
selectedBorder: `0px this.mainColor solid`,
|
|
387
|
-
},
|
|
388
|
-
default: {
|
|
389
|
-
width: 16,
|
|
390
|
-
backgroundColor: "rgba(200,200,200,.45)",
|
|
391
|
-
border: "1px rgba(200,200,200,.45) solid",
|
|
392
|
-
color: "#fff",
|
|
393
|
-
selectedBackgroundColor: selectedColor,
|
|
394
|
-
selectedBorder: `1px this.mainColor solid`,
|
|
395
|
-
},
|
|
396
|
-
round: {
|
|
397
|
-
backgroundColor: "rgba(166,166,166,.5)",
|
|
398
|
-
border: "0px rgba(166,166,166,.5) solid",
|
|
399
|
-
color: "#fff",
|
|
400
|
-
selectedBackgroundColor: selectedColor,
|
|
401
|
-
selectedBorder: `0px this.mainColor solid`,
|
|
402
|
-
},
|
|
403
|
-
nav: {
|
|
404
|
-
backgroundColor: "rgba(0,0,0,.5)",
|
|
405
|
-
border: "1px rgba(0,0,0,.5) solid",
|
|
406
|
-
color: "#fff",
|
|
407
|
-
selectedBackgroundColor: "rgba(255, 255, 255, 1)",
|
|
408
|
-
selectedBorder: "1px rgba(255, 255, 255 1) solid",
|
|
409
|
-
},
|
|
410
|
-
indexes: {
|
|
411
|
-
backgroundColor: "rgba(0,0,0,.5)",
|
|
412
|
-
border: "0px rgba(0,0,0,.5) solid",
|
|
413
|
-
color: "#aaa",
|
|
414
|
-
selectedBackgroundColor: "rgba(0,0,0,.8)",
|
|
415
|
-
selectedBorder: "0px rgba(0,0,0,.8) solid",
|
|
416
|
-
selectedColor: "#fff",
|
|
417
|
-
},
|
|
418
|
-
};
|
|
419
|
-
return style[this.top_dot_type];
|
|
420
|
-
},
|
|
421
|
-
bottomDotStyleData() {
|
|
422
|
-
let alpha = 0.6;
|
|
423
|
-
let selectedColor = `rgba(${color(this.mainColor)
|
|
424
|
-
.alpha(alpha)
|
|
425
|
-
.array()
|
|
426
|
-
.join(",")})`;
|
|
427
|
-
let style = {
|
|
428
|
-
dot: {
|
|
429
|
-
backgroundColor: "rgba(166,166,166,.5)",
|
|
430
|
-
border: "0px rgba(166,166,166,.5) solid",
|
|
431
|
-
color: "#fff",
|
|
432
|
-
selectedBackgroundColor: selectedColor,
|
|
433
|
-
selectedBorder: `0px this.mainColor solid`,
|
|
434
|
-
},
|
|
435
|
-
default: {
|
|
436
|
-
width: 16,
|
|
437
|
-
backgroundColor: "rgba(200,200,200,.45)",
|
|
438
|
-
border: "1px rgba(200,200,200,.45) solid",
|
|
439
|
-
color: "#fff",
|
|
440
|
-
selectedBackgroundColor: selectedColor,
|
|
441
|
-
selectedBorder: `1px this.mainColor solid`,
|
|
442
|
-
},
|
|
443
|
-
round: {
|
|
444
|
-
backgroundColor: "rgba(166,166,166,.5)",
|
|
445
|
-
border: "0px rgba(166,166,166,.5) solid",
|
|
446
|
-
color: "#fff",
|
|
447
|
-
selectedBackgroundColor: selectedColor,
|
|
448
|
-
selectedBorder: `0px this.mainColor solid`,
|
|
449
|
-
},
|
|
450
|
-
nav: {
|
|
451
|
-
backgroundColor: "rgba(0,0,0,.5)",
|
|
452
|
-
border: "1px rgba(0,0,0,.5) solid",
|
|
453
|
-
color: "#fff",
|
|
454
|
-
selectedBackgroundColor: "rgba(255, 255, 255, 1)",
|
|
455
|
-
selectedBorder: "1px rgba(255, 255, 255 1) solid",
|
|
456
|
-
},
|
|
457
|
-
indexes: {
|
|
458
|
-
backgroundColor: "rgba(0,0,0,.5)",
|
|
459
|
-
border: "0px rgba(0,0,0,.5) solid",
|
|
460
|
-
color: "#aaa",
|
|
461
|
-
selectedBackgroundColor: "rgba(0,0,0,.8)",
|
|
462
|
-
selectedBorder: "0px rgba(0,0,0,.8) solid",
|
|
463
|
-
selectedColor: "#fff",
|
|
464
|
-
},
|
|
465
|
-
};
|
|
466
|
-
return style[this.bottom_dot_type];
|
|
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
|
|
467
33
|
},
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
this.timer = setTimeout(()=>{
|
|
474
|
-
if (this.$configProject['isPreview']) this.onJfbLoad()
|
|
475
|
-
}, 400)
|
|
476
|
-
},
|
|
477
|
-
},
|
|
478
|
-
created() {
|
|
479
|
-
this.init(this.container);
|
|
480
|
-
this.isPreview = this.$configProject.isPreview;
|
|
481
|
-
},
|
|
482
|
-
methods: {
|
|
483
|
-
onJfbLoad(options) {
|
|
484
|
-
this.params = options;
|
|
485
|
-
//获取大图列表
|
|
486
|
-
jfbRootExec("getListPosterContent", {
|
|
487
|
-
vm: this,
|
|
488
|
-
data: {
|
|
489
|
-
page_id: this.pageAttr["page_id"], //页面ID
|
|
490
|
-
container_id: this.containerId + "big", //组件ID
|
|
491
|
-
page_size: this.number,
|
|
492
|
-
},
|
|
493
|
-
})
|
|
494
|
-
.then((res) => {
|
|
495
|
-
//如果res.list为空且isPreview为true,则获取测试数据
|
|
496
|
-
if (res.list.length === 0 && this.isPreview) {
|
|
497
|
-
res.list = this.getTestData("big");
|
|
498
|
-
}
|
|
499
|
-
//将res.list中的image_url替换为服务地址
|
|
500
|
-
this.bigList =
|
|
501
|
-
res.list &&
|
|
502
|
-
res.list.length > 0 &&
|
|
503
|
-
res.list.map((item) => {
|
|
504
|
-
item.image_url = item.image_url
|
|
505
|
-
? getServiceUrl(item.image_url)
|
|
506
|
-
: "";
|
|
507
|
-
return item;
|
|
508
|
-
});
|
|
509
|
-
})
|
|
510
|
-
.catch((error) => {
|
|
511
|
-
console.error(error);
|
|
512
|
-
});
|
|
513
|
-
//获取小图上列表
|
|
514
|
-
jfbRootExec("getListPosterContent", {
|
|
515
|
-
vm: this,
|
|
516
|
-
data: {
|
|
517
|
-
page_id: this.pageAttr["page_id"], //页面ID
|
|
518
|
-
container_id: this.containerId + "top", //组件ID
|
|
519
|
-
page_size: this.topNumber,
|
|
520
|
-
},
|
|
521
|
-
})
|
|
522
|
-
.then((res) => {
|
|
523
|
-
//如果res.list为空且isPreview为true,则获取测试数据
|
|
524
|
-
if (res.list.length === 0 && this.isPreview) {
|
|
525
|
-
res.list = this.getTestData("top");
|
|
526
|
-
}
|
|
527
|
-
//将res.list中的image_url替换为服务地址
|
|
528
|
-
this.topList =
|
|
529
|
-
res.list &&
|
|
530
|
-
res.list.length > 0 &&
|
|
531
|
-
res.list.map((item) => {
|
|
532
|
-
item.image_url = item.image_url
|
|
533
|
-
? getServiceUrl(item.image_url)
|
|
534
|
-
: "";
|
|
535
|
-
return item;
|
|
536
|
-
});
|
|
537
|
-
})
|
|
538
|
-
.catch((error) => {
|
|
539
|
-
console.error(error);
|
|
540
|
-
});
|
|
541
|
-
//获取小图下列表
|
|
542
|
-
jfbRootExec("getListPosterContent", {
|
|
543
|
-
vm: this,
|
|
544
|
-
data: {
|
|
545
|
-
page_id: this.pageAttr["page_id"], //页面ID
|
|
546
|
-
container_id: this.containerId + "bottom", //组件ID
|
|
547
|
-
page_size: this.bottomNumber,
|
|
548
|
-
},
|
|
549
|
-
})
|
|
550
|
-
.then((res) => {
|
|
551
|
-
//如果res.list为空且isPreview为true,则获取测试数据
|
|
552
|
-
if (res.list.length === 0 && this.isPreview) {
|
|
553
|
-
res.list = this.getTestData("bottom");
|
|
554
|
-
}
|
|
555
|
-
//将res.list中的image_url替换为服务地址
|
|
556
|
-
this.bottomList =
|
|
557
|
-
res.list &&
|
|
558
|
-
res.list.length > 0 &&
|
|
559
|
-
res.list.map((item) => {
|
|
560
|
-
item.image_url = item.image_url
|
|
561
|
-
? getServiceUrl(item.image_url)
|
|
562
|
-
: "";
|
|
563
|
-
return item;
|
|
564
|
-
});
|
|
565
|
-
})
|
|
566
|
-
.catch((error) => {
|
|
567
|
-
console.error(error);
|
|
568
|
-
});
|
|
569
|
-
},
|
|
570
|
-
handleBigAnimationfinish(e) {
|
|
571
|
-
this.current = e.detail.current;
|
|
572
|
-
},
|
|
573
|
-
handleTopAnimationfinish(e) {
|
|
574
|
-
this.topCurrent = e.detail.current;
|
|
575
|
-
},
|
|
576
|
-
handleBottomAnimationfinish(e) {
|
|
577
|
-
this.bottomCurrent = e.detail.current;
|
|
578
|
-
},
|
|
579
|
-
handleClick(item) {
|
|
580
|
-
//内部链接跳转地址
|
|
581
|
-
if (item.redirect_type === "INN") {
|
|
582
|
-
try {
|
|
583
|
-
let url = JSON.parse(item.redirect_data);
|
|
584
|
-
let params = "";
|
|
585
|
-
if (item["redirect_params"]) params = `?${item["redirect_params"]}`;
|
|
586
|
-
this.$xdUniHelper.navigateTo({
|
|
587
|
-
url: url.page + params,
|
|
588
|
-
});
|
|
589
|
-
} catch (e) {
|
|
590
|
-
console.error(e);
|
|
591
|
-
}
|
|
592
|
-
}
|
|
34
|
+
mixins: [
|
|
35
|
+
componentsMixins, extsMixins, JfbBasePosterBigSmallMixin
|
|
36
|
+
],
|
|
37
|
+
data() {
|
|
38
|
+
return {
|
|
593
39
|
|
|
594
|
-
|
|
595
|
-
if (item.redirect_type === "URL") {
|
|
596
|
-
let reg = /^(http:\/\/|https:\/\/|\/\/)+.+$/;
|
|
597
|
-
//#ifdef MP-WEIXIN
|
|
598
|
-
try {
|
|
599
|
-
let url = JSON.parse(item.redirect_data);
|
|
600
|
-
if (reg.test(url.url) && this.$configProject.extras.webview) {
|
|
601
|
-
console.warn(`广告跳转外站: ${url.url}`);
|
|
602
|
-
this.$xdUniHelper.navigateTo({
|
|
603
|
-
url: `${
|
|
604
|
-
this.$configProject.extras.webview
|
|
605
|
-
}?seatUrl=${Base64.encodeURI(url.url)}`,
|
|
606
|
-
});
|
|
607
|
-
} else {
|
|
608
|
-
throw Error("地址错误");
|
|
609
|
-
}
|
|
610
|
-
} catch (e) {
|
|
611
|
-
console.error(e);
|
|
612
|
-
}
|
|
613
|
-
//#endif
|
|
614
|
-
//#ifdef H5
|
|
615
|
-
try {
|
|
616
|
-
let url = JSON.parse(item.redirect_data);
|
|
617
|
-
if (reg.test(url.url)) {
|
|
618
|
-
console.warn(`广告跳转外站: ${url.url}`);
|
|
619
|
-
window.location.href = url.url;
|
|
620
|
-
} else {
|
|
621
|
-
throw Error("地址错误");
|
|
622
|
-
}
|
|
623
|
-
} catch (e) {
|
|
624
|
-
console.error(e);
|
|
625
|
-
}
|
|
626
|
-
//#endif
|
|
40
|
+
//todo
|
|
627
41
|
}
|
|
628
42
|
},
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
// 根据type参数,设置width和height
|
|
633
|
-
if (type == "big") {
|
|
634
|
-
width = this.bigWidth;
|
|
635
|
-
height = this.bigHeight;
|
|
636
|
-
}
|
|
637
|
-
if (type == "top") {
|
|
638
|
-
width = this.bigWidth;
|
|
639
|
-
height = this.smallHeight;
|
|
640
|
-
}
|
|
641
|
-
if (type == "bottom") {
|
|
642
|
-
width = this.bigWidth;
|
|
643
|
-
height = this.smallHeight;
|
|
43
|
+
watch: {
|
|
44
|
+
container(value) {
|
|
45
|
+
this.init(value)
|
|
644
46
|
}
|
|
645
|
-
// 创建一个临时数组,用于存放生成的测试数据
|
|
646
|
-
let temp = [];
|
|
647
|
-
// 循环number次,生成number个测试数据
|
|
648
|
-
for (let i = 0; i < this.number; i++) {
|
|
649
|
-
// 克隆一个测试数据
|
|
650
|
-
let item = this.$xdUniHelper.cloneDeep(this.test);
|
|
651
|
-
// 设置content_id和content_name
|
|
652
|
-
item.content_id = i;
|
|
653
|
-
item.content_name = item.content_name + i;
|
|
654
|
-
// 设置图片url
|
|
655
|
-
item.image_url = `//dummyimage.com/${width}x${height}`;
|
|
656
|
-
// 将生成的测试数据添加到临时数组中
|
|
657
|
-
temp.push(item);
|
|
658
|
-
}
|
|
659
|
-
// 返回临时数组
|
|
660
|
-
return temp;
|
|
661
47
|
},
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
* @param container {object} 业务组件对象自己
|
|
665
|
-
*/
|
|
666
|
-
init(container) {
|
|
667
|
-
this.height = getContainerPropsValue(container, "content.height", "500");
|
|
668
|
-
// 获取最外面间距,如果没有则设置默认值
|
|
669
|
-
this.mS = getContainerPropsValue(container, "content.margin", {
|
|
670
|
-
top: 0,
|
|
671
|
-
bottom: 0,
|
|
672
|
-
left: 0,
|
|
673
|
-
right: 0,
|
|
674
|
-
});
|
|
675
|
-
this.position = getContainerPropsValue(container, "content.position", 1);
|
|
676
|
-
// 获取大小图之间间距,如果没有则设置默认值
|
|
677
|
-
this.msMargin = getContainerPropsValue(container, "content.msMargin", 10);
|
|
678
|
-
// 获取安全区域宽度,减去margin的值,再除以2,获取大图宽度
|
|
679
|
-
this.bigWidth =
|
|
680
|
-
uni.getSystemInfoSync().safeArea.width -
|
|
681
|
-
(this.mS.left + this.mS.right + Number(this.msMargin)) / 2;
|
|
682
|
-
this.bigHeight = this.height - (this.mS.top + this.mS.bottom);
|
|
683
|
-
// 获取容器高度,减去margin的值,再除以2,获取小图高度
|
|
684
|
-
this.smallHeight =
|
|
685
|
-
(this.height - (this.mS.top + this.mS.bottom + Number(this.msMargin))) /
|
|
686
|
-
2;
|
|
687
|
-
// 获取大图数据
|
|
688
|
-
this.isCarousel = getContainerPropsValue(
|
|
689
|
-
container,
|
|
690
|
-
"content.isCarousel",
|
|
691
|
-
1
|
|
692
|
-
);
|
|
693
|
-
this.radius = getContainerPropsValue(container, "content.radius", 0);
|
|
694
|
-
this.number = getContainerPropsValue(container, "content.number", 1);
|
|
695
|
-
this.dot_type = getContainerPropsValue(
|
|
696
|
-
container,
|
|
697
|
-
"content.dot_type",
|
|
698
|
-
"dot"
|
|
699
|
-
);
|
|
700
|
-
this.carouselTime =
|
|
701
|
-
Number(getContainerPropsValue(container, "content.carouselTime", 5)) *
|
|
702
|
-
1000;
|
|
703
|
-
this.topRadius = getContainerPropsValue(
|
|
704
|
-
container,
|
|
705
|
-
"content.topRadius",
|
|
706
|
-
0
|
|
707
|
-
);
|
|
708
|
-
|
|
709
|
-
// 获取小图上数据
|
|
710
|
-
this.topNumber = getContainerPropsValue(
|
|
711
|
-
container,
|
|
712
|
-
"content.topNumber",
|
|
713
|
-
1
|
|
714
|
-
);
|
|
715
|
-
this.top_dot_type = getContainerPropsValue(
|
|
716
|
-
container,
|
|
717
|
-
"content.top_dot_type",
|
|
718
|
-
"dot"
|
|
719
|
-
);
|
|
720
|
-
this.topIsCarousel = getContainerPropsValue(
|
|
721
|
-
container,
|
|
722
|
-
"content.topIsCarousel",
|
|
723
|
-
1
|
|
724
|
-
);
|
|
725
|
-
this.topCarouselTime =
|
|
726
|
-
Number(
|
|
727
|
-
getContainerPropsValue(container, "content.topCarouselTime", 5)
|
|
728
|
-
) * 1000;
|
|
48
|
+
created() {
|
|
49
|
+
this.init(this.container);
|
|
729
50
|
|
|
730
|
-
|
|
731
|
-
this.bottomNumber = getContainerPropsValue(
|
|
732
|
-
container,
|
|
733
|
-
"content.bottomNumber",
|
|
734
|
-
1
|
|
735
|
-
);
|
|
736
|
-
this.bottom_dot_type = getContainerPropsValue(
|
|
737
|
-
container,
|
|
738
|
-
"content.bottom_dot_type",
|
|
739
|
-
"dot"
|
|
740
|
-
);
|
|
741
|
-
|
|
742
|
-
this.bottomRadius = getContainerPropsValue(
|
|
743
|
-
container,
|
|
744
|
-
"content.bottomRadius",
|
|
745
|
-
0
|
|
746
|
-
);
|
|
747
|
-
this.bottomIsCarousel = getContainerPropsValue(
|
|
748
|
-
container,
|
|
749
|
-
"content.bottomIsCarousel",
|
|
750
|
-
1
|
|
751
|
-
);
|
|
752
|
-
this.bottomCarouselTime =
|
|
753
|
-
Number(
|
|
754
|
-
getContainerPropsValue(container, "content.bottomCarouselTime", 5)
|
|
755
|
-
) * 1000;
|
|
51
|
+
//todo
|
|
756
52
|
},
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
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
|
+
}
|
|
99
|
+
|
|
762
100
|
</script>
|
|
763
101
|
|
|
764
102
|
<style scoped lang="less">
|
|
765
|
-
@import "./JfbBasePosterBigSmallLess.less";
|
|
103
|
+
@import "./JfbBasePosterBigSmallLess.less";
|
|
104
|
+
|
|
105
|
+
.jfb-base-poster-big-small {
|
|
106
|
+
&__body{
|
|
766
107
|
|
|
767
|
-
.jfb-base-poster-big-small {
|
|
768
|
-
&__body {
|
|
769
|
-
&-wrap {
|
|
770
|
-
display: flex;
|
|
771
108
|
}
|
|
772
109
|
}
|
|
773
|
-
}
|
|
774
110
|
</style>
|