@daeryun/dr_components 0.0.12 → 0.1.1
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/README.md +20 -28
- package/custom.d.ts +7 -0
- package/dist/asset/images/cat.png +0 -0
- package/dist/asset/images/categoryView/section9_arrow_01.webp +0 -0
- package/dist/asset/images/categoryView/section9_arrow_02.webp +0 -0
- package/dist/asset/images/categoryView/section9_arrow_03.webp +0 -0
- package/dist/asset/images/categoryView/section9_arrow_04.webp +0 -0
- package/dist/asset/images/categoryView/section9_arrow_05.webp +0 -0
- package/dist/asset/images/categoryView/section9_icon.webp +0 -0
- package/dist/asset/images/fix/arrow.webp +0 -0
- package/dist/asset/images/fix/call.webp +0 -0
- package/dist/asset/images/fix/call2.webp +0 -0
- package/dist/asset/images/fix/kakao.webp +0 -0
- package/dist/asset/images/fix/menu_x.webp +0 -0
- package/dist/asset/images/fix/online.webp +0 -0
- package/dist/asset/images/footer/footer_daeryun.webp +0 -0
- package/dist/asset/images/footer/ft_icon_arr_2.webp +0 -0
- package/dist/asset/images/footer/icon_arrow_gray.webp +0 -0
- package/dist/asset/images/footer/sns_01.webp +0 -0
- package/dist/asset/images/footer/sns_02.webp +0 -0
- package/dist/asset/images/footer/sns_03.webp +0 -0
- package/dist/asset/images/footer/sns_04.webp +0 -0
- package/dist/asset/images/footer/sns_05.webp +0 -0
- package/dist/asset/images/header/h_icon_g.webp +0 -0
- package/dist/asset/images/header/header_call.webp +0 -0
- package/dist/asset/images/header/language.webp +0 -0
- package/dist/asset/images/header/logo_s.webp +0 -0
- package/dist/asset/images/header/main_img_01.webp +0 -0
- package/dist/asset/images/header/main_img_02.webp +0 -0
- package/dist/asset/images/header/main_img_03.webp +0 -0
- package/dist/asset/images/header/menu.webp +0 -0
- package/dist/asset/images/header/menu_call.webp +0 -0
- package/dist/asset/images/header/menu_sns.webp +0 -0
- package/dist/asset/images/header/menu_sns_01.webp +0 -0
- package/dist/asset/images/header/menu_sns_02.webp +0 -0
- package/dist/asset/images/header/menu_sns_03.webp +0 -0
- package/dist/asset/images/header/menu_sns_04.webp +0 -0
- package/dist/asset/images/header/menu_sns_05.webp +0 -0
- package/dist/asset/images/header/menu_x.webp +0 -0
- package/dist/asset/images/header/online.png +0 -0
- package/dist/asset/images/header/phone.png +0 -0
- package/dist/asset/images/header/talk.png +0 -0
- package/dist/asset/images/header/top_icon_01.webp +0 -0
- package/dist/asset/images/header/top_icon_02.webp +0 -0
- package/dist/asset/images/header/top_icon_03.webp +0 -0
- package/dist/asset/images/header/top_icon_04.webp +0 -0
- package/dist/asset/images/logo.webp +0 -0
- package/dist/cjs/cn/common.json +156 -0
- package/dist/cjs/en/common.json +156 -0
- package/dist/cjs/index.js +14 -0
- package/dist/cjs/jp/common.json +156 -0
- package/dist/cjs/ko/common.json +156 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -0
- package/dist/components/Cat/index.d.ts +3 -0
- package/dist/components/Cat/index.jsx +9 -0
- package/dist/components/Cat/index.tsx +20 -0
- package/dist/components/Fix/Fix.stories.d.ts +13 -0
- package/dist/components/Fix/Fix.stories.jsx +12 -0
- package/dist/components/Fix/Fix.stories.tsx +20 -0
- package/dist/components/Fix/index.d.ts +5 -0
- package/dist/components/Fix/index.jsx +254 -0
- package/dist/components/Fix/index.module.css +316 -0
- package/dist/components/Fix/index.tsx +383 -0
- package/dist/components/Footer/Footer.stories.d.ts +17 -0
- package/dist/components/Footer/Footer.stories.jsx +14 -0
- package/dist/components/Footer/Footer.stories.tsx +20 -0
- package/dist/components/Footer/index.d.ts +10 -0
- package/dist/components/Footer/index.jsx +170 -0
- package/dist/components/Footer/index.tsx +313 -0
- package/dist/components/FooterKeywd/index.d.ts +3 -0
- package/dist/components/FooterKeywd/index.jsx +88 -0
- package/dist/components/FooterKeywd/index.module.css +123 -0
- package/dist/components/FooterKeywd/index.tsx +92 -0
- package/dist/components/Layout/Wrapper.d.ts +10 -0
- package/dist/components/Layout/Wrapper.jsx +42 -0
- package/dist/components/Layout/Wrapper.tsx +54 -0
- package/dist/components/SearchBar/SearchBar.d.ts +14 -0
- package/dist/components/SearchBar/SearchBar.jsx +73 -0
- package/dist/components/SearchBar/SearchBar.tsx +139 -0
- package/dist/components/Top/Fix.d.ts +0 -0
- package/dist/components/Top/Fix.jsx +306 -0
- package/dist/components/Top/Fix.module.css +54 -0
- package/dist/components/Top/Fix.tsx +305 -0
- package/dist/components/Top/Gnb.d.ts +0 -0
- package/dist/components/Top/Gnb.jsx +212 -0
- package/dist/components/Top/Gnb.tsx +211 -0
- package/dist/components/Top/Hamburger.d.ts +0 -0
- package/dist/components/Top/Hamburger.jsx +743 -0
- package/dist/components/Top/Hamburger.tsx +742 -0
- package/dist/components/Top/index.d.ts +0 -0
- package/dist/components/Top/index.jsx +62 -0
- package/dist/components/Top/index.tsx +61 -0
- package/dist/components/common/hook/useBrowser.d.ts +5 -0
- package/dist/components/common/hook/useBrowser.js +45 -0
- package/dist/components/common/hook/useBrowser.ts +52 -0
- package/dist/components/common/index.d.ts +37 -0
- package/dist/components/common/index.js +2041 -0
- package/dist/components/common/index.ts +2061 -0
- package/dist/components/common/types/index.d.ts +20 -0
- package/dist/components/common/types/index.js +1 -0
- package/dist/components/common/types/index.ts +22 -0
- package/dist/components/index.js +6 -0
- package/dist/components/index.ts +6 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/index.ts +2 -0
- package/dist/lib/catagoryMenuName.d.ts +8 -0
- package/dist/lib/catagoryMenuName.js +8 -0
- package/dist/lib/catagoryMenuName.ts +12 -0
- package/dist/lib/conversion.d.ts +1 -0
- package/dist/lib/conversion.js +6 -0
- package/dist/lib/conversion.ts +6 -0
- package/dist/lib/gtag.d.ts +8 -0
- package/dist/lib/gtag.js +16 -0
- package/dist/lib/index.js +5 -0
- package/dist/lib/index.ts +5 -0
- package/dist/lib/pagination/locale/en_US.js +23 -0
- package/dist/lib/pagination/locale/ko_KR.js +23 -0
- package/dist/lib/powerlink.d.ts +2 -0
- package/dist/lib/powerlink.js +128 -0
- package/dist/lib/powerlink.ts +147 -0
- package/dist/lib/utils.d.ts +35 -0
- package/dist/lib/utils.js +267 -0
- package/dist/lib/utils.ts +301 -0
- package/dist/styles/globals.css +2781 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +54 -23
- package/.eslintrc.json +0 -3
- package/.idea/modules.xml +0 -8
- package/.idea/npm_test.iml +0 -12
- package/.idea/vcs.xml +0 -6
- package/babel.config.json +0 -31
- package/dist/components/Button/Button.d.ts +0 -11
- package/dist/components/Button/Button.jsx +0 -19
- package/next.config.js +0 -22
- package/pages/_app.tsx +0 -5
- package/pages/_document.tsx +0 -13
- package/pages/api/hello.ts +0 -13
- package/pages/index.tsx +0 -9
- package/postcss.config.js +0 -6
- package/src/lib/components/Button/Button.d.ts +0 -11
- package/src/lib/components/Button/Button.js +0 -17
- package/src/lib/components/Button/Button.tsx +0 -30
- package/src/lib/index.ts +0 -1
- package/styles/globals.css +0 -27
- package/tailwind.config.js +0 -37
- package/tsconfig.json +0 -35
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface IInitialDataTypes {
|
|
2
|
+
lawyer_cnt: number;
|
|
3
|
+
office_cnt: number;
|
|
4
|
+
consult_cnt: number;
|
|
5
|
+
success_cnt: number;
|
|
6
|
+
center_cnt: number;
|
|
7
|
+
regenerTotal_cnt: number;
|
|
8
|
+
professional_cnt: number;
|
|
9
|
+
}
|
|
10
|
+
export interface ICenter {
|
|
11
|
+
code: string;
|
|
12
|
+
code_name: string | null;
|
|
13
|
+
code_desc: string | null;
|
|
14
|
+
isSelect?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface ICategory {
|
|
17
|
+
idx: number;
|
|
18
|
+
center_code: string;
|
|
19
|
+
title: string | null;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface IInitialDataTypes {
|
|
2
|
+
lawyer_cnt: number
|
|
3
|
+
office_cnt: number
|
|
4
|
+
consult_cnt: number
|
|
5
|
+
success_cnt: number
|
|
6
|
+
center_cnt: number
|
|
7
|
+
regenerTotal_cnt: number
|
|
8
|
+
professional_cnt: number
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface ICenter {
|
|
12
|
+
code: string
|
|
13
|
+
code_name: string | null //한글이름
|
|
14
|
+
code_desc: string | null //영어이름
|
|
15
|
+
isSelect?: boolean
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ICategory {
|
|
19
|
+
idx: number
|
|
20
|
+
center_code: string
|
|
21
|
+
title: string | null
|
|
22
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// import '../styles/globals.css'
|
|
2
|
+
// export { default as Top } from './Top'
|
|
3
|
+
// export { default as Cat } from './Cat'
|
|
4
|
+
// export { default as FooterKeywd } from './FooterKeywd'
|
|
5
|
+
export { default as Footer } from './Footer';
|
|
6
|
+
// export { default as CategoryView } from './CategoryView'
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// import '../styles/globals.css'
|
|
2
|
+
// export { default as Top } from './Top'
|
|
3
|
+
// export { default as Cat } from './Cat'
|
|
4
|
+
// export { default as FooterKeywd } from './FooterKeywd'
|
|
5
|
+
export { default as Footer } from './Footer'
|
|
6
|
+
// export { default as CategoryView } from './CategoryView'
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './components';
|
|
2
|
+
export * from './lib';
|
package/dist/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './components';
|
|
2
|
+
export * from './lib';
|
package/dist/index.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export function catagoryMenuName({ url, t }) {
|
|
2
|
+
switch (url) {
|
|
3
|
+
case '/broadcast':
|
|
4
|
+
return { title: t("Hamburger_Media coverage"), subTitle: t("Hamburger_Media coverage"), address: "broadcast" };
|
|
5
|
+
default:
|
|
6
|
+
return { title: '', subTitle: '', address: "/" };
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function catagoryMenuName({ url, t }: { url: string, t: any }): { title: string, subTitle: string,address:string } {
|
|
2
|
+
|
|
3
|
+
switch (url) {
|
|
4
|
+
case '/broadcast':
|
|
5
|
+
|
|
6
|
+
return { title:t("Hamburger_Media coverage"), subTitle: t("Hamburger_Media coverage") ,address:"broadcast"}
|
|
7
|
+
default:
|
|
8
|
+
return { title: '', subTitle: '' ,address:"/"}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function insert(str: string, isMobile: boolean): void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export function insert(str, isMobile) {
|
|
2
|
+
const sendData = { site_gubun: "regener", location: window.location, userAgent: navigator.userAgent, referrer: document.referrer, conversion: str, isMobile: isMobile };
|
|
3
|
+
let myHeaders = new Headers();
|
|
4
|
+
myHeaders.append("Content-Type", "application/json");
|
|
5
|
+
fetch("https://mng.daeryunlaw.com/api/conversion", { method: "POST", body: JSON.stringify(sendData), headers: myHeaders });
|
|
6
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export function insert(str:string, isMobile:boolean){
|
|
2
|
+
const sendData = { site_gubun: "regener", location: window.location, userAgent: navigator.userAgent, referrer: document.referrer, conversion: str, isMobile: isMobile}
|
|
3
|
+
let myHeaders = new Headers();
|
|
4
|
+
myHeaders.append("Content-Type", "application/json");
|
|
5
|
+
fetch("https://mng.daeryunlaw.com/api/conversion", {method: "POST", body: JSON.stringify(sendData), headers: myHeaders});
|
|
6
|
+
}
|
package/dist/lib/gtag.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const GA_TRACKING_ID = "G-SDRWEXFHVQ";
|
|
2
|
+
// https://developers.google.com/analytics/devguides/collection/ga4/events?hl="ko"&client_type=gtag
|
|
3
|
+
export const page_view = (screen_name) => {
|
|
4
|
+
window.gtag('event', "page_view", {
|
|
5
|
+
'app_name': process.env.NEXT_PUBLIC_SERVICE_DOMAIN,
|
|
6
|
+
'screen_name': screen_name
|
|
7
|
+
});
|
|
8
|
+
};
|
|
9
|
+
export const event = ({ action, category, label, value }) => {
|
|
10
|
+
window.gtag('event', action, {
|
|
11
|
+
'app_name': process.env.NEXT_PUBLIC_SERVICE_DOMAIN,
|
|
12
|
+
'event_name': label,
|
|
13
|
+
'event_category': category,
|
|
14
|
+
'value': value,
|
|
15
|
+
});
|
|
16
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
|
4
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _default = {
|
|
9
|
+
// Options.jsx
|
|
10
|
+
items_per_page: '/ page',
|
|
11
|
+
jump_to: 'Go to',
|
|
12
|
+
jump_to_confirm: 'confirm',
|
|
13
|
+
page: 'Page',
|
|
14
|
+
// Pagination.jsx
|
|
15
|
+
prev_page: 'Previous Page',
|
|
16
|
+
next_page: 'Next Page',
|
|
17
|
+
prev_5: 'Previous 5 Pages',
|
|
18
|
+
next_5: 'Next 5 Pages',
|
|
19
|
+
prev_3: 'Previous 3 Pages',
|
|
20
|
+
next_3: 'Next 3 Pages',
|
|
21
|
+
page_size: 'Page Size'
|
|
22
|
+
};
|
|
23
|
+
exports.default = _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
|
4
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _default = {
|
|
9
|
+
// Options.jsx
|
|
10
|
+
items_per_page: '/ 쪽',
|
|
11
|
+
jump_to: '이동하기',
|
|
12
|
+
jump_to_confirm: '확인하다',
|
|
13
|
+
page: '페이지',
|
|
14
|
+
// Pagination.jsx
|
|
15
|
+
prev_page: '이전 페이지',
|
|
16
|
+
next_page: '다음 페이지',
|
|
17
|
+
prev_5: '이전 5 페이지',
|
|
18
|
+
next_5: '다음 5 페이지',
|
|
19
|
+
prev_3: '이전 3 페이지',
|
|
20
|
+
next_3: '다음 3 페이지',
|
|
21
|
+
page_size: '페이지 크기'
|
|
22
|
+
};
|
|
23
|
+
exports.default = _default;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
export const saveTelNumber = (is_mobile, naverTelFn, googleTelFn, youtubeTel, setResetTel) => {
|
|
11
|
+
if (typeof window !== 'undefined') {
|
|
12
|
+
const current = window.location.href;
|
|
13
|
+
//파워링크인지?
|
|
14
|
+
const siteType = current.includes('n_ad') ? 'naver' : current.includes('gclid') ? 'google' : '';
|
|
15
|
+
//유튜브인지?
|
|
16
|
+
const isYoutube = document.referrer.includes('youtube');
|
|
17
|
+
//유튜브로 접근한 후애 / 주소로 페이지 이동한 경우
|
|
18
|
+
if (window.sessionStorage.getItem('youtube-referrer')) {
|
|
19
|
+
youtubeTel();
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (isYoutube) {
|
|
23
|
+
youtubeTel();
|
|
24
|
+
//새로고침 아니고 첫 접근
|
|
25
|
+
if (window.sessionStorage.getItem('youtube-referrer') === null) {
|
|
26
|
+
window.sessionStorage.setItem(`youtube-referrer`, JSON.stringify({
|
|
27
|
+
url: document.referrer
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const googleSession = window.sessionStorage.getItem('google-powerlink');
|
|
33
|
+
const naverSession = window.sessionStorage.getItem('naver-powerlink');
|
|
34
|
+
//기존에 저장했는데 주소에 파람 없이 접근
|
|
35
|
+
if (naverSession && siteType === '') {
|
|
36
|
+
naverTelFn();
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (googleSession && siteType === '') {
|
|
40
|
+
googleTelFn();
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (siteType != '') {
|
|
44
|
+
//저장 플래그
|
|
45
|
+
let flag = false;
|
|
46
|
+
let myHeaders = new Headers();
|
|
47
|
+
myHeaders.append('Content-Type', 'application/json');
|
|
48
|
+
const searchApi = `https://mng.daeryunlaw.com/api/${siteType}-powerlink/search`;
|
|
49
|
+
const searchJson = {
|
|
50
|
+
method: 'POST',
|
|
51
|
+
body: JSON.stringify({ url: current }),
|
|
52
|
+
headers: myHeaders
|
|
53
|
+
};
|
|
54
|
+
const postApi = `https://mng.daeryunlaw.com/api/${siteType}-powerlink`;
|
|
55
|
+
const postJson = {
|
|
56
|
+
method: 'POST',
|
|
57
|
+
body: JSON.stringify({
|
|
58
|
+
url: current,
|
|
59
|
+
is_mobile: is_mobile,
|
|
60
|
+
created_at: new Date()
|
|
61
|
+
}),
|
|
62
|
+
headers: myHeaders
|
|
63
|
+
};
|
|
64
|
+
if (siteType === 'naver') {
|
|
65
|
+
window.sessionStorage.removeItem('google-powerlink');
|
|
66
|
+
window.sessionStorage.removeItem('youtube-referrer');
|
|
67
|
+
//전화번호 변경 함수
|
|
68
|
+
naverTelFn();
|
|
69
|
+
//처음 접근이라면 디비, 세션 저장 플래그
|
|
70
|
+
if (window.sessionStorage.getItem('naver-powerlink') === null) {
|
|
71
|
+
flag = true;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (siteType === 'google') {
|
|
75
|
+
window.sessionStorage.removeItem('naver-powerlink');
|
|
76
|
+
window.sessionStorage.removeItem('youtube-referrer');
|
|
77
|
+
//전화번호 변경 함수
|
|
78
|
+
googleTelFn();
|
|
79
|
+
//처음 접근이라면 디비,세션 저장 플래그
|
|
80
|
+
if (window.sessionStorage.getItem('google-powerlink') === null) {
|
|
81
|
+
flag = true;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (flag) {
|
|
85
|
+
//같은 주소로 들어왔는지 체크 > 새로고침 방지
|
|
86
|
+
fetch(searchApi, searchJson).then((obj) => __awaiter(void 0, void 0, void 0, function* () {
|
|
87
|
+
const res = yield obj.json();
|
|
88
|
+
//파워링크 접속 기록 저장
|
|
89
|
+
if (res.data < 1) {
|
|
90
|
+
fetch(postApi, postJson).then((obj_) => __awaiter(void 0, void 0, void 0, function* () {
|
|
91
|
+
const res_ = yield obj_.json();
|
|
92
|
+
window.sessionStorage.setItem(`${siteType}-powerlink`, JSON.stringify({
|
|
93
|
+
idx: res_.data.idx,
|
|
94
|
+
url: res_.data.url
|
|
95
|
+
}));
|
|
96
|
+
}));
|
|
97
|
+
}
|
|
98
|
+
}));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
//파워링크 접근이 아닐 때
|
|
103
|
+
window.sessionStorage.removeItem('google-powerlink');
|
|
104
|
+
window.sessionStorage.removeItem('naver-powerlink');
|
|
105
|
+
setResetTel();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
export const savePowerLinkConversion = (type, isMobile) => {
|
|
110
|
+
const current = window.location.href;
|
|
111
|
+
const siteType = current.includes('n_ad') ? 'naver' : current.includes('gclid') ? 'google' : '';
|
|
112
|
+
if (typeof window !== 'undefined' && window.sessionStorage.getItem(`${siteType}-powerlink`) != null) {
|
|
113
|
+
const powerlink = JSON.parse(String(window.sessionStorage.getItem(`${siteType}-powerlink`)));
|
|
114
|
+
let myHeaders = new Headers();
|
|
115
|
+
myHeaders.append('Content-Type', 'application/json');
|
|
116
|
+
fetch(`https://mng.daeryunlaw.com/api/${siteType}-powerlink-conversion`, {
|
|
117
|
+
method: 'POST',
|
|
118
|
+
body: JSON.stringify({
|
|
119
|
+
powerlink_idx: powerlink.idx,
|
|
120
|
+
referrer_url: powerlink.url,
|
|
121
|
+
conversion_type: type,
|
|
122
|
+
is_mobile: isMobile,
|
|
123
|
+
created_at: new Date()
|
|
124
|
+
}),
|
|
125
|
+
headers: myHeaders
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
export const saveTelNumber = (
|
|
2
|
+
is_mobile: boolean,
|
|
3
|
+
naverTelFn: () => void,
|
|
4
|
+
googleTelFn: () => void,
|
|
5
|
+
youtubeTel: () => void,
|
|
6
|
+
setResetTel: () => void
|
|
7
|
+
) => {
|
|
8
|
+
if (typeof window !== 'undefined') {
|
|
9
|
+
const current = window.location.href
|
|
10
|
+
|
|
11
|
+
//파워링크인지?
|
|
12
|
+
const siteType = current.includes('n_ad') ? 'naver' : current.includes('gclid') ? 'google' : ''
|
|
13
|
+
|
|
14
|
+
//유튜브인지?
|
|
15
|
+
const isYoutube = document.referrer.includes('youtube')
|
|
16
|
+
|
|
17
|
+
//유튜브로 접근한 후애 / 주소로 페이지 이동한 경우
|
|
18
|
+
if (window.sessionStorage.getItem('youtube-referrer')) {
|
|
19
|
+
youtubeTel()
|
|
20
|
+
return
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (isYoutube) {
|
|
24
|
+
youtubeTel()
|
|
25
|
+
//새로고침 아니고 첫 접근
|
|
26
|
+
if (window.sessionStorage.getItem('youtube-referrer') === null) {
|
|
27
|
+
window.sessionStorage.setItem(
|
|
28
|
+
`youtube-referrer`,
|
|
29
|
+
JSON.stringify({
|
|
30
|
+
url: document.referrer
|
|
31
|
+
})
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
return
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const googleSession = window.sessionStorage.getItem('google-powerlink')
|
|
38
|
+
const naverSession = window.sessionStorage.getItem('naver-powerlink')
|
|
39
|
+
|
|
40
|
+
//기존에 저장했는데 주소에 파람 없이 접근
|
|
41
|
+
if (naverSession && siteType === '') {
|
|
42
|
+
naverTelFn()
|
|
43
|
+
return
|
|
44
|
+
}
|
|
45
|
+
if (googleSession && siteType === '') {
|
|
46
|
+
googleTelFn()
|
|
47
|
+
return
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (siteType != '') {
|
|
51
|
+
//저장 플래그
|
|
52
|
+
let flag = false
|
|
53
|
+
|
|
54
|
+
let myHeaders = new Headers()
|
|
55
|
+
myHeaders.append('Content-Type', 'application/json')
|
|
56
|
+
|
|
57
|
+
const searchApi = `https://mng.daeryunlaw.com/api/${siteType}-powerlink/search`
|
|
58
|
+
const searchJson = {
|
|
59
|
+
method: 'POST',
|
|
60
|
+
body: JSON.stringify({ url: current }),
|
|
61
|
+
headers: myHeaders
|
|
62
|
+
}
|
|
63
|
+
const postApi = `https://mng.daeryunlaw.com/api/${siteType}-powerlink`
|
|
64
|
+
const postJson = {
|
|
65
|
+
method: 'POST',
|
|
66
|
+
body: JSON.stringify({
|
|
67
|
+
url: current,
|
|
68
|
+
is_mobile: is_mobile,
|
|
69
|
+
created_at: new Date()
|
|
70
|
+
}),
|
|
71
|
+
headers: myHeaders
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (siteType === 'naver') {
|
|
75
|
+
window.sessionStorage.removeItem('google-powerlink')
|
|
76
|
+
window.sessionStorage.removeItem('youtube-referrer')
|
|
77
|
+
//전화번호 변경 함수
|
|
78
|
+
naverTelFn()
|
|
79
|
+
//처음 접근이라면 디비, 세션 저장 플래그
|
|
80
|
+
if (window.sessionStorage.getItem('naver-powerlink') === null) {
|
|
81
|
+
flag = true
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (siteType === 'google') {
|
|
86
|
+
window.sessionStorage.removeItem('naver-powerlink')
|
|
87
|
+
window.sessionStorage.removeItem('youtube-referrer')
|
|
88
|
+
//전화번호 변경 함수
|
|
89
|
+
googleTelFn()
|
|
90
|
+
//처음 접근이라면 디비,세션 저장 플래그
|
|
91
|
+
if (window.sessionStorage.getItem('google-powerlink') === null) {
|
|
92
|
+
flag = true
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (flag) {
|
|
97
|
+
//같은 주소로 들어왔는지 체크 > 새로고침 방지
|
|
98
|
+
fetch(searchApi, searchJson).then(async (obj) => {
|
|
99
|
+
const res = await obj.json()
|
|
100
|
+
|
|
101
|
+
//파워링크 접속 기록 저장
|
|
102
|
+
if (res.data < 1) {
|
|
103
|
+
fetch(postApi, postJson).then(async (obj_) => {
|
|
104
|
+
const res_ = await obj_.json()
|
|
105
|
+
window.sessionStorage.setItem(
|
|
106
|
+
`${siteType}-powerlink`,
|
|
107
|
+
JSON.stringify({
|
|
108
|
+
idx: res_.data.idx,
|
|
109
|
+
url: res_.data.url
|
|
110
|
+
})
|
|
111
|
+
)
|
|
112
|
+
})
|
|
113
|
+
}
|
|
114
|
+
})
|
|
115
|
+
}
|
|
116
|
+
} else {
|
|
117
|
+
//파워링크 접근이 아닐 때
|
|
118
|
+
window.sessionStorage.removeItem('google-powerlink')
|
|
119
|
+
window.sessionStorage.removeItem('naver-powerlink')
|
|
120
|
+
setResetTel()
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export const savePowerLinkConversion = (type: string, isMobile: boolean) => {
|
|
126
|
+
const current = window.location.href
|
|
127
|
+
const siteType = current.includes('n_ad') ? 'naver' : current.includes('gclid') ? 'google' : ''
|
|
128
|
+
|
|
129
|
+
if (typeof window !== 'undefined' && window.sessionStorage.getItem(`${siteType}-powerlink`) != null) {
|
|
130
|
+
const powerlink = JSON.parse(String(window.sessionStorage.getItem(`${siteType}-powerlink`)))
|
|
131
|
+
|
|
132
|
+
let myHeaders = new Headers()
|
|
133
|
+
myHeaders.append('Content-Type', 'application/json')
|
|
134
|
+
|
|
135
|
+
fetch(`https://mng.daeryunlaw.com/api/${siteType}-powerlink-conversion`, {
|
|
136
|
+
method: 'POST',
|
|
137
|
+
body: JSON.stringify({
|
|
138
|
+
powerlink_idx: powerlink.idx,
|
|
139
|
+
referrer_url: powerlink.url,
|
|
140
|
+
conversion_type: type,
|
|
141
|
+
is_mobile: isMobile,
|
|
142
|
+
created_at: new Date()
|
|
143
|
+
}),
|
|
144
|
+
headers: myHeaders
|
|
145
|
+
})
|
|
146
|
+
}
|
|
147
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* <pre>
|
|
4
|
+
* utils.ts
|
|
5
|
+
* 수정일 수정자 수정내용
|
|
6
|
+
* -------------------------------------------------
|
|
7
|
+
* 2022-08-16 최초생성
|
|
8
|
+
* </pre>
|
|
9
|
+
* @author sbpark
|
|
10
|
+
* @since 2022-08-16
|
|
11
|
+
* @version 1.0
|
|
12
|
+
*
|
|
13
|
+
* Copyright (C) by DeaRyunLaw All right Preserved.
|
|
14
|
+
*/
|
|
15
|
+
export declare function htmlTagRemove(str: string): string;
|
|
16
|
+
export declare function htmlUrlDecode(str: string): string;
|
|
17
|
+
export declare function htmlUrlEncode(str: string): string;
|
|
18
|
+
export declare function numComma(x: number): string;
|
|
19
|
+
export declare function bodyFetch(url: string, sendData: any, processFn: any, method?: string): void;
|
|
20
|
+
export declare function paramFetch(url: string, sendData: any, processFn: any, method?: string): void;
|
|
21
|
+
export declare function isEmail(asValue: string): boolean;
|
|
22
|
+
export declare function isLoginId(asValue: string): boolean;
|
|
23
|
+
export declare function isJobPassword(asValue: string): boolean;
|
|
24
|
+
export declare function isCelluar(asValue: string): boolean;
|
|
25
|
+
export declare function isBirthDay(asValue: string): boolean;
|
|
26
|
+
export declare function setCelluar(asValue: string): string;
|
|
27
|
+
export declare function dateFomat(date: string, formatStr: string): any;
|
|
28
|
+
export declare function nowDate(formatStr: string): any;
|
|
29
|
+
export declare function dateAddDay(formatStr: string, addDay: number): any;
|
|
30
|
+
export declare function dateAddMonth(formatStr: string, addMonth: number): any;
|
|
31
|
+
export declare function maskTell(tell: string): string;
|
|
32
|
+
export declare function maskName(name: string): string;
|
|
33
|
+
export declare function maskEmail(email: string): string;
|
|
34
|
+
export declare function cutString(str: string, length: number): string;
|
|
35
|
+
export declare const getLangClassName: (type: string | undefined, kor: string, en: string, jp: string, cn: string) => string;
|