zoukankan      html  css  js  c++  java
  • 联系customer的js

    import api from '@/js/api';
    export var conService = function getInfoSend() {
        var loginState = localStorage.getItem('login');
        if (loginState != null && loginState == 'logining') {
            //获取登录者信息
            api.get('/acl/user/info', null, response => {
              var nowhref = window.location.href;
              nowhref = nowhref.replace(/#/g, "%23");
              var ostr = '{"天注定后台用户信息直达:":"http://www.tzding.com/tzd/backend/index.html#/user/edit/' + response.data.id + '"}';
              ostr = ostr.replace(/#/g, "%23");
              var url = 'https://www.sobot.com/chat/pc/index.html?sysNum=f18ce7f1ad3a497eadf1973f69024f46&partnerId=' + response.data.id + '&uname=' + response.data.name + '&visitUrl=' + nowhref + '&params=' + ostr + '';
              var name = '客服页面';
              var iWidth = 420;
              var iHeight = 600;
              //获得窗口的垂直位置 
              var iTop = (window.screen.availHeight - iHeight - 100);
              //获得窗口的水平位置 
              var iLeft = (window.screen.availWidth - iWidth - 100);
              window.open(url, name, 'height=' + iHeight + ',,innerHeight=' + iHeight + ',width=' + iWidth + ',innerWidth=' + iWidth + ',top=' + iTop + ',left=' + iLeft + ',status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=0,titlebar=no');
              return;
            }, error => {
              console.log(error);
            });
        }
        var url = 'https://www.sobot.com/chat/pc/index.html?sysNum=f18ce7f1ad3a497eadf1973f69024f46';
        var name = '客服页面';
        var iWidth = 420;
        var iHeight = 600;
        //获得窗口的垂直位置 
        var iTop = (window.screen.availHeight - iHeight - 100);
        //获得窗口的水平位置 
        var iLeft = (window.screen.availWidth - iWidth - 100);
        window.open(url, name, 'height=' + iHeight + ',,innerHeight=' + iHeight + ',width=' + iWidth + ',innerWidth=' + iWidth + ',top=' + iTop + ',left=' + iLeft + ',status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=0,titlebar=no');
    }

    将上述文件放在js文件里

    在使用的页面引入(vue)

    import {conService} from '../../js/contactService.js';
    调用
    this.conService();
  • 相关阅读:
    01 drf源码剖析之restful规范
    08 Flask源码剖析之flask拓展点
    07 flask源码剖析之用户请求过来流程
    06 flask源码剖析之路由加载
    05 flask源码剖析之配置加载
    04 flask源码剖析之LocalStack和Local对象实现栈的管理
    03 flask源码剖析之threading.local和高级
    02 flask源码剖析之flask快速使用
    01 flask源码剖析之werkzurg 了解wsgi
    MVC之Filter
  • 原文地址:https://www.cnblogs.com/fqh123/p/10144419.html
Copyright © 2011-2022 走看看