zs hace 1 año
padre
commit
1627330fcf

+ 7 - 5
pages/customer/index.vue

@@ -11,7 +11,8 @@
 							{{item.time}}
 						</view>
 						<view class="msg-m msg-left" v-if="item.speaker !=  user._id">
-							<image class="user-img" :src="config.logo_url&&config.logo_url.length>0?config.logo_url[0].url:''">
+							<image class="user-img"
+								:src="config.logo_url&&config.logo_url.length>0?config.logo_url[0].url:''">
 							</image>
 							<!-- 文字 -->
 							<view class="message" v-if="item.msg_type =='0'">                           
@@ -35,7 +36,7 @@
 							</view>
 						</view>
 					</view>
-					<view class="problem" v-if="problemList.length>0">
+					<view class="problem" v-if="problemList.length>0" id="msg123456789">
 						<view class="list" v-for="(item,index) in problemList" :key="index" @tap="toProblem(item)">
 							<text>{{item.question}}</text>
 							<text class="iconfont icon-dayuhao"></text>
@@ -151,6 +152,8 @@
 						title: arr.errmsg,
 					});
 				}
+				// 跳转到最后一条数据 与前面的:id进行对照
+				that.goBottom();
 			},
 			// 进行图片的预览
 			previewImg(e) {
@@ -237,10 +240,9 @@
 			// 滚动到底部
 			async goBottom() {
 				const that = this;
-				that.scrollToView = '';
-				let lastItem = that.msgList.at(-1);
+				that.scrollToView = ""
 				that.$nextTick(function() {
-					that.scrollToView = 'msg' + (lastItem._id)
+					that.scrollToView = 'msg123456789'
 				})
 			},
 			// 下拉刷新分页

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
unpackage/dist/dev/.sourcemap/mp-weixin/pages/customer/index.js.map


+ 7 - 6
unpackage/dist/dev/mp-weixin/pages/customer/index.js

@@ -336,7 +336,9 @@ var _default = {
                     title: arr.errmsg
                   });
                 }
-              case 12:
+                // 跳转到最后一条数据 与前面的:id进行对照
+                that.goBottom();
+              case 13:
               case "end":
                 return _context3.stop();
             }
@@ -463,18 +465,17 @@ var _default = {
     goBottom: function goBottom() {
       var _this4 = this;
       return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
-        var that, lastItem;
+        var that;
         return _regenerator.default.wrap(function _callee6$(_context6) {
           while (1) {
             switch (_context6.prev = _context6.next) {
               case 0:
                 that = _this4;
-                that.scrollToView = '';
-                lastItem = that.msgList.at(-1);
+                that.scrollToView = "";
                 that.$nextTick(function () {
-                  that.scrollToView = 'msg' + lastItem._id;
+                  that.scrollToView = 'msg123456789';
                 });
-              case 4:
+              case 3:
               case "end":
                 return _context6.stop();
             }

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/customer/index.wxml