分享好友(一个小程序两个种登录类型)
onShareAppMessage() {
return {
title: '',
path: this.$public.hanldeDetailSharePath(this.material_id),
imageUrl:''
}
},
getCurrentPages()[getCurrentPages().length-1].route 获取当前页面url
cache.getCache('login_type') 获取登录类型
// 分享好友详情路径
hanldeDetailSharePath(id){
return '/'+ getCurrentPages()[getCurrentPages().length-1].route + '?type='+cache.getCache('login_type')+'&id='+id
},
分享朋友圈
onShareTimeline(){
return {
title: '',
携带参数
query: this.$public.hanldeDetailShareQuery(this.material_id),
imageUrl:''
}
},
// 分享朋友圈详情参数
hanldeDetailShareQuery(id){
return 'id=' + id + '&type=' + cache.getCache('login_type')
},