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

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

猜你喜欢

转载自www.cnblogs.com/lhj-blog/p/11077029.html
今日推荐