jufubao-mall 2.0.21 → 2.0.23-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.
Files changed (60) hide show
  1. package/package.json +1 -1
  2. package/src/components/CusProduct/CusProduct.vue +1 -1
  3. package/src/components/JfbMallBrandWall/Attr.js +10 -449
  4. package/src/components/JfbMallBrandWall/JfbMallBrandWall.vue +783 -308
  5. package/src/components/JfbMallBrandWall/cusAttr/advanced.js +61 -0
  6. package/src/components/JfbMallBrandWall/cusAttr/brand.js +341 -0
  7. package/src/components/JfbMallBrandWall/cusAttr/content.js +251 -0
  8. package/src/components/JfbMallBrandWall/cusAttr/style.js +252 -0
  9. package/src/components/JfbMallBrandWall/cusAttr/tab.js +471 -0
  10. package/src/components/JfbMallHomeProductList/JfbMallHomeProductList.vue +3 -1
  11. package/src/components/JfbMallHomeProductList/cusAttr/content.js +1 -2
  12. package/src/components/JfbMallNetworkMedia/Api.js +58 -0
  13. package/src/components/JfbMallNetworkMedia/Attr.js +20 -0
  14. package/src/components/JfbMallNetworkMedia/JfbMallNetworkMedia.vue +84 -0
  15. package/src/components/JfbMallNetworkMedia/JfbMallNetworkMediaLess.less +80 -0
  16. package/src/components/JfbMallNetworkMedia/JfbMallNetworkMediaMixin.js +30 -0
  17. package/src/components/JfbMallNetworkMedia/Mock.js +13 -0
  18. package/src/components/JfbMallNetworkMedia/cusAttr/advanced.js +60 -0
  19. package/src/components/JfbMallNetworkMedia/cusAttr/content.js +125 -0
  20. package/src/components/JfbMallNetworkMedia/cusAttr/filter.js +333 -0
  21. package/src/components/JfbMallNetworkMedia/cusAttr/font.js +114 -0
  22. package/src/components/JfbMallNetworkMedia/cusAttr/icon.js +298 -0
  23. package/src/components/{JfbMallProductList → JfbMallNetworkMedia/cusAttr}/style.js +15 -50
  24. package/src/components/JfbMallProductInfo/JfbMallProductInfo.vue +27 -23
  25. package/src/components/JfbMallProductInfo/cusAttr/content.js +1 -1
  26. package/src/components/JfbMallProductInfoV2/Api.js +1 -1
  27. package/src/components/JfbMallProductInfoV2/Attr.js +134 -41
  28. package/src/components/JfbMallProductInfoV2/JfbMallProductInfoV2.vue +136 -127
  29. package/src/components/JfbMallProductInfoV2/Mock.js +38 -10
  30. package/src/components/JfbMallProductList/Api.js +7 -7
  31. package/src/components/JfbMallProductList/Attr.js +7 -762
  32. package/src/components/JfbMallProductList/ComFilterQuery.vue +950 -0
  33. package/src/components/JfbMallProductList/JfbMallProductList.vue +807 -792
  34. package/src/components/JfbMallProductList/Mock.js +168 -255
  35. package/src/components/JfbMallProductList/XdCateV1.vue +335 -122
  36. package/src/components/JfbMallProductList/XdCateV2.vue +144 -76
  37. package/src/components/JfbMallProductList/XdQueryCommon.vue +189 -0
  38. package/src/components/JfbMallProductList/XdQueryFilter.vue +94 -76
  39. package/src/components/JfbMallProductList/XdQuerySort.vue +100 -109
  40. package/src/components/JfbMallProductList/cateMixins.js +103 -0
  41. package/src/components/JfbMallProductList/{advanced.js → cusAttr/advanced.js} +12 -4
  42. package/src/components/JfbMallProductList/cusAttr/content.js +465 -0
  43. package/src/components/JfbMallProductList/cusAttr/filter.js +333 -0
  44. package/src/components/JfbMallProductList/cusAttr/font.js +114 -0
  45. package/src/components/JfbMallProductList/cusAttr/icon.js +298 -0
  46. package/src/components/JfbMallProductList/cusAttr/style.js +91 -0
  47. package/src/components/JfbMallRecommendProduct/Attr.js +8 -366
  48. package/src/components/JfbMallRecommendProduct/JfbMallRecommendProduct.vue +218 -187
  49. package/src/components/JfbMallRecommendProduct/Mock.js +236 -693
  50. package/src/components/JfbMallRecommendProduct/cusAttr/advanced.js +79 -0
  51. package/src/components/JfbMallRecommendProduct/cusAttr/content.js +202 -0
  52. package/src/components/JfbMallRecommendProduct/cusAttr/style.js +594 -0
  53. package/src/components/JfbMallResourceShopList/Mock.js +4 -6
  54. package/src/components/JfbMallTestNormal/JfbMallTestNormal.vue +23 -2
  55. package/src/components/JfbMallTestNormal/data.js +152 -0
  56. package/src/mixins/componentsMixins.js +1 -0
  57. package/src/mixins/productCompMixins.js +29 -19
  58. package/src/components/JfbMallProductList/PosterAttr.js +0 -327
  59. package/src/components/JfbMallProductList/ProductAttr.js +0 -164
  60. package/src/components/JfbMallProductList/XdQueryBrand.vue +0 -150
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <view class="xd-cate-v2">
3
3
  <!--占位-->
4
- <view style="height: 100rpx;"></view>
5
- <view class="modal" v-if="showChose" @click="showChose=''"></view>
4
+ <view style="height: 108rpx;"></view>
5
+ <view class="modal" v-if="showChose" @click="showChose=''" :style="{top: layoutInfo['top'] + 'rpx'}"></view>
6
6
  <!--占位-->
7
7
  <!--BAR-->
8
8
  <view class="category_wrap" :style="[cateBarStyleComp]">
@@ -12,12 +12,15 @@
12
12
  :style="[cateBarStyleRLComp]"
13
13
  >
14
14
  <view class="parent_name" :style="[cateBarStyleV1Comp]">{{curParent && (curParent.category_name||curParent.name)}}</view>
15
- <xd-font-icon
16
- :color="cateBarStyleV1Comp.color"
17
- class="xd-font-icon"
18
- icon="iconxia_down"
19
- size="30"
20
- ></xd-font-icon>
15
+ <view class="xd-font-icon">
16
+ <xd-font-icon
17
+ width="32"
18
+ height="32px"
19
+ :color="cateBarStyleV1Comp.color"
20
+ icon="iconxia_down"
21
+ size="24"
22
+ ></xd-font-icon>
23
+ </view>
21
24
  </view>
22
25
  <view class="cate_child">
23
26
  <scroll-view scroll-x class="sub_cate_scroll"
@@ -26,11 +29,11 @@
26
29
  >
27
30
  <view v-for="item in subCategory"
28
31
  :key="item.category_id"
29
- :class="{active: uiCateId == item.category_id}"
32
+ :class="{active: uiCateId === item.category_id}"
30
33
  :id="'cate-scroll__index-'+item.category_id"
31
34
  class="sub_cate"
32
35
  @click="handleSubClick(item)"
33
- >{{item.category_name}}</view>
36
+ >{{item.category_name|fCutLen}}</view>
34
37
  </scroll-view>
35
38
  </view>
36
39
  <view
@@ -39,7 +42,11 @@
39
42
  v-if="curParent && curParent.children.length > 0"
40
43
  :style="[cateBarStyleRLComp]"
41
44
  >
42
- <xd-font-icon icon="iconxia_down" size="30" :color="cateBarStyleV1Comp.color"></xd-font-icon>
45
+ <xd-font-icon
46
+ icon="iconxia_down"
47
+ size="24"
48
+ :color="this.uiCateId?cateBarStyleV1Comp.color: '#999'"
49
+ ></xd-font-icon>
43
50
  </view>
44
51
  </view>
45
52
  <!--BAR-->
@@ -53,12 +60,14 @@
53
60
  v-for="item in navList"
54
61
  :key="item.category_id"
55
62
  class="chose_parent_item"
56
- :class="{active: uiPid == item.category_id}"
63
+ :class="{active: uiPid === item.category_id}"
57
64
  @click="handleParentClick(item)"
58
- :style="[itemStyleComp,(uiPid == item.category_id?cateBarNameActComp:cateBarNameComp)]"
65
+ :style="[itemStyleComp]"
59
66
  >
60
- <image :src="item.category_icon"></image>
61
- <view>{{item.category_name||item.name}}</view>
67
+ <view :style="[subTitleIcon]" class="sub_icon">
68
+ <image :src="item.category_icon" />
69
+ </view>
70
+ <view class="sub_name" :style="[(uiPid === item.category_id?level2ActNameComp:level2NameComp)]">{{item.category_name||item.name}}</view>
62
71
  </view>
63
72
  </view>
64
73
  <!--一级分类-->
@@ -72,8 +81,8 @@
72
81
  v-for="item in subCategory"
73
82
  :key="item.category_id"
74
83
  class="chose_child_item"
75
- :style="[itemStyleL2Comp,(uiCateId == item.category_id?cateBarNameActComp:cateBarNameComp)]"
76
- :class="{active: uiCateId == item.category_id}"
84
+ :style="[itemStyleL2Comp,(uiCateId === item.category_id?{}:{})]"
85
+ :class="{active: uiCateId === item.category_id}"
77
86
  @click="handleSubClick(item)"
78
87
  >{{item.category_name}}</view>
79
88
  </view>
@@ -83,12 +92,20 @@
83
92
 
84
93
  <script>
85
94
  import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
95
+ import cateMixins from "./cateMixins";
86
96
  import Color from "color"
87
97
 
88
98
  export default {
89
99
  components: {
90
100
  XdFontIcon
91
101
  },
102
+ mixins:[cateMixins],
103
+ filters:{
104
+ fCutLen(str){
105
+ if(str.length > 5) return str.substring(0,5) + '...'
106
+ return str
107
+ }
108
+ },
92
109
  props: {
93
110
  layoutInfo: {
94
111
  type: Object,
@@ -96,6 +113,10 @@ export default {
96
113
  return {}
97
114
  }
98
115
  },
116
+ mainColor:{
117
+ type: String,
118
+ default: ""
119
+ },
99
120
  pid: {
100
121
  type: String | Number,
101
122
  default: ""
@@ -116,6 +137,12 @@ export default {
116
137
  default(){
117
138
  return {}
118
139
  }
140
+ },
141
+ tabStyle: {
142
+ type: Object,
143
+ default(){
144
+ return {}
145
+ }
119
146
  }
120
147
  },
121
148
  computed: {
@@ -123,62 +150,58 @@ export default {
123
150
  return this.navList[this.tabIndex];
124
151
  },
125
152
  cateBarStyleV1Comp(){
126
- const {titleActFontSize, titleActFontWeight, titleActColor} = this.styleConfig.titleStyleLv1;
153
+ let {titleActFontSize, titleActFontWeight, titleActColor} = this.tabStyle;
154
+ if(titleActFontSize.indexOf('rpx') === -1) titleActFontSize = titleActFontSize + 'rpx';
127
155
  return {
128
- fontSize: titleActFontSize + 'rpx',
156
+ fontSize: titleActFontSize,
129
157
  color: titleActColor,
130
158
  fontWeight: titleActFontWeight
131
159
  }
132
160
  },
133
- cateBarNameActComp(){
134
- const {titleActFontWeight, titleActColor} = this.styleConfig.titleStyleLv1;
135
- return {
136
- color: titleActColor,
137
- fontWeight: titleActFontWeight
138
- }
139
- },
140
- cateBarNameComp(){
141
- const {titleFontWeight, titleColor} = this.styleConfig.titleStyleLv1;
142
- return {
143
- color: titleColor,
144
- fontWeight: titleFontWeight
145
- }
146
- },
147
-
148
161
  cateBarStyleRLComp(){
149
162
  return {
150
- backgroundColor: Color( this.styleConfig.backgroundColor).lighten(.2).hex().toString()
163
+ backgroundColor: Color( this.styleConfig.backgroundColor).lighten(.2).hex().toString(),
151
164
  }
152
165
  },
153
166
  cateBarStyleComp(){
167
+ let orderColor = '';
168
+ let {backgroundColor} = this.styleConfig;
169
+ if(Color(backgroundColor).isDark()) orderColor = Color(backgroundColor).lighten(0.8).toString();
170
+ else if(Color(backgroundColor).isLight()) orderColor = Color(backgroundColor).darken(0.05).toString();
171
+
154
172
  return {
155
173
  top: this.$configProject.isPreview?0:(this.layoutInfo.top) + 'rpx',
156
174
  backgroundColor: this.styleConfig.backgroundColor,
157
- '--border-color': Color( this.styleConfig.backgroundColor).lighten(.5).hex().toString(),
175
+ '--border-color': orderColor,
158
176
  position: this.$configProject.isPreview?'absolute':'fixed',
159
177
  };
160
178
  },
161
179
  chosePanelFixedTop(){
180
+ let level2BgcColor = '#fff';
181
+ if(Color(level2BgcColor).isDark()) level2BgcColor = Color(level2BgcColor).lighten(0.8).toString();
182
+ else if(Color(level2BgcColor).isLight()) level2BgcColor = Color(level2BgcColor).darken(0.03).toString();
183
+
162
184
  return {
163
- top: this.$configProject.isPreview?'100rpx':(parseInt(this.cateBarStyleComp.top) + 100) + 'rpx',
185
+ top: this.$configProject.isPreview?'108rpx':(parseInt(this.cateBarStyleComp.top) + 108) + 'rpx',
164
186
  position: this.$configProject.isPreview?'absolute':'fixed',
187
+ borderTop: `2rpx solid ${level2BgcColor}`
165
188
  }
166
189
  },
167
190
 
168
191
  itemStyleL2Comp(){
169
- let column = 3;
170
- let marginRL = 40;
171
- let columnSpacing = 20 * (column-1)
192
+ let column = 4;
193
+ let marginRL = 64;
194
+ let columnSpacing = 24 * (column - 1)
172
195
  return {
173
- width: this.getWidth(marginRL + columnSpacing ,3) + 'px',
174
- margin:'20rpx 20rpx 0 0'
196
+ width: this.getWidth(marginRL + columnSpacing ,column) + 'px',
197
+ margin:'24rpx 24rpx 0 0'
175
198
  }
176
199
  },
177
-
178
200
  itemStyleComp(){
179
201
  return {
180
- width: this.getWidth(40,5) + 'px',
181
- margin:'10rpx 0'
202
+ width: this.getWidth(64,5) + 'px',
203
+ margin:'0 0 24rpx',
204
+ paddingBottom: '40rpx'
182
205
  }
183
206
  },
184
207
  },
@@ -191,8 +214,8 @@ export default {
191
214
  return {
192
215
  isPreview: false,
193
216
  showChose: "",
194
- uiPid: "",
195
- uiCateId: "",
217
+ uiPid: -1, //一级分类ID
218
+ uiCateId: -1, //二级分类ID
196
219
  tabIndex: 0,
197
220
  subCategory: [],
198
221
  toView: "",
@@ -202,8 +225,8 @@ export default {
202
225
  },
203
226
  created(){
204
227
  this.isPreview = this.$configProject.isPreview;
205
- this.uiPid = this.pid || -1;
206
- this.uiCateId = this.cateId;
228
+ if(this.pid) this.uiPid = typeof this.pid === 'string'? Number(this.pid):this.pid;
229
+ if(this.cateId) this.uiCateId = typeof this.cateId === 'string'? Number(this.cateId):this.cateId;
207
230
  this.init(this.navList, this.uiPid);
208
231
  },
209
232
  methods: {
@@ -227,7 +250,8 @@ export default {
227
250
  this.showChose = "";
228
251
  return;
229
252
  }
230
- this.showChose = type
253
+ this.showChose = type;
254
+ this.$emit('on-open', true);
231
255
  },
232
256
  handleParentClick(item){
233
257
  if(Number(item.category_id) === Number(this.uiPid)) return;
@@ -267,50 +291,64 @@ export default {
267
291
  .category_wrap{
268
292
  display: flex;
269
293
  align-items: center;
270
- height: 100rpx;
294
+ justify-content: flex-start;
295
+ height: 108rpx;
271
296
  width: 100%;
272
297
  z-index: 102;
273
298
 
274
299
  .cate_parent{
300
+ flex-shrink: 0;
275
301
  border-right: 1px solid var(--border-color);
276
302
  box-sizing: border-box;
277
- width: 248rpx;
278
303
  height: 100%;
279
304
  display: flex;
280
305
  align-items: center;
281
- padding: 0 20rpx;
282
- font-size: 40rpx;
283
- font-weight: 500;
306
+ padding: 0 24rpx;
307
+ width: 230rpx ;
308
+
284
309
  .parent_name{
310
+ width: 150rpx;
285
311
  flex: 1;
286
312
  overflow: hidden;
287
313
  text-overflow: ellipsis;
288
314
  white-space: nowrap;
289
315
  color: var(--main-color);
316
+
290
317
  }
291
318
 
292
319
  .xd-font-icon{
293
- margin-left: 12rpx;
294
- color: var(--main-color);
320
+ width: 32rpx;
321
+ height: 32rpx;
322
+ display:flex;
323
+ justify-content: center;
324
+ align-items: center;
295
325
  }
296
326
  }
297
327
  .cate_child{
298
328
  flex: 1;
299
- width: 100rpx;
329
+ padding: 0 0 0 24rpx;
330
+ height: 60rpx;
331
+ width: calc(100vw - 334rpx);
332
+ box-sizing: border-box;
333
+
300
334
  .sub_cate_scroll{
301
335
  white-space: nowrap;
302
336
  width: 100%;
303
337
  .sub_cate{
304
338
  display: inline-block;
305
- padding: 12rpx 16rpx;
306
339
  background: #EEEEEE;
307
340
  font-size: 24rpx;
308
341
  font-weight: 400;
309
- color: #999999;
342
+ color: #666;
310
343
  border-radius: 80rpx;
311
- margin: 0 6rpx;
312
344
  min-width: 128rpx;
313
345
  text-align: center;
346
+ margin-right: 12rpx;
347
+ height: 60rpx;
348
+ line-height: 60rpx;
349
+ padding: 0 16rpx;
350
+ overflow: hidden;
351
+ box-sizing: border-box;
314
352
 
315
353
  &.active{
316
354
  background: var(--main-color-alpha);
@@ -318,22 +356,22 @@ export default {
318
356
  border-color: var(--main-color);
319
357
  }
320
358
 
321
- &:first-child{
322
- margin-left: 20rpx;
359
+ &:last-child{
360
+ margin-right: 0;
323
361
  }
324
362
  }
325
363
  }
326
364
  }
327
365
  .child_more{
328
-
329
- width: 80rpx;
366
+ width: 84rpx;
330
367
  height: 100%;
331
368
  display: flex;
332
369
  justify-content: center;
333
370
  align-items: center;
334
- border-left: 1px solid #EEEEEE;
371
+ border-left: 4rpx solid var(--border-color);
335
372
  background: #FFFFFF;
336
373
  z-index: 1;
374
+ flex-shrink: 0;
337
375
  }
338
376
  }
339
377
  .modal{
@@ -351,11 +389,12 @@ export default {
351
389
  background: #FFFFFF;
352
390
  width: 100%;
353
391
  top: 100rpx;
354
- padding: 0 20rpx 20rpx;
392
+ padding: 32rpx;
355
393
  display: flex;
356
394
  flex-wrap: wrap;
357
- border-radius: 0 0 24rpx 24rpx;
395
+ border-radius:0;
358
396
  box-sizing: border-box;
397
+ border-top: 2rpx solid #f8f8f8;
359
398
  }
360
399
  .chose_parent{
361
400
  .chose_parent_item{
@@ -364,34 +403,63 @@ export default {
364
403
  align-items: center;
365
404
  font-size: 24rpx;
366
405
  color: #333333;
406
+ position: relative;
407
+
408
+ & > .sub_name {
409
+ left: 0!important;
410
+ right: 0!important;
411
+ text-align: center;
412
+ width: 100%!important;
413
+ overflow: hidden;
414
+ word-break: break-all;
415
+ white-space: wrap;
416
+ height: 36rpx;
417
+ line-height: 36rpx;
418
+ }
367
419
  &.active{
368
420
  color: var(--main-color);
369
421
  }
370
- image{
422
+ .sub_icon {
371
423
  width: 96rpx;
372
424
  height: 96rpx;
373
- margin-bottom: 8rpx;
425
+ overflow: hidden;
426
+ margin-bottom: 10rpx;
427
+
428
+ image{
429
+ width: 96rpx;
430
+ height: 96rpx;
431
+ margin-bottom: 8rpx;
432
+ }
374
433
  }
434
+
375
435
  }
376
436
  }
377
437
  .chose_child{
438
+
378
439
  .chose_child_item{
379
- height: 65rpx;
380
- border-radius: 80rpx;
381
- background: #EEEEEE;
382
- border: 1px solid #EEEEEE;
440
+ height: 64rpx;
441
+ border-radius: 32rpx;
442
+ background: #f7f7f7;
383
443
  box-sizing: border-box;
384
- color: #999999;
444
+ color: #666;
385
445
  font-size: 24rpx;
446
+ padding: 0 16rpx;
386
447
  font-weight: 400;
387
448
  display: flex;
388
449
  align-items: center;
389
450
  justify-content: center;
451
+ line-height: 64rpx;
452
+ .uni-max-cut(1, 64);
453
+ text-align: center;
390
454
 
391
- &:nth-child(3n) {
455
+ &:nth-child(4n) {
392
456
  margin-right: 0!important;
393
457
  }
394
458
 
459
+ &:nth-child(1), &:nth-child(2), &:nth-child(3), &:nth-child(4) {
460
+ margin-top: 0!important;
461
+ }
462
+
395
463
  &.active{
396
464
  background: var(--main-color-alpha);
397
465
  color: var(--main-color);
@@ -0,0 +1,189 @@
1
+ <template>
2
+ <view class="xd-query-brand" :style="[boxStyleComp]">
3
+ <view class="query_brand" :style="[contStyleComp]">
4
+ <view
5
+ v-for="item in uiDataList" :key="item.value"
6
+ class="brand_item"
7
+ :class="{active: !!item.checked}"
8
+ :style="[itemStyleComp, (item.checked ? labelActColor : labelColor)]"
9
+ @click="setBrandActive(item)"
10
+ >{{ item.label }}</view>
11
+ </view>
12
+ <view class="bottom_btn">
13
+ <xd-button class="xd-button" type="info" width="220rpx" size="small" @click="onReset">重置</xd-button>
14
+ <xd-button class="xd-button" type="primary" width="220rpx" size="small" @click="onConfirm">确定</xd-button>
15
+ </view>
16
+ </view>
17
+ </template>
18
+
19
+ <script>
20
+ import XdButton from "@/components/XdButton/XdButton"
21
+ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon"
22
+ import Color from "color";
23
+ export default {
24
+ name:'XdQueryCommon',
25
+ components: {
26
+ XdButton,
27
+ XdFontIcon
28
+ },
29
+ props: {
30
+ dataList: Array,
31
+ valueIds: {
32
+ type: String,
33
+ default: ""
34
+ },
35
+ filterStyle:{
36
+ type: Object,
37
+ default(){
38
+ return {}
39
+ }
40
+ },
41
+ multiple:{
42
+ type: Boolean,
43
+ default() {
44
+ return true;
45
+ }
46
+ },
47
+ filterKey:String,
48
+ maxHeight: {
49
+ type: Number,
50
+ default: 500
51
+ },
52
+ },
53
+ data() {
54
+ return {
55
+ uiDataList: [],
56
+ }
57
+ },
58
+ computed: {
59
+ itemStyleComp(){
60
+ let column = 3;
61
+ let outWidth = uni.getSystemInfoSync().safeArea.width;
62
+ let columnSpacing = 24 * this.$rpxNum * (column-1);
63
+ let marginRL = this.filterStyle['filterPaddingRL'] * this.$rpxNum
64
+ return {
65
+ width: (outWidth - (columnSpacing + marginRL))/column + 'px',
66
+ marginRight: '24rpx',
67
+ marginTop: '24rpx',
68
+ borderRadius:(this.filterStyle['filterListRadius']||0) + 'rpx',
69
+ };
70
+ },
71
+ boxStyleComp(){
72
+ return {
73
+ backgroundColor: this.filterStyle.filterListColor,
74
+ }
75
+ },
76
+ contStyleComp(){
77
+
78
+ let temp = {
79
+ backgroundColor: '#fff',
80
+ padding: this.filterStyle['filterPadding'],
81
+ maxHeight: this.maxHeight + 'px'
82
+ };
83
+ if(this.$configProject.isPreview) {
84
+ temp = {...temp,maxHeight:'650rpx'}
85
+ }
86
+ return temp
87
+ },
88
+ labelColor(){
89
+ let font = this.filterStyle.filterFontStyle;
90
+ return {
91
+ color: font.color,
92
+ fontSize: font.fontSize,
93
+ borderColor: Color(font.color).alpha(0.01).toString(),
94
+ backgroundColor: Color(font.color).alpha(0.05).toString(),
95
+ }
96
+ },
97
+ labelActColor(){
98
+ let font = this.filterStyle.filterActFontStyle;
99
+ return {
100
+ color: font.color,
101
+ fontSize: font.fontSize,
102
+ borderColor: Color(font.color).alpha(0.2).toString(),
103
+ backgroundColor: Color(font.color).alpha(0.05).toString(),
104
+ }
105
+ }
106
+ },
107
+ watch: {
108
+ dataList(val){
109
+ this.init(val)
110
+ },
111
+ valueIds(){
112
+ this.init(this.dataList)
113
+ }
114
+ },
115
+ created(){
116
+ this.init(this.dataList);
117
+ console.log('this.$root',this.$root)
118
+ },
119
+ methods: {
120
+ init(val){
121
+ let checkedIds = this.valueIds.split(',');
122
+ this.uiDataList = val.map(item => {
123
+ return {
124
+ ...item,
125
+ checked: checkedIds.includes(item.value)
126
+ }
127
+ })
128
+ },
129
+ setBrandActive(brand){
130
+ if(this.multiple === false) this.onReset();
131
+ this.$set(brand, 'checked', !brand.checked);
132
+ },
133
+ onConfirm(){
134
+ let checkedList = this.uiDataList.filter(item => item.checked);
135
+ let valueIds = checkedList.map(item => item.value);
136
+ this.$emit('onConfirm', {valueIds , filterKey: this.filterKey});
137
+ },
138
+ onReset(){
139
+ this.uiDataList.forEach(item => {
140
+ this.$set(item, 'checked', false);
141
+ });
142
+ }
143
+ }
144
+ }
145
+ </script>
146
+
147
+ <style lang="scss" scoped>
148
+ .xd-query-brand{
149
+ .query_brand{
150
+ display: flex;
151
+ flex-wrap: wrap;
152
+
153
+ overflow: auto;
154
+ .brand_item{
155
+ text-align: center;
156
+ line-height: 60rpx;
157
+ border-radius: 60rpx;
158
+ font-size: 24rpx;
159
+ border: 1px solid #fafafa;
160
+ color: #666666;
161
+ text-overflow: ellipsis;
162
+ overflow: hidden;
163
+ white-space: nowrap;
164
+ box-sizing: border-box;
165
+ &:nth-child(3n){
166
+ margin-right: 0!important;
167
+ }
168
+ &:nth-child(1),&:nth-child(2),&:nth-child(3) {
169
+ margin-top: 0!important;
170
+ }
171
+ &.active{
172
+ border-color: #A5D63F;
173
+ color: #A5D63F;
174
+ }
175
+ }
176
+ }
177
+ .bottom_btn{
178
+ display: flex;
179
+ justify-content: center;
180
+ border-top: 1px solid #f8f8f8;
181
+ padding: 16rpx 0;
182
+ margin: 0 96rpx;
183
+ align-items: center;
184
+ .xd-button{
185
+ margin: 0 32rpx;
186
+ }
187
+ }
188
+ }
189
+ </style>