onShareAppMessage(resaa) {
if (resaa.from === 'button') { // 来自页面内分享按钮
let titleStr = this.activeList[this.activeList.length - 1].title || '资源管理'
// console.log("标题:", this.BASE_WEBVIEW_URL + 'assets/img/ziyuangl.png')
return new Promise((resolve, reject) => {
uni.showLoading()
resourceShare({
uid: this.userInfo.uid || '',
ids: this.arrIdData.join(',')
}).then(res => {
uni.hideLoading()
if (res.code == 200) {
let padeCode = res.data.code || '-'
resolve({
title: titleStr == '首页' ? '资源管理' : titleStr,
path: "/pages/resource/index?padeCode=" +padeCode, // 分享出去之后要进入的页面路径
imageUrl: this.BASE_WEBVIEW_URL + 'assets/img/ziyuangl.png'
})
} else {
this.$api.msg(res.message) //报错提示
}
}).catch(err => {
uni.hideLoading()
})
})
}
},
uniapp小程序分享时在onShareAppMessage里请求接口
最新推荐文章于 2024-09-09 17:20:15 发布