我在小程序a页面中进行分享的同时进行跳转,分享结束后仍在a页面,但是b页面的日志有被打印,并执行了b页面的销毁方法,请问如何能分享的时候b页面不被销毁
onShareAppMessage: function () {
const { cardDescription} = this.data;
const { userInfo } = app.globalData;
let shareData = {
nickName: userInfo.nickName,
avatarUrl: userInfo.avatarUrl,
cardNo: cardDescription.cardNo,
cardUniqueId: cardDescription.sendUniqueId,
}
let shareObj = {};
shareObj = {
title: '送你一份温暖心意~',
path: '/package/receiveCard/receiveCard?data=' + encodeURIComponent(JSON.stringify(shareData)),
imageUrl: cardDescription.cardFace,
}
wx.redirectTo({
url: '/package/cardIsSend/cardIsSend?cardNo=' + cardDescription.cardNo,
})
return shareObj;
}
wx.redirectTo
wx.navigateTo
这两个api的区别是什么?
仔细看看文档