//用戶點擊右上角分享轉(zhuǎn)發(fā)
onShareAppMessage: function () {
var that = this;
var id = this.options.id; //data,return 數(shù)據(jù)id
var title= this.options.title; //data,return 數(shù)據(jù)title
return {
title: title || \'\',
imageUrl: \'\',
path: \'/pages/goods_list/goods_list?id=\' + id,
}
},
//用戶點擊右上角分享朋友圈
onShareTimeline: function () {
var that = this;
var id = this.options.id; //data,return 數(shù)據(jù)id
var title=this.options.title; //data,return 數(shù)據(jù)title
return {
title: title || \'\',
query: \'id=\' + id,
imageUrl: \'\',
}
},
//生命周期函數(shù)--監(jiān)聽頁面加載
onload: function () {
wx.showShareMenu({
withShareTicket: true,
menus: [\'shareAppMessage\', \'shareTimeline\']
});
}
-
onShareAppMessage(Object object)
onShareTimeline() 相關(guān)參數(shù)文檔下面鏈接
- https://developers.weixin.qq.com/miniprogram/dev/reference/api/Page.html#onShareAppMessage-Object-object
- "shareAppMessage"表示“發(fā)送給朋友”按鈕,"shareTimeline"表示“分享到朋友圈”按鈕
- 顯示“分享到朋友圈”按鈕時必須同時顯示“發(fā)送給朋友”按鈕,顯示“發(fā)送給朋友”按鈕時則允許不顯示“分享到朋友圈”按鈕
-
?wx.showShareMenu()
?
-
圖示
-
?
?
?
聲明:所有內(nèi)容來自互聯(lián)網(wǎng)搜索結(jié)果,不保證100%準確性,僅供參考。如若本站內(nèi)容侵犯了原著者的合法權(quán)益,可聯(lián)系我們進行處理。