jufubao-base 1.0.157-beta2 → 1.0.157-beta4

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.
@@ -37,8 +37,54 @@
37
37
  field="content_name"
38
38
  :mode="config.mode"
39
39
  :dots-styles="config.dotStyleData"
40
- :style="{height: (getHeight) + 'px'}"
40
+ :style="{height: (getHeight) + 'px', width:'100%'}"
41
41
  >
42
+ <!--#ifdef MP-WEIXIN-->
43
+ <swiper
44
+ class="swiper xd-swiper-content"
45
+ :style="{width: '100%', height: getHeight + 'px'}"
46
+ :indicator-dots="false"
47
+ :autoplay="config.carouselTime > 0"
48
+ :interval="config.carouselTime"
49
+ :duration="500"
50
+ :current="current"
51
+ circular
52
+ @animationfinish="handleAnimationfinish"
53
+ >
54
+ <swiper-item
55
+ v-for="(item,index) in list"
56
+ :key="index"
57
+ :style="{width: '100%', height: getHeight + 'px'}"
58
+ >
59
+ <view
60
+ class="sreen__box-list"
61
+ :class="{
62
+ cell4: config.cells === 4,
63
+ cell5: config.cells === 5,
64
+ }"
65
+ :style="{ height: getHeight + 'px'}"
66
+ >
67
+ <view
68
+ v-for="it in item"
69
+ :key="it['content_id']"
70
+ :style="{height: boxHeight + 'px'}"
71
+ @click="handleClick(it)"
72
+ >
73
+ <view :style="{ height: height + 'px'}">
74
+ <view :style="{
75
+ borderRadius: config.radius + 'rpx',
76
+ boxShadow: config.shadow === 1? `0 0 10rpx rgba(0, 0, 0, .5)` : '',
77
+ }">
78
+ <image :src="it.image_url"></image>
79
+ </view>
80
+ </view>
81
+ <view v-if="it['content_name']" :style="{color: config.textColor}">{{it['content_name']}}</view>
82
+ </view>
83
+ </view>
84
+ </swiper-item>
85
+ </swiper>
86
+ <!--#endif-->
87
+ <!--#ifdef H5-->
42
88
  <xd-swiper
43
89
  :indicator-dots="false"
44
90
  :interval="config.carouselTime"
@@ -81,6 +127,7 @@
81
127
  </view>
82
128
  </template>
83
129
  </xd-swiper>
130
+ <!--#endif-->
84
131
  </xd-swiper-dot>
85
132
  </view>
86
133
  </view>
@@ -115,12 +162,22 @@
115
162
  padding: 0,
116
163
  status: false,
117
164
  list: [],
165
+ filterContentList:[],
118
166
  isPreview: false,
119
167
  current: 0,
120
168
  }
121
169
  },
122
170
  computed:{
123
171
  getHeight() {
172
+ let len = this.filterContentList.length
173
+ //不足一行数量,设置高度
174
+ if(len > 0 && len <= this.config.cells * 1){
175
+ return this.height + this.rpxText
176
+ }
177
+ //不足二行数量,设置高度
178
+ if(len > this.config.cells && len <= this.config.cells * 2 && this.config.jdRows >=2){
179
+ return this.height * 2 + this.rpxText * 2
180
+ }
124
181
  return this.height * this.config.jdRows + this.rpxText * this.config.jdRows;
125
182
  },
126
183
  rpxText(){
@@ -162,35 +219,50 @@
162
219
  if( this.$configProject.isPreview) return true;
163
220
 
164
221
  //非内部应用
165
- if(item.redirect_type !== 'INN') {
166
- return true
167
- }
222
+ if(item.redirect_type !== 'INN') return true
223
+
224
+ //没有配置链接
225
+ if(!item.redirect_data) return true;
168
226
 
169
227
  //内部应用
170
228
  else {
171
229
  let redirect_data;
172
230
  try {
173
231
  redirect_data = JSON.parse(item.redirect_data);
174
- if(!redirect_data.appType) redirect_data.appType = 'h5'
232
+ if(!item['app_type']) item['app_type']= 'h5';
233
+
175
234
  //#ifdef H5
176
- return redirect_data.appType !== 'wxmp';
235
+ return item['app_type'] !== 'wxmp';
177
236
  //#endif
178
237
 
179
238
  //#ifdef MP-WEIXIN
180
- console.log(redirect_data,item,this.$parent.projectAttr)
181
- debugger
239
+ let actDir = this.$parent.projectAttr.deploy_dir;
240
+ let dir = this.getPathDir(redirect_data.page);
241
+ if(item['app_type'] === 'wxmp'){
242
+ return actDir === dir;
243
+ }
244
+ else if(item['app_type'] === 'h5') return true;
245
+ else return true
182
246
  //#endif
183
- } catch (e) {
184
- console.error(e)
247
+ }
248
+ catch (e) {
185
249
  return true
186
250
  }
187
251
  }
188
252
  });
189
- console.log(content)
253
+ console.warn(`PostTypeLists:${JSON.stringify(content.map(item=>`${item.app_type}:${item.content_name}:${item.redirect_data}`), null,2)}`)
254
+ this.filterContentList = this.$xdUniHelper.checkVarType(content);
190
255
  return content;
191
256
 
192
257
  },
193
258
 
259
+ getPathDir(pathDir){
260
+ if(pathDir.indexOf('@site_domain@/') === 0) {
261
+ return pathDir.replace('@site_domain@/','').split('/')[0]
262
+ }
263
+ return ''
264
+ },
265
+
194
266
  init() {
195
267
  if (this.timer) clearTimeout(this.timer);
196
268
  this.timer = setTimeout(() => {
@@ -221,18 +293,28 @@
221
293
 
222
294
  }, 100)
223
295
  },
296
+
224
297
  handleClick(item) {
298
+ if(!item.redirect_data) {
299
+ console.warn(`未配置链接地址: ${item.redirect_data}`);
300
+ console.error(`未配置链接地址: ${item.redirect_data}`);
301
+ return
302
+ }
303
+
225
304
  //内部链接跳转地址
226
305
  if (item.redirect_type === 'INN') {
227
306
  try {
228
307
  let url = JSON.parse(item.redirect_data);
229
308
  let params = '';
230
- if (item['redirect_params']) params = `?${item['redirect_params']}`;
231
- this.$xdUniHelper.navigateTo({
232
- url: url.page + params
233
- })
309
+ if(url.page) {
310
+ if (item['redirect_params']) params = `?${item['redirect_params']}`;
311
+ this.$xdUniHelper.navigateTo({url: url.page + params})
312
+ }
313
+ else {
314
+ console.error(`应用链接配置错误: ${url.page}`)
315
+ }
234
316
  } catch (e) {
235
- console.error(e)
317
+ console.error(`应用链接配置错误: ${item.redirect_data}`)
236
318
  }
237
319
  }
238
320
 
@@ -242,29 +324,32 @@
242
324
  //#ifdef MP-WEIXIN
243
325
  try {
244
326
  let url = JSON.parse(item.redirect_data);
245
- if (reg.test(url.url) && this.$configProject.extras.webview) {
327
+ if (reg.test(url.url)) {
246
328
  console.warn(`广告跳转外站: ${url.url}`)
247
- this.$xdUniHelper.navigateTo({
248
- url: `${this.$configProject.extras.webview}?seatUrl=${Base64.encodeURI(url.url)}`
249
- });
329
+ this.$xdUniHelper.navigateTo(url);
250
330
  } else {
251
- throw Error('地址错误')
331
+ console.error(`广告跳转外站配置错误: ${url.url}`)
252
332
  }
253
333
  } catch (e) {
254
- console.error(e)
334
+ console.error(`广告跳转外站配置错误: ${item.redirect_data}`)
255
335
  }
256
336
  //#endif
257
337
  //#ifdef H5
258
338
  try {
259
339
  let url = JSON.parse(item.redirect_data);
260
340
  console.warn(`广告跳转外站: ${url.url}`);
261
- this.$xdUniHelper.navigateTo(url)
341
+ this.$xdUniHelper.redirectTo(url, false)
262
342
  } catch (e) {
263
- console.error(e)
343
+ console.error(`广告跳转外站配置错误: ${item.redirect_data}`)
264
344
  }
265
345
  //#endif
266
346
 
267
347
  }
348
+
349
+ //无跳转地址
350
+ if(item.redirect_type === 'EMP') {
351
+ console.warn(`无跳转地址`);
352
+ }
268
353
  },
269
354
  }
270
355
  }
@@ -273,6 +358,7 @@
273
358
  <style scoped lang="less">
274
359
  .sreen {
275
360
  width: calc(100% + 2px); /**防止宽度不够问**/
361
+ height: 100%;
276
362
  position: relative;
277
363
 
278
364
  & .carousel-mask {
@@ -287,6 +373,7 @@
287
373
 
288
374
  &__box.notCarousel {
289
375
  width: 100%;
376
+ height: 100%;
290
377
  display: flex;
291
378
  justify-content: flex-start;
292
379
  align-items: flex-start;
@@ -379,6 +466,8 @@
379
466
  }
380
467
 
381
468
  &__box.carousel {
469
+ width: 100%;
470
+ height: 100%;
382
471
  display: flex;
383
472
  justify-content: flex-start;
384
473
  align-items: flex-start;
@@ -387,6 +476,8 @@
387
476
  }
388
477
 
389
478
  & .sreen__box-list {
479
+ width: 100%;
480
+ height: 100%;
390
481
  display: flex;
391
482
  justify-content: flex-start;
392
483
  align-items: flex-start;
@@ -16,6 +16,7 @@
16
16
  <view class="jfb-base-video__body">
17
17
  <view class="x-line"></view>
18
18
  <view
19
+ v-if="isShow"
19
20
  class="x-video"
20
21
  :style="{
21
22
  backgroundColor:bgColor,
@@ -26,14 +27,13 @@
26
27
  height:contentHeight + 'rpx'
27
28
  }"
28
29
  >
29
-
30
30
  <xd-video
31
31
  v-if="video !== null && video !== ''"
32
32
  :key="videoKey"
33
33
  :poster="videoSetting"
34
34
  :video="video"
35
35
  ></xd-video>
36
- <view class="not-video" v-if="video === ''">
36
+ <view class="not-video" v-if="isPreview && video === ''">
37
37
  <image :src="getVideoSrc"></image>
38
38
  </view>
39
39
  </view>
@@ -59,7 +59,7 @@
59
59
  mixins: [componentsMixins,extsMixins,JfbBaseVideoMixin],
60
60
  data() {
61
61
  return {
62
- selfMask: true,
62
+ isPreview: false,
63
63
  page_size: 1,
64
64
  options:{},
65
65
 
@@ -72,10 +72,14 @@
72
72
  width:750,
73
73
  bgColor:'',
74
74
  radius:0,
75
- videoKey : Date.now()
75
+ videoKey : Date.now(),
76
76
  }
77
77
  },
78
78
  computed: {
79
+ isShow(){
80
+ if(this.isPreview) return true;
81
+ else return this.video
82
+ },
79
83
  iconFont(){
80
84
  if(this.autoplay === 'N') return 'iconplayright'
81
85
  if(this.autoplay === 'E') return 'iconshibai';