jufubao-mall 2.0.39 → 2.0.40-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.39",
3
+ "version": "2.0.40-beta2",
4
4
  "private": false,
5
5
  "description": "聚福宝商城业务组件插件包",
6
6
  "main": "index.js",
@@ -26,7 +26,7 @@ module.exports = [
26
26
  disabled: true
27
27
  },
28
28
  {
29
- mapFnName: "getNewSearchFilterList",
29
+ mapFnName: "getMallNewSearchFilterList",
30
30
  title: "获取搜索过滤条件",
31
31
  path: "/mall/v1/msearch/search-filter",
32
32
  isRule: true,
@@ -24,6 +24,15 @@
24
24
  v-if="showQuery === 'Y' && searchFilterList.length > 0"
25
25
  :style="[queryWrapStyle]"
26
26
  >
27
+ <view v-if="topNavStatus !== 'N'" class="top_category">
28
+ <view class="top_item"
29
+ v-for="(item, i) in topShowItemsComp"
30
+ :key="item.value"
31
+ :class="{active: topIndex === i}"
32
+ :style="[topCategoryItemStyleComp]"
33
+ @click="handleTopItemClick(item, i)"
34
+ >{{item.label}}</view>
35
+ </view>
27
36
  <view class="query_wrap_tabs">
28
37
  <view class="query_wrap_tabs_title" v-if="filterItemsComp.length === 1">店铺列表</view>
29
38
  <view
@@ -139,6 +148,16 @@
139
148
  cusEntry:{}, //入口状态
140
149
  initAttr: false, //状态完成
141
150
 
151
+ //顶部导航
152
+ topIndex: 0, //顶部导航当前索引
153
+ topNavStatus:'',//顶部导航状态
154
+ topAllService:'Y',//顶部服务状态
155
+ topCashierText:'',//线下核销
156
+ topCodeText:'',//电子码
157
+ topSeatText:'',//在线选座
158
+ topTravelText:'',//旅游门店
159
+ topFoodText:'',//在线点单
160
+
142
161
  //style
143
162
  bodyPadding:{},
144
163
  contentBgColor:'rgba(0,0,0,0)',
@@ -221,7 +240,8 @@
221
240
  },
222
241
 
223
242
  cateFixedHeight(){
224
- return 80
243
+ if(this.topNavStatus === 'N') return 80;
244
+ return 160
225
245
  },
226
246
 
227
247
  queryWrapStyle(){
@@ -232,7 +252,8 @@
232
252
  backgroundColor: this.filterBgcColor|| '#fff',
233
253
  color: this.filterColor|| '#333',
234
254
  top,
235
- borderTop: this.filterStyle.filterTopBorder|| '2rpx solid #f8f8f8'
255
+ borderTop: this.filterStyle.filterTopBorder|| '2rpx solid #f8f8f8',
256
+ height: this.cateFixedHeight + 'rpx'
236
257
  }
237
258
  },
238
259
 
@@ -253,9 +274,36 @@
253
274
  let tabs = [];
254
275
  if(this.filterMode.includes('area')) tabs.push({value: 'area', label: '区域', icon: 'icondizhitubiao',size: 24});
255
276
  if(this.filterMode.includes('brand')) tabs.push({value: 'brand', label: '品牌', icon: 'iconxia_down',size: 18});
256
- if(this.filterMode.includes('shop_category')) tabs.push({value: 'shop_category', label: '门店分类', icon: 'iconxia_down',size: 18});
277
+ if(this.filterMode.includes('shop_category') && this.topNavStatus !== 'C') tabs.push({value: 'shop_category', label: '分类', icon: 'iconxia_down',size: 18});
257
278
  if(this.filterMode.includes('filter')) tabs.push({value: 'filter', label: '筛选', icon: 'iconshaixuanbiaoji_mian',size: 24});
258
279
  return tabs
280
+ },
281
+ topCategoryItemStyleComp(){
282
+ let w = 750 / this.topShowItemsComp.length;
283
+ let minW = 160;
284
+ return {
285
+ width: w < minW ? minW + 'rpx' : w + 'rpx',
286
+ }
287
+ },
288
+ //顶部导航展示项目
289
+ topShowItemsComp(){
290
+ if(this.topNavStatus === 'N') return [];
291
+ if(this.topNavStatus === 'S'){
292
+ //显示-服务类型
293
+ return [
294
+ this.topAllService === 'Y' && {label: '全部', value:'all'},
295
+ this.serverType.includes("SELL") && {label: this.topCashierText, value:'SELL'},
296
+ this.serverType.includes("CODE") && {label: this.topCodeText, value:'CODE'},
297
+ this.serverType.includes("SEAT") && {label: this.topSeatText, value:'SEAT'},
298
+ this.serverType.includes("TRAVEL") && {label: this.topTravelText, value:'TRAVEL'},
299
+ this.serverType.includes("HDSELF") && {label: this.topFoodText, value:'HDSELF'}
300
+ ].filter(i => i)
301
+ }else if(this.topNavStatus === 'C'){
302
+ //显示-门店分类
303
+ let shopCate = this.searchFilterList.find(item => item.value === 'shop_category');
304
+ return shopCate ? shopCate.options : [];
305
+ }
306
+ return [];
259
307
  }
260
308
  },
261
309
  created() {
@@ -275,6 +323,7 @@
275
323
  this.serverType = gCPVal(container, 'serverType', [['SELL']]);
276
324
  this.shopType = gCPVal(container, 'shopType', '');
277
325
  this.shopListStyle = gCPVal(container, 'shopListStyle', 'v2');
326
+ this.topNavStatus = gCPVal(container, 'topNavStatus', 'N');
278
327
  this.showQuery = gCPVal(container, 'showQuery', 'N');
279
328
  if(this.showQuery === 'Y') this.filterMode = gCPVal(container, 'filterMode', [['filter']])
280
329
  else this.filterMode = [];
@@ -303,6 +352,15 @@
303
352
  if(gCPVal(container,'showStorePrice','Y') === 'Y') cusContent.push('price'); // 折扣/价格
304
353
  this.cusContent = cusContent;
305
354
 
355
+ //顶部导航
356
+ this.topNavStatus = gCPVal(container,'topNavStatus', 'N');
357
+ this.topAllService = gCPVal(container,'topAllService', 'Y');
358
+ this.topCashierText = gCPVal(container,'topCashierText', '聚好兑');
359
+ this.topCodeText = gCPVal(container,'topCodeText', '电子码');
360
+ this.topSeatText = gCPVal(container,'topSeatText', '在线选座');
361
+ this.topTravelText = gCPVal(container,'topTravelText', '旅游门票');
362
+ this.topFoodText = gCPVal(container,'topFoodText', '在线点单');
363
+
306
364
  //style
307
365
  let sValue = `{"cardItemSpace":16,"margin":{"bottom":16,"left":16,"right":16,"top":16},"backgroundColor":"rgba(245, 245, 245, 1)"}`
308
366
  let shopStyle = this.getRelationStatus(container,'shopStyle', { cardItemSpaceStatus:['cardItemSpace'],bodyPaddingStatus:['bodyPadding']}, sValue);
@@ -348,14 +406,26 @@
348
406
  this.travelfPath = gCPVal(container, 'travelfPath', {value: ''}).value;
349
407
  this.initAttr = true;
350
408
  },
351
-
409
+ handleTopItemClick(item, index){
410
+ this.topIndex = index;
411
+ if(this.topNavStatus === 'N') return;
412
+ if(this.topNavStatus === 'C'){
413
+ //门店分类
414
+ console.log("handleTopItemClick", item);
415
+ this.$set(this.searchFilterParams, 'shop_category', item.value);
416
+ }
417
+ if(this.topNavStatus === 'S'){
418
+ //服务类型
419
+ }
420
+ this.getList();
421
+ },
352
422
  getParams(){
353
- let params = {
423
+ let params = this.$xdUniHelper.deleteParamEmptyKey({
354
424
  page_size: this.page_size,
355
425
  page_token: this.page_token,
356
426
  namespace: this.xnamespace,
357
427
  ...this.options,
358
- }
428
+ })
359
429
 
360
430
 
361
431
  const getSFP = (key , value, p)=>{
@@ -364,11 +434,17 @@
364
434
  if(value.length > 0) params[key] = value.join(',');
365
435
  }
366
436
  }
367
-
437
+ //支持顶部门店服务类型筛选
438
+ if(this.topNavStatus === 'S'){
439
+ let curTopNav = this.topShowItemsComp[this.topIndex];
440
+ if(curTopNav.value !== 'all') params['consume_mode'] = curTopNav.value;
441
+ }else{
442
+ getSFP('consume_mode',this.serverType);
443
+ }
368
444
 
369
445
  getSFP('keyword',this.keyword);
370
446
  getSFP('brand_type',this.shopType);
371
- getSFP('consume_mode',this.serverType);
447
+ // getSFP('consume_mode',this.serverType);
372
448
  getSFP('shop_category_ids',this.searchFilterParams['shop_category']);
373
449
  getSFP('brand_ids',this.searchFilterParams['brand']);
374
450
  getSFP('area_codes',this.searchFilterParams['area']);
@@ -511,15 +587,15 @@
511
587
  this.searchFilterList = [];
512
588
  return
513
589
  }
514
-
515
- let data = {
590
+ let data = this.$xdUniHelper.deleteParamEmptyKey({
516
591
  ...this.options,
517
592
  namespace: this.xnamespace,
518
593
  keyword: this.keyword,
519
594
  city_code: this.stateCity.city_code,
520
595
  type:'sell',
521
- }
522
- jfbRootExec("getNewSearchFilterList", {
596
+ })
597
+
598
+ jfbRootExec("getMallNewSearchFilterList", {
523
599
  vm: this,
524
600
  data: data
525
601
  })
@@ -614,7 +690,8 @@
614
690
  delete options['shop_category_ids'];
615
691
  }
616
692
 
617
- this.options = this.$xdUniHelper.cloneDeep(options);
693
+ // this.options = this.$xdUniHelper.cloneDeep(options);
694
+ this.options = this.reserveParams(options, ['brand_type', 'keyword', 'xnamespace', 'channel_code', 'consume_mode']);
618
695
  this.getSearchFilterList();
619
696
  this.getList();
620
697
  },
@@ -646,10 +723,27 @@
646
723
 
647
724
  .jfb-mall-new-shop-list {
648
725
  &__body{
726
+ .top_category{
727
+ height: 80rpx;
728
+ line-height: 80rpx;
729
+ padding: 0;
730
+ background-color: #fff;
731
+ white-space: nowrap;
732
+ overflow: auto;
733
+ .top_item{
734
+ font-size: 32rpx;
735
+ color: #333;
736
+ display: inline-block;
737
+ text-align: center;
738
+ &.active{
739
+ color: var(--g-theme-main-color);
740
+ }
741
+ }
742
+ }
649
743
  .query_wrap{
650
744
  position: relative;
651
745
  z-index: 103;
652
- height: 80rpx;
746
+ // height: 160rpx;
653
747
  box-sizing: border-box;
654
748
  &.isFixed {
655
749
  position: fixed;
@@ -662,7 +756,7 @@
662
756
  align-items: center;
663
757
  position: relative;
664
758
  z-index: 103;
665
- height: 100%;
759
+ height: 80rpx;
666
760
 
667
761
  &_title {
668
762
  text-align: center;
@@ -485,7 +485,7 @@ module.exports = {
485
485
  "next_page_token":"",
486
486
  "request_id":"3c64153d7c1eec3a"
487
487
  },
488
- getNewSearchFilterList: {
488
+ getMallNewSearchFilterList: {
489
489
  items: [
490
490
  {
491
491
  title: '门店分类',
@@ -144,6 +144,94 @@ export default (data, gValue, gColor, oldData={})=>{
144
144
  });
145
145
  },
146
146
  },
147
+ {
148
+ label: "顶部导航",
149
+ ele: "xd-radio",
150
+ valueKey: "topNavStatus",
151
+ value: dataVal({data, key:'topNavStatus', dValue:'N', gValue}),
152
+ groupKey: "content",
153
+ list: [
154
+ {label: "隐藏", "value": "N"},
155
+ {label: "显示-门店分类", "value": "C"},
156
+ {label: "显示-服务类型", "value": "S"}
157
+ ],
158
+ labelInline:true,
159
+ },
160
+ {ele: 'group_start'},
161
+ {
162
+ label: "全部选项",
163
+ ele: "xd-radio",
164
+ valueKey: "topAllService",
165
+ value: dataVal({data, key:'topAllService', dValue:'Y', gValue}),
166
+ groupKey: "content",
167
+ list: [
168
+ {label: "显示", "value": "Y"},
169
+ {label: "隐藏", "value": "N"},
170
+ ],
171
+ labelInline:true,
172
+ hidden: dataVal({data, key:'topNavStatus', dValue:'N', gValue}) !== 'S',
173
+ },
174
+ data.serverType.includes('SELL') && {
175
+ label: "线下核销",
176
+ ele: "el-input",
177
+ valueKey: "topCashierText",
178
+ value: dataVal({data, key:'topCashierText', dValue:'', gValue}),
179
+ max: 4,
180
+ groupKey: "content",
181
+ labelInline:true,
182
+ hidden: dataVal({data, key:'topNavStatus', dValue:'N', gValue}) !== 'S',
183
+ className: 'input100',
184
+ placeholder: "聚好兑"
185
+ },
186
+ data.serverType.includes('CODE') && {
187
+ label: "电子码",
188
+ ele: "el-input",
189
+ valueKey: "topCodeText",
190
+ value: dataVal({data, key:'topCodeText', dValue:'', gValue}),
191
+ max: 4,
192
+ groupKey: "content",
193
+ labelInline:true,
194
+ hidden: dataVal({data, key:'topNavStatus', dValue:'N', gValue}) !== 'S',
195
+ className: 'input100',
196
+ placeholder: "电子码"
197
+ },
198
+ data.serverType.includes('SEAT') && {
199
+ label: "在线选座",
200
+ ele: "el-input",
201
+ valueKey: "topSeatText",
202
+ value: dataVal({data, key:'topSeatText', dValue:'', gValue}),
203
+ max: 4,
204
+ groupKey: "content",
205
+ labelInline:true,
206
+ hidden: dataVal({data, key:'topNavStatus', dValue:'N', gValue}) !== 'S',
207
+ className: 'input100',
208
+ placeholder: "在线选座"
209
+ },
210
+ data.serverType.includes('TRAVEL') && {
211
+ label: "旅游门店",
212
+ ele: "el-input",
213
+ valueKey: "topTravelText",
214
+ value: dataVal({data, key:'topTravelText', dValue:'', gValue}),
215
+ max: 4,
216
+ groupKey: "content",
217
+ labelInline:true,
218
+ hidden: dataVal({data, key:'topNavStatus', dValue:'N', gValue}) !== 'S',
219
+ className: 'input100',
220
+ placeholder: "旅游门票"
221
+ },
222
+ data.serverType.includes('HDSELF') && {
223
+ label: "小时达到店",
224
+ ele: "el-input",
225
+ valueKey: "topFoodText",
226
+ value: dataVal({data, key:'topFoodText', dValue:'', gValue}),
227
+ max: 4,
228
+ groupKey: "content",
229
+ labelInline:true,
230
+ hidden: dataVal({data, key:'topNavStatus', dValue:'N', gValue}) !== 'S',
231
+ className: 'input100',
232
+ placeholder: "在线点单"
233
+ },
234
+ {ele: 'group_end'},
147
235
  {
148
236
  label: "展示内容",
149
237
  ele: "title",
@@ -166,7 +254,7 @@ export default (data, gValue, gColor, oldData={})=>{
166
254
  },
167
255
  {ele: 'group_start'},
168
256
  {
169
- label: "横向菜单",
257
+ label: "",
170
258
  ele: "xd-check",
171
259
  groupKey:'content',
172
260
  valueKey: "filterMode",
@@ -174,7 +262,7 @@ export default (data, gValue, gColor, oldData={})=>{
174
262
  list:[
175
263
  {"label": "区域", "value": 'area'},
176
264
  {"label": "品牌", "value": 'brand'},
177
- {"label": "门店分类", "value": 'shop_category'},
265
+ {"label": "分类", "value": 'shop_category', disabled: data.topNavStatus === 'C'},
178
266
  {"label": "筛选", "value": 'filter'},
179
267
  ],
180
268
  labelInline: true,
@@ -166,9 +166,9 @@
166
166
  <cus-poster
167
167
  :key="posterKey"
168
168
  :main-color="mainColor"
169
- v-if="posterList !== null && posterList.length > 0"
169
+ v-if="showPosterList !== null && showPosterList.length > 0"
170
170
  :mode="mode"
171
- :poster-list="posterList"
171
+ :poster-list="showPosterList"
172
172
  :style-obj="{
173
173
  posterSize: posterSize,
174
174
  carouselTime: carouselTime,
@@ -395,6 +395,24 @@
395
395
  paddingTb: Number(this.getPMValue(this.filterPadding, 'TB',0))
396
396
  }
397
397
  },
398
+ showPosterList(){
399
+ let resultList = this.posterList.filter(item=>{
400
+ if(!item.custom_params){
401
+ return true;
402
+ } else {
403
+ let reg = new RegExp('cid=([^&]*)');
404
+ let result = reg.exec(item.custom_params);
405
+ let cid = result && result[1];
406
+ if(cid){
407
+ return cid == this.trueCateId || cid == this.truePid;
408
+ }else{
409
+ return true;
410
+ }
411
+ }
412
+ }).slice(0,this.posterNum);
413
+ console.log('resultList', resultList);
414
+ return resultList;
415
+ },
398
416
  },
399
417
  watch: {
400
418
  container(value,oldValue) {
@@ -953,7 +971,7 @@
953
971
  data: {
954
972
  page_id: this.pageAttr['page_id'], //页面ID
955
973
  container_id: this.containerId, //组件ID
956
- page_size: this.posterNum //可以不传
974
+ page_size: 100 //可以不传
957
975
  },
958
976
  })
959
977
  .then(res => {