亚洲免费在线观看_av网站免费观看_亚洲视频中文字幕_日本视频在线_香蕉一区二区_国产精品中文_这里只有精品久久_欧美一区二区三区不卡_日本高清在线观看_国产精品免费一区二区三区都可以_欧美黄色大片视频_自拍偷拍第1页_亚洲啪av永久无码精品放毛片_三级免费观看_日日狠狠_波多野结衣绝顶大高潮_国语一级片_亚洲丁香婷婷

027-81331413

微信小程序開發之轉發分享功能

發布時間:2020-10-31 瀏覽:2362

第一種情況 點擊小程序轉發

不加入參數

1
2
3
4
5
6
7
8
9
10
//轉發
onShareAppMessage: function() {
let users = wx.getStorageSync('user');
if (res.from === 'button') {}
return {
 title: '轉發',
 path: '/pages/index/index',
 success: function(res) {}
}
}

加入參數

1
2
3
4
5
6
7
8
9
10
//轉發
onShareAppMessage: function() {
let users = wx.getStorageSync('user');
if (res.from === 'button') {}
return {
 title: '轉發',
 path: '/pages/index/index?from_uid=' + users.id,
 success: function(res) {}
}
}

第二種 分享

這個分享必須做成button 且加上 open-type="share"

不加入參數

1
2
3
4
5
6
7
8
9
10
11
onShareAppMessage: function (res) {
if (res.from === 'button') {
}
return {
 title: '轉發',
 path: '/pages/index/community/topic/topic',
 success: function (res) {
 console.log('成功', res)
 }
}
}

加入參數 

1
2
3
4
5
6
7
8
9
10
11
12
13
//轉發
onShareAppMessage: function (res) {
if (res.from === 'button') {
 
}
return {
 title: '轉發',
 path: '/pages/index/community/topic/topic?jsonStr=' + this.data.list,
 success: function (res) {
 console.log('成功', res)
 }
}
}

提醒:

這里轉發的參數要在onLoad 的options 運用