Commit e37b2420 by 程默

Merge tag 'v2.5'

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