//定义跳转淘宝事件
function launchApp() {
if ( plus.os.name == "Android" ) {
plus.runtime.launchApplication( {pname:"com.taobao.taobao"
,extra:{url:"https://m.taobao.com/#index"}}, function ( e ) {
alert( "打开失败:" + e.message );
} );
} else if ( plus.os.name == "iOS" ) {
plus.runtime.launchApplication( {action:"taobao://"}, function ( e ) {
alert( "打开失败: " + e.message );
} );
}
}
function taobao(){
var btnArray = ['否', '是'];
mui.confirm('是否跳转到淘宝', '提示', btnArray, function(e) {
if (e.index == 1) {
//跳转淘宝
//window.location.href = 'https://m.taobao.com/#index';
//openNewPage('taobao.html')
launchApp();
} else {
//取消跳转
mui.toast('你取消了跳转淘宝');
}
})
}
function launchApp() {
if ( plus.os.name == "Android" ) {
plus.runtime.launchApplication( {pname:"com.taobao.taobao"
,extra:{url:"https://m.taobao.com/#index"}}, function ( e ) {
alert( "打开失败:" + e.message );
} );
} else if ( plus.os.name == "iOS" ) {
plus.runtime.launchApplication( {action:"taobao://"}, function ( e ) {
alert( "打开失败: " + e.message );
} );
}
}
function taobao(){
var btnArray = ['否', '是'];
mui.confirm('是否跳转到淘宝', '提示', btnArray, function(e) {
if (e.index == 1) {
//跳转淘宝
//window.location.href = 'https://m.taobao.com/#index';
//openNewPage('taobao.html')
launchApp();
} else {
//取消跳转
mui.toast('你取消了跳转淘宝');
}
})
}