Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
ccbikai(👎🏻🍜)
8 years ago
Commit
a49481e9e23aedbc09b74778cacaecf6a0243d01
1 parent
c7fb9738
mkt_code 逻辑整理
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
6 deletions
public/js/common.js
public/js/common.js
View file @
a49481e
...
...
@@ -219,17 +219,47 @@ $.extend({
$footer
.
removeClass
(
'hide'
);
// 单击下载按钮 - 接受微信商城或者第三方来源的数据埋点信息
let
mktc
=
queryString
().
union_type
||
queryString
().
mkt_cod
e
||
''
;
let
unionType
=
queryString
().
union_typ
e
||
''
;
if
(
mktc
)
{
setCookie
(
'unionTypeYas'
,
mktc
,
{
path
:
'/'
});
setCookie
(
'mkt_code'
,
mktc
,
{
if
(
unionType
)
{
setCookie
(
'unionTypeYas'
,
unionType
,
{
path
:
'/'
});
}
/*
关于yas种cookies的逻辑澄清:
1. yas的关于渠道号的cookies的key 是 mkt_code
2. mkt_code 失效时间为7天
3. 如果url后面加union_type,mkt_code 在微信下是覆盖的,其他端不覆盖
4. 如果mkt_code=100000000000349,则直接覆盖成对应的渠道号
5. yas的cookies 种在 .yohobuy.com 根域下
周奇琪
*/
let
isWechat
=
/micromessenger/i
.
test
(
navigator
.
userAgent
||
''
);
let
mktc
=
queryString
().
mkt_code
||
queryString
().
union_type
||
''
;
function
saveMktCode
()
{
if
(
mktc
)
{
setCookie
(
'mkt_code'
,
mktc
,
{
path
:
'/'
,
domain
:
'yohobuy.com'
,
expires
:
7
// 7天
});
}
}
if
(
isWechat
)
{
saveMktCode
();
}
else
{
if
(
!
cookie
(
'mkt_code'
)
||
mktc
===
'100000000000349'
)
{
saveMktCode
();
}
}
// 尝试打开 APP
require
(
'./common/open-app'
);
...
...
Please
register
or
login
to post a comment