cs_win.html 3.4 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/index.css">
    <link rel="stylesheet" href="../../assets/css/doc.css">
    <link rel="stylesheet" href="../../assets/icon/iconfont.css">
</head>
<body>
<div id="app" v-cloak>
    <header id="header">
    </header>
</div>
</body>
</html>
<script type="text/javascript" src="../../assets/js/api.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/vue.min.js"></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: {
            rongYunToken: '',
            userId: '',
            user_type:[]
        },
        created: function () {
            apiready = function () {
                app.getRongYunToken();
                app.getUserIndexInfo();
                api.openFrame({
                    name: 'cs',
                    url: '../../assets/sobot/dist/cs.html',
                    rect: {
                        x: 0,
                        y: 0,
                        w: 'auto',
                        h: 'auto'
                    },
                    pageParam: {
                        rongYunToken: app.rongYunToken,
                        // rongYunToken: '122344545',
                        userId: app.userId,
                        user_type:app.user_type
                    }
                });

            }
        },
        methods: {
            // 获取客服token
            getRongYunToken: function () {
                var header = {
                    "XX-Device-Type": getDevice(),
                    'XX-Token': getToken()
                };
                getRequest('post', 'portal/RongYun/index', null, header).then(function (res) {
                    if (res.data.code == 1) {
                        app.rongYunToken = res.data.data.token;
                        app.userId = res.data.data.userId;
                        // app.rongyunInit();
                    } else {
                        toastMsg(res.data.msg)
                    }
                })
            },
            getUserIndexInfo: function () {
                var header = {
                    "XX-Device-Type": getDevice(),
                    'XX-Token': getToken()
                };
                getRequest('post', 'user/index/getUserIndexInfo', null, header).then(function (res) {
                    // alert(JSON.stringify(res));
                    if (res.data.code == 1) {
                        app.user_type = res.data.data;
                    } else {
                    }
                    loadEnd()
                });
            }
        }
    })
</script>