Commit 8682392f by 肖康

Merge branch 'XK_carB20190624' into Development

parents 809d9306 a53f6338
......@@ -55,10 +55,44 @@
var cval = getCookie(name);
if (cval != null) document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString();
}
//标准获取地址栏参数,不乱码
function GetRequest(value) {
//url例子:www.bicycle.com?id="123456"&Name="bicycle";
if(window.location.pathname=="/s/") {
var url = location.search //?id="123456"&Name="bicycle";
}else{
var url = decodeURI(location.search); //?id="123456"&Name="bicycle";
}
var url_t = decodeURI(location.href),url="";
if(url_t.indexOf("?")!=-1){
url="?"+url_t.split("?")[1];
}
var object = {};
if(url.indexOf("?") != -1)//url中存在问号,也就说有参数。
{
var str = url.substr(1); //得到?后面的字符串
var strs = str.split("&"); //将得到的参数分隔成数组[id="123456",Name="bicycle"];
for(var i = 0; i < strs.length; i ++)
{
object[strs[i].split("=")[0]]=strs[i].split("=")[1]
}
}
return object[value];
}
var cookiex = getCookie("Yo4teW_csrf") || "", csrf = "csrf";
var cookieHostname = window.location.hostname.split(".")[1] + "." + window.location.hostname.split(".")[2];
//adtag写进cookie
if(GetRequest("adtag")){
SetCookie("adtag",GetRequest("adtag"),1,cookieHostname)
}else{
if(GetRequest("ADTAG")){
SetCookie("adtag",GetRequest("ADTAG"),1,cookieHostname)
}
if (GetRequest("utm_source")) {
SetCookie("adtag", GetRequest("utm_source"), 1,cookieHostname)
}
}
var browser = {
versions: function () {
var u = navigator.userAgent, app = navigator.appVersion;
......
......@@ -60,7 +60,7 @@
<span class="t2">{{item.ad_words}}</span>
</div>
<template v-if="item.link_words">
<a class="r" :href="item.url+'?ptag='+ptag+'-floor'+(count * 1 +1)" @click="recordFloorFn(ptag+'-floor'+(count * 1 +1))">
<a class="r" :href="item.url" @click="recordFloorFn(ptag+'-floor'+(count * 1 +1))">
<span>{{item.link_words}}</span>
<i class="lineBlock"></i>
</a>
......
This diff could not be displayed because it is too large.
......@@ -55,10 +55,44 @@
var cval = getCookie(name);
if (cval != null) document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString();
}
//标准获取地址栏参数,不乱码
function GetRequest(value) {
//url例子:www.bicycle.com?id="123456"&Name="bicycle";
if(window.location.pathname=="/s/") {
var url = location.search //?id="123456"&Name="bicycle";
}else{
var url = decodeURI(location.search); //?id="123456"&Name="bicycle";
}
var url_t = decodeURI(location.href),url="";
if(url_t.indexOf("?")!=-1){
url="?"+url_t.split("?")[1];
}
var object = {};
if(url.indexOf("?") != -1)//url中存在问号,也就说有参数。
{
var str = url.substr(1); //得到?后面的字符串
var strs = str.split("&"); //将得到的参数分隔成数组[id="123456",Name="bicycle"];
for(var i = 0; i < strs.length; i ++)
{
object[strs[i].split("=")[0]]=strs[i].split("=")[1]
}
}
return object[value];
}
var cookiex = getCookie("Yo4teW_csrf") || "", csrf = "csrf";
var cookieHostname = window.location.hostname.split(".")[1] + "." + window.location.hostname.split(".")[2];
//adtag写进cookie
if(GetRequest("adtag")){
SetCookie("adtag",GetRequest("adtag"),1,cookieHostname)
}else{
if(GetRequest("ADTAG")){
SetCookie("adtag",GetRequest("ADTAG"),1,cookieHostname)
}
if (GetRequest("utm_source")) {
SetCookie("adtag", GetRequest("utm_source"), 1,cookieHostname)
}
}
var browser = {
versions: function () {
var u = navigator.userAgent, app = navigator.appVersion;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment