uni-app分享

调用系统分享组件发送分享消息,不需要配置分享SDK

当中出现了图片,图片的优先级会大于文字。

uni.shareWithSystem({

type:"text",

summary: ‘补充文字‘,

href: ‘https://www.baidu.com/‘,

// imageUrl:"../../static/logo.png",

success(){

console.log(‘分享成功‘);

// 分享完成,请注意此时不一定是成功分享

},

fail(){

console.log(‘分享失败‘);

// 分享失败

}

})

多个图片分享

当中出现了图片,图片的优先级会大于文字。

不需要配置分享SDK

let msg={

type:‘image‘,

pictures:[‘../../static/logo.png‘]

}

plus.share.sendWithSystem(msg, function(){

console.log(‘分享成功‘);

}, function(e){

console.log(‘分享失败:‘+JSON.stringify(e));

});

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐