Commit d30c36ea by 李嘉林

积分抽奖分享

parent 24a1aaa4
...@@ -468,7 +468,30 @@ export default { ...@@ -468,7 +468,30 @@ export default {
} }
return params; return params;
},
delParam(oldUrl,paramKey) {
var url = oldUrl; //页面url
var urlParam = oldUrl.split("?")[1]; //页面参数
var beforeUrl = url.substr(0, url.indexOf("?")); //页面主地址(参数之前地址)
var nextUrl = "";
var arr = new Array();
if (urlParam != "") {
var urlParamArr = urlParam.split("&"); //将参数按照&符分成数组
for (var i = 0; i < urlParamArr.length; i++) {
var paramArr = urlParamArr[i].split("="); //将参数键,值拆开
//如果键雨要删除的不一致,则加入到参数中
if (paramArr[0] != paramKey) {
arr.push(urlParamArr[i]);
}
} }
}
if (arr.length > 0) {
nextUrl = "?" + arr.join("&");
}
url = beforeUrl + nextUrl;
return url;
},
}, },
onUnload() { onUnload() {
console.log("卸载----------------", this.options); console.log("卸载----------------", this.options);
...@@ -485,7 +508,9 @@ export default { ...@@ -485,7 +508,9 @@ export default {
} }
//分享页面去掉登录态 //分享页面去掉登录态
if (url.indexOf("sessionid") > -1) { if (url.indexOf("sessionid") > -1) {
url = url.split("?")[0] + "?mixid=" + this.shopId; // url = url.split("?")[0] + "?mixid=" + this.shopId;
url = this.delParam(this.newWindowHref,'sessionid')
url = this.delParam(url,'open_id')
} }
//分销员推广页面 默认分享分销员中心页面 //分销员推广页面 默认分享分销员中心页面
if (url.indexOf("/personalCenter/spokesmanCenter/mine/popularize") > -1) { if (url.indexOf("/personalCenter/spokesmanCenter/mine/popularize") > -1) {
......
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 to comment