APP端:
if (uni.getSystemInfoSync().platform == 'ios'){ plus.ios.import("UIApplication").sharedApplication().performSelector("exit") } else if (uni.getSystemInfoSync().platform == 'android'){ plus.runtime.quit(); }
小程序(按钮形式):
<navigator target="miniProgram" open-type="exit">退出小程序</navigator>
小程序(js):
//在需要退出小程序的地方调用添加下面代码即可(js文件中) wx.exitMiniProgram({ success: (res) => {} })
标签:uniapp,ios,APP,程序,js,platform,getSystemInfoSync From: https://www.cnblogs.com/2865----yyyy/p/16666561.html