小程序判断安卓还是IOS

// data里面加systemInfo:{},
data: {
systemInfo:{},
},

// 点击判断

aaa : function (){
var that = this;
wx. getSystemInfo({
success: function( res){
that. setData({
systemInfo: res,
})
if( res. platform == "devtools"){
            PC
} else if( res. platform == "ios"){
            IOS
} else if( res. platform == "android"){
            android
}
}
})
},

你可能感兴趣的:(小程序)