@pisell/private-materials 6.7.2 → 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/booking/components/TabProduct/index.d.ts +0 -1
- package/es/components/booking/forms/table/index.d.ts +0 -1
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/materiels/holder/index.d.ts +0 -1
- package/es/components/checkout/components/SearchAndClientModule/index.d.ts +0 -1
- package/es/components/checkout/components/WalletPassModule/components/ConflictModal/index.d.ts +0 -1
- package/es/components/checkout/components/WalletPassModule/components/DiscountWallet/index.d.ts +0 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/store/index.d.ts +2 -2
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/es/components/pay/toB/components/Cache/index.d.ts +0 -1
- package/es/components/pay/toB/components/CardGroup/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
- package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
- package/es/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/es/components/schedules/calendar/calendarItem.d.ts +0 -1
- package/es/components/schedules/components/CurrentDay/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
- package/es/components/schedules/products/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Render/index.d.ts +0 -1
- package/es/plus/clinetSearch/Add/PhoneField/index.d.ts +0 -1
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA1/index.d.ts +0 -1
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA2/index.d.ts +0 -1
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA5/index.d.ts +0 -1
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA9/index.d.ts +0 -1
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardCustom/index.d.ts +0 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Action/index.d.ts +0 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Favorite/index.d.ts +0 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Promotions/index.d.ts +0 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Tags/index.d.ts +0 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/TooltipTags/index.d.ts +0 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/WarningLists/index.d.ts +0 -1
- package/es/plus/productSelect/ProductCard/SkuCard/index.d.ts +0 -1
- package/es/plus/webPosLogin/WebPosLogin.js +11 -15
- package/es/plus/webPosLogin/WebPosLoginCpt.js +1 -1
- package/es/plus/webPosLogin/WebPosLoginCpt.less +0 -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/Login2.0/Login2.js +9 -3
- package/es/pro/Login2.0/index.less +0 -12
- package/es/pro/priceKeyboard/hooks/rightItems.d.ts +0 -1
- package/lib/components/booking/components/TabProduct/index.d.ts +0 -1
- package/lib/components/booking/forms/table/index.d.ts +0 -1
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/materiels/holder/index.d.ts +0 -1
- package/lib/components/checkout/components/SearchAndClientModule/index.d.ts +0 -1
- package/lib/components/checkout/components/WalletPassModule/components/ConflictModal/index.d.ts +0 -1
- package/lib/components/checkout/components/WalletPassModule/components/DiscountWallet/index.d.ts +0 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/store/index.d.ts +2 -2
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/lib/components/pay/toB/components/Cache/index.d.ts +0 -1
- package/lib/components/pay/toB/components/CardGroup/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
- package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
- package/lib/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/lib/components/schedules/calendar/calendarItem.d.ts +0 -1
- package/lib/components/schedules/components/CurrentDay/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
- package/lib/components/schedules/products/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Render/index.d.ts +0 -1
- package/lib/plus/clinetSearch/Add/PhoneField/index.d.ts +0 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA1/index.d.ts +0 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA2/index.d.ts +0 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA5/index.d.ts +0 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA9/index.d.ts +0 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardCustom/index.d.ts +0 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Action/index.d.ts +0 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Favorite/index.d.ts +0 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Promotions/index.d.ts +0 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Tags/index.d.ts +0 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/TooltipTags/index.d.ts +0 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/WarningLists/index.d.ts +0 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/index.d.ts +0 -1
- package/lib/plus/webPosLogin/WebPosLogin.js +22 -29
- package/lib/plus/webPosLogin/WebPosLoginCpt.js +1 -1
- package/lib/plus/webPosLogin/WebPosLoginCpt.less +0 -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/Login2.0/Login2.js +19 -9
- package/lib/pro/Login2.0/index.less +0 -12
- package/lib/pro/priceKeyboard/hooks/rightItems.d.ts +0 -1
- package/package.json +2 -2
|
@@ -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
|
-
const { getApp = () => ({}) } = (_a = context.appHelper) == null ? void 0 : _a.utils;
|
|
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);
|
|
@@ -178,7 +179,7 @@ var WebPosLogin = (props) => {
|
|
|
178
179
|
}
|
|
179
180
|
};
|
|
180
181
|
const getDeviceListFunction = async () => {
|
|
181
|
-
var _a2, _b2
|
|
182
|
+
var _a2, _b2;
|
|
182
183
|
const app = getApp();
|
|
183
184
|
const type = "terminal";
|
|
184
185
|
const res = await (0, import_service.getDeviceList)({
|
|
@@ -199,8 +200,8 @@ var WebPosLogin = (props) => {
|
|
|
199
200
|
});
|
|
200
201
|
} else {
|
|
201
202
|
app.storage.setStorage("isLogin", true);
|
|
202
|
-
|
|
203
|
-
(
|
|
203
|
+
reloadAfterLogin == null ? void 0 : reloadAfterLogin();
|
|
204
|
+
(_b2 = app == null ? void 0 : app.logger) == null ? void 0 : _b2.addLog({
|
|
204
205
|
type: "info",
|
|
205
206
|
title: "选择店铺页-获取设备列表成功-没有云端设备",
|
|
206
207
|
metadata: res || {}
|
|
@@ -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 || {}
|
|
@@ -279,17 +280,14 @@ var WebPosLogin = (props) => {
|
|
|
279
280
|
}
|
|
280
281
|
app.storage.setStorage("loginStatus", "success");
|
|
281
282
|
app.storage.setStorage("isLogin", true);
|
|
282
|
-
|
|
283
|
-
var _a3;
|
|
284
|
-
(_a3 = app == null ? void 0 : app.history) == null ? void 0 : _a3.reloadTo("/");
|
|
285
|
-
}, 500);
|
|
283
|
+
reloadAfterLogin == null ? void 0 : reloadAfterLogin();
|
|
286
284
|
app == null ? void 0 : app.storage.setStorage("boundCloudDevice", JSON.stringify(res || {}));
|
|
287
285
|
app.pubsub.publish("dataManager", {
|
|
288
286
|
type: "get",
|
|
289
287
|
key: "DEVICE_NUMBER",
|
|
290
288
|
metadata: { msg: "webpo主动推送" }
|
|
291
289
|
});
|
|
292
|
-
(
|
|
290
|
+
(_e2 = app == null ? void 0 : app.logger) == null ? void 0 : _e2.addLog({
|
|
293
291
|
type: "info",
|
|
294
292
|
title: "选择设备页-绑定设备成功",
|
|
295
293
|
metadata: res || {}
|
|
@@ -305,13 +303,8 @@ var WebPosLogin = (props) => {
|
|
|
305
303
|
import_WebPosLoginCpt.default,
|
|
306
304
|
{
|
|
307
305
|
loginConfig: config,
|
|
308
|
-
backgroundImage,
|
|
309
|
-
brandConfig:
|
|
310
|
-
carouselItems: [{
|
|
311
|
-
type: "image",
|
|
312
|
-
url: "https://static.pisellcdn.com/defaultLogo.png"
|
|
313
|
-
}]
|
|
314
|
-
},
|
|
306
|
+
backgroundImage: backgroundImage || ((_d = (_c = mediaConfig.loginBgMediaConfig) == null ? void 0 : _c[0]) == null ? void 0 : _d.url),
|
|
307
|
+
brandConfig: mediaConfig.loginMediaConfig,
|
|
315
308
|
step,
|
|
316
309
|
showBackButton: isShowGoBack,
|
|
317
310
|
storeList,
|
|
@@ -320,7 +313,7 @@ var WebPosLogin = (props) => {
|
|
|
320
313
|
selectedStore,
|
|
321
314
|
lastUsedStoreId,
|
|
322
315
|
lastUsedDeviceId,
|
|
323
|
-
locale: ((
|
|
316
|
+
locale: ((_f = (_e = context == null ? void 0 : context.engine) == null ? void 0 : _e.props) == null ? void 0 : _f.locale) || "en",
|
|
324
317
|
loading: false,
|
|
325
318
|
onStoreSelect: handleStoreSelect,
|
|
326
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
|
+
}
|