Commit 4a512103 by 陈英杰

合并分支 'dev' 到 'master'

Publisher 自动合并请求 [2wSMk-D2tOdKt_F4hjZ8P]

## Merge branch 'master' into dev


------

## Merge branch 'dev' of gitlab.aodianyun.com:broadcast_cloud/web-live into dev


------

## Merge branch 'dev' of gitlab.aodianyun.com:broadcast_cloud/web-live into dev


------

## feat
1. 支持微信分享纳入邀请


------

## fix
1. 修复微信分享配置初始化与登录不匹配的问题


------



查看合并请求 !175
parents 6a50f6e7 62a13688
...@@ -24,7 +24,7 @@ export default { ...@@ -24,7 +24,7 @@ export default {
return { return {
title: this.channelInfo.shareTitle || this.channelInfo.channelName, title: this.channelInfo.shareTitle || this.channelInfo.channelName,
desc: this.channelInfo.shareSubTitle || window.location.href, desc: this.channelInfo.shareSubTitle || window.location.href,
link: window.location.href, link: this.updateQueryStringParameter(window.location.href, 'refererId', this.userInfo.id || 0),
imgUrl: this.channelInfo.shareImgUrl || this.channelInfo.mpsBackgroundUrl, imgUrl: this.channelInfo.shareImgUrl || this.channelInfo.mpsBackgroundUrl,
success() { success() {
self.shareSuccessBack(); self.shareSuccessBack();
...@@ -39,12 +39,29 @@ export default { ...@@ -39,12 +39,29 @@ export default {
}, },
mounted() { mounted() {
this.$Bus.$on('bus-showShare', this._toggleShare); this.$Bus.$on('bus-showShare', this._toggleShare);
if (UserAgent.isWx()) { this.$Bus.$on('bus-initWX', this._initWXAll);
this._InitWXShare(); this._initWXAll()
this._getWxJsapiPackage();
}
}, },
methods: { methods: {
_initWXAll() {
if (UserAgent.isWx()) {
this._InitWXShare();
this._getWxJsapiPackage();
}
},
updateQueryStringParameter(uri, key, value) {
if (!value) {
return uri;
}
const re = new RegExp("([?&])" + key + "=.*?(&|$)", "i");
const separator = uri.indexOf('?') !== -1 ? "&" : "?";
if (uri.match(re)) {
return uri.replace(re, '$1' + key + "=" + value + '$2');
}
else {
return uri + separator + key + "=" + value;
}
},
_toggleShare(bol) { _toggleShare(bol) {
if (UserAgent.isWx()) { if (UserAgent.isWx()) {
this.isShow = bol; this.isShow = bol;
...@@ -118,6 +135,7 @@ export default { ...@@ -118,6 +135,7 @@ export default {
}, },
beforeDestroy() { beforeDestroy() {
this.$Bus.$off('bus-showShare', this._toggleShare); this.$Bus.$off('bus-showShare', this._toggleShare);
this.$Bus.$off('bus-initWX', this._initWXAll);
} }
}; };
</script> </script>
......
...@@ -73,6 +73,7 @@ export default { ...@@ -73,6 +73,7 @@ export default {
} }
this.$Bus.$on('bus-showLogin', this._toggleLogin); this.$Bus.$on('bus-showLogin', this._toggleLogin);
await this.get_userInfo({ refererId: this.$route.query.refererId }); await this.get_userInfo({ refererId: this.$route.query.refererId });
this.$Bus.$emit('bus-initWX');
this.set_nowDate(); this.set_nowDate();
if (!process.env.private) { if (!process.env.private) {
this.timer = websocketHeartbeat.call(this) this.timer = websocketHeartbeat.call(this)
......
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 sign in to comment