@pisell/private-materials 6.4.1 → 6.4.2

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.
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const PaymentPlugin: () => JSX.Element;
2
3
  export default PaymentPlugin;
@@ -740,13 +740,18 @@ export var useWalletPass = function useWalletPass(props) {
740
740
  }
741
741
  });
742
742
  var handleSelectDiscount = useMemoizedFn(function (value, option) {
743
- var _pisellos$effects2;
743
+ var _detail$discountList, _pisellos$effects2;
744
744
  setLoading(true);
745
745
  var isSelected = value.includes(option.id);
746
746
  var detail = shopDiscount.setDiscountSelected({
747
747
  discountId: option.id,
748
748
  isSelected: isSelected
749
749
  });
750
+ if (!(detail !== null && detail !== void 0 && (_detail$discountList = detail.discountList) !== null && _detail$discountList !== void 0 && (_detail$discountList = _detail$discountList.find(function (item) {
751
+ return item.id === option.id;
752
+ })) !== null && _detail$discountList !== void 0 && _detail$discountList.isSelected)) {
753
+ setLoading(false);
754
+ }
750
755
 
751
756
  // 保持初始顺序设置折扣列表
752
757
  var sortedDiscountList = sortDiscountListWithInitialOrder(detail.discountList);
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const PaymentPlugin: () => JSX.Element;
2
3
  export default PaymentPlugin;
@@ -575,18 +575,21 @@ var useWalletPass = (props) => {
575
575
  }
576
576
  });
577
577
  const handleSelectDiscount = (0, import_ahooks.useMemoizedFn)((value, option) => {
578
- var _a;
578
+ var _a, _b, _c;
579
579
  setLoading(true);
580
580
  const isSelected = value.includes(option.id);
581
581
  const detail = shopDiscount.setDiscountSelected({
582
582
  discountId: option.id,
583
583
  isSelected
584
584
  });
585
+ if (!((_b = (_a = detail == null ? void 0 : detail.discountList) == null ? void 0 : _a.find((item) => item.id === option.id)) == null ? void 0 : _b.isSelected)) {
586
+ setLoading(false);
587
+ }
585
588
  const sortedDiscountList = sortDiscountListWithInitialOrder(
586
589
  detail.discountList
587
590
  );
588
591
  setDiscountList(sortedDiscountList);
589
- (_a = pisellos == null ? void 0 : pisellos.effects) == null ? void 0 : _a.emit(
592
+ (_c = pisellos == null ? void 0 : pisellos.effects) == null ? void 0 : _c.emit(
590
593
  "shopDiscount:onSelectedDiscountListChange",
591
594
  detail
592
595
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "6.4.1",
3
+ "version": "6.4.2",
4
4
  "scripts": {
5
5
  "dev": "father dev",
6
6
  "build": "father build",
@@ -1,17 +0,0 @@
1
- /**
2
- * @title: 添加额外商品
3
- * @description:
4
- * @return {*}
5
- * @Author: zhiwei.Wang
6
- * @Date: 2024-01-30 16:33
7
- */
8
- import './index.less';
9
- export interface InfoProps {
10
- title?: string;
11
- style?: any;
12
- globalState: any;
13
- setGlobalState: any;
14
- }
15
- export declare const formatProducts: (values: any) => any;
16
- declare const Addons: any;
17
- export default Addons;
@@ -1,17 +0,0 @@
1
- /**
2
- * @title: 添加额外商品
3
- * @description:
4
- * @return {*}
5
- * @Author: zhiwei.Wang
6
- * @Date: 2024-01-30 16:33
7
- */
8
- import './index.less';
9
- export interface InfoProps {
10
- title?: string;
11
- style?: any;
12
- globalState: any;
13
- setGlobalState: any;
14
- }
15
- export declare const formatProducts: (values: any) => any;
16
- declare const Addons: any;
17
- export default Addons;