Commit e37b2420 by 程默

Merge tag 'v2.5'

parents 7ddc4114 3eda3608
...@@ -4,6 +4,7 @@ dist/ ...@@ -4,6 +4,7 @@ dist/
npm-debug.log* npm-debug.log*
yarn-debug.log* yarn-debug.log*
yarn-error.log* yarn-error.log*
project.config.json*
# Editor directories and files # Editor directories and files
.idea .idea
......
...@@ -30,18 +30,19 @@ export default { ...@@ -30,18 +30,19 @@ export default {
spokesmanGroupId: "", // 代言人的集团id spokesmanGroupId: "", // 代言人的集团id
spokesmanShopId: "", // 代言人的门店id spokesmanShopId: "", // 代言人的门店id
spokesmanRelId: "", //代言人的id spokesmanRelId: "", //代言人的id
userId : '',
hasInvitationStatus: 0, // 邀请资格:0-不能够邀请下级,1-能够邀请下级 hasInvitationStatus: 0, // 邀请资格:0-不能够邀请下级,1-能够邀请下级
newHref: "", newHref: "",
shareShopName: "", shareShopName: "",
shareLogoUrl: "", shareLogoUrl: "",
shareOrderSn: "", shareOrderSn: "",
shareTid: "", shareTid: "",
shareImgUrl : '', newWindowHref : '',
sharePageList: [ sharePageList: [
"goods/", "goods/",
"receivingGift", "receivingGift",
"article/", "article/",
"/personalCenter/spokesmanCenter/mine/popularize" "/personalCenter/spokesmanCenter"
] //分享白名单 ] //分享白名单
}; };
}, },
...@@ -69,8 +70,9 @@ export default { ...@@ -69,8 +70,9 @@ export default {
this.spokesmanShopId = this.spokesmanShopId =
getQueryVariable(this.link, "spokesmanShopId") || ""; getQueryVariable(this.link, "spokesmanShopId") || "";
this.spokesmanRelId = getQueryVariable(this.link, "spokesmanRelId") || ""; this.spokesmanRelId = getQueryVariable(this.link, "spokesmanRelId") || "";
this.userId = getQueryVariable(this.link, "userId") || "";
if (this.spokesmanGroupId != "") { if (this.spokesmanGroupId != "") {
//分销员分享 //上级分销员信息
this.$store.commit("setSpokesman", { this.$store.commit("setSpokesman", {
spokesmanGroupId: this.spokesmanGroupId, spokesmanGroupId: this.spokesmanGroupId,
spokesmanShopId: this.spokesmanShopId, spokesmanShopId: this.spokesmanShopId,
...@@ -114,26 +116,50 @@ export default { ...@@ -114,26 +116,50 @@ export default {
var scene = decodeURIComponent(options.scene); //参数二维码传递过来的参数 var scene = decodeURIComponent(options.scene); //参数二维码传递过来的参数
let querys = scene.split("_"); let querys = scene.split("_");
if (querys) { if (querys) {
if (querys[0] == "goods") { if (querys[0] == "pid") {
//商品详情 pid_123 //商品详情 pid_123
this.page = `/goods/${querys[1]}`; this.page = `/goods/${querys[1]}`;
this.params += `&spokesmanGroupId=${querys[2]}&spokesmanShopId=${ if(querys.length > 3){
querys[3] if(querys[5]){
}&spokesmanRelId=${querys[4]}&usedId=${querys[5]}`; this.params += `&spokesmanGroupId=${querys[2]}&spokesmanShopId=${querys[3]}&spokesmanRelId=${querys[4]}&userId=${querys[5]}`
}else{
this.params += `&spokesmanGroupId=${querys[2]}&spokesmanShopId=${querys[3]}&spokesmanRelId=${querys[4]}`
}
}else if(querys.length == 3){
this.params += `&userId=${querys[2]}`
}
} else if (querys[0] == "activty") { } else if (querys[0] == "activty") {
//活动页面activty_turntable_123 //活动页面activty_turntable_123
this.params += `&pageInfo=${scene}`; this.params += `&pageInfo=${scene}`;
} else if (querys[0] == "spokesman") { } else if (querys[0] == "spokesman") {
//分销员 小程序码 //分销员 小程序码
this.page = `/personalCenter/spokesmanCenter`; this.page = `/personalCenter/spokesmanCenter`;
this.params += `&spokesmanGroupId=${querys[1]}&spokesmanShopId=${ if(querys.length > 2){
querys[2] if(querys[4]){
}&spokesmanRelId=${querys[3]}&usedId=${querys[4]}`; this.params += `&spokesmanGroupId=${querys[1]}&spokesmanShopId=${querys[2]}&spokesmanRelId=${querys[3]}&userId=${querys[4]}`
}else{
this.params += `&spokesmanGroupId=${querys[1]}&spokesmanShopId=${querys[2]}&spokesmanRelId=${querys[3]}`
}
}else if(querys.length == 2){
this.params += `&userId=${querys[1]}`
}
}else if(querys[0] == "home"){ }else if(querys[0] == "home"){
this.page = `/`; this.page = `/`;
this.params += `&spokesmanGroupId=${querys[1]}&spokesmanShopId=${ if(querys.length > 2){
querys[2] if(querys[4]){
}&spokesmanRelId=${querys[3]}&usedId=${querys[4]}`; this.params += `&spokesmanGroupId=${querys[1]}&spokesmanShopId=${querys[2]}&spokesmanRelId=${querys[3]}&userId=${querys[4]}`
}else{
this.params += `&spokesmanGroupId=${querys[1]}&spokesmanShopId=${querys[2]}&spokesmanRelId=${querys[3]}`
}
}else if(querys.length == 2){
this.params += `&userId=${querys[1]}`
}
} }
} }
console.log(querys, "scene"); console.log(querys, "scene");
...@@ -238,8 +264,8 @@ export default { ...@@ -238,8 +264,8 @@ export default {
mpvue.navigateTo({ url }); mpvue.navigateTo({ url });
} }
}, },
//右上角分享时触发
getMessage(res) { getMessage(res) {
console.log(res)
let len = res.target.data.length - 1; let len = res.target.data.length - 1;
console.log(res, "h5消息", res.target.data[len]); console.log(res, "h5消息", res.target.data[len]);
this.shareShopName = res.target.data[len].shareShopName || ""; this.shareShopName = res.target.data[len].shareShopName || "";
...@@ -248,8 +274,8 @@ export default { ...@@ -248,8 +274,8 @@ export default {
//分享内容中有订单信息为送礼活动 //分享内容中有订单信息为送礼活动
this.shareOrderSn = res.target.data[len].orderSn; this.shareOrderSn = res.target.data[len].orderSn;
this.shareTid = res.target.data[len].shareTid; this.shareTid = res.target.data[len].shareTid;
this.shareImgUrl = res.target.data[len].shareImgUrl; this.newWindowHref = res.target.data[len].shareImgUrl;
console.log("分享信息:", this.shareLogoUrl, this.shareShopName,this.shareImgUrl); console.log("分享信息:", this.shareLogoUrl, this.shareShopName,this.newWindowHref);
}, },
checkPageUrl(val) { checkPageUrl(val) {
for (let i = 0; i < this.sharePageList.length; i++) { for (let i = 0; i < this.sharePageList.length; i++) {
...@@ -264,7 +290,9 @@ export default { ...@@ -264,7 +290,9 @@ export default {
console.log("卸载----------------", this.options); console.log("卸载----------------", this.options);
}, },
onShareAppMessage(res) { onShareAppMessage(res) {
console.log('=======')
console.log(res) console.log(res)
console.log('=======')
console.log( console.log(
this.shareShopName, this.shareShopName,
"share", "share",
...@@ -273,8 +301,9 @@ export default { ...@@ -273,8 +301,9 @@ export default {
this.shareLogoUrl this.shareLogoUrl
); );
let url = '' let url = ''
if(this.shareImgUrl){ console.log(this.newWindowHref + 'this.newWindowHref')
url = this.shareImgUrl; if(this.newWindowHref){
url = this.newWindowHref;
}else{ }else{
url = res.webViewUrl; url = res.webViewUrl;
} }
...@@ -284,27 +313,28 @@ export default { ...@@ -284,27 +313,28 @@ export default {
url = url.split("?")[0] + "?mixid=" + this.shopId; url = url.split("?")[0] + "?mixid=" + this.shopId;
} }
//分享页面白名单 白名单以外的分享页面为首页 //分享页面白名单 白名单以外的分享页面为首页
if (!this.checkPageUrl(url)) { // if (!this.checkPageUrl(url)) {
url = this.baseUrl + "?mixid=" + this.shopId; // url = this.baseUrl + "?mixid=" + this.shopId;
} // }
console.log("+++++", this.shareOrderSn); //有订单为送礼订单分享--分销员信息由h5添加
//有订单为送礼订单分享 // if (this.shareOrderSn != "") {
if (this.shareOrderSn != "") { // url = `${this.baseUrl}/activty/receivingGift?mixid=${
url = `${this.baseUrl}/activty/receivingGift?mixid=${ // this.shopId
this.shopId // }&orderSn=${this.shareOrderSn}&shareTid=${this.shareTid}`;
}&orderSn=${this.shareOrderSn}&shareTid=${this.shareTid}`; // }
}
//分销员推广页面 默认分享分销员中心页面 //分销员推广页面 默认分享分销员中心页面
if (url.indexOf("/personalCenter/spokesmanCenter/mine/popularize") > -1) { if (url.indexOf("/personalCenter/spokesmanCenter/mine/popularize") > -1) {
url = `${this.baseUrl}/personalCenter/spokesmanCenter?mixid=${ url = `${this.baseUrl}/personalCenter/spokesmanCenter?mixid=${
this.shopId this.shopId
}`; }`;
} }
console.log('url---------------' + url)
//增加分销员信息 //增加分销员信息
if(this.hasInvitationStatus == 1){ if(this.hasInvitationStatus == 1 && url.indexOf('spokesmanGroupId')==-1){
this.shareUrl = url this.shareUrl = url+ this.newHref
}else{ }else{
this.shareUrl = url + this.newHref; this.shareUrl = url ;
} }
...@@ -316,14 +346,14 @@ export default { ...@@ -316,14 +346,14 @@ export default {
success: function(res) { success: function(res) {
// 转发成功之后的回调 // 转发成功之后的回调
if (res.errMsg == "shareAppMessage:ok") { if (res.errMsg == "shareAppMessage:ok") {
consol.log(res, "分享成功"); console.log(res, "分享成功");
} }
}, },
fail: function() { fail: function() {
// 转发失败之后的回调 // 转发失败之后的回调
if (res.errMsg == "shareAppMessage:fail cancel") { if (res.errMsg == "shareAppMessage:fail cancel") {
// 用户取消转发 // 用户取消转发
consol.log(res, "分享失败"); console.log(res, "分享失败");
} else if (res.errMsg == "shareAppMessage:fail") { } else if (res.errMsg == "shareAppMessage:fail") {
// 转发失败,其中 detail message 为详细失败信息 // 转发失败,其中 detail message 为详细失败信息
} }
......
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