Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
ZZH_SalaryWish-20250609
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
SparkProjects
ZZH_SalaryWish-20250609
Commits
2af6dfab
Commit
2af6dfab
authored
Jun 11, 2025
by
王勇霞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 埋点
parent
20a8c80b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
109 additions
and
114 deletions
+109
-114
project.settings.json
project.settings.json
+1
-1
index.html
public/index.html
+102
-108
rulepop.jsx
src/components/rulepop/rulepop.jsx
+2
-2
index.jsx
src/pages/HomePage/index.jsx
+4
-3
No files found.
project.settings.json
View file @
2af6dfab
{
"proSetting"
:{
"projectxIDs"
:{
"testId"
:[],
"prodId"
:[{
"label"
:
"线上测试"
,
"value"
:
"p
2b588cb1
"
},{
"label"
:
"线上正式"
,
"value"
:
"p47d5ddb4"
}]},
"skinVariables"
:[]},
"envSetting"
:{},
"psdSetting"
:{
"psdFSSetting"
:
true
,
"psdCenterSetting"
:
true
}}
{
"proSetting"
:{
"projectxIDs"
:{
"testId"
:[],
"prodId"
:[{
"label"
:
"线上测试"
,
"value"
:
"p
16fceb94
"
},{
"label"
:
"线上正式"
,
"value"
:
"p47d5ddb4"
}]},
"skinVariables"
:[]},
"envSetting"
:{},
"psdSetting"
:{
"psdFSSetting"
:
true
,
"psdCenterSetting"
:
true
}}
public/index.html
View file @
2af6dfab
<!DOCTYPE html>
<html
lang=
"zh"
>
<head>
<meta
charset=
"utf-8"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<meta
name=
"theme-color"
content=
"#000000"
/>
<link
rel=
"dns-prefetch"
href=
"//yun.duiba.com.cn"
/>
<link
rel=
"preconnect"
href=
"//embedlog.duiba.com.cn"
/>
<title>
新客九重礼
</title>
<script
type=
"text/javascript"
>
if
(
localStorage
&&
localStorage
.
isWebp
)
{
document
.
getElementsByTagName
(
"html"
)[
0
].
setAttribute
(
"duiba-webp"
,
"true"
);
}
</script>
<script
src=
"//yun.duiba.com.cn/spark/v2/spark.base.fz.wxpollyfill.js"
></script>
<script
src=
"//yun.duiba.com.cn/js-libs/rem/1.1.3/rem.min.js"
></script>
<script
src=
"//yun.duiba.com.cn/h5/lib/zepto.min.js"
></script>
<script
src=
"//res.wx.qq.com/open/js/jweixin-1.6.0.js"
></script>
<link
rel=
"stylesheet"
href=
"//yun.duiba.com.cn/h5/lib/reset.css"
/>
<!-- 埋点测试 -->
<!-- <script src="https://cdn2.h5no1.com/cbsp-telegraph/opfStatisticSdk.v3.t2.js"></script> -->
<script
src=
"https://cdn2.h5no1.com/cbsp-telegraph/opfStatisticSdk.v3.min.js"
></script>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1, shrink-to-fit=no"
>
<meta
name=
"theme-color"
content=
"#000000"
>
<link
rel=
"dns-prefetch"
href=
"//yun.duiba.com.cn"
/>
<link
rel=
"preconnect"
href=
"//embedlog.duiba.com.cn"
>
<title>
新客九重礼
</title>
<script
type=
"text/javascript"
>
if
(
localStorage
&&
localStorage
.
isWebp
)
{
document
.
getElementsByTagName
(
'html'
)[
0
]
.
setAttribute
(
'duiba-webp'
,
'true'
);
}
</script>
<script
src=
"//yun.duiba.com.cn/spark/v2/spark.base.fz.wxpollyfill.js"
></script>
<script
src=
"//yun.duiba.com.cn/js-libs/rem/1.1.3/rem.min.js"
></script>
<script
src=
"//yun.duiba.com.cn/h5/lib/zepto.min.js"
></script>
<script
src=
"//res.wx.qq.com/open/js/jweixin-1.6.0.js"
></script>
<link
rel=
"stylesheet"
href=
"//yun.duiba.com.cn/h5/lib/reset.css"
>
<!-- 埋点测试 -->
<!-- <script src="https://cdn2.h5no1.com/cbsp-telegraph/opfStatisticSdk.v3.t2.js"></script> -->
<script
src=
"https://cdn2.h5no1.com/cbsp-telegraph/opfStatisticSdk.v3.min.js"
></script>
<script>
window
.
terminal
=
(
function
()
{
var
u
=
navigator
.
userAgent
;
// app = navigator.appVersion;
return
{
// 浏览器版本信息
trident
:
u
.
indexOf
(
'Trident'
)
>
-
1
,
presto
:
u
.
indexOf
(
'Presto'
)
>
-
1
,
webKit
:
u
.
indexOf
(
'AppleWebKit'
)
>
-
1
,
gecko
:
u
.
indexOf
(
'Gecko'
)
>
-
1
&&
u
.
indexOf
(
'KHTML'
)
>
-
1
,
mobile
:
!!
u
.
match
(
/AppleWebKit.*Mobile.*/
),
ios
:
!!
u
.
match
(
/
\(
i
[^
;
]
+;
(
U;
)?
CPU.+Mac OS X/
),
android
:
u
.
indexOf
(
'Android'
)
>
-
1
||
u
.
indexOf
(
'Linux'
)
>
-
1
,
iPhone
:
u
.
indexOf
(
'iPhone'
)
>
-
1
,
iPad
:
u
.
indexOf
(
'iPad'
)
>
-
1
,
webApp
:
u
.
indexOf
(
'Safari'
)
>
-
1
,
weixin
:
(
u
.
indexOf
(
'MicroMessenger'
)
>
-
1
&&
u
.
replace
(
/.*
(
MicroMessenger
\/[^\s]
*
)
.*/
,
'$1'
).
replace
(
'MicroMessenger/'
,
''
))
||
false
,
appVersion
:
u
.
indexOf
(
'bocapp('
)
>
-
1
?
u
.
match
(
/bocapp
\(\S
+
\)
/
)[
0
].
slice
(
7
,
-
1
)
:
'3.0.0'
,
app
:
u
.
indexOf
(
'bocapp('
)
>
-
1
,
isWeixin
:
u
.
indexOf
(
'MicroMessenger'
)
>
-
1
};
})();
/**
* 引入cordova
*/
if
(
window
.
terminal
.
app
)
{
var
script
=
document
.
createElement
(
'script'
);
// eslint-disable-next-line @spark/best-practices/no-url-in-js
var
path
=
'https://ebsnew.boc.cn/bocphone/BocMerchant/'
;
// 生产环境
// 外网环境直接引用生产地址即可,若需新增cordova方法,另行提供DMZ区地址
if
(
window
.
terminal
.
ios
)
{
script
.
src
=
path
+
'paylib/ios.js'
;
}
else
if
(
window
.
terminal
.
android
)
{
script
.
src
=
path
+
'paylib/android.js'
;
}
else
{
alert
(
'无法识别终端类型'
);
<script>
window
.
terminal
=
(
function
()
{
var
u
=
navigator
.
userAgent
;
// app = navigator.appVersion;
return
{
// 浏览器版本信息
trident
:
u
.
indexOf
(
"Trident"
)
>
-
1
,
presto
:
u
.
indexOf
(
"Presto"
)
>
-
1
,
webKit
:
u
.
indexOf
(
"AppleWebKit"
)
>
-
1
,
gecko
:
u
.
indexOf
(
"Gecko"
)
>
-
1
&&
u
.
indexOf
(
"KHTML"
)
>
-
1
,
mobile
:
!!
u
.
match
(
/AppleWebKit.*Mobile.*/
),
ios
:
!!
u
.
match
(
/
\(
i
[^
;
]
+;
(
U;
)?
CPU.+Mac OS X/
),
android
:
u
.
indexOf
(
"Android"
)
>
-
1
||
u
.
indexOf
(
"Linux"
)
>
-
1
,
iPhone
:
u
.
indexOf
(
"iPhone"
)
>
-
1
,
iPad
:
u
.
indexOf
(
"iPad"
)
>
-
1
,
webApp
:
u
.
indexOf
(
"Safari"
)
>
-
1
,
weixin
:
(
u
.
indexOf
(
"MicroMessenger"
)
>
-
1
&&
u
.
replace
(
/.*
(
MicroMessenger
\/[^\s]
*
)
.*/
,
"$1"
).
replace
(
"MicroMessenger/"
,
""
))
||
false
,
appVersion
:
u
.
indexOf
(
"bocapp("
)
>
-
1
?
u
.
match
(
/bocapp
\(\S
+
\)
/
)[
0
].
slice
(
7
,
-
1
)
:
"3.0.0"
,
app
:
u
.
indexOf
(
"bocapp("
)
>
-
1
,
isWeixin
:
u
.
indexOf
(
"MicroMessenger"
)
>
-
1
,
};
})();
/**
* 引入cordova
*/
if
(
window
.
terminal
.
app
)
{
var
script
=
document
.
createElement
(
"script"
);
// eslint-disable-next-line @spark/best-practices/no-url-in-js
var
path
=
"https://ebsnew.boc.cn/bocphone/BocMerchant/"
;
// 生产环境
// 外网环境直接引用生产地址即可,若需新增cordova方法,另行提供DMZ区地址
if
(
window
.
terminal
.
ios
)
{
script
.
src
=
path
+
"paylib/ios.js"
;
}
else
if
(
window
.
terminal
.
android
)
{
script
.
src
=
path
+
"paylib/android.js"
;
}
else
{
alert
(
"无法识别终端类型"
);
}
document
.
getElementsByTagName
(
"head"
)[
0
].
appendChild
(
script
);
}
document
.
getElementsByTagName
(
'head'
)[
0
].
appendChild
(
script
);
}
</script>
<script>
var
CFG
=
CFG
||
{};
CFG
.
projectId
=
location
.
pathname
.
split
(
'/'
)[
2
]
||
'1'
;
</script>
<script>
var
CFG
=
CFG
||
{};
CFG
.
projectId
=
location
.
pathname
.
split
(
"/"
)[
2
]
||
"1"
;
function
getUrlParam
(
name
)
{
var
search
=
window
.
location
.
search
;
var
matched
=
search
.
slice
(
1
)
.
match
(
new
RegExp
(
'(^|&)'
+
name
+
'=([^&]*)(&|$)'
,
'i'
));
return
search
.
length
?
matched
&&
matched
[
2
]
:
null
;
}
function
getUrlParam
(
name
)
{
var
search
=
window
.
location
.
search
;
var
matched
=
search
.
slice
(
1
).
match
(
new
RegExp
(
"(^|&)"
+
name
+
"=([^&]*)(&|$)"
,
"i"
));
return
search
.
length
?
matched
&&
matched
[
2
]
:
null
;
}
CFG
.
appID
=
'${APPID}'
;
CFG
.
domain
=
location
.
origin
;
CFG
.
appKey
=
'3CDJtKxCbGB7eh3Mxj2guJKRvfgK'
;
if
(
CFG
.
projectId
==
'p2b588cb1'
)
{
// 测试环境
CFG
.
appKey
=
'3PT1ia3EjnkhqpkqtvvYn9Sph3vQ'
;
}
// 长图页
CFG
.
imgPageUrl
=
"/projectx/"
+
CFG
.
projectId
+
"/img.html?appID="
+
CFG
.
appID
+
"&imgUrl="
;
// 首页
CFG
.
indexUrl
=
"/projectx/"
+
CFG
.
projectId
+
"/index.html?appID="
+
CFG
.
appID
;
// 是否app分享页面 1是app分享页面
CFG
.
isAppShare
=
getUrlParam
(
'appShare'
)
||
''
;
// 行方埋点参数
CFG
.
opfStatisticSdk_pfid
=
"be_2zFRQQ2Fb"
;
CFG
.
opfStatisticSdk_appid
=
"db5681a6-2bdf-4e6d-8c96-930e988c3b3b"
;
if
(
CFG
.
projectId
==
'p2b588cb1'
)
{
// 测试项目
CFG
.
appID
=
"${APPID}"
;
CFG
.
domain
=
location
.
origin
;
CFG
.
appKey
=
"3CDJtKxCbGB7eh3Mxj2guJKRvfgK"
;
if
(
CFG
.
projectId
==
"p16fceb94"
)
{
// 测试环境
CFG
.
appKey
=
"3PT1ia3EjnkhqpkqtvvYn9Sph3vQ"
;
}
// 长图页
CFG
.
imgPageUrl
=
"/projectx/"
+
CFG
.
projectId
+
"/img.html?appID="
+
CFG
.
appID
+
"&imgUrl="
;
// 首页
CFG
.
indexUrl
=
"/projectx/"
+
CFG
.
projectId
+
"/index.html?appID="
+
CFG
.
appID
;
// 是否app分享页面 1是app分享页面
CFG
.
isAppShare
=
getUrlParam
(
"appShare"
)
||
""
;
// 行方埋点参数
CFG
.
opfStatisticSdk_pfid
=
"be_2zFRQQ2Fb"
;
CFG
.
opfStatisticSdk_appid
=
"d4168704-ab8a-42ac-b9f6-d816bd7e1062"
;
}
// app端投放的商户id
CFG
.
MER_ID
=
getUrlParam
(
'merId'
)
||
'10478'
;
if
(
!
getUrlParam
(
"appID"
))
{
// alert("【警告】检测到活动url中没有appID参数\n缺少该参数会导致埋点、分享、app信息获取错误。")
}
</script>
</head>
CFG
.
opfStatisticSdk_appid
=
"db5681a6-2bdf-4e6d-8c96-930e988c3b3b"
;
if
(
CFG
.
projectId
==
"p16fceb94"
)
{
// 测试项目
CFG
.
opfStatisticSdk_pfid
=
"be_2zFRQQ2Fb"
;
CFG
.
opfStatisticSdk_appid
=
"d4168704-ab8a-42ac-b9f6-d816bd7e1062"
;
}
// app端投放的商户id
CFG
.
MER_ID
=
getUrlParam
(
"merId"
)
||
"10478"
;
if
(
!
getUrlParam
(
"appID"
))
{
// alert("【警告】检测到活动url中没有appID参数\n缺少该参数会导致埋点、分享、app信息获取错误。")
}
</script>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div
id=
"root"
></div>
<!--
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div
id=
"root"
></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
...
...
@@ -121,6 +116,5 @@
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</body>
</html>
src/components/rulepop/rulepop.jsx
View file @
2af6dfab
...
...
@@ -34,8 +34,8 @@ class Rulepop extends React.Component {
const
{
item
}
=
this
.
props
.
popData
||
{};
const
[
wxUrl1
,
wxUrl2
]
=
item
?.
wxUrl
?.
split
?.(
","
)
||
[];
const
[
appUrl1
,
appUrl2
]
=
item
?.
appUrl
?.
split
?.(
","
)
||
[];
opfStatisticSdkClick
(
`detail-btn-
${
item
.
id
}
`
,
`
${
item
.
remark
}
弹窗按钮
${
type
===
2
?
"2"
:
""
}
`
);
handleLogClick
(
1
,
5
,
`
${
item
.
remark
}
分会场`
,
type
===
1
?
0
:
1
);
opfStatisticSdkClick
(
`detail-btn-
${
item
.
id
}
`
,
`
${
item
.
remark
}
分会场活动弹窗-参与活动
${
type
===
2
?
"2"
:
""
}
`
);
handleLogClick
(
1
,
5
,
`
${
item
.
remark
}
分会场
活动弹窗-参与活动
`
,
type
===
1
?
0
:
1
);
const
wxUrl
=
type
===
1
?
wxUrl1
:
wxUrl2
;
const
appUrl
=
type
===
1
?
appUrl1
:
appUrl2
;
...
...
src/pages/HomePage/index.jsx
View file @
2af6dfab
...
...
@@ -31,14 +31,14 @@ class ShouYe extends React.Component {
handleLogExposure
(
1
,
2
);
// 首页-分会场活动按钮曝光
store
?.
homeInfo
?.
activityInfo
?.
map
((
act
,
index
)
=>
{
handleLogExposure
(
1
,
3
,
`
${
index
+
1
}
_
${
act
.
remark
}
分会场
入口
按钮`
);
handleLogExposure
(
1
,
3
,
`
${
index
+
1
}
_
${
act
.
remark
}
分会场
活动
按钮`
);
});
}
handleClickJump
=
_asyncThrottle
(
async
(
item
,
index
)
=>
{
await
store
.
appAuth
(()
=>
{
handleLogClick
(
1
,
3
,
`
${
index
+
1
}
_
${
item
.
remark
}
分会场
入口
按钮`
);
opfStatisticSdkClick
(
`join-btn-
${
index
+
1
}
`
,
`
${
item
.
remark
}
分会场入口
按钮`
);
handleLogClick
(
1
,
3
,
`
${
index
+
1
}
_
${
item
.
remark
}
分会场
活动
按钮`
);
opfStatisticSdkClick
(
`join-btn-
${
index
+
1
}
`
,
`
首页-
${
item
.
remark
}
分会场活动
按钮`
);
// 如果没有规则内容,直接跳转
const
{
rule
,
wxUrl
,
appUrl
}
=
item
;
...
...
@@ -66,6 +66,7 @@ class ShouYe extends React.Component {
handleClickShare
=
_asyncThrottle
(
async
()
=>
{
handleLogClick
(
1
,
2
);
opfStatisticSdkClick
(
`share-btn`
,
'首页-分享按'
);
shareStore
.
doShare
();
},
1000
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment