diff --git a/src/App.vue b/src/App.vue index 4ab19b4..3f27a3e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -65,6 +65,13 @@ export default { computed: { showTabbar() { const path = tabbar.map(tab => tab.path); + const { name, query: { temple_id } } = this.$route; + + // 等于寺庙功德箱时隐藏底部导航 + if(name === 'merit-box' && temple_id !== '1'){ + return false + } + return path.includes(this.$route.path); }, paddingBottom() { diff --git a/src/assets/img/gongdexiang.png b/src/assets/img/gongdexiang.png new file mode 100644 index 0000000..7c80c4c Binary files /dev/null and b/src/assets/img/gongdexiang.png differ diff --git a/src/common/wechat-web.js b/src/common/wechat-web.js index 960128f..d4b05d4 100644 --- a/src/common/wechat-web.js +++ b/src/common/wechat-web.js @@ -1,11 +1,12 @@ let wechatInstance; -function signToWechat(config, readFunction) { +function signToWechat(config, shareConfig) { if (!wx) { console.warn('请安装微信网页JS-SDK, url: https://res2.wx.qq.com/open/js/jweixin-1.6.0.js'); } const defaultConfig = { ...config, + debug: false, jsApiList: [ 'onMenuShareTimeline', 'onMenuShareAppMessage', @@ -16,15 +17,63 @@ function signToWechat(config, readFunction) { 'updateTimelineShareData' ], }; - return new Promise((resolve) => { - console.log('defaultConfig', defaultConfig); - wx.config(defaultConfig); - wx.ready(function() { - console.warn('wechat sdk config success'); - wechatInstance = wx; - resolve(wx); - readFunction && readFunction(wx) + console.log('sign', wx); + wx.config(defaultConfig); + wx.ready(function() { + + console.log('wechat sdk config success'); + wechatInstance = wx; + + wx.onMenuShareAppMessage({ + title: shareConfig.title, + desc: shareConfig.desc, + link: shareConfig.link, + imgUrl: shareConfig.imgUrl, + complete: res => { + shareConfig.callback && shareConfig.callback({ + key: 'updateAppMessageShareData', + ...res + }); + } }); + + // // 分享朋友圈 + wx.onMenuShareTimeline({ + title: shareConfig.title, + link: shareConfig.link, + imgUrl: shareConfig.imgUrl, + complete: res => { + shareConfig.callback && shareConfig.callback({ + key: 'updateTimelineShareData', + ...res + }); + } + }); + + // wx.updateAppMessageShareData({ + // title: shareConfig.title, + // desc: shareConfig.desc, + // link: shareConfig.link, + // imgUrl: shareConfig.imgUrl, + // complete: res => { + // shareConfig.callback && shareConfig.callback({ + // key: 'updateAppMessageShareData', + // ...res + // }); + // } + // }); + // // 分享朋友圈 + // wx.updateTimelineShareData({ + // title: shareConfig.title, + // link: shareConfig.link, + // imgUrl: shareConfig.imgUrl, + // complete: res => { + // shareConfig.callback && shareConfig.callback({ + // key: 'updateTimelineShareData', + // ...res + // }); + // } + // }); }); } diff --git a/src/components/random-money/index.vue b/src/components/random-money/index.vue index 53e33f3..94f6829 100644 --- a/src/components/random-money/index.vue +++ b/src/components/random-money/index.vue @@ -112,7 +112,7 @@ export default {