Authored by 陈峰

Merge branch 'feature/pc_session_type' into 'master'

Feature/pc session type



See merge request !7
This diff could not be displayed because it is too large.
{
"name": "yoho-js-sdk",
"version": "1.3.3",
"version": "1.3.4",
"description": "YOHO!前端js的功能封装包,主要用于在活动页面中,对主要功能的封装。",
"keywords": [
"YOHO!",
... ...
... ... @@ -4,7 +4,14 @@ import utils from './utils';
let _noLoginUrl = function() {
let referrer = location.href.split('?')[0];
return '//m.yohobuy.com/signin.html?refer=' + encodeURIComponent(location.href) + '&openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' + referrer.replace(/\//g, '\\/') + '","param":{"from":"app"}},"requesturl":{"url":"","param":{}},"priority":"N"}}';
let domain = 'm.yohobuy.com';
let url = utils.urlParse(referrer);
if (url.host !== 'm.yohobuy.com') {
domain = 'www.yohobuy.com';
}
return `//${domain}/signin.html?refer=` + encodeURIComponent(location.href) + '&openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' + referrer.replace(/\//g, '\\/') + '","param":{"from":"app"}},"requesturl":{"url":"","param":{}},"priority":"N"}}';
};
export default {
... ...
... ... @@ -41,6 +41,12 @@ let _queryString = function() {
return $.extend({}, window._jssdkQS);
};
let _urlParse = function(url) {
var parser = document.createElement('a');
parser.href = url;
return parser;
};
let _sParamByIframe = function() {
let paramsObj = _queryString();
let queryArray = [];
... ... @@ -96,6 +102,7 @@ let _bindEvent = function() {
export default {
queryString: _queryString,
isMobile: isMobile,
urlParse: _urlParse,
init() {
//发送活动页参数
_sParamByIframe();
... ...