jufubao-base 1.0.157-beta4 → 1.0.157-beta5

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-base",
3
- "version": "1.0.157-beta4",
3
+ "version": "1.0.157-beta5",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -66,7 +66,7 @@
66
66
  this.init(this.container);
67
67
  },
68
68
  methods: {
69
-
69
+
70
70
  /**
71
71
  * @description 监听事件变化
72
72
  * @param container {object} 业务组件对象自己
@@ -80,7 +80,7 @@
80
80
  this.shadow = (e.scrollTop > this.height ? this.height : e.scrollTop)/100;
81
81
  this.opacity = opacity < this.minOpacity ? this.minOpacity : opacity;
82
82
  },
83
-
83
+
84
84
  onJfbBack() {
85
85
  this.$xdUniHelper.navigateBack();
86
86
  }
@@ -102,7 +102,7 @@
102
102
  height: unit(90, rpx);
103
103
  padding: 0 unit(10, rpx);
104
104
  position: relative;
105
-
105
+
106
106
  &-icon {
107
107
  width: 1em;
108
108
  height: 1em;
@@ -112,13 +112,12 @@
112
112
  display: flex;
113
113
  justify-content: center;
114
114
  align-content: center;
115
- align-items: center;
116
115
  flex-shrink: 0;
117
116
  position: relative;
118
117
  z-index: 2;
119
118
  background: #fff;
120
119
  }
121
-
120
+
122
121
  &-text {
123
122
  font-size: unit(54, rpx);
124
123
  padding-right: 1em;
@@ -126,7 +125,7 @@
126
125
  position: relative;
127
126
  z-index: 2;
128
127
  color: #666;
129
-
128
+
130
129
  & > view {
131
130
  width: 100%;
132
131
  text-align: center;
@@ -134,7 +133,7 @@
134
133
  font-size: unit(32, rpx);
135
134
  }
136
135
  }
137
-
136
+
138
137
  &-bg {
139
138
  background: #fff;
140
139
  position: absolute;
@@ -20,7 +20,7 @@
20
20
  <view>
21
21
  <view
22
22
  class="jfb-base-card-sweep-info__body-info"
23
- v-for="(item, index) in valueKey"
23
+ v-for="(item, index) in showValueKey"
24
24
  :key="index"
25
25
  >
26
26
  <view class="jfb-base-card-sweep-info__body-info-label">{{item.label}}</view>
@@ -129,6 +129,12 @@ export default {
129
129
  return this.is_show_balance === "Y";
130
130
  }
131
131
  return true;
132
+ },
133
+ showValueKey(){
134
+ if(this.info.is_expired === "Y"){
135
+ return this.valueKey.filter(item => item.key !== "end_time");
136
+ }
137
+ return this.valueKey;
132
138
  }
133
139
  },
134
140
  created() {
@@ -7,28 +7,6 @@ export default {
7
7
  style: [],
8
8
  content: (data) => {
9
9
  return [
10
- {
11
- label: '选择综合入口类型:',
12
- ele: 'xd-site-select-list',
13
- valueKey: 'entryType',
14
- value: data['entryType'],
15
- placeholder: '请选择综合入口类型',
16
- multiple: false,
17
- groupKey:'content',
18
- className: 'input50',
19
- rules: [
20
- {required: true, message: '请选择综合入口类型', trigger: ['blur', 'change']}
21
- ],
22
- handleCustom({action, data}) {
23
- XdBus.getParentApi('getEntryGroupOption')({key: Date.now()})
24
- .then(res => {
25
- data.cb(res.list)
26
- })
27
- .catch(error => {
28
- console.error(error);
29
- });
30
- },
31
- },
32
10
  {
33
11
  label: '每行显示数量',
34
12
  ele: 'xd-radio',
@@ -49,7 +49,7 @@
49
49
  import componentsMixins from "@/mixins/componentsMixins";
50
50
  import extsMixins from "@/mixins/extsMixins";
51
51
  import getServiceUrl from "@/common/getServiceUrl";
52
- import {mapState} from "vuex";
52
+ import {base64} from 'js-base64';
53
53
  export default {
54
54
  name: "JfbBaseEntry",
55
55
  components: {
@@ -66,11 +66,9 @@
66
66
  paddingInput: 20,
67
67
  loadingList: true,
68
68
  margin: {},
69
- entryType: '',
70
69
  }
71
70
  },
72
71
  computed: {
73
- ...mapState(['brandInfo']),
74
72
  bodyStyle(){
75
73
  return {
76
74
  backgroundColor: this.bgcolor,
@@ -113,67 +111,17 @@
113
111
  this.rowNum = getContainerPropsValue(container, 'content.rowNum', 1);
114
112
  this.paddingInput = getContainerPropsValue(container, 'content.paddingInput', 20);
115
113
  this.margin = getContainerPropsValue(container, 'content.margin', {});
116
- this.entryType = getContainerPropsValue(container, 'content.entryType', 'default');
117
- },
118
-
119
- getCardPath(custom_redirect_data = {}){
120
- //#ifdef H5
121
- return null;
122
- //#endif
123
- //#ifdef MP-WEIXIN
124
- const dir = custom_redirect_data.dir;
125
- const actDir = this.projectAttr['deploy_dir'];
126
- if(custom_redirect_data.appType === 'wxmp') {
127
- if(dir === actDir) {
128
- return {
129
- cardPath: custom_redirect_data.path,
130
- cardSelf: 'wxmp',
131
- };
132
- }
133
- else return null;
134
- }
135
- else if(custom_redirect_data.appType === 'h5'){
136
- return {
137
- cardPath: custom_redirect_data.site_url,
138
- cardSelf: 'h5',
139
- };
140
- }
141
- else return null;
142
- //#endif
143
114
  },
144
115
  getEntrySetting(){
145
116
  this.$xdShowLoading({});
146
117
  jfbRootExec("getEntrySetting", {
147
118
  vm: this,
148
- data: {
149
- group_id:this.entryType || 'default'
150
- }
119
+ data: {}
151
120
  }).then(res => {
152
121
  this.loadingList = false;
153
122
  this.$xdHideLoading();
154
- let isH5FilterEntryList = [];
155
- let isMpFilterEntryList = [];
156
- this.entryList = res.list.filter(item=>{
157
- //#ifdef H5
158
- //在H5平台应用中不可跳转到微信小程序应用
159
- if(item.redirect_data.appType === 'wxmp'){
160
- isH5FilterEntryList.push(item)
161
- }
162
- return item.redirect_data.appType !== 'wxmp';
163
- //#endif
164
-
165
- //#ifdef MP-WEIXIN
166
- const dir = item['redirect_data'].dir;
167
- const actDir = this.projectAttr['deploy_dir'];
168
- if(item.redirect_data.appType === 'wxmp') {
169
- if(dir !== actDir) isMpFilterEntryList.push(item)
170
- return dir === actDir;
171
- }
172
- return true
173
- //#endif
174
- }).map(item => {
175
- const {dir, path, host,appType} = item['redirect_data'];
176
- if(appType === undefined) item.redirect_data.appType = 'h5';
123
+ this.entryList = res.list.map(item => {
124
+ const {dir, path, host} = item['redirect_data'];
177
125
  item['image_url'] = getServiceUrl(item.image_url);
178
126
  item['image_url2'] = item.image_url2 ? getServiceUrl(item.image_url2) : "";
179
127
  item['image_url3'] = item.image_url3 ? getServiceUrl(item.image_url3) : "";
@@ -191,35 +139,24 @@
191
139
  let jumpUrl = path;
192
140
 
193
141
  //域名相同并且应用路径不相同时候处理
194
- if(host === this.projectAttr.host && this.projectAttr['deploy_dir'] !== dir){
142
+ if(host === this.projectAttr.host
143
+ && this.projectAttr['deploy_dir'] !== dir
144
+ ){
195
145
  jumpUrl = `//${host}/${dir}${path}`;
196
146
  //#ifdef MP-WEIXIN
197
147
  jumpUrl = `https:${jumpUrl}`;
198
148
  //#endif
199
149
  }
200
150
 
201
- //获取自定义卡券登录地址(微信小程序跳转到H5平台起作用)
202
- let cardPathStr = '';
203
- //#ifdef MP-WEIXIN
204
- if(item.redirect_data.appType === 'h5') {
205
- const custom_redirect_data = this.$xdUniHelper.checkVarType(item['custom_redirect_data']) === 'object'?item['custom_redirect_data']:{};
206
- const cardPathObject = this.getCardPath(custom_redirect_data);
207
- if(cardPathObject !== null) {
208
- const {cardPath, cardSelf} =cardPathObject
209
- if(cardPath) cardPathStr = `&card-login=${encodeURIComponent(cardPath)}&cardSelf=${cardSelf}`
210
- }
151
+ if(item['redirect_data']['fixed_business_code'] === '') {
152
+ item['redirect_data']['path'] = `${jumpUrl}?x-common=${nsp}&vs=${new Date().getTime()}`
153
+ }
154
+ else{
155
+ item['redirect_data']['path'] = `${jumpUrl}?x-common=${nsp}&vs=${new Date().getTime()}`
211
156
  }
212
- //#endif
213
- item['redirect_data']['path'] = `${jumpUrl}?x-common=${nsp}&vs=${new Date().getTime()}${cardPathStr}`
214
157
  return item;
215
158
  });
216
- //#ifdef MP-WEIXIN
217
- console.warn(`微信小程序端被过滤的入口列表:${JSON.stringify(isMpFilterEntryList.map(item=> `${item.redirect_data.appType}:${item.entry_name}:${item.redirect_data['frontPath']}`),null,2)}`)
218
- //#endif
219
- //#ifdef H5
220
- console.warn(`H5端被过滤的入口列表:${JSON.stringify(isH5FilterEntryList.map(item=> `${item.redirect_data.appType}:${item.entry_name}:${item.redirect_data['frontPath']}`),null,2)}`)
221
- //#endif
222
- console.warn(`福利入口链接列表:${JSON.stringify(this.entryList.map(item=> `${item.redirect_data.appType}:${item.redirect_data['path']}`),null,2)}`);
159
+ console.log( this.entryList)
223
160
  if(res.list.length === 1) this.toLink(this.entryList[0]);
224
161
  if(res.list.length === 0) {
225
162
  this.$xdAlert({content: '当前票券暂无支持服务'})
@@ -261,6 +261,8 @@ export default {
261
261
  {"label": "滚动显示", "value": '2'},
262
262
  {"label": "弹窗显示", "value": '3'},
263
263
  ],
264
+ inline:false,
265
+ notice:'预览模式点击使用“<span style="color:red">弹窗显示</span>”会重新触发页面刷新,可点击弹出遮罩层进行关闭功能'
264
266
  },
265
267
  {
266
268
  label: '是否隐藏弹框(仅预览模式生效):',
@@ -235,13 +235,7 @@
235
235
  this.speedKey = Date.now()
236
236
  }, 400)
237
237
 
238
- },
239
- is_hide_dailog(value){
240
- if(value === 'N') {
241
- storage.remove(this.containerId);
242
- this.onJfbLoad();
243
- }
244
- },
238
+ }
245
239
  },
246
240
  computed:{
247
241
  marginUi() {
@@ -287,6 +281,13 @@
287
281
  return this.num > 1
288
282
  },
289
283
 
284
+ is_hide_dailog(value){
285
+ if(value === 'N') {
286
+ storage.remove(this.containerId);
287
+ this.onJfbLoad();
288
+ }
289
+ },
290
+
290
291
  },
291
292
  created() {
292
293
  this.backgroundColor = Color(this.warningColor).alpha(0.2).toString();
@@ -15,6 +15,7 @@
15
15
  <!-- #endif -->
16
16
  <view class="jfb-base-poster__body" v-if="noData">
17
17
  <view class="x-line"></view>
18
+
18
19
  <view class="jfb-base-poster-cont" :style="getBodyStyle">
19
20
  <!--一分屏-->
20
21
  <template v-if="posterType === '1'">
@@ -49,7 +50,6 @@
49
50
  }"
50
51
  >
51
52
  <xd-swiper-dot
52
- :style="{width: getOneWidth + 'rpx', height: getOneHeight + 'rpx'}"
53
53
  v-if="pageSwiperShow"
54
54
  :current="current"
55
55
  :info="info"
@@ -57,24 +57,6 @@
57
57
  :mode="mode"
58
58
  :dots-styles="dotStyleData"
59
59
  >
60
- <!--#ifdef MP-WEIXIN-->
61
- <swiper
62
- class="swiper xd-swiper-content"
63
- :style="{width: getOneWidth + 'rpx', height: getOneHeight + 'rpx'}"
64
- :indicator-dots="false"
65
- :autoplay="carouselTime>0"
66
- :interval="carouselTime"
67
- :duration="500"
68
- :current="current"
69
- circular
70
- @animationfinish="handleAnimationfinish"
71
- >
72
- <swiper-item v-for="(item,index) in info" :key="index" @click.stop="handleClick(item,index)">
73
- <image :style="{width: getOneWidth + 'rpx', height: getOneHeight + 'rpx'}" :src="item['image_url']" mode="aspectFill"></image>
74
- </swiper-item>
75
- </swiper>
76
- <!--#endif-->
77
- <!--#ifdef H5-->
78
60
  <xd-swiper
79
61
  :indicator-dots="false"
80
62
  :list="info"
@@ -89,7 +71,6 @@
89
71
  <image :src="item['image_url']" mode="aspectFill"></image>
90
72
  </template>
91
73
  </xd-swiper>
92
- <!--#endif-->
93
74
  </xd-swiper-dot>
94
75
  <view v-if="isPreview" class="carousel-mask"></view>
95
76
  </view>
@@ -97,7 +78,6 @@
97
78
  <!--一分屏-->
98
79
  <!--多分屏-->
99
80
  <more-screen
100
- style="width: 100%; height: 100%"
101
81
  v-if="posterType !== '1'"
102
82
  :config="getConfig"
103
83
  :content="info"
@@ -178,11 +158,11 @@
178
158
  backgroundSize: '100%',
179
159
  backgroundRepeat: 'no-repeat',
180
160
  }
181
- image = Object.assign({},image,{
161
+ return {
162
+ ...image,
182
163
  margin: this.margin,
183
164
  padding: this.outPadding
184
- })
185
- return this.styleObjectToString(image)
165
+ }
186
166
  },
187
167
  getOneWidth(){
188
168
  let margin = this.checkValue(this.mS.left, 0) + this.checkValue(this.mS.right, 0);
@@ -352,9 +332,9 @@
352
332
  },
353
333
  },
354
334
  created() {
335
+ this.init(this.container);
355
336
  this.isPreview = this.$configProject.isPreview;
356
337
  this.pageSwiperShow = this.$root.$isShow;
357
- this.init(this.container);
358
338
  },
359
339
 
360
340
  destroyed() {
@@ -365,63 +345,6 @@
365
345
  },
366
346
 
367
347
  methods: {
368
- /**
369
- * @description 过滤不可以用
370
- * 当前项目未H5时,过滤所有小程序应用
371
- * 当前项目未小程序时,过滤所有非当前小程序应用
372
- * 站外地址直接返回
373
- * 站内地址未选值直接返回
374
- * 预览模式全过
375
- */
376
- filterItem(list){
377
- let content = list.filter(item=>{
378
- //预览模式
379
- if( this.$configProject.isPreview) return true;
380
-
381
- //非内部应用
382
- if(item.redirect_type !== 'INN') return true
383
-
384
- //没有配置链接
385
- if(!item.redirect_data) return true;
386
-
387
- //内部应用
388
- else {
389
- let redirect_data;
390
- try {
391
- redirect_data = JSON.parse(item.redirect_data);
392
- if(!item['app_type']) item['app_type']= 'h5';
393
-
394
- //#ifdef H5
395
- return item['app_type'] !== 'wxmp';
396
- //#endif
397
-
398
- //#ifdef MP-WEIXIN
399
- let actDir = this.$parent.projectAttr.deploy_dir;
400
- let dir = this.getPathDir(redirect_data.page);
401
- if(item['app_type'] === 'wxmp'){
402
- return actDir === dir;
403
- }
404
- else if(item['app_type'] === 'h5') return true;
405
- else return true
406
- //#endif
407
- }
408
- catch (e) {
409
- return true
410
- }
411
- }
412
- });
413
- console.warn(`PostersList:${JSON.stringify(content.map(item=>`${item.app_type}:${item.content_name}:${item.redirect_data}`), null,2)}`)
414
- return content;
415
-
416
- },
417
-
418
- getPathDir(pathDir){
419
- if(pathDir.indexOf('@site_domain@/') === 0) {
420
- return pathDir.replace('@site_domain@/','').split('/')[0]
421
- }
422
- return ''
423
- },
424
-
425
348
  getTestData(){
426
349
  let temp = [];
427
350
  for (let i = 0; i< this.useNumber; i++) {
@@ -459,28 +382,18 @@
459
382
  this.current = e.detail.current;
460
383
  }
461
384
  },
462
-
463
385
  handleClick(item) {
464
- if(!item.redirect_data) {
465
- console.warn(`未配置链接地址: ${item.redirect_data}`);
466
- console.error(`未配置链接地址: ${item.redirect_data}`);
467
- return
468
- }
469
-
470
386
  //内部链接跳转地址
471
387
  if (item.redirect_type === 'INN') {
472
388
  try {
473
389
  let url = JSON.parse(item.redirect_data);
474
390
  let params = '';
475
- if(url.page) {
476
- if (item['redirect_params']) params = `?${item['redirect_params']}`;
477
- this.$xdUniHelper.navigateTo({url: url.page + params})
478
- }
479
- else {
480
- console.error(`应用链接配置错误: ${url.page}`)
481
- }
391
+ if (item['redirect_params']) params = `?${item['redirect_params']}`;
392
+ this.$xdUniHelper.navigateTo({
393
+ url: url.page + params
394
+ })
482
395
  } catch (e) {
483
- console.error(`应用链接配置错误: ${item.redirect_data}`)
396
+ console.error(e)
484
397
  }
485
398
  }
486
399
 
@@ -490,38 +403,31 @@
490
403
  //#ifdef MP-WEIXIN
491
404
  try {
492
405
  let url = JSON.parse(item.redirect_data);
493
- if (reg.test(url.url)) {
406
+ if (reg.test(url.url) && this.$configProject.extras.webview) {
494
407
  console.warn(`广告跳转外站: ${url.url}`)
495
- this.$xdUniHelper.navigateTo(url);
408
+ this.$xdUniHelper.navigateTo({
409
+ url: `${this.$configProject.extras.webview}?seatUrl=${Base64.encodeURI(url.url)}`
410
+ });
496
411
  } else {
497
- console.error(`广告跳转外站配置错误: ${url.url}`)
412
+ throw Error('地址错误')
498
413
  }
499
414
  } catch (e) {
500
- console.error(`广告跳转外站配置错误: ${item.redirect_data}`)
415
+ console.error(e)
501
416
  }
502
417
  //#endif
503
418
  //#ifdef H5
504
419
  try {
505
420
  let url = JSON.parse(item.redirect_data);
506
421
  console.warn(`广告跳转外站: ${url.url}`);
507
- this.$xdUniHelper.redirectTo(url, false)
422
+ this.$xdUniHelper.navigateTo(url)
508
423
  } catch (e) {
509
- console.error(`广告跳转外站配置错误: ${item.redirect_data}`)
424
+ console.error(e)
510
425
  }
511
426
  //#endif
512
427
 
513
428
  }
514
-
515
- //无跳转地址
516
- if(item.redirect_type === 'EMP') {
517
- console.warn(`无跳转地址`);
518
- }
519
429
  },
520
-
521
-
522
430
  handleImage(list){
523
- list = this.filterItem(list);
524
-
525
431
  return list.map((item,index) => {
526
432
  return {
527
433
  ...item,
@@ -557,11 +463,6 @@
557
463
  this.isCarousel = getContainerPropsValue(container, 'content.isCarousel', 1);
558
464
  this.radius = getContainerPropsValue(container, 'content.radius', 0);
559
465
  this.padding = getContainerPropsValue(container, 'content.padding', 0);
560
-
561
- //静态图,一分屏并且间距为0设置
562
- if(this.isCarousel === 1 && this.posterType === '1' && this.padding === 0) {
563
- this.padding = 20;
564
- }
565
466
  this.rows = getContainerPropsValue(container, 'content.rows', 1);
566
467
  if(this.posterType === '1' && this.isCarousel === 2) this.isSupport = getContainerPropsValue(container, 'content.isSupport', 'Y');
567
468
  this.mS = getContainerPropsValue(container, 'content.margin', {});