改变默认返回url地址
onUnload:function(){
wx.navigateBack({
delta:1
})
},
动态设置当前页面的标题
wx.setNavigationBarTitle({
title: '',
})
自定义分享内容
onShareAppMessage: function(res){
return{
'title':'标题',
'image':logo,
'path':'分享页面地址(/page/index/index)'
success: function(e){
wx.showToast({
title: '分享成功',
icon:'success',
duration:2000
})
}
}
}
获取元素宽高信息
var query = wx.createSelectorQuery();
var that = this;
query.select('.viewBtm').boundingClientRect(function (rect) {
that.setData({
height: rect.height + 'px'
})
}).exec();