sys 3 жил өмнө
parent
commit
df8ef39aac

+ 9 - 4
components/en-list/en-list.vue

@@ -2,8 +2,9 @@
   <view class="list">
     <Blank v-if="list.length<0"></Blank>
     <view class="scroll-view" v-else>
-      <scroll-view class="scroll-list" scroll-y="true" style="height: 100%;" @scrolltolower="onReachScollBottom" :scroll-top="scrollTop"  @scroll="scroll">
-        <slot name="listInfo" v-bind:pagingData="list"  ></slot>
+      <scroll-view class="scroll-list" scroll-y="true" style="height: 100%;" @scrolltolower="onReachScollBottom"
+                   :scroll-top="scrollTop" @scroll="scroll">
+        <slot name="listInfo" v-bind:pagingData="list"></slot>
         <view class="toMore" v-show="isAjax">加载中-----</view>
       </scroll-view>
     </view>
@@ -29,7 +30,7 @@ export default {
     this.getList()
   },
   methods: {
-    scroll: function(e) {
+    scroll: function (e) {
       this.scrollTop = e.detail.scrollTop
     },
     onReachScollBottom() {
@@ -40,11 +41,12 @@ export default {
     },
     getList() {
       this.isAjax = true
-      this.$emit('getList',this.page)
+      this.$emit('getList', this.page)
     },
     startList() {
       this.list = []
       this.page = 1
+      this.scrollTop = 0
       this.isAjax = false
     },
     setList(list, total) {
@@ -63,14 +65,17 @@ export default {
 <style scoped lang="scss">
 .list {
   height: 100%;
+
   .scroll-view {
     flex: 1;
     overflow: auto;
+
     .scroll-list {
       width: 100%;
       max-height: 100vh;
     }
   }
+
   .toMore {
     color: #999;
     font-size: 20rpx;