my_set.html 8.2 KB
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <script src="../../assets/js/fontsize.js"></script>
    <link rel="stylesheet" href="../../assets/css/api.css"/>
    <link rel="stylesheet" href="../../assets/css/style.css">
    <link rel="stylesheet" href="../../assets/icon/iconfont.css">
    <title></title>
    <style>
        body, html {
            background-color: #f4f4f4;
            height: 100%;
            overflow: hidden;
        }

        .set_box {
            background-color: #fff;
            margin: 0.09rem 0 0 0;
        }

        .set_item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-size: 15px;
            color: #424242;
            border-bottom: 1px solid #F7f7f7;
            padding: 0.3rem 0.43rem;
        }

        .set_item:last-child {
            border: 0;
        }

        .set_item .iconfont {
            color: #C0C0C0;
            font-size: 15px;
        }

        .set_item .work_time {
            font-size: 12px;
            color: #C0C0C0;
        }

        .fontBold {
            font-weight: 600;
        }
    </style>
</head>
<body>
<div id="app">
    <div class="set_box">
        <div class="set_item" @click="argeement">
            <span>慈界用户服务协议</span><span class="iconfont icon-xiangyou"></span>
        </div>
        <div class="set_item" @click="forget">
            <span>修改密码</span><span class="iconfont icon-xiangyou"></span>
        </div>
    </div>
    <div class="set_box">
        <div class="set_item" @click="clear_ache">
            <span>清除缓存</span>
            <div><span v-text="size+'M'"></span> <span class="iconfont icon-xiangyou"></span></div>
        </div>
        <div class="set_item" @click="about_us">
            <span>关于我们</span><span class="iconfont icon-xiangyou"></span>
        </div>
    </div>
    <div class="set_box">
        <div class="set_item" @click="callNumber">
            <span>联系客服</span><span class="iconfont icon-xiangyou"></span>
        </div>
        <div class="set_item" @click="sever">
            <span>在线客服</span>
            <div class="work_time"><span>工作时间: 周一至周日 9:00-17:00</span><span class="iconfont icon-xiangyou"></span></div>
        </div>
    </div>
    <!--<div class="set_box">-->
        <!--<div class="set_item" @click="provider">-->
            <!--<span>服务商入口</span><span class="iconfont icon-xiangyou"></span>-->
        <!--</div>-->
    <!--</div>-->
    <div class="save_btn" @click="login_out">退出登录</div>
</div>
</body>
</html>
<script type="text/javascript" src="../../assets/js/api.js"></script>
<script type="text/javascript" src="../../assets/js/vue.min.js"></script>
<script type="text/javascript" src="../../assets/js/index.js"></script>
<script type="text/javascript" src="../../assets/js/public.js"></script>
<script type="text/javascript" src="../../assets/js/fastclick.js"></script>
<script>
    new FastClick(document.body);
</script>
<script type="text/javascript" src="../../assets/js/axios.min.js"></script>
<script type="text/javascript" src="../../assets/icon/iconfont.js"></script>
<script>
    var app = new Vue({
        el: "#app",
        data: {
            isIos: false,
            size: 0,
            tel: '',
            user_info:[]
        },
        created: function () {
            apiready = function () {
                app.getCall();
                app.getUserIndexInfo();
                api.getCacheSize(function (ret) {
                    app.size = (ret.size / 1048576).toFixed(2);
                });
            }
        },
        methods: {
            // 获取客服电话
            getCall: function () {
                var header = {
                    "XX-Device-Type": getDevice(),
                    'XX-Token': getToken()
                };
                getRequest('post', 'home/site/getWebsiteTel', null, header).then(function (res) {
                    if (res.data.code == 1) {
                        app.tel = res.data.data.tel;
                    } else {
                        toastMsg(res.data.msg)
                    }
                })
            },
            // 去慈界用户服务协议
            argeement: function () {
                openView('agree_content', 'common/agree_content', '慈界用户服务协议', 'agree_content', false, {id: 3}, false)
            },
            // 修改密码
            forget: function () {
                openView('forgot_f', 'login/forgot_f', '修改密码')
            },
            // 清除缓存
            clear_ache: function () {
                api.clearCache(function () {
                    api.clearCache(function () {
                        app.size = 0;
                        toastMsg('清除完成')
                    });
                });
            },
            // 退出登录
            login_out: function () {
                $api.rmStorage('token');
                openView('login_index', 'login/login_index', '登录');
                window.location.reload()
            },
            // 关于我们
            about_us: function () {
                openView('my_about', 'my/my_about', '关于我们')
            },
            // 去医护端
            // provider: function () {
            //     api.openWin({
            //         name: 'doctor_win',
            //         url: '../doctor/doctor_win.html',
            //     });
            //     api.sendEvent({
            //         name: 'doctor_index0',
            //         extra: {
            //             index: 0
            //         }
            //     });
            // },
            // 拨打客服电话
            callNumber: function () {
                api.call({
                    type: 'tel_prompt',
                    number: app.tel
                });
            },
            // 获取个人的基本信息
            getUserIndexInfo: function () {
                var header = {
                    "XX-Device-Type": getDevice(),
                    'XX-Token': getToken()
                };
                getRequest('post', 'user/index/getUserIndexInfo', null, header).then(function (res) {
                    if (res.data.code == 1) {
                        app.user_info = res.data.data;
                    } else {
                        toastMsg(res.data.msg)
                    }
                })
            },
            // 打开客服
            sever: function () {
                    // app.getRongYunToken();
                    function callBack(ret, err) {
                        if (ret.type == 1) {
                            // api.closeFrame({}
                            // );
                        }
                    }
                    var param = {
                        appkey: "1da38c74bc3746cea6b767727683ca83",
                        titleImgId: '#dbb25f',
                        themeColor: '#dbb25f',
                        backgroundColor: '#f8f9f8',
                        userId: app.userId,
                        customBannerColor: '#dbb25f',
                        nickName: app.user_info.name,
                        avatarUrl: app.user_info.avatar,
                        transferKeyWord: '人工服务,人工,电话',
                        isShowEvaluate: true,
                        isSettingSkillSet: false,
                        skillSetId: "",
                        customUserOutWord: '欢迎再次咨询',
                        customAdminTipWord: '请稍等... 正在查询资料',
                        customAdminNonelineTitle: '人工客服忙~',
                        isShowTansfer: true,
                        titleFont: 18.0,
                        bottomLineColor: '#dbb25f',
                    };
                    var zhichi = api.require('zhiChiSobot');
                    zhichi.startZhiChiSobot(param, callBack);
                },
        }
    })
</script>