zengh
2022-09-14 8ea19a6bb34daab1410f6186992a4c1e90299c92
pages/groupChat/chating.vue
@@ -206,11 +206,10 @@
         },
         // 获取聊天数据
         _getMsg(page) {
            var that = this;
            that.senId = WxStorage.get("ids");
            uni.request({
               url:"http://s16s652780.51mypc.cn/api/chat-records/getSingleMessagePage",
               url:that.$store.state.piAPI + "/chat-records/getSingleMessagePage",
               method:"get",
               data:{
                  senderId: that.senId,
@@ -223,7 +222,7 @@
                  var resdata = res.data.data.user;
                  for (var i = 0; i < resdata.length; i++) {
                     if(resdata[i].avatar == null || resdata[i].avatar == ""){
                        resdata[i].avatar = "http://s16s652780.51mypc.cn/img/bg/img-logo.png";
                        resdata[i].avatar = "http://106.225.193.35:83/img/bg/img-logo.png";
                     }
                     
                     if(resdata[i].id == that.senId){
@@ -266,7 +265,10 @@
                  
                  that.$nextTick(() => {
                     that.isanimation = false
                     that.scrollToView = 'msg' + that.getData[0].id
                     if(that.getData.length != 0){
                        that.scrollToView = 'msg' + that.getData[0].id
                     }
                  })
                  // 数据加载完毕关闭动画,停止数据加载
                  clearInterval(this.loading)
@@ -330,7 +332,7 @@
            }
            
            uni.request({
               url:"http://s16s652780.51mypc.cn/api/chat-records/insertSingleChat",
               url:that.$store.state.piAPI + "/chat-records/insertSingleChat",
               method:"post",
               data:{
                  senderId: that.senId,
@@ -365,7 +367,10 @@
            this.scrollToView = ''
            this.$nextTick(() => {
               let len = this.getData.length -1
               this.scrollToView = 'msg' + this.getData[0].id
               if(this.getData.length != 0){
                  this.scrollToView = 'msg' + this.getData[0].id
               }
            })
         },
         // 地图定位