vue.js客服系统实时聊天项目开发(九)热门常问关键词展示

在聊天输入框的上方,一般会展示一些常问的关键词,访客点击以后直接回复设置的回答

展示效果如下图所示:

 

 

 

直接通过接口获取数据,循环展示数据就可以了

复制代码
            //获取常问关键词
            getTopRequest(){
                var _this=this;
                let entId=tools.getQuery("ent_id");
                this.visitor.ent_id=entId;
                this.$axios.get(this.ApiHost+'/other/getTopQuestion?ent_id='+entId).then(function (response) {
                    let result=response.data.result;
                    if(result.hotQuestion){
                        let hotQuestion=result.hotQuestion.replace("",",").split(",");
                        _this.question.hotQuestion=hotQuestion;
                    }

                    console.log(hotQuestion);
                }).catch(function (error) {
                });
            },
复制代码

模板中循环数组

            <div class="hotQuestions" v-if="question.hotQuestion.length!=0">
                <a class="slideInRightItem"  v-for="row in question.hotQuestion">{{row}}</a>
            </div>

 

唯一在线客服系统

https://gofly.v1kf.com

posted @   唯一客服系统开发笔记  阅读(116)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库
· SQL Server 2025 AI相关能力初探
· 为什么 退出登录 或 修改密码 无法使 token 失效
历史上的今天:
2019-01-29 [Go] go get获取官方库被墙解决
2018-01-29 [PHP] 超全局变量$_FILES上传文件
点击右上角即可分享
微信分享提示
1
chat with us