zs 1 年之前
父節點
當前提交
26a19de623
共有 1 個文件被更改,包括 6 次插入7 次删除
  1. 6 7
      pagesHome/customer/index.vue

+ 6 - 7
pagesHome/customer/index.vue

@@ -135,7 +135,7 @@
 					});
 				}
 				// 跳转到最后一条数据 与前面的:id进行对照
-				that.goBottom();
+				await that.goBottom(that.msgList[that.msgList.length - 1]);
 			},
 			// 进行图片的预览
 			previewImg(e) {
@@ -185,7 +185,7 @@
 						})
 					}
 					// 跳转到最后一条数据 与前面的:id进行对照
-					that.goBottom();
+					await that.goBottom(that.msgList[that.msgList.length - 1]);
 				} else {
 					uni.navigateTo({
 						url: `/pagesHome/login/index`
@@ -193,16 +193,15 @@
 				}
 			},
 			//输入框高度
-			heights(e) {
+			async heights(e) {
 				const that = this;
-				that.goBottom();
+				await that.goBottom(that.msgList[that.msgList.length - 1]);
 			},
 			// 滚动到底部
-			async goBottom() {
+			async goBottom(item) {
 				const that = this;
-				that.scrollToView = ""
 				that.$nextTick(function() {
-					that.scrollToView = 'msg123456789'
+					that.$set(that, `scrollToView`, `msg${item._id}`)
 				})
 			},
 			// 下拉刷新分页