在聊天输入框的上方,一般会展示一些常问的关键词,访客点击以后直接回复设置的回答
展示效果如下图所示:
直接通过接口获取数据,循环展示数据就可以了
- //获取常问关键词
- 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>
唯一在线客服系统