• nuxt3+ts:集成 百度-爱番番 客服


    一、本文目标

    nuxt3 + ts 集成百度爱番番(客服)

    百度爱番番—企业的一站式智能营销管家

    二、百度爱番番客服能力

    三、爱番番后台基础配置

    3.1、设置中心

    登录后点右上角设置中心

    3.2、沟通与触达 -- > 站点设置 -- > 新建站点

    填写信息

    3.3、获取代码

    有了这段代码就可以集成到项目里边了 

    四、代码集成 

    4.1、方式一

    public/js/baidu.js

    baidu.js

    1. var _hmt = _hmt || [];
    2. (function() {
    3. var hm = document.createElement("script");
    4. hm.src = "https://hm.baidu.com/hm.js?7xxxxxxxxxxxxxxxxxxxxxxxxxx8";
    5. var s = document.getElementsByTagName("script")[0];
    6. s.parentNode.insertBefore(hm, s);
    7. })();

    nuxt.config.ts

    1. app: {
    2. head: {
    3. script: [
    4. {
    5. {
    6. type: 'text/javascript',
    7. src: '/js/baidu.js'
    8. },
    9. }
    10. ]
    11. }
    12. }

    4.2、方式二(推荐)

    app.vue 使用 useHead 方法

    1. useHead({
    2. script: [
    3. {
    4. src: 'https://hm.baidu.com/hm.js?7cxxxxxxxxxxxx8'
    5. }
    6. ]
    7. })

     

     

     

    集成成功,测试成功。 

    五、去掉弹窗的“在线咨询”

    5.1、目标--去掉在线咨询

    在电脑下载的客户端--点设置按钮--样式设置-PC样式-邀请框右上的关闭哈

    5.2、下载客户端

    5.3、设置--样式设置--编辑

    5.4、邀请框--自动邀请--关闭

    测试成功,,咨询过客服,只能下载软件后设置,在pc端不可以。 

    六、点击页面dom元素,唤起客服

    开启咨询图标

    咨询了客服,没有对应的配置,那我们调一下爱番番默认样式,设置为透明,定位到指定位置即可

    1. // 爱番番在线咨询样式定位
    2. @media screen and (min-width: 987px) {
    3. #newBridge {
    4. .nb-icon-base{
    5. top: 340PX!important;
    6. height: 100PX!important;
    7. background: transparent!important;
    8. .nb-icon-inner-wrap{
    9. background: transparent!important;
    10. }
    11. }
    12. }
    13. }
    14. // 20231226 PC换成新的元素了
    15. .embed-icon{
    16. top: 340PX!important;
    17. height: 100PX!important;
    18. background: transparent!important;
    19. .embed-icon-default{
    20. top: 340PX!important;
    21. height: 100PX!important;
    22. background: transparent!important;
    23. }
    24. }
    25. // 移动端爱番番在线咨询样式定位
    26. @media screen and (max-width: 987px) {
    27. #newBridge {
    28. .nb-icon-wrap{
    29. left: 0!important;
    30. bottom: -33PX!important;
    31. top: unset!important;
    32. background: transparent!important;
    33. width: calc(50% - 30px)!important;
    34. }
    35. .nb-icon-wrap-base{
    36. background: transparent;
    37. display: none;
    38. }
    39. }
    40. }

    七、过程记录

    百度-爱番番 与 百度-统计

    百度-爱番番 与 百度统计 的集成是一致的,如果之前集成过百度统计,那么百度爱番番会自动集成,重启项目后自动出现百度爱番番客服。

    https://www.cnblogs.com/hity-tt/p/7699756.html

    八、欢迎交流指正

    九、参考链接

    百度爱番番—企业的一站式智能营销管家

  • 相关阅读:
    M4Singer Ubuntu 4060ti16G 笔记【2】
    信息共享的记忆被囊群算法-附代码
    安卓 view淡入淡出(fade in fade out) kotlin
    SpringCloud 04 Eureka 服务注册和发现
    【Python爬虫】python打印本地代理
    Visual Leak Detector 2.5.1 (VLD)下载、安装与使用
    【数据结构】链表的十三种操作
    api安全测试的学习
    ARM按键中断控制事件
    Axios在vue项目中的封装
  • 原文地址:https://blog.csdn.net/snowball_li/article/details/133768482