首页 > 建站教程 > APP开发,混合APP >  MUI注销登录代码正文

MUI注销登录代码

    MUI注销登录界面代码,对退出登录进行了注销和直接关闭的选择操作:
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <title>mui注销登录 - 我爱模板网 www.5imoban.net</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <link rel="stylesheet" type="text/css" href="css/mui.css"/>
    <link rel="stylesheet" type="text/css" href="css/cszjw.css"/>
</head>
<body>
        <div id="dropout" onclick="closeApp();">
        <a href="#"><ul class="mui-footer_dropout mui_magrin-top" >退出登录</ul></a>
        </div>
</body>
<script src="js/mui.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript">
         function closeApp() {
            plus.nativeUI.actionSheet({
                cancel: "取消",
                buttons: [{
                    title: "注销当前账号"
                }, {
                    title: "直接关闭应用"
                }]
            }, function(e) {
                var index = e.index;
                switch (index) { //case 0: 取消
                    case 1: //
                        localStorage.clear();
                        plus.runtime.restart();
                        break;
                    case 2: //
                        plus.runtime.quit();
                        break;
                }
            });
        }; 
    </script>
</html>