methods: { sharesys() { var msg = { content: "测试:", href: "https://bfw.wiki" }; plus.share.sendWithSystem ? plus.share.sendWithSystem(msg, function() { console.log('Success'); }, function(e) { console.log('Failed: ' + JSON.stringify(e)); }) : this.shareSystemNativeJS(); }, shareSystemNativeJS() { if (plus.os.name !== 'Android') { plus.nativeUI.alert('此平台暂不支持系统分享功能!'); return; } var intent = new Intent(Intent.ACTION_SEND); intent.setType('text/plain'); intent.putExtra(Intent.EXTRA_SUBJECT, 'Hello'); intent.putExtra(Intent.EXTRA_TEXT, sharecontent.value); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); main.startActivity(Intent.createChooser(intent, '系统分享Hello')); } }
网友回复