jufubao-base 1.0.288 → 1.0.289-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 (28) hide show
  1. package/package.json +1 -1
  2. package/src/components/CusCouponChose/CusCouponChose.vue +1027 -0
  3. package/src/components/CusCouponItem/CusCouponItem.vue +298 -0
  4. package/src/components/CusEnter/CusEnter.vue +360 -0
  5. package/src/components/CusPoster/CusPoster.vue +212 -0
  6. package/src/components/CusPoster/CusSwiperDot.vue +234 -0
  7. package/src/components/CusProduct/CusProduct.vue +372 -0
  8. package/src/components/CusShops/CusShops.vue +518 -0
  9. package/src/components/CusSwiperDot/CusSwiperDot.vue +234 -0
  10. package/src/components/CusTab/CusTab.vue +411 -0
  11. package/src/components/CusVideo/CusVideo.vue +170 -0
  12. package/src/components/JfbBaseFooter/Attr.js +10 -155
  13. package/src/components/JfbBaseFooter/JfbBaseFooter.vue +96 -43
  14. package/src/components/JfbBaseFooter/cusAttr/advanced.js +12 -0
  15. package/src/components/JfbBaseFooter/cusAttr/content.js +446 -0
  16. package/src/components/JfbBaseFooter/cusAttr/style.js +7 -0
  17. package/src/components/JfbBaseFooter/cusAttr/tools.js +17 -0
  18. package/src/components/JfbBaseOrderList/Mock.js +1 -1
  19. package/src/components/JfbBaseTfkSearch/Api.js +15 -0
  20. package/src/components/JfbBaseTfkSearch/CustomList.vue +10 -0
  21. package/src/components/JfbBaseTfkSearch/JfbBaseTfkSearch.vue +247 -7
  22. package/src/components/JfbBaseTfkSearch/XdQueryFilter.vue +354 -0
  23. package/src/components/JfbBaseTfkSearch/XdQuerySort.vue +192 -0
  24. package/src/components/JfbBaseUserInfo/Attr.js +12 -0
  25. package/src/components/JfbBaseUserInfo/JfbBaseUserInfo.vue +8 -2
  26. package/src/mixins/componentsMixins.js +363 -55
  27. package/src/mixins/posterMixins.js +27 -199
  28. package/src/mixins/productCompMixins.js +252 -0
@@ -34,7 +34,41 @@
34
34
  >{{ item.label }}</view>
35
35
  </view>
36
36
  </view>
37
+ <view class="menu_filter" v-if="(tabId!=='all'&&filterTab.length)||(tabId!=='all'&&showComprehensive)||(tabId!=='all'&&showSort)">
38
+ <view @click="handleGetFilterItem({value:'comprehensive'})" v-if="showComprehensive" class="menu_filter_item" >
39
+ <view>{{sortData.label || '综合'}}</view>
40
+ <xd-font-icon size="24" icon="iconxia_down" color="#333"></xd-font-icon>
41
+ </view>
42
+ <view @click="handleGetFilterItem({value:'sort'})" v-if="showSort" class="menu_filter_item" >
43
+ <view>{{sortData.label || '排序'}}</view>
44
+ <xd-font-icon size="24" icon="iconxia_down" color="#333"></xd-font-icon>
45
+ </view>
46
+ <view class="menu_filter_item" @click="handleGetFilterItem(item)" v-for="(item,index) in filterTab" :key="index">
47
+ <view>
48
+ {{ item.label }}
49
+ </view>
50
+ <xd-font-icon v-if="item.icon" :size="item.size" :icon="item.icon" color="#333"></xd-font-icon>
51
+ </view>
52
+ </view>
53
+ <view class="query_modal">
54
+ <xd-query-filter
55
+ v-if="showMoreFilterType.includes(curQueryTab)&&searchFilterList.length"
56
+ :key="curQueryTab"
57
+ :list="searchFilterList"
58
+ :filter-type="curQueryTab"
59
+ :collapse-num="6"
60
+ :filter-selected="selectFilterParams"
61
+ @onConfirm="handleQueryFilter"></xd-query-filter>
62
+ <xd-query-sort
63
+ v-if="(curQueryTab === 'comprehensive' || curQueryTab === 'sort')"
64
+ :list="sortList"
65
+ :filter-style="filterStyle"
66
+ :sort="sort"
67
+ @onConfirm="handleQuerySort"
68
+ ></xd-query-sort>
69
+ </view>
37
70
  </view>
71
+
38
72
  <view v-if="!isPreview" :style="{height: menuHeight}"></view>
39
73
  <view class="tfk-search" :style="{padding: outSpacing + 'rpx'}">
40
74
  <all-list v-if="tabId === 'all'"
@@ -50,6 +84,7 @@
50
84
  v-else
51
85
  :tab-id="tabId"
52
86
  :keyword="keyword"
87
+ :refresh="refresh"
53
88
  :list-item-style="listItemStyle"
54
89
  :product-config="productConfig"
55
90
  ref="customList"
@@ -74,6 +109,8 @@
74
109
  import CustomList from "./CustomList.vue";
75
110
  import AllList from "./AllList.vue";
76
111
  import { mapState } from 'vuex';
112
+ import XdQueryFilter from "./XdQueryFilter"
113
+ import XdQuerySort from "./XdQuerySort"
77
114
 
78
115
  class EmitParent {
79
116
  constructor(options) {
@@ -88,6 +125,8 @@
88
125
  XdFontIcon,
89
126
  AllList,
90
127
  XdSearchHistory,
128
+ XdQueryFilter,
129
+ XdQuerySort
91
130
  },
92
131
  mixins: [
93
132
  componentsMixins, extsMixins, JfbBaseTfkSearchMixin,listMixins
@@ -128,15 +167,42 @@
128
167
  allModuleItemContRadius: 16,
129
168
  allModuleItemContBgColor: "#FFFFFF",
130
169
  emitParent:{},
131
- is_plus_site: false
170
+ is_plus_site: false,
171
+ closeMask: true,
172
+ filterTab: [],
173
+ filterTabIcon: [
174
+ { value: 'area', label: '区域',icon: 'icondizhitubiao', size: 24 },
175
+ { value: 'brand', label: '品牌',icon: 'iconxia_down', size: 18 },
176
+ { value: 'shop', label: '门店分类',icon: 'iconxia_down', size: 18 },
177
+ { value: 'filter', label: '筛选', icon: 'iconshaixuanbiaoji_mian', size: 24 },
178
+ { value: 'comprehensive', label: '综合', icon: 'iconxia_down', size: 18 },
179
+ { value: 'sort', label: '排序', icon: 'iconxia_down', size: 18 },
180
+ { value: 'business_line', label: '业务线', icon: 'iconxia_down', size: 18 },
181
+ ],
182
+ curQueryTab: "",//刷新KEY(切换标签)
183
+ searchFilterList: [],
184
+ searchFilterParams: {},
185
+ selectFilterParams: {},
186
+ filterType: '',
187
+ sort: "",
188
+ sortData: {},
189
+ filterStyle: {},
190
+ showMoreFilterType: ['filter', 'shop', 'brand', 'area', 'delivery_method', 'shop_category', 'business_line','namespace'],
191
+ refresh: new Date().getTime(),
192
+ showComprehensive: false,
193
+ showSort:false,
194
+ brands: [],
195
+ namespace: '',
196
+ sortList: []
132
197
  }
133
198
  },
134
199
  computed: {
135
200
  ...mapState({
136
201
  siteInfo: state => state.siteInfo,
202
+ stateCity: state => state.cityLocation.city,
137
203
  }),
138
204
  showMenuList(){
139
- return [{label: "全部", value: "all"}, ...this.menuList]
205
+ return [{ label: "全部", value: "all" }, ...this.menuList]
140
206
  },
141
207
  menuWrapBoxStyle(){
142
208
  let padding = `${this.checkValue(this.menuMargin.top, 20)}rpx`;
@@ -186,6 +252,9 @@
186
252
  let height = this.checkValue(menuMargin.top, 20) + this.checkValue(menuMargin.bottom, 20) +
187
253
  this.checkValue(menuPadding.top, 20) + this.checkValue(menuPadding.bottom, 20) +
188
254
  this.checkValue(menuItemPadding.top, 20) + this.checkValue(menuItemPadding.bottom, 20);
255
+ if (this.filterTab.length > 0) {
256
+ height += 90
257
+ }
189
258
  return (height + 40) + 'rpx';
190
259
  },
191
260
  menuItemActiveStyle(){
@@ -229,8 +298,7 @@
229
298
  }
230
299
  },
231
300
  },
232
- created() {
233
-
301
+ created() {
234
302
  this.emitParent = new EmitParent({
235
303
  getParent: ()=>{
236
304
  return this;
@@ -248,8 +316,8 @@
248
316
  * @param cb {Function}
249
317
  */
250
318
  handleList({params, cb}){
251
- let data = {...params};
252
- if(this.tabId === 'all'){
319
+ let data = { ...params, sort: this.sort, ...this.searchFilterParams };
320
+ if(this.tabId === 'all'){
253
321
  data['search_range'] = this.searchScope.map(item => item.value.split("@")[0]).join(',');
254
322
  }
255
323
  if(this.productConfig.isShowDiscount==='Y'){
@@ -313,19 +381,170 @@
313
381
  this.allModuleItemContPadding = getContainerPropsValue(container, 'content.allModuleItemContPadding', {});
314
382
  this.allModuleItemContRadius = getContainerPropsValue(container, 'content.allModuleItemContRadius', 16);
315
383
  this.allModuleItemContBgColor = getContainerPropsValue(container, 'content.allModuleItemContBgColor', '#FFFFFF');
316
-
317
384
  if(this.$configProject['isPreview']){
318
385
  this.menuList = this.searchScope;
319
386
  this.isPreview = true;
320
387
  }
388
+ this.filterStyle = {
389
+ filterPadding: this.getMarginAndPadding({},20),
390
+ filterRowSpacing:20,
391
+ filterListColor:'#f9f9f9',
392
+ filterFontStyle: this.getFontAndBgcStyle({},{
393
+ fontSize: '26px',
394
+ color: '#333',
395
+ fontWeight: 'normal',
396
+ bgColor: 'rgba(0,0,0,0)'
397
+ }),
398
+ filterActFontStyle: this.getFontAndBgcStyle({},{
399
+ fontSize: '26px',
400
+ color: this.mainColor,
401
+ fontWeight: 'normal',
402
+ bgColor: 'rgba(0,0,0,0)'
403
+ },'act')
404
+ };
321
405
  },
322
406
  handleSwitchMenu(item){
323
407
  this.tabId = item.value;
408
+ this.namespace = item.namespace;
409
+ this.filterType = item.type
410
+ this.curQueryTab = '';
411
+ this.searchFilterParams = {};
412
+ this.sortData = {};
413
+ this.sort = '';
414
+ if (item.filter_item && item.filter_item.tab_filter) {
415
+ // 综合和排序的显示状态,当选中综合或排序时,下拉菜单取本地数据
416
+ this.showComprehensive = item.filter_item.tab_filter.find(item => item.value === 'comprehensive')
417
+ this.showSort = item.filter_item.tab_filter.find(item => item.value === 'sort')
418
+ let filter_item = item.filter_item.tab_filter.filter(item => {
419
+ return (item.value !== 'comprehensive'&&item.value !== 'sort')
420
+ })
421
+ this.filterTab = filter_item.map(item => {
422
+ let temp = this.filterTabIcon.find(Sitem => item.value === Sitem.value);
423
+ return {
424
+ ...item,
425
+ icon: temp ? temp.icon : '',
426
+ size: temp ? temp.size : ''
427
+ }
428
+ })
429
+ } else {
430
+ this.filterTab = []
431
+ }
324
432
  uni.pageScrollTo({
325
433
  scrollTop: 0,
326
434
  duration: 0
327
435
  });
328
436
  },
437
+ handleGetFilterItem(item) {
438
+ //设置城市
439
+ let city_code = ''
440
+ if(this.stateCity && this.stateCity.city_code) {
441
+ city_code = this.stateCity.city_code;
442
+ }
443
+ let data = {
444
+ type: this.filterType,
445
+ namespace: this.namespace,
446
+ filter_item: item.value,
447
+ city_code
448
+ }
449
+ if(item.value === this.curQueryTab){
450
+ this.curQueryTab = '';
451
+ return
452
+ }
453
+ else {
454
+ this.curQueryTab = item.value;
455
+ }
456
+ if (this.curQueryTab === 'sort') {
457
+ this.sortList = [{
458
+ label: "排序",
459
+ key: "default",
460
+ value: "default"
461
+ }]
462
+ } else if (this.curQueryTab === 'comprehensive') {
463
+ this.sortList = [
464
+ {
465
+ label: "综合",
466
+ key: "default",
467
+ value: "default"
468
+ },
469
+ {
470
+ label: "销量",
471
+ key: "sale_num",
472
+ children: [
473
+ {label: "由高到低", value: 'sale_num_desc'},
474
+ {label: "由低到高", value: 'sale_num_asc'}
475
+ ]
476
+ },
477
+ {
478
+ label: "价格",
479
+ key: "price",
480
+ children: [
481
+ {label: "由高到低", value: 'price_desc'},
482
+ {label: "由低到高", value: 'price_asc'}
483
+ ]
484
+ }
485
+ ]
486
+ }
487
+ const sortMap = {
488
+ 'sales_volume': 'sale_num_desc',
489
+ 'price': 'price_desc',
490
+ default: 'default'
491
+ };
492
+
493
+ if (sortMap[item.value]) {
494
+ this.sort = sortMap[item.value];
495
+ this.refresh = new Date().getTime();
496
+ return;
497
+ }
498
+
499
+ jfbRootExec("getTfkSearchFilterItems", {
500
+ vm: this,
501
+ data: data
502
+ }).then(res => {
503
+ this.searchFilterList = res.items || [];
504
+ }).catch(err => {
505
+ this.$xdLog.catch(err);
506
+ })
507
+ },
508
+ handleQueryFilter({ items, ids, labels }) {
509
+ const maps = {
510
+ 'brand': 'brands',
511
+ 'area': 'area_codes',
512
+ 'delivery_method': 'delivery_methods',
513
+ 'shop_category': 'category_ids',
514
+ 'business_line': 'business_lines'
515
+ };
516
+ Object.keys(items).map(key => {
517
+ let keys = Object.keys(maps);
518
+ if (keys.indexOf(key) > -1) {
519
+ this.searchFilterParams[maps[key]] = ids[key]
520
+ }
521
+ // if (key === 'brand') {
522
+ // this.searchFilterParams.brands = ids[key]
523
+ // }
524
+ // if (key === 'area') {
525
+ // this.searchFilterParams.area_codes = ids[key]
526
+ // }
527
+ // if (key === 'delivery_method') {
528
+ // this.searchFilterParams.delivery_methods = ids[key]
529
+ // }
530
+ // if (key === 'shop_category') {
531
+ // this.searchFilterParams.category_ids = ids[key]
532
+ // }
533
+ // if (key === 'business_line') {
534
+ // this.searchFilterParams.business_lines = ids[key]
535
+ // }
536
+ this.selectFilterParams[key] = ids[key]
537
+ })
538
+ this.curQueryTab = '';
539
+ this.refresh = new Date().getTime();
540
+ },
541
+ handleQuerySort(sortData){
542
+ if(this.sort === sortData.value) return false;
543
+ this.sortData = sortData;
544
+ this.sort = sortData.value;
545
+ this.curQueryTab = '';
546
+ this.refresh = new Date().getTime();
547
+ },
329
548
  handleToSearch(item){
330
549
  this.keyword = item;
331
550
  jfbRootFnExec(this, 'onCustomEvent')("baseTfkSearch@keyword", item);
@@ -380,6 +599,27 @@
380
599
  }
381
600
  }
382
601
  }
602
+ .menu_filter {
603
+ background:#fff;
604
+ display: flex;
605
+ justify-content: space-around;
606
+ align-items: center;
607
+ padding: 26rpx 0;
608
+ border-top: 1px solid #f8f8f8;
609
+ &_item {
610
+ color: #333;
611
+ font-size: 28rpx;
612
+ display: flex;
613
+ align-items: center;
614
+ justify-content: center;
615
+ & > view:first-child{
616
+ margin-right: 14rpx;
617
+ }
618
+ }
619
+ }
620
+ .query_modal {
621
+ background-color: #fff;
622
+ }
383
623
  }
384
624
  }
385
625
  </style>
@@ -0,0 +1,354 @@
1
+ <template>
2
+ <view class="xd-query-filter">
3
+ <view class="filter_wrap" :style="[boxListComp]">
4
+ <view
5
+ class="filter_item"
6
+ v-for="tab in filterTabs"
7
+ :key="tab.title"
8
+ :style="[contStyleComp]"
9
+ >
10
+ <view class="filter_title">
11
+ <view>{{tab.title}}</view>
12
+ <view v-if="isFitler && tab.options.length > collapseNum" class="_ext" @click="switchOpen(tab)">
13
+ <text>{{tab.open ? '收起' : '展开'}}</text>
14
+ <xd-font-icon v-if="tab.open" icon="iconshang_up" :size="20"></xd-font-icon>
15
+ <xd-font-icon v-else icon="iconxia_down" :size="20"></xd-font-icon>
16
+ </view>
17
+ </view>
18
+ <view class="filter_tab">
19
+ <template v-for="(item,i) in tab.options">
20
+ <view
21
+ class="_tag"
22
+ :style="[itemStyleComp,(isActive(tab, item.value)?labelActColor:labelColor)]"
23
+ v-if="(!tab.open && i < collapseNum) || tab.open || !isFitler"
24
+ :key="item.value"
25
+ :class="{active: isActive(tab, item.value)}"
26
+ @click="setChooseTag(tab, item)"
27
+ >{{item.label}}</view>
28
+ </template>
29
+ </view>
30
+ </view>
31
+ </view>
32
+ <view class="bottom_btn" v-if="isShowBtn">
33
+ <xd-button class="xd-button" type="info" width="248rpx" size="small" @click="onReset">重置</xd-button>
34
+ <xd-button class="xd-button" type="primary" width="248rpx" size="small" @click="onConfirm">确定</xd-button>
35
+ </view>
36
+ </view>
37
+ </template>
38
+
39
+ <script>
40
+ import XdButton from "@/components/XdButton/XdButton"
41
+ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon"
42
+ import Color from "color";
43
+
44
+ export default {
45
+ components: {
46
+ XdButton,
47
+ XdFontIcon
48
+ },
49
+ props: {
50
+ list: {
51
+ type: Array,
52
+ default: function(){
53
+ return [
54
+
55
+ ]
56
+ }
57
+ },
58
+ filterStyle:{
59
+ type: Object,
60
+ default(){
61
+ return {}
62
+ }
63
+ },
64
+ collapseNum: {
65
+ type: Number,
66
+ default: 3
67
+ },
68
+ filterType:{
69
+ type: String,
70
+ default: ""
71
+ },
72
+ filterSelected:{
73
+ type: Object,
74
+ default(){
75
+ return {}
76
+ }
77
+ },
78
+ },
79
+ computed:{
80
+ itemStyleComp(){
81
+ let column = 3,columnSpacing = 24;
82
+
83
+ let outWidth = uni.getSystemInfoSync().safeArea.width;
84
+ let columnSpacingWidth = columnSpacing * (column-1) * this.$rpxNum;
85
+ let marginRL = 96 * this.$rpxNum; //左右默认48rpx
86
+ let paddingRL = 16 * this.$rpxNum
87
+
88
+ return {
89
+ width: (outWidth - (columnSpacingWidth + marginRL + paddingRL))/column + 'px',
90
+ padding: `0 ${paddingRL}px`,
91
+ marginRight: columnSpacing + 'rpx',
92
+ marginTop: columnSpacing + 'rpx',
93
+ };
94
+ },
95
+ boxListComp(){
96
+ let maxHeight = this.$root.layoutInfo['bodyMinHeightRpx'] - 500;
97
+ if(this.$configProject.isPreview) maxHeight = 800;
98
+ return {
99
+ backgroundColor: this.filterStyle['filterListColor'] || '#f8f8f8',
100
+ maxHeight: maxHeight + 'rpx',
101
+ borderTop: this.filterStyle.filterTopBorder|| '2rpx solid #f8f8f8'
102
+ }
103
+ },
104
+ contStyleComp(){
105
+ return {
106
+ backgroundColor: '#fff',
107
+ marginBottom: (this.filterStyle['filterRowSpacing'] || 16) + 'rpx',
108
+ padding: (this.filterStyle['filterRowPadding'] || '32rpx 48rpx'),
109
+ }
110
+ },
111
+ labelColor(){
112
+ let fontStyle = this.filterStyle.filterFontStyle || {}
113
+ return {
114
+ color: fontStyle.color ||'#666',
115
+ borderColor: Color(fontStyle.color || '#666').alpha(0.2).toString(),
116
+ backgroundColor: fontStyle.backgroundColor || '#f8f8f8',
117
+ }
118
+ },
119
+ labelActColor(){
120
+ let fontStyle = this.filterStyle.filterActFontStyle || {}
121
+ let mainColor = fontStyle.color || this.$root.gThemeStyle['--g-theme-mainColor'];
122
+ return {
123
+ color: mainColor,
124
+ borderColor: Color(mainColor).alpha(0.5).toString(),
125
+ backgroundColor: fontStyle.backgroundColor || Color(mainColor).alpha(0.1).toString(),
126
+ }
127
+ },
128
+ },
129
+ data(){
130
+ return {
131
+ isFitler: true, //是筛选OR快捷方式
132
+ isShowBtn: false,
133
+ selectedItems:{},
134
+ selectedLabels:{},
135
+ selectedIds:{},
136
+ filterTabs: [],
137
+ }
138
+ },
139
+ watch: {
140
+ list(){
141
+ this.initData();
142
+ },
143
+ filterType(){
144
+ this.initData();
145
+ },
146
+ },
147
+ created() {
148
+ console.log(this.list,'aaajaj');
149
+ this.initData();
150
+ },
151
+ methods: {
152
+ initData(){
153
+ let filterTabs = [];
154
+ if(this.filterType === 'filter') {
155
+ filterTabs = this.$xdUniHelper.cloneDeep(this.list);
156
+ this.isShowBtn = true;
157
+ this.isFitler = true;
158
+ }
159
+ else {
160
+ this.isFitler = false;
161
+ filterTabs = this.$xdUniHelper.cloneDeep(this.list).filter(item=>{
162
+ if( this.filterType === item.value) {
163
+ this.isShowBtn = item.multiple === true;
164
+ }
165
+ return this.filterType === item.value;
166
+ });
167
+ }
168
+
169
+ filterTabs.map(item=>{
170
+ //未选择
171
+ let ids = !item.multiple?'':[];
172
+ let lables = !item.multiple ?'':[];
173
+ let items = !item.multiple?'':[];
174
+
175
+ //已选中
176
+ if(this.filterSelected[item.value]) {
177
+ ids = this.filterSelected[item.value];
178
+ if(!item.multiple) {
179
+ item.options.map(item=>{
180
+ if(ids === item.value) {
181
+ lables = item.label;
182
+ items = this.$xdUniHelper.cloneDeep(item);
183
+ }
184
+ })
185
+ }
186
+ else {
187
+ item.options.map(item=>{
188
+ ids.map(it=>{
189
+ if(it === item.value) {
190
+ lables.push(item.label)
191
+ items.push(this.$xdUniHelper.cloneDeep(item))
192
+ }
193
+ })
194
+
195
+ })
196
+ }
197
+ }
198
+
199
+ this.$set(this.selectedItems, item.value, items);
200
+ this.$set(this.selectedLabels, item.value, lables);
201
+ this.$set(this.selectedIds, item.value, ids);
202
+ });
203
+
204
+ this.filterTabs = filterTabs
205
+ },
206
+ isActive(tab, value){
207
+ if(!this.selectedIds[tab.value]) return false
208
+ return this.selectedIds[tab.value].includes(value);
209
+ },
210
+ setSelectData(type,ids, items, labels){
211
+ this.$set(this.selectedIds, type, ids);
212
+ this.$set(this.selectedItems, type, items);
213
+ this.$set(this.selectedLabels, type, labels);
214
+ },
215
+
216
+ setChooseTag(tab, item){
217
+ //单选
218
+ if(!tab.multiple) {
219
+ //取消
220
+ if(this.selectedIds[tab.value] && this.selectedIds[tab.value].includes(item.value)) {
221
+ this.setSelectData(tab.value, '', '', '')
222
+ }
223
+ //新增
224
+ else {
225
+ this.setSelectData(tab.value, item.value, item, item.label);
226
+ //单选直接触发返回数据
227
+ if(this.isShowBtn === false) this.onConfirm();
228
+ }
229
+ }
230
+ //多选
231
+ else {
232
+ let index = this.selectedIds[tab.value].indexOf(item.value);
233
+ //新增
234
+ if(index === -1) {
235
+ //选中
236
+ let ids = this.$xdUniHelper.cloneDeep(this.selectedIds[tab.value] || []),
237
+ items = this.$xdUniHelper.cloneDeep(this.selectedItems[tab.value] || []),
238
+ labels = this.$xdUniHelper.cloneDeep(this.selectedLabels[tab.value] || []);
239
+ ids.push(item.value);
240
+ items.push(item);
241
+ labels.push(item.label);
242
+ this.$set(this.selectedIds, tab.value,ids);
243
+ this.$set(this.selectedItems, tab.value,items);
244
+ this.$set(this.selectedLabels, tab.value,labels);
245
+ }
246
+ //取消
247
+ else {
248
+ this.selectedIds[tab.value].splice(index,1);
249
+ this.selectedLabels[tab.value].splice(index,1);
250
+ this.selectedItems[tab.value].splice(index,1);
251
+ }
252
+ }
253
+
254
+ },
255
+ switchOpen(tab){
256
+ this.filterTabs = this.filterTabs.map(item => {
257
+ if(JSON.stringify(item) === JSON.stringify(tab)) item['open'] = !item['open'];
258
+ return item;
259
+ })
260
+ },
261
+
262
+ //重置
263
+ onReset(){
264
+ Object.keys(this.selectedIds).map(key=>{
265
+ let multiple = this.$xdUniHelper.checkVarType(this.selectedIds[key]) === 'array';
266
+ let value = multiple ?'':[];
267
+ this.setSelectData(key, value, value,value)
268
+ })
269
+
270
+
271
+ },
272
+ onConfirm(){
273
+ this.$emit("onConfirm", {
274
+ items: this.$xdUniHelper.cloneDeep(this.selectedItems),
275
+ labels: this.$xdUniHelper.cloneDeep(this.selectedLabels),
276
+ ids: this.$xdUniHelper.cloneDeep(this.selectedIds)
277
+ });
278
+ }
279
+ }
280
+ }
281
+ </script>
282
+
283
+ <style lang="less" scoped>
284
+ .filter_wrap{
285
+ overflow: auto;
286
+ max-height: 50vh;
287
+
288
+ .filter_item{
289
+ &:last-child {
290
+ margin-bottom: 0!important;
291
+ }
292
+ }
293
+ .filter_title{
294
+ color: #333333;
295
+ font-size: 28rpx;
296
+ margin-bottom: 1.2rem;
297
+ font-weight: bold;
298
+ display: flex;
299
+ justify-content: space-between;
300
+
301
+ ._ext{
302
+ display: flex;
303
+ align-items: center;
304
+ font-size: 24rpx;
305
+ color: #BBBBBB;
306
+ font-weight: normal;
307
+
308
+ & > text {
309
+ padding-right: unit(10, rpx);
310
+ }
311
+ }
312
+ }
313
+
314
+ .filter_tab{
315
+ display: flex;
316
+ flex-wrap: wrap;
317
+ justify-content: flex-start;
318
+ align-items: center;
319
+ max-height: 50vh;
320
+
321
+ & > ._tag{
322
+ text-align: center;
323
+ line-height: 66rpx;
324
+ border-radius: 4rpx;
325
+ font-size: 24rpx;
326
+ color: #666;
327
+ text-overflow: ellipsis;
328
+ overflow: hidden;
329
+ white-space: nowrap;
330
+ box-sizing: border-box;
331
+ background-color: #f8f8f8;
332
+
333
+ &:nth-child(3n){
334
+ margin-right: 0!important;
335
+ }
336
+ &:nth-child(1),&:nth-child(2),&:nth-child(3) {
337
+ margin-top: 0!important;
338
+ }
339
+ }
340
+ }
341
+
342
+ }
343
+
344
+ .bottom_btn{
345
+ display: flex;
346
+ justify-content: center;
347
+ padding: 16rpx 32rpx;
348
+ border-top: 2rpx solid #f8f8f8;
349
+
350
+ .xd-button{
351
+ margin: 0 32rpx;
352
+ }
353
+ }
354
+ </style>