jufubao-mall 2.0.20-beta1 → 2.0.20-beta2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-mall",
3
- "version": "2.0.20-beta1",
3
+ "version": "2.0.20-beta2",
4
4
  "private": false,
5
5
  "description": "聚福宝商城业务组件插件包",
6
6
  "main": "index.js",
@@ -1,6 +1,6 @@
1
1
  <template>
2
- <view class="jfb-filter" v-if="showQuery === 'Y'">
3
- <view class="jfb-filter-placeholder" :style="[placeholderStyleComp]" ></view>
2
+ <view class="jfb-filter" v-if="showQuery === 'Y'" :style="[cssStyle]">
3
+ <view class="jfb-filter-placeholder" :style="[placeholderStyleComp]"></view>
4
4
  <view class="jfb-filter-menu" :style="[cusMenuStyle,menuStyleTopComp]">
5
5
  <template v-if="sortList.length > 0">
6
6
  <view
@@ -251,7 +251,8 @@ export default {
251
251
  menuStyleTopComp(){
252
252
  return {
253
253
  zIndex: this.showQueryModal ? 1002 : 1,
254
- ...this.queryMaskComp
254
+ position:this.$configProject.isPreview?'absolute':'fixed',
255
+ top: this.$configProject.isPreview ? 0 : this.queryMaskComp.top
255
256
  }
256
257
  },
257
258
  queryTopComp(){
@@ -271,7 +272,7 @@ export default {
271
272
  otherMenuComp(){
272
273
  let height = 48; //菜单高度
273
274
  let maxHeight = this.$root.layoutInfo['bodyMinHeightRpx'] - (300 + height + this.topHeight) ;
274
- if(this.$configProject.isPreview) maxHeight = 800;
275
+ if(this.$configProject.isPreview) maxHeight = 600;
275
276
  return {
276
277
  backgroundColor: this.cusPopStyle['filterListColor'] || '#f8f8f8',
277
278
  maxHeight: maxHeight + 'rpx',
@@ -335,6 +336,20 @@ export default {
335
336
  }
336
337
  }
337
338
  return params
339
+ },
340
+ cssStyle(){
341
+ let filterListColor = this.cusPopStyle['filterListColor'] || '#f8f8f8';
342
+ if(Color(filterListColor).isDark()) filterListColor = Color(filterListColor).lighten(0.8).toString();
343
+ else if(Color(filterListColor).isLight()) filterListColor = Color(filterListColor).darken(0.03).toString();
344
+
345
+ let menuListColor = this.cusPopStyle['backgroundColor'] || '#fff';
346
+ if(Color(menuListColor).isDark()) menuListColor = Color(menuListColor).lighten(0.8).toString();
347
+ else if(Color(menuListColor).isLight()) menuListColor = Color(menuListColor).darken(0.03).toString();
348
+
349
+ return {
350
+ '--com-pop-border': filterListColor,
351
+ '--com-menu-border': menuListColor
352
+ }
338
353
  }
339
354
  },
340
355
  watch:{
@@ -623,7 +638,6 @@ export default {
623
638
  this.closeQueryModal();
624
639
  },
625
640
  switchOtherOpen(tab){
626
- debugger
627
641
  this.filterTabs = this.filterTabs.map(item => {
628
642
  if(JSON.stringify(tab.value) === JSON.stringify(item.value)) item['open'] = !item['open'];
629
643
  return item;
@@ -749,6 +763,7 @@ export default {
749
763
 
750
764
  <style scoped lang="less">
751
765
  .jfb-filter {
766
+ position: relative;
752
767
  &-placeholder {
753
768
  font-size: 20rpx;
754
769
  }
@@ -758,8 +773,7 @@ export default {
758
773
  left: 0;
759
774
  right: 0;
760
775
  z-index: 100;
761
- border-top: 1px solid #F5F5F5;
762
- width: 100%;
776
+ border-top: 1px solid var(--com-menu-border);
763
777
  display: flex;
764
778
  justify-content: space-around;
765
779
  height: 48rpx;
@@ -831,7 +845,7 @@ export default {
831
845
  .xd-query-sort{
832
846
  &-item {
833
847
  height: 80rpx;
834
- border-bottom: 1rpx solid #f8f8f8;
848
+ border-bottom: 1rpx solid var(--com-pop-border);
835
849
  line-height: 80rpx;
836
850
  padding-left: 80rpx;
837
851
  color: #999;
@@ -416,15 +416,22 @@
416
416
  allIcon(){
417
417
  this.handleAllChange()
418
418
  },
419
+
419
420
  allName(){
420
421
  this.handleAllChange()
421
422
  },
423
+
422
424
  showCategory(val){
423
425
  if(this.$configProject.isPreview) {
424
426
  if(val === 'Y') this.getCategoryList();
425
427
  else this.navList = [];
426
428
  }
429
+ },
427
430
 
431
+ parentId(){
432
+ if(this.$configProject.isPreview) {
433
+ this.getCategoryList();
434
+ }
428
435
  },
429
436
 
430
437
  need_show_tags(value,oldValue) {
@@ -440,7 +447,7 @@
440
447
  },
441
448
  onLoadStatus(){
442
449
  if(this.initStatus && this.onLoadStatus) this.handleInit();
443
- }
450
+ },
444
451
 
445
452
  },
446
453
  created() {
@@ -554,6 +561,13 @@
554
561
  //基础
555
562
  this.sort = gCPVal(container, "sort", "default");
556
563
  this.version = gCPVal(container, 'version', '');
564
+ let categoryParentType = gCPVal(container, 'categoryParentType', 'root');
565
+ if(categoryParentType === 'root') this.parentId = 0;
566
+ else {
567
+ let categoryParent = gCPVal(container, 'categoryParent', '');
568
+ if(!categoryParent) this.parentId = 0;
569
+ else this.parentId = categoryParent;
570
+ }
557
571
  this.xnamespace = gCPVal(container, 'xnamespace', this.projectAttr.business_code||this.xnamespace);
558
572
  this.listPadding = gCPVal(container,'listPadding', [{top:16, left:16, right:16,bottom:16},20], {sKey:'listPaddingStatus',fields:['listPadding'],isPMR: true});
559
573
  this.contentColor = gCPVal(container,'contentColor', ['#f8f8f8','#fafafa'], {sKey:'contentColorStatus',fields:['contentColor']});
@@ -593,7 +607,7 @@
593
607
 
594
608
  //==过滤区域============
595
609
  let categoryLayout = gCPVal(container, "categoryLayout", "v1");
596
- let category = 'v2'//gCPVal(container, 'category',categoryLayout);
610
+ let category = gCPVal(container, 'category',categoryLayout);
597
611
 
598
612
  //是否显示过滤菜单
599
613
  let showQuery = gCPVal(container, "showQuery", 'Y');
@@ -604,7 +618,7 @@
604
618
  else this.isFilterMenuForFilterFields = [];
605
619
  //是否显示品牌菜单
606
620
  let showBrandFilter = gCPVal(container, "showBrandFilter", "in");
607
-
621
+ let filterModeSort = ['common','price','host','brand','delivery_method','filter'];
608
622
  //菜单设置
609
623
  let filterMode = [];
610
624
  if(showQuery === 'Y') {
@@ -616,6 +630,8 @@
616
630
  if(showBrandFilter === 'out') filterMode.push('brand');
617
631
  filterMode.push('filter');
618
632
  }
633
+ //已经设置
634
+ else filterMode = this.$xdUniHelper.cloneDeep(filterModeArr);
619
635
 
620
636
  //设置条件
621
637
  if(filterMode.length <= 4 && filterMode.length >=2) {
@@ -786,6 +802,8 @@
786
802
  const subTitleIconBorder = gCPVal(container, 'subTitleIconBorder', [{style:'solid', width: '2', color: this.mainColor},'0'], {isBorder:true});
787
803
  let navStyle = gCPVal(container, 'navStyle', 'line-6-8-s');
788
804
  if(navStyle.indexOf('line-') === 0) navStyle = 'line-6-8-s';
805
+ const iconWdith = gCPVal(container, 'iconWdith', [100],{sKey:'iconWdithStatus', fields:['iconWdith']});
806
+ const iconBgColor = gCPVal(container, 'iconBgColor', [100],{sKey:'iconBgColorStatus', fields:['iconBgColor']});
789
807
 
790
808
  this.tabStyle = {
791
809
  titleColor,
@@ -797,6 +815,8 @@
797
815
  titleActFontWeight,
798
816
  subTitleIconShadow,
799
817
  subTitleIconBorder,
818
+ iconWdith,
819
+ iconBgColor,
800
820
  titleBgColor,
801
821
  titleActBgColor,
802
822
  level2Name,
@@ -5,6 +5,8 @@ module.exports = {
5
5
  items: [
6
6
  {
7
7
  title: '配送方式',
8
+ value:'delivery_method',
9
+ multiple: false,
8
10
  options: [
9
11
  {
10
12
  label: '同城配送',
@@ -25,6 +27,8 @@ module.exports = {
25
27
  },
26
28
  {
27
29
  title: "品牌",
30
+ value:'brand',
31
+ multiple: true,
28
32
  options: [
29
33
  {"label":"美克斯","value":"100787","icon":"//img.jufubao.cn\/uploads\/20240311\/ef2f44e422d73d9b09746cfe0b2c312d.jpg?x-oss-process=style/size4"},
30
34
  {"label":"DOCTOR LI","value":"100535","icon":"//img.jufubao.cn\/uploads\/20240102\/924d9c1b4a06d8a47dfe53a6a6b529b6.png?x-oss-process=style/size4"},
@@ -65,6 +69,8 @@ module.exports = {
65
69
  },
66
70
  {
67
71
  title: "尺寸",
72
+ value:'attr',
73
+ multiple: false,
68
74
  options: [
69
75
  { label: "≤4英寸", value: "size-1" },
70
76
  { label: "6英寸", value: "size-2" },
@@ -75,6 +81,8 @@ module.exports = {
75
81
  },
76
82
  {
77
83
  title: "适用场景",
84
+ value:'attr',
85
+ multiple: true,
78
86
  options: [
79
87
  { label: "生日", value: "scene-1" },
80
88
  { label: "下午茶", value: "scene-2" },
@@ -3,7 +3,7 @@
3
3
  <view v-if="!isFixed" class="category_wrap-mask" :style="[categoryWarperMaskComp]" ></view>
4
4
  <view
5
5
  class="category_wraper"
6
- :style="{top:(layoutInfo['top']) + 'rpx'}"
6
+ :style="[categoryWaperComp]"
7
7
  >
8
8
  <view v-if="showParent && isShowCategory" >
9
9
  <view class="tab_wrap" :style="[{backgroundColor:titleBgcColor}]">
@@ -40,20 +40,22 @@
40
40
  :key="sub_category_list"
41
41
  class="sub_category_list"
42
42
  >
43
-
44
43
  <view v-for="(sub,i) in imageIconList" :key="sub.category_id" class="sub_cate icon">
45
44
  <view
46
45
  :id="'cate-scroll__index-'+i"
47
46
  @click="handleCateClick(sub, 1)"
48
47
  >
49
- <view :style="[sub.category_id === (['child','parentNew'].includes(showType)? uiPid:cateId )?subActTitleIcon:subTitleIcon]" class="sub_icon">
50
- <view :style="[subTitleInIcon]">
48
+ <view
49
+ :style="[sub.category_id === (['child','parentNew'].includes(showType)? uiPid:uiCateId )?subActTitleIcon:subTitleIcon,subTitleInIcon]"
50
+ class="sub_icon"
51
+ >
52
+ <view>
51
53
  <image :src="sub.category_icon" style="width:100%;height:100%"/>
52
54
  </view>
53
55
  </view>
54
56
  <view
55
57
  class="sub_name"
56
- :style="[sub.category_id === (['child','parentNew'].includes(showType)? uiPid:cateId )?level2ActNameComp:level2NameComp]"
58
+ :style="[sub.category_id === (['child','parentNew'].includes(showType)? uiPid:uiCateId )?level2ActNameComp:level2NameComp]"
57
59
  >{{sub.category_name}}</view>
58
60
  </view>
59
61
  </view>
@@ -89,6 +91,7 @@
89
91
  import CusTab from "@/components/CusTab/CusTab.vue"
90
92
  import getServiceUrl from "@/common/getServiceUrl";
91
93
  import cateMixins from "./cateMixins";
94
+ import Color from "color";
92
95
  export default {
93
96
  components: {
94
97
  CusTab
@@ -250,7 +253,12 @@ export default {
250
253
  return {height: height + 'rpx'}
251
254
  },
252
255
  subTitleInIcon(){
253
- return {}
256
+ let {iconWdith, iconBgColor} = this.tabStyle
257
+ return {
258
+ width: iconWdith + 'rpx',
259
+ height: iconWdith + 'rpx',
260
+ backgroundColor: iconBgColor
261
+ }
254
262
  },
255
263
  //是否展示父级分类
256
264
  showParent(){
@@ -262,9 +270,14 @@ export default {
262
270
  backgroundColor: this.level2BgcColor,
263
271
  color: this.level2Color,
264
272
  }
273
+
274
+ let level2BgcColor = this.level2BgcColor || '#fff';
275
+ if(Color(level2BgcColor).isDark()) level2BgcColor = Color(level2BgcColor).lighten(0.8).toString();
276
+ else if(Color(level2BgcColor).isLight()) level2BgcColor = Color(level2BgcColor).darken(0.03).toString();
277
+
265
278
  if(this.showParent && this.isShowCategory){
266
279
  temp = Object.assign({},temp, {
267
- borderTop:this.boxTitleBorder,
280
+ borderTop:`2rpx solid ${level2BgcColor}`,
268
281
  boxSizing: 'border-box'
269
282
  })
270
283
  }
@@ -288,6 +301,12 @@ export default {
288
301
  backgroundColor: this.tabStyle.titleActBgColor,
289
302
  }
290
303
  },
304
+ categoryWaperComp(){
305
+ return {
306
+ position:this.$configProject.isPreview?'absolute':'fixed',
307
+ top: this.$configProject.isPreview ? 0 : (this.layoutInfo.top + 'rpx')
308
+ }
309
+ }
291
310
  },
292
311
  created(){
293
312
  this.isPreview = this.$configProject.isPreview;
@@ -397,6 +416,7 @@ export default {
397
416
  * @param type 1=>图文 2=>文字
398
417
  */
399
418
  handleCateClick(sub , type = 1){
419
+ debugger
400
420
  //当前布局为v1时候
401
421
  if(this.showType === 'all') this.clickClidItem(sub);
402
422
 
@@ -498,6 +518,9 @@ export default {
498
518
  margin: 0 auto;
499
519
  overflow: hidden;
500
520
  box-sizing: border-box;
521
+ display: flex;
522
+ justify-content: center;
523
+ align-items: center;
501
524
  & > view {
502
525
  background-color: #fff;
503
526
  width: calc(100% - var(--sub-icon-border)*2);
@@ -172,9 +172,14 @@ export default {
172
172
  };
173
173
  },
174
174
  chosePanelFixedTop(){
175
+ let level2BgcColor = '#fff';
176
+ if(Color(level2BgcColor).isDark()) level2BgcColor = Color(level2BgcColor).lighten(0.8).toString();
177
+ else if(Color(level2BgcColor).isLight()) level2BgcColor = Color(level2BgcColor).darken(0.03).toString();
178
+
175
179
  return {
176
180
  top: this.$configProject.isPreview?'108rpx':(parseInt(this.cateBarStyleComp.top) + 108) + 'rpx',
177
181
  position: this.$configProject.isPreview?'absolute':'fixed',
182
+ borderTop: `2rpx solid ${level2BgcColor}`
178
183
  }
179
184
  },
180
185
 
@@ -55,6 +55,9 @@ export default (data, gValue,gColor,oldData)=>{
55
55
  isShowDelivery = data['isShowDelivery'];
56
56
  }
57
57
 
58
+ let categoryParentType = dataVal({data, key:'categoryParentType', dValue:'root', gValue});
59
+
60
+
58
61
  return[
59
62
  {
60
63
  ele: 'title',
@@ -172,6 +175,35 @@ export default (data, gValue,gColor,oldData)=>{
172
175
  {required: true, message: '请上传全部图标', trigger: ['blur', 'change']},
173
176
  ],
174
177
  },
178
+ {
179
+ label: '父级分类',
180
+ ele: 'xd-radio',
181
+ groupKey: 'content',
182
+ valueKey: 'categoryParentType',
183
+ value: categoryParentType,
184
+ labelInline:true,
185
+ className: 'input100',
186
+ list: [
187
+ {label: '根目录', value: 'root'},
188
+ {label: '自定义', value: 'child'},
189
+ ],
190
+ notice:'展示指定父级分类下的子级分类',
191
+ inline: false
192
+ },
193
+ {
194
+ label: '',
195
+ ele: 'el-input',
196
+ type: 'number',
197
+ labelInline: true,
198
+ valueKey: 'categoryParent',
199
+ cusStyle: {
200
+ paddingLeft: '90px'
201
+ },
202
+ value: dataVal({data, key:'categoryParent', dValue:'', gValue}),
203
+ groupKey:'content',
204
+ className: 'input100',
205
+ hidden: categoryParentType === 'root',
206
+ },
175
207
  {ele: 'group_end'},
176
208
  {
177
209
  label: "分类样式",
@@ -309,6 +341,7 @@ export default (data, gValue,gColor,oldData)=>{
309
341
  groupKey:'content',
310
342
  valueKey: "filterMode",
311
343
  value: filterMode,
344
+ isSort: true,
312
345
  list:[
313
346
  {"label": "综合", "value": 'common'},
314
347
  {"label": "销量", "value": 'hot'},
@@ -103,25 +103,6 @@ export default (data, gValue, gColor, oldData)=>{
103
103
  {label: '自定义', value: 'C'},
104
104
  ]
105
105
  },
106
- 0&&{
107
- label: "图标大小",
108
- groupKey: 'style',
109
- ele: 'xd-slider',
110
- valueKey: "iconWdith",
111
- value: data['iconWdith'] === undefined?128:data['iconWdith'],
112
- className: "input80",
113
- labelInline: true,
114
- setting:{
115
- min: 64,//最小值
116
- max: 128, //最小值
117
- step:1, //步长
118
- showStops:false,//显示间断点
119
- showInput:false,//显示输入框
120
- },
121
- inline:false,
122
- notice:'调整分类图标大小'
123
- },
124
-
125
106
  {ele: 'group_start'},
126
107
  {
127
108
  label: '',
@@ -160,6 +141,63 @@ export default (data, gValue, gColor, oldData)=>{
160
141
  },
161
142
  },
162
143
  {ele: 'group_end'},
144
+ {
145
+ label: '图标大小',
146
+ ele: 'xd-radio',
147
+ groupKey: 'style',
148
+ valueKey: 'iconWdithStatus',
149
+ value: statusDataVal({data, key:'iconWdithStatus', fields:['iconWdith'],gValue}),
150
+ labelInline:true,
151
+ list: [
152
+ {label: '默认', value: 'D'},
153
+ {label: '自定义', value: 'C'},
154
+ ]
155
+ },
156
+ {ele: 'group_start'},
157
+ {
158
+ label: "",
159
+ groupKey: 'style',
160
+ ele: 'xd-slider',
161
+ valueKey: "iconWdith",
162
+ value: dataVal({data, key:'iconWdith', dValue:100, gValue}),
163
+ hidden: !statusShow({data, key: 'iconWdithStatus', fields:['iconWdith'], gValue}),
164
+ className: "input80",
165
+ labelInline: true,
166
+ setting:{
167
+ min: 50,//最小值
168
+ max: 100, //最小值
169
+ step:1, //步长
170
+ showStops:false,//显示间断点
171
+ showInput:false,//显示输入框
172
+ },
173
+ },
174
+ {ele: 'group_end'},
175
+ {
176
+ label: '图标背景',
177
+ ele: 'xd-radio',
178
+ groupKey: 'style',
179
+ valueKey: 'iconBgColorStatus',
180
+ value: statusDataVal({data, key:'iconBgColorStatus', fields:['iconBgColor'],gValue}),
181
+ labelInline:true,
182
+ list: [
183
+ {label: '默认', value: 'D'},
184
+ {label: '自定义', value: 'C'},
185
+ ]
186
+ },
187
+ {ele: 'group_start'},
188
+ {
189
+ label: '',
190
+ ele: 'xd-color',
191
+ valueKey: 'iconBgColor',
192
+ groupKey:'style',
193
+ value: dataVal({data, key:'iconBgColor', dValue:'#f8f8f8', gValue}),
194
+ hidden: !statusShow({data, key: 'iconBgColorStatus', fields:['iconBgColor'], gValue}),
195
+ classNmae: 'input80',
196
+ setting: {
197
+ showAlpha: true
198
+ },
199
+ },
200
+ {ele: 'group_end'},
163
201
 
164
202
  {
165
203
  label: '名称样式',