@pisell/private-materials 6.8.91 → 6.8.92
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/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/booking/components/footer/index.d.ts +1 -0
- package/es/components/booking/components/footer/utils.js +2 -1
- package/es/components/checkout/PaymentModal.js +4 -2
- package/es/components/list/List.js +4 -19
- package/es/components/list/hooks/useListState.d.ts +1 -2
- package/es/components/list/hooks/useListState.js +2 -7
- package/es/components/list/types.d.ts +0 -1
- package/es/components/shoppingCart/components/Cart/Product.d.ts +1 -0
- package/es/components/ticketBooking/components/ProductDisplayAdapter/ProductDisplayAdapter.js +1 -6
- package/es/components/ticketBooking/components/ProductDisplayAdapter/types.js +2 -11
- package/es/components/ticketBooking/components/ProductDisplayAdapter/utils.d.ts +1 -1
- package/es/components/ticketBooking/components/ProductDisplayAdapter/utils.js +1 -62
- package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +1 -0
- package/es/components/ticketBooking/components/ticketBooking/index.js +4 -2
- package/es/components/ticketBooking/context/OsKeyContext.d.ts +3 -0
- package/es/components/ticketBooking/context/OsKeyContext.js +12 -2
- package/es/components/ticketBooking/context/index.d.ts +1 -1
- package/es/components/ticketBooking/context/index.js +1 -1
- package/es/components/ticketBooking/index.d.ts +1 -0
- package/es/components/ticketBooking/index.js +2 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.d.ts +1 -0
- package/es/plus/skuOptionsSelection/components/OptionsCard/OptionItemCard.d.ts +1 -0
- package/es/plus/skuOptionsSelection/components/OptionsModal/index.d.ts +1 -0
- package/es/pro/priceKeyboard/components/paymentKeyboard/index.d.ts +1 -0
- package/es/pro/skuDetailModal/index.js +8 -3
- package/es/pro/skuDetailModal/index.less +15 -0
- package/lib/components/booking/components/footer/index.d.ts +1 -0
- package/lib/components/booking/components/footer/utils.js +2 -1
- package/lib/components/checkout/PaymentModal.js +3 -1
- package/lib/components/list/List.js +3 -15
- package/lib/components/list/hooks/useListState.d.ts +1 -2
- package/lib/components/list/hooks/useListState.js +2 -7
- package/lib/components/list/types.d.ts +0 -1
- package/lib/components/shoppingCart/components/Cart/Product.d.ts +1 -0
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/ProductDisplayAdapter.js +1 -4
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/types.js +2 -11
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/utils.d.ts +1 -1
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/utils.js +2 -46
- package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +1 -0
- package/lib/components/ticketBooking/components/ticketBooking/index.js +3 -1
- package/lib/components/ticketBooking/context/OsKeyContext.d.ts +3 -0
- package/lib/components/ticketBooking/context/OsKeyContext.js +13 -3
- package/lib/components/ticketBooking/context/index.d.ts +1 -1
- package/lib/components/ticketBooking/context/index.js +2 -0
- package/lib/components/ticketBooking/index.d.ts +1 -0
- package/lib/components/ticketBooking/index.js +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.d.ts +1 -0
- package/lib/plus/skuOptionsSelection/components/OptionsCard/OptionItemCard.d.ts +1 -0
- package/lib/plus/skuOptionsSelection/components/OptionsModal/index.d.ts +1 -0
- package/lib/pro/priceKeyboard/components/paymentKeyboard/index.d.ts +1 -0
- package/lib/pro/skuDetailModal/index.js +2 -2
- package/lib/pro/skuDetailModal/index.less +15 -0
- package/package.json +1 -1
|
@@ -897,7 +897,8 @@ export var formatValues = function formatValues(state) {
|
|
|
897
897
|
customer_name: '',
|
|
898
898
|
holder: {},
|
|
899
899
|
relation_products: [],
|
|
900
|
-
metadata: {}
|
|
900
|
+
metadata: {},
|
|
901
|
+
business_code: (state === null || state === void 0 ? void 0 : state.businessCode) || undefined
|
|
901
902
|
};
|
|
902
903
|
|
|
903
904
|
// 是是跨日预约模版
|
|
@@ -32,7 +32,7 @@ import WalletPassModule from "./components/WalletPassModule";
|
|
|
32
32
|
import PaymentOptionsModule, { SHOW_METHODS_CODE } from "./components/PaymentOptionsModule";
|
|
33
33
|
import CashPaymentModule from "./components/CashPaymentModule";
|
|
34
34
|
import AdditionalModule from "./components/AdditionalModule";
|
|
35
|
-
import { useOsKey } from "../ticketBooking/context/OsKeyContext";
|
|
35
|
+
import { useBusinessCode, useOsKey } from "../ticketBooking/context/OsKeyContext";
|
|
36
36
|
import { closePaymentResultToast, closeAllPaymentResultToasts, setTillButton } from "./components/PaymentResultToast";
|
|
37
37
|
import { formatCurrency, calculateStatusClassName, calculateAutoCloseConfig, displayPaymentResultToast, createShowSuccessToast } from "./utils/PaymentResultToastUtils";
|
|
38
38
|
import { Printer, FileCheck02, RefreshCw05, CreditCard02, MessageTextSquare02, ArrowLeft, DotsVertical } from '@pisell/icon';
|
|
@@ -1527,6 +1527,7 @@ var PaymentModal = function PaymentModal(_ref19) {
|
|
|
1527
1527
|
var Toast = useToast();
|
|
1528
1528
|
var _usePrinter2 = usePrinter(),
|
|
1529
1529
|
nativePrint = _usePrinter2.nativePrint;
|
|
1530
|
+
var businessCode = useBusinessCode();
|
|
1530
1531
|
|
|
1531
1532
|
// 重试处理函数(逻辑由用户自己实现)
|
|
1532
1533
|
var handleRetry = /*#__PURE__*/function () {
|
|
@@ -2157,7 +2158,8 @@ var PaymentModal = function PaymentModal(_ref19) {
|
|
|
2157
2158
|
currency_code: getData('shop_currency_code'),
|
|
2158
2159
|
currency_symbol: getData('shop_symbol'),
|
|
2159
2160
|
order_rounding_setting: getData('order_rounding_setting'),
|
|
2160
|
-
shop_wallet_pass_id: shop_wallet_pass_id
|
|
2161
|
+
shop_wallet_pass_id: shop_wallet_pass_id,
|
|
2162
|
+
business_code: businessCode
|
|
2161
2163
|
});
|
|
2162
2164
|
newData = cloneDeep(data);
|
|
2163
2165
|
existPayment = newData.existPayment; // setTotalAmount(newData.total.expectAmount);
|
|
@@ -21,7 +21,7 @@ import WaterfallList from "./components/WaterfallList";
|
|
|
21
21
|
import ListItemSkeleton from "./components/ListItemSkeleton";
|
|
22
22
|
import TabSkeleton from "./components/TabSkeleton";
|
|
23
23
|
import "./List.less";
|
|
24
|
-
import { Iconfont, PisellTabbar
|
|
24
|
+
import { Iconfont, PisellTabbar } from '@pisell/materials';
|
|
25
25
|
// import { locales } from '@pisell/utils';
|
|
26
26
|
import listLocales from "./locales";
|
|
27
27
|
import useWaterfall from "./hooks/useWaterfall";
|
|
@@ -137,9 +137,7 @@ var List = function List(props) {
|
|
|
137
137
|
pagination = props.pagination,
|
|
138
138
|
_props$loading = props.loading,
|
|
139
139
|
loading = _props$loading === void 0 ? false : _props$loading,
|
|
140
|
-
renderSearch = props.renderSearch
|
|
141
|
-
_props$isTreeTab = props.isTreeTab,
|
|
142
|
-
isTreeTab = _props$isTreeTab === void 0 ? true : _props$isTreeTab;
|
|
140
|
+
renderSearch = props.renderSearch;
|
|
143
141
|
console.log('List props', props);
|
|
144
142
|
var tabItems = tabStyle === 'none' ? [] : tabData || [];
|
|
145
143
|
|
|
@@ -149,8 +147,7 @@ var List = function List(props) {
|
|
|
149
147
|
tabItems: tabItems,
|
|
150
148
|
defaultPageSize: defaultPageSize,
|
|
151
149
|
tabStyle: tabStyle,
|
|
152
|
-
onLoadData: onLoadData
|
|
153
|
-
isTreeTab: isTreeTab
|
|
150
|
+
onLoadData: onLoadData
|
|
154
151
|
}),
|
|
155
152
|
listState = _useListState.state,
|
|
156
153
|
currentPage = _useListState.actualCurrentPage,
|
|
@@ -285,14 +282,6 @@ var List = function List(props) {
|
|
|
285
282
|
}
|
|
286
283
|
if (Array.isArray(activeTab)) {
|
|
287
284
|
var productIds = findProductIdsByPath(tabItems, activeTab, 0);
|
|
288
|
-
// 如果选择了"全部",不进行过滤
|
|
289
|
-
if (activeTab.toString() === '0') {
|
|
290
|
-
return [{
|
|
291
|
-
tabKey: activeTab,
|
|
292
|
-
tabLabel: '',
|
|
293
|
-
items: sourceData
|
|
294
|
-
}];
|
|
295
|
-
}
|
|
296
285
|
var items = productIds.map(function (id) {
|
|
297
286
|
return dataIdMap[id];
|
|
298
287
|
});
|
|
@@ -731,7 +720,7 @@ var List = function List(props) {
|
|
|
731
720
|
}), /*#__PURE__*/React.createElement("div", {
|
|
732
721
|
ref: headerRef,
|
|
733
722
|
className: headerClasses
|
|
734
|
-
},
|
|
723
|
+
}, /*#__PURE__*/React.createElement(PisellTabbar, {
|
|
735
724
|
levelConfig: {
|
|
736
725
|
level1: {
|
|
737
726
|
positionId: "#level1-wrap"
|
|
@@ -746,10 +735,6 @@ var List = function List(props) {
|
|
|
746
735
|
dataSource: tabItems,
|
|
747
736
|
value: activeTab,
|
|
748
737
|
onChange: handleTabChangeWithScroll
|
|
749
|
-
}) : /*#__PURE__*/React.createElement(PisellTabbarTemplate1, {
|
|
750
|
-
dataSource: tabItems,
|
|
751
|
-
value: activeTab,
|
|
752
|
-
onChange: handleTabChangeWithScroll
|
|
753
738
|
})));
|
|
754
739
|
};
|
|
755
740
|
|
|
@@ -27,7 +27,6 @@ export interface UseListStateProps {
|
|
|
27
27
|
onLoadData?: (params: LoadDataParams) => void;
|
|
28
28
|
/** tab样式 */
|
|
29
29
|
tabStyle: 'anchor' | 'switch' | 'none';
|
|
30
|
-
isTreeTab: boolean;
|
|
31
30
|
}
|
|
32
31
|
export interface UseListStateReturn {
|
|
33
32
|
state: ListState;
|
|
@@ -43,4 +42,4 @@ export interface UseListStateReturn {
|
|
|
43
42
|
handleScrollLoad: () => void;
|
|
44
43
|
actualCurrentPage: number;
|
|
45
44
|
}
|
|
46
|
-
export declare const useListState: ({ externalCurrentPage, tabItems, defaultPageSize, onLoadData, tabStyle,
|
|
45
|
+
export declare const useListState: ({ externalCurrentPage, tabItems, defaultPageSize, onLoadData, tabStyle, }: UseListStateProps) => UseListStateReturn;
|
|
@@ -49,8 +49,7 @@ export var useListState = function useListState(_ref) {
|
|
|
49
49
|
tabItems = _ref.tabItems,
|
|
50
50
|
defaultPageSize = _ref.defaultPageSize,
|
|
51
51
|
onLoadData = _ref.onLoadData,
|
|
52
|
-
tabStyle = _ref.tabStyle
|
|
53
|
-
isTreeTab = _ref.isTreeTab;
|
|
52
|
+
tabStyle = _ref.tabStyle;
|
|
54
53
|
// 初始状态
|
|
55
54
|
var initialState = {
|
|
56
55
|
activeTab: tabItems.length > 0 ? tabItems[0].key : 'all',
|
|
@@ -62,10 +61,6 @@ export var useListState = function useListState(_ref) {
|
|
|
62
61
|
state = _useReducer2[0],
|
|
63
62
|
dispatch = _useReducer2[1];
|
|
64
63
|
useEffect(function () {
|
|
65
|
-
if (!isTreeTab) {
|
|
66
|
-
setActiveTab(['0']);
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
64
|
if (tabStyle === 'switch' && tabItems.length > 0) {
|
|
70
65
|
var _tabItems$;
|
|
71
66
|
var defaultTab = [tabItems[0].key];
|
|
@@ -76,7 +71,7 @@ export var useListState = function useListState(_ref) {
|
|
|
76
71
|
// const defaultTab = PisellTabbar.getDefaultActiveKey(tabItems, 'id');
|
|
77
72
|
setActiveTab(defaultTab);
|
|
78
73
|
}
|
|
79
|
-
}, [tabItems
|
|
74
|
+
}, [tabItems]);
|
|
80
75
|
|
|
81
76
|
// 计算实际使用的当前页码
|
|
82
77
|
var actualCurrentPage = externalCurrentPage || state.currentPage;
|
|
@@ -119,7 +119,6 @@ export interface ListProps<TItem extends BaseListItem = BaseListItem> {
|
|
|
119
119
|
tabGroup?: TabConfig['tabGroup'];
|
|
120
120
|
tabData?: TabConfig['tabData'];
|
|
121
121
|
stickyTop?: TabConfig['stickyTop'];
|
|
122
|
-
isTreeTab?: boolean;
|
|
123
122
|
/** 分页配置 */
|
|
124
123
|
paginationType?: PaginationConfig['paginationType'];
|
|
125
124
|
defaultPageSize?: PaginationConfig['defaultPageSize'];
|
package/es/components/ticketBooking/components/ProductDisplayAdapter/ProductDisplayAdapter.js
CHANGED
|
@@ -103,19 +103,16 @@ var ProductDisplayAdapter = function ProductDisplayAdapter(props) {
|
|
|
103
103
|
}));
|
|
104
104
|
}, [keyword]);
|
|
105
105
|
var tabData = useMemo(function () {
|
|
106
|
-
var _listConfig$isTreeTab;
|
|
107
106
|
var _ref2 = config.skuListConfig || {},
|
|
108
107
|
_ref2$listConfig = _ref2.listConfig,
|
|
109
108
|
listConfig = _ref2$listConfig === void 0 ? {} : _ref2$listConfig;
|
|
110
109
|
var enableTab = listConfig.showTab || false;
|
|
111
110
|
var tabStyle = listConfig.tabStyle || 'switch';
|
|
112
|
-
|
|
113
|
-
return enableTab ? generateProductTabs(_filteredList, tabStyle, isTreeTab) : undefined;
|
|
111
|
+
return enableTab ? generateProductTabs(_filteredList, tabStyle) : undefined;
|
|
114
112
|
}, [_filteredList]);
|
|
115
113
|
|
|
116
114
|
// 渲染 SkuList 模式
|
|
117
115
|
var renderSkuList = useMemo(function () {
|
|
118
|
-
var _listConfig$isTreeTab2;
|
|
119
116
|
var _ref3 = config.skuListConfig || {},
|
|
120
117
|
_ref3$listConfig = _ref3.listConfig,
|
|
121
118
|
listConfig = _ref3$listConfig === void 0 ? {} : _ref3$listConfig,
|
|
@@ -128,7 +125,6 @@ var ProductDisplayAdapter = function ProductDisplayAdapter(props) {
|
|
|
128
125
|
var paginationType = listConfig.showPagination ? 'pager' : 'all';
|
|
129
126
|
var enableTab = listConfig.showTab || false;
|
|
130
127
|
var tabStyle = listConfig.tabStyle || 'switch';
|
|
131
|
-
var isTreeTab = (_listConfig$isTreeTab2 = listConfig.isTreeTab) !== null && _listConfig$isTreeTab2 !== void 0 ? _listConfig$isTreeTab2 : true;
|
|
132
128
|
var stickyTop = listConfig.stickyTop !== undefined ? listConfig.stickyTop : true;
|
|
133
129
|
var filteredData = _filteredList.map(function (item) {
|
|
134
130
|
var _item$category, _item$category$map;
|
|
@@ -161,7 +157,6 @@ var ProductDisplayAdapter = function ProductDisplayAdapter(props) {
|
|
|
161
157
|
// Tab 配置
|
|
162
158
|
,
|
|
163
159
|
tabStyle: enableTab ? tabStyle : 'none',
|
|
164
|
-
isTreeTab: isTreeTab,
|
|
165
160
|
tabData: tabData,
|
|
166
161
|
tabGroup: "category",
|
|
167
162
|
stickyTop: stickyTop
|
|
@@ -108,17 +108,9 @@ export var ProductDisplayPresets = {
|
|
|
108
108
|
listConfig: {
|
|
109
109
|
layout: 'grid',
|
|
110
110
|
showPagination: false,
|
|
111
|
-
showTab:
|
|
112
|
-
tabStyle: 'switch',
|
|
113
|
-
isTreeTab: false
|
|
111
|
+
showTab: false
|
|
114
112
|
},
|
|
115
113
|
skuCardAllConfig: {
|
|
116
|
-
skuActionConfig: {
|
|
117
|
-
isOpen: false
|
|
118
|
-
},
|
|
119
|
-
skuExtraConfig: {
|
|
120
|
-
isFavorite: false
|
|
121
|
-
},
|
|
122
114
|
skuCardConfig: {
|
|
123
115
|
displayMode: 'display_a2',
|
|
124
116
|
layoutDirection: 'row',
|
|
@@ -177,8 +169,7 @@ export var ProductDisplayPresets = {
|
|
|
177
169
|
stickyTop: true,
|
|
178
170
|
// Tab 吸顶
|
|
179
171
|
columns: 4,
|
|
180
|
-
tabGroup: 'category'
|
|
181
|
-
isTreeTab: true
|
|
172
|
+
tabGroup: 'category'
|
|
182
173
|
},
|
|
183
174
|
skuCardAllConfig: {
|
|
184
175
|
skuCardConfig: {
|
|
@@ -80,5 +80,5 @@ export interface CategoryTreeNode {
|
|
|
80
80
|
* @param tabStyle tab 样式类型
|
|
81
81
|
* @returns Switch 模式返回 CategoryTreeNode[],Anchor 模式返回 TabItem[]
|
|
82
82
|
*/
|
|
83
|
-
export declare const generateProductTabs: (products: Product[], tabStyle?: 'switch' | 'anchor'
|
|
83
|
+
export declare const generateProductTabs: (products: Product[], tabStyle?: 'switch' | 'anchor') => CategoryTreeNode[] | TabItem[];
|
|
84
84
|
export {};
|
|
@@ -42,66 +42,6 @@ export var formatSkuDataSource = function formatSkuDataSource(dataSource) {
|
|
|
42
42
|
* 分类树节点接口(Switch 模式返回值)
|
|
43
43
|
*/
|
|
44
44
|
|
|
45
|
-
/**
|
|
46
|
-
* 生成简单的 Tab 列表(非树形结构)
|
|
47
|
-
* 遍历商品直接关联的分类,扁平化输出为 CategoryTreeNode[]
|
|
48
|
-
*
|
|
49
|
-
* @param products 产品列表
|
|
50
|
-
* @returns CategoryTreeNode[] 扁平化的分类列表,children 为空数组
|
|
51
|
-
*/
|
|
52
|
-
var generateSimpleTabItems = function generateSimpleTabItems(products) {
|
|
53
|
-
// 收集所有分类及其对应的商品 ID
|
|
54
|
-
var categoryMap = new Map();
|
|
55
|
-
var categoryProductMap = new Map();
|
|
56
|
-
products.forEach(function (product) {
|
|
57
|
-
if (product.category && Array.isArray(product.category)) {
|
|
58
|
-
product.category.forEach(function (cat) {
|
|
59
|
-
// 收集分类信息
|
|
60
|
-
if (!categoryMap.has(cat.id)) {
|
|
61
|
-
categoryMap.set(cat.id, {
|
|
62
|
-
id: cat.id,
|
|
63
|
-
name: cat.name,
|
|
64
|
-
icon: cat.icon,
|
|
65
|
-
slug: cat.slug,
|
|
66
|
-
sort: cat.sort
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// 收集分类对应的商品 ID
|
|
71
|
-
if (!categoryProductMap.has(cat.id)) {
|
|
72
|
-
categoryProductMap.set(cat.id, new Set());
|
|
73
|
-
}
|
|
74
|
-
categoryProductMap.get(cat.id).add(product.id);
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
// 构建 CategoryTreeNode 列表
|
|
80
|
-
var result = [];
|
|
81
|
-
categoryMap.forEach(function (category, id) {
|
|
82
|
-
var productIds = Array.from(categoryProductMap.get(id) || []);
|
|
83
|
-
result.push({
|
|
84
|
-
id: id,
|
|
85
|
-
key: id,
|
|
86
|
-
group: id,
|
|
87
|
-
label: category.name,
|
|
88
|
-
name: category.name,
|
|
89
|
-
icon: category.icon,
|
|
90
|
-
productIds: productIds,
|
|
91
|
-
children: [],
|
|
92
|
-
childrenMaxLevel: 0
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
// 按 sort 字段排序(降序)
|
|
97
|
-
result.sort(function (a, b) {
|
|
98
|
-
var catA = categoryMap.get(a.id);
|
|
99
|
-
var catB = categoryMap.get(b.id);
|
|
100
|
-
return ((catB === null || catB === void 0 ? void 0 : catB.sort) || 0) - ((catA === null || catA === void 0 ? void 0 : catA.sort) || 0);
|
|
101
|
-
});
|
|
102
|
-
return result;
|
|
103
|
-
};
|
|
104
|
-
|
|
105
45
|
/**
|
|
106
46
|
* 根据产品数据生成分类 Tabs(Switch 模式)
|
|
107
47
|
* 参考 TestResponsiveWrapper 的 generateSimpleTabItems 函数
|
|
@@ -112,7 +52,6 @@ var generateSimpleTabItems = function generateSimpleTabItems(products) {
|
|
|
112
52
|
*/
|
|
113
53
|
export var generateProductTabs = function generateProductTabs(products) {
|
|
114
54
|
var tabStyle = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'switch';
|
|
115
|
-
var isTreeTab = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
116
55
|
if (!products || products.length === 0) {
|
|
117
56
|
if (tabStyle === 'switch') {
|
|
118
57
|
return [];
|
|
@@ -124,7 +63,7 @@ export var generateProductTabs = function generateProductTabs(products) {
|
|
|
124
63
|
}
|
|
125
64
|
if (tabStyle === 'switch') {
|
|
126
65
|
// 切换模式:构建多级分类树形结构
|
|
127
|
-
return
|
|
66
|
+
return buildCategoryTree(products);
|
|
128
67
|
} else {
|
|
129
68
|
// 锚点模式:基于实际数据统计数量
|
|
130
69
|
var categoryCount = products.reduce(function (acc, product) {
|
|
@@ -49,7 +49,7 @@ import { useCustomer } from "../../hooks/pisellos";
|
|
|
49
49
|
import { useMemoizedFn } from 'ahooks';
|
|
50
50
|
import useScanManager from "../../hooks/pisellos/useScanManager";
|
|
51
51
|
import { useDebounceFn } from 'ahooks';
|
|
52
|
-
import { useOsKey } from "../../context";
|
|
52
|
+
import { useBusinessCode, useOsKey } from "../../context";
|
|
53
53
|
import { useIsActive } from "../../context/IsActiveContext";
|
|
54
54
|
import { useShopDiscountModule } from "../../hooks/pisellos/useShopDiscountModule";
|
|
55
55
|
import { isWalkIn } from "../../../booking/utils";
|
|
@@ -324,6 +324,7 @@ var TicketBooking = function TicketBooking(props) {
|
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
326
|
});
|
|
327
|
+
var businessCode = useBusinessCode();
|
|
327
328
|
useEffect(function () {
|
|
328
329
|
if (isActive) {
|
|
329
330
|
openScan(function (data) {
|
|
@@ -1339,7 +1340,8 @@ var TicketBooking = function TicketBooking(props) {
|
|
|
1339
1340
|
onQrCodeClick: function onQrCodeClick() {
|
|
1340
1341
|
console.log('onQrCodeClick');
|
|
1341
1342
|
bookingTicket === null || bookingTicket === void 0 || bookingTicket.activateCamera();
|
|
1342
|
-
}
|
|
1343
|
+
},
|
|
1344
|
+
businessCode: businessCode
|
|
1343
1345
|
});
|
|
1344
1346
|
}, [state.modalState, state.amountSymbol, state.bookingConfig, state.bookingDetail, state.bookingId, apis, state.open, state.bookingStatus, state.addTimeProducts, state.isParallelResourcesBooking, engineProps.locale]);
|
|
1345
1347
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
@@ -7,10 +7,12 @@ import React from 'react';
|
|
|
7
7
|
interface OsKeyContextType {
|
|
8
8
|
/** pisellos 模块的唯一标识 */
|
|
9
9
|
osKey: string | undefined;
|
|
10
|
+
businessCode: string | undefined;
|
|
10
11
|
}
|
|
11
12
|
declare const OsKeyContext: React.Context<OsKeyContextType>;
|
|
12
13
|
interface OsKeyProviderProps {
|
|
13
14
|
osKey: string | undefined;
|
|
15
|
+
businessCode: string | undefined;
|
|
14
16
|
children: React.ReactNode;
|
|
15
17
|
}
|
|
16
18
|
/**
|
|
@@ -23,4 +25,5 @@ export declare const OsKeyProvider: React.FC<OsKeyProviderProps>;
|
|
|
23
25
|
* 在子组件中使用此 hook 获取 osKey
|
|
24
26
|
*/
|
|
25
27
|
export declare const useOsKey: () => string;
|
|
28
|
+
export declare const useBusinessCode: () => string;
|
|
26
29
|
export default OsKeyContext;
|
|
@@ -7,7 +7,8 @@ import React, { createContext, useContext } from 'react';
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
var OsKeyContext = /*#__PURE__*/createContext({
|
|
10
|
-
osKey: undefined
|
|
10
|
+
osKey: undefined,
|
|
11
|
+
businessCode: undefined
|
|
11
12
|
});
|
|
12
13
|
/**
|
|
13
14
|
* OsKey Provider
|
|
@@ -15,10 +16,12 @@ var OsKeyContext = /*#__PURE__*/createContext({
|
|
|
15
16
|
*/
|
|
16
17
|
export var OsKeyProvider = function OsKeyProvider(_ref) {
|
|
17
18
|
var osKey = _ref.osKey,
|
|
19
|
+
businessCode = _ref.businessCode,
|
|
18
20
|
children = _ref.children;
|
|
19
21
|
return /*#__PURE__*/React.createElement(OsKeyContext.Provider, {
|
|
20
22
|
value: {
|
|
21
|
-
osKey: osKey
|
|
23
|
+
osKey: osKey,
|
|
24
|
+
businessCode: businessCode
|
|
22
25
|
}
|
|
23
26
|
}, children);
|
|
24
27
|
};
|
|
@@ -34,4 +37,11 @@ export var useOsKey = function useOsKey() {
|
|
|
34
37
|
}
|
|
35
38
|
return (context === null || context === void 0 ? void 0 : context.osKey) || "ticket";
|
|
36
39
|
};
|
|
40
|
+
export var useBusinessCode = function useBusinessCode() {
|
|
41
|
+
var context = useContext(OsKeyContext);
|
|
42
|
+
if (!context) {
|
|
43
|
+
throw new Error('useBusinessCode must be used within an OsKeyProvider');
|
|
44
|
+
}
|
|
45
|
+
return (context === null || context === void 0 ? void 0 : context.businessCode) || "";
|
|
46
|
+
};
|
|
37
47
|
export default OsKeyContext;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { OsKeyProvider, useOsKey } from './OsKeyContext';
|
|
1
|
+
export { OsKeyProvider, useOsKey, useBusinessCode } from './OsKeyContext';
|
|
2
2
|
export { default as OsKeyContext } from './OsKeyContext';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { OsKeyProvider, useOsKey } from "./OsKeyContext";
|
|
1
|
+
export { OsKeyProvider, useOsKey, useBusinessCode } from "./OsKeyContext";
|
|
2
2
|
export { default as OsKeyContext } from "./OsKeyContext";
|
|
@@ -10,6 +10,7 @@ interface TicketBookingProps {
|
|
|
10
10
|
productDisplayConfig?: ProductDisplayPresetKey | ProductDisplayConfig;
|
|
11
11
|
isActive?: boolean;
|
|
12
12
|
rulesHooks?: any;
|
|
13
|
+
businessCode?: string;
|
|
13
14
|
}
|
|
14
15
|
declare const _default: (props: TicketBookingProps) => JSX.Element;
|
|
15
16
|
export default _default;
|
|
@@ -241,7 +241,8 @@ export default (function (props) {
|
|
|
241
241
|
}), /*#__PURE__*/React.createElement(IsActiveProvider, {
|
|
242
242
|
isActive: isActive
|
|
243
243
|
}, /*#__PURE__*/React.createElement(OsKeyProvider, {
|
|
244
|
-
osKey: osKey
|
|
244
|
+
osKey: osKey,
|
|
245
|
+
businessCode: props === null || props === void 0 ? void 0 : props.businessCode
|
|
245
246
|
}, /*#__PURE__*/React.createElement(Provider, {
|
|
246
247
|
store: storeRef.current,
|
|
247
248
|
key: activeNavKey
|
|
@@ -760,8 +760,6 @@ var SkuDetailModal = function SkuDetailModal(_ref, ref) {
|
|
|
760
760
|
}, currentStep === 0 && /*#__PURE__*/React.createElement("div", {
|
|
761
761
|
className: "sku-detail-right-content-detail"
|
|
762
762
|
}, /*#__PURE__*/React.createElement("div", {
|
|
763
|
-
className: "sku-detail-right-content-detail-title"
|
|
764
|
-
}, (productData === null || productData === void 0 ? void 0 : productData.title) || ''), /*#__PURE__*/React.createElement("div", {
|
|
765
763
|
className: "sku-detail-right-content-detail-description"
|
|
766
764
|
}, productData !== null && productData !== void 0 && productData.subtitle ? /*#__PURE__*/React.createElement("div", {
|
|
767
765
|
className: "sku-detail-right-content-detail-subtitle"
|
|
@@ -770,7 +768,14 @@ var SkuDetailModal = function SkuDetailModal(_ref, ref) {
|
|
|
770
768
|
dangerouslySetInnerHTML: {
|
|
771
769
|
__html: productData.description
|
|
772
770
|
}
|
|
773
|
-
}) : null
|
|
771
|
+
}) : null, (productData === null || productData === void 0 ? void 0 : productData.description) === '' && !hasSkuOptions && /*#__PURE__*/React.createElement("div", {
|
|
772
|
+
className: "sku-detail-right-content-detail-placeholder"
|
|
773
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
774
|
+
width: 300,
|
|
775
|
+
height: 300,
|
|
776
|
+
src: "https://static.pisellcdn.com/sku_empty.png",
|
|
777
|
+
alt: "placeholder"
|
|
778
|
+
}), /*#__PURE__*/React.createElement("p", null, "No additional options for this item")))), currentStep === 1 && hasSkuOptions && /*#__PURE__*/React.createElement(SKUOptionsSelection, {
|
|
774
779
|
ref: skuOptionsSelectionRef,
|
|
775
780
|
dataSource: productData,
|
|
776
781
|
value: skuDefaultValue,
|
|
@@ -427,3 +427,18 @@
|
|
|
427
427
|
position: relative;
|
|
428
428
|
z-index: 10000; // 确保键盘在遮罩之上
|
|
429
429
|
}
|
|
430
|
+
|
|
431
|
+
.sku-detail-right-content-detail-placeholder {
|
|
432
|
+
display: flex;
|
|
433
|
+
flex-direction: column;
|
|
434
|
+
align-items: center;
|
|
435
|
+
justify-content: center;
|
|
436
|
+
gap: 8px;
|
|
437
|
+
color: #667085;
|
|
438
|
+
|
|
439
|
+
p {
|
|
440
|
+
margin: 0;
|
|
441
|
+
text-align: center;
|
|
442
|
+
font-size: 16px;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
@@ -655,7 +655,8 @@ var formatValues = (state) => {
|
|
|
655
655
|
customer_name: "",
|
|
656
656
|
holder: {},
|
|
657
657
|
relation_products: [],
|
|
658
|
-
metadata: {}
|
|
658
|
+
metadata: {},
|
|
659
|
+
business_code: (state == null ? void 0 : state.businessCode) || void 0
|
|
659
660
|
};
|
|
660
661
|
const isDay = (0, import_utils4.isDaysBooking)(state);
|
|
661
662
|
const isHasMultiDay = getHasMultiDayProduct(state);
|
|
@@ -1155,6 +1155,7 @@ var PaymentModal = ({
|
|
|
1155
1155
|
const { executeIfActive } = (0, import_pisellos.useActiveExecute)();
|
|
1156
1156
|
const Toast = (0, import_materials.useToast)();
|
|
1157
1157
|
const { nativePrint } = (0, import_printer.default)();
|
|
1158
|
+
const businessCode = (0, import_OsKeyContext.useBusinessCode)();
|
|
1158
1159
|
const handleRetry = async () => {
|
|
1159
1160
|
var _a2, _b2;
|
|
1160
1161
|
const checkoutModule = pisellos == null ? void 0 : pisellos.getModule("checkout");
|
|
@@ -1515,7 +1516,8 @@ var PaymentModal = ({
|
|
|
1515
1516
|
currency_code: getData("shop_currency_code"),
|
|
1516
1517
|
currency_symbol: getData("shop_symbol"),
|
|
1517
1518
|
order_rounding_setting: getData("order_rounding_setting"),
|
|
1518
|
-
shop_wallet_pass_id
|
|
1519
|
+
shop_wallet_pass_id,
|
|
1520
|
+
business_code: businessCode
|
|
1519
1521
|
});
|
|
1520
1522
|
const newData = (0, import_lodash.cloneDeep)(data);
|
|
1521
1523
|
const existPayment = newData.existPayment;
|
|
@@ -113,8 +113,7 @@ var List = (props) => {
|
|
|
113
113
|
emptyConfig = { show: true, text: getLocalText("pisell-list-empty-text-default", "No data available"), icon: null, description: "" },
|
|
114
114
|
pagination,
|
|
115
115
|
loading = false,
|
|
116
|
-
renderSearch
|
|
117
|
-
isTreeTab = true
|
|
116
|
+
renderSearch
|
|
118
117
|
} = props;
|
|
119
118
|
console.log("List props", props);
|
|
120
119
|
const tabItems = tabStyle === "none" ? [] : tabData || [];
|
|
@@ -134,8 +133,7 @@ var List = (props) => {
|
|
|
134
133
|
tabItems,
|
|
135
134
|
defaultPageSize,
|
|
136
135
|
tabStyle,
|
|
137
|
-
onLoadData
|
|
138
|
-
isTreeTab
|
|
136
|
+
onLoadData
|
|
139
137
|
});
|
|
140
138
|
const { activeTab, isStickyActive } = listState;
|
|
141
139
|
const listRef = (0, import_react.useRef)(null);
|
|
@@ -206,9 +204,6 @@ var List = (props) => {
|
|
|
206
204
|
}
|
|
207
205
|
if (Array.isArray(activeTab)) {
|
|
208
206
|
const productIds = (0, import_utils.findProductIdsByPath)(tabItems, activeTab, 0);
|
|
209
|
-
if (activeTab.toString() === "0") {
|
|
210
|
-
return [{ tabKey: activeTab, tabLabel: "", items: sourceData }];
|
|
211
|
-
}
|
|
212
207
|
const items = productIds.map((id) => dataIdMap[id]);
|
|
213
208
|
return [{
|
|
214
209
|
tabKey: activeTab,
|
|
@@ -516,7 +511,7 @@ var List = (props) => {
|
|
|
516
511
|
ref: headerRef,
|
|
517
512
|
className: headerClasses
|
|
518
513
|
},
|
|
519
|
-
|
|
514
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
520
515
|
import_materials.PisellTabbar,
|
|
521
516
|
{
|
|
522
517
|
levelConfig: {
|
|
@@ -532,13 +527,6 @@ var List = (props) => {
|
|
|
532
527
|
value: activeTab,
|
|
533
528
|
onChange: handleTabChangeWithScroll
|
|
534
529
|
}
|
|
535
|
-
) : /* @__PURE__ */ import_react.default.createElement(
|
|
536
|
-
import_materials.PisellTabbarTemplate1,
|
|
537
|
-
{
|
|
538
|
-
dataSource: tabItems,
|
|
539
|
-
value: activeTab,
|
|
540
|
-
onChange: handleTabChangeWithScroll
|
|
541
|
-
}
|
|
542
530
|
)
|
|
543
531
|
));
|
|
544
532
|
};
|
|
@@ -27,7 +27,6 @@ export interface UseListStateProps {
|
|
|
27
27
|
onLoadData?: (params: LoadDataParams) => void;
|
|
28
28
|
/** tab样式 */
|
|
29
29
|
tabStyle: 'anchor' | 'switch' | 'none';
|
|
30
|
-
isTreeTab: boolean;
|
|
31
30
|
}
|
|
32
31
|
export interface UseListStateReturn {
|
|
33
32
|
state: ListState;
|
|
@@ -43,4 +42,4 @@ export interface UseListStateReturn {
|
|
|
43
42
|
handleScrollLoad: () => void;
|
|
44
43
|
actualCurrentPage: number;
|
|
45
44
|
}
|
|
46
|
-
export declare const useListState: ({ externalCurrentPage, tabItems, defaultPageSize, onLoadData, tabStyle,
|
|
45
|
+
export declare const useListState: ({ externalCurrentPage, tabItems, defaultPageSize, onLoadData, tabStyle, }: UseListStateProps) => UseListStateReturn;
|
|
@@ -42,8 +42,7 @@ var useListState = ({
|
|
|
42
42
|
tabItems,
|
|
43
43
|
defaultPageSize,
|
|
44
44
|
onLoadData,
|
|
45
|
-
tabStyle
|
|
46
|
-
isTreeTab
|
|
45
|
+
tabStyle
|
|
47
46
|
}) => {
|
|
48
47
|
const initialState = {
|
|
49
48
|
activeTab: tabItems.length > 0 ? tabItems[0].key : "all",
|
|
@@ -53,10 +52,6 @@ var useListState = ({
|
|
|
53
52
|
const [state, dispatch] = (0, import_react.useReducer)(listStateReducer, initialState);
|
|
54
53
|
(0, import_react.useEffect)(() => {
|
|
55
54
|
var _a, _b;
|
|
56
|
-
if (!isTreeTab) {
|
|
57
|
-
setActiveTab(["0"]);
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
55
|
if (tabStyle === "switch" && tabItems.length > 0) {
|
|
61
56
|
const defaultTab = [tabItems[0].key];
|
|
62
57
|
if (((_b = (_a = tabItems[0]) == null ? void 0 : _a.children) == null ? void 0 : _b.length) > 0) {
|
|
@@ -64,7 +59,7 @@ var useListState = ({
|
|
|
64
59
|
}
|
|
65
60
|
setActiveTab(defaultTab);
|
|
66
61
|
}
|
|
67
|
-
}, [tabItems
|
|
62
|
+
}, [tabItems]);
|
|
68
63
|
const actualCurrentPage = externalCurrentPage || state.currentPage;
|
|
69
64
|
const setActiveTab = (0, import_react.useCallback)((tab) => {
|
|
70
65
|
dispatch({ type: "SET_ACTIVE_TAB", payload: tab });
|