jufubao-mall 2.0.67 → 2.0.69-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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-mall",
3
- "version": "2.0.67",
3
+ "version": "2.0.69-beta1",
4
4
  "private": false,
5
5
  "description": "聚福宝商城业务组件插件包",
6
6
  "main": "index.js",
@@ -993,8 +993,16 @@
993
993
  this.choseCoupon = data;
994
994
  this.showCouponChose = false;
995
995
  //优惠券跟钱包同时使用,优惠券选完后,钱包默认选中第一张卡
996
- if(this.is_wallet_use_with_coupon === "Y" && this.defaultUseWallet && data.isAutoTrigger){
997
- if(this.$refs['xdWalletChose']) this.$refs['xdWalletChose'].handleChoseDefault();
996
+ if(this.is_wallet_use_with_coupon === "Y" && this.defaultUseWallet){
997
+ //自动选择卡券
998
+ if(data.isAutoTrigger){
999
+ if(this.$refs['xdWalletChose']) this.$refs['xdWalletChose'].handleChoseDefault();
1000
+ }
1001
+ //重新选择卡券,则需清空钱包,重新选第一个钱包
1002
+ if(data.reChoseCoupon){
1003
+ if(this.$refs['xdWalletChose']) this.$refs['xdWalletChose'].clearChecked();
1004
+ if(this.$refs['xdWalletChose']) this.$refs['xdWalletChose'].handleChoseDefault();
1005
+ }
998
1006
  }
999
1007
  },
1000
1008
  handleCouponInit(coupList){
@@ -1045,12 +1053,13 @@
1045
1053
  },
1046
1054
  useBindedWallet(options, successCb, errCb){
1047
1055
  console.log("this.choseCard", this.choseCard)
1048
- const { choseCard } = this;
1056
+ const { choseCard, choseCoupon } = this;
1049
1057
  let selected_card_list = choseCard ? choseCard.selectedCardList : [];
1050
1058
  //苏州交投:优惠券跟钱包可同时支持
1051
1059
  //问题:票券跟优惠券同时存在的话,暂时都放到selected_card_list中,后续再做区分处理
1052
1060
  if(this.choseCoupon){
1053
- selected_card_list = selected_card_list.concat(this.choseCoupon.selectedCardList);
1061
+ // selected_card_list = selected_card_list.concat(this.choseCoupon.selectedCardList);
1062
+ selected_card_list = choseCoupon ? choseCoupon.selectedCardList : [];
1054
1063
  }
1055
1064
  let otherOptions = {};
1056
1065
  let fnName = "useBindedWallet";
@@ -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="iconchanpinfenlei" width="50" :size="28"/>
58
+ </view>
56
59
  </view>
57
60
  <view class="jfb-filter-pop" :style="[queryTopComp]">
58
61
  <view
@@ -223,6 +226,12 @@ export default {
223
226
  type: Number,
224
227
  default: 3
225
228
  },
229
+
230
+ //组合布局, 组合内布局可互相切换
231
+ combLayout: {
232
+ type: String,
233
+ default: "N"
234
+ }
226
235
  },
227
236
  filters:{
228
237
  fCusName(item){
@@ -799,6 +808,9 @@ export default {
799
808
 
800
809
  },
801
810
  //==其他菜单下拉操作====
811
+ handleCombLayout(){
812
+ this.$emit("switch-layout")
813
+ },
802
814
 
803
815
  update(){
804
816
  let params = {};
@@ -892,6 +904,11 @@ export default {
892
904
  //}
893
905
  }
894
906
 
907
+ &-ext{
908
+ display: flex;
909
+ align-items: center;
910
+ }
911
+
895
912
  &-name {
896
913
 
897
914
  &.fontWeight {
@@ -74,6 +74,7 @@
74
74
  ref="filter-query"
75
75
  :show-query="showQuery"
76
76
  :layout-info="layoutInfo"
77
+ :comb-layout="combLayout"
77
78
  :top-height="cateFixedHeight"
78
79
  :cus-menu-style="queryMenuStyleComp"
79
80
  :cus-pop-style="filterStyle"
@@ -84,6 +85,7 @@
84
85
  :def-remote="defMenuValue"
85
86
  :price-range="[startPrice, endPrice]"
86
87
  @on-change="handleFitlerChange"
88
+ @switch-layout="handleSwitchLayout"
87
89
  ></com-filter-query>
88
90
  </template>
89
91
  <!--搜索条件-->
@@ -216,6 +218,7 @@
216
218
  import posterMixins from "@/mixins/posterMixins";
217
219
  import CusPoster from "@/components/CusPoster/CusPoster.vue";
218
220
  import XdNoData from "@/components/XdNoData/XdNoData";
221
+ import storage from "@/common/storage";
219
222
 
220
223
  export default {
221
224
  name: "JfbMallProductList",
@@ -265,6 +268,7 @@
265
268
  contentColor:'',
266
269
  filterModeData:[],//菜单数量
267
270
  parentId:0, //获取商品分类父级ID
271
+ combLayout: "N", //组合布局, 组合内布局可互相切换
268
272
 
269
273
  //==搜索条件=============
270
274
  filterPadding:{},
@@ -619,30 +623,20 @@
619
623
  this.xnamespace = gCPVal(container, 'xnamespace', this.projectAttr.business_code||this.xnamespace);
620
624
  this.listPadding = gCPVal(container,'listPadding', [{top:16, left:16, right:16,bottom:16},20], {sKey:'listPaddingStatus',fields:['listPadding'],isPMR: true});
621
625
  this.contentColor = gCPVal(container,'contentColor', ['#f8f8f8','#fafafa'], {sKey:'contentColorStatus',fields:['contentColor']});
626
+ this.combLayout = gCPVal(container, 'combLayout', 'N');
622
627
  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;
628
+ // 读取缓存的布局,若与当前配置相等或为互斥组合,则使用缓存值
629
+ const cachedLayout = storage.get('jfb_mall_product_list_layout');
630
+ if (cachedLayout != null && this.combLayout === 'Y') {
631
+ const validPairs = [[4,2], [1,2], [2,1], [3,2]];
632
+ const isValid = cachedLayout === column_num || validPairs.some(([a, b]) => a === cachedLayout && b === column_num);
633
+ if (isValid) {
634
+ column_num = cachedLayout;
635
+ }
644
636
  }
645
-
637
+ this.column_num = column_num;
638
+ this.orgColumnNum = column_num;
639
+ this.handleColumnInit(column_num);
646
640
 
647
641
  //广告位置
648
642
  this.isPoster = gCPVal(container, 'isPoster', 'N');
@@ -975,7 +969,30 @@
975
969
  //记载完成
976
970
  this.initStatus = true;
977
971
  },
972
+ handleColumnInit(column_num){
973
+ //一列垂直
974
+ if(column_num === 4) {
975
+ this.column_num = 1;
976
+ this.columnOneLayout = 'V';
977
+ this.skeNumber = 10;
978
+ this.page_size = 20;
979
+ }
980
+ //一列水平
981
+ if( column_num === 1) {
982
+ this.skeNumber = 10;
983
+ this.page_size = 20;
984
+ this.columnOneLayout = 'H';
985
+ }
986
+ if( column_num === 2) {
987
+ this.skeNumber = 5;
988
+ this.page_size = 20;
989
+ }
990
+ if(column_num === 3) {
991
+ this.skeNumber = 6;
992
+ this.page_size = 21;
993
+ }
978
994
 
995
+ },
979
996
  //=====广告数据,商品列表, 分类数据,过滤条件===========
980
997
  //广告列表
981
998
  getPosterList(){
@@ -1241,6 +1258,17 @@
1241
1258
  },
1242
1259
  //==菜单相关操作==============
1243
1260
 
1261
+ handleSwitchLayout(){
1262
+ // 组合布局切换:当前布局 ↔ 2列布局
1263
+ if(this.column_num === 2) {
1264
+ this.column_num = this.orgColumnNum === 2 ? 1 : this.orgColumnNum;
1265
+ } else {
1266
+ this.column_num = 2;
1267
+ }
1268
+ storage.set('jfb_mall_product_list_layout', this.column_num);
1269
+ this.handleColumnInit(this.column_num);
1270
+ },
1271
+
1244
1272
  toProductInfo(item){
1245
1273
  if (this.$configProject['isPreview'])return;
1246
1274
  toProductDetail(this, item, this.productInfoPath, item.isCart === 'Y');
@@ -301,6 +301,22 @@ export default (data, gValue,gColor,oldData)=>{
301
301
  });
302
302
  },
303
303
  },
304
+ {ele: 'group_start'},
305
+ {
306
+ label: "组合布局",
307
+ ele: "xd-radio",
308
+ groupKey: 'content',
309
+ valueKey: "combLayout",
310
+ value: dataVal({data, key:'combLayout', dValue:'N', gValue}),
311
+ labelInline:true,
312
+ inline: false,
313
+ list:[
314
+ {label:"开启", value:"Y"},
315
+ {label:"禁用", value:"N"}
316
+ ],
317
+ notice:'开启组合布局后,用户可在多个布局之间切换 ',
318
+ },
319
+ {ele: 'group_end'},
304
320
  {
305
321
  label: "商品样式",
306
322
  ele: "xd-style-image",
@@ -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
  },
@@ -1,22 +0,0 @@
1
- 'use strict';
2
-
3
- /**
4
- * @description 第三方库
5
- * @param threePackagePath {String} 第三方库所在项目路径存放路径路
6
- * @param packname {String} 包名字
7
- * @returns {string|*}
8
- */
9
- const getPackagePath = (threePackagePath, packname = 'gxd-commands-bussiness')=>{
10
- if(packname === 'gxd-commands-bussiness') {
11
- return `/Users/shiyonggao/Desktop/code/BASE/UNIAPP/xd-commands-bussiness/${threePackagePath}`;
12
- }
13
-
14
- if (packname === 'gxd-uni-library-editx') {
15
- return `/Users/shiyonggao/Desktop/code/BASE/UNIAPP/xd-uni-library-editx/${threePackagePath}`;
16
- }
17
-
18
- };
19
-
20
- module.exports = {
21
- getPackagePath
22
- }