@pisell/private-materials 6.7.3 → 6.7.4
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/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +2 -2
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +2 -2
- package/es/components/appointmentBooking/components/Footer/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service/like/index.d.ts +1 -0
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/eftpos/deviceList/index.d.ts +1 -0
- package/es/components/eftpos/form/index.d.ts +1 -0
- package/es/components/eftpos/group/index.d.ts +1 -0
- package/es/components/eftpos/hooks.d.ts +1 -0
- package/es/components/eftpos/icon/apiKey.d.ts +1 -0
- package/es/components/eftpos/icon/device.d.ts +1 -0
- package/es/components/eftpos/receipt/index.d.ts +1 -0
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/component/alert/warn.d.ts +1 -0
- package/es/components/eftposPay/component/header/titlebar.d.ts +1 -0
- package/es/components/eftposPay/component/step/index.d.ts +1 -0
- package/es/components/eftposPay/component/step/step.d.ts +1 -0
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/store/index.d.ts +3 -3
- package/es/components/eftposPay/tyro/hooks.d.ts +1 -0
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/es/components/productExtension/fields/Forms/index.d.ts +1 -0
- package/es/components/schedules/resources/relationProduct/index.d.ts +1 -0
- package/es/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/es/plus/clientName/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Duration/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Resource/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Stock/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Time/index.d.ts +1 -1
- package/es/plus/webPosLogin/WebPosLogin.js +5 -8
- package/es/plus/webPosLogin/WebPosLoginCpt.js +1 -1
- package/es/plus/webPosLogin/components/BrandPanel/index.js +7 -37
- package/es/plus/webPosLogin/components/MediaDisplay/index.d.ts +12 -0
- package/es/plus/webPosLogin/components/MediaDisplay/index.js +220 -0
- package/es/plus/webPosLogin/components/MediaDisplay/index.less +141 -0
- package/es/plus/webPosLogin/components/MediaDisplay/type.d.ts +54 -0
- package/es/plus/webPosLogin/components/MediaDisplay/type.js +1 -0
- package/es/pro/pisellPaymentList/example.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Footer/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service/like/index.d.ts +1 -0
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/eftpos/deviceList/index.d.ts +1 -0
- package/lib/components/eftpos/form/index.d.ts +1 -0
- package/lib/components/eftpos/group/index.d.ts +1 -0
- package/lib/components/eftpos/hooks.d.ts +1 -0
- package/lib/components/eftpos/icon/apiKey.d.ts +1 -0
- package/lib/components/eftpos/icon/device.d.ts +1 -0
- package/lib/components/eftpos/receipt/index.d.ts +1 -0
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/component/alert/warn.d.ts +1 -0
- package/lib/components/eftposPay/component/header/titlebar.d.ts +1 -0
- package/lib/components/eftposPay/component/step/index.d.ts +1 -0
- package/lib/components/eftposPay/component/step/step.d.ts +1 -0
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/store/index.d.ts +3 -3
- package/lib/components/eftposPay/tyro/hooks.d.ts +1 -0
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/lib/components/productExtension/fields/Forms/index.d.ts +1 -0
- package/lib/components/schedules/resources/relationProduct/index.d.ts +1 -0
- package/lib/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/lib/plus/clientName/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Duration/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Resource/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Stock/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Time/index.d.ts +1 -1
- package/lib/plus/webPosLogin/WebPosLogin.js +17 -21
- package/lib/plus/webPosLogin/WebPosLoginCpt.js +1 -1
- package/lib/plus/webPosLogin/components/BrandPanel/index.js +2 -22
- package/lib/plus/webPosLogin/components/MediaDisplay/index.d.ts +12 -0
- package/lib/plus/webPosLogin/components/MediaDisplay/index.js +160 -0
- package/lib/plus/webPosLogin/components/MediaDisplay/index.less +141 -0
- package/lib/plus/webPosLogin/components/MediaDisplay/type.d.ts +54 -0
- package/lib/plus/webPosLogin/components/MediaDisplay/type.js +17 -0
- package/lib/pro/pisellPaymentList/example.d.ts +1 -0
- package/package.json +3 -3
|
@@ -2,5 +2,5 @@ import React from 'react';
|
|
|
2
2
|
import { ProductCardConfig } from '../../type';
|
|
3
3
|
declare const Capacity: ({ props }: {
|
|
4
4
|
props: ProductCardConfig;
|
|
5
|
-
}) => string | number | true |
|
|
5
|
+
}) => string | number | true | JSX.Element | React.ReactFragment | null;
|
|
6
6
|
export default Capacity;
|
|
@@ -3,5 +3,5 @@ import { SkuStatusOverlayConfig } from '../../type';
|
|
|
3
3
|
import './index.less';
|
|
4
4
|
declare const CardMask: ({ props }: {
|
|
5
5
|
props: SkuStatusOverlayConfig;
|
|
6
|
-
}) => string | number | true |
|
|
6
|
+
}) => string | number | true | JSX.Element | React.ReactFragment | null;
|
|
7
7
|
export default CardMask;
|
|
@@ -3,5 +3,5 @@ import { ProductCardConfig } from '../../type';
|
|
|
3
3
|
import './index.less';
|
|
4
4
|
declare const Countdown: ({ props }: {
|
|
5
5
|
props: ProductCardConfig;
|
|
6
|
-
}) => string | number | true |
|
|
6
|
+
}) => string | number | true | JSX.Element | React.ReactFragment | null;
|
|
7
7
|
export default Countdown;
|
|
@@ -2,5 +2,5 @@ import React from 'react';
|
|
|
2
2
|
import { ProductCardConfig } from '../../type';
|
|
3
3
|
declare const Duration: ({ props }: {
|
|
4
4
|
props: ProductCardConfig;
|
|
5
|
-
}) => string | number | true |
|
|
5
|
+
}) => string | number | true | JSX.Element | React.ReactFragment | null;
|
|
6
6
|
export default Duration;
|
|
@@ -3,5 +3,5 @@ import { ProductCardConfig } from '../../type';
|
|
|
3
3
|
import './index.less';
|
|
4
4
|
declare const MemberPrice: ({ props }: {
|
|
5
5
|
props: ProductCardConfig;
|
|
6
|
-
}) => string | number | true |
|
|
6
|
+
}) => string | number | true | JSX.Element | React.ReactFragment | null;
|
|
7
7
|
export default MemberPrice;
|
|
@@ -2,5 +2,5 @@ import React from 'react';
|
|
|
2
2
|
import { ProductCardConfig } from '../../type';
|
|
3
3
|
declare const Resource: ({ props }: {
|
|
4
4
|
props: ProductCardConfig;
|
|
5
|
-
}) => string | number | true |
|
|
5
|
+
}) => string | number | true | JSX.Element | React.ReactFragment | null;
|
|
6
6
|
export default Resource;
|
|
@@ -2,5 +2,5 @@ import React from 'react';
|
|
|
2
2
|
import { ProductCardConfig } from '../../type';
|
|
3
3
|
declare const Stock: ({ props }: {
|
|
4
4
|
props: ProductCardConfig;
|
|
5
|
-
}) => string | number | true |
|
|
5
|
+
}) => string | number | true | JSX.Element | React.ReactFragment | null;
|
|
6
6
|
export default Stock;
|
|
@@ -2,5 +2,5 @@ import React from 'react';
|
|
|
2
2
|
import { ProductCardConfig } from '../../type';
|
|
3
3
|
declare const Time: ({ props }: {
|
|
4
4
|
props: ProductCardConfig;
|
|
5
|
-
}) => string | number | true |
|
|
5
|
+
}) => string | number | true | JSX.Element | React.ReactFragment | null;
|
|
6
6
|
export default Time;
|
|
@@ -43,9 +43,10 @@ var useSearchParams = () => {
|
|
|
43
43
|
return new URLSearchParams(window.location.search);
|
|
44
44
|
};
|
|
45
45
|
var WebPosLogin = (props) => {
|
|
46
|
-
var _a, _b, _c;
|
|
46
|
+
var _a, _b, _c, _d, _e, _f;
|
|
47
47
|
const context = (0, import_useEngineContext.default)();
|
|
48
48
|
const { getApp = () => ({}), reloadAfterLogin } = (_a = context.appHelper) == null ? void 0 : _a.utils;
|
|
49
|
+
const { mediaConfig } = (_b = context.appHelper) == null ? void 0 : _b.constants;
|
|
49
50
|
const { backgroundImage, step: propsStep = "login", config } = props;
|
|
50
51
|
const [storeList, setStoreList] = (0, import_react.useState)(() => {
|
|
51
52
|
var _a2;
|
|
@@ -102,7 +103,7 @@ var WebPosLogin = (props) => {
|
|
|
102
103
|
const [isShowGoBack, setIsShowGoBack] = (0, import_react.useState)(true);
|
|
103
104
|
import_utils2.request.setRequest(context.appHelper.utils.request);
|
|
104
105
|
const onLoginSuccess = async (res) => {
|
|
105
|
-
var _a2, _b2, _c2,
|
|
106
|
+
var _a2, _b2, _c2, _d2, _e2;
|
|
106
107
|
const app = getApp();
|
|
107
108
|
if (!res) {
|
|
108
109
|
return;
|
|
@@ -114,10 +115,10 @@ var WebPosLogin = (props) => {
|
|
|
114
115
|
);
|
|
115
116
|
setUserInfo({
|
|
116
117
|
name: ((_c2 = res == null ? void 0 : res.account) == null ? void 0 : _c2.name) || "",
|
|
117
|
-
avatar: ((
|
|
118
|
+
avatar: ((_d2 = res == null ? void 0 : res.account) == null ? void 0 : _d2.avatar) || ""
|
|
118
119
|
});
|
|
119
120
|
const tenant = await (0, import_service.getTenant)();
|
|
120
|
-
(
|
|
121
|
+
(_e2 = app == null ? void 0 : app.storage) == null ? void 0 : _e2.setStorage("storeList", JSON.stringify(tenant || {}));
|
|
121
122
|
const lastUsedStore = tenant == null ? void 0 : tenant.find((item) => item.id == lastUsedStoreId);
|
|
122
123
|
if ((tenant == null ? void 0 : tenant.length) === 1) {
|
|
123
124
|
await handleStoreSelect(tenant[0], false);
|
|
@@ -136,7 +137,7 @@ var WebPosLogin = (props) => {
|
|
|
136
137
|
}
|
|
137
138
|
};
|
|
138
139
|
const handleStoreSelect = async (shopInfo, isShowGoBack2 = true) => {
|
|
139
|
-
var _a2, _b2, _c2,
|
|
140
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g, _h;
|
|
140
141
|
const app = getApp();
|
|
141
142
|
app.storage.setStorage("tenant_domain", (_a2 = shopInfo == null ? void 0 : shopInfo.tenant) == null ? void 0 : _a2.default_domain);
|
|
142
143
|
app.storage.setStorage("selectedStore", JSON.stringify(shopInfo));
|
|
@@ -158,9 +159,9 @@ var WebPosLogin = (props) => {
|
|
|
158
159
|
});
|
|
159
160
|
return;
|
|
160
161
|
}
|
|
161
|
-
(
|
|
162
|
+
(_e2 = app == null ? void 0 : app.getPlugin("token")) == null ? void 0 : _e2.set((_d2 = res == null ? void 0 : res.mypisell_data) == null ? void 0 : _d2.account_token, "pisellV1Token");
|
|
162
163
|
if (res.nocobase_tenant_token) {
|
|
163
|
-
(
|
|
164
|
+
(_f2 = app == null ? void 0 : app.getPlugin("token")) == null ? void 0 : _f2.set(res.nocobase_tenant_token, "nocobaseToken");
|
|
164
165
|
}
|
|
165
166
|
await getDeviceListFunction();
|
|
166
167
|
setIsShowGoBack(isShowGoBack2);
|
|
@@ -208,7 +209,7 @@ var WebPosLogin = (props) => {
|
|
|
208
209
|
}
|
|
209
210
|
};
|
|
210
211
|
const handleDissociateDevice = async () => {
|
|
211
|
-
var _a2, _b2, _c2,
|
|
212
|
+
var _a2, _b2, _c2, _d2, _e2;
|
|
212
213
|
const app = getApp();
|
|
213
214
|
const boundCloudDevice = JSON.parse(
|
|
214
215
|
((_a2 = app == null ? void 0 : app.storage) == null ? void 0 : _a2.getStorage("boundCloudDevice")) || "{}"
|
|
@@ -219,13 +220,13 @@ var WebPosLogin = (props) => {
|
|
|
219
220
|
dissociateDeviceNumber: boundCloudDevice == null ? void 0 : boundCloudDevice.number
|
|
220
221
|
});
|
|
221
222
|
if (!res) {
|
|
222
|
-
(
|
|
223
|
+
(_d2 = app == null ? void 0 : app.logger) == null ? void 0 : _d2.addLog({
|
|
223
224
|
type: "error",
|
|
224
225
|
title: "选择设备页-解除设备绑定失败"
|
|
225
226
|
});
|
|
226
227
|
return false;
|
|
227
228
|
} else {
|
|
228
|
-
(
|
|
229
|
+
(_e2 = app == null ? void 0 : app.logger) == null ? void 0 : _e2.addLog({
|
|
229
230
|
type: "info",
|
|
230
231
|
title: "选择设备页-解除设备绑定成功",
|
|
231
232
|
metadata: res || {}
|
|
@@ -236,7 +237,7 @@ var WebPosLogin = (props) => {
|
|
|
236
237
|
return true;
|
|
237
238
|
};
|
|
238
239
|
const handleDeviceSelect = async (device) => {
|
|
239
|
-
var _a2, _b2, _c2,
|
|
240
|
+
var _a2, _b2, _c2, _d2, _e2;
|
|
240
241
|
const app = getApp();
|
|
241
242
|
app.storage.setStorage("lastUsedDevice", JSON.stringify(device));
|
|
242
243
|
setLastUsedDeviceId(device.id);
|
|
@@ -260,7 +261,7 @@ var WebPosLogin = (props) => {
|
|
|
260
261
|
});
|
|
261
262
|
return;
|
|
262
263
|
} else {
|
|
263
|
-
(
|
|
264
|
+
(_d2 = app == null ? void 0 : app.logger) == null ? void 0 : _d2.addLog({
|
|
264
265
|
type: "info",
|
|
265
266
|
title: "选择设备页-绑定设备-本机设备信息获取成功",
|
|
266
267
|
metadata: _device || {}
|
|
@@ -286,7 +287,7 @@ var WebPosLogin = (props) => {
|
|
|
286
287
|
key: "DEVICE_NUMBER",
|
|
287
288
|
metadata: { msg: "webpo主动推送" }
|
|
288
289
|
});
|
|
289
|
-
(
|
|
290
|
+
(_e2 = app == null ? void 0 : app.logger) == null ? void 0 : _e2.addLog({
|
|
290
291
|
type: "info",
|
|
291
292
|
title: "选择设备页-绑定设备成功",
|
|
292
293
|
metadata: res || {}
|
|
@@ -302,13 +303,8 @@ var WebPosLogin = (props) => {
|
|
|
302
303
|
import_WebPosLoginCpt.default,
|
|
303
304
|
{
|
|
304
305
|
loginConfig: config,
|
|
305
|
-
backgroundImage,
|
|
306
|
-
brandConfig:
|
|
307
|
-
carouselItems: [{
|
|
308
|
-
type: "image",
|
|
309
|
-
url: "https://static.pisellcdn.com/defaultLogo.png"
|
|
310
|
-
}]
|
|
311
|
-
},
|
|
306
|
+
backgroundImage: backgroundImage || ((_d = (_c = mediaConfig.loginBgMediaConfig) == null ? void 0 : _c[0]) == null ? void 0 : _d.url),
|
|
307
|
+
brandConfig: mediaConfig.loginMediaConfig,
|
|
312
308
|
step,
|
|
313
309
|
showBackButton: isShowGoBack,
|
|
314
310
|
storeList,
|
|
@@ -317,7 +313,7 @@ var WebPosLogin = (props) => {
|
|
|
317
313
|
selectedStore,
|
|
318
314
|
lastUsedStoreId,
|
|
319
315
|
lastUsedDeviceId,
|
|
320
|
-
locale: ((
|
|
316
|
+
locale: ((_f = (_e = context == null ? void 0 : context.engine) == null ? void 0 : _e.props) == null ? void 0 : _f.locale) || "en",
|
|
321
317
|
loading: false,
|
|
322
318
|
onStoreSelect: handleStoreSelect,
|
|
323
319
|
onDeviceSelect: handleDeviceSelect,
|
|
@@ -41,7 +41,7 @@ var import_SelectStore = __toESM(require("./components/SelectStore"));
|
|
|
41
41
|
var import_SelectDevice = __toESM(require("./components/SelectDevice"));
|
|
42
42
|
var import_UserFooter = __toESM(require("./components/UserFooter"));
|
|
43
43
|
var import_WebPosLoginCpt = require("./WebPosLoginCpt.less");
|
|
44
|
-
var DEFAULT_BACKGROUND = "http://static.pisellcdn.com/
|
|
44
|
+
var DEFAULT_BACKGROUND = "http://static.pisellcdn.com/defaultBg1.jpg";
|
|
45
45
|
var WebPosLoginCpt = (0, import_react.memo)((props) => {
|
|
46
46
|
const {
|
|
47
47
|
className = "",
|
|
@@ -33,31 +33,11 @@ __export(BrandPanel_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(BrandPanel_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
|
-
var import_materials = require("@pisell/materials");
|
|
37
36
|
var import_index = require("./index.less");
|
|
37
|
+
var import_MediaDisplay = __toESM(require("../MediaDisplay"));
|
|
38
38
|
var BrandPanel = (0, import_react.memo)((props) => {
|
|
39
39
|
const { config, className = "" } = props;
|
|
40
|
-
|
|
41
|
-
var _a;
|
|
42
|
-
if ((_a = config == null ? void 0 : config.carouselItems) == null ? void 0 : _a.length) {
|
|
43
|
-
const firstImage = config.carouselItems.find((item) => item.type === "image");
|
|
44
|
-
if (firstImage == null ? void 0 : firstImage.url) {
|
|
45
|
-
return firstImage.url;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return config == null ? void 0 : config.logo;
|
|
49
|
-
}, [config == null ? void 0 : config.carouselItems, config == null ? void 0 : config.logo]);
|
|
50
|
-
const slogan = config == null ? void 0 : config.slogan;
|
|
51
|
-
console.log("displayImage", displayImage);
|
|
52
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className: `webpos-login-brand-panel ${className}`.trim() }, /* @__PURE__ */ import_react.default.createElement("div", { className: "webpos-login-brand-panel__content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "webpos-login-brand-panel__logo-wrapper" }, /* @__PURE__ */ import_react.default.createElement(
|
|
53
|
-
import_materials.Image,
|
|
54
|
-
{
|
|
55
|
-
src: displayImage,
|
|
56
|
-
preview: false,
|
|
57
|
-
alt: "Brand Logo",
|
|
58
|
-
className: "webpos-login-brand-panel__logo"
|
|
59
|
-
}
|
|
60
|
-
)), slogan && /* @__PURE__ */ import_react.default.createElement("p", { className: "webpos-login-brand-panel__slogan" }, slogan)));
|
|
40
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: `webpos-login-brand-panel ${className}`.trim() }, /* @__PURE__ */ import_react.default.createElement(import_MediaDisplay.default, { config: { carouselItems: config } }));
|
|
61
41
|
});
|
|
62
42
|
BrandPanel.displayName = "BrandPanel";
|
|
63
43
|
var BrandPanel_default = BrandPanel;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MediaDisplayProps } from "./type";
|
|
3
|
+
import './index.less';
|
|
4
|
+
/**
|
|
5
|
+
* MediaDisplay 媒体组件
|
|
6
|
+
* @description 通用媒体展示组件,支持图片/视频展示
|
|
7
|
+
* - 支持单个媒体或轮播(预留)
|
|
8
|
+
* - 支持全屏模式
|
|
9
|
+
* - 支持视频播放控制和状态回调
|
|
10
|
+
*/
|
|
11
|
+
declare const MediaDisplay: React.FC<MediaDisplayProps>;
|
|
12
|
+
export default MediaDisplay;
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/plus/webPosLogin/components/MediaDisplay/index.tsx
|
|
30
|
+
var MediaDisplay_exports = {};
|
|
31
|
+
__export(MediaDisplay_exports, {
|
|
32
|
+
default: () => MediaDisplay_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(MediaDisplay_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_materials = require("@pisell/materials");
|
|
37
|
+
var import_index = require("./index.less");
|
|
38
|
+
var MediaDisplay = (0, import_react.memo)((props) => {
|
|
39
|
+
var _a;
|
|
40
|
+
const {
|
|
41
|
+
config,
|
|
42
|
+
className = "",
|
|
43
|
+
fullscreen = false,
|
|
44
|
+
muted = true,
|
|
45
|
+
loop = false,
|
|
46
|
+
onVideoEnded,
|
|
47
|
+
onVideoStateChange,
|
|
48
|
+
canClose = true,
|
|
49
|
+
onClose
|
|
50
|
+
} = props;
|
|
51
|
+
const videoRef = (0, import_react.useRef)(null);
|
|
52
|
+
const [videoState, setVideoState] = (0, import_react.useState)("idle");
|
|
53
|
+
const [isVideoEnded, setIsVideoEnded] = (0, import_react.useState)(false);
|
|
54
|
+
const currentMedia = (0, import_react.useMemo)(() => {
|
|
55
|
+
var _a2;
|
|
56
|
+
if ((_a2 = config == null ? void 0 : config.carouselItems) == null ? void 0 : _a2.length) {
|
|
57
|
+
return config.carouselItems[0];
|
|
58
|
+
}
|
|
59
|
+
if (config == null ? void 0 : config.logo) {
|
|
60
|
+
return { type: "image", url: config.logo };
|
|
61
|
+
}
|
|
62
|
+
return null;
|
|
63
|
+
}, [config == null ? void 0 : config.carouselItems, config == null ? void 0 : config.logo]);
|
|
64
|
+
const isVideo = (currentMedia == null ? void 0 : currentMedia.type) === "video";
|
|
65
|
+
const isSingleMedia = (0, import_react.useMemo)(() => {
|
|
66
|
+
var _a2;
|
|
67
|
+
const itemCount = ((_a2 = config == null ? void 0 : config.carouselItems) == null ? void 0 : _a2.length) || 0;
|
|
68
|
+
return itemCount <= 1;
|
|
69
|
+
}, [(_a = config == null ? void 0 : config.carouselItems) == null ? void 0 : _a.length]);
|
|
70
|
+
const updateVideoState = (0, import_react.useCallback)((state) => {
|
|
71
|
+
setVideoState(state);
|
|
72
|
+
onVideoStateChange == null ? void 0 : onVideoStateChange(state);
|
|
73
|
+
}, [onVideoStateChange]);
|
|
74
|
+
const handleVideoEnded = (0, import_react.useCallback)(() => {
|
|
75
|
+
setIsVideoEnded(true);
|
|
76
|
+
updateVideoState("ended");
|
|
77
|
+
onVideoEnded == null ? void 0 : onVideoEnded();
|
|
78
|
+
if (canClose) {
|
|
79
|
+
onClose == null ? void 0 : onClose();
|
|
80
|
+
}
|
|
81
|
+
}, [canClose, onClose, onVideoEnded, updateVideoState]);
|
|
82
|
+
(0, import_react.useEffect)(() => {
|
|
83
|
+
if (isVideoEnded && canClose) {
|
|
84
|
+
onClose == null ? void 0 : onClose();
|
|
85
|
+
}
|
|
86
|
+
}, [isVideoEnded, canClose, onClose]);
|
|
87
|
+
(0, import_react.useEffect)(() => {
|
|
88
|
+
const video = videoRef.current;
|
|
89
|
+
if (!video || !isVideo) return;
|
|
90
|
+
const handlePlay = () => updateVideoState("playing");
|
|
91
|
+
const handlePause = () => updateVideoState("paused");
|
|
92
|
+
const handleError = () => updateVideoState("error");
|
|
93
|
+
const handleLoadedData = () => {
|
|
94
|
+
video.play().catch((err) => {
|
|
95
|
+
console.warn("[MediaDisplay] 视频自动播放失败:", err);
|
|
96
|
+
updateVideoState("error");
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
video.addEventListener("play", handlePlay);
|
|
100
|
+
video.addEventListener("pause", handlePause);
|
|
101
|
+
video.addEventListener("ended", handleVideoEnded);
|
|
102
|
+
video.addEventListener("error", handleError);
|
|
103
|
+
video.addEventListener("loadeddata", handleLoadedData);
|
|
104
|
+
return () => {
|
|
105
|
+
video.removeEventListener("play", handlePlay);
|
|
106
|
+
video.removeEventListener("pause", handlePause);
|
|
107
|
+
video.removeEventListener("ended", handleVideoEnded);
|
|
108
|
+
video.removeEventListener("error", handleError);
|
|
109
|
+
video.removeEventListener("loadeddata", handleLoadedData);
|
|
110
|
+
};
|
|
111
|
+
}, [isVideo, handleVideoEnded, updateVideoState]);
|
|
112
|
+
const slogan = config == null ? void 0 : config.slogan;
|
|
113
|
+
const renderMedia = () => {
|
|
114
|
+
if (!currentMedia) {
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
if (currentMedia.type === "video") {
|
|
118
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
119
|
+
"video",
|
|
120
|
+
{
|
|
121
|
+
style: { backgroundColor: currentMedia.backgroundColor },
|
|
122
|
+
ref: videoRef,
|
|
123
|
+
src: currentMedia.url,
|
|
124
|
+
className: "media-display__video",
|
|
125
|
+
muted,
|
|
126
|
+
loop,
|
|
127
|
+
playsInline: true,
|
|
128
|
+
autoPlay: true
|
|
129
|
+
}
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
if (currentMedia.type === "logo") {
|
|
133
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "media-display__logo-wrapper" }, /* @__PURE__ */ import_react.default.createElement(
|
|
134
|
+
import_materials.Image,
|
|
135
|
+
{
|
|
136
|
+
style: currentMedia.logoStyle,
|
|
137
|
+
src: currentMedia.url,
|
|
138
|
+
preview: false
|
|
139
|
+
}
|
|
140
|
+
));
|
|
141
|
+
}
|
|
142
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "media-display__image-wrapper" }, /* @__PURE__ */ import_react.default.createElement(
|
|
143
|
+
import_materials.Image,
|
|
144
|
+
{
|
|
145
|
+
style: { width: "100%", height: "100%", backgroundColor: currentMedia.backgroundColor },
|
|
146
|
+
src: currentMedia.url,
|
|
147
|
+
preview: false,
|
|
148
|
+
alt: "Media",
|
|
149
|
+
className: "media-display__image"
|
|
150
|
+
}
|
|
151
|
+
));
|
|
152
|
+
};
|
|
153
|
+
if (fullscreen) {
|
|
154
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: `media-display media-display--fullscreen ${className}`.trim() }, renderMedia());
|
|
155
|
+
}
|
|
156
|
+
console.log(currentMedia, "currentMedia");
|
|
157
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: `webpos-login-brand-panel ${className}`.trim() }, /* @__PURE__ */ import_react.default.createElement("div", { className: "webpos-login-brand-panel__content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "webpos-login-brand-panel__logo-wrapper" }, renderMedia()), slogan && /* @__PURE__ */ import_react.default.createElement("p", { className: "webpos-login-brand-panel__slogan" }, slogan), !isSingleMedia && /* @__PURE__ */ import_react.default.createElement("div", { className: "webpos-login-brand-panel__carousel-controls" })));
|
|
158
|
+
});
|
|
159
|
+
MediaDisplay.displayName = "MediaDisplay";
|
|
160
|
+
var MediaDisplay_default = MediaDisplay;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MediaDisplay 媒体展示组件样式
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/* 全屏模式 */
|
|
6
|
+
.media-display {
|
|
7
|
+
position: relative;
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: 100%;
|
|
10
|
+
|
|
11
|
+
/* 全屏模式 */
|
|
12
|
+
&--fullscreen {
|
|
13
|
+
position: fixed;
|
|
14
|
+
top: 0;
|
|
15
|
+
left: 0;
|
|
16
|
+
right: 0;
|
|
17
|
+
bottom: 0;
|
|
18
|
+
width: 100%;
|
|
19
|
+
height: 100%;
|
|
20
|
+
z-index: 9999;
|
|
21
|
+
/* 背景色由 JS 动态设置(从视频帧提取主色),这里设置默认回退值 */
|
|
22
|
+
background: #000;
|
|
23
|
+
|
|
24
|
+
/* 全屏模式下视频铺满 */
|
|
25
|
+
.media-display__video {
|
|
26
|
+
position: absolute;
|
|
27
|
+
top: 0;
|
|
28
|
+
left: 0;
|
|
29
|
+
width: 100%;
|
|
30
|
+
height: 100%;
|
|
31
|
+
object-fit: contain;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* 视频样式(普通模式) */
|
|
36
|
+
&__video {
|
|
37
|
+
width: 100%;
|
|
38
|
+
height: 100%;
|
|
39
|
+
object-fit: contain;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* 图片容器 */
|
|
43
|
+
&__image-wrapper {
|
|
44
|
+
width: 100%;
|
|
45
|
+
height: 100%;
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
justify-content: center;
|
|
49
|
+
.pisell-lowcode-image {
|
|
50
|
+
width: 100%;
|
|
51
|
+
height: 100%;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* 图片样式 */
|
|
56
|
+
&__image {
|
|
57
|
+
max-width: 100%;
|
|
58
|
+
max-height: 100%;
|
|
59
|
+
object-fit: cover;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* BrandPanel 品牌区组件样式(普通模式)
|
|
65
|
+
*/
|
|
66
|
+
.webpos-login-brand-panel {
|
|
67
|
+
position: relative;
|
|
68
|
+
display: flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
justify-content: center;
|
|
71
|
+
width: 50%;
|
|
72
|
+
min-width: 400px;
|
|
73
|
+
min-height: 600px;
|
|
74
|
+
background: linear-gradient(135deg, #F04A28 0%, #E8421F 100%);
|
|
75
|
+
border-radius: 24px 0 0 24px;
|
|
76
|
+
overflow: hidden;
|
|
77
|
+
flex-shrink: 0;
|
|
78
|
+
|
|
79
|
+
/* 品牌内容区 */
|
|
80
|
+
&__content {
|
|
81
|
+
display: flex;
|
|
82
|
+
flex-direction: column;
|
|
83
|
+
align-items: center;
|
|
84
|
+
justify-content: center;
|
|
85
|
+
padding: 40px;
|
|
86
|
+
text-align: center;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* Logo/媒体 容器 */
|
|
90
|
+
&__logo-wrapper {
|
|
91
|
+
display: flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
justify-content: center;
|
|
94
|
+
max-width: 320px;
|
|
95
|
+
|
|
96
|
+
/* 视频在品牌面板中的样式 */
|
|
97
|
+
video {
|
|
98
|
+
max-width: 100%;
|
|
99
|
+
max-height: 240px;
|
|
100
|
+
border-radius: 8px;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/* Logo 图片 */
|
|
105
|
+
&__logo {
|
|
106
|
+
max-width: 100%;
|
|
107
|
+
max-height: 120px;
|
|
108
|
+
object-fit: contain;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* 品牌标语 */
|
|
112
|
+
&__slogan {
|
|
113
|
+
margin-top: 16px;
|
|
114
|
+
font-size: 18px;
|
|
115
|
+
font-weight: 400;
|
|
116
|
+
color: rgba(255, 255, 255, 0.9);
|
|
117
|
+
letter-spacing: 0.5px;
|
|
118
|
+
line-height: 1.5;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/* 轮播控件(预留) */
|
|
122
|
+
&__carousel-controls {
|
|
123
|
+
display: flex;
|
|
124
|
+
align-items: center;
|
|
125
|
+
justify-content: center;
|
|
126
|
+
margin-top: 20px;
|
|
127
|
+
gap: 8px;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* 响应式适配 */
|
|
132
|
+
@media screen and (max-width: 768px) {
|
|
133
|
+
.webpos-login-brand-panel {
|
|
134
|
+
display: none;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* 全屏模式在移动端仍然显示 */
|
|
138
|
+
.media-display--fullscreen {
|
|
139
|
+
display: flex;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/**
|
|
3
|
+
* 媒体轮播项
|
|
4
|
+
* @description 媒体展示区的轮播内容配置
|
|
5
|
+
*/
|
|
6
|
+
export interface CarouselItem {
|
|
7
|
+
/** 内容类型:图片或视频 */
|
|
8
|
+
type: 'image' | 'video' | 'logo';
|
|
9
|
+
/** 资源URL */
|
|
10
|
+
url: string;
|
|
11
|
+
/** 背景颜色 */
|
|
12
|
+
backgroundColor?: string;
|
|
13
|
+
/** logo样式 */
|
|
14
|
+
logoStyle?: React.CSSProperties;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 媒体配置
|
|
18
|
+
* @description 媒体展示区域的配置
|
|
19
|
+
*/
|
|
20
|
+
export interface MediaConfig {
|
|
21
|
+
/** 轮播内容列表(图片/视频) */
|
|
22
|
+
carouselItems?: CarouselItem[];
|
|
23
|
+
/** 默认Logo(当无轮播时显示) */
|
|
24
|
+
logo?: string;
|
|
25
|
+
/** 品牌标语 */
|
|
26
|
+
slogan?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* 视频播放状态
|
|
30
|
+
*/
|
|
31
|
+
export declare type VideoPlayState = 'idle' | 'playing' | 'paused' | 'ended' | 'error';
|
|
32
|
+
/**
|
|
33
|
+
* MediaDisplay 媒体展示组件 Props
|
|
34
|
+
*/
|
|
35
|
+
export interface MediaDisplayProps {
|
|
36
|
+
/** 品牌配置 */
|
|
37
|
+
config?: MediaConfig;
|
|
38
|
+
/** 自定义类名 */
|
|
39
|
+
className?: string;
|
|
40
|
+
/** 是否全屏模式 */
|
|
41
|
+
fullscreen?: boolean;
|
|
42
|
+
/** 视频是否静音,默认 true */
|
|
43
|
+
muted?: boolean;
|
|
44
|
+
/** 视频是否循环播放,默认 false */
|
|
45
|
+
loop?: boolean;
|
|
46
|
+
/** 视频播放结束回调 */
|
|
47
|
+
onVideoEnded?: () => void;
|
|
48
|
+
/** 视频播放状态变化回调 */
|
|
49
|
+
onVideoStateChange?: (state: VideoPlayState) => void;
|
|
50
|
+
/** 是否可以关闭(用于控制视频结束后是否允许关闭) */
|
|
51
|
+
canClose?: boolean;
|
|
52
|
+
/** 关闭回调(视频结束且 canClose 为 true 时触发) */
|
|
53
|
+
onClose?: () => void;
|
|
54
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
|
|
15
|
+
// src/plus/webPosLogin/components/MediaDisplay/type.ts
|
|
16
|
+
var type_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(type_exports);
|