在小程序开发过程中,有时不注意细节会发现分享出去的页面打开是空白,手机打开控制台也很难跟踪到问题所在,空白原因基本上是路径书写错误或者用的不是绝对路径造成的,比如下方代码,分享出去打开就会是空白页
onShareAppMessage:function(res){
return{
title:this.sve.title,
path:'survey?id='+this.sve.id,
imageUrl:'http://img.qinmingyun.com/join.jpg'
}
} 正确代码应该是:
onShareAppMessage:function(res){
return{
title:this.sve.title,
path:'/pages/common/survey/survey?id='+this.sve.id,
imageUrl:'http://img.qinmingyun.com/join.jpg'
}
} 代码中的path必须是绝对路径才可以。
2013-2024 LifeAdd生活方式 www.lifeadd.cn 版权所有 | 御融(北京)科技有限公司 All Rights
Reserved
增值电信业务经营许可证:京B2-20200664 | 京ICP备14004911号-7