pb-sxp-ui 1.0.59 → 1.0.60
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/dist/index.cjs +11 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +3 -3
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +3 -3
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +11 -1
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/materials/sxp/popup/Prompt/index.d.ts +1 -0
- package/es/materials/sxp/popup/Prompt/index.js +13 -1
- package/lib/materials/sxp/popup/Prompt/index.d.ts +1 -0
- package/lib/materials/sxp/popup/Prompt/index.js +13 -1
- package/package.json +1 -1
@@ -4,10 +4,22 @@ import React, { memo } from 'react';
|
|
4
4
|
import success from './success.png';
|
5
5
|
import { getMediaValueByMode } from '../../../../core/utils/materials';
|
6
6
|
import './index.less';
|
7
|
+
import { useSxpDataSource } from '../../../../core/hooks';
|
8
|
+
import { useEventReport } from '../../../../core/hooks/useEventReport';
|
7
9
|
const Prompt = (_a) => {
|
8
|
-
var { content, btnText, style, icon, isPopup, onClose, onClick } = _a, props = __rest(_a, ["content", "btnText", "style", "icon", "isPopup", "onClose", "onClick"]);
|
10
|
+
var { content, btnText, style, icon, isPopup, isExternalLink, onClose, onClick } = _a, props = __rest(_a, ["content", "btnText", "style", "icon", "isPopup", "isExternalLink", "onClose", "onClick"]);
|
11
|
+
const { popupDetailData } = useSxpDataSource();
|
12
|
+
const { jumpToWeb } = useEventReport();
|
9
13
|
const iconSrc = typeof icon === 'string' ? icon : getMediaValueByMode(icon);
|
10
14
|
const handleOk = () => {
|
15
|
+
var _a, _b, _c;
|
16
|
+
if (isExternalLink) {
|
17
|
+
const data = popupDetailData;
|
18
|
+
const product = (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProduct;
|
19
|
+
const cta = (_c = (_b = data === null || data === void 0 ? void 0 : data.video) === null || _b === void 0 ? void 0 : _b.bindProduct) === null || _c === void 0 ? void 0 : _c.bindCta;
|
20
|
+
const position = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
21
|
+
jumpToWeb(data, product, cta, position);
|
22
|
+
}
|
11
23
|
if (!isPopup) {
|
12
24
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
13
25
|
}
|
@@ -6,10 +6,22 @@ const react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
const success_png_1 = tslib_1.__importDefault(require("./success.png"));
|
7
7
|
const materials_1 = require("../../../../core/utils/materials");
|
8
8
|
require("./index.less");
|
9
|
+
const hooks_1 = require("../../../../core/hooks");
|
10
|
+
const useEventReport_1 = require("../../../../core/hooks/useEventReport");
|
9
11
|
const Prompt = (_a) => {
|
10
|
-
var { content, btnText, style, icon, isPopup, onClose, onClick } = _a, props = tslib_1.__rest(_a, ["content", "btnText", "style", "icon", "isPopup", "onClose", "onClick"]);
|
12
|
+
var { content, btnText, style, icon, isPopup, isExternalLink, onClose, onClick } = _a, props = tslib_1.__rest(_a, ["content", "btnText", "style", "icon", "isPopup", "isExternalLink", "onClose", "onClick"]);
|
13
|
+
const { popupDetailData } = (0, hooks_1.useSxpDataSource)();
|
14
|
+
const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
|
11
15
|
const iconSrc = typeof icon === 'string' ? icon : (0, materials_1.getMediaValueByMode)(icon);
|
12
16
|
const handleOk = () => {
|
17
|
+
var _a, _b, _c;
|
18
|
+
if (isExternalLink) {
|
19
|
+
const data = popupDetailData;
|
20
|
+
const product = (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProduct;
|
21
|
+
const cta = (_c = (_b = data === null || data === void 0 ? void 0 : data.video) === null || _b === void 0 ? void 0 : _b.bindProduct) === null || _c === void 0 ? void 0 : _c.bindCta;
|
22
|
+
const position = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
23
|
+
jumpToWeb(data, product, cta, position);
|
24
|
+
}
|
13
25
|
if (!isPopup) {
|
14
26
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
15
27
|
}
|