pb-sxp-ui 1.15.7 → 1.15.9
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 +54 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +54 -16
- 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 +54 -16
- 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.js +2 -2
- package/es/core/context/SxpDataSourceProvider.js +19 -2
- package/es/core/utils/localStore.d.ts +3 -0
- package/es/core/utils/localStore.js +8 -0
- package/es/materials/sxp/consentPopup/Click/index.js +5 -2
- package/es/materials/sxp/consentPopup/Click/material.js +1 -1
- package/es/materials/sxp/consentPopup/Swipe/index.js +5 -2
- package/es/materials/sxp/consentPopup/Swipe/material.js +1 -1
- package/lib/core/components/SxpPageRender/index.js +2 -2
- package/lib/core/context/SxpDataSourceProvider.js +19 -2
- package/lib/core/utils/localStore.d.ts +3 -0
- package/lib/core/utils/localStore.js +11 -1
- package/lib/materials/sxp/consentPopup/Click/index.js +5 -2
- package/lib/materials/sxp/consentPopup/Click/material.js +1 -1
- package/lib/materials/sxp/consentPopup/Swipe/index.js +5 -2
- package/lib/materials/sxp/consentPopup/Swipe/material.js +1 -1
- package/package.json +1 -1
@@ -554,8 +554,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
554
554
|
isReload,
|
555
555
|
renderToggleButton
|
556
556
|
]);
|
557
|
-
return (React.createElement("div", { id: 'sxp-render' }, (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", {
|
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)) {
|
@@ -126,6 +126,23 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
126
126
|
.then((res) => res.json())
|
127
127
|
.catch((err) => Promise.reject(err));
|
128
128
|
}, [bffDataSource, fakeUserId]);
|
129
|
+
const bffFetchAdmin = useCallback((path, options) => {
|
130
|
+
if (!bffDataSource)
|
131
|
+
return;
|
132
|
+
const url = bffDataSource.url;
|
133
|
+
if (options === null || options === void 0 ? void 0 : options.query) {
|
134
|
+
const queryString = qs.stringify(options.query);
|
135
|
+
path = `${path}?${queryString}`;
|
136
|
+
}
|
137
|
+
return window
|
138
|
+
.fetch(`${url}/admin/${path}`, {
|
139
|
+
headers: Object.assign({ 'Content-Type': 'application/json' }, bffDataSource.headers),
|
140
|
+
method: options.method,
|
141
|
+
body: JSON.stringify(options.body)
|
142
|
+
})
|
143
|
+
.then((res) => res.json())
|
144
|
+
.catch((err) => Promise.reject(err));
|
145
|
+
}, [bffDataSource]);
|
129
146
|
const getRecommendVideos = useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
|
130
147
|
var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
131
148
|
query = Object.assign({ maxSize: (_f = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _f !== void 0 ? _f : maxSize, defaultSize: (_g = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _g !== void 0 ? _g : defaultSize, hashTag: query === null || query === void 0 ? void 0 : query.hashTag, traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo, themeTag: query === null || query === void 0 ? void 0 : query.themeTag, pageNum: query === null || query === void 0 ? void 0 : query.pageNum, contentFilter: query === null || query === void 0 ? void 0 : query.contentFilter, productFilter: query === null || query === void 0 ? void 0 : query.productFilter }, (chatlabsId && { chatlabsId }));
|
@@ -153,7 +170,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
153
170
|
const recurveRecList = (query) => __awaiter(void 0, void 0, void 0, function* () {
|
154
171
|
var _v, _w, _x, _y, _z, _0;
|
155
172
|
query.pageNum = pageNum;
|
156
|
-
result = yield (
|
173
|
+
result = yield (bffFetchAdmin === null || bffFetchAdmin === void 0 ? void 0 : bffFetchAdmin('recommend/direct_page', { method: 'POST', body: query }));
|
157
174
|
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
158
175
|
return undefined;
|
159
176
|
}
|
@@ -193,7 +210,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
193
210
|
return Object.assign(Object.assign({}, result.data), { recList: list });
|
194
211
|
}
|
195
212
|
return result === null || result === void 0 ? void 0 : result.data;
|
196
|
-
}), [bffFetch, utmVal, maxSize, defaultSize, channelQueryList, channel, chatlabsId]);
|
213
|
+
}), [bffFetch, utmVal, maxSize, defaultSize, channelQueryList, channel, chatlabsId, bffFetchAdmin]);
|
197
214
|
const loadVideos = useCallback((pageNum) => __awaiter(void 0, void 0, void 0, function* () {
|
198
215
|
var _1, _2, _3, _4;
|
199
216
|
if (rtcList.length <= 0) {
|
@@ -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
|
+
};
|
@@ -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();
|
@@ -12,7 +12,7 @@ const Click = createMaterial(ClickComponent, {
|
|
12
12
|
},
|
13
13
|
defaulSetting: {
|
14
14
|
props: {
|
15
|
-
content: '<p><strong><span style="font-size:14px"><span style="line-height:3">Your Cookie Preferences</span></span></strong></p><p>We use cookie, including third-party cookies, to ensure the proper functioning and security of this site, to analyse its use, and to show you personalised content. You can authorise the use of all cookies by clicking on "Accept all cookies". If you click on "Reject all cookies", we will only use cookies necessary for the proper functioning and security of this site. To personalise on adjust your preferences at any time, click on "Cookies Settings" below or at the bottom of any Fendi.com webpage. For more information, read our Cookie Policy.</p><p></p>',
|
15
|
+
content: '<p><strong><span style="font-size:14px"><span style="line-height:3">Your Cookie Preferences</span></span></strong></p><p><span style="font-size:13px"><span style="line-height:1.7">We use cookie, including third-party cookies, to ensure the proper functioning and security of this site, to analyse its use, and to show you personalised content. You can authorise the use of all cookies by clicking on "Accept all cookies". If you click on "Reject all cookies", we will only use cookies necessary for the proper functioning and security of this site. To personalise on adjust your preferences at any time, click on "Cookies Settings" below or at the bottom of any Fendi.com webpage. For more information, read our Cookie Policy.</span></span></p><p></p>',
|
16
16
|
acceptButton: {
|
17
17
|
text: 'Accept all cookies',
|
18
18
|
style: {
|
@@ -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];
|
@@ -12,7 +12,7 @@ const Swipe = createMaterial(SwipeComponent, {
|
|
12
12
|
},
|
13
13
|
defaulSetting: {
|
14
14
|
props: {
|
15
|
-
content: '<p><span style="font-
|
15
|
+
content: '<p><strong><span style="font-size:18px"><span style="line-height:1.7">Your Cookie Preferences</span></span></strong></p><p><span style="line-height:1.7"><span style="font-size:13px">We use cookie, including third-party cookies, to ensure the proper functioning and security of this site, to analyse its use, and to show you personalised content. You can authorise the use of all cookies by clicking on 'Accept all cookies'. If you click on 'Reject all cookies', we will only use cookies necessary for the proper functioning and security of this site. To personalise or adjust your preferences at any time, click on 'Cookies Settings' below or at the bottom of any Fendi.com webpage. For more information, <u>read our Cookie Policy</u>.</span></span></p>'
|
16
16
|
},
|
17
17
|
style: {
|
18
18
|
backgroundColor: '#fff',
|
@@ -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("div", { id: 'sxp-render' }, (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", {
|
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)) {
|
@@ -129,6 +129,23 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
129
129
|
.then((res) => res.json())
|
130
130
|
.catch((err) => Promise.reject(err));
|
131
131
|
}, [bffDataSource, fakeUserId]);
|
132
|
+
const bffFetchAdmin = (0, react_1.useCallback)((path, options) => {
|
133
|
+
if (!bffDataSource)
|
134
|
+
return;
|
135
|
+
const url = bffDataSource.url;
|
136
|
+
if (options === null || options === void 0 ? void 0 : options.query) {
|
137
|
+
const queryString = qs_1.default.stringify(options.query);
|
138
|
+
path = `${path}?${queryString}`;
|
139
|
+
}
|
140
|
+
return window
|
141
|
+
.fetch(`${url}/admin/${path}`, {
|
142
|
+
headers: Object.assign({ 'Content-Type': 'application/json' }, bffDataSource.headers),
|
143
|
+
method: options.method,
|
144
|
+
body: JSON.stringify(options.body)
|
145
|
+
})
|
146
|
+
.then((res) => res.json())
|
147
|
+
.catch((err) => Promise.reject(err));
|
148
|
+
}, [bffDataSource]);
|
132
149
|
const getRecommendVideos = (0, react_1.useCallback)((query) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
133
150
|
var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
134
151
|
query = Object.assign({ maxSize: (_f = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _f !== void 0 ? _f : maxSize, defaultSize: (_g = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _g !== void 0 ? _g : defaultSize, hashTag: query === null || query === void 0 ? void 0 : query.hashTag, traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo, themeTag: query === null || query === void 0 ? void 0 : query.themeTag, pageNum: query === null || query === void 0 ? void 0 : query.pageNum, contentFilter: query === null || query === void 0 ? void 0 : query.contentFilter, productFilter: query === null || query === void 0 ? void 0 : query.productFilter }, (chatlabsId && { chatlabsId }));
|
@@ -156,7 +173,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
156
173
|
const recurveRecList = (query) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
157
174
|
var _v, _w, _x, _y, _z, _0;
|
158
175
|
query.pageNum = pageNum;
|
159
|
-
result = yield (
|
176
|
+
result = yield (bffFetchAdmin === null || bffFetchAdmin === void 0 ? void 0 : bffFetchAdmin('recommend/direct_page', { method: 'POST', body: query }));
|
160
177
|
if (!(result === null || result === void 0 ? void 0 : result.success)) {
|
161
178
|
return undefined;
|
162
179
|
}
|
@@ -196,7 +213,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
196
213
|
return Object.assign(Object.assign({}, result.data), { recList: list });
|
197
214
|
}
|
198
215
|
return result === null || result === void 0 ? void 0 : result.data;
|
199
|
-
}), [bffFetch, utmVal, maxSize, defaultSize, channelQueryList, channel, chatlabsId]);
|
216
|
+
}), [bffFetch, utmVal, maxSize, defaultSize, channelQueryList, channel, chatlabsId, bffFetchAdmin]);
|
200
217
|
const loadVideos = (0, react_1.useCallback)((pageNum) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
201
218
|
var _1, _2, _3, _4;
|
202
219
|
if (rtcList.length <= 0) {
|
@@ -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;
|
@@ -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();
|
@@ -16,7 +16,7 @@ const Click = (0, create_1.createMaterial)(_1.default, {
|
|
16
16
|
},
|
17
17
|
defaulSetting: {
|
18
18
|
props: {
|
19
|
-
content: '<p><strong><span style="font-size:14px"><span style="line-height:3">Your Cookie Preferences</span></span></strong></p><p>We use cookie, including third-party cookies, to ensure the proper functioning and security of this site, to analyse its use, and to show you personalised content. You can authorise the use of all cookies by clicking on "Accept all cookies". If you click on "Reject all cookies", we will only use cookies necessary for the proper functioning and security of this site. To personalise on adjust your preferences at any time, click on "Cookies Settings" below or at the bottom of any Fendi.com webpage. For more information, read our Cookie Policy.</p><p></p>',
|
19
|
+
content: '<p><strong><span style="font-size:14px"><span style="line-height:3">Your Cookie Preferences</span></span></strong></p><p><span style="font-size:13px"><span style="line-height:1.7">We use cookie, including third-party cookies, to ensure the proper functioning and security of this site, to analyse its use, and to show you personalised content. You can authorise the use of all cookies by clicking on "Accept all cookies". If you click on "Reject all cookies", we will only use cookies necessary for the proper functioning and security of this site. To personalise on adjust your preferences at any time, click on "Cookies Settings" below or at the bottom of any Fendi.com webpage. For more information, read our Cookie Policy.</span></span></p><p></p>',
|
20
20
|
acceptButton: {
|
21
21
|
text: 'Accept all cookies',
|
22
22
|
style: {
|
@@ -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];
|
@@ -16,7 +16,7 @@ const Swipe = (0, create_1.createMaterial)(_1.default, {
|
|
16
16
|
},
|
17
17
|
defaulSetting: {
|
18
18
|
props: {
|
19
|
-
content: '<p><span style="font-
|
19
|
+
content: '<p><strong><span style="font-size:18px"><span style="line-height:1.7">Your Cookie Preferences</span></span></strong></p><p><span style="line-height:1.7"><span style="font-size:13px">We use cookie, including third-party cookies, to ensure the proper functioning and security of this site, to analyse its use, and to show you personalised content. You can authorise the use of all cookies by clicking on 'Accept all cookies'. If you click on 'Reject all cookies', we will only use cookies necessary for the proper functioning and security of this site. To personalise or adjust your preferences at any time, click on 'Cookies Settings' below or at the bottom of any Fendi.com webpage. For more information, <u>read our Cookie Policy</u>.</span></span></p>'
|
20
20
|
},
|
21
21
|
style: {
|
22
22
|
backgroundColor: '#fff',
|