pb-sxp-ui 1.15.6 → 1.15.8
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 +35 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +35 -13
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +4 -4
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +4 -4
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +35 -13
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +4 -4
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/index.d.ts +3 -3
- package/es/core/components/SxpPageRender/index.js +4 -4
- package/es/core/utils/localStore.d.ts +3 -0
- package/es/core/utils/localStore.js +8 -0
- package/es/materials/sxp/consentPopup/Click/index.d.ts +5 -1
- package/es/materials/sxp/consentPopup/Click/index.js +5 -2
- package/es/materials/sxp/consentPopup/Swipe/index.d.ts +5 -1
- package/es/materials/sxp/consentPopup/Swipe/index.js +5 -2
- package/es/materials/sxp/popup/ConsentDetail/index.d.ts +5 -1
- package/es/materials/sxp/popup/ConsentDetail/index.js +2 -1
- package/lib/core/components/SxpPageRender/index.d.ts +3 -3
- package/lib/core/components/SxpPageRender/index.js +3 -3
- package/lib/core/utils/localStore.d.ts +3 -0
- package/lib/core/utils/localStore.js +11 -1
- package/lib/materials/sxp/consentPopup/Click/index.d.ts +5 -1
- package/lib/materials/sxp/consentPopup/Click/index.js +5 -2
- package/lib/materials/sxp/consentPopup/Swipe/index.d.ts +5 -1
- package/lib/materials/sxp/consentPopup/Swipe/index.js +5 -2
- package/lib/materials/sxp/popup/ConsentDetail/index.d.ts +5 -1
- package/lib/materials/sxp/popup/ConsentDetail/index.js +2 -1
- package/package.json +1 -1
@@ -1,4 +1,4 @@
|
|
1
|
-
import { CSSProperties
|
1
|
+
import React, { CSSProperties } from 'react';
|
2
2
|
import { RecItemType } from './typing';
|
3
3
|
import './index.less';
|
4
4
|
export type postConfigType = {
|
@@ -112,5 +112,5 @@ export interface ISxpPageRenderProps {
|
|
112
112
|
hashTagRightMargin: number;
|
113
113
|
defaultData?: any;
|
114
114
|
}
|
115
|
-
declare const
|
116
|
-
export default
|
115
|
+
declare const _default: React.NamedExoticComponent<ISxpPageRenderProps>;
|
116
|
+
export default _default;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React, { useMemo, useEffect, useState, useRef, useCallback } from 'react';
|
1
|
+
import React, { useMemo, useEffect, useState, useRef, useCallback, memo } from 'react';
|
2
2
|
import { Swiper, SwiperSlide } from 'swiper/react';
|
3
3
|
import ExpandableText from './ExpandableText';
|
4
4
|
import LikeButton from './LikeButton';
|
@@ -554,8 +554,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
554
554
|
isReload,
|
555
555
|
renderToggleButton
|
556
556
|
]);
|
557
|
-
return (React.createElement(
|
558
|
-
React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement("div", {
|
557
|
+
return (React.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container' }, (data === null || data === void 0 ? void 0 : data.length) < 1 && loading ? (React.createElement("div", { style: { height, width: containerWidth, display: 'flex', justifyContent: 'center', alignItems: 'center' } },
|
558
|
+
React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement("div", { style: Object.assign({}, ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset) && { textUnderlineOffset: `${globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset}px` })) },
|
559
559
|
waterFallData && (React.createElement(Navbar, { icon: left, styles: { background: 'rgba(0,0,0,.3)', color: '#fff', top: `${minusHeight}px` }, textStyle: Object.assign(Object.assign({}, (_e = (_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.textStyles) === null || _e === void 0 ? void 0 : _e.hashTagTitle), { color: '#fff' }), onClose: () => {
|
560
560
|
const isEq = isEqual(rtcList, cacheRtcList);
|
561
561
|
if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
|
@@ -616,4 +616,4 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
616
616
|
React.createElement(ConsentPopup, { resolver: resolver, globalConfig: globalConfig }),
|
617
617
|
openMultiPosts && (React.createElement(MultiPosts, Object.assign({}, (_x = (_w = (_v = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _v === void 0 ? void 0 : _v[0]) === null || _w === void 0 ? void 0 : _w.item) === null || _x === void 0 ? void 0 : _x.props, (_0 = (_z = (_y = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _y === void 0 ? void 0 : _y[0]) === null || _z === void 0 ? void 0 : _z.item) === null || _0 === void 0 ? void 0 : _0.event, { style: { position: 'fixed', top: 0, left: 0, right: 0 } })))))));
|
618
618
|
};
|
619
|
-
export default SxpPageRender;
|
619
|
+
export default memo(SxpPageRender);
|
@@ -3,9 +3,12 @@ export declare const FAKE_USER_STATE = "FAKE_USER_STATE";
|
|
3
3
|
export declare const AGREE_POLICY = "AGREE_POLICY";
|
4
4
|
export declare const SLIDE_SKIP_STATE = "SLIDE_SKIP_STATE";
|
5
5
|
export declare const CCONTSENT_STATE = "CCONTSENT_STATE";
|
6
|
+
export declare const USER_CONSENT_RESULT_KEY = "USER_CONSENT_RESULT";
|
6
7
|
export declare const storeAndLoadFeUserId: () => string;
|
7
8
|
export declare const removeFeUserId: () => void;
|
8
9
|
export declare const getFeUserState: () => boolean;
|
9
10
|
export declare const getSlideSkipState: () => boolean;
|
10
11
|
export declare const setSlideSkipState: () => void;
|
11
12
|
export declare const getContsentState: () => boolean;
|
13
|
+
export declare const getUserConsentResult: () => boolean;
|
14
|
+
export declare const setUserConsentResult: () => void;
|
@@ -5,6 +5,7 @@ export const FAKE_USER_STATE = 'FAKE_USER_STATE';
|
|
5
5
|
export const AGREE_POLICY = 'AGREE_POLICY';
|
6
6
|
export const SLIDE_SKIP_STATE = 'SLIDE_SKIP_STATE';
|
7
7
|
export const CCONTSENT_STATE = 'CCONTSENT_STATE';
|
8
|
+
export const USER_CONSENT_RESULT_KEY = 'USER_CONSENT_RESULT';
|
8
9
|
export const storeAndLoadFeUserId = () => {
|
9
10
|
let fakeUserId = window.localStorage.getItem(FAKE_USER_KEY);
|
10
11
|
if (isEmpty(fakeUserId)) {
|
@@ -37,3 +38,10 @@ export const getContsentState = () => {
|
|
37
38
|
}
|
38
39
|
return isEmpty(contsentState);
|
39
40
|
};
|
41
|
+
export const getUserConsentResult = () => {
|
42
|
+
const contsentState = window.localStorage.getItem(USER_CONSENT_RESULT_KEY);
|
43
|
+
return contsentState === 'true';
|
44
|
+
};
|
45
|
+
export const setUserConsentResult = () => {
|
46
|
+
window.localStorage.setItem(USER_CONSENT_RESULT_KEY, 'true');
|
47
|
+
};
|
@@ -1,8 +1,12 @@
|
|
1
1
|
import React, { CSSProperties } from 'react';
|
2
2
|
import './index.less';
|
3
|
+
interface richText {
|
4
|
+
html: any;
|
5
|
+
raw: any;
|
6
|
+
}
|
3
7
|
export interface IClickProps {
|
4
8
|
open?: boolean;
|
5
|
-
content?:
|
9
|
+
content?: richText | any;
|
6
10
|
style?: Record<string, any>;
|
7
11
|
isTel?: boolean;
|
8
12
|
acceptButton?: {
|
@@ -5,6 +5,7 @@ import ConsentDetail from '../../popup/ConsentDetail';
|
|
5
5
|
import tel from './tel.png';
|
6
6
|
import { setFontForText } from '../../../../core/utils/tool';
|
7
7
|
import { useSxpDataSource } from '../../../../core/hooks';
|
8
|
+
import { getUserConsentResult, setUserConsentResult } from '../../../../core/utils/localStore';
|
8
9
|
const Click = (_a) => {
|
9
10
|
var { isTel, open, content, style, consentPopupCate, acceptButton, rejectButton, showRejectButton } = _a, props = __rest(_a, ["isTel", "open", "content", "style", "consentPopupCate", "acceptButton", "rejectButton", "showRejectButton"]);
|
10
11
|
const { getAccount, accountSonsent } = useSxpDataSource();
|
@@ -17,12 +18,14 @@ const Click = (_a) => {
|
|
17
18
|
return consentPopupCate || (open && style && !consentResult);
|
18
19
|
}, [consentPopupCate, open, style, consentResult]);
|
19
20
|
useEffect(() => {
|
20
|
-
!consentPopupCate && open && style && handleGetAccount();
|
21
|
+
!consentPopupCate && open && style && !getUserConsentResult() && handleGetAccount();
|
21
22
|
}, []);
|
22
23
|
const handleClickAccept = () => __awaiter(void 0, void 0, void 0, function* () {
|
23
24
|
const res = yield (accountSonsent === null || accountSonsent === void 0 ? void 0 : accountSonsent(true));
|
24
|
-
if (res)
|
25
|
+
if (res) {
|
25
26
|
setConsentResult(true);
|
27
|
+
setUserConsentResult();
|
28
|
+
}
|
26
29
|
});
|
27
30
|
const handleClickReject = () => {
|
28
31
|
history === null || history === void 0 ? void 0 : history.back();
|
@@ -1,8 +1,12 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import './index.less';
|
3
|
+
interface richText {
|
4
|
+
html: any;
|
5
|
+
raw: any;
|
6
|
+
}
|
3
7
|
export interface ISwipeProps {
|
4
8
|
open?: boolean;
|
5
|
-
content?:
|
9
|
+
content?: richText | any;
|
6
10
|
style?: Record<string, any>;
|
7
11
|
isTel?: boolean;
|
8
12
|
consentPopupCate?: string;
|
@@ -4,6 +4,7 @@ import './index.less';
|
|
4
4
|
import ConsentDetail from '../../popup/ConsentDetail';
|
5
5
|
import tel from './tel.png';
|
6
6
|
import { useSxpDataSource } from '../../../../core/hooks';
|
7
|
+
import { getUserConsentResult, setUserConsentResult } from '../../../../core/utils/localStore';
|
7
8
|
const Swipe = (_a) => {
|
8
9
|
var { isTel, open, content, style, consentPopupCate, swipeIcon } = _a, props = __rest(_a, ["isTel", "open", "content", "style", "consentPopupCate", "swipeIcon"]);
|
9
10
|
const touchInfo = useRef();
|
@@ -18,12 +19,14 @@ const Swipe = (_a) => {
|
|
18
19
|
return consentPopupCate || (open && style && !consentResult);
|
19
20
|
}, [consentPopupCate, open, style, consentResult]);
|
20
21
|
useEffect(() => {
|
21
|
-
!consentPopupCate && open && style && handleGetAccount();
|
22
|
+
!consentPopupCate && open && style && !getUserConsentResult() && handleGetAccount();
|
22
23
|
}, []);
|
23
24
|
const handleClickAccept = () => __awaiter(void 0, void 0, void 0, function* () {
|
24
25
|
const res = yield (accountSonsent === null || accountSonsent === void 0 ? void 0 : accountSonsent(true));
|
25
|
-
if (res)
|
26
|
+
if (res) {
|
26
27
|
setConsentResult(true);
|
28
|
+
setUserConsentResult();
|
29
|
+
}
|
27
30
|
});
|
28
31
|
const handleTouchStart = (event) => {
|
29
32
|
const touch = event.touches[0];
|
@@ -1,7 +1,11 @@
|
|
1
1
|
import React, { CSSProperties } from 'react';
|
2
2
|
import './index.less';
|
3
|
+
interface richText {
|
4
|
+
html: any;
|
5
|
+
raw: any;
|
6
|
+
}
|
3
7
|
export interface IConsentDetailProps {
|
4
|
-
content?:
|
8
|
+
content?: richText | any;
|
5
9
|
isTel?: boolean;
|
6
10
|
style?: CSSProperties;
|
7
11
|
}
|
@@ -2,9 +2,10 @@ import { __rest } from "tslib";
|
|
2
2
|
import React, { memo } from 'react';
|
3
3
|
import './index.less';
|
4
4
|
const ConsentDetail = (_a) => {
|
5
|
+
var _b;
|
5
6
|
var { content, isTel, style } = _a, props = __rest(_a, ["content", "isTel", "style"]);
|
6
7
|
return (React.createElement("article", { className: 'consentDetail-article', dangerouslySetInnerHTML: {
|
7
|
-
__html:
|
8
|
+
__html: (_b = content === null || content === void 0 ? void 0 : content.html) !== null && _b !== void 0 ? _b : content
|
8
9
|
}, onClick: (e) => {
|
9
10
|
e.stopPropagation();
|
10
11
|
}, style: style }));
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { CSSProperties
|
1
|
+
import React, { CSSProperties } from 'react';
|
2
2
|
import { RecItemType } from './typing';
|
3
3
|
import './index.less';
|
4
4
|
export type postConfigType = {
|
@@ -112,5 +112,5 @@ export interface ISxpPageRenderProps {
|
|
112
112
|
hashTagRightMargin: number;
|
113
113
|
defaultData?: any;
|
114
114
|
}
|
115
|
-
declare const
|
116
|
-
export default
|
115
|
+
declare const _default: React.NamedExoticComponent<ISxpPageRenderProps>;
|
116
|
+
export default _default;
|
@@ -557,8 +557,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
557
557
|
isReload,
|
558
558
|
renderToggleButton
|
559
559
|
]);
|
560
|
-
return (react_1.default.createElement(
|
561
|
-
react_1.default.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (react_1.default.createElement("div", {
|
560
|
+
return (react_1.default.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container' }, (data === null || data === void 0 ? void 0 : data.length) < 1 && loading ? (react_1.default.createElement("div", { style: { height, width: containerWidth, display: 'flex', justifyContent: 'center', alignItems: 'center' } },
|
561
|
+
react_1.default.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (react_1.default.createElement("div", { style: Object.assign({}, ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset) && { textUnderlineOffset: `${globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset}px` })) },
|
562
562
|
waterFallData && (react_1.default.createElement(Navbar_1.default, { icon: left_png_1.default, styles: { background: 'rgba(0,0,0,.3)', color: '#fff', top: `${minusHeight}px` }, textStyle: Object.assign(Object.assign({}, (_e = (_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.textStyles) === null || _e === void 0 ? void 0 : _e.hashTagTitle), { color: '#fff' }), onClose: () => {
|
563
563
|
const isEq = (0, lodash_1.isEqual)(rtcList, cacheRtcList);
|
564
564
|
if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
|
@@ -619,4 +619,4 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
619
619
|
react_1.default.createElement(ConsentPopup_1.default, { resolver: resolver, globalConfig: globalConfig }),
|
620
620
|
openMultiPosts && (react_1.default.createElement(MultiPosts_1.default, Object.assign({}, (_x = (_w = (_v = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _v === void 0 ? void 0 : _v[0]) === null || _w === void 0 ? void 0 : _w.item) === null || _x === void 0 ? void 0 : _x.props, (_0 = (_z = (_y = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _y === void 0 ? void 0 : _y[0]) === null || _z === void 0 ? void 0 : _z.item) === null || _0 === void 0 ? void 0 : _0.event, { style: { position: 'fixed', top: 0, left: 0, right: 0 } })))))));
|
621
621
|
};
|
622
|
-
exports.default = SxpPageRender;
|
622
|
+
exports.default = (0, react_1.memo)(SxpPageRender);
|
@@ -3,9 +3,12 @@ export declare const FAKE_USER_STATE = "FAKE_USER_STATE";
|
|
3
3
|
export declare const AGREE_POLICY = "AGREE_POLICY";
|
4
4
|
export declare const SLIDE_SKIP_STATE = "SLIDE_SKIP_STATE";
|
5
5
|
export declare const CCONTSENT_STATE = "CCONTSENT_STATE";
|
6
|
+
export declare const USER_CONSENT_RESULT_KEY = "USER_CONSENT_RESULT";
|
6
7
|
export declare const storeAndLoadFeUserId: () => string;
|
7
8
|
export declare const removeFeUserId: () => void;
|
8
9
|
export declare const getFeUserState: () => boolean;
|
9
10
|
export declare const getSlideSkipState: () => boolean;
|
10
11
|
export declare const setSlideSkipState: () => void;
|
11
12
|
export declare const getContsentState: () => boolean;
|
13
|
+
export declare const getUserConsentResult: () => boolean;
|
14
|
+
export declare const setUserConsentResult: () => void;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.getContsentState = exports.setSlideSkipState = exports.getSlideSkipState = exports.getFeUserState = exports.removeFeUserId = exports.storeAndLoadFeUserId = exports.CCONTSENT_STATE = exports.SLIDE_SKIP_STATE = exports.AGREE_POLICY = exports.FAKE_USER_STATE = exports.FAKE_USER_KEY = void 0;
|
3
|
+
exports.setUserConsentResult = exports.getUserConsentResult = exports.getContsentState = exports.setSlideSkipState = exports.getSlideSkipState = exports.getFeUserState = exports.removeFeUserId = exports.storeAndLoadFeUserId = exports.USER_CONSENT_RESULT_KEY = exports.CCONTSENT_STATE = exports.SLIDE_SKIP_STATE = exports.AGREE_POLICY = exports.FAKE_USER_STATE = exports.FAKE_USER_KEY = void 0;
|
4
4
|
const lodash_1 = require("lodash");
|
5
5
|
const tool_1 = require("./tool");
|
6
6
|
exports.FAKE_USER_KEY = 'SXP_FAKE_USER_ID';
|
@@ -8,6 +8,7 @@ exports.FAKE_USER_STATE = 'FAKE_USER_STATE';
|
|
8
8
|
exports.AGREE_POLICY = 'AGREE_POLICY';
|
9
9
|
exports.SLIDE_SKIP_STATE = 'SLIDE_SKIP_STATE';
|
10
10
|
exports.CCONTSENT_STATE = 'CCONTSENT_STATE';
|
11
|
+
exports.USER_CONSENT_RESULT_KEY = 'USER_CONSENT_RESULT';
|
11
12
|
const storeAndLoadFeUserId = () => {
|
12
13
|
let fakeUserId = window.localStorage.getItem(exports.FAKE_USER_KEY);
|
13
14
|
if ((0, lodash_1.isEmpty)(fakeUserId)) {
|
@@ -46,3 +47,12 @@ const getContsentState = () => {
|
|
46
47
|
return (0, lodash_1.isEmpty)(contsentState);
|
47
48
|
};
|
48
49
|
exports.getContsentState = getContsentState;
|
50
|
+
const getUserConsentResult = () => {
|
51
|
+
const contsentState = window.localStorage.getItem(exports.USER_CONSENT_RESULT_KEY);
|
52
|
+
return contsentState === 'true';
|
53
|
+
};
|
54
|
+
exports.getUserConsentResult = getUserConsentResult;
|
55
|
+
const setUserConsentResult = () => {
|
56
|
+
window.localStorage.setItem(exports.USER_CONSENT_RESULT_KEY, 'true');
|
57
|
+
};
|
58
|
+
exports.setUserConsentResult = setUserConsentResult;
|
@@ -1,8 +1,12 @@
|
|
1
1
|
import React, { CSSProperties } from 'react';
|
2
2
|
import './index.less';
|
3
|
+
interface richText {
|
4
|
+
html: any;
|
5
|
+
raw: any;
|
6
|
+
}
|
3
7
|
export interface IClickProps {
|
4
8
|
open?: boolean;
|
5
|
-
content?:
|
9
|
+
content?: richText | any;
|
6
10
|
style?: Record<string, any>;
|
7
11
|
isTel?: boolean;
|
8
12
|
acceptButton?: {
|
@@ -7,6 +7,7 @@ const ConsentDetail_1 = tslib_1.__importDefault(require("../../popup/ConsentDeta
|
|
7
7
|
const tel_png_1 = tslib_1.__importDefault(require("./tel.png"));
|
8
8
|
const tool_1 = require("../../../../core/utils/tool");
|
9
9
|
const hooks_1 = require("../../../../core/hooks");
|
10
|
+
const localStore_1 = require("../../../../core/utils/localStore");
|
10
11
|
const Click = (_a) => {
|
11
12
|
var { isTel, open, content, style, consentPopupCate, acceptButton, rejectButton, showRejectButton } = _a, props = tslib_1.__rest(_a, ["isTel", "open", "content", "style", "consentPopupCate", "acceptButton", "rejectButton", "showRejectButton"]);
|
12
13
|
const { getAccount, accountSonsent } = (0, hooks_1.useSxpDataSource)();
|
@@ -19,12 +20,14 @@ const Click = (_a) => {
|
|
19
20
|
return consentPopupCate || (open && style && !consentResult);
|
20
21
|
}, [consentPopupCate, open, style, consentResult]);
|
21
22
|
(0, react_1.useEffect)(() => {
|
22
|
-
!consentPopupCate && open && style && handleGetAccount();
|
23
|
+
!consentPopupCate && open && style && !(0, localStore_1.getUserConsentResult)() && handleGetAccount();
|
23
24
|
}, []);
|
24
25
|
const handleClickAccept = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
25
26
|
const res = yield (accountSonsent === null || accountSonsent === void 0 ? void 0 : accountSonsent(true));
|
26
|
-
if (res)
|
27
|
+
if (res) {
|
27
28
|
setConsentResult(true);
|
29
|
+
(0, localStore_1.setUserConsentResult)();
|
30
|
+
}
|
28
31
|
});
|
29
32
|
const handleClickReject = () => {
|
30
33
|
history === null || history === void 0 ? void 0 : history.back();
|
@@ -1,8 +1,12 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import './index.less';
|
3
|
+
interface richText {
|
4
|
+
html: any;
|
5
|
+
raw: any;
|
6
|
+
}
|
3
7
|
export interface ISwipeProps {
|
4
8
|
open?: boolean;
|
5
|
-
content?:
|
9
|
+
content?: richText | any;
|
6
10
|
style?: Record<string, any>;
|
7
11
|
isTel?: boolean;
|
8
12
|
consentPopupCate?: string;
|
@@ -6,6 +6,7 @@ require("./index.less");
|
|
6
6
|
const ConsentDetail_1 = tslib_1.__importDefault(require("../../popup/ConsentDetail"));
|
7
7
|
const tel_png_1 = tslib_1.__importDefault(require("./tel.png"));
|
8
8
|
const hooks_1 = require("../../../../core/hooks");
|
9
|
+
const localStore_1 = require("../../../../core/utils/localStore");
|
9
10
|
const Swipe = (_a) => {
|
10
11
|
var { isTel, open, content, style, consentPopupCate, swipeIcon } = _a, props = tslib_1.__rest(_a, ["isTel", "open", "content", "style", "consentPopupCate", "swipeIcon"]);
|
11
12
|
const touchInfo = (0, react_1.useRef)();
|
@@ -20,12 +21,14 @@ const Swipe = (_a) => {
|
|
20
21
|
return consentPopupCate || (open && style && !consentResult);
|
21
22
|
}, [consentPopupCate, open, style, consentResult]);
|
22
23
|
(0, react_1.useEffect)(() => {
|
23
|
-
!consentPopupCate && open && style && handleGetAccount();
|
24
|
+
!consentPopupCate && open && style && !(0, localStore_1.getUserConsentResult)() && handleGetAccount();
|
24
25
|
}, []);
|
25
26
|
const handleClickAccept = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
26
27
|
const res = yield (accountSonsent === null || accountSonsent === void 0 ? void 0 : accountSonsent(true));
|
27
|
-
if (res)
|
28
|
+
if (res) {
|
28
29
|
setConsentResult(true);
|
30
|
+
(0, localStore_1.setUserConsentResult)();
|
31
|
+
}
|
29
32
|
});
|
30
33
|
const handleTouchStart = (event) => {
|
31
34
|
const touch = event.touches[0];
|
@@ -1,7 +1,11 @@
|
|
1
1
|
import React, { CSSProperties } from 'react';
|
2
2
|
import './index.less';
|
3
|
+
interface richText {
|
4
|
+
html: any;
|
5
|
+
raw: any;
|
6
|
+
}
|
3
7
|
export interface IConsentDetailProps {
|
4
|
-
content?:
|
8
|
+
content?: richText | any;
|
5
9
|
isTel?: boolean;
|
6
10
|
style?: CSSProperties;
|
7
11
|
}
|
@@ -4,9 +4,10 @@ const tslib_1 = require("tslib");
|
|
4
4
|
const react_1 = tslib_1.__importStar(require("react"));
|
5
5
|
require("./index.less");
|
6
6
|
const ConsentDetail = (_a) => {
|
7
|
+
var _b;
|
7
8
|
var { content, isTel, style } = _a, props = tslib_1.__rest(_a, ["content", "isTel", "style"]);
|
8
9
|
return (react_1.default.createElement("article", { className: 'consentDetail-article', dangerouslySetInnerHTML: {
|
9
|
-
__html:
|
10
|
+
__html: (_b = content === null || content === void 0 ? void 0 : content.html) !== null && _b !== void 0 ? _b : content
|
10
11
|
}, onClick: (e) => {
|
11
12
|
e.stopPropagation();
|
12
13
|
}, style: style }));
|