jufubao-base 1.0.290-beta2 → 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.
Files changed (30) 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 +98 -44
  14. package/src/components/JfbBaseFooter/XdFooterBar.vue +324 -0
  15. package/src/components/JfbBaseFooter/cusAttr/advanced.js +12 -0
  16. package/src/components/JfbBaseFooter/cusAttr/content.js +475 -0
  17. package/src/components/JfbBaseFooter/cusAttr/style.js +7 -0
  18. package/src/components/JfbBaseFooter/cusAttr/tools.js +17 -0
  19. package/src/components/JfbBaseSavingDetail/JfbBaseSavingDetail.vue +2 -14
  20. package/src/components/JfbBaseTfkSearch/Api.js +15 -0
  21. package/src/components/JfbBaseTfkSearch/CustomList.vue +10 -0
  22. package/src/components/JfbBaseTfkSearch/JfbBaseTfkSearch.vue +255 -7
  23. package/src/components/JfbBaseTfkSearch/XdQueryFilter.vue +347 -0
  24. package/src/components/JfbBaseTfkSearch/XdQuerySort.vue +192 -0
  25. package/src/components/JfbBaseTfkSearch/listMixins.js +8 -6
  26. package/src/components/JfbBaseUserInfo/Attr.js +12 -0
  27. package/src/components/JfbBaseUserInfo/JfbBaseUserInfo.vue +8 -2
  28. package/src/mixins/componentsMixins.js +363 -55
  29. package/src/mixins/posterMixins.js +27 -199
  30. package/src/mixins/productCompMixins.js +252 -0
@@ -34,7 +34,42 @@
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
+ <view v-show="curQueryTab" class="modal"></view>
72
+
38
73
  <view v-if="!isPreview" :style="{height: menuHeight}"></view>
39
74
  <view class="tfk-search" :style="{padding: outSpacing + 'rpx'}">
40
75
  <all-list v-if="tabId === 'all'"
@@ -50,6 +85,7 @@
50
85
  v-else
51
86
  :tab-id="tabId"
52
87
  :keyword="keyword"
88
+ :refresh="refresh"
53
89
  :list-item-style="listItemStyle"
54
90
  :product-config="productConfig"
55
91
  ref="customList"
@@ -74,6 +110,8 @@
74
110
  import CustomList from "./CustomList.vue";
75
111
  import AllList from "./AllList.vue";
76
112
  import { mapState } from 'vuex';
113
+ import XdQueryFilter from "./XdQueryFilter"
114
+ import XdQuerySort from "./XdQuerySort"
77
115
 
78
116
  class EmitParent {
79
117
  constructor(options) {
@@ -88,6 +126,8 @@
88
126
  XdFontIcon,
89
127
  AllList,
90
128
  XdSearchHistory,
129
+ XdQueryFilter,
130
+ XdQuerySort
91
131
  },
92
132
  mixins: [
93
133
  componentsMixins, extsMixins, JfbBaseTfkSearchMixin,listMixins
@@ -128,15 +168,42 @@
128
168
  allModuleItemContRadius: 16,
129
169
  allModuleItemContBgColor: "#FFFFFF",
130
170
  emitParent:{},
131
- is_plus_site: false
171
+ is_plus_site: false,
172
+ closeMask: true,
173
+ filterTab: [],
174
+ filterTabIcon: [
175
+ { value: 'area', label: '区域',icon: 'icondizhitubiao', size: 24 },
176
+ { value: 'brand', label: '品牌',icon: 'iconxia_down', size: 18 },
177
+ { value: 'shop_category', label: '门店分类',icon: 'iconxia_down', size: 18 },
178
+ { value: 'filter', label: '筛选', icon: 'iconshaixuanbiaoji_mian', size: 24 },
179
+ { value: 'comprehensive', label: '综合', icon: 'iconxia_down', size: 18 },
180
+ { value: 'sort', label: '排序', icon: 'iconxia_down', size: 18 },
181
+ { value: 'business_line', label: '业务线', icon: 'iconxia_down', size: 18 },
182
+ ],
183
+ curQueryTab: "",//刷新KEY(切换标签)
184
+ searchFilterList: [],
185
+ searchFilterParams: {},
186
+ selectFilterParams: {},
187
+ filterType: '',
188
+ sort: "",
189
+ sortData: {},
190
+ filterStyle: {},
191
+ showMoreFilterType: ['filter', 'shop', 'brand', 'area', 'delivery_method', 'shop_category', 'business_line','namespace'],
192
+ refresh: new Date().getTime(),
193
+ showComprehensive: false,
194
+ showSort:false,
195
+ brands: [],
196
+ namespace: '',
197
+ sortList: [],
132
198
  }
133
199
  },
134
200
  computed: {
135
201
  ...mapState({
136
202
  siteInfo: state => state.siteInfo,
203
+ stateCity: state => state.cityLocation.city,
137
204
  }),
138
205
  showMenuList(){
139
- return [{label: "全部", value: "all"}, ...this.menuList]
206
+ return [{ label: "全部", value: "all" }, ...this.menuList]
140
207
  },
141
208
  menuWrapBoxStyle(){
142
209
  let padding = `${this.checkValue(this.menuMargin.top, 20)}rpx`;
@@ -186,6 +253,9 @@
186
253
  let height = this.checkValue(menuMargin.top, 20) + this.checkValue(menuMargin.bottom, 20) +
187
254
  this.checkValue(menuPadding.top, 20) + this.checkValue(menuPadding.bottom, 20) +
188
255
  this.checkValue(menuItemPadding.top, 20) + this.checkValue(menuItemPadding.bottom, 20);
256
+ if (this.filterTab.length > 0) {
257
+ height += 90
258
+ }
189
259
  return (height + 40) + 'rpx';
190
260
  },
191
261
  menuItemActiveStyle(){
@@ -218,6 +288,9 @@
218
288
  allModuleItemContRadius: this.allModuleItemContRadius,
219
289
  allModuleItemContBgColor: this.allModuleItemContBgColor
220
290
  }
291
+ },
292
+ showQueryModal() {
293
+ return this.curQueryTab?true:false
221
294
  }
222
295
  },
223
296
  watch: {
@@ -229,8 +302,7 @@
229
302
  }
230
303
  },
231
304
  },
232
- created() {
233
-
305
+ created() {
234
306
  this.emitParent = new EmitParent({
235
307
  getParent: ()=>{
236
308
  return this;
@@ -248,8 +320,8 @@
248
320
  * @param cb {Function}
249
321
  */
250
322
  handleList({params, cb}){
251
- let data = {...params};
252
- if(this.tabId === 'all'){
323
+ let data = { ...params, sort: this.sort, ...this.searchFilterParams };
324
+ if(this.tabId === 'all'){
253
325
  data['search_range'] = this.searchScope.map(item => item.value.split("@")[0]).join(',');
254
326
  }
255
327
  if(this.productConfig.isShowDiscount==='Y'){
@@ -313,19 +385,165 @@
313
385
  this.allModuleItemContPadding = getContainerPropsValue(container, 'content.allModuleItemContPadding', {});
314
386
  this.allModuleItemContRadius = getContainerPropsValue(container, 'content.allModuleItemContRadius', 16);
315
387
  this.allModuleItemContBgColor = getContainerPropsValue(container, 'content.allModuleItemContBgColor', '#FFFFFF');
316
-
317
388
  if(this.$configProject['isPreview']){
318
389
  this.menuList = this.searchScope;
319
390
  this.isPreview = true;
320
391
  }
392
+ this.filterStyle = {
393
+ filterPadding: this.getMarginAndPadding({},20),
394
+ filterRowSpacing:20,
395
+ filterListColor:'#f9f9f9',
396
+ filterFontStyle: this.getFontAndBgcStyle({},{
397
+ fontSize: '26px',
398
+ color: '#333',
399
+ fontWeight: 'normal',
400
+ bgColor: 'rgba(0,0,0,0)'
401
+ }),
402
+ filterActFontStyle: this.getFontAndBgcStyle({},{
403
+ fontSize: '26px',
404
+ color: this.mainColor,
405
+ fontWeight: 'normal',
406
+ bgColor: 'rgba(0,0,0,0)'
407
+ },'act')
408
+ };
321
409
  },
322
410
  handleSwitchMenu(item){
323
411
  this.tabId = item.value;
412
+ this.namespace = item.namespace;
413
+ this.filterType = item.type
414
+ this.curQueryTab = '';
415
+ this.searchFilterParams = {};
416
+ this.selectFilterParams = {};
417
+ this.sortData = {};
418
+ this.sort = '';
419
+ if (item.filter_item && item.filter_item.tab_filter) {
420
+ // 综合和排序的显示状态,当选中综合或排序时,下拉菜单取本地数据
421
+ this.showComprehensive = item.filter_item.tab_filter.find(item => item.value === 'comprehensive')?true:false;
422
+ this.showSort = item.filter_item.tab_filter.find(item => item.value === 'sort')?true:false;
423
+ let filter_item = item.filter_item.tab_filter.filter(item => {
424
+ return (item.value !== 'comprehensive'&&item.value !== 'sort')
425
+ })
426
+ this.filterTab = filter_item.map(item => {
427
+ let temp = this.filterTabIcon.find(Sitem => item.value === Sitem.value);
428
+ return {
429
+ ...item,
430
+ icon: temp ? temp.icon : '',
431
+ size: temp ? temp.size : ''
432
+ }
433
+ })
434
+ } else {
435
+ this.filterTab = []
436
+ }
324
437
  uni.pageScrollTo({
325
438
  scrollTop: 0,
326
439
  duration: 0
327
440
  });
328
441
  },
442
+ handleGetFilterItem(item) {
443
+ //设置城市
444
+ let city_code = ''
445
+ if(this.stateCity && this.stateCity.city_code) {
446
+ city_code = this.stateCity.city_code;
447
+ }
448
+ let data = {
449
+ type: this.filterType,
450
+ namespace: this.namespace,
451
+ filter_item: item.value,
452
+ city_code
453
+ }
454
+ if(item.value === this.curQueryTab){
455
+ this.curQueryTab = '';
456
+ return
457
+ }
458
+ else {
459
+ this.curQueryTab = item.value;
460
+ }
461
+ if (this.curQueryTab === 'sort') {
462
+ this.sort = 'default'
463
+ this.sortList = [{
464
+ label: "综合",
465
+ key: "default",
466
+ value: "default"
467
+ }]
468
+ } else if (this.curQueryTab === 'comprehensive') {
469
+ this.sortList = [
470
+ {
471
+ label: "综合",
472
+ key: "default",
473
+ value: "default"
474
+ },
475
+ {
476
+ label: "销量",
477
+ key: "sale_num",
478
+ children: [
479
+ {label: "由高到低", value: 'sale_num_desc'},
480
+ {label: "由低到高", value: 'sale_num_asc'}
481
+ ]
482
+ },
483
+ {
484
+ label: "价格",
485
+ key: "price",
486
+ children: [
487
+ {label: "由高到低", value: 'price_desc'},
488
+ {label: "由低到高", value: 'price_asc'}
489
+ ]
490
+ }
491
+ ]
492
+ }
493
+ const sortMap = {
494
+ 'sales_volume': 'sale_num_desc',
495
+ 'price': 'price_desc',
496
+ default: 'default'
497
+ };
498
+
499
+ if (sortMap[item.value]) {
500
+ this.curQueryTab = '';
501
+ this.sort = sortMap[item.value];
502
+ this.refresh = new Date().getTime();
503
+ return;
504
+ }
505
+
506
+ jfbRootExec("getTfkSearchFilterItems", {
507
+ vm: this,
508
+ data: data
509
+ }).then(res => {
510
+ this.searchFilterList = res.items || [];
511
+ }).catch(err => {
512
+ this.$xdLog.catch(err);
513
+ })
514
+ },
515
+ handleQueryFilter({ items, ids, labels }) {
516
+ const maps = {
517
+ 'brand': 'brand_ids',
518
+ 'area': 'area_codes',
519
+ 'delivery_method': 'delivery_methods',
520
+ 'shop_category': 'category_ids',
521
+ 'business_line': 'namespaces'
522
+ };
523
+ Object.keys(items).map(key => {
524
+ let keys = Object.keys(maps);
525
+ if (keys.indexOf(key) > -1) {
526
+ this.searchFilterParams[maps[key]] = ids[key]
527
+ if (this.$xdUniHelper.checkVarType(ids[key]) === 'array') {
528
+ if (ids[key].length === 0) {
529
+ this.searchFilterParams[maps[key]] = ''
530
+ } else {
531
+ this.searchFilterParams[maps[key]] = ids[key].join(',')
532
+ }
533
+ }
534
+ }
535
+ this.selectFilterParams[key] = ids[key]
536
+ })
537
+ this.curQueryTab = '';
538
+ this.refresh = new Date().getTime();
539
+ },
540
+ handleQuerySort(sortData){
541
+ if(this.sort === sortData.value) return false;
542
+ this.sortData = sortData;
543
+ this.sort = sortData.value;
544
+ this.curQueryTab = '';
545
+ this.refresh = new Date().getTime();
546
+ },
329
547
  handleToSearch(item){
330
548
  this.keyword = item;
331
549
  jfbRootFnExec(this, 'onCustomEvent')("baseTfkSearch@keyword", item);
@@ -380,6 +598,36 @@
380
598
  }
381
599
  }
382
600
  }
601
+ .menu_filter {
602
+ background:#fff;
603
+ display: flex;
604
+ justify-content: space-around;
605
+ align-items: center;
606
+ padding: 26rpx 0;
607
+ border-top: 1px solid #f8f8f8;
608
+ &_item {
609
+ color: #333;
610
+ font-size: 28rpx;
611
+ display: flex;
612
+ align-items: center;
613
+ justify-content: center;
614
+ & > view:first-child{
615
+ margin-right: 14rpx;
616
+ }
617
+ }
618
+ }
619
+ .query_modal {
620
+ background-color: #fff;
621
+ }
383
622
  }
384
623
  }
624
+ .modal{
625
+ position: fixed;
626
+ width: 100%;
627
+ height: 100%;
628
+ left: 0;
629
+ top: 0;
630
+ background: rgba(0, 0, 0, .4);
631
+ z-index: 102;
632
+ }
385
633
  </style>
@@ -0,0 +1,347 @@
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
+ this.setSelectData(tab.value, item.value, item, item.label);
220
+ //单选直接触发返回数据
221
+ if(this.isShowBtn === false) this.onConfirm();
222
+ }
223
+ //多选
224
+ else {
225
+ let index = this.selectedIds[tab.value].indexOf(item.value);
226
+ //新增
227
+ if(index === -1) {
228
+ //选中
229
+ let ids = this.$xdUniHelper.cloneDeep(this.selectedIds[tab.value] || []),
230
+ items = this.$xdUniHelper.cloneDeep(this.selectedItems[tab.value] || []),
231
+ labels = this.$xdUniHelper.cloneDeep(this.selectedLabels[tab.value] || []);
232
+ ids.push(item.value);
233
+ items.push(item);
234
+ labels.push(item.label);
235
+ this.$set(this.selectedIds, tab.value,ids);
236
+ this.$set(this.selectedItems, tab.value,items);
237
+ this.$set(this.selectedLabels, tab.value,labels);
238
+ }
239
+ //取消
240
+ else {
241
+ this.selectedIds[tab.value].splice(index,1);
242
+ this.selectedLabels[tab.value].splice(index,1);
243
+ this.selectedItems[tab.value].splice(index,1);
244
+ }
245
+ }
246
+
247
+ },
248
+ switchOpen(tab){
249
+ this.filterTabs = this.filterTabs.map(item => {
250
+ if(JSON.stringify(item) === JSON.stringify(tab)) item['open'] = !item['open'];
251
+ return item;
252
+ })
253
+ },
254
+
255
+ //重置
256
+ onReset(){
257
+ Object.keys(this.selectedIds).map(key=>{
258
+ let multiple = this.$xdUniHelper.checkVarType(this.selectedIds[key]) === 'array';
259
+ let value = multiple ?'':[];
260
+ this.setSelectData(key, value, value,value)
261
+ })
262
+
263
+
264
+ },
265
+ onConfirm(){
266
+ this.$emit("onConfirm", {
267
+ items: this.$xdUniHelper.cloneDeep(this.selectedItems),
268
+ labels: this.$xdUniHelper.cloneDeep(this.selectedLabels),
269
+ ids: this.$xdUniHelper.cloneDeep(this.selectedIds)
270
+ });
271
+ }
272
+ }
273
+ }
274
+ </script>
275
+
276
+ <style lang="less" scoped>
277
+ .filter_wrap{
278
+ overflow: auto;
279
+ max-height: 50vh;
280
+
281
+ .filter_item{
282
+ &:last-child {
283
+ margin-bottom: 0!important;
284
+ }
285
+ }
286
+ .filter_title{
287
+ color: #333333;
288
+ font-size: 28rpx;
289
+ margin-bottom: 1.2rem;
290
+ font-weight: bold;
291
+ display: flex;
292
+ justify-content: space-between;
293
+
294
+ ._ext{
295
+ display: flex;
296
+ align-items: center;
297
+ font-size: 24rpx;
298
+ color: #BBBBBB;
299
+ font-weight: normal;
300
+
301
+ & > text {
302
+ padding-right: unit(10, rpx);
303
+ }
304
+ }
305
+ }
306
+
307
+ .filter_tab{
308
+ display: flex;
309
+ flex-wrap: wrap;
310
+ justify-content: flex-start;
311
+ align-items: center;
312
+ // max-height: 50vh;
313
+
314
+ & > ._tag{
315
+ text-align: center;
316
+ line-height: 66rpx;
317
+ border-radius: 4rpx;
318
+ font-size: 24rpx;
319
+ color: #666;
320
+ text-overflow: ellipsis;
321
+ overflow: hidden;
322
+ white-space: nowrap;
323
+ box-sizing: border-box;
324
+ background-color: #f8f8f8;
325
+
326
+ &:nth-child(3n){
327
+ margin-right: 0!important;
328
+ }
329
+ &:nth-child(1),&:nth-child(2),&:nth-child(3) {
330
+ margin-top: 0!important;
331
+ }
332
+ }
333
+ }
334
+
335
+ }
336
+
337
+ .bottom_btn{
338
+ display: flex;
339
+ justify-content: center;
340
+ padding: 16rpx 32rpx;
341
+ border-top: 2rpx solid #f8f8f8;
342
+
343
+ .xd-button{
344
+ margin: 0 32rpx;
345
+ }
346
+ }
347
+ </style>