@pisell/private-materials 6.12.256 → 6.12.257
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/components/venueBooking/context.js +6 -7
- package/es/components/venueBooking/hooks.js +22 -16
- package/lib/components/venueBooking/context.js +6 -7
- package/lib/components/venueBooking/hooks.js +22 -16
- package/package.json +4 -4
|
@@ -201,14 +201,13 @@ function VenueBookingProvider({ entryContext, children }) {
|
|
|
201
201
|
*/
|
|
202
202
|
const refreshViewModel = useCallback(function() {
|
|
203
203
|
var _ref = _asyncToGenerator(function* (extraFields) {
|
|
204
|
-
|
|
205
|
-
yield venueBookingModule
|
|
204
|
+
try {
|
|
205
|
+
const moduleData = yield createVenueBookingViewModel(venueBookingModule);
|
|
206
|
+
setViewModel((prev) => _objectSpread2(_objectSpread2(_objectSpread2({}, prev), moduleData), extraFields || {}));
|
|
207
|
+
if (venueBookingModule && typeof venueBookingModule.getDiscountList === "function") setDiscountList(venueBookingModule.getDiscountList() || []);
|
|
206
208
|
} catch (error) {
|
|
207
|
-
console.warn("[venueBooking]
|
|
209
|
+
console.warn("[venueBooking] refreshViewModel failed", error);
|
|
208
210
|
}
|
|
209
|
-
const moduleData = createVenueBookingViewModel(venueBookingModule);
|
|
210
|
-
setViewModel((prev) => _objectSpread2(_objectSpread2(_objectSpread2({}, prev), moduleData), extraFields || {}));
|
|
211
|
-
if (venueBookingModule && typeof venueBookingModule.getDiscountList === "function") setDiscountList(venueBookingModule.getDiscountList() || []);
|
|
212
211
|
});
|
|
213
212
|
return function(_x) {
|
|
214
213
|
return _ref.apply(this, arguments);
|
|
@@ -620,7 +619,7 @@ function VenueBookingProvider({ entryContext, children }) {
|
|
|
620
619
|
yield loadVenueProducts(venueBookingModule, VENUE_PRODUCT_IDS);
|
|
621
620
|
const venueProducts = typeof (venueBookingModule === null || venueBookingModule === void 0 ? void 0 : venueBookingModule.getVenueProducts) === "function" ? venueBookingModule.getVenueProducts() : [];
|
|
622
621
|
yield goToNearestAvailableDateRef.current(anchorDateRef.current);
|
|
623
|
-
const moduleData = createVenueBookingViewModel(venueBookingModule);
|
|
622
|
+
const moduleData = yield createVenueBookingViewModel(venueBookingModule);
|
|
624
623
|
if (!unmounted) {
|
|
625
624
|
setViewModel((prev) => _objectSpread2(_objectSpread2({}, prev), {}, {
|
|
626
625
|
cartItems: Array.isArray(moduleData.cartItems) ? moduleData.cartItems : [],
|
|
@@ -190,25 +190,31 @@ function getSelectedDateKeySet(module) {
|
|
|
190
190
|
return selectedDateKeySet;
|
|
191
191
|
}
|
|
192
192
|
/**
|
|
193
|
-
*
|
|
193
|
+
* 等待 OS 金额汇总后,从模块快照构建 ViewModel(购物车部分)
|
|
194
194
|
* 购物车数据使用 toShoppingCartProducts 转换为 ShoppingCart 组件所需格式
|
|
195
195
|
*/
|
|
196
|
-
function createVenueBookingViewModel(
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
196
|
+
function createVenueBookingViewModel(_x10) {
|
|
197
|
+
return _createVenueBookingViewModel.apply(this, arguments);
|
|
198
|
+
}
|
|
199
|
+
function _createVenueBookingViewModel() {
|
|
200
|
+
_createVenueBookingViewModel = _asyncToGenerator(function* (module) {
|
|
201
|
+
const summaryByGetter = typeof (module === null || module === void 0 ? void 0 : module.getSummary) === "function" ? yield module.getSummary() : null;
|
|
202
|
+
const orderProducts = callModuleGetter(module, "getOrderProducts", []);
|
|
203
|
+
const tempOrder = callModuleGetter(module, "getTempOrder", null);
|
|
204
|
+
const amountSymbol = (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.currency_symbol) || "$";
|
|
205
|
+
const cartItems = toShoppingCartProducts({
|
|
206
|
+
orderProducts: Array.isArray(orderProducts) ? orderProducts : [],
|
|
207
|
+
amountSymbol
|
|
208
|
+
});
|
|
209
|
+
const summary = (summaryByGetter && typeof summaryByGetter === "object" ? summaryByGetter : null) || (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.summary) || {};
|
|
210
|
+
return {
|
|
211
|
+
cartItems: Array.isArray(cartItems) ? cartItems : [],
|
|
212
|
+
summary: summary && typeof summary === "object" ? summary : {},
|
|
213
|
+
note: String((tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.note) || ""),
|
|
214
|
+
contactsInfo: Array.isArray(tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.contacts_info) ? tempOrder.contacts_info : []
|
|
215
|
+
};
|
|
204
216
|
});
|
|
205
|
-
|
|
206
|
-
return {
|
|
207
|
-
cartItems: Array.isArray(cartItems) ? cartItems : [],
|
|
208
|
-
summary: summary && typeof summary === "object" ? summary : {},
|
|
209
|
-
note: String((tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.note) || ""),
|
|
210
|
-
contactsInfo: Array.isArray(tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.contacts_info) ? tempOrder.contacts_info : []
|
|
211
|
-
};
|
|
217
|
+
return _createVenueBookingViewModel.apply(this, arguments);
|
|
212
218
|
}
|
|
213
219
|
/** 登录状态 hook(检查 token + 弹出登录弹窗) */
|
|
214
220
|
function useVenueBookingLogin() {
|
|
@@ -204,14 +204,13 @@ function VenueBookingProvider({ entryContext, children }) {
|
|
|
204
204
|
*/
|
|
205
205
|
const refreshViewModel = (0, react.useCallback)(function() {
|
|
206
206
|
var _ref = require_asyncToGenerator._asyncToGenerator(function* (extraFields) {
|
|
207
|
-
|
|
208
|
-
yield
|
|
207
|
+
try {
|
|
208
|
+
const moduleData = yield require_hooks.createVenueBookingViewModel(venueBookingModule);
|
|
209
|
+
setViewModel((prev) => require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, prev), moduleData), extraFields || {}));
|
|
210
|
+
if (venueBookingModule && typeof venueBookingModule.getDiscountList === "function") setDiscountList(venueBookingModule.getDiscountList() || []);
|
|
209
211
|
} catch (error) {
|
|
210
|
-
console.warn("[venueBooking]
|
|
212
|
+
console.warn("[venueBooking] refreshViewModel failed", error);
|
|
211
213
|
}
|
|
212
|
-
const moduleData = require_hooks.createVenueBookingViewModel(venueBookingModule);
|
|
213
|
-
setViewModel((prev) => require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, prev), moduleData), extraFields || {}));
|
|
214
|
-
if (venueBookingModule && typeof venueBookingModule.getDiscountList === "function") setDiscountList(venueBookingModule.getDiscountList() || []);
|
|
215
214
|
});
|
|
216
215
|
return function(_x) {
|
|
217
216
|
return _ref.apply(this, arguments);
|
|
@@ -623,7 +622,7 @@ function VenueBookingProvider({ entryContext, children }) {
|
|
|
623
622
|
yield require_hooks.loadVenueProducts(venueBookingModule, require_hooks.VENUE_PRODUCT_IDS);
|
|
624
623
|
const venueProducts = typeof (venueBookingModule === null || venueBookingModule === void 0 ? void 0 : venueBookingModule.getVenueProducts) === "function" ? venueBookingModule.getVenueProducts() : [];
|
|
625
624
|
yield goToNearestAvailableDateRef.current(anchorDateRef.current);
|
|
626
|
-
const moduleData = require_hooks.createVenueBookingViewModel(venueBookingModule);
|
|
625
|
+
const moduleData = yield require_hooks.createVenueBookingViewModel(venueBookingModule);
|
|
627
626
|
if (!unmounted) {
|
|
628
627
|
setViewModel((prev) => require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, prev), {}, {
|
|
629
628
|
cartItems: Array.isArray(moduleData.cartItems) ? moduleData.cartItems : [],
|
|
@@ -191,25 +191,31 @@ function getSelectedDateKeySet(module) {
|
|
|
191
191
|
return selectedDateKeySet;
|
|
192
192
|
}
|
|
193
193
|
/**
|
|
194
|
-
*
|
|
194
|
+
* 等待 OS 金额汇总后,从模块快照构建 ViewModel(购物车部分)
|
|
195
195
|
* 购物车数据使用 toShoppingCartProducts 转换为 ShoppingCart 组件所需格式
|
|
196
196
|
*/
|
|
197
|
-
function createVenueBookingViewModel(
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
197
|
+
function createVenueBookingViewModel(_x10) {
|
|
198
|
+
return _createVenueBookingViewModel.apply(this, arguments);
|
|
199
|
+
}
|
|
200
|
+
function _createVenueBookingViewModel() {
|
|
201
|
+
_createVenueBookingViewModel = require_asyncToGenerator._asyncToGenerator(function* (module) {
|
|
202
|
+
const summaryByGetter = typeof (module === null || module === void 0 ? void 0 : module.getSummary) === "function" ? yield module.getSummary() : null;
|
|
203
|
+
const orderProducts = callModuleGetter(module, "getOrderProducts", []);
|
|
204
|
+
const tempOrder = callModuleGetter(module, "getTempOrder", null);
|
|
205
|
+
const amountSymbol = (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.currency_symbol) || "$";
|
|
206
|
+
const cartItems = require_toShoppingCartProducts.toShoppingCartProducts({
|
|
207
|
+
orderProducts: Array.isArray(orderProducts) ? orderProducts : [],
|
|
208
|
+
amountSymbol
|
|
209
|
+
});
|
|
210
|
+
const summary = (summaryByGetter && typeof summaryByGetter === "object" ? summaryByGetter : null) || (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.summary) || {};
|
|
211
|
+
return {
|
|
212
|
+
cartItems: Array.isArray(cartItems) ? cartItems : [],
|
|
213
|
+
summary: summary && typeof summary === "object" ? summary : {},
|
|
214
|
+
note: String((tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.note) || ""),
|
|
215
|
+
contactsInfo: Array.isArray(tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.contacts_info) ? tempOrder.contacts_info : []
|
|
216
|
+
};
|
|
205
217
|
});
|
|
206
|
-
|
|
207
|
-
return {
|
|
208
|
-
cartItems: Array.isArray(cartItems) ? cartItems : [],
|
|
209
|
-
summary: summary && typeof summary === "object" ? summary : {},
|
|
210
|
-
note: String((tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.note) || ""),
|
|
211
|
-
contactsInfo: Array.isArray(tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.contacts_info) ? tempOrder.contacts_info : []
|
|
212
|
-
};
|
|
218
|
+
return _createVenueBookingViewModel.apply(this, arguments);
|
|
213
219
|
}
|
|
214
220
|
/** 登录状态 hook(检查 token + 弹出登录弹窗) */
|
|
215
221
|
function useVenueBookingLogin() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "6.12.
|
|
3
|
+
"version": "6.12.257",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -71,10 +71,10 @@
|
|
|
71
71
|
"styled-components": "^6.0.0-rc.3",
|
|
72
72
|
"use-sync-external-store": "^1.6.0",
|
|
73
73
|
"@pisell/materials": "6.12.74",
|
|
74
|
-
"@pisell/pi-payment-sdk": "0.0.3",
|
|
75
|
-
"@pisell/icon": "0.0.11",
|
|
76
74
|
"@pisell/utils": "3.0.7",
|
|
77
|
-
"@pisell/
|
|
75
|
+
"@pisell/pi-payment-sdk": "0.0.3",
|
|
76
|
+
"@pisell/date-picker": "3.0.12",
|
|
77
|
+
"@pisell/icon": "0.0.11"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
80
80
|
"react": "^18.0.0",
|