jufubao-base 1.0.212-beta101 → 1.0.212

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.
@@ -15,12 +15,16 @@
15
15
  <!-- #endif -->
16
16
  <view class="jfb-base-poster-type__body" v-if="noData">
17
17
  <view class="x-line"></view>
18
- <view class="jfb-base-poster-cont" :style="[bodyStyleComp]">
19
- <four-screen
20
- style="width: 100%;"
21
- :config="getConfig"
22
- :content="info"
23
- ></four-screen>
18
+ <view
19
+ class="jfb-base-poster-cont"
20
+ :style="{
21
+ margin: margin,
22
+ padding:contentPaddingOut,
23
+ backgroundColor: bgColor,
24
+ borderRadius: bgRadius + 'rpx'
25
+ }"
26
+ >
27
+ <four-screen style="width: 100%;" :config="getConfig" :content="info"></four-screen>
24
28
  </view>
25
29
 
26
30
  </view>
@@ -52,13 +56,7 @@
52
56
  mixins: [componentsMixins,extsMixins,JfbBasePosterTypeMixin],
53
57
  data() {
54
58
  return {
55
- //closeMask: true,
56
59
  params: {},
57
- noData:false,
58
- timer: null,
59
- info: [],
60
- isPreview: false,
61
-
62
60
  //Swiper 配置
63
61
  posterPosition: null,
64
62
  current: 0,
@@ -66,134 +64,76 @@
66
64
  isCarousel: true, //是否轮播图
67
65
  carouselTime: 5,//轮播图轮播周期
68
66
  useNumber: null, //广告使用张数
69
- mode:'round',//索引样式
70
- row: 1, //行
71
- column: 4, //列
72
- columnSpacing:0,
73
-
74
- //icon样式设置
75
- contShadow:{},
67
+ padding: 0, //广告内容之间间距
68
+ jdRows: 1, //行
69
+ cells: 4, //列
70
+ shadow: false, //是否设置阴影
71
+ shadowColor:'rgba(0,0,0,.3)',
76
72
  radius: '20', //10/20/40 , 小/中/大
77
- iconMargin:20,
78
- titleStyle:{},
73
+ timer: null,
74
+ info: [],
75
+ mS: {},
76
+ iconPadding:{},
77
+ contentPadding:{},
78
+ isPreview: false,
79
+ noData:false,
79
80
 
80
81
  //颜色设置
81
- margin: {},
82
- contentPadding:{},
82
+ textColor: '#333',
83
83
  bgColor:'rgba(0,0,0,0)',
84
84
  bgRadius: 0,
85
85
  }
86
86
  },
87
87
  computed: {
88
- dotStyleData(){
89
- return this.dotStyleDataConf[this.mode];
90
- },
91
- dotStyleDataConf(){
92
- let alpha = 0.6;
93
- let selectedColor = `rgba(${color(this.mainColor).alpha(alpha).array().join(',')})`;
94
- let textColor = `rgba(${color(this.mainColor).alpha(0.2).array().join(',')})`;
95
- return {
96
- dot: {
97
- backgroundColor: 'rgba(166,166,166,.5)',
98
- border: '0px rgba(166,166,166,.5) solid',
99
- color: '#fff',
100
- selectedBackgroundColor: selectedColor,
101
- selectedBorder: `0px this.mainColor solid`
102
- },
103
- default: {
104
- width: 16,
105
- backgroundColor: 'rgba(200,200,200,.45)',
106
- border: '1px rgba(200,200,200,.45) solid',
107
- color: '#fff',
108
- selectedBackgroundColor: selectedColor,
109
- selectedBorder: `1px this.mainColor solid`
110
- },
111
- round: {
112
- backgroundColor: 'rgba(166,166,166,.5)',
113
- border: '0px rgba(166,166,166,.5) solid',
114
- color: '#fff',
115
- selectedBackgroundColor: selectedColor,
116
- selectedBorder: `0px this.mainColor solid`
117
- },
118
- nav: {
119
- backgroundColor: selectedColor,
120
- border: '1px rgba(0,0,0,.2) solid',
121
- color: '#fff',
122
- selectedBackgroundColor: selectedColor,
123
- selectedBorder: '1px rgba(255, 255, 255 1) solid'
124
- },
125
- indexes: {
126
- backgroundColor: textColor,
127
- border: '0px rgba(0,0,0,.2) solid',
128
- color: '#fff',
129
- selectedBackgroundColor: selectedColor,
130
- selectedBorder: '0px rgba(0,0,0,.8) solid',
131
- selectedColor: '#fff',
132
- }
133
- }
134
- },
135
88
  getConfig(){
89
+ let width = uni.getSystemInfoSync().safeArea.width -
90
+ (this.checkValue(this.mS.left, 0) + this.checkValue(this.mS.right, 0)) * this.$rpxNum;
91
+ width = width -
92
+ (this.checkValue(this.contentPadding.left, 0) + this.checkValue(this.contentPadding.right, 0)) * this.$rpxNum;
136
93
  return {
137
- mode:this.mode,
138
- isCarousel: this.isCarousel, //焦点图|轮播
139
- carouselTime: this.carouselTime, //轮播周期速度
140
- row: this.row,
141
- isPreview: this.isPreview,
142
- column: this.column,
143
- iconStyleComp: this.iconStyleComp,
144
- iconItemStyleComp: this.iconItemStyleComp,
145
- iconItemBoxStyleComp: this.iconItemBoxStyleComp,
146
- height: this.iconWH.height,
147
- width: this.iconWH.width,
148
- titleStyle: this.titleStyle,
149
- dotStyleData: this.dotStyleData
94
+ mode: 'normal',
95
+ dotStyleData: this.dotStyleData,
96
+ poster: this.poster,
97
+ showType: this.showType,
98
+ isCarousel: this.isCarousel,
99
+ carouselTime: this.carouselTime,
100
+ height: width / this.cells,
101
+ width: width / this.cells,
102
+ radius: this.radius,
103
+ padding: this.padding,
104
+ jdRows: this.jdRows,
105
+ cells: this.cells,
106
+ shadow: this.shadow,
107
+ shadowColor: this.shadowColor,
108
+ textColor: this.textColor,
109
+ iconPadding:this.iconCPadding,
150
110
  }
151
111
  },
152
- iconItemStyleComp(){
153
- return {
154
- height: this.iconWH.height + 'px',
155
- width: this.iconWH.width + 'px',
156
- marginRight: this.columnSpacing + 'rpx'
157
- }
158
- },
159
- iconItemBoxStyleComp(){
160
- return {
161
- height: this.iconWH.width + 'px',
162
- width: this.iconWH.width + 'px',
163
- marginRight: this.columnSpacing + 'rpx',
164
- padding: this.iconMargin + 'rpx',
165
- boxSizing: 'border-box'
166
- }
167
- },
168
- iconWH(){
169
- //宽高
170
- let outWidth = uni.getSystemInfoSync().safeArea.width;
171
- let marginRL = this.getPMValue(this.margin, 'RL', 0) * this.$rpxNum;
172
- let contentPaddingRL = this.getPMValue(this.contentPadding, 'RL', 0) * this.$rpxNum;
173
- let columnSpacings = this.columnSpacing * (this.column -1)* this.$rpxNum
174
- let width = (outWidth - (marginRL + contentPaddingRL + columnSpacings))/ this.column;
175
- let textHeight = 40;
176
- if(this.titleStyle.lineHeight) textHeight = parseInt(this.titleStyle.lineHeight);
177
-
178
- return {
179
- width,
180
- height: width + textHeight * this.$rpxNum
181
- }
112
+ iconCPadding(){
113
+ let defaultPadding = 20;
114
+ if(this.cells === 4) defaultPadding = 25
115
+ let str = `${this.checkValue(this.iconPadding.top, defaultPadding)}rpx`;
116
+ str = `${str} ${this.checkValue(this.iconPadding.right, defaultPadding)}rpx`;
117
+ str = `${str} ${this.checkValue(this.iconPadding.bottom, defaultPadding)}rpx`;
118
+ str = `${str} ${this.checkValue(this.iconPadding.left, defaultPadding)}rpx`;
119
+ return str
182
120
  },
183
- iconStyleComp(){
184
- return {
185
- boxShadow: this.contShadow,
186
- borderRadius: this.radius + 'rpx',
187
- }
121
+ margin(){
122
+ let str = `${this.checkValue(this.mS.top, 0)}rpx`;
123
+ str = `${str} ${this.checkValue(this.mS.right, 0)}rpx`;
124
+ str = `${str} ${this.checkValue(this.mS.bottom, 0)}rpx`;
125
+ str = `${str} ${this.checkValue(this.mS.left, 0)}rpx`;
126
+ return str
127
+ },
128
+ contentPaddingOut(){
129
+ let str = `${this.checkValue(this.contentPadding.top, 0)}rpx`;
130
+ str = `${str} ${this.checkValue(this.contentPadding.right, 0)}rpx`;
131
+ str = `${str} ${this.checkValue(this.contentPadding.bottom, 0)}rpx`;
132
+ str = `${str} ${this.checkValue(this.contentPadding.left, 0)}rpx`;
133
+ return str
188
134
  },
189
-
190
- bodyStyleComp(){
191
- return {
192
- margin: this.getMarginAndPadding(this.margin, 0),
193
- padding:this.getMarginAndPadding(this.contentPadding, 0),
194
- backgroundColor: this.bgColor,
195
- borderRadius: this.bgRadius + 'rpx'
196
- }
135
+ dotStyleData() {
136
+ return {}
197
137
  }
198
138
  },
199
139
  watch: {
@@ -211,7 +151,9 @@
211
151
  this.isPreview = this.$configProject.isPreview;
212
152
  },
213
153
  methods: {
214
-
154
+ handleAnimationfinish(e) {
155
+ this.current = e.detail.current;
156
+ },
215
157
  handleImage(list){
216
158
  return list.map(item => {
217
159
  return {
@@ -234,48 +176,25 @@
234
176
  if (this.poster.position) {
235
177
  this.posterPosition = this.poster.position
236
178
  }
237
- this.row = getContainerPropsValue(container, 'content.jdRows', 1);
238
- this.column = getContainerPropsValue(container, 'content.cells', 4);
239
- this.columnSpacing = getContainerPropsValue(container, 'columnSpacing', 0)
179
+ this.jdRows = getContainerPropsValue(container, 'content.jdRows', 1);
180
+ this.cells = getContainerPropsValue(container, 'content.cells', 4);
240
181
 
241
182
  //content
242
- this.mode = getContainerPropsValue(container, 'content.dot_type', 'round');
183
+ this.mode = getContainerPropsValue(container, 'content.dot_type', 'dot');
243
184
  this.isCarousel = getContainerPropsValue(container, 'content.isCarousel', 1) === 2;
244
185
  this.carouselTime = Number(getContainerPropsValue(container, 'content.carouselTime', 5)) * 1000;
245
- let useNumberDefault = 20;
246
- if(this.isCarousel === false) useNumberDefault = this.row * this.column;
247
- this.useNumber = getContainerPropsValue(container, 'content.number', useNumberDefault);
248
-
249
- //icon样式设置
250
- let shadow = getContainerPropsValue(container, 'content.shadow', 2);
251
- let shadowColor = getContainerPropsValue(container, 'content.shadowColor', 'rgba(0,0,0,0)');
252
- let defaultPadding = 20;
253
- if(this.column === 4) defaultPadding = 25
254
- this.iconMargin = getContainerPropsValue(container, 'content.iconMargin', defaultPadding);
255
- this.contShadow = this.getShadowCompatibleOldStyle(getContainerPropsValue(container, 'content.iconShadow', {}),{
256
- type: shadow ===1?'Y':'N',
257
- width: '10',
258
- color: shadowColor|| 'rgba(0,0,0,0)'
259
- })
260
- let textColor = getContainerPropsValue(container, 'content.textColor', '#333');
261
- let iconSetBaseStyle = getContainerPropsValue(container, 'content.iconSetBaseStyle', 'Y');
262
- if(iconSetBaseStyle === 'N') {
263
- shadow = 'N';
264
- textColor = '#333';
265
- }
266
- let titleStyle = getContainerPropsValue(container,'content.titleStyle', {});
267
- if(!titleStyle.color) titleStyle.color = textColor || '#333';
268
- if(!titleStyle.lineHeight) titleStyle.lineHeight = '36rpx';
269
- if(!titleStyle.fontWeight) titleStyle.fontWeight = 'normal';
270
- if(!titleStyle.fontSize) titleStyle.fontSize = '24rpx';
271
- if(!titleStyle.textDecoration) titleStyle.textDecoration = 'none';
272
- this.titleStyle = titleStyle;
186
+ this.useNumber = getContainerPropsValue(container, 'content.number', 1);
187
+ this.shadow = getContainerPropsValue(container, 'content.shadow', 2);
188
+ this.shadowColor = getContainerPropsValue(container, 'content.shadowColor', 'rgba(0,0,0,.3)');
189
+ this.mS = getContainerPropsValue(container, 'content.margin', {});
190
+ this.iconPadding = getContainerPropsValue(container, 'content.iconPadding', {});
191
+ this.contentPadding = getContainerPropsValue(container, 'content.contentPadding', {});
273
192
 
274
193
  //样式设置
194
+ this.textColor = getContainerPropsValue(container, 'content.textColor', '#333');
275
195
  this.bgColor = getContainerPropsValue(container, 'content.bgColor','rgba(0,0,0,0)');
276
196
  this.bgRadius = getContainerPropsValue(container, 'content.bgRadius', '0');
277
- this.contentPadding = getContainerPropsValue(container, 'content.contentPadding', {});
278
- this.margin = getContainerPropsValue(container, 'content.margin', {});
197
+
279
198
 
280
199
  },
281
200
 
@@ -1,11 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  import {getContainerFnPropsValue, getContainerPropsValue,isWechat} from "@/utils/xd.base";
4
+ import {Base64} from 'js-base64';
4
5
  import {mapActions,mapState, mapMutations} from "vuex";
5
6
  import helper from "@/utils/helper";
6
7
  import store from "@/store/index";
7
- import getServiceUrl from "@/common/getServiceUrl"
8
-
9
8
 
10
9
  export default {
11
10
  props: {
@@ -210,31 +209,20 @@ export default {
210
209
 
211
210
  //调试模式设置值
212
211
  let zIndex = 4;
213
- if(this['hideMask'] === true) zIndex = -1;
212
+ if( this['hideMask'] === true) zIndex = -1;
214
213
  if(this['closeMask'] === true) zIndex = -1;
215
214
  if(this['closeMask'] === false) zIndex = 4;
215
+ document.querySelector(':root').style.setProperty('--preview-z-index', zIndex);
216
216
 
217
217
  //生产元素
218
218
  if(this.$configProject.isPreview) {
219
219
  if(zIndex ===-1) {
220
- this.$nextTick(()=>{
221
- setTimeout(()=>{
222
- let r = document.getElementsByClassName(this.cssRoot);
223
- let len = r.length;
224
- for (let i=0; i < len; i++) {
225
- let el = r.item(i);
226
- if(!el.hasAttribute('close-mask')) {
227
- el.setAttribute('close-mask', '1');
228
- for(let k=0; k < 4;k++) {
229
- let span = document.createElement('span');
230
- span.className = 'xd-preview-line xd-preview-line-' + k;
231
- el.appendChild(span);
232
- }
233
- }
234
- }
235
-
236
- }, 50)
237
- })
220
+ let parentRoot = document.querySelector(`.${this.cssRoot}`);
221
+ for(let i=0; i < 4;i++) {
222
+ let span = document.createElement('span');
223
+ span.className = 'xd-preview-line xd-preview-line-' + i;
224
+ parentRoot.appendChild(span);
225
+ }
238
226
  }
239
227
 
240
228
  }
@@ -525,11 +513,6 @@ export default {
525
513
 
526
514
  //边框样式生成
527
515
  getXdBorder(defaultObj, newObj, type='border'){
528
- //使用默认值
529
- if(newObj.type ==='D'){
530
- if(type === 'border') return `${defaultObj.width}rpx ${defaultObj.style} ${defaultObj.color}`;
531
- return `0 0 ${defaultObj.width}rpx ${defaultObj.color}`;
532
- }
533
516
  if(newObj.type === 'N' || this.$xdUniHelper.isEmpty(newObj)) return `0`;
534
517
  let width = defaultObj.width;
535
518
  let color = defaultObj.color;
@@ -650,31 +633,6 @@ export default {
650
633
  return str
651
634
  },
652
635
 
653
- /**
654
- * @description 获取边距与填充上下或者左右的值
655
- * @param obj
656
- * @param type
657
- * @param defValue
658
- * @return {*}
659
- */
660
- getPMValue(obj = {},type='RL', defValue) {
661
- if(this.$xdUniHelper.checkVarType(obj) !== 'object') obj = {};
662
- let top = 0,right=0,bottom=0,left=0;
663
- if(typeof defValue === 'number') {
664
- top = right = left = bottom = defValue;
665
- }
666
- else if(this.$xdUniHelper.checkVarType(obj) === 'object') {
667
- if(typeof defValue.top === "number") top = defValue.top;
668
- if(typeof defValue.right === "number") right = defValue.right;
669
- if(typeof defValue.bottom === "number") bottom = defValue.bottom;
670
- if(typeof defValue.left === "number") left = defValue.left;
671
- }
672
- if(type === 'RL') {
673
- return this.checkValue(obj.left,left) + this.checkValue(obj.right,right);
674
- }
675
- return this.checkValue(obj.bottom,bottom) + this.checkValue(obj.top,top);
676
- },
677
-
678
636
  /**
679
637
  * @description 获取商品显示规则
680
638
  * @param container
@@ -830,6 +788,44 @@ export default {
830
788
  console.error(e);
831
789
  return null;
832
790
  }
791
+ // let content = list.filter(item=>{
792
+ // //预览模式
793
+ // if(this.$configProject.isPreview) return true;
794
+ //
795
+ // //非内部应用
796
+ // if(item.redirect_type !== 'INN') return true
797
+ //
798
+ // //没有配置链接
799
+ // if(!item.redirect_data) return true;
800
+ //
801
+ // //内部应用
802
+ // else {
803
+ // let redirect_data;
804
+ // try {
805
+ // redirect_data = JSON.parse(item.redirect_data);
806
+ // if(!item['app_type']) item['app_type']= 'h5';
807
+ //
808
+ // //#ifdef H5
809
+ // return item['app_type'] !== 'wxmp';
810
+ // //#endif
811
+ //
812
+ // //#ifdef MP-WEIXIN
813
+ // let actDir = this.$parent.projectAttr.deploy_dir;
814
+ // let dir = this.getPathDir(redirect_data.page);
815
+ // if(item['app_type'] === 'wxmp'){
816
+ // return actDir === dir;
817
+ // }
818
+ // else if(item['app_type'] === 'h5') return true;
819
+ // else return true
820
+ // //#endif
821
+ // }
822
+ // catch (e) {
823
+ // return true
824
+ // }
825
+ // }
826
+ // });
827
+ // console.warn(`PostersList:${JSON.stringify(content.map(item=>`${item.app_type}:${item.content_name}:${item.redirect_data}`), null,2)}`)
828
+ // return content;
833
829
 
834
830
  },
835
831
  }