Commit 1ec207fb by 李嘉林

注册兼容

parent 6d523aff
...@@ -87,6 +87,12 @@ export default { ...@@ -87,6 +87,12 @@ export default {
} }
this.page = ""; this.page = "";
this.params = ""; this.params = "";
if(options.tTShareEnv){
wx.setStorage({
key: "tTShareEnv",
data: options.tTShareEnv,
});
}
} else if (options.from && options.from == "h5login") { } else if (options.from && options.from == "h5login") {
//来自h5登录 //来自h5登录
let params = JSON.parse(options.params); let params = JSON.parse(options.params);
...@@ -355,10 +361,6 @@ export default { ...@@ -355,10 +361,6 @@ export default {
console.log("卸载----------------", this.options); console.log("卸载----------------", this.options);
}, },
onShareAppMessage(res) { onShareAppMessage(res) {
// 抖音展示拍视频功能
if(MINI_ENV=='tt'){
}
console.log(res) console.log(res)
console.log( console.log(
this.shareShopName, this.shareShopName,
...@@ -397,9 +399,29 @@ export default { ...@@ -397,9 +399,29 @@ export default {
console.log(this.shareUrl, "index12"); console.log(this.shareUrl, "index12");
console.log(`/pages/index/main?share=${encodeURIComponent(this.shareUrl)}`, '测试直播分享相关') console.log(`/pages/index/main?share=${encodeURIComponent(this.shareUrl)}`, '测试直播分享相关')
return { let sharePath=`/pages/index/main?share=${encodeURIComponent(this.shareUrl)}`; // 默认是当前页面
// 抖音分享类型 默认分享、拍抖音、分享二维码
let tTShareEnv='';
if(MINI_ENV=='tt'){
// 抖音
switch (res.channel) {
case 'video':
tTShareEnv='video';
break;
case 'qrcode':
tTShareEnv='qrcode';
break;
default:
tTShareEnv='share';
break;
}
sharePath=`/pages/index/main?share=${encodeURIComponent(this.shareUrl)}&tTShareEnv=${tTShareEnv}`; // 默认是当前页面
}else {
// 微信
}
let shareParam={
title: this.shareShopName, // 默认是小程序的名称 title: this.shareShopName, // 默认是小程序的名称
path: `/pages/index/main?share=${encodeURIComponent(this.shareUrl)}`, // 默认是当前页面 path: sharePath,
imageUrl: this.shareLogoUrl, imageUrl: this.shareLogoUrl,
success: function(res) { success: function(res) {
// 转发成功之后的回调 // 转发成功之后的回调
...@@ -420,6 +442,8 @@ export default { ...@@ -420,6 +442,8 @@ export default {
// 转发结束之后的回调(转发成不成功都会执行) // 转发结束之后的回调(转发成不成功都会执行)
} }
}; };
console.log(shareParam,'-------------------------shareParam-----439')
return shareParam;
} }
}; };
</script> </script>
......
...@@ -394,6 +394,17 @@ export default { ...@@ -394,6 +394,17 @@ export default {
query.iv=this.ttData.iv; query.iv=this.ttData.iv;
query.encryptedData=this.ttData.encryptedData; query.encryptedData=this.ttData.encryptedData;
query.sessionKey=this.session_key; query.sessionKey=this.session_key;
// registeredType (integer, optional)
// 注册来源(1:自主注册,2:视频导流注册)
query.registeredType=1;
let tTShareEnv = wx.getStorageSync("tTShareEnv");
if(tTShareEnv&&tTShareEnv=='video'){
query.registeredType=2;
}else if(tTShareEnv&&tTShareEnv=='qrcode'){
query.registeredType=3;
}else if(tTShareEnv&&tTShareEnv=='share'){
query.registeredType=4;
}
} }
if (this.$store.state.spokesmanGroupId != "") { if (this.$store.state.spokesmanGroupId != "") {
query.spokesmanRelId = this.$store.state.spokesmanRelId; query.spokesmanRelId = this.$store.state.spokesmanRelId;
...@@ -405,6 +416,7 @@ export default { ...@@ -405,6 +416,7 @@ export default {
login login
.bindUser(query,MINI_ENV) .bindUser(query,MINI_ENV)
.then(res => { .then(res => {
wx.removeStorageSync("tTShareEnv");
wx.hideLoading(); wx.hideLoading();
//绑定成功 //绑定成功
if (res.data.code == 200) { if (res.data.code == 200) {
......
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