diff --git a/src/pages/game.wpy b/src/pages/game.wpy index 1e3944b..9289044 100644 --- a/src/pages/game.wpy +++ b/src/pages/game.wpy @@ -16,7 +16,8 @@ link: '', roomId: '', gid: '', - name: '' + name: '', + share_image: '' }; methods = { webloaded: function(e) { @@ -43,8 +44,15 @@ wepy.setNavigationBarTitle({ title: this.name }); + this.share_image = decodeURIComponent(params.share_image); this.$apply(); } + onShow() { + let cfg = wepy.getStorageSync('cfg'); + if (!cfg._getrewardtype) { + wepy.hideShareMenu(); + } + } onShareAppMessage() { let self = this; let account = wepy.getStorageSync('account'); @@ -53,7 +61,7 @@ return { title: shareStr, 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) { wepy.getShareInfo({ shareTicket: res.shareTickets[0] diff --git a/src/pages/gameInfo.wpy b/src/pages/gameInfo.wpy index 3aac46e..8642d1c 100644 --- a/src/pages/gameInfo.wpy +++ b/src/pages/gameInfo.wpy @@ -178,6 +178,9 @@ } onShow() { let cfg = wepy.getStorageSync('cfg'); + if (!cfg._getrewardtype) { + wepy.hideShareMenu(); + } this.gbaUrl1 = cfg.gbaurl1; this.gbaUrl2 = cfg.gbaurl2; this.fcUrl = cfg.fcurl; @@ -209,7 +212,9 @@ } } 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 => { diff --git a/src/pages/index.wpy b/src/pages/index.wpy index 081d22b..54debb7 100644 --- a/src/pages/index.wpy +++ b/src/pages/index.wpy @@ -196,6 +196,9 @@ } onShow() { let cfg = wepy.getStorageSync('cfg'); + if (!cfg._getrewardtype) { + wepy.hideShareMenu(); + } this.showAll = !cfg ? false : !cfg.hide_main; let userInfo = this.$parent.getUserInfo(); console.log(userInfo); diff --git a/src/pages/search.wpy b/src/pages/search.wpy index c03ebc0..624a35f 100644 --- a/src/pages/search.wpy +++ b/src/pages/search.wpy @@ -163,6 +163,9 @@ } onShow() { let cfg = wepy.getStorageSync('cfg'); + if (!cfg._getrewardtype) { + wepy.hideShareMenu(); + } this.showAll = !cfg ? false : !cfg.hide_main; } initPageParam() {