jufubao-base 1.0.213 → 1.0.214
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/get.package.path.js +2 -2
- package/package.json +1 -1
- package/src/components/JfbBasePoster/JfbBasePoster.vue +11 -2
- package/src/components/JfbBasePosterType/Attr.js +199 -81
- package/src/components/JfbBasePosterType/FourScreen.vue +115 -233
- package/src/components/JfbBasePosterType/JfbBasePosterType.vue +161 -80
- package/src/mixins/componentsMixins.js +51 -47
|
@@ -15,16 +15,12 @@
|
|
|
15
15
|
<!-- #endif -->
|
|
16
16
|
<view class="jfb-base-poster-type__body" v-if="noData">
|
|
17
17
|
<view class="x-line"></view>
|
|
18
|
-
<view
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
borderRadius: bgRadius + 'rpx'
|
|
25
|
-
}"
|
|
26
|
-
>
|
|
27
|
-
<four-screen style="width: 100%;" :config="getConfig" :content="info"></four-screen>
|
|
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>
|
|
28
24
|
</view>
|
|
29
25
|
|
|
30
26
|
</view>
|
|
@@ -56,7 +52,13 @@
|
|
|
56
52
|
mixins: [componentsMixins,extsMixins,JfbBasePosterTypeMixin],
|
|
57
53
|
data() {
|
|
58
54
|
return {
|
|
55
|
+
//closeMask: true,
|
|
59
56
|
params: {},
|
|
57
|
+
noData:false,
|
|
58
|
+
timer: null,
|
|
59
|
+
info: [],
|
|
60
|
+
isPreview: false,
|
|
61
|
+
|
|
60
62
|
//Swiper 配置
|
|
61
63
|
posterPosition: null,
|
|
62
64
|
current: 0,
|
|
@@ -64,76 +66,134 @@
|
|
|
64
66
|
isCarousel: true, //是否轮播图
|
|
65
67
|
carouselTime: 5,//轮播图轮播周期
|
|
66
68
|
useNumber: null, //广告使用张数
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
mode:'round',//索引样式
|
|
70
|
+
row: 1, //行
|
|
71
|
+
column: 4, //列
|
|
72
|
+
columnSpacing:0,
|
|
73
|
+
|
|
74
|
+
//icon样式设置
|
|
75
|
+
contShadow:{},
|
|
72
76
|
radius: '20', //10/20/40 , 小/中/大
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
mS: {},
|
|
76
|
-
iconPadding:{},
|
|
77
|
-
contentPadding:{},
|
|
78
|
-
isPreview: false,
|
|
79
|
-
noData:false,
|
|
77
|
+
iconMargin:20,
|
|
78
|
+
titleStyle:{},
|
|
80
79
|
|
|
81
80
|
//颜色设置
|
|
82
|
-
|
|
81
|
+
margin: {},
|
|
82
|
+
contentPadding:{},
|
|
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
|
+
},
|
|
88
135
|
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;
|
|
93
136
|
return {
|
|
94
|
-
mode:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
shadowColor: this.shadowColor,
|
|
108
|
-
textColor: this.textColor,
|
|
109
|
-
iconPadding:this.iconCPadding,
|
|
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
|
|
110
150
|
}
|
|
111
151
|
},
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
str = `${str} ${this.checkValue(this.iconPadding.left, defaultPadding)}rpx`;
|
|
119
|
-
return str
|
|
152
|
+
iconItemStyleComp(){
|
|
153
|
+
return {
|
|
154
|
+
height: this.iconWH.height + 'px',
|
|
155
|
+
width: this.iconWH.width + 'px',
|
|
156
|
+
marginRight: this.columnSpacing + 'rpx'
|
|
157
|
+
}
|
|
120
158
|
},
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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
|
|
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
|
+
}
|
|
134
167
|
},
|
|
135
|
-
|
|
136
|
-
|
|
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
|
+
}
|
|
182
|
+
},
|
|
183
|
+
iconStyleComp(){
|
|
184
|
+
return {
|
|
185
|
+
boxShadow: this.contShadow,
|
|
186
|
+
borderRadius: this.radius + 'rpx',
|
|
187
|
+
}
|
|
188
|
+
},
|
|
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
|
+
}
|
|
137
197
|
}
|
|
138
198
|
},
|
|
139
199
|
watch: {
|
|
@@ -151,9 +211,7 @@
|
|
|
151
211
|
this.isPreview = this.$configProject.isPreview;
|
|
152
212
|
},
|
|
153
213
|
methods: {
|
|
154
|
-
|
|
155
|
-
this.current = e.detail.current;
|
|
156
|
-
},
|
|
214
|
+
|
|
157
215
|
handleImage(list){
|
|
158
216
|
return list.map(item => {
|
|
159
217
|
return {
|
|
@@ -176,25 +234,48 @@
|
|
|
176
234
|
if (this.poster.position) {
|
|
177
235
|
this.posterPosition = this.poster.position
|
|
178
236
|
}
|
|
179
|
-
this.
|
|
180
|
-
this.
|
|
237
|
+
this.row = getContainerPropsValue(container, 'content.jdRows', 1);
|
|
238
|
+
this.column = getContainerPropsValue(container, 'content.cells', 4);
|
|
239
|
+
this.columnSpacing = getContainerPropsValue(container, 'columnSpacing', 0)
|
|
181
240
|
|
|
182
241
|
//content
|
|
183
|
-
this.mode = getContainerPropsValue(container, 'content.dot_type', '
|
|
242
|
+
this.mode = getContainerPropsValue(container, 'content.dot_type', 'round');
|
|
184
243
|
this.isCarousel = getContainerPropsValue(container, 'content.isCarousel', 1) === 2;
|
|
185
244
|
this.carouselTime = Number(getContainerPropsValue(container, 'content.carouselTime', 5)) * 1000;
|
|
186
|
-
|
|
187
|
-
this.
|
|
188
|
-
this.
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
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;
|
|
192
273
|
|
|
193
274
|
//样式设置
|
|
194
|
-
this.textColor = getContainerPropsValue(container, 'content.textColor', '#333');
|
|
195
275
|
this.bgColor = getContainerPropsValue(container, 'content.bgColor','rgba(0,0,0,0)');
|
|
196
276
|
this.bgRadius = getContainerPropsValue(container, 'content.bgRadius', '0');
|
|
197
|
-
|
|
277
|
+
this.contentPadding = getContainerPropsValue(container, 'content.contentPadding', {});
|
|
278
|
+
this.margin = getContainerPropsValue(container, 'content.margin', {});
|
|
198
279
|
|
|
199
280
|
},
|
|
200
281
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
import {getContainerFnPropsValue, getContainerPropsValue,isWechat} from "@/utils/xd.base";
|
|
4
|
-
import {Base64} from 'js-base64';
|
|
5
4
|
import {mapActions,mapState, mapMutations} from "vuex";
|
|
6
5
|
import helper from "@/utils/helper";
|
|
7
6
|
import store from "@/store/index";
|
|
7
|
+
import getServiceUrl from "@/common/getServiceUrl"
|
|
8
|
+
|
|
8
9
|
|
|
9
10
|
export default {
|
|
10
11
|
props: {
|
|
@@ -209,20 +210,31 @@ export default {
|
|
|
209
210
|
|
|
210
211
|
//调试模式设置值
|
|
211
212
|
let zIndex = 4;
|
|
212
|
-
if(
|
|
213
|
+
if(this['hideMask'] === true) zIndex = -1;
|
|
213
214
|
if(this['closeMask'] === true) zIndex = -1;
|
|
214
215
|
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
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
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
|
+
})
|
|
226
238
|
}
|
|
227
239
|
|
|
228
240
|
}
|
|
@@ -513,6 +525,11 @@ export default {
|
|
|
513
525
|
|
|
514
526
|
//边框样式生成
|
|
515
527
|
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
|
+
}
|
|
516
533
|
if(newObj.type === 'N' || this.$xdUniHelper.isEmpty(newObj)) return `0`;
|
|
517
534
|
let width = defaultObj.width;
|
|
518
535
|
let color = defaultObj.color;
|
|
@@ -633,6 +650,31 @@ export default {
|
|
|
633
650
|
return str
|
|
634
651
|
},
|
|
635
652
|
|
|
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
|
+
|
|
636
678
|
/**
|
|
637
679
|
* @description 获取商品显示规则
|
|
638
680
|
* @param container
|
|
@@ -788,44 +830,6 @@ export default {
|
|
|
788
830
|
console.error(e);
|
|
789
831
|
return null;
|
|
790
832
|
}
|
|
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;
|
|
829
833
|
|
|
830
834
|
},
|
|
831
835
|
}
|