jufubao-mall 2.0.74 → 2.0.76

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.
@@ -8,11 +8,11 @@
8
8
  */
9
9
  const getPackagePath = (threePackagePath, packname = 'gxd-commands-bussiness')=>{
10
10
  if(packname === 'gxd-commands-bussiness') {
11
- return `/Users/shiyonggao/Desktop/code/BASE/UNIAPP/xd-commands-bussiness/${threePackagePath}`;
11
+ return `/Users/shiyonggao/home/root/Base-Jufubao/xd-commands-bussiness/${threePackagePath}`;
12
12
  }
13
13
 
14
14
  if (packname === 'gxd-uni-library-editx') {
15
- return `/Users/shiyonggao/Desktop/code/BASE/UNIAPP/xd-uni-library-editx/${threePackagePath}`;
15
+ return `/Users/shiyonggao/home/root/Base-Jufubao/xd-uni-library-editx/${threePackagePath}`;
16
16
  }
17
17
 
18
18
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-mall",
3
- "version": "2.0.74",
3
+ "version": "2.0.76",
4
4
  "private": false,
5
5
  "description": "聚福宝商城业务组件插件包",
6
6
  "main": "index.js",
@@ -53,6 +53,9 @@
53
53
  </view>
54
54
  </view>
55
55
  </template>
56
+ <view v-if="combLayout==='Y'" class="jfb-filter-menu-ext" @click="handleCombLayout">
57
+ <xd-font-icon :icon="combIcon" width="50" :size="28"/>
58
+ </view>
56
59
  </view>
57
60
  <view class="jfb-filter-pop" :style="[queryTopComp]">
58
61
  <view
@@ -223,6 +226,15 @@ export default {
223
226
  type: Number,
224
227
  default: 3
225
228
  },
229
+
230
+ //组合布局, 组合内布局可互相切换
231
+ combLayout: {
232
+ type: String,
233
+ default: "N"
234
+ },
235
+ combIcon: {
236
+ type: String
237
+ }
226
238
  },
227
239
  filters:{
228
240
  fCusName(item){
@@ -799,6 +811,9 @@ export default {
799
811
 
800
812
  },
801
813
  //==其他菜单下拉操作====
814
+ handleCombLayout(){
815
+ this.$emit("switch-layout")
816
+ },
802
817
 
803
818
  update(){
804
819
  let params = {};
@@ -892,6 +907,11 @@ export default {
892
907
  //}
893
908
  }
894
909
 
910
+ &-ext{
911
+ display: flex;
912
+ align-items: center;
913
+ }
914
+
895
915
  &-name {
896
916
 
897
917
  &.fontWeight {
@@ -74,6 +74,8 @@
74
74
  ref="filter-query"
75
75
  :show-query="showQuery"
76
76
  :layout-info="layoutInfo"
77
+ :comb-layout="combLayout"
78
+ :comb-icon="switchLayoutIcon"
77
79
  :top-height="cateFixedHeight"
78
80
  :cus-menu-style="queryMenuStyleComp"
79
81
  :cus-pop-style="filterStyle"
@@ -84,6 +86,7 @@
84
86
  :def-remote="defMenuValue"
85
87
  :price-range="[startPrice, endPrice]"
86
88
  @on-change="handleFitlerChange"
89
+ @switch-layout="handleSwitchLayout"
87
90
  ></com-filter-query>
88
91
  </template>
89
92
  <!--搜索条件-->
@@ -216,6 +219,7 @@
216
219
  import posterMixins from "@/mixins/posterMixins";
217
220
  import CusPoster from "@/components/CusPoster/CusPoster.vue";
218
221
  import XdNoData from "@/components/XdNoData/XdNoData";
222
+ import storage from "@/common/storage";
219
223
 
220
224
  export default {
221
225
  name: "JfbMallProductList",
@@ -265,6 +269,7 @@
265
269
  contentColor:'',
266
270
  filterModeData:[],//菜单数量
267
271
  parentId:0, //获取商品分类父级ID
272
+ combLayout: "N", //组合布局, 组合内布局可互相切换
268
273
 
269
274
  //==搜索条件=============
270
275
  filterPadding:{},
@@ -416,6 +421,14 @@
416
421
  console.log('resultList', resultList);
417
422
  return resultList;
418
423
  },
424
+ switchLayoutIcon(){
425
+ //当前为2列时显示原始布局的icon,否则显示2列布局的icon
426
+ const targetLayout = this.column_num === 2
427
+ ? (this.orgColumnNum === 2 ? 1 : this.orgColumnNum)
428
+ : 2;
429
+ const iconMap = { 1: 'iconfenlei', 2: 'icona-huaban1', 3: 'iconsanlie', 4: 'icondanlie' };
430
+ return iconMap[targetLayout] || 'icona-huaban6';
431
+ }
419
432
  },
420
433
  watch: {
421
434
  container(value,oldValue) {
@@ -619,30 +632,20 @@
619
632
  this.xnamespace = gCPVal(container, 'xnamespace', this.projectAttr.business_code||this.xnamespace);
620
633
  this.listPadding = gCPVal(container,'listPadding', [{top:16, left:16, right:16,bottom:16},20], {sKey:'listPaddingStatus',fields:['listPadding'],isPMR: true});
621
634
  this.contentColor = gCPVal(container,'contentColor', ['#f8f8f8','#fafafa'], {sKey:'contentColorStatus',fields:['contentColor']});
635
+ this.combLayout = gCPVal(container, 'combLayout', 'N');
622
636
  let column_num = gCPVal(container, 'row_num', 2);
623
- this.column_num = column_num;
624
- //一列垂直
625
- if(column_num === 4) {
626
- this.column_num = 1;
627
- this.columnOneLayout = 'V';
628
- this.skeNumber = 10;
629
- this.page_size = 20;
630
- }
631
- //一列水平
632
- if( column_num === 1) {
633
- this.skeNumber = 10;
634
- this.page_size = 20;
635
- this.columnOneLayout = 'H';
636
- }
637
- if( column_num === 2) {
638
- this.skeNumber = 5;
639
- this.page_size = 20;
640
- }
641
- if(column_num === 3) {
642
- this.skeNumber = 6;
643
- this.page_size = 21;
637
+ // 读取缓存的布局,若与当前配置相等或为互斥组合,则使用缓存值
638
+ const cachedLayout = storage.get('jfb_mall_product_list_layout');
639
+ if (cachedLayout != null && this.combLayout === 'Y' && !this.$configProject['isPreview']) {
640
+ const validPairs = [[4,2], [1,2], [2,1], [3,2]];
641
+ const isValid = cachedLayout === column_num || validPairs.some(([a, b]) => a === cachedLayout && b === column_num);
642
+ if (isValid) {
643
+ column_num = cachedLayout;
644
+ }
644
645
  }
645
-
646
+ this.column_num = column_num;
647
+ this.orgColumnNum = column_num;
648
+ this.handleColumnInit(column_num);
646
649
 
647
650
  //广告位置
648
651
  this.isPoster = gCPVal(container, 'isPoster', 'N');
@@ -975,7 +978,30 @@
975
978
  //记载完成
976
979
  this.initStatus = true;
977
980
  },
981
+ handleColumnInit(column_num){
982
+ //一列垂直
983
+ if(column_num === 4) {
984
+ this.column_num = 1;
985
+ this.columnOneLayout = 'V';
986
+ this.skeNumber = 10;
987
+ this.page_size = 20;
988
+ }
989
+ //一列水平
990
+ if( column_num === 1) {
991
+ this.skeNumber = 10;
992
+ this.page_size = 20;
993
+ this.columnOneLayout = 'H';
994
+ }
995
+ if( column_num === 2) {
996
+ this.skeNumber = 5;
997
+ this.page_size = 20;
998
+ }
999
+ if(column_num === 3) {
1000
+ this.skeNumber = 6;
1001
+ this.page_size = 21;
1002
+ }
978
1003
 
1004
+ },
979
1005
  //=====广告数据,商品列表, 分类数据,过滤条件===========
980
1006
  //广告列表
981
1007
  getPosterList(){
@@ -1242,6 +1268,17 @@
1242
1268
  },
1243
1269
  //==菜单相关操作==============
1244
1270
 
1271
+ handleSwitchLayout(){
1272
+ // 组合布局切换:当前布局 ↔ 2列布局
1273
+ if(this.column_num === 2) {
1274
+ this.column_num = this.orgColumnNum === 2 ? 1 : this.orgColumnNum;
1275
+ } else {
1276
+ this.column_num = 2;
1277
+ }
1278
+ storage.set('jfb_mall_product_list_layout', this.column_num);
1279
+ this.handleColumnInit(this.column_num);
1280
+ },
1281
+
1245
1282
  toProductInfo(item){
1246
1283
  if (this.$configProject['isPreview'])return;
1247
1284
  toProductDetail(this, item, this.productInfoPath, item.isCart === 'Y');
@@ -129,113 +129,116 @@ export default (data, gValue,gColor,oldData)=>{
129
129
  });
130
130
  },
131
131
  },
132
- {ele: 'group_start'},
133
- {
134
- label: "全部名称",
135
- ele: "el-input",
136
- valueKey: "allName",
137
- value: data.allName || "",
138
- labelInline: true,
139
- className: "input100",
140
- groupKey:'content',
141
- inline:false,
142
- notice:'设置全部自定义名称,默认值:<span style="color:red">全部</span>',
143
- rules: [
144
- {
145
- required: false,
146
- validator: (rule, value, callback) => {
147
- value = value.trim();
148
- if(value.length === 0) return callback()
149
- if (value.length < 2 || value.length > 4) callback('全部自定义名称长度为:1-4字符');
150
- else callback()
151
- },
152
- trigger: 'blur'
153
- }
154
- ],
155
- },
156
- {
157
- label: '全部图标',
158
- ele: 'xd-upload',
159
- valueKey: 'allIcon',
160
- value: data['allIcon'] || {},
161
- defaultValue: data['allIcon'],
162
- slot: true,
163
- tipsformet: ``,
164
- type: ['jpg', 'png', 'jpeg','gif'],
165
- styleType: 'one',
166
- uploadType: 'aliyun',
167
- groupKey:'content',
168
- size: .5,
169
- action: 'aliyun',
170
- oneWidth: 128,
171
- oneHeight: 128,
172
- labelInline: true,
173
- inline:false,
174
- notice:'建议尺寸:128*128像素',
175
- rules: [
176
- {
177
- validator: (rule, value, callback) => {
178
- if(!value) callback('请上传全部图片图片');
179
- else {
180
- if(!isObject(value)){
181
- callback('请上传全部图片图片');
132
+ data.category !== 'none' && [
133
+ {ele: 'group_start'},
134
+ {
135
+ label: "全部名称",
136
+ ele: "el-input",
137
+ valueKey: "allName",
138
+ value: data.allName || "",
139
+ labelInline: true,
140
+ className: "input100",
141
+ groupKey:'content',
142
+ inline:false,
143
+ notice:'设置全部自定义名称,默认值:<span style="color:red">全部</span>',
144
+ rules: [
145
+ {
146
+ required: false,
147
+ validator: (rule, value, callback) => {
148
+ value = value.trim();
149
+ if(value.length === 0) return callback()
150
+ if (value.length < 2 || value.length > 4) callback('全部自定义名称长度为:1-4字符');
151
+ else callback()
152
+ },
153
+ trigger: 'blur'
154
+ }
155
+ ],
156
+ },
157
+ {
158
+ label: '全部图标',
159
+ ele: 'xd-upload',
160
+ valueKey: 'allIcon',
161
+ value: data['allIcon'] || {},
162
+ defaultValue: data['allIcon'],
163
+ slot: true,
164
+ tipsformet: ``,
165
+ type: ['jpg', 'png', 'jpeg','gif'],
166
+ styleType: 'one',
167
+ uploadType: 'aliyun',
168
+ groupKey:'content',
169
+ size: .5,
170
+ action: 'aliyun',
171
+ oneWidth: 128,
172
+ oneHeight: 128,
173
+ labelInline: true,
174
+ inline:false,
175
+ notice:'建议尺寸:128*128像素',
176
+ rules: [
177
+ ['v2', 'v3', 'v4'].includes(data.category) && {
178
+ validator: (rule, value, callback) => {
179
+ if(!value) callback('请上传全部图片图片');
180
+ else {
181
+ if(!isObject(value)){
182
+ callback('请上传全部图片图片');
183
+ }
184
+ else {
185
+ if(!value.url)callback('请上传全部图片图片');
186
+ else callback()
187
+ }
182
188
  }
189
+ },
190
+ message: '请上传全部图片图片',
191
+ trigger: ['blur', 'change'],
192
+ required: true,
193
+ }
194
+ ].filter(i=>i),
195
+ },
196
+ {
197
+ label: '父级分类',
198
+ ele: 'xd-radio',
199
+ groupKey: 'content',
200
+ valueKey: 'categoryParentType',
201
+ value: categoryParentType,
202
+ labelInline:true,
203
+ className: 'input100',
204
+ list: [
205
+ {label: '根目录', value: 'root'},
206
+ {label: '自定义', value: 'child'},
207
+ ],
208
+ notice:'展示指定父级分类下的子级分类',
209
+ inline: false
210
+ },
211
+ {
212
+ label: '',
213
+ ele: 'el-input',
214
+ type: 'number',
215
+ labelInline: true,
216
+ valueKey: 'categoryParent',
217
+ cusStyle: {
218
+ paddingLeft: '90px'
219
+ },
220
+ value: dataVal({data, key:'categoryParent', dValue:'', gValue}),
221
+ groupKey:'content',
222
+ className: 'input100',
223
+ hidden: categoryParentType === 'root',
224
+ rules: [
225
+ {
226
+ validator: (rule, value, callback) => {
227
+ if(categoryParentType === 'root') callback();
183
228
  else {
184
- if(!value.url)callback('请上传全部图片图片');
229
+ if(!value) callback('请输入父级分类ID');
185
230
  else callback()
186
231
  }
187
- }
188
- },
189
- message: '请上传全部图片图片',
190
- trigger: ['blur', 'change'],
191
- required: true,
192
- }
193
- ],
194
- },
195
- {
196
- label: '父级分类',
197
- ele: 'xd-radio',
198
- groupKey: 'content',
199
- valueKey: 'categoryParentType',
200
- value: categoryParentType,
201
- labelInline:true,
202
- className: 'input100',
203
- list: [
204
- {label: '根目录', value: 'root'},
205
- {label: '自定义', value: 'child'},
206
- ],
207
- notice:'展示指定父级分类下的子级分类',
208
- inline: false
209
- },
210
- {
211
- label: '',
212
- ele: 'el-input',
213
- type: 'number',
214
- labelInline: true,
215
- valueKey: 'categoryParent',
216
- cusStyle: {
217
- paddingLeft: '90px'
232
+ },
233
+ message: '请输入父级分类ID',
234
+ trigger: ['blur', 'change'],
235
+ required: true,
236
+ }
237
+ ],
218
238
  },
219
- value: dataVal({data, key:'categoryParent', dValue:'', gValue}),
220
- groupKey:'content',
221
- className: 'input100',
222
- hidden: categoryParentType === 'root',
223
- rules: [
224
- {
225
- validator: (rule, value, callback) => {
226
- if(categoryParentType === 'root') callback();
227
- else {
228
- if(!value) callback('请输入父级分类ID');
229
- else callback()
230
- }
231
- },
232
- message: '请输入父级分类ID',
233
- trigger: ['blur', 'change'],
234
- required: true,
235
- }
236
- ],
237
- },
238
- {ele: 'group_end'},
239
+ {ele: 'group_end'},
240
+ ],
241
+
239
242
  {
240
243
  label: "分类样式",
241
244
  ele: "xd-style-image",
@@ -301,6 +304,22 @@ export default (data, gValue,gColor,oldData)=>{
301
304
  });
302
305
  },
303
306
  },
307
+ {ele: 'group_start'},
308
+ {
309
+ label: "组合布局",
310
+ ele: "xd-radio",
311
+ groupKey: 'content',
312
+ valueKey: "combLayout",
313
+ value: dataVal({data, key:'combLayout', dValue:'N', gValue}),
314
+ labelInline:true,
315
+ inline: false,
316
+ list:[
317
+ {label:"开启", value:"Y"},
318
+ {label:"禁用", value:"N"}
319
+ ],
320
+ notice:'开启组合布局后,用户可在多个布局之间切换 ',
321
+ },
322
+ {ele: 'group_end'},
304
323
  {
305
324
  label: "商品样式",
306
325
  ele: "xd-style-image",
@@ -461,5 +480,5 @@ export default (data, gValue,gColor,oldData)=>{
461
480
 
462
481
  ...ProductAttr(data, gValue,gColor,oldData),
463
482
  ...PosterAttr(data, gValue,gColor,oldData)
464
- ]
483
+ ].flat().filter(i=>i)
465
484
  }
@@ -303,7 +303,7 @@
303
303
  })
304
304
  }else{
305
305
  this.$xdUniHelper.navigateTo({
306
- url: this.productListPath + `?keyword=${this.keyword}`
306
+ url: this.productListPath + `?keyword=${this.keyword}&search_focus_back=Y`
307
307
  })
308
308
  }
309
309
  },
@@ -540,7 +540,9 @@
540
540
  this.shopInfo = shopInfo;
541
541
  this.mapCenter = {lng: shopInfo.longitude, lat: shopInfo.latitude}
542
542
  this.initBaidu = true;
543
- this.getShowBrandTip(this.shopInfo)
543
+ if(this.shopInfo.shop_id !== 0){
544
+ this.getShowBrandTip(this.shopInfo)
545
+ }
544
546
  this.$nextTick(() => {
545
547
  this.checkTextOverflow();
546
548
  if(this.isShowCodeProduct){