jufubao-base 1.0.289-beta2 → 1.0.290-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.
- package/package.json +1 -1
- package/src/components/JfbBaseFooter/Attr.js +155 -10
- package/src/components/JfbBaseFooter/JfbBaseFooter.vue +43 -96
- package/src/components/JfbBaseSavingDetail/JfbBaseSavingDetail.vue +14 -2
- package/src/components/JfbBaseTfkSearch/Api.js +0 -15
- package/src/components/JfbBaseTfkSearch/CustomList.vue +0 -10
- package/src/components/JfbBaseTfkSearch/JfbBaseTfkSearch.vue +7 -247
- package/src/components/JfbBaseUserInfo/Attr.js +0 -12
- package/src/components/JfbBaseUserInfo/JfbBaseUserInfo.vue +2 -8
- package/src/mixins/componentsMixins.js +55 -363
- package/src/mixins/posterMixins.js +199 -27
- package/src/components/CusCouponChose/CusCouponChose.vue +0 -1027
- package/src/components/CusCouponItem/CusCouponItem.vue +0 -298
- package/src/components/CusEnter/CusEnter.vue +0 -360
- package/src/components/CusPoster/CusPoster.vue +0 -212
- package/src/components/CusPoster/CusSwiperDot.vue +0 -234
- package/src/components/CusProduct/CusProduct.vue +0 -372
- package/src/components/CusShops/CusShops.vue +0 -518
- package/src/components/CusSwiperDot/CusSwiperDot.vue +0 -234
- package/src/components/CusTab/CusTab.vue +0 -411
- package/src/components/CusVideo/CusVideo.vue +0 -170
- package/src/components/JfbBaseFooter/cusAttr/advanced.js +0 -12
- package/src/components/JfbBaseFooter/cusAttr/content.js +0 -447
- package/src/components/JfbBaseFooter/cusAttr/style.js +0 -7
- package/src/components/JfbBaseFooter/cusAttr/tools.js +0 -17
- package/src/components/JfbBaseTfkSearch/XdQueryFilter.vue +0 -354
- package/src/components/JfbBaseTfkSearch/XdQuerySort.vue +0 -192
- package/src/mixins/productCompMixins.js +0 -252
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {getContainerFnPropsValue, getContainerPropsValue,isWechat} from "@/utils/xd.base";
|
|
4
4
|
import {mapActions,mapState, mapMutations} from "vuex";
|
|
5
5
|
import helper from "@/utils/helper";
|
|
6
6
|
import store from "@/store/index";
|
|
7
7
|
import getServiceUrl from "@/common/getServiceUrl"
|
|
8
8
|
import {parsePath} from "@/utils/linkUrl";
|
|
9
|
-
import {Base64} from "js-base64";
|
|
10
|
-
import {isArray, isEmpty, isObject} from "@/utils/AttrTools";
|
|
11
9
|
|
|
12
10
|
|
|
13
11
|
export default {
|
|
@@ -108,7 +106,6 @@ export default {
|
|
|
108
106
|
active: false, //是否选择当前状态
|
|
109
107
|
isEditx: true, //当前为Editx模式
|
|
110
108
|
edit: false, //是否开启编辑模式
|
|
111
|
-
isRefDelIcon: true, //引用情况设置关闭按钮
|
|
112
109
|
// #endif
|
|
113
110
|
|
|
114
111
|
//风格键
|
|
@@ -140,13 +137,7 @@ export default {
|
|
|
140
137
|
"op_user_id": "",
|
|
141
138
|
"created_time": 0,
|
|
142
139
|
"updated_time": 0
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
//全局样式
|
|
146
|
-
gStyleValue:{}, //转化好的值
|
|
147
|
-
gObjStyleValue:{}, //对象数据
|
|
148
|
-
gOrgStyleValue:{}, //原始数据
|
|
149
|
-
|
|
140
|
+
}
|
|
150
141
|
}
|
|
151
142
|
},
|
|
152
143
|
|
|
@@ -174,14 +165,6 @@ export default {
|
|
|
174
165
|
if (this.$vnode && this.$vnode.tag) tag = this.$vnode.tag;
|
|
175
166
|
this.$xdLog.setProject('App.components.start', `App.components.vnode.name.${tag}`);
|
|
176
167
|
|
|
177
|
-
let style = this.pageAttr['configs']['default_style']
|
|
178
|
-
|
|
179
|
-
//全局样式处理
|
|
180
|
-
if(style) {
|
|
181
|
-
this.gOrgStyleValue = this.$xdUniHelper.cloneDeep(style);
|
|
182
|
-
this.setGStyleValue(style);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
168
|
//设置插件cid
|
|
186
169
|
if (this.cid) {
|
|
187
170
|
this.containerId = this.cid;
|
|
@@ -221,8 +204,6 @@ export default {
|
|
|
221
204
|
// #endif
|
|
222
205
|
},
|
|
223
206
|
|
|
224
|
-
|
|
225
|
-
|
|
226
207
|
//#ifdef H5
|
|
227
208
|
mounted() {
|
|
228
209
|
let that = this;
|
|
@@ -296,35 +277,16 @@ export default {
|
|
|
296
277
|
&& this.$configProject.NODE_ENV === 'development'
|
|
297
278
|
&& this.$configProject.viewType === 'pack'
|
|
298
279
|
){
|
|
299
|
-
|
|
280
|
+
this.isEditx = false;
|
|
300
281
|
}
|
|
282
|
+
|
|
301
283
|
},
|
|
302
284
|
// #endif
|
|
303
285
|
|
|
304
286
|
computed:{
|
|
305
287
|
...mapState({
|
|
306
288
|
pageNamespace: state=> state.pageBusinessCode,
|
|
307
|
-
|
|
308
|
-
}),
|
|
309
|
-
|
|
310
|
-
isGVipSite(){
|
|
311
|
-
return this.projectAttr.headers['X-Site-Group']==="vip";
|
|
312
|
-
},
|
|
313
|
-
|
|
314
|
-
isGVip(){
|
|
315
|
-
//非vip站点直接返回 非vip
|
|
316
|
-
if(!this.isGVipSite) return 'N';
|
|
317
|
-
|
|
318
|
-
//预览模式
|
|
319
|
-
if(this.$configProject.isPreview) return 'Y';
|
|
320
|
-
|
|
321
|
-
//token中获取vip标识
|
|
322
|
-
if(this.getTokenForKey('user_level')) {
|
|
323
|
-
return this.getTokenForKey('user_level')==='VIP'?'Y':'N'
|
|
324
|
-
}
|
|
325
|
-
//非vip
|
|
326
|
-
else return 'N';
|
|
327
|
-
},
|
|
289
|
+
})
|
|
328
290
|
},
|
|
329
291
|
|
|
330
292
|
watch:{
|
|
@@ -337,90 +299,6 @@ export default {
|
|
|
337
299
|
...mapActions(['setXNamespace','setStyleCommon','wxCodeForGetAppId']),
|
|
338
300
|
...mapMutations(['setCurrentStyle']),
|
|
339
301
|
|
|
340
|
-
getBSStr({color, width, style = 'solid'}, type='border'){
|
|
341
|
-
|
|
342
|
-
width = Number(width)
|
|
343
|
-
//1px solid #eee
|
|
344
|
-
if(type === 'border'){
|
|
345
|
-
if(width === 0) return 0
|
|
346
|
-
return `${width}rpx ${style} ${color}`;
|
|
347
|
-
}
|
|
348
|
-
//0 0 10rpx #fff
|
|
349
|
-
else {
|
|
350
|
-
debugger
|
|
351
|
-
if(width === 0) return 'none';
|
|
352
|
-
return `0 0 ${width}rpx ${color}`
|
|
353
|
-
}
|
|
354
|
-
},
|
|
355
|
-
|
|
356
|
-
/**
|
|
357
|
-
* @description 设置全局样式
|
|
358
|
-
* @param data
|
|
359
|
-
*/
|
|
360
|
-
setGStyleValue(data){
|
|
361
|
-
|
|
362
|
-
function objFn(mpObj){
|
|
363
|
-
if(mpObj['type'] === 'D') return {top: 0, left: 20, right: 20, bottom:20};
|
|
364
|
-
else {
|
|
365
|
-
Object.keys(mpObj['custom']).map(key=>{
|
|
366
|
-
if(mpObj['custom'][key] === -999999) mpObj['custom'][key] = 0;
|
|
367
|
-
})
|
|
368
|
-
}
|
|
369
|
-
return mpObj['custom'];
|
|
370
|
-
}
|
|
371
|
-
let temp = {};
|
|
372
|
-
let objTemp = {};
|
|
373
|
-
Object.keys(data).map(key=>{
|
|
374
|
-
if(key === 'padding' || key === 'margin') {
|
|
375
|
-
temp[key] = objFn(data[key]);
|
|
376
|
-
objTemp[key] = objFn(data[key]);
|
|
377
|
-
}
|
|
378
|
-
else if(key === 'shadow') {
|
|
379
|
-
if(data['type'] === 'D'){
|
|
380
|
-
temp['shadow'] = 'none';
|
|
381
|
-
objTemp['shadow'] = {color: 'rgba(0,0,0,0)', width: '0'};
|
|
382
|
-
}
|
|
383
|
-
else {
|
|
384
|
-
if(data[key]['custom'] && data[key]['custom']['color']) {
|
|
385
|
-
temp['shadow'] = `0 0 ${data[key]['custom']['width']}rpx ${data[key]['custom']['color']}`
|
|
386
|
-
objTemp['shadow'] = data[key]['custom'];
|
|
387
|
-
}
|
|
388
|
-
else {
|
|
389
|
-
temp['shadow'] = 'none';
|
|
390
|
-
objTemp['shadow'] = {color: 'rgba(0,0,0,0)', width: '0'};
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
else if(key === 'background') {
|
|
396
|
-
if(data['type'] === 'D') temp['background'] = 'none';
|
|
397
|
-
else {
|
|
398
|
-
if(data[key]['custom']) {
|
|
399
|
-
temp['background'] = data[key]['custom']
|
|
400
|
-
objTemp['background'] = data[key]['custom'];
|
|
401
|
-
}
|
|
402
|
-
else {
|
|
403
|
-
temp['background'] = 'none';
|
|
404
|
-
objTemp['background'] = 'none';
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
else if(key === 'radius') {
|
|
409
|
-
if(data['type'] === 'D') {
|
|
410
|
-
temp['radius'] = 0;
|
|
411
|
-
objTemp['radius'] = '0';
|
|
412
|
-
}
|
|
413
|
-
else {
|
|
414
|
-
temp['radius'] = Number(data[key]['custom']);
|
|
415
|
-
objTemp['radius'] = data[key]['custom'];
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
}
|
|
419
|
-
});
|
|
420
|
-
this.gStyleValue = this.$xdUniHelper.cloneDeep(temp);
|
|
421
|
-
this.gObjStyleValue = this.$xdUniHelper.cloneDeep(objTemp);
|
|
422
|
-
},
|
|
423
|
-
|
|
424
302
|
/**
|
|
425
303
|
* @description 自动生成调试模式
|
|
426
304
|
*/
|
|
@@ -438,6 +316,8 @@ export default {
|
|
|
438
316
|
}
|
|
439
317
|
},
|
|
440
318
|
|
|
319
|
+
|
|
320
|
+
|
|
441
321
|
/**
|
|
442
322
|
* @description 检查是否同域名
|
|
443
323
|
* @param url
|
|
@@ -458,17 +338,12 @@ export default {
|
|
|
458
338
|
},
|
|
459
339
|
// #endif
|
|
460
340
|
|
|
461
|
-
setNameSpace(options
|
|
341
|
+
setNameSpace(options){
|
|
462
342
|
this.xnamespace = this.xnamespace || this.pageNamespace;
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
if(!this.xnamespace && !this.$configProject.isPreview){
|
|
467
|
-
this.$xdAlert({content: '未设置业务编码',type:'error'});
|
|
468
|
-
throw new Error('请配置业务编码')
|
|
469
|
-
}
|
|
343
|
+
if(!this.xnamespace && !this.$configProject.isPreview){
|
|
344
|
+
this.$xdAlert({content: '未设置业务编码',type:'error'});
|
|
345
|
+
throw new Error('请配置业务编码')
|
|
470
346
|
}
|
|
471
|
-
|
|
472
347
|
this.setXNamespace(this.xnamespace)
|
|
473
348
|
},
|
|
474
349
|
|
|
@@ -551,9 +426,6 @@ export default {
|
|
|
551
426
|
Object.keys(this.styles).map(key => {
|
|
552
427
|
let k = key.replace('$', '');
|
|
553
428
|
if (this[k] !== undefined){
|
|
554
|
-
if(typeof this.styles[key] === 'string'){
|
|
555
|
-
this.styles[key] = this.styles[key].trim()
|
|
556
|
-
}
|
|
557
429
|
this[k] = this.styles[key];
|
|
558
430
|
current[k] = this.styles[key];
|
|
559
431
|
}
|
|
@@ -588,44 +460,25 @@ export default {
|
|
|
588
460
|
* @description 点击选择插件显示边框
|
|
589
461
|
*/
|
|
590
462
|
handleEditxSelect() {
|
|
591
|
-
|
|
592
463
|
//加载本地业务插件库
|
|
593
464
|
if (this.noBorder) return;
|
|
594
465
|
|
|
595
466
|
//#ifdef H5
|
|
596
467
|
if (this.active) return;
|
|
597
468
|
this.active = true;
|
|
598
|
-
|
|
599
469
|
let AttrObj = this.$xdUniHelper.checkVarType(this.Attr) === 'object' ?
|
|
600
470
|
this.$xdUniHelper.customClone(this.Attr) : {style: [], advanced: [], content: []};
|
|
601
471
|
|
|
602
|
-
let gStyleColor = {
|
|
603
|
-
mainColor: this.mainColor,
|
|
604
|
-
successColor: this.successColor,
|
|
605
|
-
infoColor: this.infoColor,
|
|
606
|
-
subMainColor: this.subMainColor,
|
|
607
|
-
warningColor: this.warningColor,
|
|
608
|
-
defaultColor: this.defaultColor,
|
|
609
|
-
dangerColor: this.dangerColor
|
|
610
|
-
}
|
|
611
|
-
|
|
612
472
|
//设置已绑定数据
|
|
613
473
|
Object.keys(AttrObj).map(type => {
|
|
614
474
|
//配置的是方法
|
|
615
475
|
if (type === 'style' || type === 'advanced' || type === 'content') {
|
|
616
476
|
if (typeof AttrObj[type] === "function") {
|
|
617
477
|
let params = getContainerFnPropsValue(this.container, `${type}`);
|
|
618
|
-
|
|
619
|
-
//默认样式设置
|
|
620
|
-
let defaultGValue = this.$xdUniHelper.cloneDeep(this.gStyleValue);
|
|
621
|
-
//是否为添加组件操作
|
|
622
|
-
defaultGValue['isAdd'] = this.container.isAdd === true;
|
|
623
|
-
//面板首次加载
|
|
624
|
-
defaultGValue['isFirst'] = true;
|
|
625
478
|
let Attr = this.$xdUniHelper.customClone(this.Attr);
|
|
626
479
|
AttrObj[`${type}.isFn`] = true;
|
|
627
480
|
AttrObj[`${type}.Fn`] = Attr[type];
|
|
628
|
-
AttrObj[type] = Attr[type](params
|
|
481
|
+
AttrObj[type] = Attr[type](params);
|
|
629
482
|
} else {
|
|
630
483
|
AttrObj[type].map(item => {
|
|
631
484
|
if (item.value !== undefined) {
|
|
@@ -641,32 +494,16 @@ export default {
|
|
|
641
494
|
});
|
|
642
495
|
|
|
643
496
|
//发送点击组件事件
|
|
644
|
-
let sendContainer = this.$xdUniHelper.cloneDeep(this.container);
|
|
645
|
-
sendContainer.defaultData = this.$xdUniHelper.cloneDeep(this.gStyleValue||{});//设置全局默认值
|
|
646
|
-
sendContainer.gStyleColor = this.$xdUniHelper.cloneDeep(gStyleColor);//设置全局默认值
|
|
647
|
-
|
|
648
497
|
XdBus.send('onSelectPackage', {
|
|
649
498
|
containerId: this.containerId,
|
|
650
499
|
Attr: this.$xdUniHelper.customClone(AttrObj),
|
|
651
|
-
container:
|
|
500
|
+
container: this.$xdUniHelper.cloneDeep(this.container)
|
|
652
501
|
});
|
|
653
502
|
|
|
654
503
|
//绑定选中插件事件
|
|
655
504
|
XdBus.message('select', {
|
|
656
505
|
containerId: this.containerId,
|
|
657
|
-
});
|
|
658
|
-
|
|
659
|
-
//引用模版直接不显示编辑按钮
|
|
660
|
-
this.$nextTick(()=>{
|
|
661
|
-
if(this.pageAttr.configs['template_type'] === 2){
|
|
662
|
-
const editCss = `${this.cssRoot}__edit`;
|
|
663
|
-
let el = document.getElementsByClassName(editCss).item(0);
|
|
664
|
-
el.style.display = 'none';
|
|
665
|
-
}
|
|
666
506
|
})
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
507
|
//#endif
|
|
671
508
|
},
|
|
672
509
|
|
|
@@ -703,132 +540,80 @@ export default {
|
|
|
703
540
|
* @return {string} 例如:`0,0,10rpx,rgba(0,0,0,0)`
|
|
704
541
|
*/
|
|
705
542
|
getXdShadow(defaultObj, newObj){
|
|
706
|
-
if(newObj.type === 'N' || this.$xdUniHelper.isEmpty(newObj)) return
|
|
543
|
+
if(newObj.type === 'N' || this.$xdUniHelper.isEmpty(newObj)) return `0 0 0 rgba(0,0,0,0)`;
|
|
707
544
|
return this.getXdBorder(defaultObj,newObj,'shadow')
|
|
708
545
|
},
|
|
709
546
|
|
|
710
547
|
/**
|
|
711
548
|
* @description 边框样式生成
|
|
712
|
-
* @param
|
|
549
|
+
* @param defaultObj {Object} 默认值
|
|
713
550
|
* @param newObj {Object} 新组件对象
|
|
714
551
|
* @param type {string} border/shadow
|
|
715
552
|
* @return {string} 例如:`2rpx solid rgba(0,0,0,0)`
|
|
716
553
|
*/
|
|
717
|
-
getXdBorder(
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
if(this.$xdUniHelper.checkVarType(options) === 'array') {
|
|
725
|
-
if(options.length ===1) {
|
|
726
|
-
defaultObj = options[0];
|
|
727
|
-
gValue = options[0];
|
|
728
|
-
}
|
|
729
|
-
if(options.length ===2) {
|
|
730
|
-
defaultObj = options[0];
|
|
731
|
-
gValue = options[1];
|
|
732
|
-
}
|
|
733
|
-
}
|
|
734
|
-
|
|
735
|
-
//使用默认值
|
|
736
|
-
if((this.$xdUniHelper.isEmpty(newObj)) || newObj.type ==='D' ){
|
|
737
|
-
if(type === 'border') return `${gValue.width}rpx ${gValue.style||'solid'} ${gValue.color}`;
|
|
738
|
-
return `0 0 ${gValue.width}rpx ${gValue.color}`;
|
|
554
|
+
getXdBorder(defaultObj, newObj, type='border'){
|
|
555
|
+
//使用默认值()
|
|
556
|
+
if((this.$xdUniHelper.isEmpty(newObj) && defaultObj.type === 'D')
|
|
557
|
+
|| newObj.type ==='D'
|
|
558
|
+
){
|
|
559
|
+
if(type === 'border') return `${defaultObj.width * this.$rpxNum}px ${defaultObj.style||'solid'} ${defaultObj.color}`;
|
|
560
|
+
return `0 0 ${defaultObj.width}rpx ${defaultObj.color}`;
|
|
739
561
|
}
|
|
740
|
-
|
|
741
|
-
//border
|
|
742
562
|
if(newObj.type === 'N' || this.$xdUniHelper.isEmpty(newObj)) return `0`;
|
|
743
|
-
|
|
744
|
-
//Y
|
|
745
563
|
let width = defaultObj.width;
|
|
746
564
|
let color = defaultObj.color;
|
|
747
565
|
let style = defaultObj.style || 'solid';
|
|
748
566
|
let value = newObj.value || {};
|
|
749
|
-
if(value.width
|
|
567
|
+
if(value.width) width = value.width;
|
|
750
568
|
if(value.color) color = value.color;
|
|
751
569
|
if(value.style) style = value.style;
|
|
752
|
-
if(type === 'border') return `${width}
|
|
570
|
+
if(type === 'border') return `${width* this.$rpxNum}px ${style} ${color}`
|
|
753
571
|
return `0 0 ${width}rpx ${color}`;
|
|
754
572
|
},
|
|
755
573
|
|
|
756
574
|
/**
|
|
757
575
|
* @description 兼容新老border与shadow组件数据
|
|
758
576
|
* @param newObj {Object} 新对象border与shadow
|
|
759
|
-
* @param oldObj {Object} 新对象border与shadow
|
|
760
|
-
* @param oldObj.
|
|
761
|
-
* @param oldObj.width {number|string}老border与shadow的宽度字段
|
|
577
|
+
* @param oldObj {Object} 新对象border与shadow
|
|
578
|
+
* @param oldObj.width {Number}老border与shadow的宽度字段
|
|
762
579
|
* @param oldObj.color {String} 老border与shadow的颜色字段
|
|
763
580
|
* @param oldObj.style {String|undefined} 老border样式默认值:solid
|
|
764
581
|
* @param type {String}
|
|
765
|
-
* @param options {Array} 默认值
|
|
766
582
|
* @return {string} 例如:`2rpx solid rgba(0,0,0,0)`
|
|
767
583
|
*/
|
|
768
|
-
getBorderCompatibleOldStyle(newObj={}, oldObj={}, type='border'
|
|
769
|
-
|
|
770
|
-
let
|
|
771
|
-
let
|
|
772
|
-
let contrStyle = null;
|
|
773
|
-
let hasValue = false;
|
|
774
|
-
let gValue = '';
|
|
775
|
-
let dValue = '';
|
|
776
|
-
if(options.length === 1) {
|
|
777
|
-
dValue = options[0]
|
|
778
|
-
gValue = options[0];
|
|
779
|
-
}
|
|
780
|
-
if(options.length === 2) {
|
|
781
|
-
dValue = options[0]
|
|
782
|
-
gValue = options[1];
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
//等于默认选项直接返回默认值
|
|
787
|
-
if(newObj.type === 'D') return gValue;
|
|
584
|
+
getBorderCompatibleOldStyle(newObj={}, oldObj={}, type='border'){
|
|
585
|
+
let contWidth = 0;
|
|
586
|
+
let contColor = 'rgba(0.0.0.0)';
|
|
587
|
+
let contrStyle = 'solid';
|
|
788
588
|
|
|
789
589
|
if(oldObj.type === 'Y') {
|
|
790
|
-
hasValue = true;
|
|
791
590
|
if(oldObj.width !== undefined) contWidth = oldObj.width;
|
|
792
591
|
if(oldObj.color !== undefined) contColor = oldObj.color;
|
|
793
|
-
contrStyle = 'solid';
|
|
794
592
|
}
|
|
795
|
-
|
|
796
593
|
if(newObj.type === 'Y') {
|
|
797
|
-
hasValue = true;
|
|
798
594
|
let value = newObj.value || {};
|
|
799
595
|
if(value.color) contColor = value.color;
|
|
800
596
|
if(value.style) contrStyle = value.style;
|
|
801
|
-
if(value.width
|
|
597
|
+
if(value.width) contWidth = value.width;
|
|
802
598
|
}
|
|
803
599
|
|
|
804
|
-
//边距设置
|
|
805
600
|
if(type === 'border'){
|
|
806
|
-
if(
|
|
807
|
-
|
|
808
|
-
else return dValue
|
|
809
|
-
}
|
|
810
|
-
return '0'
|
|
601
|
+
if(oldObj.type === 'N' && newObj.type === 'N') return 0;
|
|
602
|
+
return `${contWidth* this.$rpxNum}px ${contrStyle} ${contColor}`
|
|
811
603
|
}
|
|
812
|
-
|
|
813
|
-
if(hasValue) {
|
|
814
|
-
if(contWidth !==null && contColor !== null) return `0 0 ${contWidth}rpx ${contColor}`
|
|
815
|
-
else return dValue
|
|
816
|
-
}
|
|
817
|
-
return 'none' ;
|
|
604
|
+
return `0 0 ${contWidth}rpx ${contColor}` ;
|
|
818
605
|
},
|
|
819
606
|
|
|
820
607
|
/**
|
|
821
608
|
* @description 兼容新老border与shadow组件数据
|
|
822
609
|
* @param newShadow {Object} 新对象border与shadow
|
|
823
610
|
* @param oldShadow {Object} 新对象border与shadow
|
|
824
|
-
* @param oldShadow.
|
|
825
|
-
* @param oldShadow.width {number|string} 老border与shadow的宽度字段
|
|
611
|
+
* @param oldShadow.width {Number}老border与shadow的宽度字段
|
|
826
612
|
* @param oldShadow.color {String} 老border与shadow的颜色字段
|
|
827
|
-
* @param options {Array} 默认值
|
|
828
613
|
* @return {string} 例如:`0,0,10rpx,rgba(0,0,0,1)`
|
|
829
614
|
*/
|
|
830
|
-
getShadowCompatibleOldStyle(newShadow={},oldShadow={}
|
|
831
|
-
return this.getBorderCompatibleOldStyle(newShadow,
|
|
615
|
+
getShadowCompatibleOldStyle(newShadow={},oldShadow={}){
|
|
616
|
+
return this.getBorderCompatibleOldStyle(newShadow,oldShadow, 'shadow')
|
|
832
617
|
},
|
|
833
618
|
|
|
834
619
|
/**
|
|
@@ -938,76 +723,12 @@ export default {
|
|
|
938
723
|
return this.checkValue(obj.bottom,bottom) + this.checkValue(obj.top,top);
|
|
939
724
|
},
|
|
940
725
|
|
|
941
|
-
//==检查自定义关联属性状态==========================
|
|
942
|
-
|
|
943
|
-
checkAttrEmpty(data){
|
|
944
|
-
//数组判断
|
|
945
|
-
if(this.$xdUniHelper.checkVarType(data) === 'array') return data.length === 0;
|
|
946
|
-
//对象判断
|
|
947
|
-
else if(this.$xdUniHelper.checkVarType(data) === 'object') return this.$xdUniHelper.isEmpty(data);
|
|
948
|
-
//字符串
|
|
949
|
-
else if(typeof data === 'string') return !data;
|
|
950
|
-
//其他
|
|
951
|
-
else return (typeof data === 'undefined' || data === null);
|
|
952
|
-
},
|
|
953
|
-
|
|
954
|
-
getRelationStatus(container, key, relation={}, dValue=null){
|
|
955
|
-
let props = container['component']['props']['content'];
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
//自定义属性已经设置值
|
|
959
|
-
if(props[key]) return props[key];
|
|
960
|
-
|
|
961
|
-
//检查关联属性状态
|
|
962
|
-
let tempStatus = [];
|
|
963
|
-
Object.keys(relation).map(sKey=>{
|
|
964
|
-
//边框与投影处理
|
|
965
|
-
if(relation[sKey][1] === 'bs') {
|
|
966
|
-
if(props[sKey]) {
|
|
967
|
-
if(['N','Y'].includes(props[sKey]['type'])) tempStatus.push(sKey);
|
|
968
|
-
}
|
|
969
|
-
}
|
|
970
|
-
//其他属性处理
|
|
971
|
-
else {
|
|
972
|
-
//有状态选项卡值
|
|
973
|
-
if(props[sKey]) {
|
|
974
|
-
if(props[sKey] === 'C') tempStatus.push(sKey);
|
|
975
|
-
}
|
|
976
|
-
//无状态选项卡值
|
|
977
|
-
else {
|
|
978
|
-
let has = [];
|
|
979
|
-
relation[sKey].map(item=>{
|
|
980
|
-
let noValue = this.checkAttrEmpty(props[item])
|
|
981
|
-
if(!noValue) has.push(noValue);
|
|
982
|
-
});
|
|
983
|
-
if(has.length > 0) tempStatus.push(sKey)
|
|
984
|
-
}
|
|
985
|
-
}
|
|
986
|
-
|
|
987
|
-
});
|
|
988
|
-
|
|
989
|
-
//关联属性某一个值已设置自定义选项值
|
|
990
|
-
if(tempStatus.length > 0) return 'none'
|
|
991
|
-
|
|
992
|
-
//已保存版本号
|
|
993
|
-
if(props['version'] === 'v2.0') {
|
|
994
|
-
return dValue
|
|
995
|
-
}
|
|
996
|
-
|
|
997
|
-
//未保存版本号
|
|
998
|
-
return 'none'
|
|
999
|
-
|
|
1000
|
-
},
|
|
1001
|
-
|
|
1002
|
-
//==检查自定义关联属性状态==========================
|
|
1003
|
-
|
|
1004
726
|
/**
|
|
1005
727
|
* @description 获取商品显示规则
|
|
1006
728
|
* @param container
|
|
1007
|
-
* @param cartStyle {String}
|
|
1008
729
|
* @return {{isAddCart: *, isShowDiscount: *, isPrice: *, is_show_brand: *, showActivityPrice: *, isShowTag: *, differ: *}}
|
|
1009
730
|
*/
|
|
1010
|
-
getProductConfig(container
|
|
731
|
+
getProductConfig(container){
|
|
1011
732
|
let is_show_brand = getContainerPropsValue(container, "content.is_show_brand", "N");
|
|
1012
733
|
let isPrice = getContainerPropsValue(container, "content.isPrice", "Y");
|
|
1013
734
|
let isShowDiscount = getContainerPropsValue(container, "content.isShowDiscount", "Y");
|
|
@@ -1016,13 +737,6 @@ export default {
|
|
|
1016
737
|
let isShowTag = getContainerPropsValue(container, "content.isShowTag", "Y");
|
|
1017
738
|
let isAddCart = getContainerPropsValue(container, "content.isAddCart", "N");
|
|
1018
739
|
let showFreeShipping = getContainerPropsValue(container, "content.showFreeShipping", "N");
|
|
1019
|
-
let cartIcon = '';
|
|
1020
|
-
let cartName = '';
|
|
1021
|
-
if(cartStyle) {
|
|
1022
|
-
cartIcon = getContainerPropsValue(container, "content.cartStyle", cartStyle);
|
|
1023
|
-
cartName = getContainerPropsValue(container, "content.cartName", '购买');
|
|
1024
|
-
}
|
|
1025
|
-
|
|
1026
740
|
return {
|
|
1027
741
|
isShowDiscount: isShowDiscount,
|
|
1028
742
|
isPrice: isPrice,
|
|
@@ -1031,9 +745,7 @@ export default {
|
|
|
1031
745
|
showActivityPrice:showActivityPrice,
|
|
1032
746
|
isShowTag : isShowTag,
|
|
1033
747
|
differ: differ,
|
|
1034
|
-
showFreeShipping: showFreeShipping
|
|
1035
|
-
cartIcon,
|
|
1036
|
-
cartName,
|
|
748
|
+
showFreeShipping: showFreeShipping
|
|
1037
749
|
}
|
|
1038
750
|
},
|
|
1039
751
|
|
|
@@ -1098,23 +810,19 @@ export default {
|
|
|
1098
810
|
|
|
1099
811
|
//#ifdef MP-WEIXIN
|
|
1100
812
|
let zb = this.baiduTogcj(latitude, longitude);
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
// }
|
|
1115
|
-
// console.log('success');
|
|
1116
|
-
// }
|
|
1117
|
-
// });
|
|
813
|
+
uni.openLocation({
|
|
814
|
+
latitude: zb[0],
|
|
815
|
+
longitude: zb[1],
|
|
816
|
+
name: name || '我的位置',
|
|
817
|
+
scale: 15,
|
|
818
|
+
address: address ||'',
|
|
819
|
+
success: function () {
|
|
820
|
+
if(typeof cb === 'function') {
|
|
821
|
+
cb();
|
|
822
|
+
}
|
|
823
|
+
console.log('success');
|
|
824
|
+
}
|
|
825
|
+
});
|
|
1118
826
|
//#endif
|
|
1119
827
|
//#ifdef H5
|
|
1120
828
|
if(isWechat()) this.webChatEnvOpenLocation({latitude,longitude, name, address}, cb);
|
|
@@ -1201,20 +909,6 @@ export default {
|
|
|
1201
909
|
return null;
|
|
1202
910
|
}
|
|
1203
911
|
},
|
|
1204
|
-
getTokenForKey(key='csrf_user_id'){
|
|
1205
|
-
let token = this.jfbAuthorize.getToken('user')
|
|
1206
|
-
if(token) {
|
|
1207
|
-
let arr = token.split('.');
|
|
1208
|
-
try {
|
|
1209
|
-
let uid = JSON.parse(Base64.decode(arr[1]));
|
|
1210
|
-
return uid[key];
|
|
1211
|
-
}catch (e) {
|
|
1212
|
-
return null;
|
|
1213
|
-
}
|
|
1214
|
-
}else {
|
|
1215
|
-
return null;
|
|
1216
|
-
}
|
|
1217
|
-
},
|
|
1218
912
|
|
|
1219
913
|
getProductTagsParams(conf=null,data={}){
|
|
1220
914
|
var temp = [];
|
|
@@ -1222,7 +916,6 @@ export default {
|
|
|
1222
916
|
isShowTag:"market",
|
|
1223
917
|
showActivityPrice:"flashsale",
|
|
1224
918
|
showTag: "market",
|
|
1225
|
-
showParams: 'param'
|
|
1226
919
|
}
|
|
1227
920
|
try{
|
|
1228
921
|
if(conf) {
|
|
@@ -1248,10 +941,9 @@ export default {
|
|
|
1248
941
|
getProductTagsKeys(conf=null,container,type='productList'){
|
|
1249
942
|
let defaultValue
|
|
1250
943
|
if(type==='productList' ){
|
|
1251
|
-
defaultValue = ["isShowTag","showActivityPrice"
|
|
1252
|
-
}
|
|
1253
|
-
|
|
1254
|
-
defaultValue = ["showTag","showActivityPrice",'showParams']
|
|
944
|
+
defaultValue = ["isShowTag","showActivityPrice"]
|
|
945
|
+
} else {
|
|
946
|
+
defaultValue = ["showTag","showActivityPrice"]
|
|
1255
947
|
}
|
|
1256
948
|
try{
|
|
1257
949
|
if(conf) conf = JSON.parse(conf).keys;
|