var url = "https://m.toutiao.com/is/2TQBxfj/?"
var _this=this
uni.showModal({
title: '打开链接?',
content: '即将打开链接:'+url,
success: function(res) {
if (res.confirm) {
//#ifdef APP-PLUS
plus.runtime.openURL(url, err=>{
console.log(err)
console.log("打开失败")
if ( plus.os.name == "Android" ) {
plus.runtime.launchApplication( {pname:"com.android.browser"
,extra:{url:url}}, function ( e ) {
console.log( e );
} );
} else if ( plus.os.name == "iOS" ) {
plus.runtime.launchApplication( {action:url}, function ( e ) {
console.log( e );
} );
}
});
//#endif
}
}
});
报错:
去掉链接最后的 '?' 就可以打开了