zoukankan      html  css  js  c++  java
  • 外贸业务国际站模拟人工回复消息,提升及时回复率

      朋友在A..L..B..B..某国际站做外贸业务,因为时差原因我们这里晚上休息时间正是国外客户工作时间。在这期间店铺内会有一些消息得不到及时回复,但是后台设置的机器人回复不会算在回复率以内于是想到了模拟实现人工回复功能。下面是具体操作方法和回复效果。

    使用方法:

    1、在chrome浏览器中打开阿里巴巴国际站登陆自己的账号

    2、右击聊天小窗口,选择“检查”,打开"Console"窗口

    3、设置回复内容:复制以下代码(双引号内是固定回复内容可改为自己需求的格式)到窗口中,点击回车键

    //设置回复内容,引号内可替换为自定义的内容
    this.msg = "It's night now. I will reply you soon tomorrow. Please do not reply this message.Thank you!";

    4、设置自动回复:复制以下代码到窗口中,点击回车键

    (function () {
        setInterval(function () {
            //检查是否有未读消息
            if (document.getElementsByClassName('recent-list-item recent-list-item-unread').length <= 0) return;
            //每步操作的间隔时间,如果不留间隔时间会影响执行效果
            var waitSec = 100;
            var sec = 1500;
    
    
            //打开消息窗口
            setTimeout(function () {
                if (document.getElementById('icbu-weblite-list').className.indexOf('expand') == -1) {
                    document.getElementsByClassName('next-icon next-icon-arrow-up-filling next-icon-xl fold-up')[0].click();
                }
            }, waitSec);
            waitSec += sec;
    
            //点击第一个待回复客户头像
            setTimeout(function () {
                document.getElementsByClassName('recent-list-item recent-list-item-unread')[0].click();
            }, waitSec);
            waitSec += sec;
    
            //客户发来的最近一条消息,todo:根据消息设置回复内容
            var questionMsg = document.getElementsByClassName('recent-list-item recent-list-item-select')[0].getElementsByClassName('latest-msg')[0].innerText;
            console.log(questionMsg);
    
            //获取对话框焦点
            setTimeout(function () {
                document.getElementsByClassName('send-textarea')[0].focus();
            }, waitSec);
            waitSec += sec;
    
            //输入回复内容
            setTimeout(function () {
                var replyMsg = 'ok';
                if (this.msg) {
                    replyMsg = this.msg;
                }
                document.getElementsByClassName('send-textarea')[0].value = replyMsg;
            }, waitSec);
            waitSec += sec;
    
            //发送消息
            setTimeout(function () {
                document.getElementsByClassName('next-btn next-btn-primary next-btn-medium send-tool-button')[0].click();
            }, waitSec);
            waitSec += sec;
    
            //关闭窗口
            setTimeout(function () {
                if (document.getElementById('icbu-weblite-list').className.indexOf('expand') > -1) {
                    document.getElementsByClassName('next-icon next-icon-close next-icon-xs fold-down')[0].click();
                }
            }, waitSec);
    
        }, 1000 * 60);
    })();

    5、关闭自动回复:关闭chrome浏览器后重新登陆

    注意点:
    1、推荐使用chrome浏览器
    2、建议夜间无人工客服期间使用本功能
    3、需要先登陆好账号
    4、后续会增加根据消息内容不同而设置不同回复内容的功能;如果有其它疑问或其它平台想实现类似功能或其它需求请关注公众号【cyun笔记】留言

  • 相关阅读:
    STL
    Makefile
    配置pyqt5环境 for python3.4 on Linux Mint 17.1
    SELinux Policy Macros
    python爬虫
    python常用模块
    python中if __name__ == '__main__':
    Centos 7 .Net core后台守护进程Supervisor配置
    阅读Google Protocol Buffers 指南,整理pb语法
    Google Protocol Buffers 入门
  • 原文地址:https://www.cnblogs.com/cy2011/p/14776947.html
Copyright © 2011-2022 走看看