703 lines
78 KiB
HTML
703 lines
78 KiB
HTML
|
<!doctype html>
|
|||
|
<html data-path="/p/:id">
|
|||
|
<head>
|
|||
|
<meta charset="UTF-8">
|
|||
|
<meta name="viewport"
|
|||
|
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover">
|
|||
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|||
|
<meta name="og:url" content="https://36kr.com/p/1722376536065"><meta name="og:type" content="article"><meta data-react-helmet="true" name="baidu-site-verification" content="ET7tYDCqIv"/><meta data-react-helmet="true" name="shenma-site-verification" content="8d43b014716644e38cc8fff2051c47a0_1623316092"/><meta data-react-helmet="true" name="360-site-verification" content="b14201a8708468357bd6fab4ad556b78"/><meta data-react-helmet="true" name="sogou_site_verification" content="5ZZdpkOf3U"/><meta data-react-helmet="true" name="renderer" content="webkit"/><meta data-react-helmet="true" name="apple-mobile-web-app-title" content="Title"/><meta data-react-helmet="true" name="apple-mobile-web-app-capable" content="yes"/><meta data-react-helmet="true" name="apple-mobile-web-app-status-bar-style" content="black"/><meta data-react-helmet="true" name="HandheldFriendly" content="True"/><meta data-react-helmet="true" name="MobileOptimized" content="320"/><meta data-react-helmet="true" name="applicable-device" content="pc"/><meta data-react-helmet="true" name="format-detection" content="telephone=no"/><meta data-react-helmet="true" property="og:description" content="深夜友好型心理内容,KnowYourself。"/><meta data-react-helmet="true" property="og:image" content="https://img.36krcdn.com/20200409/v2_9c2f935370f94b408e1be0be6349205b_img_000"/><meta data-react-helmet="true" property="og:title" content="36氪专访|时代心理诊所「KnowYourself」,和一群直面「心理困惑」的年轻人-36氪"/><meta data-react-helmet="true" name="description" content="深夜友好型心理内容,KnowYourself。"/><meta data-react-helmet="true" name="keywords" content="资讯,股票,创业,投资,资本市场,汽车,教育,职业,房产,36氪首发,游戏,上市,新商业,新经济,网红经济,黑科技,最前沿,最前线,无人驾驶,自动驾驶,物联网,车联网,互联网,科技"/><meta data-react-helmet="true" name="popintimestamp" content="1522126218000"/><meta data-react-helmet="true" name="mobile-agent" content="format=xhtml; url=https://m.36kr.com/p/1722376536065"/><meta data-react-helmet="true" name="mobile-agent" content="format=html5; url=https://m.36kr.com/p/1722376536065"/><meta data-react-helmet="true" property="article:published_time" content="2018-03-27 12:50:18"/><meta data-react-helmet="true" property="author" content="克里斯唐"/>
|
|||
|
<title data-react-helmet="true">36氪专访|时代心理诊所「KnowYourself」,和一群直面「心理困惑」的年轻人-36氪</title>
|
|||
|
<link href="//static.36krcdn.com/36kr-web/static/app.5ad49285.css" rel="stylesheet" />
|
|||
|
<link rel="stylesheet" type="text/css" href="//static.36krcdn.com/36kr-web/static/article.32fc8bea.css">
|
|||
|
|
|||
|
<link data-react-helmet="true" href="/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon"/><link data-react-helmet="true" rel="dns-prefetch" href="//sta.36krcnd.com"/><link data-react-helmet="true" rel="dns-prefetch" href="//pic.36krcnd.com"/><link data-react-helmet="true" rel="dns-prefetch" href="//static.36krcnd.com"/><link data-react-helmet="true" rel="dns-prefetch" href="//img.36krcnd.com"/><link data-react-helmet="true" rel="dns-prefetch" href="//file.36krcnd.com"/><link data-react-helmet="true" rel="alternate" media="only screen and(max-width: 640px)" href="https://m.36kr.com/p/1722376536065"/><link data-react-helmet="true" rel="canonical" href="https://36kr.com/p/1722376536065"/><script data-react-helmet="true" >
|
|||
|
window.WEIXINSHARE = {
|
|||
|
shareTitle: "36氪_让一部分人先看到未来",
|
|||
|
shareImg: "https://img.36krcdn.com/20191024/v2_1571894049839_img_jpg",
|
|||
|
imgUrl: "https://img.36krcdn.com/20191024/v2_1571894049839_img_jpg",
|
|||
|
shareDesc: "36氪为您提供创业资讯、科技新闻、投融资对接、股权投资、极速融资等创业服务,致力成为创业者可以依赖的创业服务平台,为创业者提供最好的产品和服务。"
|
|||
|
}
|
|||
|
</script><script data-react-helmet="true" >
|
|||
|
// sem 统计代码
|
|||
|
var _hmt= _hmt||[];
|
|||
|
(function(){
|
|||
|
var hm = document.createElement("script");
|
|||
|
hm.src = "https://hm.baidu.com/hm.js?1684191ccae0314c6254306a8333d090";
|
|||
|
var s = document.getElementsByTagName("script")[0];
|
|||
|
s.parentNode.insertBefore(hm,s);
|
|||
|
})();
|
|||
|
</script><script data-react-helmet="true" >
|
|||
|
//百度统计代码
|
|||
|
var _hmt = _hmt || [];
|
|||
|
(function () {
|
|||
|
var hm = document.createElement('script');
|
|||
|
hm.src = "https://hm.baidu.com/hm.js?713123c60a0e86982326bae1a51083e1";
|
|||
|
var s = document.getElementsByTagName('script')[0];
|
|||
|
s.parentNode.insertBefore(hm, s);
|
|||
|
})();
|
|||
|
</script><script data-react-helmet="true" >
|
|||
|
// 给百度seo主动推送, 文明确认
|
|||
|
(function () {
|
|||
|
var bp = document.createElement('script');
|
|||
|
var curProtocol = window.location.protocol.split(':')[0];
|
|||
|
if (curProtocol === 'https') {
|
|||
|
bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
|
|||
|
}
|
|||
|
else {
|
|||
|
bp.src = 'http://push.zhanzhang.baidu.com/push.js';
|
|||
|
}
|
|||
|
var s = document.getElementsByTagName("script")[0];
|
|||
|
s.parentNode.insertBefore(bp, s);
|
|||
|
})();
|
|||
|
</script><script data-react-helmet="true" src="https://static.geetest.com/static/tools/gt.js"></script><script data-react-helmet="true" >
|
|||
|
// 神策统计代码
|
|||
|
(function(para) {
|
|||
|
var p = para.sdk_url, n = para.name, w = window, d = document, s = 'script',x = null,y = null;
|
|||
|
w['sensorsDataAnalytic201505'] = n;
|
|||
|
w[n] = w[n] || function(a) {return function() {(w[n]._q = w[n]._q || []).push([a, arguments]);}};
|
|||
|
var ifs = ['track','quick','register','registerPage','registerOnce','trackSignup', 'trackAbtest', 'setProfile','setOnceProfile','appendProfile', 'incrementProfile', 'deleteProfile', 'unsetProfile', 'identify','login','logout','trackLink','clearAllRegister','getAppStatus'];
|
|||
|
for (var i = 0; i < ifs.length; i++) {
|
|||
|
w[n][ifs[i]] = w[n].call(null, ifs[i]);
|
|||
|
}
|
|||
|
if (!w[n]._t) {
|
|||
|
x = d.createElement(s), y = d.getElementsByTagName(s)[0];
|
|||
|
x.async = 1;
|
|||
|
x.src = p;
|
|||
|
x.setAttribute('charset','UTF-8');
|
|||
|
y.parentNode.insertBefore(x, y);
|
|||
|
w[n].para = para;
|
|||
|
}
|
|||
|
})({
|
|||
|
sdk_url: 'https://static.sensorsdata.cn/sdk/1.12.5/sensorsdata.min.js',
|
|||
|
heatmap_url: 'https://static.sensorsdata.cn/sdk/1.12.5/heatmap.min.js',
|
|||
|
name: 'sa',
|
|||
|
web_url: 'https://data.corp.36kr.com/',
|
|||
|
server_url: "https://36kr.com/global/sensors/sa/sa",
|
|||
|
heatmap:{
|
|||
|
//default 表示开启,自动采集 $WebClick 事件,可以设置 'not_collect' 表示关闭。
|
|||
|
clickmap:'default',
|
|||
|
//default 表示开启,自动采集 $WebStay 事件,可以设置 'not_collect' 表示关闭。
|
|||
|
scroll_notice_map:'default'
|
|||
|
},
|
|||
|
source_type: {
|
|||
|
search: ['//baidu.com', 'cn.bing.com', '//sm.cn', 'quark.sm.cn'],
|
|||
|
social: ['.facebook.com'],
|
|||
|
},
|
|||
|
show_log: false,
|
|||
|
});
|
|||
|
(function(){
|
|||
|
const cookies = {};
|
|||
|
document.cookie.split('; ').forEach((c) => {
|
|||
|
const key = c.split('=')[0];
|
|||
|
const value = c.split('=')[1];
|
|||
|
cookies[key] = value;
|
|||
|
});
|
|||
|
const userid = cookies["userId"];
|
|||
|
const cid = cookies["kr_stat_uuid"];
|
|||
|
if (userid) {
|
|||
|
sa.login(userid);
|
|||
|
} else {
|
|||
|
sa.login(cid);
|
|||
|
}
|
|||
|
|
|||
|
sa.quick('autoTrack');
|
|||
|
})();
|
|||
|
</script><script data-react-helmet="true" >
|
|||
|
window.WEIXINSHARE = {
|
|||
|
shareTitle: "36氪专访|时代心理诊所「KnowYourself」,和一群直面「心理困惑」的年轻人-36氪",
|
|||
|
shareImg: "https://img.36krcdn.com/20200409/v2_9c2f935370f94b408e1be0be6349205b_img_000",
|
|||
|
imgUrl: "https://img.36krcdn.com/20200409/v2_9c2f935370f94b408e1be0be6349205b_img_000",
|
|||
|
shareDesc: "深夜友好型心理内容,KnowYourself。"
|
|||
|
}
|
|||
|
</script><script data-react-helmet="true" >
|
|||
|
(function () {
|
|||
|
var bp = document.createElement('script');
|
|||
|
var curProtocol = window.location.protocol.split(':')[0];
|
|||
|
if (curProtocol === 'https') {
|
|||
|
bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
|
|||
|
}
|
|||
|
else {
|
|||
|
bp.src = 'http://push.zhanzhang.baidu.com/push.js';
|
|||
|
}
|
|||
|
var s = document.getElementsByTagName("script")[0];
|
|||
|
s.parentNode.insertBefore(bp, s);
|
|||
|
})();
|
|||
|
</script><script>var __assign = (this && this.__assign) || function () {
|
|||
|
__assign = Object.assign || function(t) {
|
|||
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|||
|
s = arguments[i];
|
|||
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|||
|
t[p] = s[p];
|
|||
|
}
|
|||
|
return t;
|
|||
|
};
|
|||
|
return __assign.apply(this, arguments);
|
|||
|
};
|
|||
|
// 埋点需求详情 https://shimo.im/sheets/aJg66OpLVX0PGC28/
|
|||
|
/*****工具方法*****/
|
|||
|
function isNumber(path) {
|
|||
|
return !isNaN(Number(path));
|
|||
|
}
|
|||
|
function isObj(key) {
|
|||
|
return typeof key === 'object';
|
|||
|
}
|
|||
|
/**
|
|||
|
* 判断obj中是否有key这个属性
|
|||
|
* @param obj {object}
|
|||
|
* @param key {string}
|
|||
|
*/
|
|||
|
function objHasKey(obj, key) {
|
|||
|
return obj.hasOwnProperty(key);
|
|||
|
}
|
|||
|
/**
|
|||
|
* @param {{
|
|||
|
* control: Boolean,
|
|||
|
* key: string,
|
|||
|
* value: string,
|
|||
|
* data?: obj,
|
|||
|
* elseValue?: string
|
|||
|
* }} option
|
|||
|
*
|
|||
|
* 参数说明:
|
|||
|
* control 判断条件
|
|||
|
* data 最终返回的对象
|
|||
|
* key 添加到data中的属性
|
|||
|
* value 要添加的值
|
|||
|
* elseValue 如果control不成立,添加到data的值 传入此参数则添加,不传则不会添加
|
|||
|
*/
|
|||
|
function setProperty(option) {
|
|||
|
var _a = option.data, data = _a === void 0 ? {} : _a, key = option.key, value = option.value, control = option.control, elseValue = option.elseValue;
|
|||
|
if (control) {
|
|||
|
data[key] = value;
|
|||
|
}
|
|||
|
else if (elseValue) {
|
|||
|
data[key] = elseValue;
|
|||
|
}
|
|||
|
return data;
|
|||
|
}
|
|||
|
function getClass(attributes) {
|
|||
|
var classObj = attributes.class || {};
|
|||
|
return classObj.value || "";
|
|||
|
}
|
|||
|
var Platform;
|
|||
|
(function (Platform) {
|
|||
|
Platform["H5"] = "H5";
|
|||
|
Platform["WEB"] = "web";
|
|||
|
})(Platform || (Platform = {}));
|
|||
|
;
|
|||
|
function judgePlatform(userAgent) {
|
|||
|
if (!userAgent && typeof window !== 'undefined') {
|
|||
|
userAgent = navigator.userAgent;
|
|||
|
}
|
|||
|
if (!userAgent)
|
|||
|
return Platform.WEB;
|
|||
|
if (userAgent.match(/iPad|iPhone/i)) {
|
|||
|
return Platform.H5;
|
|||
|
}
|
|||
|
else if (userAgent.match(/Android/i)) {
|
|||
|
return Platform.H5;
|
|||
|
}
|
|||
|
return Platform.WEB;
|
|||
|
}
|
|||
|
/*****工具方法end*****/
|
|||
|
/**
|
|||
|
* 统计点击跳转外链的数据
|
|||
|
* 包括media_content_id、media_event_value、source_id、media_source
|
|||
|
* @param {String} hrefValue
|
|||
|
*/
|
|||
|
function externalLink(hrefValue) {
|
|||
|
var data = {};
|
|||
|
var externalLinkList = [
|
|||
|
{ pathKey: '/', mediaSourceValue: 'page_home' },
|
|||
|
{ pathKey: 'p', mediaSourceValue: 'article' },
|
|||
|
{ pathKey: 'newsflashes', mediaSourceValue: 'newsflash', subPathNotNumMediaSourceValue: 'page_newsflashes' },
|
|||
|
{ pathKey: 'topics', mediaSourceValue: 'topics' },
|
|||
|
];
|
|||
|
var pathInfo = new PathInfo(window.location.pathname);
|
|||
|
// 记录外链url
|
|||
|
data.media_content_id = hrefValue;
|
|||
|
// 详情页中(当前地址包含ID),含有外链,发送source_id
|
|||
|
Object.assign(data, setProperty({
|
|||
|
control: isNumber(pathInfo.sub),
|
|||
|
key: 'source_id',
|
|||
|
value: pathInfo.sub,
|
|||
|
}));
|
|||
|
// 地方站 外链记录media_event_value
|
|||
|
if (pathInfo.root === 'local') {
|
|||
|
data.media_event_value = 'local_' + pathInfo.sub;
|
|||
|
}
|
|||
|
return Object.assign(data, genMediaSource(externalLinkList, isNumber(pathInfo.sub)));
|
|||
|
}
|
|||
|
/**
|
|||
|
* 统计点击跳转www.36kr.com内链的数据
|
|||
|
* 根据主站路由规则,分析点击的地址
|
|||
|
* 收集source_id、media_source、media_event_value、media_content_type、media_content_id
|
|||
|
* @param {String} hrefValue
|
|||
|
* @param {String} className 点击的a标签所带class
|
|||
|
*/
|
|||
|
function internalLink(hrefValue, className) {
|
|||
|
var pageInfo = new PageInfo(hrefValue);
|
|||
|
var data = {};
|
|||
|
/* 聚合页跳转id */
|
|||
|
Object.assign(data, setProperty({
|
|||
|
control: pageInfo.currentPath.sub && isNumber(pageInfo.currentPath.sub) && pageInfo.destPath.sub && isNumber(pageInfo.destPath.sub),
|
|||
|
key: 'source_id',
|
|||
|
value: pageInfo.currentPath.sub,
|
|||
|
}));
|
|||
|
/* 搜索结果、资讯、地方 */
|
|||
|
Object.assign(data, genMediaEventValue(hrefValue));
|
|||
|
// 文章详情含有跳转链接
|
|||
|
Object.assign(data, setProperty({
|
|||
|
control: pageInfo.currentPath.root === 'p' && isNumber(pageInfo.currentPath.sub) && isNumber(pageInfo.destPath.sub),
|
|||
|
key: 'media_source',
|
|||
|
value: 'article',
|
|||
|
}));
|
|||
|
/* 不同页面,进入详情页 */
|
|||
|
Object.assign(data, intoDetailPage(pageInfo.destPath.sub));
|
|||
|
/* 添加media_conten_type 针对相应页面添加属性 */
|
|||
|
Object.assign(data, genContentTypeAndId(hrefValue, className));
|
|||
|
return data;
|
|||
|
}
|
|||
|
/**
|
|||
|
* 获取media_event_value统一方法
|
|||
|
* 点击搜索结果list和地方站list跳转到详情页
|
|||
|
* @param currentPath
|
|||
|
* @param subHref
|
|||
|
*/
|
|||
|
function genMediaEventValue(hrefValue) {
|
|||
|
var data = {};
|
|||
|
var key = 'media_event_value';
|
|||
|
var pageInfo = new PageInfo(hrefValue);
|
|||
|
var genMediaEventValueList = [
|
|||
|
{ pathKey: 'search', subPathList: [
|
|||
|
{ key: 'articles', value: 'search_articles' },
|
|||
|
{ key: 'newsflashes', value: 'search_flashnews' },
|
|||
|
{ key: 'video', value: 'search_videos' },
|
|||
|
{ key: 'monographic', value: 'search_topics' },
|
|||
|
{ key: 'user', value: 'search_writer' },
|
|||
|
] },
|
|||
|
{ pathKey: 'information', subPathList: [
|
|||
|
'web_news', 'contact', 'enterpriseservice', 'happy_life', 'travel',
|
|||
|
'real_estate', 'web_recommend', 'technology', { key: 'zhichang', value: 'web_zhichang' }, 'innovate',
|
|||
|
] },
|
|||
|
{ pathKey: 'local' }
|
|||
|
];
|
|||
|
for (var _i = 0, genMediaEventValueList_1 = genMediaEventValueList; _i < genMediaEventValueList_1.length; _i++) {
|
|||
|
var pathItem = genMediaEventValueList_1[_i];
|
|||
|
if (pageInfo.currentPath.root === pathItem.pathKey) {
|
|||
|
if (pageInfo.currentPath.root === 'local') {
|
|||
|
// 城市
|
|||
|
data.media_event_value = 'local_' + pageInfo.currentPath.sub;
|
|||
|
}
|
|||
|
else {
|
|||
|
for (var _a = 0, _b = pathItem.subPathList; _a < _b.length; _a++) {
|
|||
|
var subPathItem = _b[_a];
|
|||
|
var value = isObj(subPathItem) ? subPathItem.value : subPathItem;
|
|||
|
var subPathKey = isObj(subPathItem) ? subPathItem.key : subPathItem;
|
|||
|
if (pageInfo.currentPath.sub === subPathKey) {
|
|||
|
Object.assign(data, setProperty({
|
|||
|
control: isNumber(pageInfo.destPath.sub),
|
|||
|
key: key,
|
|||
|
value: value,
|
|||
|
}));
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
return data;
|
|||
|
}
|
|||
|
/**
|
|||
|
* 不同页面点击详情链接跳转到详情页,添加media_source
|
|||
|
* @param subHref
|
|||
|
*/
|
|||
|
function intoDetailPage(subHref) {
|
|||
|
var pathInfo = new PathInfo(window.location.pathname);
|
|||
|
var intoDetailPageList = [
|
|||
|
{ pathKey: '/', mediaSourceValue: 'page_home' },
|
|||
|
{ pathKey: '/video', mediaSourceValue: 'page_video' },
|
|||
|
{ pathKey: '/topics', mediaSourceValue: 'page_topics' },
|
|||
|
{ pathKey: 'newsflashes', control: isNumber(pathInfo.sub), mediaSourceValue: 'newsflash', subPathNotNumMediaSourceValue: 'page_newsflashes' },
|
|||
|
{ pathKey: 'information', mediaSourceValue: 'page_information' },
|
|||
|
{ pathKey: 'search', mediaSourceValue: 'page_search' },
|
|||
|
{ pathKey: 'Calendar', mediaSourceValue: 'calendar' },
|
|||
|
{ pathKey: 'user', mediaSourceValue: 'user' },
|
|||
|
{ pathKey: 'motif', mediaSourceValue: 'motif' },
|
|||
|
{ pathKey: 'topics', mediaSourceValue: 'topics' },
|
|||
|
{ pathKey: 'video', mediaSourceValue: 'video' },
|
|||
|
{ pathKey: 'audio', mediaSourceValue: 'audio' },
|
|||
|
];
|
|||
|
return genMediaSource(intoDetailPageList, isNumber(subHref));
|
|||
|
}
|
|||
|
/**
|
|||
|
* 获取media_source统一方法
|
|||
|
* 记录从何处跳转到的详情页
|
|||
|
* @param pathList
|
|||
|
* @param control
|
|||
|
*/
|
|||
|
function genMediaSource(pathList, control) {
|
|||
|
var pathInfo = new PathInfo(window.location.pathname);
|
|||
|
var key = 'media_source';
|
|||
|
var data = {};
|
|||
|
for (var _i = 0, pathList_1 = pathList; _i < pathList_1.length; _i++) {
|
|||
|
var pathItem = pathList_1[_i];
|
|||
|
if (pathInfo.path === pathItem.pathKey) {
|
|||
|
data.media_source = pathItem.mediaSourceValue;
|
|||
|
}
|
|||
|
else if (pathInfo.root === pathItem.pathKey && pathInfo.sub) {
|
|||
|
Object.assign(data, setProperty({
|
|||
|
control: objHasKey(pathItem, 'control') ? pathItem.control : control,
|
|||
|
key: key,
|
|||
|
value: pathItem.mediaSourceValue,
|
|||
|
elseValue: pathItem.subPathNotNumMediaSourceValue || null,
|
|||
|
}));
|
|||
|
}
|
|||
|
}
|
|||
|
return data;
|
|||
|
}
|
|||
|
/**
|
|||
|
* 记录跳转到的具体内容类型和具体内容id
|
|||
|
* @param hrefValue
|
|||
|
* @param className
|
|||
|
*/
|
|||
|
function genContentTypeAndId(hrefValue, className) {
|
|||
|
// 设置media_content_type和media_content_id
|
|||
|
var pageInfo = new PageInfo(hrefValue);
|
|||
|
var genContentTypeAndIdList = [
|
|||
|
{
|
|||
|
key: 'p',
|
|||
|
setData: {
|
|||
|
media_content_type: 'article',
|
|||
|
media_content_id: pageInfo.destPath.sub,
|
|||
|
}
|
|||
|
},
|
|||
|
{
|
|||
|
key: 'newsflashes',
|
|||
|
setData: {
|
|||
|
media_content_type: 'flashnews',
|
|||
|
media_content_id: pageInfo.destPath.sub,
|
|||
|
}
|
|||
|
},
|
|||
|
{
|
|||
|
key: 'video',
|
|||
|
setData: {
|
|||
|
media_content_type: 'video',
|
|||
|
media_content_id: pageInfo.destPath.sub,
|
|||
|
}
|
|||
|
},
|
|||
|
{
|
|||
|
key: 'v-video',
|
|||
|
setData: {
|
|||
|
media_content_type: 'video_portrait',
|
|||
|
media_content_id: pageInfo.destPath.sub,
|
|||
|
}
|
|||
|
},
|
|||
|
{
|
|||
|
key: 'topics',
|
|||
|
setData: {
|
|||
|
media_content_type: 'topic',
|
|||
|
media_content_id: pageInfo.destPath.sub,
|
|||
|
}
|
|||
|
},
|
|||
|
{
|
|||
|
key: 'motif',
|
|||
|
setData: {
|
|||
|
media_content_type: (function () {
|
|||
|
// TODO 这里声明了一个自执行函数,判断是否为商业主题后,给media_conten_type不同的值,可否优化?
|
|||
|
var isMotifList = pageInfo.currentPath.root === 'motif-catalog' && pageInfo.currentPath.sub === 'recomend';
|
|||
|
var isHomeEntry = className.includes('businessMotifHome-main-item-top-a');
|
|||
|
var isBusinessMotif = isMotifList || isHomeEntry;
|
|||
|
return isBusinessMotif ? 'business_motif' : 'motif';
|
|||
|
})(),
|
|||
|
media_content_id: pageInfo.destPath.sub,
|
|||
|
}
|
|||
|
},
|
|||
|
{
|
|||
|
key: 'user',
|
|||
|
setData: {
|
|||
|
media_content_type: 'user',
|
|||
|
media_content_id: pageInfo.destPath.sub,
|
|||
|
}
|
|||
|
},
|
|||
|
{
|
|||
|
key: 'column',
|
|||
|
setData: {
|
|||
|
media_content_type: 'audio',
|
|||
|
media_content_id: pageInfo.destPath.sub,
|
|||
|
}
|
|||
|
},
|
|||
|
];
|
|||
|
var data = {};
|
|||
|
if (!isNumber(pageInfo.destPath.sub))
|
|||
|
return data;
|
|||
|
for (var _i = 0, genContentTypeAndIdList_1 = genContentTypeAndIdList; _i < genContentTypeAndIdList_1.length; _i++) {
|
|||
|
var hrefItem = genContentTypeAndIdList_1[_i];
|
|||
|
if (pageInfo.destPath.root === hrefItem.key) {
|
|||
|
data = hrefItem.setData;
|
|||
|
}
|
|||
|
}
|
|||
|
return data;
|
|||
|
}
|
|||
|
/**
|
|||
|
* 根据高阶组件中,向a标签插入的属性
|
|||
|
* 收集对应的广告信息 和 从哪个具体推荐位跳转到的详情页
|
|||
|
* 对应的广告信息有
|
|||
|
* @param elementTarget 点击的a标签
|
|||
|
*/
|
|||
|
function genPropertyAccordingToAttribute(elementTarget) {
|
|||
|
// 推荐位跳转到详情页
|
|||
|
var operation_list = elementTarget.getAttribute('sensors_operation_list');
|
|||
|
// 运营位上具体第几帧、第几位、日签的日期
|
|||
|
var index_num = elementTarget.getAttribute('sensors_index_num');
|
|||
|
// 广告事件: 1、曝光 2、点击
|
|||
|
var operate_type = elementTarget.getAttribute('sensors_operate_type');
|
|||
|
// 具体广告位置id
|
|||
|
var position_id = elementTarget.getAttribute('sensors_position_id');
|
|||
|
// 具体广告的plan_id
|
|||
|
var plan_id = elementTarget.getAttribute('sensors_media_content_id');
|
|||
|
var genPropertyAccordingToAttributeList = [
|
|||
|
{
|
|||
|
control: operation_list === 'page_flow' && window.location.pathname === '/',
|
|||
|
key: 'operation_list',
|
|||
|
value: 'latest_articles',
|
|||
|
elseValue: 'page_flow'
|
|||
|
},
|
|||
|
{
|
|||
|
control: operation_list === 'banner',
|
|||
|
key: 'operation_list',
|
|||
|
value: 'banner'
|
|||
|
},
|
|||
|
{
|
|||
|
control: operation_list === 'banner_right',
|
|||
|
key: 'operation_list',
|
|||
|
value: 'banner_right'
|
|||
|
},
|
|||
|
{
|
|||
|
control: operation_list === 'author_latest_article',
|
|||
|
key: 'operation_list',
|
|||
|
value: 'author_latest_article'
|
|||
|
},
|
|||
|
{
|
|||
|
control: operation_list === 'specialtopic_recommend',
|
|||
|
key: 'operation_list',
|
|||
|
value: 'specialtopic_recommend'
|
|||
|
},
|
|||
|
{
|
|||
|
control: operation_list === 'video_recommend',
|
|||
|
key: 'operation_list',
|
|||
|
value: 'video_recommend'
|
|||
|
},
|
|||
|
{
|
|||
|
control: operation_list === 'dailyword',
|
|||
|
key: 'operation_list',
|
|||
|
value: 'dailyword'
|
|||
|
},
|
|||
|
{
|
|||
|
control: operation_list === 'latest_newsflash',
|
|||
|
key: 'operation_list',
|
|||
|
value: 'latest_newsflash'
|
|||
|
},
|
|||
|
{
|
|||
|
control: operation_list === 'business_motif',
|
|||
|
key: 'operation_list',
|
|||
|
value: 'business_motif'
|
|||
|
},
|
|||
|
{
|
|||
|
control: operation_list === 'hotlist',
|
|||
|
key: 'operation_list',
|
|||
|
value: 'hotlist'
|
|||
|
},
|
|||
|
{
|
|||
|
control: operation_list === 'latest_videos',
|
|||
|
key: 'operation_list',
|
|||
|
value: 'latest_videos'
|
|||
|
},
|
|||
|
{
|
|||
|
control: operation_list === 'recommend_motif',
|
|||
|
key: 'operation_list',
|
|||
|
value: 'recommend_motif'
|
|||
|
},
|
|||
|
{
|
|||
|
control: operation_list === 'hot_author',
|
|||
|
key: 'operation_list',
|
|||
|
value: 'hot_author'
|
|||
|
},
|
|||
|
{
|
|||
|
control: operation_list === 'next_card',
|
|||
|
key: 'operation_list',
|
|||
|
value: 'next_card'
|
|||
|
},
|
|||
|
{
|
|||
|
control: index_num,
|
|||
|
key: 'media_index_number',
|
|||
|
value: index_num
|
|||
|
},
|
|||
|
{
|
|||
|
control: operate_type,
|
|||
|
key: 'operate_type',
|
|||
|
value: operate_type
|
|||
|
},
|
|||
|
{
|
|||
|
control: position_id,
|
|||
|
key: 'position_id',
|
|||
|
value: position_id
|
|||
|
},
|
|||
|
{
|
|||
|
control: plan_id,
|
|||
|
key: 'media_content_id',
|
|||
|
value: plan_id
|
|||
|
},
|
|||
|
{
|
|||
|
control: operate_type || position_id,
|
|||
|
key: 'media_content_type',
|
|||
|
value: 'ad'
|
|||
|
},
|
|||
|
{
|
|||
|
control: position_id === '827' || operation_list === 'home_top',
|
|||
|
key: 'operation_list',
|
|||
|
value: 'home_top'
|
|||
|
},
|
|||
|
{
|
|||
|
control: position_id === '817',
|
|||
|
key: 'operation_list',
|
|||
|
value: 'article_bottom'
|
|||
|
},
|
|||
|
{
|
|||
|
control: position_id === '835',
|
|||
|
key: 'operation_list',
|
|||
|
value: 'comment_bottom'
|
|||
|
},
|
|||
|
];
|
|||
|
var data = {};
|
|||
|
for (var _i = 0, genPropertyAccordingToAttributeList_1 = genPropertyAccordingToAttributeList; _i < genPropertyAccordingToAttributeList_1.length; _i++) {
|
|||
|
var infoItem = genPropertyAccordingToAttributeList_1[_i];
|
|||
|
Object.assign(data, setProperty(infoItem));
|
|||
|
}
|
|||
|
return data;
|
|||
|
}
|
|||
|
// 暴露给神策api的方法,此方法返回的object,神策会统一收集上报
|
|||
|
function manualMain(elementTarget) {
|
|||
|
if (elementTarget.tagName.toLowerCase() !== 'a')
|
|||
|
throw Error('目前只收集点击a标签所跳转的信息');
|
|||
|
// TODO: 需要区分H5还是web
|
|||
|
var data = {
|
|||
|
platform: judgePlatform(window &&
|
|||
|
window.initialState &&
|
|||
|
window.initialState.navigator &&
|
|||
|
window.initialState.navigator.userAgent)
|
|||
|
};
|
|||
|
var attributes = elementTarget.attributes;
|
|||
|
var hrefObj = attributes.href || {};
|
|||
|
var className = getClass(attributes);
|
|||
|
var hrefValue = hrefObj.value || "";
|
|||
|
if ((/(http|ftp|https):\/\//.test(hrefValue) && !hrefValue.includes('36kr.com')) ||
|
|||
|
(/(http|ftp|https):\/\//.test(hrefValue) && hrefValue.includes('36kr.com/api/ad/'))) {
|
|||
|
Object.assign(data, externalLink(hrefValue));
|
|||
|
}
|
|||
|
else {
|
|||
|
var internalLinkHrefValue = hrefValue;
|
|||
|
if (hrefValue.includes('36kr.com'))
|
|||
|
internalLinkHrefValue = hrefValue.split('36kr.com')[1];
|
|||
|
Object.assign(data, internalLink(internalLinkHrefValue, className));
|
|||
|
}
|
|||
|
// 通过标签属性,添加相关信息
|
|||
|
Object.assign(data, genPropertyAccordingToAttribute(elementTarget));
|
|||
|
return data;
|
|||
|
}
|
|||
|
/**
|
|||
|
* 根据传入的地址生成路径信息
|
|||
|
*/
|
|||
|
var PathInfo = /** @class */ (function () {
|
|||
|
function PathInfo(path) {
|
|||
|
this.path = path;
|
|||
|
var pathArr = path.split('/').filter(function (x) { return x !== ""; });
|
|||
|
this.root = pathArr[0];
|
|||
|
this.sub = pathArr[1];
|
|||
|
}
|
|||
|
return PathInfo;
|
|||
|
}());
|
|||
|
// 分析当前地址和传入的地址,生成当前页面的地址信息,方便业务中的数据分析
|
|||
|
var PageInfo = /** @class */ (function () {
|
|||
|
function PageInfo(href) {
|
|||
|
this.destPath = __assign({}, new PathInfo(href), new SourcePath(href));
|
|||
|
this.currentPath = __assign({}, new PathInfo(window.location.pathname), new SourcePath(window.location.pathname));
|
|||
|
}
|
|||
|
return PageInfo;
|
|||
|
}());
|
|||
|
var SourcePath = /** @class */ (function () {
|
|||
|
function SourcePath(href) {
|
|||
|
this.group = SourcePath.groupFn(href);
|
|||
|
}
|
|||
|
SourcePath.groupFn = function (href) {
|
|||
|
var pathInfo = new PathInfo(href);
|
|||
|
if (pathInfo.sub && isNumber(pathInfo.sub)) {
|
|||
|
return 'content';
|
|||
|
}
|
|||
|
else {
|
|||
|
return 'default';
|
|||
|
}
|
|||
|
};
|
|||
|
return SourcePath;
|
|||
|
}());
|
|||
|
// 区分埋点的“关键事件”
|
|||
|
function getCaseKey(data) {
|
|||
|
if (data.hasOwnProperty('operate_type') ||
|
|||
|
data.hasOwnProperty('position_id')) {
|
|||
|
return 'MediaWebAD';
|
|||
|
}
|
|||
|
else {
|
|||
|
return 'MediaWebRead';
|
|||
|
}
|
|||
|
}
|
|||
|
function coverTagAClickEvent() {
|
|||
|
// document.querySelectorAll('a').forEach(item => {
|
|||
|
document.getElementById('app').addEventListener('click', function (e) {
|
|||
|
// 兼容性处理
|
|||
|
var event = e || window.event;
|
|||
|
var eventPath = event.path || [];
|
|||
|
var target = eventPath.filter(function (x) {
|
|||
|
return x && x.nodeName && x.nodeName.toLocaleLowerCase() === 'a';
|
|||
|
});
|
|||
|
// 判断是否匹配目标元素
|
|||
|
if (target.length !== 0) {
|
|||
|
var elementTarget = target[target.length - 1];
|
|||
|
if (elementTarget.getAttribute('sensors_do_not_send_data'))
|
|||
|
return;
|
|||
|
var targetValue_1 = elementTarget.getAttribute('target');
|
|||
|
var targetHref = elementTarget.getAttribute('href');
|
|||
|
var url_1 = elementTarget.href;
|
|||
|
var data = manualMain(elementTarget);
|
|||
|
if (!targetHref)
|
|||
|
return;
|
|||
|
if (!targetValue_1)
|
|||
|
e.preventDefault();
|
|||
|
if (window.sa && window.sa.track) {
|
|||
|
window.sa.track(getCaseKey(data), data, function () {
|
|||
|
if (!targetValue_1)
|
|||
|
location.href = url_1;
|
|||
|
});
|
|||
|
}
|
|||
|
else {
|
|||
|
if (!targetValue_1)
|
|||
|
location.href = url_1;
|
|||
|
}
|
|||
|
}
|
|||
|
});
|
|||
|
// });
|
|||
|
}
|
|||
|
// 手动埋点内容
|
|||
|
window.onload = function () {
|
|||
|
setTimeout(function () {
|
|||
|
coverTagAClickEvent();
|
|||
|
}, 0);
|
|||
|
};
|
|||
|
|
|||
|
//# sourceMappingURL=main.js.map
|
|||
|
</script>
|
|||
|
</head>
|
|||
|
<body>
|
|||
|
<div id="app"></div>
|
|||
|
<script>window.initialState={"state":"GsGEjP8dAjIYaDNgCxOkJYJQrOECQf8iB+5dvYWO6ojFDqi7H3k8vSF5OJEleRWuqRO+xqayT+iqOx7v01UcsMqASFBLMCg5WD1bUC06u8AH5tx0/p9d4JG2KVPWWHASmAyHtv6YTfGkYjiwPikZjV4tP5PEDHou6rgMiHAhO1uT+aSjUIXGnbHVOiwPoR/dr1KFo3ri5OJTYvv4SIykGm51BwwFS9s+UwtpD4bkUZaJTUCcgmnkjPx/l4eLwmgPoVQ7173vVia+N5T4gWTibnjt/QooTzmHa9iuadd8EU6ZICDXcia4F06bsMT/zo1eJsj3clWOUNV27urcbRG1jl6JntZqpuqbvgdS4LxhYjY7vuKdg+efBN6MREtaDg1mlKQjM7Xre0acnR9D/JUHb2k/ixD1A62TXp+oJaNy0yLtl1P8T7wiVG9/RtdBoo1UdNAO5iYOQ8t66NOjBDn7sWt1v7ZFtRowBFwfRgo04Wm9kc6Abq7FZqZqZZOHfgOJWT4xWR9uOhc8ONdeqHAZMtTptYP2CyA+YE0IA6Dg2dKBFUd3Q3tWLjFLJsjElzao0sp/MCt+YACHVsi88QX3UrEUJ5dWoIgZL5u495WNU/OIe/pZyW2IlL5WXMxFEBlPxqyRq2kpXP8L3tE6xZiKWf290Um3nje/p5TAPE2/Y/m1QJ9XeyOTxsrkA1ylku2Gq09bdlyxPKvtUiurW3Hcm24Y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JD/T5tzXSxIxnhvVIBfkGKdr3WirxvoLDW8pEWFhTV2gO9t+/ZbHHlxBMkLF/09zD7gbGEtag92iIQJDIFzFDImKL2wDdyvqdlfsFzfTrNXTsokumL
|
|||
|
<script src="//static.36krcdn.com/36kr-web/static/runtime.0dc8f562.js" type="text/javascript"></script><script src="//static.36krcdn.com/36kr-web/static/app.0813a330.js" type="text/javascript"></script>
|
|||
|
</body>
|
|||
|
</html>
|