根据服务端配置,实时开启关闭分享

This commit is contained in:
zhl 2019-03-06 16:17:54 +08:00
parent 3ec9b592cd
commit 3ce0149580
4 changed files with 22 additions and 3 deletions

View File

@ -16,7 +16,8 @@
link: '', link: '',
roomId: '', roomId: '',
gid: '', gid: '',
name: '' name: '',
share_image: ''
}; };
methods = { methods = {
webloaded: function(e) { webloaded: function(e) {
@ -43,8 +44,15 @@
wepy.setNavigationBarTitle({ wepy.setNavigationBarTitle({
title: this.name title: this.name
}); });
this.share_image = decodeURIComponent(params.share_image);
this.$apply(); this.$apply();
} }
onShow() {
let cfg = wepy.getStorageSync('cfg');
if (!cfg._getrewardtype) {
wepy.hideShareMenu();
}
}
onShareAppMessage() { onShareAppMessage() {
let self = this; let self = this;
let account = wepy.getStorageSync('account'); let account = wepy.getStorageSync('account');
@ -53,7 +61,7 @@
return { return {
title: shareStr, title: shareStr,
path: `/pages/index?isShare=1&inviter_id=${account.account_id}&roomId=${this.roomId}&gid=${this.gid}&togame=1&t=${Date.now()}`, path: `/pages/index?isShare=1&inviter_id=${account.account_id}&roomId=${this.roomId}&gid=${this.gid}&togame=1&t=${Date.now()}`,
imageUrl: 'https://resource.kingsome.cn/dalmatian/wapp/share.jpg', imageUrl: this.share_image,
success: function (res) { success: function (res) {
wepy.getShareInfo({ wepy.getShareInfo({
shareTicket: res.shareTickets[0] shareTicket: res.shareTickets[0]

View File

@ -178,6 +178,9 @@
} }
onShow() { onShow() {
let cfg = wepy.getStorageSync('cfg'); let cfg = wepy.getStorageSync('cfg');
if (!cfg._getrewardtype) {
wepy.hideShareMenu();
}
this.gbaUrl1 = cfg.gbaurl1; this.gbaUrl1 = cfg.gbaurl1;
this.gbaUrl2 = cfg.gbaurl2; this.gbaUrl2 = cfg.gbaurl2;
this.fcUrl = cfg.fcurl; this.fcUrl = cfg.fcurl;
@ -209,7 +212,9 @@
} }
} }
wepy.navigateTo({ wepy.navigateTo({
url: '/pages/game?link=' + encodeURIComponent(url) + '&gid=' + this.id + '&name=' + encodeURIComponent(this.record.name) url: '/pages/game?link=' + encodeURIComponent(url) + '&gid=' + this.id
+ '&name=' + encodeURIComponent(this.record.name)
+ '&share_image=' + encodeURIComponent(this.record.icon)
}); });
}) })
.catch(err => { .catch(err => {

View File

@ -196,6 +196,9 @@
} }
onShow() { onShow() {
let cfg = wepy.getStorageSync('cfg'); let cfg = wepy.getStorageSync('cfg');
if (!cfg._getrewardtype) {
wepy.hideShareMenu();
}
this.showAll = !cfg ? false : !cfg.hide_main; this.showAll = !cfg ? false : !cfg.hide_main;
let userInfo = this.$parent.getUserInfo(); let userInfo = this.$parent.getUserInfo();
console.log(userInfo); console.log(userInfo);

View File

@ -163,6 +163,9 @@
} }
onShow() { onShow() {
let cfg = wepy.getStorageSync('cfg'); let cfg = wepy.getStorageSync('cfg');
if (!cfg._getrewardtype) {
wepy.hideShareMenu();
}
this.showAll = !cfg ? false : !cfg.hide_main; this.showAll = !cfg ? false : !cfg.hide_main;
} }
initPageParam() { initPageParam() {