diff --git a/pages/mainPage/mainPage.js b/pages/mainPage/mainPage.js index 1c15f9d..8594bc0 100644 --- a/pages/mainPage/mainPage.js +++ b/pages/mainPage/mainPage.js @@ -32,7 +32,8 @@ Page({ ], docCount: 0, cerCount: 0, - recommendDesc: '' + recommendDesc: '', + shareTitle: '欢迎体验喵著' }, /** @@ -41,6 +42,29 @@ Page({ onLoad(options) { this.getMainProCount() }, + onShareAppMessage() { + const promise = new Promise(resolve => { + setTimeout(() => { + resolve({ + title: '欢迎体验喵著' + }) + }, 2000) + }) + return { + title: '欢迎体验喵著', + path: '/pages/mainPage/mainPage', + imageUrl: this.data.imgAssets + '/wx_share_img.png', + promise + } + }, + //分享朋友圈 + onShareTimeline() { + return { + title: this.data.shareTitle, + query: 'from=timeline', + imageUrl: this.data.imgAssets + '/wx_share_img.png' + } + }, getMainProCount() { ProApi.doGetMainProCount() .then(res => {