jufubao-base 1.0.290-beta3 → 1.0.290
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/CusCouponChose/CusCouponChose.vue +1027 -0
- package/src/components/CusCouponItem/CusCouponItem.vue +298 -0
- package/src/components/CusEnter/CusEnter.vue +360 -0
- package/src/components/CusPoster/CusPoster.vue +212 -0
- package/src/components/CusPoster/CusSwiperDot.vue +234 -0
- package/src/components/CusProduct/CusProduct.vue +372 -0
- package/src/components/CusShops/CusShops.vue +518 -0
- package/src/components/CusSwiperDot/CusSwiperDot.vue +234 -0
- package/src/components/CusTab/CusTab.vue +411 -0
- package/src/components/CusVideo/CusVideo.vue +170 -0
- package/src/components/JfbBaseFooter/Attr.js +10 -155
- package/src/components/JfbBaseFooter/JfbBaseFooter.vue +98 -44
- package/src/components/JfbBaseFooter/XdFooterBar.vue +324 -0
- package/src/components/JfbBaseFooter/cusAttr/advanced.js +12 -0
- package/src/components/JfbBaseFooter/cusAttr/content.js +475 -0
- package/src/components/JfbBaseFooter/cusAttr/style.js +7 -0
- package/src/components/JfbBaseFooter/cusAttr/tools.js +17 -0
- package/src/components/JfbBaseSavingDetail/JfbBaseSavingDetail.vue +3 -15
- package/src/components/JfbBaseTfkSearch/Api.js +15 -0
- package/src/components/JfbBaseTfkSearch/CustomList.vue +10 -0
- package/src/components/JfbBaseTfkSearch/JfbBaseTfkSearch.vue +255 -7
- package/src/components/JfbBaseTfkSearch/XdQueryFilter.vue +347 -0
- package/src/components/JfbBaseTfkSearch/XdQuerySort.vue +192 -0
- package/src/components/JfbBaseTfkSearch/listMixins.js +8 -6
- package/src/components/JfbBaseUserInfo/Attr.js +12 -0
- package/src/components/JfbBaseUserInfo/JfbBaseUserInfo.vue +8 -2
- package/src/mixins/componentsMixins.js +363 -55
- package/src/mixins/posterMixins.js +27 -199
- package/src/mixins/productCompMixins.js +252 -0
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
import {getContainerFnPropsValue, getContainerPropsValue,isWechat} from "@/utils/xd.base";
|
|
3
|
+
import {gCPVal,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";
|
|
9
11
|
|
|
10
12
|
|
|
11
13
|
export default {
|
|
@@ -106,6 +108,7 @@ export default {
|
|
|
106
108
|
active: false, //是否选择当前状态
|
|
107
109
|
isEditx: true, //当前为Editx模式
|
|
108
110
|
edit: false, //是否开启编辑模式
|
|
111
|
+
isRefDelIcon: true, //引用情况设置关闭按钮
|
|
109
112
|
// #endif
|
|
110
113
|
|
|
111
114
|
//风格键
|
|
@@ -137,7 +140,13 @@ export default {
|
|
|
137
140
|
"op_user_id": "",
|
|
138
141
|
"created_time": 0,
|
|
139
142
|
"updated_time": 0
|
|
140
|
-
}
|
|
143
|
+
},
|
|
144
|
+
|
|
145
|
+
//全局样式
|
|
146
|
+
gStyleValue:{}, //转化好的值
|
|
147
|
+
gObjStyleValue:{}, //对象数据
|
|
148
|
+
gOrgStyleValue:{}, //原始数据
|
|
149
|
+
|
|
141
150
|
}
|
|
142
151
|
},
|
|
143
152
|
|
|
@@ -165,6 +174,14 @@ export default {
|
|
|
165
174
|
if (this.$vnode && this.$vnode.tag) tag = this.$vnode.tag;
|
|
166
175
|
this.$xdLog.setProject('App.components.start', `App.components.vnode.name.${tag}`);
|
|
167
176
|
|
|
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
|
+
|
|
168
185
|
//设置插件cid
|
|
169
186
|
if (this.cid) {
|
|
170
187
|
this.containerId = this.cid;
|
|
@@ -204,6 +221,8 @@ export default {
|
|
|
204
221
|
// #endif
|
|
205
222
|
},
|
|
206
223
|
|
|
224
|
+
|
|
225
|
+
|
|
207
226
|
//#ifdef H5
|
|
208
227
|
mounted() {
|
|
209
228
|
let that = this;
|
|
@@ -277,16 +296,35 @@ export default {
|
|
|
277
296
|
&& this.$configProject.NODE_ENV === 'development'
|
|
278
297
|
&& this.$configProject.viewType === 'pack'
|
|
279
298
|
){
|
|
280
|
-
|
|
299
|
+
that.isEditx = false;
|
|
281
300
|
}
|
|
282
|
-
|
|
283
301
|
},
|
|
284
302
|
// #endif
|
|
285
303
|
|
|
286
304
|
computed:{
|
|
287
305
|
...mapState({
|
|
288
306
|
pageNamespace: state=> state.pageBusinessCode,
|
|
289
|
-
|
|
307
|
+
jfbAuthorize: state=> state.jfbAuthorize,
|
|
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
|
+
},
|
|
290
328
|
},
|
|
291
329
|
|
|
292
330
|
watch:{
|
|
@@ -299,6 +337,90 @@ export default {
|
|
|
299
337
|
...mapActions(['setXNamespace','setStyleCommon','wxCodeForGetAppId']),
|
|
300
338
|
...mapMutations(['setCurrentStyle']),
|
|
301
339
|
|
|
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
|
+
|
|
302
424
|
/**
|
|
303
425
|
* @description 自动生成调试模式
|
|
304
426
|
*/
|
|
@@ -316,8 +438,6 @@ export default {
|
|
|
316
438
|
}
|
|
317
439
|
},
|
|
318
440
|
|
|
319
|
-
|
|
320
|
-
|
|
321
441
|
/**
|
|
322
442
|
* @description 检查是否同域名
|
|
323
443
|
* @param url
|
|
@@ -338,12 +458,17 @@ export default {
|
|
|
338
458
|
},
|
|
339
459
|
// #endif
|
|
340
460
|
|
|
341
|
-
setNameSpace(options){
|
|
461
|
+
setNameSpace(options, isAlert=true){
|
|
342
462
|
this.xnamespace = this.xnamespace || this.pageNamespace;
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
463
|
+
|
|
464
|
+
//不检查业务线
|
|
465
|
+
if(isAlert) {
|
|
466
|
+
if(!this.xnamespace && !this.$configProject.isPreview){
|
|
467
|
+
this.$xdAlert({content: '未设置业务编码',type:'error'});
|
|
468
|
+
throw new Error('请配置业务编码')
|
|
469
|
+
}
|
|
346
470
|
}
|
|
471
|
+
|
|
347
472
|
this.setXNamespace(this.xnamespace)
|
|
348
473
|
},
|
|
349
474
|
|
|
@@ -426,6 +551,9 @@ export default {
|
|
|
426
551
|
Object.keys(this.styles).map(key => {
|
|
427
552
|
let k = key.replace('$', '');
|
|
428
553
|
if (this[k] !== undefined){
|
|
554
|
+
if(typeof this.styles[key] === 'string'){
|
|
555
|
+
this.styles[key] = this.styles[key].trim()
|
|
556
|
+
}
|
|
429
557
|
this[k] = this.styles[key];
|
|
430
558
|
current[k] = this.styles[key];
|
|
431
559
|
}
|
|
@@ -460,25 +588,44 @@ export default {
|
|
|
460
588
|
* @description 点击选择插件显示边框
|
|
461
589
|
*/
|
|
462
590
|
handleEditxSelect() {
|
|
591
|
+
|
|
463
592
|
//加载本地业务插件库
|
|
464
593
|
if (this.noBorder) return;
|
|
465
594
|
|
|
466
595
|
//#ifdef H5
|
|
467
596
|
if (this.active) return;
|
|
468
597
|
this.active = true;
|
|
598
|
+
|
|
469
599
|
let AttrObj = this.$xdUniHelper.checkVarType(this.Attr) === 'object' ?
|
|
470
600
|
this.$xdUniHelper.customClone(this.Attr) : {style: [], advanced: [], content: []};
|
|
471
601
|
|
|
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
|
+
|
|
472
612
|
//设置已绑定数据
|
|
473
613
|
Object.keys(AttrObj).map(type => {
|
|
474
614
|
//配置的是方法
|
|
475
615
|
if (type === 'style' || type === 'advanced' || type === 'content') {
|
|
476
616
|
if (typeof AttrObj[type] === "function") {
|
|
477
617
|
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;
|
|
478
625
|
let Attr = this.$xdUniHelper.customClone(this.Attr);
|
|
479
626
|
AttrObj[`${type}.isFn`] = true;
|
|
480
627
|
AttrObj[`${type}.Fn`] = Attr[type];
|
|
481
|
-
AttrObj[type] = Attr[type](params);
|
|
628
|
+
AttrObj[type] = Attr[type](params, defaultGValue, gStyleColor);
|
|
482
629
|
} else {
|
|
483
630
|
AttrObj[type].map(item => {
|
|
484
631
|
if (item.value !== undefined) {
|
|
@@ -494,16 +641,32 @@ export default {
|
|
|
494
641
|
});
|
|
495
642
|
|
|
496
643
|
//发送点击组件事件
|
|
644
|
+
let sendContainer = this.$xdUniHelper.cloneDeep(this.container);
|
|
645
|
+
sendContainer.defaultData = this.$xdUniHelper.cloneDeep(this.gStyleValue||{});//设置全局默认值
|
|
646
|
+
sendContainer.gStyleColor = this.$xdUniHelper.cloneDeep(gStyleColor);//设置全局默认值
|
|
647
|
+
|
|
497
648
|
XdBus.send('onSelectPackage', {
|
|
498
649
|
containerId: this.containerId,
|
|
499
650
|
Attr: this.$xdUniHelper.customClone(AttrObj),
|
|
500
|
-
container:
|
|
651
|
+
container: sendContainer
|
|
501
652
|
});
|
|
502
653
|
|
|
503
654
|
//绑定选中插件事件
|
|
504
655
|
XdBus.message('select', {
|
|
505
656
|
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
|
+
}
|
|
506
666
|
})
|
|
667
|
+
|
|
668
|
+
|
|
669
|
+
|
|
507
670
|
//#endif
|
|
508
671
|
},
|
|
509
672
|
|
|
@@ -540,80 +703,132 @@ export default {
|
|
|
540
703
|
* @return {string} 例如:`0,0,10rpx,rgba(0,0,0,0)`
|
|
541
704
|
*/
|
|
542
705
|
getXdShadow(defaultObj, newObj){
|
|
543
|
-
if(newObj.type === 'N' || this.$xdUniHelper.isEmpty(newObj)) return
|
|
706
|
+
if(newObj.type === 'N' || this.$xdUniHelper.isEmpty(newObj)) return 'none';
|
|
544
707
|
return this.getXdBorder(defaultObj,newObj,'shadow')
|
|
545
708
|
},
|
|
546
709
|
|
|
547
710
|
/**
|
|
548
711
|
* @description 边框样式生成
|
|
549
|
-
* @param
|
|
712
|
+
* @param options {Object|Array} 默认值
|
|
550
713
|
* @param newObj {Object} 新组件对象
|
|
551
714
|
* @param type {string} border/shadow
|
|
552
715
|
* @return {string} 例如:`2rpx solid rgba(0,0,0,0)`
|
|
553
716
|
*/
|
|
554
|
-
getXdBorder(
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
717
|
+
getXdBorder(options, newObj, type='border'){
|
|
718
|
+
let defaultObj = {};
|
|
719
|
+
let gValue = {};
|
|
720
|
+
if(this.$xdUniHelper.checkVarType(options) === 'object') {
|
|
721
|
+
defaultObj = this.$xdUniHelper.cloneDeep(options);
|
|
722
|
+
gValue = this.$xdUniHelper.cloneDeep(options);
|
|
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}`;
|
|
561
739
|
}
|
|
740
|
+
|
|
741
|
+
//border
|
|
562
742
|
if(newObj.type === 'N' || this.$xdUniHelper.isEmpty(newObj)) return `0`;
|
|
743
|
+
|
|
744
|
+
//Y
|
|
563
745
|
let width = defaultObj.width;
|
|
564
746
|
let color = defaultObj.color;
|
|
565
747
|
let style = defaultObj.style || 'solid';
|
|
566
748
|
let value = newObj.value || {};
|
|
567
|
-
if(value.width) width = value.width;
|
|
749
|
+
if(value.width !== undefined) width = value.width;
|
|
568
750
|
if(value.color) color = value.color;
|
|
569
751
|
if(value.style) style = value.style;
|
|
570
|
-
if(type === 'border') return `${width
|
|
752
|
+
if(type === 'border') return `${width}rpx ${style} ${color}`
|
|
571
753
|
return `0 0 ${width}rpx ${color}`;
|
|
572
754
|
},
|
|
573
755
|
|
|
574
756
|
/**
|
|
575
757
|
* @description 兼容新老border与shadow组件数据
|
|
576
758
|
* @param newObj {Object} 新对象border与shadow
|
|
577
|
-
* @param oldObj {Object} 新对象border与shadow
|
|
578
|
-
* @param oldObj.
|
|
759
|
+
* @param oldObj {Object} 新对象border与shadow,老数据
|
|
760
|
+
* @param oldObj.type {string}
|
|
761
|
+
* @param oldObj.width {number|string}老border与shadow的宽度字段
|
|
579
762
|
* @param oldObj.color {String} 老border与shadow的颜色字段
|
|
580
763
|
* @param oldObj.style {String|undefined} 老border样式默认值:solid
|
|
581
764
|
* @param type {String}
|
|
765
|
+
* @param options {Array} 默认值
|
|
582
766
|
* @return {string} 例如:`2rpx solid rgba(0,0,0,0)`
|
|
583
767
|
*/
|
|
584
|
-
getBorderCompatibleOldStyle(newObj={}, oldObj={}, type='border'){
|
|
585
|
-
|
|
586
|
-
let
|
|
587
|
-
let
|
|
768
|
+
getBorderCompatibleOldStyle(newObj={}, oldObj={}, type='border', options=[]){
|
|
769
|
+
|
|
770
|
+
let contWidth = null;
|
|
771
|
+
let contColor = null;
|
|
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;
|
|
588
788
|
|
|
589
789
|
if(oldObj.type === 'Y') {
|
|
790
|
+
hasValue = true;
|
|
590
791
|
if(oldObj.width !== undefined) contWidth = oldObj.width;
|
|
591
792
|
if(oldObj.color !== undefined) contColor = oldObj.color;
|
|
793
|
+
contrStyle = 'solid';
|
|
592
794
|
}
|
|
795
|
+
|
|
593
796
|
if(newObj.type === 'Y') {
|
|
797
|
+
hasValue = true;
|
|
594
798
|
let value = newObj.value || {};
|
|
595
799
|
if(value.color) contColor = value.color;
|
|
596
800
|
if(value.style) contrStyle = value.style;
|
|
597
|
-
if(value.width) contWidth = value.width;
|
|
801
|
+
if(value.width !== undefined) contWidth = value.width;
|
|
598
802
|
}
|
|
599
803
|
|
|
804
|
+
//边距设置
|
|
600
805
|
if(type === 'border'){
|
|
601
|
-
if(
|
|
602
|
-
|
|
806
|
+
if(hasValue) {
|
|
807
|
+
if(contWidth !==null && contColor !== null) return `${contWidth* this.$rpxNum}px ${contrStyle} ${contColor}`
|
|
808
|
+
else return dValue
|
|
809
|
+
}
|
|
810
|
+
return '0'
|
|
603
811
|
}
|
|
604
|
-
|
|
812
|
+
//投影值
|
|
813
|
+
if(hasValue) {
|
|
814
|
+
if(contWidth !==null && contColor !== null) return `0 0 ${contWidth}rpx ${contColor}`
|
|
815
|
+
else return dValue
|
|
816
|
+
}
|
|
817
|
+
return 'none' ;
|
|
605
818
|
},
|
|
606
819
|
|
|
607
820
|
/**
|
|
608
821
|
* @description 兼容新老border与shadow组件数据
|
|
609
822
|
* @param newShadow {Object} 新对象border与shadow
|
|
610
823
|
* @param oldShadow {Object} 新对象border与shadow
|
|
611
|
-
* @param oldShadow.
|
|
824
|
+
* @param oldShadow.type {string}
|
|
825
|
+
* @param oldShadow.width {number|string} 老border与shadow的宽度字段
|
|
612
826
|
* @param oldShadow.color {String} 老border与shadow的颜色字段
|
|
827
|
+
* @param options {Array} 默认值
|
|
613
828
|
* @return {string} 例如:`0,0,10rpx,rgba(0,0,0,1)`
|
|
614
829
|
*/
|
|
615
|
-
getShadowCompatibleOldStyle(newShadow={},oldShadow={}){
|
|
616
|
-
return this.getBorderCompatibleOldStyle(newShadow,oldShadow, 'shadow')
|
|
830
|
+
getShadowCompatibleOldStyle(newShadow={},oldShadow={}, options){
|
|
831
|
+
return this.getBorderCompatibleOldStyle(newShadow, oldShadow, 'shadow', options)
|
|
617
832
|
},
|
|
618
833
|
|
|
619
834
|
/**
|
|
@@ -723,12 +938,76 @@ export default {
|
|
|
723
938
|
return this.checkValue(obj.bottom,bottom) + this.checkValue(obj.top,top);
|
|
724
939
|
},
|
|
725
940
|
|
|
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
|
+
|
|
726
1004
|
/**
|
|
727
1005
|
* @description 获取商品显示规则
|
|
728
1006
|
* @param container
|
|
1007
|
+
* @param cartStyle {String}
|
|
729
1008
|
* @return {{isAddCart: *, isShowDiscount: *, isPrice: *, is_show_brand: *, showActivityPrice: *, isShowTag: *, differ: *}}
|
|
730
1009
|
*/
|
|
731
|
-
getProductConfig(container){
|
|
1010
|
+
getProductConfig(container,{cartStyle=''}={}){
|
|
732
1011
|
let is_show_brand = getContainerPropsValue(container, "content.is_show_brand", "N");
|
|
733
1012
|
let isPrice = getContainerPropsValue(container, "content.isPrice", "Y");
|
|
734
1013
|
let isShowDiscount = getContainerPropsValue(container, "content.isShowDiscount", "Y");
|
|
@@ -737,6 +1016,13 @@ export default {
|
|
|
737
1016
|
let isShowTag = getContainerPropsValue(container, "content.isShowTag", "Y");
|
|
738
1017
|
let isAddCart = getContainerPropsValue(container, "content.isAddCart", "N");
|
|
739
1018
|
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
|
+
|
|
740
1026
|
return {
|
|
741
1027
|
isShowDiscount: isShowDiscount,
|
|
742
1028
|
isPrice: isPrice,
|
|
@@ -745,7 +1031,9 @@ export default {
|
|
|
745
1031
|
showActivityPrice:showActivityPrice,
|
|
746
1032
|
isShowTag : isShowTag,
|
|
747
1033
|
differ: differ,
|
|
748
|
-
showFreeShipping: showFreeShipping
|
|
1034
|
+
showFreeShipping: showFreeShipping,
|
|
1035
|
+
cartIcon,
|
|
1036
|
+
cartName,
|
|
749
1037
|
}
|
|
750
1038
|
},
|
|
751
1039
|
|
|
@@ -810,19 +1098,23 @@ export default {
|
|
|
810
1098
|
|
|
811
1099
|
//#ifdef MP-WEIXIN
|
|
812
1100
|
let zb = this.baiduTogcj(latitude, longitude);
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
1101
|
+
let mapInfo = Base64.encodeURI(JSON.stringify([name,address,zb, this.mainColor]));
|
|
1102
|
+
uni.navigateTo({
|
|
1103
|
+
url: `/pages/location/location?map=${mapInfo}`
|
|
1104
|
+
})
|
|
1105
|
+
// uni.openLocation({
|
|
1106
|
+
// latitude: zb[0],
|
|
1107
|
+
// longitude: zb[1],
|
|
1108
|
+
// name: name || '我的位置',
|
|
1109
|
+
// scale: 15,
|
|
1110
|
+
// address: address ||'',
|
|
1111
|
+
// success: function () {
|
|
1112
|
+
// if(typeof cb === 'function') {
|
|
1113
|
+
// cb();
|
|
1114
|
+
// }
|
|
1115
|
+
// console.log('success');
|
|
1116
|
+
// }
|
|
1117
|
+
// });
|
|
826
1118
|
//#endif
|
|
827
1119
|
//#ifdef H5
|
|
828
1120
|
if(isWechat()) this.webChatEnvOpenLocation({latitude,longitude, name, address}, cb);
|
|
@@ -909,6 +1201,20 @@ export default {
|
|
|
909
1201
|
return null;
|
|
910
1202
|
}
|
|
911
1203
|
},
|
|
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
|
+
},
|
|
912
1218
|
|
|
913
1219
|
getProductTagsParams(conf=null,data={}){
|
|
914
1220
|
var temp = [];
|
|
@@ -916,6 +1222,7 @@ export default {
|
|
|
916
1222
|
isShowTag:"market",
|
|
917
1223
|
showActivityPrice:"flashsale",
|
|
918
1224
|
showTag: "market",
|
|
1225
|
+
showParams: 'param'
|
|
919
1226
|
}
|
|
920
1227
|
try{
|
|
921
1228
|
if(conf) {
|
|
@@ -941,9 +1248,10 @@ export default {
|
|
|
941
1248
|
getProductTagsKeys(conf=null,container,type='productList'){
|
|
942
1249
|
let defaultValue
|
|
943
1250
|
if(type==='productList' ){
|
|
944
|
-
defaultValue = ["isShowTag","showActivityPrice"]
|
|
945
|
-
}
|
|
946
|
-
|
|
1251
|
+
defaultValue = ["isShowTag","showActivityPrice",'showParams']
|
|
1252
|
+
}
|
|
1253
|
+
else {
|
|
1254
|
+
defaultValue = ["showTag","showActivityPrice",'showParams']
|
|
947
1255
|
}
|
|
948
1256
|
try{
|
|
949
1257
|
if(conf) conf = JSON.parse(conf).keys;
|