@pisell/private-materials 6.12.140 → 6.12.142
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.css +1 -1
- package/build/lowcode/render/default/view.js +4 -4
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +4 -4
- package/es/components/bigSale/components/ProductList/index.js +24 -20
- package/es/plus/pisellSalesProductCard/index.js +3 -3
- package/es/plus/productSelect/ProductCard/ProductCardV2.js +2 -1
- package/es/plus/saasDevice/appDevicePlanning/hooks/useDeviceLinking.js +28 -4
- package/es/plus/saasDevice/appDevicePlanning/modules/devices/components/DeviceTable/index.js +4 -1
- package/es/plus/saasDevice/appDevicePlanning/modules/devices/components/DeviceTable/index.less +23 -3
- package/es/plus/salesSdk/context/SalesSdkCartContext.js +54 -53
- package/es/pro/skuDetailModal/README.md +2 -2
- package/es/pro/skuDetailModal/flow/presets.d.ts +2 -42
- package/lib/components/bigSale/components/ProductList/index.js +24 -20
- package/lib/plus/pisellSalesProductCard/index.js +3 -3
- package/lib/plus/productSelect/ProductCard/ProductCardV2.js +2 -1
- package/lib/plus/saasDevice/appDevicePlanning/hooks/useDeviceLinking.js +28 -4
- package/lib/plus/saasDevice/appDevicePlanning/modules/devices/components/DeviceTable/index.js +4 -1
- package/lib/plus/saasDevice/appDevicePlanning/modules/devices/components/DeviceTable/index.less +23 -3
- package/lib/plus/salesSdk/context/SalesSdkCartContext.js +54 -53
- package/lib/pro/skuDetailModal/README.md +2 -2
- package/lib/pro/skuDetailModal/flow/presets.d.ts +2 -42
- package/package.json +2 -2
|
@@ -2,27 +2,7 @@ import { ResolveSelectionFlowSteps, SelectionFlowStepConfig } from "./types.js";
|
|
|
2
2
|
|
|
3
3
|
//#region src/pro/skuDetailModal/flow/presets.d.ts
|
|
4
4
|
/** 用户端:每项选择能力独立成一步。 */
|
|
5
|
-
declare const customerSteps: readonly [
|
|
6
|
-
readonly key: "date";
|
|
7
|
-
readonly title: "pisell2.text.sku.detail.modal.step.date";
|
|
8
|
-
readonly modules: readonly ["date"];
|
|
9
|
-
}, {
|
|
10
|
-
readonly key: "sku";
|
|
11
|
-
readonly title: "pisell2.text.sku.detail.modal.step.sku";
|
|
12
|
-
readonly modules: readonly ["sku"];
|
|
13
|
-
}, {
|
|
14
|
-
readonly key: "time";
|
|
15
|
-
readonly title: "pisell2.text.sku.detail.modal.step.time";
|
|
16
|
-
readonly modules: readonly ["time"];
|
|
17
|
-
}, {
|
|
18
|
-
readonly key: "resource";
|
|
19
|
-
readonly title: "pisell2.text.sku.detail.modal.step.resource";
|
|
20
|
-
readonly modules: readonly ["resource"];
|
|
21
|
-
}, {
|
|
22
|
-
readonly key: "holder";
|
|
23
|
-
readonly title: "pisell2.text.sku.detail.modal.step.holder";
|
|
24
|
-
readonly modules: readonly ["holder"];
|
|
25
|
-
}];
|
|
5
|
+
declare const customerSteps: readonly SelectionFlowStepConfig[];
|
|
26
6
|
/** POS:先完成日期与 SKU,再合并其余预约模块。 */
|
|
27
7
|
declare const posSteps: readonly SelectionFlowStepConfig<string>[];
|
|
28
8
|
/**
|
|
@@ -31,27 +11,7 @@ declare const posSteps: readonly SelectionFlowStepConfig<string>[];
|
|
|
31
11
|
*/
|
|
32
12
|
declare const resolvePosSelectionFlowSteps: ResolveSelectionFlowSteps;
|
|
33
13
|
declare const selectionFlowPresets: {
|
|
34
|
-
readonly customer: readonly [
|
|
35
|
-
readonly key: "date";
|
|
36
|
-
readonly title: "pisell2.text.sku.detail.modal.step.date";
|
|
37
|
-
readonly modules: readonly ["date"];
|
|
38
|
-
}, {
|
|
39
|
-
readonly key: "sku";
|
|
40
|
-
readonly title: "pisell2.text.sku.detail.modal.step.sku";
|
|
41
|
-
readonly modules: readonly ["sku"];
|
|
42
|
-
}, {
|
|
43
|
-
readonly key: "time";
|
|
44
|
-
readonly title: "pisell2.text.sku.detail.modal.step.time";
|
|
45
|
-
readonly modules: readonly ["time"];
|
|
46
|
-
}, {
|
|
47
|
-
readonly key: "resource";
|
|
48
|
-
readonly title: "pisell2.text.sku.detail.modal.step.resource";
|
|
49
|
-
readonly modules: readonly ["resource"];
|
|
50
|
-
}, {
|
|
51
|
-
readonly key: "holder";
|
|
52
|
-
readonly title: "pisell2.text.sku.detail.modal.step.holder";
|
|
53
|
-
readonly modules: readonly ["holder"];
|
|
54
|
-
}];
|
|
14
|
+
readonly customer: readonly SelectionFlowStepConfig<string>[];
|
|
55
15
|
readonly pos: readonly SelectionFlowStepConfig<string>[];
|
|
56
16
|
};
|
|
57
17
|
type SelectionFlowPresetName = keyof typeof selectionFlowPresets;
|
|
@@ -720,26 +720,30 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
|
|
|
720
720
|
* @example
|
|
721
721
|
* renderListItem(item, 0);
|
|
722
722
|
*/
|
|
723
|
-
const renderListItem = (0, ahooks.useMemoizedFn)((item, index) =>
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
723
|
+
const renderListItem = (0, ahooks.useMemoizedFn)((item, index) => {
|
|
724
|
+
const isBookingProduct = !require_utils.isNormalProductByDurationSchedule(item);
|
|
725
|
+
return usesV2ProductCard ? /* @__PURE__ */ react.default.createElement(require_ProductCardV2.default, {
|
|
726
|
+
key: item.id,
|
|
727
|
+
index,
|
|
728
|
+
item,
|
|
729
|
+
requiresOptions: isBookingProduct,
|
|
730
|
+
hideAction: isBookingProduct,
|
|
731
|
+
value: phoneCartProductValues,
|
|
732
|
+
onChange: handlePhoneProductCardChange,
|
|
733
|
+
decorateConfig: v2ProductCardDecorateConfig
|
|
734
|
+
}) : /* @__PURE__ */ react.default.createElement(require_index.default, {
|
|
735
|
+
key: item.id,
|
|
736
|
+
index,
|
|
737
|
+
item,
|
|
738
|
+
onSelect: () => handleSelectProduct(item),
|
|
739
|
+
onSelectCover: () => handleSelectProduct(item),
|
|
740
|
+
onSelectInfo: () => handleSelectProduct(item),
|
|
741
|
+
isSelected: false,
|
|
742
|
+
selectionTrigger: productSelectionTrigger,
|
|
743
|
+
scenario: "booking2",
|
|
744
|
+
customSkuCardAllConfig: skuCardAllConfig
|
|
745
|
+
});
|
|
746
|
+
});
|
|
743
747
|
const setPersistentSearchScrolling = (0, ahooks.useMemoizedFn)((isScrolling) => {
|
|
744
748
|
var _listWrapperRef$curre;
|
|
745
749
|
if (variant !== "phone" || !persistentSearch) return;
|
|
@@ -52,7 +52,7 @@ function isNormalProduct(product) {
|
|
|
52
52
|
const requiresDetail = isEnabledProductFlag(productAny === null || productAny === void 0 ? void 0 : productAny.isOpenDetailModal) || isEnabledProductFlag(productAny === null || productAny === void 0 ? void 0 : productAny.open_sold_weight) || ["session_product", "session_ticket"].includes(String((productAny === null || productAny === void 0 ? void 0 : productAny.extension_type) || ""));
|
|
53
53
|
return !(hasOption || hasBundle || hasVariant || requiresDetail);
|
|
54
54
|
}
|
|
55
|
-
const PisellSalesProductCard = ({ product, requiresOptions = false, value, selectedQuantity: selectedQuantityProp, disabled = false, stepperProps, optionsText, skuCardConfig, cartElementId, style, className, onChange, onClick }) => {
|
|
55
|
+
const PisellSalesProductCard = ({ product, requiresOptions = false, hideAction = false, value, selectedQuantity: selectedQuantityProp, disabled = false, stepperProps, optionsText, skuCardConfig, cartElementId, style, className, onChange, onClick }) => {
|
|
56
56
|
var _context$appHelper$ut, _product$price, _value$num, _stepperProps$min3, _stepperProps$step;
|
|
57
57
|
const context = require_useEngineContext.default();
|
|
58
58
|
_pisell_utils.locales.init(require_locales.default, ((_context$appHelper$ut = context.appHelper.utils) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut = _context$appHelper$ut.storage) === null || _context$appHelper$ut === void 0 ? void 0 : _context$appHelper$ut.get("umi_locale")) || "en");
|
|
@@ -146,7 +146,7 @@ const PisellSalesProductCard = ({ product, requiresOptions = false, value, selec
|
|
|
146
146
|
}) : /* @__PURE__ */ react.default.createElement("div", { className: `${PREFIX}__image-placeholder` }, textCover)), /* @__PURE__ */ react.default.createElement("div", { className: `${PREFIX}__content` }, /* @__PURE__ */ react.default.createElement("div", { className: `${PREFIX}__title` }, title), /* @__PURE__ */ react.default.createElement(require_index$1.default, {
|
|
147
147
|
value: (_product$price = product.price) !== null && _product$price !== void 0 ? _product$price : 0,
|
|
148
148
|
isMini: !!product.is_bundle
|
|
149
|
-
})), /* @__PURE__ */ react.default.createElement("div", { className: `${PREFIX}__action` }, normalProduct ? /* @__PURE__ */ react.default.createElement("div", {
|
|
149
|
+
})), !hideAction ? /* @__PURE__ */ react.default.createElement("div", { className: `${PREFIX}__action` }, normalProduct ? /* @__PURE__ */ react.default.createElement("div", {
|
|
150
150
|
className: `${PREFIX}__stepper`,
|
|
151
151
|
onClick: (event) => event.stopPropagation(),
|
|
152
152
|
onPointerDown: (event) => event.stopPropagation(),
|
|
@@ -201,7 +201,7 @@ const PisellSalesProductCard = ({ product, requiresOptions = false, value, selec
|
|
|
201
201
|
}, optionsText || _pisell_utils.locales.getText("pisell2.text.options"), selectedQuantity > 0 ? /* @__PURE__ */ react.default.createElement("span", {
|
|
202
202
|
className: `${PREFIX}__options-button-badge`,
|
|
203
203
|
"aria-hidden": "true"
|
|
204
|
-
}, selectedQuantity) : null)))));
|
|
204
|
+
}, selectedQuantity) : null)) : null)));
|
|
205
205
|
};
|
|
206
206
|
//#endregion
|
|
207
207
|
exports.default = PisellSalesProductCard;
|
|
@@ -11,7 +11,7 @@ classnames = require_runtime.__toESM(classnames);
|
|
|
11
11
|
* v2 卡片:复用 ProductCard 的结构能力(分类项 + IntersectionTrigger),
|
|
12
12
|
* 商品项内部渲染 PisellSalesProductCard。
|
|
13
13
|
*/
|
|
14
|
-
const ProductCardV2 = (0, react.memo)(({ item, index, context, className, value, onChange, decorateConfig = {}, cartElementId, requiresOptions = false }) => {
|
|
14
|
+
const ProductCardV2 = (0, react.memo)(({ item, index, context, className, value, onChange, decorateConfig = {}, cartElementId, requiresOptions = false, hideAction = false }) => {
|
|
15
15
|
var _item$product_id, _ref2, _item$product_id2, _item$item_rule_limit, _item$item_rule_limit2, _item$item_rule_limit3, _item$item_rule_limit4, _item$item_rule_limit5, _item$item_rule_limit6;
|
|
16
16
|
const { __typename } = item;
|
|
17
17
|
if (__typename === "category") return /* @__PURE__ */ react.default.createElement("div", {
|
|
@@ -45,6 +45,7 @@ const ProductCardV2 = (0, react.memo)(({ item, index, context, className, value,
|
|
|
45
45
|
}),
|
|
46
46
|
product: item,
|
|
47
47
|
requiresOptions,
|
|
48
|
+
hideAction,
|
|
48
49
|
style: salesCardStyle,
|
|
49
50
|
stepperProps: {
|
|
50
51
|
min: item === null || item === void 0 || (_item$item_rule_limit = item.item_rule_limit) === null || _item$item_rule_limit === void 0 ? void 0 : _item$item_rule_limit.min,
|
|
@@ -39,6 +39,30 @@ const useDeviceLinking = ({ utils, onLinked, reloadDevices, setStoredIotDevice,
|
|
|
39
39
|
metadata: { error }
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
+
try {
|
|
43
|
+
var _app$plugins3, _app$plugins4, _app$plugins5;
|
|
44
|
+
yield app === null || app === void 0 || (_app$plugins3 = app.plugins) === null || _app$plugins3 === void 0 || (_app$plugins3 = _app$plugins3.get("mqtt")) === null || _app$plugins3 === void 0 ? void 0 : _app$plugins3.stopHeartbeat();
|
|
45
|
+
yield app === null || app === void 0 || (_app$plugins4 = app.plugins) === null || _app$plugins4 === void 0 || (_app$plugins4 = _app$plugins4.get("mqtt")) === null || _app$plugins4 === void 0 ? void 0 : _app$plugins4.disconnect();
|
|
46
|
+
yield app === null || app === void 0 || (_app$plugins5 = app.plugins) === null || _app$plugins5 === void 0 || (_app$plugins5 = _app$plugins5.get("mqtt")) === null || _app$plugins5 === void 0 ? void 0 : _app$plugins5.clearCredentials();
|
|
47
|
+
} catch (error) {
|
|
48
|
+
var _app$logger2;
|
|
49
|
+
app === null || app === void 0 || (_app$logger2 = app.logger) === null || _app$logger2 === void 0 || _app$logger2.addLog({
|
|
50
|
+
type: "error",
|
|
51
|
+
title: "销毁老的mqtt失败",
|
|
52
|
+
metadata: { error }
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
var _app$plugins6, _app$plugins6$saveCre;
|
|
57
|
+
yield app === null || app === void 0 || (_app$plugins6 = app.plugins) === null || _app$plugins6 === void 0 || (_app$plugins6 = _app$plugins6.get("mqtt")) === null || _app$plugins6 === void 0 || (_app$plugins6$saveCre = _app$plugins6.saveCredentials) === null || _app$plugins6$saveCre === void 0 ? void 0 : _app$plugins6$saveCre.call(_app$plugins6, linkedDevice);
|
|
58
|
+
} catch (error) {
|
|
59
|
+
var _app$logger3;
|
|
60
|
+
app === null || app === void 0 || (_app$logger3 = app.logger) === null || _app$logger3 === void 0 || _app$logger3.addLog({
|
|
61
|
+
type: "error",
|
|
62
|
+
title: "将凭证信息存入 mqtt 失败",
|
|
63
|
+
metadata: { error }
|
|
64
|
+
});
|
|
65
|
+
}
|
|
42
66
|
setStoredIotDevice({
|
|
43
67
|
id: typeof (linkedDevice === null || linkedDevice === void 0 ? void 0 : linkedDevice.id) === "number" ? linkedDevice.id : void 0,
|
|
44
68
|
number: (linkedDevice === null || linkedDevice === void 0 ? void 0 : linkedDevice.number) ? String(linkedDevice.number) : ""
|
|
@@ -57,14 +81,14 @@ const useDeviceLinking = ({ utils, onLinked, reloadDevices, setStoredIotDevice,
|
|
|
57
81
|
var _localStorage, _localStorage$setItem;
|
|
58
82
|
(_localStorage = localStorage) === null || _localStorage === void 0 || (_localStorage$setItem = _localStorage.setItem) === null || _localStorage$setItem === void 0 || _localStorage$setItem.call(_localStorage, "pisell_app_channel", channel);
|
|
59
83
|
try {
|
|
60
|
-
var _app$
|
|
61
|
-
yield app === null || app === void 0 || (_app$
|
|
84
|
+
var _app$plugins7, _app$plugins7$set;
|
|
85
|
+
yield app === null || app === void 0 || (_app$plugins7 = app.plugins) === null || _app$plugins7 === void 0 || (_app$plugins7 = _app$plugins7.get("nativeStorage")) === null || _app$plugins7 === void 0 || (_app$plugins7$set = _app$plugins7.set) === null || _app$plugins7$set === void 0 ? void 0 : _app$plugins7$set.call(_app$plugins7, {
|
|
62
86
|
key: "pisell_app_channel",
|
|
63
87
|
value: channel
|
|
64
88
|
});
|
|
65
89
|
} catch (error) {
|
|
66
|
-
var _app$
|
|
67
|
-
app === null || app === void 0 || (_app$
|
|
90
|
+
var _app$logger4;
|
|
91
|
+
app === null || app === void 0 || (_app$logger4 = app.logger) === null || _app$logger4 === void 0 || _app$logger4.addLog({
|
|
68
92
|
type: "error",
|
|
69
93
|
title: "将渠道信息存入 nativeStorage 失败",
|
|
70
94
|
metadata: { error }
|
package/lib/plus/saasDevice/appDevicePlanning/modules/devices/components/DeviceTable/index.js
CHANGED
|
@@ -22,9 +22,12 @@ const DeviceTable = ({ data, loading, search, page, pageSize, linkingDeviceId, g
|
|
|
22
22
|
const isLinking = linkingDeviceId === record.id;
|
|
23
23
|
const isDisabled = Boolean(linkingDeviceId);
|
|
24
24
|
if (record.isCurrent) return /* @__PURE__ */ react.default.createElement(_pisell_materials.Button, {
|
|
25
|
+
type: "primary",
|
|
25
26
|
className: "saas-app-device-planning-device-table__current-button",
|
|
26
27
|
icon: /* @__PURE__ */ react.default.createElement(_ant_design_icons.CheckOutlined, null),
|
|
27
|
-
|
|
28
|
+
loading: isLinking,
|
|
29
|
+
disabled: isDisabled,
|
|
30
|
+
onClick: () => onLink(record)
|
|
28
31
|
}, getText("pisell2.saas.device-planning.action.current-device"));
|
|
29
32
|
if (record.isLastUsed) return /* @__PURE__ */ react.default.createElement(_pisell_materials.Button, {
|
|
30
33
|
type: "primary",
|
package/lib/plus/saasDevice/appDevicePlanning/modules/devices/components/DeviceTable/index.less
CHANGED
|
@@ -140,9 +140,29 @@
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
&__current-button {
|
|
143
|
-
color:
|
|
144
|
-
background: #
|
|
145
|
-
border-color: #
|
|
143
|
+
color: #fff !important;
|
|
144
|
+
background: #16a34a !important;
|
|
145
|
+
border-color: #16a34a !important;
|
|
146
|
+
|
|
147
|
+
&:not(:disabled):hover,
|
|
148
|
+
&:not(:disabled):focus {
|
|
149
|
+
color: #fff;
|
|
150
|
+
background: #15803d;
|
|
151
|
+
border-color: #15803d;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
&:not(:disabled):active {
|
|
155
|
+
color: #fff;
|
|
156
|
+
background: #166534;
|
|
157
|
+
border-color: #166534;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
&:disabled {
|
|
161
|
+
color: rgba(0, 0, 0, 0.25);
|
|
162
|
+
background: #f0f0f0;
|
|
163
|
+
border-color: #d9d9d9;
|
|
164
|
+
box-shadow: none;
|
|
165
|
+
}
|
|
146
166
|
}
|
|
147
167
|
|
|
148
168
|
&__empty {
|