| | |
| | | }, |
| | | // 获取聊天数据 |
| | | _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, |
| | |
| | | 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){ |
| | |
| | | |
| | | 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) |
| | |
| | | } |
| | | |
| | | 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, |
| | |
| | | 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 |
| | | } |
| | | |
| | | }) |
| | | }, |
| | | // 地图定位 |