Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
飞
飞鹤小程序
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
FH
飞鹤小程序
Commits
c9ffd775
Commit
c9ffd775
authored
Aug 26, 2025
by
张九刚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 首页埋点
parent
7352416d
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
420 additions
and
33 deletions
+420
-33
.DS_Store
.DS_Store
+0
-0
settings.json
.vscode/settings.json
+177
-0
request.js
api/request.js
+2
-2
md.js
md.js
+48
-2
home.json
mock/home.json
+15
-11
exposure.js
utils/exposure.js
+6
-1
Home.vue
views/Home.vue
+172
-17
No files found.
.DS_Store
View file @
c9ffd775
No preview for this file type
.vscode/settings.json
0 → 100644
View file @
c9ffd775
{
"editor.semanticHighlighting.enabled"
:
false
,
"files.associations"
:
{
"*.wxml"
:
"html"
,
"*.wxss"
:
"css"
,
"*.wxs"
:
"javascript"
},
"editor.tokenColorCustomizations"
:
{
"comments"
:
"#9AA0A6"
,
"textMateRules"
:
[
{
"scope"
:
[
"comment"
,
"comment.block"
,
"comment.block.documentation"
,
"punctuation.definition.comment"
],
"settings"
:
{
"foreground"
:
"#9AA0A6"
}
},
{
"scope"
:
[
"comment.block.html"
,
"punctuation.definition.comment.html"
,
"comment.block.vue"
,
"punctuation.definition.comment.vue"
,
"comment.block.vue-html"
,
"punctuation.definition.comment.vue-html"
,
"comment.block.xml"
,
"punctuation.definition.comment.xml"
],
"settings"
:
{
"foreground"
:
"#9AA0A6"
}
},
{
"scope"
:
[
"comment.block.js"
,
"comment.line.double-slash.js"
,
"punctuation.definition.comment.js"
,
"comment.block.javascript"
,
"comment.line.double-slash.javascript"
,
"punctuation.definition.comment.javascript"
],
"settings"
:
{
"foreground"
:
"#9AA0A6"
}
},
{
"scope"
:
[
"comment.block.css"
,
"punctuation.definition.comment.css"
],
"settings"
:
{
"foreground"
:
"#9AA0A6"
}
}
],
"[Default Dark+]"
:
{
"comments"
:
"#9AA0A6"
,
"textMateRules"
:
[
{
"scope"
:
[
"comment"
,
"comment.block"
,
"comment.block.documentation"
,
"punctuation.definition.comment"
,
"comment.block.html"
,
"punctuation.definition.comment.html"
,
"comment.block.vue"
,
"punctuation.definition.comment.vue"
,
"comment.block.vue-html"
,
"punctuation.definition.comment.vue-html"
,
"comment.block.xml"
,
"punctuation.definition.comment.xml"
,
"comment.block.js"
,
"comment.line.double-slash.js"
,
"punctuation.definition.comment.js"
,
"comment.block.javascript"
,
"comment.line.double-slash.javascript"
,
"punctuation.definition.comment.javascript"
,
"comment.block.css"
,
"punctuation.definition.comment.css"
],
"settings"
:
{
"foreground"
:
"#9AA0A6"
}
}
]
},
"[Default Light+]"
:
{
"comments"
:
"#80868B"
,
"textMateRules"
:
[
{
"scope"
:
[
"comment"
,
"comment.block"
,
"comment.block.documentation"
,
"punctuation.definition.comment"
,
"comment.block.html"
,
"punctuation.definition.comment.html"
,
"comment.block.vue"
,
"punctuation.definition.comment.vue"
,
"comment.block.vue-html"
,
"punctuation.definition.comment.vue-html"
,
"comment.block.xml"
,
"punctuation.definition.comment.xml"
,
"comment.block.js"
,
"comment.line.double-slash.js"
,
"punctuation.definition.comment.js"
,
"comment.block.javascript"
,
"comment.line.double-slash.javascript"
,
"punctuation.definition.comment.javascript"
,
"comment.block.css"
,
"punctuation.definition.comment.css"
],
"settings"
:
{
"foreground"
:
"#80868B"
}
}
]
},
"[Cursor Dark]"
:
{
"comments"
:
"#9AA0A6"
,
"textMateRules"
:
[
{
"scope"
:
[
"comment"
,
"comment.block"
,
"comment.block.documentation"
,
"punctuation.definition.comment"
,
"comment.block.html"
,
"punctuation.definition.comment.html"
,
"comment.block.vue"
,
"punctuation.definition.comment.vue"
,
"comment.block.vue-html"
,
"punctuation.definition.comment.vue-html"
,
"comment.block.xml"
,
"punctuation.definition.comment.xml"
,
"comment.block.js"
,
"comment.line.double-slash.js"
,
"punctuation.definition.comment.js"
,
"comment.block.javascript"
,
"comment.line.double-slash.javascript"
,
"punctuation.definition.comment.javascript"
,
"comment.block.css"
,
"punctuation.definition.comment.css"
],
"settings"
:
{
"foreground"
:
"#9AA0A6"
}
}
]
},
"[Cursor Light]"
:
{
"comments"
:
"#80868B"
,
"textMateRules"
:
[
{
"scope"
:
[
"comment"
,
"comment.block"
,
"comment.block.documentation"
,
"punctuation.definition.comment"
,
"comment.block.html"
,
"punctuation.definition.comment.html"
,
"comment.block.vue"
,
"punctuation.definition.comment.vue"
,
"comment.block.vue-html"
,
"punctuation.definition.comment.vue-html"
,
"comment.block.xml"
,
"punctuation.definition.comment.xml"
,
"comment.block.js"
,
"comment.line.double-slash.js"
,
"punctuation.definition.comment.js"
,
"comment.block.javascript"
,
"comment.line.double-slash.javascript"
,
"punctuation.definition.comment.javascript"
,
"comment.block.css"
,
"punctuation.definition.comment.css"
],
"settings"
:
{
"foreground"
:
"#80868B"
}
}
]
}
},
"editor.semanticTokenColorCustomizations"
:
{
"enabled"
:
false
}
}
api/request.js
View file @
c9ffd775
...
@@ -16,8 +16,8 @@ const {
...
@@ -16,8 +16,8 @@ const {
// request.js
// request.js
// 通常可以吧 baseUrl 单独放在一个 js 文件了
// 通常可以吧 baseUrl 单独放在一个 js 文件了
// const baseUrl = "http://172.16.230.108:7777/pmall";
// const baseUrl = "http://172.16.230.108:7777/pmall";
//
const baseUrl = "https://momclub-uat.feihe.com/pmall";//测试环境
const
baseUrl
=
"https://momclub-uat.feihe.com/pmall"
;
//测试环境
let
baseUrl
=
"https://momclub.feihe.com/pmall"
;
//生产环境
//
let baseUrl = "https://momclub.feihe.com/pmall";//生产环境
// const baseUrl = "https://docs.dui88.com/mock/1956/api";//mock
// const baseUrl = "https://docs.dui88.com/mock/1956/api";//mock
// const baseUrl = "https://feihe.m.duibatest.com.cn/pmall"
// const baseUrl = "https://feihe.m.duibatest.com.cn/pmall"
...
...
md.js
View file @
c9ffd775
...
@@ -62,13 +62,13 @@ const sensorLog = (evt) => {
...
@@ -62,13 +62,13 @@ const sensorLog = (evt) => {
trackObj
[
key
]
=
logObj
[
key
];
trackObj
[
key
]
=
logObj
[
key
];
}
}
if
(
xcxPage
&&
xcxPage
.
length
>
0
)
{
if
(
xcxPage
&&
xcxPage
.
length
>
0
)
{
console
.
warn
(
"xcxPage"
,
trackObj
);
//
console.warn("xcxPage", trackObj);
sensors
.
track
(
"xcxPage"
,
{
sensors
.
track
(
"xcxPage"
,
{
...
trackObj
,
...
trackObj
,
});
});
}
}
if
(
xcxClick
&&
xcxClick
.
length
>
0
)
{
if
(
xcxClick
&&
xcxClick
.
length
>
0
)
{
console
.
warn
(
"xcxClick"
,
trackObj
);
//
console.warn("xcxClick", trackObj);
sensors
.
track
(
"xcxClick"
,
{
sensors
.
track
(
"xcxClick"
,
{
...
trackObj
,
...
trackObj
,
});
});
...
@@ -91,10 +91,56 @@ const sensorLogTake = (logObj) => {
...
@@ -91,10 +91,56 @@ const sensorLogTake = (logObj) => {
};
};
sensorLog
(
evt
);
sensorLog
(
evt
);
};
};
const
sensorComponentLog
=
(
evt
)
=>
{
const
_dataset
=
evt
.
currentTarget
.
dataset
;
const
logObj
=
_dataset
.
comlog
;
if
(
!
logObj
)
{
return
;
}
const
{
xcxComponentExposure
,
xcxComponentClick
}
=
logObj
;
let
trackObj
=
{};
for
(
let
key
in
logObj
)
{
trackObj
[
key
]
=
logObj
[
key
];
}
if
(
xcxComponentExposure
&&
xcxComponentExposure
.
length
>
0
)
{
console
.
warn
(
"-----xcxComponentExposure-----"
,
trackObj
);
sensors
.
track
(
"xcxComponentExposure"
,
{
...
trackObj
,
});
}
if
(
xcxComponentClick
&&
xcxComponentClick
.
length
>
0
)
{
console
.
warn
(
"-----xcxComponentClick-----"
,
trackObj
);
sensors
.
track
(
"xcxComponentClick"
,
{
...
trackObj
,
});
}
};
/**
* 主动通过配置数据触发埋点
* @param {*} evt
*/
const
sensorComponentLogTake
=
(
logObj
)
=>
{
if
(
!
logObj
)
{
return
;
}
const
evt
=
{
currentTarget
:
{
dataset
:
{
comlog
:
logObj
,
},
},
};
sensorComponentLog
(
evt
);
};
export
default
{
export
default
{
init
,
init
,
sensors
,
sensors
,
login
,
login
,
sensorLog
,
sensorLog
,
sensorLogTake
,
sensorLogTake
,
sensorComponentLog
,
sensorComponentLogTake
,
};
};
mock/home.json
View file @
c9ffd775
...
@@ -33,17 +33,6 @@
...
@@ -33,17 +33,6 @@
"jtIcon"
:
"homepage/tool_jt.png"
,
"jtIcon"
:
"homepage/tool_jt.png"
,
"subtitle"
:
"更多妈妈都在用,告别手忙脚乱,助你轻松带娃!"
,
"subtitle"
:
"更多妈妈都在用,告别手忙脚乱,助你轻松带娃!"
,
"tools"
:
[
"tools"
:
[
{
"icon"
:
"homepage/tool_icon_1.png"
,
"link"
:
{
"extra"
:
{},
"type"
:
1
,
"url"
:
"/pages/naming/naming"
},
"context"
:
"AI生成吉利好名"
,
"type"
:
1
,
"title"
:
"AI起名"
},
{
{
"icon"
:
"homepage/tool_icon_2.png"
,
"icon"
:
"homepage/tool_icon_2.png"
,
"link"
:
{
"link"
:
{
...
@@ -114,13 +103,28 @@
...
@@ -114,13 +103,28 @@
"type"
:
1
,
"type"
:
1
,
"url"
:
"/pages/syWebview/syWebview?p=xmh09"
"url"
:
"/pages/syWebview/syWebview?p=xmh09"
},
},
"title"
:
"北纬47°鲜活溯源之旅"
,
"type"
:
1
,
"type"
:
1
,
"url"
:
"homepage/homeSwiper/V1/7.jpg"
"url"
:
"homepage/homeSwiper/V1/7.jpg"
},
},
{
{
"videoUrl"
:
"homepage/homeSwiper/V1/2.m4v"
,
"videoUrl"
:
"homepage/homeSwiper/V1/2.m4v"
,
"link"
:
{},
"link"
:
{},
"title"
:
"成为妈妈更懂妈妈"
,
"url"
:
"homepage/homeSwiper/V1/2.png"
"url"
:
"homepage/homeSwiper/V1/2.png"
},
{
"img"
:
"homepage/homeSwiper/V1/28会员日.jpg"
,
"title"
:
"28会员日"
,
"link"
:
{
"extra"
:
{
"envVersion"
:
"release"
,
"appId"
:
"wx4205ec55b793245e"
},
"type"
:
2
,
"url"
:
"/subPackages/shopMainList/topicNew/index?id=1001087"
},
"url"
:
"homepage/homeSwiper/V1/28会员日.jpg"
}
}
],
],
"childrenInfoList"
:
[
"childrenInfoList"
:
[
...
...
utils/exposure.js
View file @
c9ffd775
...
@@ -58,8 +58,13 @@ class ExposureTracker {
...
@@ -58,8 +58,13 @@ class ExposureTracker {
const
isVisible
=
this
.
isElementInViewport
(
res
,
scrollTop
);
const
isVisible
=
this
.
isElementInViewport
(
res
,
scrollTop
);
if
(
isVisible
&&
!
value
.
isExposed
)
{
if
(
isVisible
&&
!
value
.
isExposed
)
{
value
.
isExposed
=
true
;
value
.
isExposed
=
true
;
// 触发埋点
// 触发埋点
md
.
sensorLogTake
(
value
.
logParams
);
if
(
value
.
logParams
.
xcxComponentExposure
){
md
.
sensorComponentLogTake
(
value
.
logParams
);
}
else
{
md
.
sensorLogTake
(
value
.
logParams
);
}
}
}
});
});
});
});
...
...
views/Home.vue
View file @
c9ffd775
This diff is collapsed.
Click to expand it.
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