jufubao-base 1.0.157-beta5 → 1.0.157-beta6
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/JfbBaseAddress/JfbBaseAddress.vue +4 -4
- package/src/components/JfbBaseBack/JfbBaseBack.vue +7 -6
- package/src/components/JfbBaseCardDetail/JfbBaseCardDetail.vue +14 -14
- package/src/components/JfbBaseCardDetailEntry/JfbBaseCardDetailEntry.vue +1 -1
- package/src/components/JfbBaseCardDisabled/JfbBaseCardDisabled.vue +1 -1
- package/src/components/JfbBaseCardDisabledEntry/JfbBaseCardDisabledEntry.vue +5 -4
- package/src/components/JfbBaseCardInfo/JfbBaseCardInfo.vue +9 -19
- package/src/components/JfbBaseCardInfoEntry/JfbBaseCardInfoEntry.vue +2 -2
- package/src/components/JfbBaseCardMerge/JfbBaseCardMerge.vue +1 -1
- package/src/components/JfbBaseCardMergeEntry/JfbBaseCardMergeEntry.vue +12 -13
- package/src/components/JfbBaseCardShift/JfbBaseCardShift.vue +1 -1
- package/src/components/JfbBaseCardShiftEntry/JfbBaseCardShiftEntry.vue +1 -1
- package/src/components/JfbBaseCardSweepInfo/JfbBaseCardSweepInfo.vue +1 -7
- package/src/components/JfbBaseEntry/Attr.js +22 -0
- package/src/components/JfbBaseEntry/JfbBaseEntry.vue +76 -13
- package/src/components/JfbBaseLogin/JfbBaseLogin.vue +2 -2
- package/src/components/JfbBaseLoginForgetPwd/JfbBaseLoginForgetPwd.vue +1 -1
- package/src/components/JfbBaseLoginSetPwd/JfbBaseLoginSetPwd.vue +3 -3
- package/src/components/JfbBaseNotice/Attr.js +0 -2
- package/src/components/JfbBaseNotice/JfbBaseNotice.vue +8 -9
- package/src/components/JfbBaseOrderDetail/JfbBaseOrderDetail.vue +1 -1
- package/src/components/JfbBaseOrderList/JfbBaseOrderList.vue +1 -1
- package/src/components/JfbBasePoster/JfbBasePoster.vue +118 -18
- package/src/components/JfbBasePoster/MoreScreen.vue +155 -37
- package/src/components/JfbBasePosterBigSmall/Attr.js +1 -4
- package/src/components/JfbBasePosterBigSmall/JfbBasePosterBigSmall.vue +184 -42
- package/src/components/JfbBasePosterEntry/JfbBasePosterEntry.vue +90 -20
- package/src/components/JfbBasePosterType/FourScreen.vue +156 -18
- package/src/components/JfbBasePosterType/JfbBasePosterType.vue +0 -35
- package/src/components/JfbBaseUserInfo/JfbBaseUserInfo.vue +2 -1
- package/src/components/JfbBaseVideo/JfbBaseVideo.vue +8 -7
- package/src/components/JfbBaseVideo/XdVideo.vue +0 -4
- package/src/components/JfbBaseWalletIndex/JfbBaseWalletIndex.vue +4 -13
- package/src/components/JfbBaseWxAuthorize/JfbBaseWxAuthorize.vue +2 -2
- package/src/mixins/colorCardMixins.js +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<script src="JfbBasePosterBigSmallMixin.js"></script>
|
|
1
2
|
<template>
|
|
2
3
|
<view
|
|
3
4
|
class="jfb-base-poster-big-small"
|
|
@@ -10,9 +11,7 @@
|
|
|
10
11
|
:class="{ editx: isEditx && active }"
|
|
11
12
|
v-if="isEditx && active"
|
|
12
13
|
>
|
|
13
|
-
<view class="jfb-base-poster-big-small__edit-icon" @click="delEdit"
|
|
14
|
-
>删除</view
|
|
15
|
-
>
|
|
14
|
+
<view class="jfb-base-poster-big-small__edit-icon" @click="delEdit">删除</view>
|
|
16
15
|
</view>
|
|
17
16
|
<!-- #endif -->
|
|
18
17
|
<view class="jfb-base-poster-big-small__body">
|
|
@@ -22,6 +21,7 @@
|
|
|
22
21
|
margin: margin,
|
|
23
22
|
flexDirection: position === 1 ? 'row' : 'row-reverse',
|
|
24
23
|
}"
|
|
24
|
+
v-if="isShowAd"
|
|
25
25
|
>
|
|
26
26
|
<view
|
|
27
27
|
v-if="isCarousel === 1"
|
|
@@ -60,6 +60,26 @@
|
|
|
60
60
|
:mode="dot_type"
|
|
61
61
|
:dots-styles="dotStyleData"
|
|
62
62
|
>
|
|
63
|
+
<!--#ifdef MP-WEIXIN-->
|
|
64
|
+
<swiper
|
|
65
|
+
:style="{width: bigWidth + 'rpx', height: bigHeight + 'rpx'}"
|
|
66
|
+
:indicator-dots="false"
|
|
67
|
+
:autoplay="carouselTime>0"
|
|
68
|
+
:interval="carouselTime"
|
|
69
|
+
:duration="500"
|
|
70
|
+
:current="current"
|
|
71
|
+
circular
|
|
72
|
+
@animationfinish="handleBigAnimationfinish"
|
|
73
|
+
>
|
|
74
|
+
<swiper-item v-for="(item,index) in bigList" :key="index" @click.stop="handleClick(item)">
|
|
75
|
+
<image
|
|
76
|
+
:style="{borderRadius: radius + 'rpx',width: bigWidth + 'rpx',height: bigHeight + 'rpx',}"
|
|
77
|
+
:src="item['image_url']"
|
|
78
|
+
mode="aspectFill"></image>
|
|
79
|
+
</swiper-item>
|
|
80
|
+
</swiper>
|
|
81
|
+
<!--#endif-->
|
|
82
|
+
<!--#ifdef H5-->
|
|
63
83
|
<xd-swiper
|
|
64
84
|
:indicator-dots="false"
|
|
65
85
|
:list="bigList"
|
|
@@ -71,15 +91,10 @@
|
|
|
71
91
|
@animationfinish="handleBigAnimationfinish"
|
|
72
92
|
>
|
|
73
93
|
<template slot-scope="{ item, index }">
|
|
74
|
-
<image
|
|
75
|
-
:style="{
|
|
76
|
-
borderRadius: radius + 'rpx',
|
|
77
|
-
}"
|
|
78
|
-
:src="item['image_url']"
|
|
79
|
-
mode="aspectFill"
|
|
80
|
-
></image>
|
|
94
|
+
<image :style="{borderRadius: radius + 'rpx',}" :src="item['image_url']" mode="aspectFill"></image>
|
|
81
95
|
</template>
|
|
82
96
|
</xd-swiper>
|
|
97
|
+
<!--#endif-->
|
|
83
98
|
</xd-swiper-dot>
|
|
84
99
|
<view v-if="isPreview" class="carousel-mask"></view>
|
|
85
100
|
</view>
|
|
@@ -112,7 +127,7 @@
|
|
|
112
127
|
}"
|
|
113
128
|
:src="topList[0].image_url"
|
|
114
129
|
mode="aspectFill"
|
|
115
|
-
></image
|
|
130
|
+
></image></view
|
|
116
131
|
></view>
|
|
117
132
|
<view
|
|
118
133
|
v-else
|
|
@@ -129,6 +144,26 @@
|
|
|
129
144
|
:mode="top_dot_type"
|
|
130
145
|
:dots-styles="topDotStyleData"
|
|
131
146
|
>
|
|
147
|
+
<!--#ifdef MP-WEIXIN-->
|
|
148
|
+
<swiper
|
|
149
|
+
:style="{width: bigWidth + 'rpx', height: smallHeight + 'rpx'}"
|
|
150
|
+
:indicator-dots="false"
|
|
151
|
+
:autoplay="topCarouselTime>0"
|
|
152
|
+
:interval="topCarouselTime"
|
|
153
|
+
:duration="500"
|
|
154
|
+
:current="current"
|
|
155
|
+
circular
|
|
156
|
+
@animationfinish="handleBigAnimationfinish"
|
|
157
|
+
>
|
|
158
|
+
<swiper-item v-for="(item,index) in topList" :key="index" @click.stop="handleClick(item)">
|
|
159
|
+
<image
|
|
160
|
+
:style="{borderRadius: radius + 'rpx',width: bigWidth + 'rpx',height: smallHeight + 'rpx',}"
|
|
161
|
+
:src="item['image_url']"
|
|
162
|
+
mode="aspectFill"></image>
|
|
163
|
+
</swiper-item>
|
|
164
|
+
</swiper>
|
|
165
|
+
<!--#endif-->
|
|
166
|
+
<!--#ifdef H5-->
|
|
132
167
|
<xd-swiper
|
|
133
168
|
:indicator-dots="false"
|
|
134
169
|
:list="topList"
|
|
@@ -140,17 +175,11 @@
|
|
|
140
175
|
@animationfinish="handleTopAnimationfinish"
|
|
141
176
|
>
|
|
142
177
|
<template slot-scope="{ item, index }">
|
|
143
|
-
<image
|
|
144
|
-
:style="{
|
|
145
|
-
borderRadius: topRadius + 'rpx',
|
|
146
|
-
}"
|
|
147
|
-
:src="item['image_url']"
|
|
148
|
-
mode="aspectFill"
|
|
149
|
-
></image>
|
|
178
|
+
<image :style="{borderRadius: topRadius + 'rpx',}" :src="item['image_url']" mode="aspectFill"></image>
|
|
150
179
|
</template>
|
|
151
180
|
</xd-swiper>
|
|
181
|
+
<!--#endif-->
|
|
152
182
|
</xd-swiper-dot>
|
|
153
|
-
|
|
154
183
|
<view v-if="isPreview" class="carousel-mask"></view>
|
|
155
184
|
</view>
|
|
156
185
|
</view>
|
|
@@ -193,6 +222,26 @@
|
|
|
193
222
|
:mode="bottom_dot_type"
|
|
194
223
|
:dots-styles="bottomDotStyleData"
|
|
195
224
|
>
|
|
225
|
+
<!--#ifdef MP-WEIXIN-->
|
|
226
|
+
<swiper
|
|
227
|
+
:style="{width: bigWidth + 'rpx', height: smallHeight + 'rpx'}"
|
|
228
|
+
:indicator-dots="false"
|
|
229
|
+
:autoplay="bottomCarouselTime>0"
|
|
230
|
+
:interval="bottomCarouselTime"
|
|
231
|
+
:duration="500"
|
|
232
|
+
:current="current"
|
|
233
|
+
circular
|
|
234
|
+
@animationfinish="handleBigAnimationfinish"
|
|
235
|
+
>
|
|
236
|
+
<swiper-item v-for="(item,index) in bottomList" :key="index" @click.stop="handleClick(item)">
|
|
237
|
+
<image
|
|
238
|
+
:style="{borderRadius: radius + 'rpx',width: bigWidth + 'rpx',height: smallHeight + 'rpx',}"
|
|
239
|
+
:src="item['image_url']"
|
|
240
|
+
mode="aspectFill"></image>
|
|
241
|
+
</swiper-item>
|
|
242
|
+
</swiper>
|
|
243
|
+
<!--#endif-->
|
|
244
|
+
<!--#ifdef H5-->
|
|
196
245
|
<xd-swiper
|
|
197
246
|
:indicator-dots="false"
|
|
198
247
|
:list="bottomList"
|
|
@@ -213,8 +262,8 @@
|
|
|
213
262
|
></image>
|
|
214
263
|
</template>
|
|
215
264
|
</xd-swiper>
|
|
265
|
+
<!--#endif-->
|
|
216
266
|
</xd-swiper-dot>
|
|
217
|
-
|
|
218
267
|
<view v-if="isPreview" class="carousel-mask"></view>
|
|
219
268
|
</view>
|
|
220
269
|
</view>
|
|
@@ -246,6 +295,7 @@ export default {
|
|
|
246
295
|
mixins: [componentsMixins, extsMixins, JfbBasePosterBigSmallMixin],
|
|
247
296
|
data() {
|
|
248
297
|
return {
|
|
298
|
+
params:{},
|
|
249
299
|
height: 0, //组件高度
|
|
250
300
|
mS: {
|
|
251
301
|
top: 0,
|
|
@@ -280,6 +330,7 @@ export default {
|
|
|
280
330
|
//大图
|
|
281
331
|
current: 0,
|
|
282
332
|
carouselTime: 5, //轮播图轮播周期
|
|
333
|
+
|
|
283
334
|
bigList: [],
|
|
284
335
|
number: null,
|
|
285
336
|
dot_type: "dot",
|
|
@@ -295,6 +346,7 @@ export default {
|
|
|
295
346
|
bottomRadius: 0, //小图上圆角
|
|
296
347
|
bottomCurrent: 0, //小图上
|
|
297
348
|
bottomIsCarousel: 1,
|
|
349
|
+
bottomCarouselTime:0,
|
|
298
350
|
|
|
299
351
|
//小图上
|
|
300
352
|
topList: [],
|
|
@@ -304,6 +356,7 @@ export default {
|
|
|
304
356
|
topCurrent: 0, //小图上
|
|
305
357
|
topIsCarousel: 1,
|
|
306
358
|
smallHeight: 0,
|
|
359
|
+
topCarouselTime:0,
|
|
307
360
|
|
|
308
361
|
timer: null,
|
|
309
362
|
|
|
@@ -467,6 +520,10 @@ export default {
|
|
|
467
520
|
};
|
|
468
521
|
return style[this.bottom_dot_type];
|
|
469
522
|
},
|
|
523
|
+
isShowAd(){
|
|
524
|
+
if(this.bigList.length === 0 && this.topList.length === 0 && this.bottomList.length === 0 ) return false
|
|
525
|
+
return true
|
|
526
|
+
},
|
|
470
527
|
},
|
|
471
528
|
watch: {
|
|
472
529
|
container(value,oloValue) {
|
|
@@ -499,6 +556,9 @@ export default {
|
|
|
499
556
|
if (res.list.length === 0 && this.isPreview) {
|
|
500
557
|
res.list = this.getTestData("big");
|
|
501
558
|
}
|
|
559
|
+
|
|
560
|
+
res.list = this.filterItem(res.list);
|
|
561
|
+
|
|
502
562
|
//将res.list中的image_url替换为服务地址
|
|
503
563
|
this.bigList =
|
|
504
564
|
res.list &&
|
|
@@ -513,6 +573,7 @@ export default {
|
|
|
513
573
|
.catch((error) => {
|
|
514
574
|
console.error(error);
|
|
515
575
|
});
|
|
576
|
+
|
|
516
577
|
//获取小图上列表
|
|
517
578
|
jfbRootExec("getListPosterContent", {
|
|
518
579
|
vm: this,
|
|
@@ -527,6 +588,9 @@ export default {
|
|
|
527
588
|
if (res.list.length === 0 && this.isPreview) {
|
|
528
589
|
res.list = this.getTestData("top");
|
|
529
590
|
}
|
|
591
|
+
|
|
592
|
+
res.list = this.filterItem(res.list);
|
|
593
|
+
|
|
530
594
|
//将res.list中的image_url替换为服务地址
|
|
531
595
|
this.topList =
|
|
532
596
|
res.list &&
|
|
@@ -541,6 +605,7 @@ export default {
|
|
|
541
605
|
.catch((error) => {
|
|
542
606
|
console.error(error);
|
|
543
607
|
});
|
|
608
|
+
|
|
544
609
|
//获取小图下列表
|
|
545
610
|
jfbRootExec("getListPosterContent", {
|
|
546
611
|
vm: this,
|
|
@@ -555,6 +620,9 @@ export default {
|
|
|
555
620
|
if (res.list.length === 0 && this.isPreview) {
|
|
556
621
|
res.list = this.getTestData("bottom");
|
|
557
622
|
}
|
|
623
|
+
|
|
624
|
+
res.list = this.filterItem(res.list);
|
|
625
|
+
|
|
558
626
|
//将res.list中的image_url替换为服务地址
|
|
559
627
|
this.bottomList =
|
|
560
628
|
res.list &&
|
|
@@ -579,65 +647,137 @@ export default {
|
|
|
579
647
|
handleBottomAnimationfinish(e) {
|
|
580
648
|
this.bottomCurrent = e.detail.current;
|
|
581
649
|
},
|
|
650
|
+
|
|
651
|
+
/**
|
|
652
|
+
* @description 过滤不可以用
|
|
653
|
+
* 当前项目未H5时,过滤所有小程序应用
|
|
654
|
+
* 当前项目未小程序时,过滤所有非当前小程序应用
|
|
655
|
+
* 站外地址直接返回
|
|
656
|
+
* 站内地址未选值直接返回
|
|
657
|
+
* 预览模式全过
|
|
658
|
+
*/
|
|
659
|
+
filterItem(list = []){
|
|
660
|
+
let content = list.filter(item=>{
|
|
661
|
+
//预览模式
|
|
662
|
+
if( this.$configProject.isPreview) return true;
|
|
663
|
+
|
|
664
|
+
//非内部应用
|
|
665
|
+
if(item.redirect_type !== 'INN') return true
|
|
666
|
+
|
|
667
|
+
//没有配置链接
|
|
668
|
+
if(!item.redirect_data) return true;
|
|
669
|
+
|
|
670
|
+
//内部应用
|
|
671
|
+
else {
|
|
672
|
+
let redirect_data;
|
|
673
|
+
try {
|
|
674
|
+
redirect_data = JSON.parse(item.redirect_data);
|
|
675
|
+
if(!item['app_type']) item['app_type']= 'h5';
|
|
676
|
+
|
|
677
|
+
//#ifdef H5
|
|
678
|
+
return item['app_type'] !== 'wxmp';
|
|
679
|
+
//#endif
|
|
680
|
+
|
|
681
|
+
//#ifdef MP-WEIXIN
|
|
682
|
+
let actDir = this.$parent.projectAttr.deploy_dir;
|
|
683
|
+
let dir = this.getPathDir(redirect_data.page);
|
|
684
|
+
if(item['app_type'] === 'wxmp'){
|
|
685
|
+
return actDir === dir;
|
|
686
|
+
}
|
|
687
|
+
else if(item['app_type'] === 'h5') return true;
|
|
688
|
+
else return true
|
|
689
|
+
//#endif
|
|
690
|
+
}
|
|
691
|
+
catch (e) {
|
|
692
|
+
return true
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
});
|
|
696
|
+
console.warn(`PostersList:${JSON.stringify(content.map(item=>`${item.app_type}:${item.content_name}:${item.redirect_data}`), null,2)}`)
|
|
697
|
+
return content;
|
|
698
|
+
|
|
699
|
+
},
|
|
700
|
+
|
|
701
|
+
getPathDir(pathDir){
|
|
702
|
+
if(pathDir.indexOf('@site_domain@/') === 0) {
|
|
703
|
+
return pathDir.replace('@site_domain@/','').split('/')[0]
|
|
704
|
+
}
|
|
705
|
+
return ''
|
|
706
|
+
},
|
|
707
|
+
|
|
582
708
|
handleClick(item) {
|
|
709
|
+
if(!item.redirect_data) {
|
|
710
|
+
console.warn(`未配置链接地址: ${item.redirect_data}`);
|
|
711
|
+
console.error(`未配置链接地址: ${item.redirect_data}`);
|
|
712
|
+
return
|
|
713
|
+
}
|
|
714
|
+
|
|
583
715
|
//内部链接跳转地址
|
|
584
|
-
if (item.redirect_type ===
|
|
716
|
+
if (item.redirect_type === 'INN') {
|
|
585
717
|
try {
|
|
586
718
|
let url = JSON.parse(item.redirect_data);
|
|
587
|
-
let params =
|
|
588
|
-
if
|
|
589
|
-
|
|
590
|
-
url: url.page + params
|
|
591
|
-
}
|
|
719
|
+
let params = '';
|
|
720
|
+
if(url.page) {
|
|
721
|
+
if (item['redirect_params']) params = `?${item['redirect_params']}`;
|
|
722
|
+
this.$xdUniHelper.navigateTo({url: url.page + params})
|
|
723
|
+
}
|
|
724
|
+
else {
|
|
725
|
+
console.error(`应用链接配置错误: ${url.page}`)
|
|
726
|
+
}
|
|
592
727
|
} catch (e) {
|
|
593
|
-
console.error(
|
|
728
|
+
console.error(`应用链接配置错误: ${item.redirect_data}`)
|
|
594
729
|
}
|
|
595
730
|
}
|
|
596
731
|
|
|
597
732
|
//外部链接
|
|
598
|
-
if (item.redirect_type ===
|
|
733
|
+
if (item.redirect_type === 'URL') {
|
|
599
734
|
let reg = /^(http:\/\/|https:\/\/|\/\/)+.+$/;
|
|
735
|
+
let spReg = /(-apiuri\/v)/;
|
|
600
736
|
//#ifdef MP-WEIXIN
|
|
601
737
|
try {
|
|
602
738
|
let url = JSON.parse(item.redirect_data);
|
|
603
|
-
if (reg.test(url.url)
|
|
604
|
-
console.warn(`广告跳转外站: ${url.url}`)
|
|
605
|
-
this.$xdUniHelper.navigateTo(
|
|
606
|
-
url: `${
|
|
607
|
-
this.$configProject.extras.webview
|
|
608
|
-
}?seatUrl=${Base64.encodeURI(url.url)}`,
|
|
609
|
-
});
|
|
739
|
+
if (reg.test(url.url) || spReg.test(url.url)) {
|
|
740
|
+
console.warn(`广告跳转外站: ${url.url}`)
|
|
741
|
+
this.$xdUniHelper.navigateTo(url);
|
|
610
742
|
} else {
|
|
611
|
-
|
|
743
|
+
console.error(`广告跳转外站配置错误: ${url.url}`)
|
|
612
744
|
}
|
|
613
745
|
} catch (e) {
|
|
614
|
-
console.error(
|
|
746
|
+
console.error(`广告跳转外站配置错误: ${item.redirect_data}`)
|
|
615
747
|
}
|
|
616
748
|
//#endif
|
|
617
749
|
//#ifdef H5
|
|
618
750
|
try {
|
|
619
751
|
let url = JSON.parse(item.redirect_data);
|
|
620
752
|
console.warn(`广告跳转外站: ${url.url}`);
|
|
621
|
-
this.$xdUniHelper.
|
|
753
|
+
this.$xdUniHelper.redirectTo(url, false)
|
|
622
754
|
} catch (e) {
|
|
623
|
-
console.error(
|
|
755
|
+
console.error(`广告跳转外站配置错误: ${item.redirect_data}`)
|
|
624
756
|
}
|
|
625
757
|
//#endif
|
|
758
|
+
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
//无跳转地址
|
|
762
|
+
if(item.redirect_type === 'EMP') {
|
|
763
|
+
console.warn(`无跳转地址`);
|
|
626
764
|
}
|
|
627
765
|
},
|
|
766
|
+
|
|
767
|
+
|
|
628
768
|
getTestData(type) {
|
|
629
769
|
let width;
|
|
630
770
|
let height;
|
|
631
771
|
// 根据type参数,设置width和height
|
|
632
|
-
if (type
|
|
772
|
+
if (type === "big") {
|
|
633
773
|
width = this.bigWidth;
|
|
634
774
|
height = this.bigHeight;
|
|
635
775
|
}
|
|
636
|
-
if (type
|
|
776
|
+
if (type === "top") {
|
|
637
777
|
width = this.bigWidth;
|
|
638
778
|
height = this.smallHeight;
|
|
639
779
|
}
|
|
640
|
-
if (type
|
|
780
|
+
if (type === "bottom") {
|
|
641
781
|
width = this.bigWidth;
|
|
642
782
|
height = this.smallHeight;
|
|
643
783
|
}
|
|
@@ -658,6 +798,7 @@ export default {
|
|
|
658
798
|
// 返回临时数组
|
|
659
799
|
return temp;
|
|
660
800
|
},
|
|
801
|
+
|
|
661
802
|
/**
|
|
662
803
|
* @description 监听事件变化
|
|
663
804
|
* @param container {object} 业务组件对象自己
|
|
@@ -744,6 +885,7 @@ export default {
|
|
|
744
885
|
getContainerPropsValue(container, "content.bottomCarouselTime", 5)
|
|
745
886
|
) * 1000;
|
|
746
887
|
},
|
|
888
|
+
|
|
747
889
|
onJfbUpdate(data) {
|
|
748
890
|
this.onJfbLoad(this.params);
|
|
749
891
|
}
|
|
@@ -122,50 +122,121 @@
|
|
|
122
122
|
this.init(this.container);
|
|
123
123
|
},
|
|
124
124
|
methods: {
|
|
125
|
-
|
|
125
|
+
/**
|
|
126
|
+
* @description 过滤不可以用
|
|
127
|
+
* 当前项目未H5时,过滤所有小程序应用
|
|
128
|
+
* 当前项目未小程序时,过滤所有非当前小程序应用
|
|
129
|
+
* 站外地址直接返回
|
|
130
|
+
* 站内地址未选值直接返回
|
|
131
|
+
* 预览模式全过
|
|
132
|
+
*/
|
|
133
|
+
filterItem(list){
|
|
134
|
+
let content = list.filter(item=>{
|
|
135
|
+
//预览模式
|
|
136
|
+
if( this.$configProject.isPreview) return true;
|
|
137
|
+
|
|
138
|
+
//非内部应用
|
|
139
|
+
if(item.redirect_type !== 'INN') return true
|
|
140
|
+
|
|
141
|
+
//没有配置链接
|
|
142
|
+
if(!item.redirect_data) return true;
|
|
143
|
+
|
|
144
|
+
//内部应用
|
|
145
|
+
else {
|
|
146
|
+
let redirect_data;
|
|
147
|
+
try {
|
|
148
|
+
redirect_data = JSON.parse(item.redirect_data);
|
|
149
|
+
if(!item['app_type']) item['app_type']= 'h5';
|
|
150
|
+
|
|
151
|
+
//#ifdef H5
|
|
152
|
+
return item['app_type'] !== 'wxmp';
|
|
153
|
+
//#endif
|
|
154
|
+
|
|
155
|
+
//#ifdef MP-WEIXIN
|
|
156
|
+
let actDir = this.projectAttr.deploy_dir;
|
|
157
|
+
let dir = this.getPathDir(redirect_data.page);
|
|
158
|
+
if(item['app_type'] === 'wxmp'){
|
|
159
|
+
return actDir === dir;
|
|
160
|
+
}
|
|
161
|
+
else if(item['app_type'] === 'h5') return true;
|
|
162
|
+
else return true
|
|
163
|
+
//#endif
|
|
164
|
+
}
|
|
165
|
+
catch (e) {
|
|
166
|
+
return true
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
console.warn(`PostTypeList:${JSON.stringify(content.map(item=>`${item.app_type}:${item.content_name}:${item.redirect_data}`), null,2)}`)
|
|
171
|
+
return content;
|
|
172
|
+
|
|
173
|
+
},
|
|
174
|
+
|
|
175
|
+
getPathDir(pathDir){
|
|
176
|
+
if(pathDir.indexOf('@site_domain@/') === 0) {
|
|
177
|
+
return pathDir.replace('@site_domain@/','').split('/')[0]
|
|
178
|
+
}
|
|
179
|
+
return ''
|
|
180
|
+
},
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
handleClick(item) {
|
|
184
|
+
if(!item.redirect_data) {
|
|
185
|
+
console.warn(`未配置链接地址: ${item.redirect_data}`);
|
|
186
|
+
console.error(`未配置链接地址: ${item.redirect_data}`);
|
|
187
|
+
return
|
|
188
|
+
}
|
|
189
|
+
|
|
126
190
|
//内部链接跳转地址
|
|
127
|
-
if(item.redirect_type === 'INN') {
|
|
128
|
-
try{
|
|
191
|
+
if (item.redirect_type === 'INN') {
|
|
192
|
+
try {
|
|
129
193
|
let url = JSON.parse(item.redirect_data);
|
|
130
194
|
let params = '';
|
|
131
|
-
if(
|
|
132
|
-
|
|
133
|
-
url: url.page + params
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
|
|
195
|
+
if(url.page) {
|
|
196
|
+
if (item['redirect_params']) params = `?${item['redirect_params']}`;
|
|
197
|
+
this.$xdUniHelper.navigateTo({url: url.page + params})
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
console.error(`应用链接配置错误: ${url.page}`)
|
|
201
|
+
}
|
|
202
|
+
} catch (e) {
|
|
203
|
+
console.error(`应用链接配置错误: ${item.redirect_data}`)
|
|
137
204
|
}
|
|
138
205
|
}
|
|
139
206
|
|
|
140
207
|
//外部链接
|
|
141
|
-
if(item.redirect_type === 'URL') {
|
|
208
|
+
if (item.redirect_type === 'URL') {
|
|
142
209
|
let reg = /^(http:\/\/|https:\/\/|\/\/)+.+$/;
|
|
210
|
+
let spReg = /(-apiuri\/v)/;
|
|
143
211
|
//#ifdef MP-WEIXIN
|
|
144
212
|
try {
|
|
145
213
|
let url = JSON.parse(item.redirect_data);
|
|
146
|
-
if(reg.test(url.url)
|
|
214
|
+
if (reg.test(url.url) || spReg.test(url.url)) {
|
|
147
215
|
console.warn(`广告跳转外站: ${url.url}`)
|
|
148
|
-
this.$xdUniHelper.navigateTo(
|
|
149
|
-
url: `${this.$configProject.extras.webview}?seatUrl=${Base64.encodeURI(url.url)}`
|
|
150
|
-
});
|
|
216
|
+
this.$xdUniHelper.navigateTo(url);
|
|
151
217
|
} else {
|
|
152
|
-
|
|
218
|
+
console.error(`广告跳转外站配置错误: ${url.url}`)
|
|
153
219
|
}
|
|
154
220
|
} catch (e) {
|
|
155
|
-
console.error(
|
|
221
|
+
console.error(`广告跳转外站配置错误: ${item.redirect_data}`)
|
|
156
222
|
}
|
|
157
223
|
//#endif
|
|
158
224
|
//#ifdef H5
|
|
159
225
|
try {
|
|
160
226
|
let url = JSON.parse(item.redirect_data);
|
|
161
227
|
console.warn(`广告跳转外站: ${url.url}`);
|
|
162
|
-
this.$xdUniHelper.
|
|
228
|
+
this.$xdUniHelper.redirectTo(url, false)
|
|
163
229
|
} catch (e) {
|
|
164
|
-
console.error(
|
|
230
|
+
console.error(`广告跳转外站配置错误: ${item.redirect_data}`)
|
|
165
231
|
}
|
|
166
232
|
//#endif
|
|
167
233
|
|
|
168
234
|
}
|
|
235
|
+
|
|
236
|
+
//无跳转地址
|
|
237
|
+
if(item.redirect_type === 'EMP') {
|
|
238
|
+
console.warn(`无跳转地址`);
|
|
239
|
+
}
|
|
169
240
|
},
|
|
170
241
|
|
|
171
242
|
getTestData() {
|
|
@@ -212,8 +283,7 @@
|
|
|
212
283
|
}
|
|
213
284
|
}
|
|
214
285
|
|
|
215
|
-
|
|
216
|
-
this.list = list;
|
|
286
|
+
this.list = this.filterItem(list);
|
|
217
287
|
this.noData = this.list.length === 0;
|
|
218
288
|
})
|
|
219
289
|
.catch(error => {
|