jufubao-base 1.0.220-beta4 → 1.0.221-beta101
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 +2 -2
- package/src/components/JfbBaseOrderList/JfbBaseOrderList.vue +5 -2
- package/src/components/JfbBasePoster/JfbBasePoster.vue +22 -109
- package/src/components/JfbBasePoster/MoreScreen.vue +62 -113
- package/src/components/JfbBasePosterBigSmall/JfbBasePosterBigSmall.vue +9 -105
- package/src/components/JfbBasePosterEntry/JfbBasePosterEntry.vue +8 -114
- package/src/components/JfbBasePosterType/FourScreen.vue +4 -116
- package/src/components/JfbBasePosterType/JfbBasePosterType.vue +1 -1
- package/src/mixins/componentsMixins.js +127 -28
- package/src/mixins/posterMixins.js +143 -31
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jufubao-base",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.221-beta101",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "聚福宝业务组件基础插件包",
|
|
6
6
|
"main": "index.js",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"dingtalk-jsapi": "^3.0.31",
|
|
52
52
|
"flyio": "^0.6.2",
|
|
53
53
|
"gxd-commands-bussiness": "^1.0.12",
|
|
54
|
-
"gxd-uni-library-editx": "1.0.17-
|
|
54
|
+
"gxd-uni-library-editx": "1.0.17-beta99",
|
|
55
55
|
"jweixin-module": "^1.6.0",
|
|
56
56
|
"md5": "^2.3.0",
|
|
57
57
|
"path-to-regexp": "^6.2.1",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
:key="Sitem.key"
|
|
98
98
|
v-if="(item['isOpen'] === false && Sindex < showLen) || item['isOpen']"
|
|
99
99
|
>
|
|
100
|
-
<image :src="Sitem.product_thumb" style="background: #ffffff" mode="aspectFit"></image>
|
|
100
|
+
<image :src="setImageCdnUrl(Sitem.product_thumb)" style="background: #ffffff" mode="aspectFit"></image>
|
|
101
101
|
<view class="jfb-base-order-list__body-order-item-content-info">
|
|
102
102
|
<view class="jfb-base-order-list__body-order-item-content-info-name">{{ Sitem.product_name }}</view>
|
|
103
103
|
<view class="brand-name" v-if="Sitem.brand_name" :style="{color:brandTextColor}">{{ Sitem.brand_name }}</view>
|
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
marginBottom: padding + 'rpx',
|
|
179
179
|
}"
|
|
180
180
|
>
|
|
181
|
-
<xd-tfk-order-item
|
|
181
|
+
<xd-tfk-order-item
|
|
182
182
|
:mainColor="mainColor"
|
|
183
183
|
:isShowOrderNo="isShowOrderNo"
|
|
184
184
|
:brandTextColor="brandTextColor"
|
|
@@ -307,6 +307,9 @@ export default {
|
|
|
307
307
|
this.init(this.container);
|
|
308
308
|
},
|
|
309
309
|
methods: {
|
|
310
|
+
setImageCdnUrl(url){
|
|
311
|
+
return getServiceUrl(url,'size4')
|
|
312
|
+
},
|
|
310
313
|
getKey(id, index){
|
|
311
314
|
return id + index;
|
|
312
315
|
},
|
|
@@ -121,6 +121,7 @@
|
|
|
121
121
|
import { jfbRootExec } from "@/utils/xd.event";
|
|
122
122
|
import JfbBasePosterMixin from "./JfbBasePosterMixin";
|
|
123
123
|
import componentsMixins from "@/mixins/componentsMixins";
|
|
124
|
+
import posterMixins from "@/mixins/posterMixins";
|
|
124
125
|
import extsMixins from "@/mixins/extsMixins"
|
|
125
126
|
import { getContainerPropsValue } from "@/utils/xd.base";
|
|
126
127
|
import getServiceUrl from '@/common/getServiceUrl'
|
|
@@ -138,7 +139,7 @@
|
|
|
138
139
|
MoreScreen,
|
|
139
140
|
XdSwiperDot
|
|
140
141
|
},
|
|
141
|
-
mixins: [componentsMixins,extsMixins,JfbBasePosterMixin],
|
|
142
|
+
mixins: [componentsMixins,extsMixins,JfbBasePosterMixin,posterMixins],
|
|
142
143
|
data() {
|
|
143
144
|
return {
|
|
144
145
|
selfMask: false,
|
|
@@ -380,56 +381,6 @@
|
|
|
380
381
|
},
|
|
381
382
|
|
|
382
383
|
methods: {
|
|
383
|
-
/**
|
|
384
|
-
* @description 过滤不可以用
|
|
385
|
-
* 当前项目未H5时,过滤所有小程序应用
|
|
386
|
-
* 当前项目未小程序时,过滤所有非当前小程序应用
|
|
387
|
-
* 站外地址直接返回
|
|
388
|
-
* 站内地址未选值直接返回
|
|
389
|
-
* 预览模式全过
|
|
390
|
-
*/
|
|
391
|
-
filterItem(list){
|
|
392
|
-
let content = list.filter(item=>{
|
|
393
|
-
//预览模式
|
|
394
|
-
if( this.$configProject.isPreview) return true;
|
|
395
|
-
|
|
396
|
-
//非内部应用
|
|
397
|
-
if(item.redirect_type !== 'INN') return true
|
|
398
|
-
|
|
399
|
-
//没有配置链接
|
|
400
|
-
if(!item.redirect_data) return true;
|
|
401
|
-
|
|
402
|
-
//内部应用
|
|
403
|
-
else {
|
|
404
|
-
let redirect_data;
|
|
405
|
-
try {
|
|
406
|
-
redirect_data = JSON.parse(item.redirect_data);
|
|
407
|
-
if(!item['app_type']) item['app_type']= 'h5';
|
|
408
|
-
|
|
409
|
-
//#ifdef H5
|
|
410
|
-
return item['app_type'] !== 'wxmp';
|
|
411
|
-
//#endif
|
|
412
|
-
|
|
413
|
-
//#ifdef MP-WEIXIN
|
|
414
|
-
let actDir = this.$parent.projectAttr.deploy_dir;
|
|
415
|
-
let dir = this.getPathDir(redirect_data.page);
|
|
416
|
-
if(item['app_type'] === 'wxmp'){
|
|
417
|
-
return actDir === dir;
|
|
418
|
-
}
|
|
419
|
-
else if(item['app_type'] === 'h5') return true;
|
|
420
|
-
else return true
|
|
421
|
-
//#endif
|
|
422
|
-
}
|
|
423
|
-
catch (e) {
|
|
424
|
-
return true
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
});
|
|
428
|
-
console.warn(`PostersList:${JSON.stringify(content.map(item=>`${item.app_type}:${item.content_name}:${item.redirect_data}`), null,2)}`)
|
|
429
|
-
return content;
|
|
430
|
-
|
|
431
|
-
},
|
|
432
|
-
|
|
433
384
|
getPathDir(pathDir){
|
|
434
385
|
if(pathDir.indexOf('@site_domain@/') === 0) {
|
|
435
386
|
return pathDir.replace('@site_domain@/','').split('/')[0]
|
|
@@ -481,74 +432,36 @@
|
|
|
481
432
|
}
|
|
482
433
|
},
|
|
483
434
|
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
let url = JSON.parse(item.redirect_data);
|
|
495
|
-
let params = '';
|
|
496
|
-
if(url.page) {
|
|
497
|
-
if (item['redirect_params']) params = `?${item['redirect_params']}`;
|
|
498
|
-
this.$xdUniHelper.navigateTo({url: url.page + params})
|
|
499
|
-
}
|
|
500
|
-
else {
|
|
501
|
-
console.error(`应用链接配置错误: ${url.page}`)
|
|
502
|
-
}
|
|
503
|
-
} catch (e) {
|
|
504
|
-
console.error(`应用链接配置错误: ${item.redirect_data}`)
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
//外部链接
|
|
509
|
-
if (item.redirect_type === 'URL') {
|
|
510
|
-
let reg = /^(http:\/\/|https:\/\/|\/\/)+.+$/;
|
|
511
|
-
let spReg = /(-apiuri\/v)/;
|
|
512
|
-
//#ifdef MP-WEIXIN
|
|
513
|
-
try {
|
|
514
|
-
let url = JSON.parse(item.redirect_data);
|
|
515
|
-
if (reg.test(url.url) || spReg.test(url.url)) {
|
|
516
|
-
console.warn(`广告跳转外站: ${url.url}`)
|
|
517
|
-
this.$xdUniHelper.navigateTo(url);
|
|
518
|
-
} else {
|
|
519
|
-
console.error(`广告跳转外站配置错误: ${url.url}`)
|
|
520
|
-
}
|
|
521
|
-
} catch (e) {
|
|
522
|
-
console.error(`广告跳转外站配置错误: ${item.redirect_data}`)
|
|
523
|
-
}
|
|
524
|
-
//#endif
|
|
525
|
-
//#ifdef H5
|
|
526
|
-
try {
|
|
527
|
-
let url = JSON.parse(item.redirect_data);
|
|
528
|
-
console.warn(`广告跳转外站: ${url.url}`);
|
|
529
|
-
this.$xdUniHelper.redirectTo(url, false)
|
|
530
|
-
} catch (e) {
|
|
531
|
-
console.error(`广告跳转外站配置错误: ${item.redirect_data}`)
|
|
532
|
-
}
|
|
533
|
-
//#endif
|
|
534
|
-
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
//无跳转地址
|
|
538
|
-
if(item.redirect_type === 'EMP') {
|
|
539
|
-
console.warn(`无跳转地址`);
|
|
540
|
-
}
|
|
435
|
+
/**
|
|
436
|
+
* @description 过滤不可以用
|
|
437
|
+
* 当前项目未H5时,过滤所有小程序应用
|
|
438
|
+
* 当前项目未小程序时,过滤所有非当前小程序应用
|
|
439
|
+
* 站外地址直接返回
|
|
440
|
+
* 站内地址未选值直接返回
|
|
441
|
+
* 预览模式全过
|
|
442
|
+
*/
|
|
443
|
+
filterItem(list){
|
|
444
|
+
return this.filterPosterItem(list);
|
|
541
445
|
},
|
|
542
446
|
|
|
447
|
+
handleClick(item) {
|
|
448
|
+
if(this.isPreview) return;
|
|
449
|
+
this.handlePosterClick(item)
|
|
450
|
+
},
|
|
543
451
|
|
|
544
452
|
handleImage(list){
|
|
545
453
|
list = this.filterItem(list);
|
|
454
|
+
let size = 'size8';
|
|
455
|
+
if(Number(this.posterType) === 2) size = 'size5';
|
|
456
|
+
if(Number(this.posterType) === 3) size = 'size3';
|
|
457
|
+
if(Number(this.posterType) === 4) size = 'size2';
|
|
458
|
+
console.log(this.posterType,size)
|
|
546
459
|
|
|
547
460
|
return list.map((item,index) => {
|
|
548
461
|
return {
|
|
549
462
|
...item,
|
|
550
463
|
image_background_url: item.image_background_url?getServiceUrl(item.image_background_url):'',
|
|
551
|
-
image_url: item.image_url?getServiceUrl(item.image_url):''
|
|
464
|
+
image_url: item.image_url?getServiceUrl(item.image_url,size):''
|
|
552
465
|
}
|
|
553
466
|
})
|
|
554
467
|
},
|
|
@@ -117,6 +117,7 @@
|
|
|
117
117
|
<script>
|
|
118
118
|
import XdSwiperDot from "./XdSwiperDot";
|
|
119
119
|
import XdSwiper from "@/components/XdSwiper/XdSwiper";
|
|
120
|
+
import posterMixins from "@/mixins/posterMixins";
|
|
120
121
|
|
|
121
122
|
export default {
|
|
122
123
|
components:{
|
|
@@ -124,6 +125,7 @@
|
|
|
124
125
|
XdSwiper
|
|
125
126
|
},
|
|
126
127
|
name: "MoreScreen",
|
|
128
|
+
mixins:[posterMixins],
|
|
127
129
|
props: {
|
|
128
130
|
config: {
|
|
129
131
|
type: Object,
|
|
@@ -178,62 +180,6 @@
|
|
|
178
180
|
this.current = e.detail.current;
|
|
179
181
|
},
|
|
180
182
|
|
|
181
|
-
/**
|
|
182
|
-
* @description 过滤不可以用
|
|
183
|
-
* 当前项目未H5时,过滤所有小程序应用
|
|
184
|
-
* 当前项目未小程序时,过滤所有非当前小程序应用
|
|
185
|
-
* 站外地址直接返回
|
|
186
|
-
* 站内地址未选值直接返回
|
|
187
|
-
* 预览模式全过
|
|
188
|
-
*/
|
|
189
|
-
filterItem(){
|
|
190
|
-
let content = this.content.filter(item=>{
|
|
191
|
-
//预览模式
|
|
192
|
-
if( this.$configProject.isPreview) return true;
|
|
193
|
-
|
|
194
|
-
//非内部应用
|
|
195
|
-
if(item.redirect_type !== 'INN') return true
|
|
196
|
-
|
|
197
|
-
//没有配置链接
|
|
198
|
-
if(!item.redirect_data) return true;
|
|
199
|
-
|
|
200
|
-
//内部应用
|
|
201
|
-
else {
|
|
202
|
-
let redirect_data;
|
|
203
|
-
try {
|
|
204
|
-
redirect_data = JSON.parse(item.redirect_data);
|
|
205
|
-
if(!item['app_type']) item['app_type']= 'h5';
|
|
206
|
-
|
|
207
|
-
//#ifdef H5
|
|
208
|
-
return item['app_type'] !== 'wxmp';
|
|
209
|
-
//#endif
|
|
210
|
-
|
|
211
|
-
//#ifdef MP-WEIXIN
|
|
212
|
-
let actDir = this.$parent.projectAttr.deploy_dir;
|
|
213
|
-
let dir = this.getPathDir(redirect_data.page);
|
|
214
|
-
if(item['app_type'] === 'wxmp'){
|
|
215
|
-
return actDir === dir;
|
|
216
|
-
}
|
|
217
|
-
else if(item['app_type'] === 'h5') return true;
|
|
218
|
-
else return true
|
|
219
|
-
//#endif
|
|
220
|
-
}
|
|
221
|
-
catch (e) {
|
|
222
|
-
return true
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
|
-
console.warn(`PostersList:${JSON.stringify(content.map(item=>`${item.app_type}:${item.content_name}:${item.redirect_data}`), null,2)}`)
|
|
227
|
-
return content;
|
|
228
|
-
|
|
229
|
-
},
|
|
230
|
-
|
|
231
|
-
getPathDir(pathDir){
|
|
232
|
-
if(pathDir.indexOf('@site_domain@/') === 0) {
|
|
233
|
-
return pathDir.replace('@site_domain@/','').split('/')[0]
|
|
234
|
-
}
|
|
235
|
-
return ''
|
|
236
|
-
},
|
|
237
183
|
|
|
238
184
|
init() {
|
|
239
185
|
if (this.timer) clearTimeout(this.timer);
|
|
@@ -243,7 +189,7 @@
|
|
|
243
189
|
this.padding = Number(this.config.padding);
|
|
244
190
|
|
|
245
191
|
//过滤不可以用
|
|
246
|
-
const content = this.
|
|
192
|
+
const content = this.filterPosterItem(this.$xdUniHelper.cloneDeep(this.content));
|
|
247
193
|
|
|
248
194
|
//静态图显示
|
|
249
195
|
if(this.config.isCarousel === 1) {
|
|
@@ -263,62 +209,65 @@
|
|
|
263
209
|
},
|
|
264
210
|
|
|
265
211
|
handleClick(item) {
|
|
266
|
-
if(
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
212
|
+
if(this.config.isPreview) return;
|
|
213
|
+
|
|
214
|
+
this.handlePosterClick(item);
|
|
215
|
+
// if(!item.redirect_data) {
|
|
216
|
+
// console.warn(`未配置链接地址: ${item.redirect_data}`);
|
|
217
|
+
// console.error(`未配置链接地址: ${item.redirect_data}`);
|
|
218
|
+
// return
|
|
219
|
+
// }
|
|
220
|
+
//
|
|
221
|
+
// //内部链接跳转地址
|
|
222
|
+
// if (item.redirect_type === 'INN') {
|
|
223
|
+
// try {
|
|
224
|
+
// let url = JSON.parse(item.redirect_data);
|
|
225
|
+
// let params = '';
|
|
226
|
+
// if(url.page) {
|
|
227
|
+
// if (item['redirect_params']) params = `?${item['redirect_params']}`;
|
|
228
|
+
// this.$xdUniHelper.navigateTo({url: url.page + params})
|
|
229
|
+
// }
|
|
230
|
+
// else {
|
|
231
|
+
// console.error(`应用链接配置错误: ${url.page}`)
|
|
232
|
+
// }
|
|
233
|
+
// } catch (e) {
|
|
234
|
+
// console.error(`应用链接配置错误: ${item.redirect_data}`)
|
|
235
|
+
// }
|
|
236
|
+
// }
|
|
237
|
+
//
|
|
238
|
+
// //外部链接
|
|
239
|
+
// if (item.redirect_type === 'URL') {
|
|
240
|
+
// let reg = /^(http:\/\/|https:\/\/|\/\/)+.+$/;
|
|
241
|
+
// let spReg = /(-apiuri\/v)/;
|
|
242
|
+
// //#ifdef MP-WEIXIN
|
|
243
|
+
// try {
|
|
244
|
+
// let url = JSON.parse(item.redirect_data);
|
|
245
|
+
// if (reg.test(url.url) || spReg.test(url.url)) {
|
|
246
|
+
// console.warn(`广告跳转外站: ${url.url}`)
|
|
247
|
+
// this.$xdUniHelper.navigateTo(url);
|
|
248
|
+
// } else {
|
|
249
|
+
// console.error(`广告跳转外站配置错误: ${url.url}`)
|
|
250
|
+
// }
|
|
251
|
+
// } catch (e) {
|
|
252
|
+
// console.error(`广告跳转外站配置错误: ${item.redirect_data}`)
|
|
253
|
+
// }
|
|
254
|
+
// //#endif
|
|
255
|
+
// //#ifdef H5
|
|
256
|
+
// try {
|
|
257
|
+
// let url = JSON.parse(item.redirect_data);
|
|
258
|
+
// console.warn(`广告跳转外站: ${url.url}`);
|
|
259
|
+
// this.$xdUniHelper.redirectTo(url, false)
|
|
260
|
+
// } catch (e) {
|
|
261
|
+
// console.error(`广告跳转外站配置错误: ${item.redirect_data}`)
|
|
262
|
+
// }
|
|
263
|
+
// //#endif
|
|
264
|
+
//
|
|
265
|
+
// }
|
|
266
|
+
//
|
|
267
|
+
// //无跳转地址
|
|
268
|
+
// if(item.redirect_type === 'EMP') {
|
|
269
|
+
// console.warn(`无跳转地址`);
|
|
270
|
+
// }
|
|
322
271
|
},
|
|
323
272
|
}
|
|
324
273
|
}
|
|
@@ -282,6 +282,7 @@ import JfbBasePosterBigSmallMixin from "./JfbBasePosterBigSmallMixin";
|
|
|
282
282
|
import { getContainerPropsValue } from "@/utils/xd.base";
|
|
283
283
|
import componentsMixins from "@/mixins/componentsMixins";
|
|
284
284
|
import extsMixins from "@/mixins/extsMixins";
|
|
285
|
+
import posterMixins from "@/mixins/posterMixins";
|
|
285
286
|
import XdSwiper from "@/components/XdSwiper/XdSwiper";
|
|
286
287
|
import XdSwiperDot from "./XdSwiperDot";
|
|
287
288
|
import getServiceUrl from "@/common/getServiceUrl";
|
|
@@ -293,7 +294,7 @@ export default {
|
|
|
293
294
|
XdSwiper,
|
|
294
295
|
XdSwiperDot,
|
|
295
296
|
},
|
|
296
|
-
mixins: [componentsMixins, extsMixins, JfbBasePosterBigSmallMixin],
|
|
297
|
+
mixins: [componentsMixins, extsMixins, JfbBasePosterBigSmallMixin, posterMixins],
|
|
297
298
|
data() {
|
|
298
299
|
return {
|
|
299
300
|
params:{},
|
|
@@ -529,6 +530,7 @@ export default {
|
|
|
529
530
|
},
|
|
530
531
|
},
|
|
531
532
|
created() {
|
|
533
|
+
debugger
|
|
532
534
|
this.init(this.container);
|
|
533
535
|
this.isPreview = this.$configProject.isPreview;
|
|
534
536
|
},
|
|
@@ -553,7 +555,7 @@ export default {
|
|
|
553
555
|
res.list = this.filterItem(res.list);
|
|
554
556
|
if(res.list && res.list.length > 0 ) {
|
|
555
557
|
this.bigList = res.list.map((item) => {
|
|
556
|
-
item.image_url = item.image_url ? getServiceUrl(item.image_url) : "";
|
|
558
|
+
item.image_url = item.image_url ? getServiceUrl(item.image_url,'size5') : "";
|
|
557
559
|
return item;
|
|
558
560
|
});
|
|
559
561
|
}
|
|
@@ -579,7 +581,7 @@ export default {
|
|
|
579
581
|
res.list = this.filterItem(res.list);
|
|
580
582
|
if(res.list && res.list.length > 0 ){
|
|
581
583
|
this.topList = res.list.map((item) => {
|
|
582
|
-
item.image_url = item.image_url ? getServiceUrl(item.image_url) : "";
|
|
584
|
+
item.image_url = item.image_url ? getServiceUrl(item.image_url, 'size5') : "";
|
|
583
585
|
return item;
|
|
584
586
|
})
|
|
585
587
|
}
|
|
@@ -605,7 +607,7 @@ export default {
|
|
|
605
607
|
res.list = this.filterItem(res.list);
|
|
606
608
|
if(res.list && res.list.length > 0){
|
|
607
609
|
this.bottomList = res.list.map((item) => {
|
|
608
|
-
item.image_url = item.image_url ? getServiceUrl(item.image_url) : "";
|
|
610
|
+
item.image_url = item.image_url ? getServiceUrl(item.image_url, 'size5') : "";
|
|
609
611
|
return item;
|
|
610
612
|
});
|
|
611
613
|
}
|
|
@@ -633,111 +635,13 @@ export default {
|
|
|
633
635
|
* 预览模式全过
|
|
634
636
|
*/
|
|
635
637
|
filterItem(list = []){
|
|
636
|
-
|
|
637
|
-
//预览模式
|
|
638
|
-
if( this.$configProject.isPreview) return true;
|
|
639
|
-
|
|
640
|
-
//非内部应用
|
|
641
|
-
if(item.redirect_type !== 'INN') return true
|
|
642
|
-
|
|
643
|
-
//没有配置链接
|
|
644
|
-
if(!item.redirect_data) return true;
|
|
645
|
-
|
|
646
|
-
//内部应用
|
|
647
|
-
else {
|
|
648
|
-
let redirect_data;
|
|
649
|
-
try {
|
|
650
|
-
redirect_data = JSON.parse(item.redirect_data);
|
|
651
|
-
if(!item['app_type']) item['app_type']= 'h5';
|
|
652
|
-
|
|
653
|
-
//#ifdef H5
|
|
654
|
-
return item['app_type'] !== 'wxmp';
|
|
655
|
-
//#endif
|
|
656
|
-
|
|
657
|
-
//#ifdef MP-WEIXIN
|
|
658
|
-
let actDir = this.$parent.projectAttr.deploy_dir;
|
|
659
|
-
let dir = this.getPathDir(redirect_data.page);
|
|
660
|
-
if(item['app_type'] === 'wxmp'){
|
|
661
|
-
return actDir === dir;
|
|
662
|
-
}
|
|
663
|
-
else if(item['app_type'] === 'h5') return true;
|
|
664
|
-
else return true
|
|
665
|
-
//#endif
|
|
666
|
-
}
|
|
667
|
-
catch (e) {
|
|
668
|
-
return true
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
});
|
|
672
|
-
console.warn(`PostersList:${JSON.stringify(content.map(item=>`${item.app_type}:${item.content_name}:${item.redirect_data}`), null,2)}`)
|
|
673
|
-
return content;
|
|
674
|
-
|
|
638
|
+
return this.filterPosterItem(this.$xdUniHelper.cloneDeep(list))
|
|
675
639
|
},
|
|
676
640
|
|
|
677
|
-
getPathDir(pathDir){
|
|
678
|
-
if(pathDir.indexOf('@site_domain@/') === 0) {
|
|
679
|
-
return pathDir.replace('@site_domain@/','').split('/')[0]
|
|
680
|
-
}
|
|
681
|
-
return ''
|
|
682
|
-
},
|
|
683
641
|
|
|
684
642
|
handleClick(item) {
|
|
685
|
-
if(
|
|
686
|
-
|
|
687
|
-
console.error(`未配置链接地址: ${item.redirect_data}`);
|
|
688
|
-
return
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
//内部链接跳转地址
|
|
692
|
-
if (item.redirect_type === 'INN') {
|
|
693
|
-
try {
|
|
694
|
-
let url = JSON.parse(item.redirect_data);
|
|
695
|
-
let params = '';
|
|
696
|
-
if(url.page) {
|
|
697
|
-
if (item['redirect_params']) params = `?${item['redirect_params']}`;
|
|
698
|
-
this.$xdUniHelper.navigateTo({url: url.page + params})
|
|
699
|
-
}
|
|
700
|
-
else {
|
|
701
|
-
console.error(`应用链接配置错误: ${url.page}`)
|
|
702
|
-
}
|
|
703
|
-
} catch (e) {
|
|
704
|
-
console.error(`应用链接配置错误: ${item.redirect_data}`)
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
|
|
708
|
-
//外部链接
|
|
709
|
-
if (item.redirect_type === 'URL') {
|
|
710
|
-
let reg = /^(http:\/\/|https:\/\/|\/\/)+.+$/;
|
|
711
|
-
let spReg = /(-apiuri\/v)/;
|
|
712
|
-
//#ifdef MP-WEIXIN
|
|
713
|
-
try {
|
|
714
|
-
let url = JSON.parse(item.redirect_data);
|
|
715
|
-
if (reg.test(url.url) || spReg.test(url.url)) {
|
|
716
|
-
console.warn(`广告跳转外站: ${url.url}`)
|
|
717
|
-
this.$xdUniHelper.navigateTo(url);
|
|
718
|
-
} else {
|
|
719
|
-
console.error(`广告跳转外站配置错误: ${url.url}`)
|
|
720
|
-
}
|
|
721
|
-
} catch (e) {
|
|
722
|
-
console.error(`广告跳转外站配置错误: ${item.redirect_data}`)
|
|
723
|
-
}
|
|
724
|
-
//#endif
|
|
725
|
-
//#ifdef H5
|
|
726
|
-
try {
|
|
727
|
-
let url = JSON.parse(item.redirect_data);
|
|
728
|
-
console.warn(`广告跳转外站: ${url.url}`);
|
|
729
|
-
this.$xdUniHelper.redirectTo(url, false)
|
|
730
|
-
} catch (e) {
|
|
731
|
-
console.error(`广告跳转外站配置错误: ${item.redirect_data}`)
|
|
732
|
-
}
|
|
733
|
-
//#endif
|
|
734
|
-
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
//无跳转地址
|
|
738
|
-
if(item.redirect_type === 'EMP') {
|
|
739
|
-
console.warn(`无跳转地址`);
|
|
740
|
-
}
|
|
643
|
+
if(this.isPreview) return;
|
|
644
|
+
this.handlePosterClick(item);
|
|
741
645
|
},
|
|
742
646
|
|
|
743
647
|
|