微信小程序自定义分享封面

onShareAppMessage:function(options){

let thas = this;

if (options.from === 'button') {
    // 来自页面内转发按钮
    shareObj = {

        title:"页面分享",  //分享标题
        path:"/pages/index/index",  //分享地址
        desc:"我在观运算命,你也来试试吧",  //描述
        imageUrl: '/images/img_honorbook_masterdata.png',  //图片路径

        success: function (res) {     //成功回调

        }
    
    }

    return shareObj;

}    

 

切记封面地址的参数是imageUrl不是imgUrl,网上很多都是imgUrl

 

posted @ 2019-06-24 14:47  诩小贝  阅读(2444)  评论(0编辑  收藏  举报
Copyright ©2016 诩小贝   联系QQ:980823367