//分享好友
onShareAppMessage: function () {
var that = this;
return new Promise((resolve,reject)=>{
wx.showLoading({
title: '正在生成中...',
icon: 'none'
})
var index = 0; //计数循环
var recursiveFunc = function () {
if (isEmty(that.data.shareItemImageUrl) && index < 10) {
setTimeout(() => {
index++; //计数+1
recursiveFunc(); //再次执行
}, 500);
} else {
//递归结束退出递归
wx.hideLoading();
resolve({
title: that.data.shareTitle,
path: 'pages/index/home?id=' + that.data.shareId,
imageUrl:that.data.shareItemImageUrl
})
}
}
recursiveFunc(); //执行
})
},