@pisell/private-materials 6.11.62 → 6.11.63
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/pro/skuDetailModal/index.js +2 -2
- package/lib/pro/skuDetailModal/index.js +8 -8
- package/package.json +1 -1
|
@@ -33,7 +33,7 @@ import useLogger from "../../hooks/useLogger";
|
|
|
33
33
|
import { filterVariantGroupByVariants } from "../../components/shoppingCart/utils";
|
|
34
34
|
import { cloneDeep } from 'lodash';
|
|
35
35
|
var SkuDetailModal = function SkuDetailModal(_ref, ref) {
|
|
36
|
-
var _context$appHelper,
|
|
36
|
+
var _context$appHelper, _context$engine, _bookingState$booking3, _bookingState$booking6, _bookingState$booking9, _productData$_extend2, _bookingState$booking13, _bookingState$booking14;
|
|
37
37
|
var onConfirm = _ref.onConfirm,
|
|
38
38
|
onRemove = _ref.onRemove,
|
|
39
39
|
onClose = _ref.onClose;
|
|
@@ -137,7 +137,7 @@ var SkuDetailModal = function SkuDetailModal(_ref, ref) {
|
|
|
137
137
|
*/
|
|
138
138
|
var _ref3 = useContext(BookingContext) || {},
|
|
139
139
|
bookingState = _ref3.state;
|
|
140
|
-
var symbol = (
|
|
140
|
+
var symbol = getData('shop_symbol');
|
|
141
141
|
locales.init(localeTexts, (context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale) || 'en');
|
|
142
142
|
var getDetailData = /*#__PURE__*/function () {
|
|
143
143
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data, open_deposit) {
|
|
@@ -52,7 +52,7 @@ var import_useLogger = __toESM(require("../../hooks/useLogger"));
|
|
|
52
52
|
var import_utils3 = require("../../components/shoppingCart/utils");
|
|
53
53
|
var import_lodash = require("lodash");
|
|
54
54
|
var SkuDetailModal = ({ onConfirm, onRemove, onClose }, ref) => {
|
|
55
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m
|
|
55
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
56
56
|
const [open, setOpen] = (0, import_react.useState)(false);
|
|
57
57
|
const [productData, setProductData] = (0, import_react.useState)(null);
|
|
58
58
|
const [note, setNote] = (0, import_react.useState)("");
|
|
@@ -91,8 +91,8 @@ var SkuDetailModal = ({ onConfirm, onRemove, onClose }, ref) => {
|
|
|
91
91
|
const context = (0, import_useEngineContext.default)();
|
|
92
92
|
const { store, getData, isWebPos } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {};
|
|
93
93
|
const { state: bookingState } = (0, import_react.useContext)(import_model.Context) || {};
|
|
94
|
-
const symbol = (
|
|
95
|
-
import_utils.locales.init(import_locales.default, ((
|
|
94
|
+
const symbol = getData("shop_symbol");
|
|
95
|
+
import_utils.locales.init(import_locales.default, ((_c = (_b = context == null ? void 0 : context.engine) == null ? void 0 : _b.props) == null ? void 0 : _c.locale) || "en");
|
|
96
96
|
const getDetailData = async (data, open_deposit) => {
|
|
97
97
|
var _a2;
|
|
98
98
|
const isCallProductDetail = ((_a2 = data == null ? void 0 : data.skuDetailConfig) == null ? void 0 : _a2.isCallProductDetail) ?? false;
|
|
@@ -115,19 +115,19 @@ var SkuDetailModal = ({ onConfirm, onRemove, onClose }, ref) => {
|
|
|
115
115
|
return Number(
|
|
116
116
|
((_c2 = (_b2 = (_a2 = bookingState == null ? void 0 : bookingState.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b2.stock_setting) == null ? void 0 : _c2.stock_validation) ?? 0
|
|
117
117
|
);
|
|
118
|
-
}, [(
|
|
118
|
+
}, [(_e = (_d = bookingState == null ? void 0 : bookingState.bookingConfig) == null ? void 0 : _d.config) == null ? void 0 : _e.stock_setting]);
|
|
119
119
|
const allowAddToCartWhenOutStock = (0, import_react.useMemo)(() => {
|
|
120
120
|
var _a2, _b2, _c2;
|
|
121
121
|
return Number(
|
|
122
122
|
((_c2 = (_b2 = (_a2 = bookingState == null ? void 0 : bookingState.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b2.stock_setting) == null ? void 0 : _c2.allow_add_to_cart_when_out_stock) ?? 0
|
|
123
123
|
);
|
|
124
|
-
}, [(
|
|
124
|
+
}, [(_g = (_f = bookingState == null ? void 0 : bookingState.bookingConfig) == null ? void 0 : _f.config) == null ? void 0 : _g.stock_setting]);
|
|
125
125
|
const enableDontShowAgainToday = (0, import_react.useMemo)(() => {
|
|
126
126
|
var _a2, _b2, _c2;
|
|
127
127
|
return Number(
|
|
128
128
|
((_c2 = (_b2 = (_a2 = bookingState == null ? void 0 : bookingState.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b2.stock_setting) == null ? void 0 : _c2.do_not_show_again_today) ?? 0
|
|
129
129
|
);
|
|
130
|
-
}, [(
|
|
130
|
+
}, [(_i = (_h = bookingState == null ? void 0 : bookingState.bookingConfig) == null ? void 0 : _h.config) == null ? void 0 : _i.stock_setting]);
|
|
131
131
|
const hasSkuOptions = (0, import_react.useMemo)(() => {
|
|
132
132
|
const data = productData;
|
|
133
133
|
const hasVariantGroup = Array.isArray(data == null ? void 0 : data.variant_group) && data.variant_group.length > 0;
|
|
@@ -314,7 +314,7 @@ var SkuDetailModal = ({ onConfirm, onRemove, onClose }, ref) => {
|
|
|
314
314
|
const price = ((_a2 = productData == null ? void 0 : productData._extend) == null ? void 0 : _a2.price) || 0;
|
|
315
315
|
const priceSign = Number(price) < 0 ? "-" : "";
|
|
316
316
|
return `${priceSign}${symbol}${Math.abs(Number(price))}`;
|
|
317
|
-
}, [(
|
|
317
|
+
}, [(_j = productData == null ? void 0 : productData._extend) == null ? void 0 : _j.price, symbol]);
|
|
318
318
|
const unitPrice = (0, import_react.useMemo)(() => {
|
|
319
319
|
const activeSkuValue = (skuValue == null ? void 0 : skuValue.product_id) ? skuValue : skuDefaultValue;
|
|
320
320
|
return getSelectedUnitPrice({ productData, skuValue: activeSkuValue });
|
|
@@ -817,7 +817,7 @@ var SkuDetailModal = ({ onConfirm, onRemove, onClose }, ref) => {
|
|
|
817
817
|
onCancel: handleStockAlertCancel
|
|
818
818
|
},
|
|
819
819
|
/* @__PURE__ */ import_react.default.createElement("div", { style: { padding: "40px 0 0 0" } }, /* @__PURE__ */ import_react.default.createElement("div", { style: { color: "#344054", fontSize: 14, lineHeight: "22px" } }, import_utils.locales.getText("pisell2.text.sku.detail.modal.stock.alert.desc")), Number(
|
|
820
|
-
((
|
|
820
|
+
((_m = (_l = (_k = bookingState == null ? void 0 : bookingState.bookingConfig) == null ? void 0 : _k.config) == null ? void 0 : _l.stock_setting) == null ? void 0 : _m.do_not_show_again_today) ?? 0
|
|
821
821
|
) === 1 && /* @__PURE__ */ import_react.default.createElement("div", { style: { marginTop: 16 } }, /* @__PURE__ */ import_react.default.createElement(
|
|
822
822
|
import_materials.Checkbox,
|
|
823
823
|
{
|