jufubao-base 1.0.213 → 1.0.215-beta1

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,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
- 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>
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
- padding: 0, //广告内容之间间距
68
- jdRows: 1, //行
69
- cells: 4, //列
70
- shadow: false, //是否设置阴影
71
- shadowColor:'rgba(0,0,0,.3)',
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
- timer: null,
74
- info: [],
75
- mS: {},
76
- iconPadding:{},
77
- contentPadding:{},
78
- isPreview: false,
79
- noData:false,
77
+ iconMargin:20,
78
+ titleStyle:{},
80
79
 
81
80
  //颜色设置
82
- textColor: '#333',
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: '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,
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
- 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
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
- 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
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
- dotStyleData() {
136
- return {}
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
- handleAnimationfinish(e) {
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.jdRows = getContainerPropsValue(container, 'content.jdRows', 1);
180
- this.cells = getContainerPropsValue(container, 'content.cells', 4);
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', 'dot');
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
- 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', {});
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
 
@@ -22,9 +22,7 @@
22
22
  v-if="noUserLoding === true"
23
23
  class="jfb-base-success__body-nouser"
24
24
  :style="{ margin: jfbListMarginComputed }"
25
- >
26
- 请关闭当前浏览器,返回原界面查看结果
27
- </view>
25
+ >请关闭当前浏览器,返回原界面查看结果</view>
28
26
  <template v-if="noUserLoding === false && info !== null">
29
27
  <view :style="{ margin: jfbListMarginComputed }">
30
28
  <view
@@ -71,6 +69,18 @@
71
69
  </view>
72
70
  </view>
73
71
  <!--settle end-->
72
+ <!--取票码提示文案-->
73
+ <view
74
+ class="ticket_method_msg"
75
+ v-if="ticket_method_msg"
76
+ :style="{
77
+ marginBottom: jfbListSpacing + 'rpx',
78
+ boxShadow: jfbListShadowComputed,
79
+ border: jfbListBorderComputed,
80
+ borderRadius: jfbListRadius + 'rpx',
81
+ }"
82
+ >{{ticket_method_msg}}</view>
83
+ <!--取票码提示文案-->
74
84
  <view class="jfb-base-success__body-other">
75
85
  <view
76
86
  v-if="info.codes && info.codes.length > 0 && is_show_code === 'Y'"
@@ -416,6 +426,7 @@ export default {
416
426
  boxBgColor:'',
417
427
  payBgColor:'',
418
428
  bgColor:'',
429
+ ticket_method_msg:'', //取票提示文案
419
430
 
420
431
  //按钮
421
432
  btnTextColor:'',
@@ -631,6 +642,19 @@ export default {
631
642
  return item;
632
643
  });
633
644
 
645
+ //检查是否用取票信息
646
+ if(info.codes instanceof Array) {
647
+ let ticket_method_msg = '';
648
+ if(info.codes.length > 0) {
649
+ info.codes.map(item=>{
650
+ if(item['ticket_method_msg'] && ticket_method_msg === ''){
651
+ ticket_method_msg = item['ticket_method_msg'];
652
+ }
653
+ })
654
+ };
655
+ this.ticket_method_msg = ticket_method_msg;
656
+ }
657
+
634
658
  //设置预览内容
635
659
  info["productDetail"] = null;
636
660
  if (info.product) {
@@ -751,6 +775,17 @@ export default {
751
775
 
752
776
  .jfb-base-success {
753
777
  &__body {
778
+ .ticket_method_msg {
779
+ background-color: #FFEAE6;
780
+ font-size: 24rpx;
781
+ font-weight: 500;
782
+ line-height: 32rpx;
783
+ padding:18rpx 30rpx;
784
+ border-radius: 10rpx;
785
+ color: rgba(249, 101, 65, 1);
786
+ text-align: left;
787
+ }
788
+
754
789
  &-nouser {
755
790
  padding: 20rpx;
756
791
  //background: #f5f5f5;
@@ -841,7 +876,7 @@ export default {
841
876
  }
842
877
  }
843
878
  &-icon {
844
- height: unit(320, rpx) !important;
879
+ min-height: unit(320, rpx) !important;
845
880
  display: flex;
846
881
  justify-content: center;
847
882
  align-items: center;
@@ -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( this['hideMask'] === true) zIndex = -1;
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
- 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
- }
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
  }