-
+ -->
@@ -184,6 +184,7 @@
leftActiveIndex: 0,
msgCurrent: 1,
msgTotal: 0,
+ msgPages: 2,
msgList: [],
msgType: 0,
msgTypeList: [
@@ -193,7 +194,7 @@
{name: '文件', value: 'file'},
],
searchMsg: '',
- // id: 'LiuYe',
+ id: 'LiuYe',
id: ''
}
},
@@ -210,6 +211,17 @@
},
methods: {
+ msgScroll(e) {
+ if(e.target.scrollTop == 0) {
+ if(this.msgCurrent > this.msgPages) {
+ return this.$message('已加载完成,没有更多数据');
+ }else {
+ this.msgCurrent ++
+ this.getMsgList()
+ }
+ }
+
+ },
getListInit() {
this.isLoading = true
this.current = 1
@@ -240,9 +252,11 @@
getMsgListInit() {
this.isLoading = true
this.msgCurrent = 1
+ this.msgPages = 2
this.getMsgList()
},
getMsgList() {
+ var preveHeight = document.querySelector('.content-right-info').scrollHeight
this.instance.post(`/app/appsessionarchiveinfo/list`, null, {
params: {
userId: this.id,
@@ -264,26 +278,20 @@
if(item.msgType == 'file') {
item.files = [{url: item.sdkFileUrl, accessUrl: item.sdkFileUrl, name: item.sdkFileName, fileSizeStr: item.fileSizeStr}]
}
-
if(item.msgType == 'location') {
- // const {AMap, map} = this
- // item.map = null
- // this.$load(item.map).then(() => {
- // // const marker = new AMap.Marker({
- // // position: new AMap.LngLat(item.lng, item.lat),
- // // title: item.address
- // // })
- // // item.map.add(marker)
- // item.map.setZoomAndCenter(item.zoom, [item.lng, item.lat], false, 600)
- // // item.map.setFitView()
- // })
this.initMap(item.lng, item.lat, item.zoom, index)
}
})
- this.msgList = res.data.records
- this.msgTotal = res.data.total || 0
+ this.msgList = this.msgCurrent > 1 ? [ ...res.data.records, ...this.msgList]: res.data.records
+ this.msgPages = res.data.pages || 2
this.$nextTick(() => {
- document.querySelector('.content-right-info').scrollTo(0, 999999999)
+ if(this.msgCurrent == 1) {
+ document.querySelector('.content-right-info').scrollTo(0, 999999999)
+ }else {
+ var height = document.querySelector('.content-right-info').scrollHeight - preveHeight
+ document.querySelector('.content-right-info').scrollTop = height
+ }
+
})
}
this.isLoading = false
@@ -314,7 +322,6 @@
this.getMsgListInit()
},
currentChange(e) {
- console.log(e)
this.current = e
this.getList()
},