优化加载更多

pull/23/head
taoshihan1991 4 years ago
parent db909c6e11
commit c52d50a191

@ -27,16 +27,7 @@
:closable="false"
type="success">
</el-alert>
<el-alert
style="margin:10px auto;width: 100%;"
center
:title="flyLang['moremessage']"
close-text="more"
@close="getMesssagesByVisitorId(true)"
v-show="msgList.length>10"
show-icon
type="info">
</el-alert>
<div class="el-alert el-alert--info is-center is-light el-alert__title" v-show="msgListNum>10" v-on:click="getMesssagesByVisitorId(true)"><i class="el-icon-info" ></i>&nbsp;<{flyLang['moremessage']}></div>
<el-row :gutter="2" v-for="v in msgList" v-bind:class="{'chatBoxMe': v.is_kefu==true}">
<div class="chatTime" v-bind:class="{'chatTimeHide': v.show_time==false}"><{v.time}></div>
<el-col :span="3"><el-avatar shape="square" :size="36" :src="v.avator"></el-avatar></el-col>

@ -5,7 +5,7 @@ var GOFLY_LANG={
"connectok":"连接成功!",
"chating":"正在与您沟通!",
"historymes":"—— 以上是历史消息 ——",
"moremessage":"点击more加载更多记录",
"moremessage":" 点击加载更多记录",
"copyright":"GO-FLY1.0.0客服陶士涵提供技术支持",
"textarea":"请输入内容",
"closemes":"系统自动关闭连接!点击会重连",

@ -7,6 +7,7 @@ new Vue({
server:getWsBaseUrl()+"/ws_visitor",
socket:null,
msgList:[],
msgListNum:[],
messageContent:"",
chatTitle:GOFLY_LANG[LANG]['connecting'],
visitor:{},
@ -211,11 +212,13 @@ new Vue({
url:"/messages?visitorId="+this.visitor.visitor_id,
success: function(data) {
if(data.code==200 && data.result!=null&&data.result.length!=0){
_this.msgListNum=data.result.length;
let msgList=data.result;
_this.msgList=[];
if(!isAll&&msgList.length>10){
var i=msgList.length-10
}else{
_this.msgListNum=0;
var i=0;
}
for(;i<msgList.length;i++){

Loading…
Cancel
Save