@pisell/private-materials 3.3.55 → 3.3.57

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 (123) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +6 -6
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +6 -6
  11. package/es/components/appointmentBooking/assets/resource.svg +1 -0
  12. package/es/components/appointmentBooking/components/Content/index.d.ts +0 -1
  13. package/es/components/appointmentBooking/components/Header/index.d.ts +0 -1
  14. package/es/components/appointmentBooking/components/Resource/index.js +44 -5
  15. package/es/components/appointmentBooking/hooks.js +218 -177
  16. package/es/components/appointmentBooking/locales.d.ts +3 -0
  17. package/es/components/appointmentBooking/locales.js +9 -0
  18. package/es/components/booking/components/TabProduct/productItem/index.js +14 -2
  19. package/es/components/booking/components/drawer/index.js +4 -2
  20. package/es/components/booking/components/footer/index.js +1 -1
  21. package/es/components/booking/components/voucher/index.js +25 -17
  22. package/es/components/booking/info/client/index.js +2 -1
  23. package/es/components/booking/info/pet/index.js +3 -0
  24. package/es/components/booking/info/service2/utils.js +27 -27
  25. package/es/components/booking/info2/index.js +3 -3
  26. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  27. package/es/components/booking/info2/service/addService/utils.js +5 -2
  28. package/es/components/booking/info2/service/editService/index.js +1 -0
  29. package/es/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
  30. package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.js +23 -4
  31. package/es/components/eventBooking/components/progressBar/index.js +16 -0
  32. package/es/components/eventBooking/index.d.ts +0 -1
  33. package/es/components/pay/toC/PaymentList/index.js +10 -4
  34. package/es/components/pay/toC/PaymentList/serve.d.ts +1 -1
  35. package/es/components/pay/toC/PaymentList/serve.js +7 -1
  36. package/es/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.js +30 -13
  37. package/es/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.js +30 -13
  38. package/es/components/pay/toC/PaymentMethods/index.js +29 -2
  39. package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
  40. package/es/components/pay/toC/WalletPassBlock/index.less +4 -0
  41. package/es/components/pay/toC/index.js +38 -30
  42. package/es/components/pay/toC/utils.d.ts +6 -0
  43. package/es/components/pay/toC/utils.js +21 -0
  44. package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -1
  45. package/es/components/productExtension/fields/SelectProducts/ProductItem/index.js +18 -6
  46. package/es/components/productSelect/components/TabProduct/index.js +28 -10
  47. package/es/components/productSelect/components/TabProduct/tabs/index.d.ts +21 -0
  48. package/es/components/productSelect/components/TabProduct/tabs/index.js +243 -0
  49. package/es/components/productSelect/components/TabProduct/tabs/index.less +126 -0
  50. package/es/components/productSelect/components/pisellPriceText/index.d.ts +11 -0
  51. package/es/components/productSelect/components/pisellPriceText/index.js +43 -0
  52. package/es/components/productSelect/components/productGroup/index.js +20 -7
  53. package/es/components/productSelect/components/productGroup/index.less +14 -1
  54. package/es/components/productSelect/index.less +1 -2
  55. package/es/components/ticketBooking/components/addServiceVariant/addService.js +16 -10
  56. package/es/components/ticketBooking/components/addServiceVariant/index.less +10 -0
  57. package/es/components/ticketBooking/components/ticketBooking/index.js +18 -9
  58. package/es/components/ticketBooking/index.js +2 -1
  59. package/es/components/ticketBooking/locales.d.ts +3 -0
  60. package/es/components/ticketBooking/locales.js +12 -3
  61. package/es/components/ticketBooking/serve.d.ts +5 -0
  62. package/es/components/ticketBooking/serve.js +27 -0
  63. package/es/components/ticketBooking/utils/index.d.ts +5 -1
  64. package/es/components/ticketBooking/utils/index.js +35 -3
  65. package/es/components/wallet/index.js +51 -5
  66. package/lib/components/appointmentBooking/assets/resource.svg +1 -0
  67. package/lib/components/appointmentBooking/components/Content/index.d.ts +0 -1
  68. package/lib/components/appointmentBooking/components/Header/index.d.ts +0 -1
  69. package/lib/components/appointmentBooking/components/Resource/index.js +44 -5
  70. package/lib/components/appointmentBooking/hooks.js +12 -3
  71. package/lib/components/appointmentBooking/locales.d.ts +3 -0
  72. package/lib/components/appointmentBooking/locales.js +3 -0
  73. package/lib/components/booking/components/TabProduct/productItem/index.js +8 -1
  74. package/lib/components/booking/components/drawer/index.js +2 -2
  75. package/lib/components/booking/components/footer/index.js +1 -1
  76. package/lib/components/booking/components/voucher/index.js +31 -27
  77. package/lib/components/booking/info/client/index.js +2 -1
  78. package/lib/components/booking/info/pet/index.js +3 -0
  79. package/lib/components/booking/info/service2/utils.js +2 -2
  80. package/lib/components/booking/info2/index.js +7 -4
  81. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  82. package/lib/components/booking/info2/service/addService/utils.js +4 -2
  83. package/lib/components/booking/info2/service/editService/index.js +1 -0
  84. package/lib/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
  85. package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.js +18 -8
  86. package/lib/components/eventBooking/components/progressBar/index.js +15 -0
  87. package/lib/components/eventBooking/index.d.ts +0 -1
  88. package/lib/components/pay/toC/PaymentList/index.js +11 -6
  89. package/lib/components/pay/toC/PaymentList/serve.d.ts +1 -1
  90. package/lib/components/pay/toC/PaymentList/serve.js +5 -2
  91. package/lib/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.js +10 -1
  92. package/lib/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.js +10 -1
  93. package/lib/components/pay/toC/PaymentMethods/index.js +28 -4
  94. package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
  95. package/lib/components/pay/toC/WalletPassBlock/index.less +4 -0
  96. package/lib/components/pay/toC/index.js +20 -13
  97. package/lib/components/pay/toC/utils.d.ts +6 -0
  98. package/lib/components/pay/toC/utils.js +15 -0
  99. package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -1
  100. package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.js +8 -1
  101. package/lib/components/productSelect/components/TabProduct/index.js +19 -6
  102. package/lib/components/productSelect/components/TabProduct/tabs/index.d.ts +21 -0
  103. package/lib/components/productSelect/components/TabProduct/tabs/index.js +202 -0
  104. package/lib/components/productSelect/components/TabProduct/tabs/index.less +126 -0
  105. package/lib/components/productSelect/components/pisellPriceText/index.d.ts +11 -0
  106. package/lib/components/productSelect/components/pisellPriceText/index.js +72 -0
  107. package/lib/components/productSelect/components/productGroup/index.js +24 -4
  108. package/lib/components/productSelect/components/productGroup/index.less +14 -1
  109. package/lib/components/productSelect/index.less +1 -2
  110. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +25 -14
  111. package/lib/components/ticketBooking/components/addServiceVariant/index.less +10 -0
  112. package/lib/components/ticketBooking/components/ticketBooking/index.js +17 -8
  113. package/lib/components/ticketBooking/index.js +2 -1
  114. package/lib/components/ticketBooking/locales.d.ts +3 -0
  115. package/lib/components/ticketBooking/locales.js +6 -3
  116. package/lib/components/ticketBooking/serve.d.ts +5 -0
  117. package/lib/components/ticketBooking/serve.js +8 -2
  118. package/lib/components/ticketBooking/utils/index.d.ts +5 -1
  119. package/lib/components/ticketBooking/utils/index.js +35 -3
  120. package/lib/components/wallet/index.js +26 -1
  121. package/package.json +4 -4
  122. package/es/components/booking/info2/service/editService/Resources/index.d.ts +0 -4
  123. package/lib/components/booking/info2/service/editService/Resources/index.d.ts +0 -4
@@ -101,24 +101,28 @@ var VoucherCard = (props) => {
101
101
  });
102
102
  return val;
103
103
  }, [state.service.value]);
104
+ const { run } = (0, import_ahooks.useDebounceFn)(
105
+ () => {
106
+ var _a2, _b2;
107
+ if (productRef.current === state.service.value || !((_b2 = (_a2 = state.service) == null ? void 0 : _a2.value) == null ? void 0 : _b2.length)) {
108
+ return;
109
+ }
110
+ if (isBooking4Shop) {
111
+ const val = shopDiscount.calcDiscount(state.service.value);
112
+ productRef.current = val.productList;
113
+ dispatch({
114
+ type: "setService",
115
+ payload: {
116
+ ...services,
117
+ value: ((val == null ? void 0 : val.productList) || []).filter(Boolean)
118
+ }
119
+ });
120
+ }
121
+ },
122
+ { wait: 500 }
123
+ );
104
124
  (0, import_react.useEffect)(() => {
105
- var _a2, _b2;
106
- if (productRef.current === state.service.value || !((_b2 = (_a2 = state.service) == null ? void 0 : _a2.value) == null ? void 0 : _b2.length)) {
107
- return;
108
- }
109
- if (isBooking4Shop) {
110
- const val = shopDiscount.calcDiscount(state.service.value);
111
- console.log("input: ", state.service.value);
112
- console.log("output: ", val);
113
- productRef.current = val.productList;
114
- dispatch({
115
- type: "setService",
116
- payload: {
117
- ...services,
118
- value: ((val == null ? void 0 : val.productList) || []).filter(Boolean)
119
- }
120
- });
121
- }
125
+ run();
122
126
  }, [JSON.stringify(serviceMemo), isBooking4Shop]);
123
127
  const fn = (0, import_ahooks.useMemoizedFn)((result) => {
124
128
  var _a2;
@@ -135,18 +139,18 @@ var VoucherCard = (props) => {
135
139
  });
136
140
  (0, import_react.useEffect)(() => {
137
141
  if (!isBooking4Shop) return;
138
- pisellos.effects.on(ShopDiscountHooks.onScanCustomerChange, (customer) => {
139
- dispatch({
140
- type: "setClient",
141
- payload: {
142
- value: customer
143
- }
144
- });
145
- });
146
142
  pisellos.effects.on(
147
- ShopDiscountHooks.onLoadPrepareCalcResult,
148
- fn
143
+ ShopDiscountHooks.onScanCustomerChange,
144
+ (customer) => {
145
+ dispatch({
146
+ type: "setClient",
147
+ payload: {
148
+ value: customer
149
+ }
150
+ });
151
+ }
149
152
  );
153
+ pisellos.effects.on(ShopDiscountHooks.onLoadPrepareCalcResult, fn);
150
154
  pisellos.effects.on(
151
155
  ShopDiscountHooks.onDiscountListChange,
152
156
  (discount) => {
@@ -306,7 +306,8 @@ var Client = () => {
306
306
  isPreview: false,
307
307
  drawerProps: {
308
308
  title: import_utils.locales.getText("pisell2.text.select-customer"),
309
- destroyOnClose: true
309
+ destroyOnClose: true,
310
+ mask: state.drawerMask
310
311
  },
311
312
  mode: "single",
312
313
  createItemText: import_utils.locales.getText("pisell2.text.create-new-customer"),
@@ -463,6 +463,9 @@ var Pet = (props) => {
463
463
  ...((_c3 = (_b3 = (_a3 = state.pet) == null ? void 0 : _a3.formData) == null ? void 0 : _b3[0]) == null ? void 0 : _c3.options) || []
464
464
  ]);
465
465
  },
466
+ drawerProps: {
467
+ mask: state.drawerMask
468
+ },
466
469
  getHolders,
467
470
  addCallbackService: addCallback,
468
471
  loading: valueLoading,
@@ -454,7 +454,7 @@ var isAllNormalProductByState = (state) => {
454
454
  return isAllNormalProduct(state.service.value);
455
455
  };
456
456
  var getGeneralParams = (item, state, isParallelResource) => {
457
- var _a, _b, _c, _d, _e, _f, _g;
457
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
458
458
  const { pet, service } = state;
459
459
  const { holders = [], formData } = pet || {};
460
460
  const parallelResourceOtherParams = {};
@@ -519,6 +519,7 @@ var getGeneralParams = (item, state, isParallelResource) => {
519
519
  holder_id: (_d = item == null ? void 0 : item._extend) == null ? void 0 : _d.holder_id,
520
520
  start_date: !isNormalProduct ? (_e = item == null ? void 0 : item._extend) == null ? void 0 : _e.startDate : "",
521
521
  end_date: !isNormalProduct ? ((_f = item == null ? void 0 : item._extend) == null ? void 0 : _f.endDate) || ((_g = item == null ? void 0 : item._extend) == null ? void 0 : _g.end_date) : "",
522
+ rowKey: `rowKey-${(_i = (_h = item == null ? void 0 : item._extend) == null ? void 0 : _h.other) == null ? void 0 : _i.rowKey}`,
522
523
  ...parallelResourceOtherParams
523
524
  };
524
525
  };
@@ -543,7 +544,6 @@ var formatProducts = (lists, state, isRenderGroup = true, isGeneral, isParallelR
543
544
  errorMessage = getErrorMessage(item, resourceItem, isDayBooking(state));
544
545
  }
545
546
  const generalParams = isGeneral ? getGeneralParams(item, state, !!isParallelResource) : {};
546
- console.log(isNormalProduct, "isNormalProduct");
547
547
  return {
548
548
  id: item == null ? void 0 : item.id,
549
549
  _id: item == null ? void 0 : item._id,
@@ -92,7 +92,7 @@ var Info = (0, import_model.Provider)((props) => {
92
92
  });
93
93
  }
94
94
  }, []);
95
- (0, import_react.useEffect)(() => {
95
+ (0, import_react.useMemo)(() => {
96
96
  var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m;
97
97
  const isFranchisee = (_d2 = (_c2 = (_b2 = (_a2 = context == null ? void 0 : context.appHelper) == null ? void 0 : _a2.utils) == null ? void 0 : _b2.businessUtils) == null ? void 0 : _c2.getAppByModal) == null ? void 0 : _d2.call(_c2, "franchisee");
98
98
  modal.dispatch({
@@ -165,9 +165,12 @@ var Info = (0, import_model.Provider)((props) => {
165
165
  try {
166
166
  setTimeout(async () => {
167
167
  var _a2;
168
- let data = await (0, import_serve.getResourceList)({
169
- date: currentDate
170
- }, (_a2 = stateRef == null ? void 0 : stateRef.current) == null ? void 0 : _a2.bookingId);
168
+ let data = await (0, import_serve.getResourceList)(
169
+ {
170
+ date: currentDate
171
+ },
172
+ (_a2 = stateRef == null ? void 0 : stateRef.current) == null ? void 0 : _a2.bookingId
173
+ );
171
174
  data.date = currentDate;
172
175
  localStorage.setItem("bookingResourceList", JSON.stringify(data));
173
176
  modal.dispatch({
@@ -77,7 +77,7 @@ export declare const setDefaultCapacitys: ({ capacitys, cacheItem }: any) => any
77
77
  * @Author: zhiwei.Wang
78
78
  * @Date: 2024-06-01 13:25
79
79
  */
80
- export declare const getProductExtend: ({ cacheItem, state }: any) => any;
80
+ export declare const getProductExtend: ({ cacheItem, state, isDisabledTime }: any) => any;
81
81
  /**
82
82
  * @title: 格式化服务列表
83
83
  * @description: 后端列表返回的product_resource.resources 的optional_resource等不是最新数据
@@ -355,7 +355,7 @@ var getIsAutoClose = (cacheItem) => {
355
355
  }
356
356
  );
357
357
  };
358
- var getProductExtend = ({ cacheItem, state }) => {
358
+ var getProductExtend = ({ cacheItem, state, isDisabledTime }) => {
359
359
  const isNew = cacheItem.new || !cacheItem._extend.endDate;
360
360
  let _cacheItem = { ...cacheItem };
361
361
  const resourcesOriginMap = state.service.resourcesOriginMap || {};
@@ -409,7 +409,9 @@ var getProductExtend = ({ cacheItem, state }) => {
409
409
  if (_cacheItem._extend.bundle_edit !== void 0) {
410
410
  _cacheItem._extend.bundle_edit = 1;
411
411
  }
412
- _cacheItem._time = (/* @__PURE__ */ new Date()).getTime();
412
+ if (!isDisabledTime) {
413
+ _cacheItem._time = (/* @__PURE__ */ new Date()).getTime();
414
+ }
413
415
  } else {
414
416
  if (!_cacheItem._data.capacitys) {
415
417
  _cacheItem._data.capacitys = cacheItem.capacity;
@@ -428,6 +428,7 @@ var Info = (_, ref) => {
428
428
  titleNoWrap: true,
429
429
  zIndex: state.service.changeService ? 999 : 1e3,
430
430
  forceRender: true,
431
+ mask: state.drawerMask,
431
432
  open: state.service.editModal && !((_p = state.service.cacheItem) == null ? void 0 : _p.autoClose),
432
433
  title: import_utils.locales.getText("pisell2.text.edit-service"),
433
434
  onClose: () => {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Header: () => JSX.Element;
4
3
  export default Header;
@@ -37,6 +37,8 @@ var import_OpenCard = __toESM(require("../../OpenCard"));
37
37
  var import_materials = require("@pisell/materials");
38
38
  var import_utils = require("@pisell/utils");
39
39
  var import_Sales = require("../../../../Sales");
40
+ var import_decimal = __toESM(require("decimal.js"));
41
+ var import_pisellPriceText = __toESM(require("../../../../productSelect/components/pisellPriceText"));
40
42
  var BookingOptions = (props) => {
41
43
  var _a, _b;
42
44
  const { detail, currentBookingOption, selectEventDetailBookingOptions } = (0, import_Sales.useEventDetail)();
@@ -63,14 +65,22 @@ var BookingOptions = (props) => {
63
65
  optionClassName: `option-item ${((_b = detail == null ? void 0 : detail.bookingOptions) == null ? void 0 : _b.length) > 1 ? "option-item-pointer" : ""}`,
64
66
  value: currentBookingOption,
65
67
  renderOption: (option) => {
66
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "item" }, /* @__PURE__ */ import_react.default.createElement("span", null, option.label), /* @__PURE__ */ import_react.default.createElement(
67
- import_materials.PisellText.Amount,
68
- {
69
- value: option.price,
70
- showCurrencySymbol: true,
71
- className: "price"
72
- }
73
- ));
68
+ const { price, is_bundle, minimum_markup_price } = option._originData || {};
69
+ if (!option._originData || !is_bundle) {
70
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: "item" }, /* @__PURE__ */ import_react.default.createElement("span", null, option.label), /* @__PURE__ */ import_react.default.createElement(
71
+ import_materials.PisellText.Amount,
72
+ {
73
+ value: option.price,
74
+ showCurrencySymbol: true,
75
+ className: "price"
76
+ }
77
+ ));
78
+ }
79
+ let _price = price;
80
+ if (is_bundle) {
81
+ _price = new import_decimal.default(price).plus(new import_decimal.default(minimum_markup_price)).toFixed(2);
82
+ }
83
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: "item" }, /* @__PURE__ */ import_react.default.createElement("span", null, option.label), /* @__PURE__ */ import_react.default.createElement(import_pisellPriceText.default, { className: "price", value: _price, isMini: true }));
74
84
  },
75
85
  onChange
76
86
  }
@@ -37,6 +37,7 @@ var import_materials = require("@pisell/materials");
37
37
  var import_Sales = require("../../../Sales");
38
38
  var import_utils = require("@pisell/utils");
39
39
  var import_index = require("./index.less");
40
+ var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
40
41
  var ProgressBar = ({
41
42
  title,
42
43
  description,
@@ -48,8 +49,11 @@ var ProgressBar = ({
48
49
  onBack,
49
50
  onClose
50
51
  }) => {
52
+ var _a;
51
53
  const [open, setOpen] = (0, import_react.useState)(false);
52
54
  const { removeSessionStorage } = (0, import_Sales.useSales)();
55
+ const context = (0, import_useEngineContext.default)();
56
+ const { interaction } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {};
53
57
  const handleClose = () => {
54
58
  if (isConfirmClose) {
55
59
  setOpen(true);
@@ -58,6 +62,17 @@ var ProgressBar = ({
58
62
  }
59
63
  };
60
64
  const handleOk = () => {
65
+ var _a2, _b;
66
+ if ((_b = (_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.isAppEnv) == null ? void 0 : _b.call(_a2)) {
67
+ interaction.utils.postMessageToApp({
68
+ module: "global",
69
+ key: "paymentResultAction",
70
+ data: {
71
+ actionType: "backHome"
72
+ }
73
+ });
74
+ return;
75
+ }
61
76
  onClose == null ? void 0 : onClose();
62
77
  setOpen(false);
63
78
  removeSessionStorage == null ? void 0 : removeSessionStorage();
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const EventBooking: () => JSX.Element;
4
3
  export default EventBooking;
@@ -46,19 +46,20 @@ var offline = [
46
46
  "pisell.custom_payment"
47
47
  ];
48
48
  var PaymentList = (props, ref) => {
49
- var _a, _b;
49
+ var _a, _b, _c;
50
50
  const [paymentList, setPaymentList] = (0, import_react.useState)([]);
51
51
  const [paymentType, setPaymentType] = (0, import_react.useState)("");
52
52
  const [loading, setLoading] = (0, import_react.useState)(true);
53
53
  const context = (0, import_useEngineContext.default)();
54
+ const { interaction } = (_a = context.appHelper) == null ? void 0 : _a.utils;
54
55
  const _paymentList = (0, import_react.useMemo)(() => {
55
56
  var _a2;
56
57
  return ((_a2 = props == null ? void 0 : props.store) == null ? void 0 : _a2.paymentList) || paymentList;
57
- }, [paymentList, (_a = props == null ? void 0 : props.store) == null ? void 0 : _a.paymentList]);
58
+ }, [paymentList, (_b = props == null ? void 0 : props.store) == null ? void 0 : _b.paymentList]);
58
59
  const _paymentType = (0, import_react.useMemo)(() => {
59
60
  var _a2;
60
61
  return ((_a2 = props == null ? void 0 : props.store) == null ? void 0 : _a2.paymentType) || paymentType;
61
- }, [paymentType, (_b = props == null ? void 0 : props.store) == null ? void 0 : _b.paymentType]);
62
+ }, [paymentType, (_c = props == null ? void 0 : props.store) == null ? void 0 : _c.paymentType]);
62
63
  const _getPaymentList = async (initProps) => {
63
64
  var _a2;
64
65
  setLoading(true);
@@ -85,11 +86,15 @@ var PaymentList = (props, ref) => {
85
86
  setPaymentList(list);
86
87
  return list;
87
88
  };
89
+ const isApp = (0, import_react.useMemo)(() => {
90
+ var _a2, _b2;
91
+ return (_b2 = (_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.isAppEnv) == null ? void 0 : _b2.call(_a2);
92
+ }, []);
88
93
  const init = (list) => {
89
94
  var _a2, _b2;
90
95
  setLoading(true);
91
96
  const platform = ((_b2 = (_a2 = context.appHelper) == null ? void 0 : _a2.constants) == null ? void 0 : _b2.platform) || "h5";
92
- const { paymentList: paymentList2, walletPass } = (0, import_serve.filterPaymentList)(list, platform);
97
+ const { paymentList: paymentList2, walletPass } = (0, import_serve.filterPaymentList)(list, platform, isApp);
93
98
  if (paymentList2.length > 0) {
94
99
  let first = paymentList2[0];
95
100
  setPaymentList(paymentList2);
@@ -131,13 +136,13 @@ var PaymentList = (props, ref) => {
131
136
  })
132
137
  );
133
138
  const renderToast = (_item) => {
134
- var _a2, _b2, _c;
139
+ var _a2, _b2, _c2;
135
140
  return /* @__PURE__ */ import_react.default.createElement("div", { className: "surcharge-modal-wrap" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "surcharge-modal-title" }, _item.title + " " + (((_a2 = _item == null ? void 0 : _item.params) == null ? void 0 : _a2.description) ? import_utils2.locales.getText("tocPay.text.paymentInstructions") : import_utils2.locales.getText("tocPay.text.serviceCharge"))), /* @__PURE__ */ import_react.default.createElement(
136
141
  "div",
137
142
  {
138
143
  className: "surcharge-info",
139
144
  dangerouslySetInnerHTML: {
140
- __html: ((_b2 = _item == null ? void 0 : _item.params) == null ? void 0 : _b2.description) ? (_c = _item == null ? void 0 : _item.params) == null ? void 0 : _c.description : _item.surcharge_fee
145
+ __html: ((_b2 = _item == null ? void 0 : _item.params) == null ? void 0 : _b2.description) ? (_c2 = _item == null ? void 0 : _item.params) == null ? void 0 : _c2.description : _item.surcharge_fee
141
146
  }
142
147
  }
143
148
  ));
@@ -20,7 +20,7 @@ export declare const getPaymentList: (values: any) => Promise<{
20
20
  * @Author: zhiwei.Wang
21
21
  * @Date: 2024-08-16 10:57
22
22
  */
23
- export declare const filterPaymentList: (list: any[], platform?: string) => {
23
+ export declare const filterPaymentList: (list: any[], platform: string | undefined, isApp: boolean) => {
24
24
  message: string;
25
25
  status: string;
26
26
  paymentList: any[];
@@ -31,12 +31,12 @@ var getPaymentList = async (values) => {
31
31
  let { data = [] } = await import_utils.request.getRequest().get("/h5/pay/order/payments", values);
32
32
  return filterPaymentList(data);
33
33
  };
34
- var filterPaymentList = (list, platform = "h5") => {
34
+ var filterPaymentList = (list, platform = "h5", isApp) => {
35
35
  let paymentList = [...list];
36
36
  let _paymentKeys = [...import_status.paymentKeys];
37
37
  const walletPass = paymentList.find((d) => d.service === "pisell.wallet_pass");
38
38
  let arr = [];
39
- if (!(0, import_utils2.isWx)()) {
39
+ if (!(0, import_utils2.isWx)() && !isApp) {
40
40
  arr = arr.concat(["globepay.wechat.jsapi", "superpay.wechat.h5"]);
41
41
  }
42
42
  if (platform === "h5") {
@@ -45,6 +45,9 @@ var filterPaymentList = (list, platform = "h5") => {
45
45
  if (!(0, import_utils2.isIOS)()) {
46
46
  arr = arr.concat(["mw.apple"]);
47
47
  }
48
+ if ((0, import_utils2.isIOS)() && isApp) {
49
+ arr = arr.concat(["mw.google"]);
50
+ }
48
51
  _paymentKeys = _paymentKeys.filter((d) => !arr.includes(d));
49
52
  paymentList = paymentList.filter(
50
53
  (d) => _paymentKeys.includes(d.service)
@@ -39,12 +39,21 @@ var import_ThreedsLoading = __toESM(require("../MWCreditCard/TDSPay/ThreedsLoadi
39
39
  var import_serve = require("./serve");
40
40
  var import_payGroup = require("../../payGroup");
41
41
  var import_index = require("./index.less");
42
+ var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
43
+ var import_utils2 = require("../../utils");
42
44
  var SuperPayAliPayH5 = (props, ref) => {
45
+ var _a;
43
46
  const { onChange } = props;
44
47
  const [open, setOpen] = (0, import_react.useState)(false);
48
+ const context = (0, import_useEngineContext.default)();
49
+ const { interaction } = (_a = context.appHelper) == null ? void 0 : _a.utils;
45
50
  const init = async ({ payGroup }) => {
46
- setOpen(true);
51
+ var _a2, _b;
47
52
  const values = (0, import_payGroup.getPayGroupParamsFromStorage)(payGroup.order_id);
53
+ if ((_b = (_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.isAppEnv) == null ? void 0 : _b.call(_a2)) {
54
+ return (0, import_utils2.clientPayment)({ order_id: payGroup.order_id, type: "aliPay", values, interaction });
55
+ }
56
+ setOpen(true);
48
57
  if (!values) {
49
58
  setOpen(false);
50
59
  return;
@@ -39,11 +39,20 @@ var import_serve = require("./serve");
39
39
  var import_payGroup = require("../../payGroup");
40
40
  var import_index = require("./index.less");
41
41
  var import_utils = require("@pisell/utils");
42
+ var import_utils2 = require("../../utils");
43
+ var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
42
44
  var SuperPayWxPayH5 = (props, ref) => {
45
+ var _a;
43
46
  const [open, setOpen] = (0, import_react.useState)(false);
47
+ const context = (0, import_useEngineContext.default)();
48
+ const { interaction } = (_a = context.appHelper) == null ? void 0 : _a.utils;
44
49
  const init = async ({ payGroup }) => {
45
- setOpen(true);
50
+ var _a2, _b;
46
51
  const values = (0, import_payGroup.getPayGroupParamsFromStorage)(payGroup.order_id);
52
+ if ((_b = (_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.isAppEnv) == null ? void 0 : _b.call(_a2)) {
53
+ return (0, import_utils2.clientPayment)({ order_id: payGroup.order_id, type: "wxPay", values, interaction });
54
+ }
55
+ setOpen(true);
47
56
  if (!values) {
48
57
  setOpen(false);
49
58
  return;
@@ -51,6 +51,9 @@ var import_GlobePayWxH5 = __toESM(require("./GlobePayWxH5"));
51
51
  var import_GlobePayQrcode = __toESM(require("./GlobePayQrcode"));
52
52
  var import_serve = require("./WalletPass/serve");
53
53
  var import_utils = require("../utils");
54
+ var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
55
+ var import_utils2 = require("@pisell/utils");
56
+ var import_serve2 = require("./GlobePayQrcode/serve");
54
57
  var isOfflinePayment = (type) => {
55
58
  if ((0, import_status.isCustomPayment)(type)) {
56
59
  return true;
@@ -63,6 +66,7 @@ var isOfflinePayment = (type) => {
63
66
  ].includes(type);
64
67
  };
65
68
  var PaymentMethods = (props, ref) => {
69
+ var _a;
66
70
  const MWCreditCardRef2 = (0, import_react.useRef)(null);
67
71
  const SuperPayAliPayH5Ref2 = (0, import_react.useRef)(null);
68
72
  const StripePayRef2 = (0, import_react.useRef)(null);
@@ -77,10 +81,12 @@ var PaymentMethods = (props, ref) => {
77
81
  const GlobePayPaypalH5Ref2 = (0, import_react.useRef)(null);
78
82
  const GlobePayWxH5Ref2 = (0, import_react.useRef)(null);
79
83
  const GlobePayQrcodeRef2 = (0, import_react.useRef)(null);
84
+ const context = (0, import_useEngineContext.default)();
85
+ const { interaction } = (_a = context.appHelper) == null ? void 0 : _a.utils;
80
86
  const init = async ({ type, payGroup }) => {
81
- var _a, _b;
87
+ var _a2, _b;
82
88
  const waitAmount = (payGroup == null ? void 0 : payGroup.wait_amount) || 0;
83
- const cards = (_b = (_a = payGroup == null ? void 0 : payGroup.walletPass) == null ? void 0 : _a.cards) == null ? void 0 : _b.length;
89
+ const cards = (_b = (_a2 = payGroup == null ? void 0 : payGroup.walletPass) == null ? void 0 : _a2.cards) == null ? void 0 : _b.length;
84
90
  if (cards && (waitAmount <= 0 || isOfflinePayment(type))) {
85
91
  try {
86
92
  await (0, import_serve.walletPassPay)((0, import_utils.formatWalletPassParams)(payGroup));
@@ -110,11 +116,29 @@ var PaymentMethods = (props, ref) => {
110
116
  }
111
117
  await onPayByType({ type, payGroup });
112
118
  };
119
+ (0, import_react.useEffect)(() => {
120
+ var _a2, _b, _c, _d;
121
+ console.log("paymentResult isAppEnv", (_b = (_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.isAppEnv) == null ? void 0 : _b.call(_a2));
122
+ if ((_d = (_c = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _c.isAppEnv) == null ? void 0 : _d.call(_c)) {
123
+ interaction.utils.mountFunction("global", "paymentResult", (strResult) => {
124
+ console.log("paymentResult", strResult);
125
+ if (!(0, import_utils2.isJson)(strResult)) return;
126
+ const result = JSON.parse(strResult);
127
+ const { type, pay_number, order_id } = result;
128
+ if (type && order_id && pay_number) {
129
+ (0, import_payGroup.setPayNumber)(order_id, pay_number);
130
+ }
131
+ const url = `${(0, import_serve2.getReturnUrl)()}?order_id=${order_id}&status=success`;
132
+ console.log(url, "paymentResult");
133
+ window.location.href = url;
134
+ });
135
+ }
136
+ }, []);
113
137
  const onPayByType = async ({ type, payGroup }) => {
114
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
138
+ var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
115
139
  console.log(type, payGroup);
116
140
  if (type === "mw.apple") {
117
- await ((_a = ApplePayRef2.current) == null ? void 0 : _a.init({ payGroup }));
141
+ await ((_a2 = ApplePayRef2.current) == null ? void 0 : _a2.init({ payGroup }));
118
142
  return;
119
143
  }
120
144
  if (type === "mw.google") {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { WalletPassDataType } from '../../../PaymentMethods/WalletPass/serve';
3
2
  import './index.less';
4
3
  interface WalletUseListProps {
@@ -10,6 +10,10 @@
10
10
  display: flex;
11
11
  align-items: center;
12
12
  justify-content: center;
13
+ & > span:first-child {
14
+ text-overflow: ellipsis;
15
+ overflow: hidden;
16
+ }
13
17
  }
14
18
  }
15
19
 
@@ -70,7 +70,7 @@ var ToCPay = (props, ref) => {
70
70
  import_utils.locales.init(import_locales.default, ((_m = dvaStore.core) == null ? void 0 : _m.translateLocale) || "en");
71
71
  import_utils2.request.setRequest(utils == null ? void 0 : utils.request);
72
72
  const _initStore = (initProps) => {
73
- var _a2, _b2, _c2, _d2;
73
+ var _a2;
74
74
  dispatch({
75
75
  type: "init",
76
76
  payload: {
@@ -78,15 +78,15 @@ var ToCPay = (props, ref) => {
78
78
  status: "init",
79
79
  // 将支付回调储存在store, 方便其他模块调用
80
80
  payCallback: props.callback,
81
- history: (_a2 = context.appHelper.utils) == null ? void 0 : _a2.history,
81
+ history: (_a2 = context.appHelper.utils) == null ? void 0 : _a2.history
82
82
  // 支付组
83
- payGroup: {
84
- order_id: (_b2 = initProps == null ? void 0 : initProps.order) == null ? void 0 : _b2.order_id,
85
- total_amount: (_c2 = initProps == null ? void 0 : initProps.order) == null ? void 0 : _c2.amount,
86
- // 原订单信息
87
- _order: initProps == null ? void 0 : initProps.order,
88
- payment_group_id: (_d2 = initProps == null ? void 0 : initProps.order) == null ? void 0 : _d2.payment_group_id
89
- }
83
+ // payGroup: {
84
+ // order_id: initProps?.order?.order_id,
85
+ // total_amount: initProps?.order?.amount,
86
+ // // 原订单信息
87
+ // _order: initProps?.order,
88
+ // payment_group_id: initProps?.order?.payment_group_id,
89
+ // },
90
90
  }
91
91
  });
92
92
  };
@@ -140,7 +140,12 @@ var ToCPay = (props, ref) => {
140
140
  dispatch({
141
141
  type: "setPayGroup",
142
142
  payload: {
143
- ...state.payGroup,
143
+ // ...state.payGroup,
144
+ order_id: order == null ? void 0 : order.order_id,
145
+ // total_amount: order?.amount,
146
+ // 原订单信息
147
+ _order: order,
148
+ payment_group_id: order == null ? void 0 : order.payment_group_id,
144
149
  // 支付方式没有walletPass时walletPass设置null
145
150
  walletPass: walletPass ? {
146
151
  ...(_a2 = state.payGroup) == null ? void 0 : _a2.walletPass,
@@ -148,7 +153,7 @@ var ToCPay = (props, ref) => {
148
153
  amount: wallet_pass_amount,
149
154
  cards: wallet_pass_recommend_list
150
155
  } : null,
151
- total_amount: order.amount,
156
+ total_amount: order == null ? void 0 : order.amount,
152
157
  wait_amount: remain_amount
153
158
  }
154
159
  });
@@ -277,13 +282,15 @@ var ToCPay = (props, ref) => {
277
282
  (_a2 = props.callback) == null ? void 0 : _a2.call(props, res);
278
283
  };
279
284
  const onCancel = () => {
280
- var _a2;
285
+ var _a2, _b2;
281
286
  (0, import_payGroup.removePayGroupFromStorage)((_a2 = state.payGroup) == null ? void 0 : _a2.order_id);
282
287
  setShowInformation(false);
283
288
  setOpen(false);
284
289
  payCallback({
285
290
  key: "cancel",
286
- data: {}
291
+ data: {
292
+ order_id: (_b2 = state.payGroup) == null ? void 0 : _b2.order_id
293
+ }
287
294
  });
288
295
  };
289
296
  (0, import_ahooks.useUpdateEffect)(() => {
@@ -49,3 +49,9 @@ export declare const isFranchiseeShop: (path?: any, history?: any) => any;
49
49
  export declare const getFranchiseeShopId: (path?: any, history?: any) => number;
50
50
  export declare const formatFranchiseeRoute: (url: string, history?: any) => string;
51
51
  export declare const getAvailableMaxAmount: (data: WalletPassDataType) => string;
52
+ export declare const clientPayment: (params: {
53
+ order_id: number;
54
+ type: "aliPay" | "wxPay";
55
+ values: any;
56
+ interaction?: any;
57
+ }) => void;
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  var utils_exports = {};
21
21
  __export(utils_exports, {
22
22
  calcWalletPassListAmount: () => calcWalletPassListAmount,
23
+ clientPayment: () => clientPayment,
23
24
  formatFranchiseeRoute: () => formatFranchiseeRoute,
24
25
  formatWalletPassList2PreparePayments: () => formatWalletPassList2PreparePayments,
25
26
  formatWalletPassParams: () => formatWalletPassParams,
@@ -85,9 +86,23 @@ var formatFranchiseeRoute = (url, history) => {
85
86
  var getAvailableMaxAmount = (data) => {
86
87
  return data.tag !== "point_card" ? data.available_max_amount : data == null ? void 0 : data.recommended_usage_amount;
87
88
  };
89
+ var clientPayment = (params) => {
90
+ var _a, _b;
91
+ const { interaction, type, order_id, values } = params;
92
+ (_b = (_a = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a.postMessageToApp) == null ? void 0 : _b.call(_a, {
93
+ module: "global",
94
+ key: "paymentClient",
95
+ data: {
96
+ type,
97
+ order_id,
98
+ ...values
99
+ }
100
+ });
101
+ };
88
102
  // Annotate the CommonJS export names for ESM import in node:
89
103
  0 && (module.exports = {
90
104
  calcWalletPassListAmount,
105
+ clientPayment,
91
106
  formatFranchiseeRoute,
92
107
  formatWalletPassList2PreparePayments,
93
108
  formatWalletPassParams,
@@ -1,3 +1,3 @@
1
- import "./index.less";
1
+ import './index.less';
2
2
  declare const ProductItem: ({ item, onClick, amountSymbol, style, className, }: any) => JSX.Element;
3
3
  export default ProductItem;